Agent-based soil erosion monitoring event diagnosis closed-loop processing method and system

By using a multi-source information integrated diagnosis and automated closed-loop processing method for intelligent agents, the problems of low automation and insufficient diagnostic basis in the soil erosion monitoring platform are solved. This enables efficient event handling and state transition, generates an interpretable chain of evidence, and achieves deep integration between intelligent agents and the platform.

CN123179162APending Publication Date: 2026-11-27SUN YAT SEN UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611331304.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-31
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing soil and water conservation monitoring platforms suffer from low automation in incident handling, insufficient diagnostic evidence, high false alarm rate, lack of interpretable evidence chains, incomplete event status transitions, and disconnect between intelligent agents and platform business systems.

Method used

A closed-loop processing method for soil erosion monitoring event diagnosis based on intelligent agents is adopted. Through comprehensive diagnosis of multi-source information, an interpretable chain of evidence is generated, and the entire process of automated closed-loop processing is realized, including event reading, context acquisition, knowledge retrieval, report generation, and work order creation. The MCP tool service is used to realize the deep integration of intelligent agents and the platform.

Benefits of technology

It improves diagnostic accuracy and automation, reduces false alarm rates, ensures automatic event status transitions, generates clear chains of evidence for easy review and auditing, and resolves the disconnect between intelligent agents and the platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123179162A_ABST
    Figure CN123179162A_ABST
Patent Text Reader

Abstract

The application discloses an agent-based soil erosion monitoring event diagnosis closed-loop processing method and system, which comprises the following steps: S1, reading an interface to obtain a monitoring event to be diagnosed; S2, obtaining complete event context information, including monitoring data and environmental data; S3, an agent retrieves a field knowledge base according to the context information to obtain a diagnosis basis; S4, the agent generates a risk level, a diagnosis conclusion, an evidence chain and a disposal suggestion; S5, a structured diagnosis report is generated; S6, a patrol work order is automatically created according to a work order triggering condition; S7, the structured diagnosis report, the risk level, the diagnosis conclusion, the evidence chain and the disposal suggestion, work order information and an event state are written back to a monitoring platform. The application realizes multi-source information comprehensive diagnosis, full-process automatic closed-loop processing, evidence chain explainability and event state automatic flow transfer, and improves diagnosis accuracy and disposal efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence, environmental monitoring, intelligent agent tool invocation, and soil and water conservation supervision, specifically to a closed-loop processing method and system for soil erosion monitoring event diagnosis based on intelligent agents. Background Technology

[0002] Soil erosion is a significant issue in ecological environment governance and water resource protection. With the development of remote sensing monitoring, video surveillance, edge recognition models, and information platforms for soil and water conservation, an increasing number of soil erosion-related events can be detected through automated monitoring methods. For example, platforms can identify suspected muddy water phenomena through image recognition models, detect abnormal water body colors through monitoring equipment, or identify potential risk events through environmental data such as rainfall and water levels.

[0003] However, existing soil erosion monitoring platforms have the following technical shortcomings in the process of incident response: 1. Existing platforms typically rely solely on the output of a single image recognition model for event diagnosis. This makes it difficult to combine historical site information, rainfall data, domain rules, and historical handling cases for comprehensive multi-source information diagnosis, resulting in insufficient diagnostic basis and a high false alarm rate.

[0004] 2. The incident handling process relies on manual operation. Staff need to manually check incident details, review historical data, determine risk levels, write reports, and create inspection work orders. The automation level is low, the handling efficiency is low, and there is a high risk of untimely incident handling.

[0005] 3. The event results generated by the existing system lack an interpretable chain of evidence, making it difficult to explain the specific basis for determining an event as high-risk or requiring manual inspection, which is not conducive to manual review and regulatory audit.

[0006] 4. There is a lack of automated closed-loop connection between diagnostic results, report content, work order information and platform event status. Event status cannot be automatically transferred, which can easily lead to problems such as events remaining in the pending state for a long time, incomplete records and untraceable processes.

[0007] 5. The existing intelligent agent system lacks a standardized tool call interface with the monitoring platform. The intelligent agent cannot directly read platform event data, call the knowledge base, write back diagnostic results, and create work orders, resulting in the intelligent agent's capabilities being disconnected from the platform's business system.

[0008] With the development of large language models and agent tool invocation technology, agents can access external systems, retrieve knowledge bases, perform inference tasks, and write the results back to the business platform through tool invocation. MCP (ModelContext Protocol) provides a mechanism to encapsulate external system interfaces into standardized tools, enabling agents to interact with different business systems through a unified tool invocation interface. If MCP tool services, agent diagnostics, domain knowledge bases, ticketing systems, and platform status write-back mechanisms can be combined, it is expected to achieve automated closed-loop processing from event triggering to diagnosis, reporting, ticketing, and platform write-back.

[0009] Therefore, it is necessary to propose a method and system for the diagnosis, report generation and work order closed-loop processing of soil erosion monitoring events based on intelligent agents, in order to solve the technical problems of low automation, insufficient diagnostic basis, lack of interpretable evidence chain, reliance on manual work order creation, incomplete platform status write-back and separation between intelligent agents and platform business systems in the existing soil erosion monitoring event handling process. Summary of the Invention

[0010] To overcome the shortcomings of existing technologies, one of the objectives of this invention is to provide a closed-loop processing method for the diagnosis of soil erosion monitoring events based on intelligent agents. This method can achieve comprehensive diagnosis of multi-source information, improve diagnostic accuracy, realize fully automated closed-loop processing, improve handling efficiency, generate an interpretable chain of evidence, realize automatic event status transition, and achieve deep integration between intelligent agents and monitoring platforms.

[0011] To achieve one of the objectives of this invention, the following solution is adopted: The agent-based closed-loop processing method for soil erosion monitoring event diagnosis includes the following steps: S1. Obtain monitoring events with a status of pending diagnosis through the event reading interface of the monitoring platform as monitoring events to be diagnosed; S2. Based on the event identifier of the monitoring event to be diagnosed, obtain the complete event context information of the monitoring event to be diagnosed through the event context acquisition interface encapsulated in the tool service module. The complete event context information includes the monitoring data of the monitoring event to be diagnosed and the associated environmental data. S3. The agent generates search conditions based on the complete event context information, retrieves diagnostic basis information related to the event to be diagnosed and monitored in the domain knowledge base through the knowledge retrieval interface encapsulated by the tool service module, and inputs the retrieval results as diagnostic reference into the agent's reasoning process. S4. The intelligent agent generates the risk level, diagnostic conclusion, evidence chain, and handling suggestion of the monitoring event to be diagnosed based on the complete event context information and the diagnostic reference basis, wherein the evidence chain includes at least two evidence items, and each evidence item includes evidence source, evidence content, and evidence description; S5. Generate a structured diagnostic report based on the risk level, the diagnostic conclusion, the chain of evidence, and the treatment recommendations; S6. Determine whether an inspection work order needs to be created based on the preset work order triggering conditions. If the work order triggering conditions are met, create an inspection work order through the work order creation interface encapsulated by the tool service module and obtain the work order creation result. S7. Through the write-back interface encapsulated in the tool service module, the structured diagnostic report, the risk level, the diagnostic conclusion, the evidence chain, the handling suggestions, the work order information of the inspection work order, and the event processing status of the monitoring event to be diagnosed are written back to the monitoring platform. Based on the diagnostic process and the work order creation result, the event status of the monitoring event to be diagnosed is updated to diagnosed status, work order created status, no work order required status, or diagnostic abnormality status.

[0012] Furthermore, in step S2, the monitoring data includes one or more of the following: basic event data, monitoring site data, image recognition result data, and historical event data; The environmental data includes one or more of the following: rainfall data, water level data, meteorological data, topographic data, and surrounding disturbance data.

[0013] Furthermore, the tool service module encapsulates the interface of the monitoring platform and the retrieval interface of the domain knowledge base into standardized tools that the intelligent agent can call; The standardized tools include at least an event reading tool, a context acquisition tool, a knowledge retrieval tool, a result write-back tool, a work order creation tool, and a status update tool.

[0014] Furthermore, in step S3, the domain knowledge base stores soil and water loss diagnosis rules, historical treatment cases, risk classification standards, and treatment specifications; Retrieving diagnostic basis information related to the monitored event to be diagnosed from the domain knowledge base includes: A retrieval query is constructed based on the event type, site characteristics, identification tags, and environmental information of the monitoring event to be diagnosed; Retrieve matching rule documents, case documents, and specification documents from the domain knowledge base; rank the search results by relevance. The sorted knowledge fragments will be used as the diagnostic reference. The identification information of the search results is saved for evidence chain tracing.

[0015] Furthermore, in step S4, the risk level is determined by the intelligent agent based on the abnormal confidence level of the image recognition result, the rainfall before and after the event, the frequency of similar events in the history of the site, the strength of the matching rules in the knowledge base, and the necessity of handling similar historical cases. The risk level includes at least two levels, which are used to determine whether to trigger the creation of an inspection work order and the priority of incident handling.

[0016] Furthermore, in step S4, the sources of evidence items in the evidence chain include, but are not limited to, image recognition output, rainfall monitoring records, station historical event records, and knowledge base rule matching results; Each piece of evidence includes specific monitoring data or rule provisions, and the evidence description includes a description of how the evidence supports the risk assessment.

[0017] Furthermore, in step S5, the structured diagnostic report includes a natural language description section for user reading and a structured data section for machine parsing; The natural language description section includes an event summary, diagnostic conclusions, risk level, evidence details, and treatment recommendations; The structured data portion includes event identifiers, risk level codes, evidence lists, recommended action indicators, and diagnostic metadata.

[0018] Furthermore, in step S6, the work order triggering condition includes one or more of the following: The risk level reaches the preset threshold, the image recognition result is abnormal and the confidence level exceeds the set threshold, the environmental data exceeds the warning threshold, the frequency of historical events at the site exceeds the set number of times, the intelligent agent's diagnostic conclusion indicates that on-site verification is required, and there is key risk evidence in the chain of evidence. The inspection work order includes the work order number, associated event identifier, inspection location, inspection reason, risk level, verification content, handling suggestions, priority, and creation time.

[0019] Furthermore, the method also includes a diagnostic tracing step, specifically: The tool call records, knowledge retrieval records, diagnostic input data, diagnostic output data, report generation records, and write-back records of the intelligent agent are stored in a traceability database for subsequent auditing, review, and diagnostic quality assessment. The traceability database includes at least an event data table, a site data table, a knowledge document table, a diagnostic result table, and a work order data table, which are used to store event information, site information, knowledge entries, diagnostic results, and work order information, respectively.

[0020] The second objective of this invention is to provide a closed-loop processing system for the diagnosis of soil erosion monitoring events based on intelligent agents. This system can achieve comprehensive diagnosis of multi-source information, improve diagnostic accuracy, realize fully automated closed-loop processing, improve handling efficiency, generate an interpretable chain of evidence, realize automatic event status transition, and achieve deep integration between intelligent agents and monitoring platforms.

[0021] To achieve the second objective of this invention, the following solution is adopted: A closed-loop processing system for soil erosion monitoring event diagnosis based on intelligent agents, used to execute the closed-loop processing method for soil erosion monitoring event diagnosis as described in one of the objectives of this invention, comprising: The platform interface module is used to provide business interfaces for the soil and water loss monitoring platform. The business interfaces include event reading interface, event context acquisition interface, diagnostic result write-back interface, work order creation interface and event status update interface. The data storage module is used to store monitoring event data, site data, knowledge documents, diagnostic results, and work order data. The tool service module is used to encapsulate the interfaces of the platform interface module and the knowledge base retrieval interface into standardized tool interfaces that can be called by intelligent agents. The knowledge base module is used to store diagnostic rules, historical cases, risk classification standards, and treatment procedures in the field of soil and water conservation. The intelligent agent diagnostic module is used to obtain complete event context information and knowledge retrieval results of the monitoring event to be diagnosed by calling the standardized tool interface of the tool service module, and generate the risk level, diagnostic conclusion, evidence chain and treatment suggestion of the monitoring event to be diagnosed accordingly. The evidence chain includes at least two evidence items, and each evidence item includes evidence source, evidence content and evidence description. The report generation module is used to generate a structured diagnostic report based on the risk level, diagnostic conclusion, evidence chain, and treatment recommendations output by the intelligent agent diagnostic module. The work order processing module is used to determine whether to create an inspection work order based on the preset work order triggering conditions and the output results of the intelligent agent diagnosis module, and to create an inspection work order through the work order creation interface of the tool service module when the conditions are met. The platform write-back module is used to write back the structured diagnostic report, the risk level, the diagnostic conclusion, the evidence chain, the handling suggestions, the work order information, and the event handling status to the monitoring platform through the write-back interface of the tool service module, and update the event status of the monitoring event to be diagnosed according to the diagnostic process and the work order creation results.

[0022] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention improves diagnostic accuracy through multi-source information integrated diagnosis. By employing a multi-source information integrated diagnostic mechanism, this invention effectively overcomes the shortcomings of traditional schemes that rely on a single diagnostic basis, significantly improving diagnostic accuracy and reliability. Specifically, this invention acquires complete event context information including monitoring data and related environmental data, and combines this with the results of domain knowledge base retrieval. An intelligent agent then comprehensively generates a risk level, diagnostic conclusion, and an evidence chain containing at least two pieces of evidence, making the diagnostic basis more sufficient and comprehensive, effectively reducing the false alarm rate.

[0023] 2. This invention constructs an automated closed-loop processing flow to improve handling efficiency. This invention constructs a fully automated closed-loop processing chain from event reading, context acquisition, knowledge retrieval, intelligent diagnosis, report generation, work order creation to platform write-back. This completely changes the inefficient mode of traditional solutions that rely on manual viewing of event details, reviewing historical data, judging risk levels, writing reports, and creating inspection work orders. It significantly improves the automation level and workflow efficiency of soil erosion monitoring event handling, effectively avoiding event backlog and delays caused by untimely manual processing.

[0024] 3. This invention generates an interpretable chain of evidence, facilitating review and auditing. By generating an evidence chain containing at least two evidence items, each item including the source, content, and description of the evidence, this invention ensures that the agent's diagnostic conclusions are clear, complete, interpretable, and traceable. It clearly explains the specific basis for determining an event to be classified as having a specific risk level or requiring manual inspection, providing reliable evidence support for manual review, regulatory auditing, and subsequent decision-making.

[0025] 4. This invention achieves automated closed-loop connection, ensuring automatic event status transition. This invention achieves automated closed-loop connection between diagnostic results, report content, work order information, and platform event status. Through an automatic status transition mechanism, the event status is updated to "diagnosed," "work order created," "no work order required," or "diagnostic anomaly," ensuring that every event can be accurately tracked. This effectively avoids events remaining in a pending state for extended periods, guaranteeing the integrity of event handling records and the traceability of business processes.

[0026] 5. This invention provides a standardized tool invocation interface to achieve deep integration between the intelligent agent and the platform. Through a tool service module, this invention encapsulates the monitoring platform interface and knowledge retrieval interface into standardized tools that can be invoked by the intelligent agent. This enables the intelligent agent to complete operations such as event reading, context acquisition, knowledge retrieval, work order creation, and result writing back through a unified tool invocation method. This achieves deep integration and seamless collaboration between the intelligent agent and the monitoring platform, solving the technical problem of the disconnect between the intelligent agent's capabilities and the platform's business system in existing solutions. Attached Figure Description

[0027] Figure 1 This is a flowchart of the closed-loop processing method for water and soil erosion monitoring event diagnosis based on intelligent agents in an embodiment of the present invention; Figure 2 This is a schematic diagram of the closed-loop processing method for water and soil erosion monitoring event diagnosis based on intelligent agents in an embodiment of the present invention. Figure 3 This is a schematic diagram of the tool invocation process of the MCP tool service module in an embodiment of the present invention; Figure 4 This is a schematic diagram of the event state transition in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of the structured diagnostic report in an embodiment of the present invention; Figure 6 This is a block diagram of the closed-loop processing system for soil erosion monitoring event diagnosis based on intelligent agents, as described in an embodiment of the present invention. Detailed Implementation

[0028] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments. It should be noted that, without conflict, the various embodiments or technical features described below can be arbitrarily combined to form new embodiments.

[0029] Example 1 like Figure 1-5 As shown, this embodiment of the invention provides a closed-loop processing method for the diagnosis of soil erosion monitoring events based on intelligent agents, including the following steps: S1. Obtain monitoring events with a status of pending diagnosis through the event reading interface of the monitoring platform as monitoring events to be diagnosed; S2. Based on the event identifier of the monitoring event to be diagnosed, obtain the complete event context information of the monitoring event to be diagnosed through the event context acquisition interface encapsulated in the tool service module. The complete event context information includes the monitoring data of the monitoring event to be diagnosed and the associated environmental data. S3. The agent generates search conditions based on the complete event context information, retrieves diagnostic basis information related to the event to be diagnosed and monitored in the domain knowledge base through the knowledge retrieval interface encapsulated by the tool service module, and inputs the retrieval results as diagnostic reference into the agent's reasoning process. S4. The intelligent agent generates the risk level, diagnostic conclusion, evidence chain, and handling suggestion of the monitoring event to be diagnosed based on the complete event context information and the diagnostic reference basis, wherein the evidence chain includes at least two evidence items, and each evidence item includes evidence source, evidence content, and evidence description; S5. Generate a structured diagnostic report based on the risk level, the diagnostic conclusion, the chain of evidence, and the treatment recommendations; S6. Determine whether an inspection work order needs to be created based on the preset work order triggering conditions. If the work order triggering conditions are met, create an inspection work order through the work order creation interface encapsulated by the tool service module and obtain the work order creation result. S7. Through the write-back interface encapsulated in the tool service module, the structured diagnostic report, the risk level, the diagnostic conclusion, the evidence chain, the handling suggestions, the work order information of the inspection work order, and the event processing status of the monitoring event to be diagnosed are written back to the monitoring platform. Based on the diagnostic process and the work order creation result, the event status of the monitoring event to be diagnosed is updated to diagnosed status, work order created status, no work order required status, or diagnostic abnormality status.

[0030] The following is a more detailed description of the closed-loop processing method for soil erosion monitoring event diagnosis based on intelligent agents, according to an embodiment of the present invention.

[0031] In this embodiment, step S1 is the step of reading the event to be processed by the intelligent agent, and the specific content is as follows: The monitoring events to be diagnosed are read through the FastAPI interface of the soil and water loss monitoring platform. The events are then sorted according to their creation time, initial risk screening results, and site priority.

[0032] The soil and water loss monitoring platform identifies the event processing stage through the event status field. The complete event status flow path is: NEW (new) → PENDING_AGENT (pending agent processing) → DIAGNOSING (in diagnosis) → DIAGNOSED (diagnosed) / WORK_ORDER_CREATED (work order created) / NO_WORK_ORDER (no work order needed) / DIAGNOSIS_FAILED (diagnosis error) → CLOSED (closed). When a monitoring event requires diagnosis by an agent, the platform sets its event status to PENDING_AGENT. The agent or its MCP tool service queries the list of events with the PENDING_AGENT status through the platform interface.

[0033] The events to be diagnosed and monitored can originate from image recognition models, video monitoring equipment, edge computing devices, manual reporting modules, or platform rule engines. Event types include, but are not limited to: suspected muddy water events, abnormal water color events, high-risk events after heavy rain, and site anomaly alarm events.

[0034] The platform interface is implemented based on the FastAPI framework, providing an interface for reading events to be diagnosed (GET / api / events / pending). This interface supports the following filtering parameters: event status, event creation time range (start_time, end_time), station number (station_id), administrative region (region), event type (event_type), and risk preliminary result (risk_preliminary). The interface returns a list of events that meet the criteria, sorted by the specified field.

[0035] In this embodiment, step S2 is the step of obtaining complete event context information, the specific content of which is as follows: Based on the event identifier (event_id) of the monitoring event to be diagnosed read in step S1, the complete event context information is obtained through the event context acquisition tool (get_event_context) encapsulated by MCP Server.

[0036] The complete event context information includes the following five categories: Basic event information includes event number (event_id), event name, event type (event_type), event status (status), event occurrence time (occurred_time), event source (source), and event description (description). Monitoring station information includes station number (station_id), station name, geographical location (latitude and longitude coordinates), administrative region, river basin, monitoring equipment information, and historical risk level of the station. Image recognition result information includes: recognition model output label (model_label), suspected yellow mud water recognition result (is_yellow_water), recognition confidence (confidence), image address (image_url), video clip address (video_url), and model judgment description (model_note); Historical event information: This includes the number of historical events, historical risk level distribution, historical work order records, and historical handling results of the monitoring station within a preset time range (such as the past 30 days). Environmental auxiliary information includes rainfall, water level changes, weather conditions, topographic information, information on surrounding construction disturbances, and notes on manual inspections.

[0037] By acquiring the complete event context information mentioned above, the intelligent agent can avoid making judgments based solely on a single identification label, and instead combine multi-source information from the platform for comprehensive diagnosis, thereby improving the sufficiency of the diagnostic basis and the accuracy of the diagnostic results.

[0038] In this embodiment, step S3 is the step of retrieving knowledge from the knowledge base in the field of soil and water conservation, and the specific content is as follows: The agent constructs a retrieval query based on the complete event context information obtained in step S2, and retrieves diagnostic rules, historical cases, risk classification criteria, and handling specifications related to the event to be diagnosed and monitored from the knowledge base retrieval tool (search_erosion_knowledge) encapsulated in the MCP Server.

[0039] The knowledge base for the field of soil and water conservation is constructed using a knowledge base import script. This script converts data related to soil and water conservation into knowledge base documents. The data includes: rules for judging soil and water conservation (such as standards for judging soil and water conservation risks under different slopes and vegetation cover), causes and key points for identifying muddy water formation, rules for rainfall-induced soil and water conservation (such as erosion risk levels corresponding to different rainfall intensities), risk level classification standards, historical treatment cases, manual inspection specifications, treatment suggestion templates, and report templates.

[0040] The search process includes the following steps: S31. Construct a retrieval query statement based on the event context information. The query statement contains keywords such as event type, site information, identification tags, rainfall information, and historical event information. S32. Retrieve rule documents, case documents, and handling specifications related to the query statement from the knowledge base in the field of soil and water conservation; S33. Sort the search results according to the relevance score, which is calculated based on text similarity and keyword matching degree; S34. Select the top-ranked knowledge fragments (such as the first N document fragments) as diagnostic references and input them into the agent's reasoning process; S35. Retain the search result identifiers (document number, fragment number, relevance score) for subsequent evidence chain generation and diagnostic traceability.

[0041] In this embodiment, step S4 is the step of generating risk level, diagnostic conclusion, chain of evidence, and treatment recommendations, the specific content of which is as follows: Based on the complete event context information obtained in step S2 and the diagnostic reference information obtained in step S3, the intelligent agent generates the risk level, diagnostic conclusion, evidence chain, and treatment recommendations for the event to be diagnosed through the MCP tool invocation mechanism.

[0042] The agent obtains platform data and knowledge base content by calling the tool interface of the MCP tool service module, and performs inference according to preset diagnostic prompts or diagnostic procedures. The preset diagnostic prompts include event context information, knowledge base retrieval results, diagnostic task descriptions, and output format requirements.

[0043] The risk levels include three categories: low risk, medium risk, and high risk. Alternatively, they can be set to three categories: general, moderate, and severe, depending on specific business needs. The basis for generating the risk levels includes: Whether the image recognition result is suspected yellow mud water; whether the recognition confidence exceeds the preset threshold (e.g., 0.8); whether there is significant rainfall within the preset time range before and after the event (e.g., 24 hours); whether similar events have occurred multiple times at this site within the preset time range (e.g., in the last 30 days); whether the knowledge base rules indicate that such conditions are prone to inducing soil erosion; and whether there are situations in similar historical cases that require on-site verification or handling.

[0044] The chain of evidence includes at least two pieces of evidence. Each piece of evidence includes the source of the evidence, the content of the evidence, and a description of the evidence. A specific example is as follows: Evidence Item 1: The source of the evidence is the image recognition result. The content of the evidence is that the identification label is "suspected yellow muddy water" and the identification confidence level is 0.92 (exceeding the preset threshold of 0.8). The explanation of the evidence is that the result indicates that the color of the monitored water body is abnormal and there may be an increase in the sediment content. Evidence Item 2: The source of the evidence is rainfall information, and the content of the evidence is that the cumulative rainfall in the 12 hours before the event reached 35mm (exceeding the preset threshold of 25mm). The evidence explanation is that heavy rainfall may enhance slope runoff and induce soil erosion. Evidence Item 3: The source of the evidence is historical event records. The evidence content is that the site has experienced 4 similar events in the past 30 days (exceeding the preset threshold of 3 times). The evidence explanation is that the site has the characteristics of repeated soil erosion risk. Evidence Item 4: The source of the evidence is a knowledge base rule, and the content of the evidence is that the knowledge base records "there is a significant correlation between turbid runoff after heavy rainfall and slope erosion". The explanation of the evidence is that this rule supports the assessment of soil and water loss risk in this event.

[0045] The proposed measures include: whether manual on-site inspection is required, key areas to be inspected, recommended inspection items (such as checking for obvious erosion marks on the slope and checking for blockages in drainage facilities), whether continuous observation is required, whether to record it as a historical case, and whether to report it to the superior management department.

[0046] In this embodiment, step S5 is the step of generating a structured diagnostic report, the specific content of which is as follows: Based on the risk level, diagnostic conclusion, chain of evidence, and treatment recommendations generated in step S4, a structured diagnostic report is generated.

[0047] The structured diagnostic report includes a natural language report section and a machine-parseable structured field section.

[0048] The Natural Language Report section is preferably in Markdown format and includes the following modules: Event Overview: Event number, event type, time of occurrence, and source of the event; Site Information: Site number, site name, geographical location, and watershed; Diagnostic Conclusion: A description of the nature of the event; Risk Level: Low risk / Medium risk / High risk; Diagnostic Basis: An overview of the elements supporting the diagnostic conclusion; Chain of Evidence: A list of the source, content, and explanation of each piece of evidence; Handling Recommendations: Whether to conduct an inspection, inspection focus, and verification content; Work Order Recommendations: Whether to recommend creating a work order and the work order priority; Platform Write-back Status: The write-back results of the diagnostic results and work order information.

[0049] The machine can parse the structured fields, which are stored in JSON format. Specifically, the structured fields include: event ID (event_id), used to uniquely identify the current monitored event; risk level (risk_level), which can be high, medium, or low risk, for the business system to classify, filter, and statistically analyze events; diagnosis summary (diagnosis_summary), used to briefly describe the diagnostic conclusion; evidence item list (evidence_items), containing at least two evidence items, each including the source, content, and explanation of the evidence; suggestion, used to provide written handling opinions; whether to suggest creating a work order (need_work_order), with a value of yes or no; diagnosis time (diagnosis_time), recording the timestamp of the agent completing the diagnosis; and agent version information (agent_version), used to record the version number of the agent that performed the diagnosis, facilitating subsequent traceability and version management. In a specific example, the event number is "EVT-20260715-001", the risk level is "high risk", the diagnostic summary is "suspected rain-induced soil erosion and muddy water event", and the evidence list contains two evidence items: the evidence source of the first evidence item is "image recognition results", the evidence content is "identified as suspected muddy water, confidence level 0.92", and the evidence description is "monitoring water color is abnormal"; the evidence source of the second evidence item is "rainfall information", the evidence content is "rainfall 35mm in the 12 hours before the event", and the evidence description is "rainfall may induce slope erosion"; the handling suggestion is "suggest creating a field inspection work order", whether to suggest creating a work order is "yes", the diagnosis time is "2026-07-15T10:00:00", and the agent version is "v1.0.0".

[0050] By simultaneously generating natural language reports and machine-parseable structured fields, this invention caters to both human reading needs and platform automation requirements. The natural language reports facilitate reading and review by staff, while the machine-parseable fields facilitate automatic parsing and processing by the platform's business systems.

[0051] In this embodiment, step S6 is the step of creating an inspection work order, the specific content of which is as follows: The system determines whether an inspection work order needs to be created based on the preset work order creation rules. If the work order creation conditions are met, the inspection work order is created using the inspection work order creation tool (create_event_work_order) encapsulated in the MCP Server.

[0052] The work order creation rules include one or more of the following conditions: The risk level is medium or high; the image recognition result is suspected to be yellow mud water and the recognition confidence exceeds the preset threshold (e.g., 0.8); there was significant rainfall within a preset time range (e.g., 24 hours) before the event, and the rainfall exceeded the preset threshold (e.g., 25mm); the monitoring station has had multiple similar historical events within a preset time range (e.g., within the past 30 days) (e.g., more than 3 times); the intelligent agent's diagnostic conclusion is that manual on-site verification is required; and there is key evidence in the chain of evidence that is directly related to the risk of soil erosion.

[0053] When any one or more of the above work order creation conditions are met, the system calls the inspection work order creation interface (POST / api / events / work-order) to create an inspection work order. The created inspection work order includes the following fields: work order number (work_order_id), associated event number (event_id), inspection station (station_id), inspection reason (reason), risk level (risk_level), suggested check items (check_items), handling suggestion (suggestion), work order priority (e.g., high / medium / low), work order status (status, initially PENDING), and creation time (created_at).

[0054] Through this step, the diagnostic results of the intelligent agent can be directly transformed into platform business processing tasks, realizing the business connection from intelligent analysis to manual inspection, and avoiding the efficiency bottleneck of manually creating work orders.

[0055] In this embodiment, step S7 is the platform write-back step, the specific content of which is as follows: The diagnostic result write-back tool (submit_event_diagnosis) and event status update tool (update_event_status) encapsulated in MCP Server are used to write back the diagnostic results, report content, work order information and event processing status to the soil and water loss monitoring platform.

[0056] The write-back content includes: event number, risk level, diagnostic summary, chain of evidence, handling recommendations, full text of the Markdown diagnostic report, work order number, work order status, agent diagnostic time, agent version, and event handling status.

[0057] The event status is updated as follows based on the diagnostic results and work order creation results: If a work order is successfully created, the event status is updated to WORK_ORDER_CREATED (work order created); if the diagnosis is completed but no work order needs to be created, the event status is updated to DIAGNOSED (diagnosed) or NO_WORK_ORDER (no work order needed); if an exception occurs during the diagnosis process, the event status is updated to DIAGNOSIS_FAILED (diagnosis exception).

[0058] By writing back the status, the platform can continuously track the progress of event processing, preventing events from remaining in a pending state for a long time, and providing a data foundation for subsequent statistical analysis and process optimization.

[0059] The invention will now be described using a specific application scenario.

[0060] The soil and water conservation monitoring platform generated a suspected muddy water event at a river monitoring station using an image recognition model. The event status was set to PENDING_AGENT. The specific processing procedure is as follows: 1. The agent reads the event using the get_pending_events tool. The event information shows that the event number is EVT-20260715-001, the event type is suspected muddy water, the event status is PENDING_AGENT, and the event source is the image recognition model.

[0061] 2. The agent obtains the complete event context using the get_event_context tool. The context shows that the event originated from a river monitoring station (station number ST-032), the image recognition model output label is "suspected muddy water", the recognition confidence level is 0.92, the cumulative rainfall in the 12 hours before the event was 35mm, and similar events have occurred 4 times at this station in the past 30 days.

[0062] 3. The agent calls the `search_erosion_knowledge` tool to search the knowledge base and obtain rule documents and historical cases related to "heavy rainfall", "turbid runoff", and "slope erosion". The knowledge base rules state: "There is a significant correlation between turbid runoff after heavy rainfall and slope erosion"; historical cases show that 2 out of 3 cases under similar conditions require on-site intervention.

[0063] 4. After integrating the event context and knowledge base results, the agent generates a diagnostic conclusion: This event is likely a rainfall-induced soil erosion event involving muddy water, with a high risk level. The evidence chain includes four items: image recognition results (suspected muddy water, confidence level 0.92), rainfall information (35mm rainfall in 12 hours), historical event records (4 similar events in the past 30 days), and knowledge base rules (turbid runoff after heavy rainfall is related to slope erosion). The recommended action is to conduct manual on-site inspections, focusing on verifying slope erosion traces and the status of drainage facilities.

[0064] 5. The system generates a diagnostic report in Markdown format and a structured field report in JSON format. The report content includes an event overview, site information, diagnostic conclusions, risk level, chain of evidence, and handling recommendations.

[0065] 6. Due to the high risk level and the fulfillment of multiple work order creation conditions, the system invoked the create_event_work_order tool to create an inspection work order. The work order number is WO-20260715-001, the associated event number is EVT-20260715-001, the inspection site is ST-032, the inspection reason is a suspected soil erosion muddy water incident, the risk level is high, the work order has a high priority, and it is recommended to check the slope erosion traces and drainage facilities.

[0066] 7. The agent writes the diagnosis results, report content, work order number and event status back to the platform through the submit_event_diagnosis tool and the update_event_status tool, and the event status is updated to WORK_ORDER_CREATED.

[0067] This completes the entire closed loop from event triggering, agent diagnosis, report generation, work order creation to platform write-back, without any human intervention, and the diagnostic conclusions are supported by a complete chain of evidence.

[0068] In this embodiment, the present invention also includes a diagnostic result traceability mechanism. During the diagnostic process performed by the intelligent agent, the system stores the following information in the database: Intelligent agent tool call records: including tool name, call parameters, call time, and return results; Knowledge base retrieval results: including search query statements, a list of search result documents, and relevance score sorting; Diagnostic input information: including a complete snapshot of event context information; Diagnostic output information: including the complete content of risk level, diagnostic conclusion, evidence chain, and treatment recommendations; Report generation results: including the full text of the Markdown report and JSON structured fields; Platform write-back results: including write-back interface call status, write-back content, and event status update results.

[0069] Through the aforementioned traceability mechanism, the entire process of each diagnosis can be fully traced in the database, supporting subsequent audits, comparisons of expert results, assessments of diagnostic accuracy, and optimization of the diagnostic process.

[0070] In this embodiment, the FastAPI platform interface, SQLite data table design, MCPServer, intelligent agent tool call configuration, knowledge base import script, event diagnosis write-back interface, and inspection work order creation interface have been implemented. Verified capabilities include: reading events to be diagnosed, obtaining complete event context, retrieving the soil erosion knowledge base, generating risk levels, generating evidence chains, generating Markdown reports, creating inspection work orders, and updating platform event status.

[0071] The core algorithms involved in this invention, such as intelligent agent reasoning, multi-source data fusion, secondary verification of image recognition results, evidence chain generation, and knowledge retrieval ranking and reordering, are described below.

[0072] The intelligent agent reasoning algorithm of this invention adopts a three-layer progressive processing architecture of "perception-reasoning-decision," which consists of three independent algorithm modules: Perception Agent, Reasoning Agent, and Decision Agent. Intermediate results are transmitted between the modules through standardized data interfaces, forming a complete reasoning chain from raw multi-source data to the final action plan.

[0073] In this embodiment, the specific details of the perception algorithm (PerceptionAgent) are as follows: The perception algorithm is the first stage of the inference chain of this invention. Its core function is to transform the raw heterogeneous data from the soil and water loss monitoring platform into a structured feature vector, providing standardized input for the subsequent inference stage.

[0074] The input to the perception algorithm is the event context dictionary E_ctx, which is obtained from the platform interface through the get_event_context tool wrapped in the MCP Server and contains the following data sources: Basic event information: event number, event type, event status, occurrence time, and source; monitoring station information: station name, river, watershed, administrative town, water level fluctuation, and soil moisture content; image recognition results: erosion category code, confidence value, model name and version; rainfall data: 24-hour rainfall, 72-hour cumulative rainfall, and rainfall intensity level; historical event records: number of similar events within 30 days, frequency trend, and number of untreated events; equipment information: equipment model and last calibration date.

[0075] The output of the perceptron algorithm is a 15-dimensional structured feature vector P=[p1,p2,…,p 15 The dimensions are defined as follows: p1=site_name, representing the name of the monitoring site (string type).

[0076] p2=erosion_class represents the erosion category code, with values ​​ranging from {NM,SD,SEL,SL,SEH,SH}, corresponding to normal water body, sediment deposition, slight erosion, slight water stratification, severe erosion, and severe water stratification, respectively.

[0077] p3=confidence represents the confidence level of image recognition. It is a floating-point number with a value range of [0,1].

[0078] p4=rainfall_24h represents the 24-hour rainfall, a floating-point number in millimeters (mm).

[0079] p5=rainfall_72h represents the cumulative rainfall over 72 hours, a floating-point number in millimeters (mm).

[0080] p6=water_level_delta, representing the 24-hour water level fluctuation, a floating-point number, in meters (m).

[0081] p7=soil_moisture, representing soil moisture content, a floating-point number, in percentage (%).

[0082] p8=recent_event_count represents the number of similar events within 30 days, an integer.

[0083] p9=frequency_trend represents the frequency trend of the event, with values ​​of stable, increasing, or decreasing.

[0084] p 10 =days_since_calibration represents the number of days since the device was calibrated, an integer.

[0085] p 11=data_completeness represents the data completeness score. It is a floating-point number with a value range of [0,1]. The calculation method is: data_completeness=N_avail / N_total, where N_avail is the number of available data items and N_total is the total number of expected data items (in this embodiment, N_total=4, corresponding to the four key data items rainfall_24h, rainfall_72h, water_level_delta, and soil_moisture).

[0086] p 12 =rainfall_severity represents the severity level of rainfall, with values ​​of normal, heavy, or extreme. The determination rule is: if rainfall_24h ≥ 100mm, then it is extreme; if rainfall_24h ≥ 50mm, then it is heavy; otherwise, it is normal.

[0087] p 13 =confidence_level represents the confidence level, with values ​​of high, medium, low, or critical. The judgment rules are: confidence ≥ 0.85 → high, confidence ≥ 0.65 → medium, confidence ≥ 0.45 → low, confidence < 0.45 → critical.

[0088] p 14 =device_status indicates the device's operating status, with values ​​of either normal or warning. The determination rule is: if days_since_calibration > 180 days → warning, otherwise normal.

[0089] p 15 =anomalies represents a list of detected anomalies. Each element in the list contains three fields: anomaly type, anomaly details, and severity.

[0090] Furthermore, the perception algorithm includes an automatic anomaly detection sub-algorithm, which applies the following rules to detect anomalies from the feature vector: Low confidence anomaly: When confidence < 0.45, the anomaly type is recorded as "low_confidence", the details are "model confidence is below the 0.45 threshold", and the severity is critical.

[0091] Data missing warning: When data_completeness < 0.5, the warning type is recorded as "data_missing", the details are "data completeness less than 50%", and the severity is warning.

[0092] Equipment calibration overdue warning: When days_since_calibration > 180 days, record the warning type as "calibration_overdue", the details as "equipment overdue for calibration", and the severity as "warning".

[0093] Rainfall-Class Mismatch Warning: When rainfall_severity∈{heavy,extreme} and erosion_class=NM, the anomaly type is recorded as "rain_class_mismatch", the details are "the identification result is normal water body under heavy rainfall conditions, there may be image acquisition time deviation", and the severity is warning.

[0094] The above anomaly detection results will be displayed in the anomalies field (p 15 The results are passed to subsequent reasoning algorithms in the form of ( ), which are used to trigger manual review decisions and add prompts and explanations to the diagnostic conclusions.

[0095] In this embodiment, the specific details of the reasoning algorithm (ReasoningAgent) are as follows: The inference algorithm is the second stage of the inference chain of this invention. It receives the feature vector P output by the perception algorithm, obtains domain reference information by calling the knowledge base retrieval tool, and performs three sub-steps: risk scoring, comparative analysis, and diagnostic text generation, and finally outputs a structured diagnostic result.

[0096] Specifically, the risk scoring algorithm: The risk scoring algorithm uses a deterministic scoring formula to quantitatively assess the current event, avoiding reliance on the randomness inherent in the generation process of large language models. The total risk score R_total is defined as the sum of three components: R_total=R_base+R_env+R_history R_base is the basic risk score, which is determined by the erosion category output by the image recognition model. The mapping relationship is: NM→0, SD→1, SEL→2, SL→2, SEH→4, SH→4.

[0097] R_env is the environmental correction score, representing the amplification effect of current environmental conditions on the risk of soil erosion. Its calculation involves evaluating and accumulating each environmental factor individually. The scoring rules and basis for each factor are as follows: If rainfall_24h ≥ 100mm (extremely heavy rain), then R_env += 3; if rainfall_24h ≥ 50mm (heavy rain), then R_env += 2.

[0098] If rainfall_24h ≥ 25mm (heavy rain), then R_env += 1.

[0099] If rainfall_72h ≥ 200mm (72-hour cumulative effect), then R_env += 1.

[0100] If |water_level_delta|≥1.0m (water level fluctuates drastically), then R_env+=1.

[0101] If soil moisture ≥ 30% (soil is close to saturation), then R_env += 1.

[0102] If days_since_calibration > 180 days (equipment has exceeded its calibration period), then R_env += 1. The maximum value of R_env is 3.

[0103] R_history is the historical adjustment score, representing the amplification effect of the recurrence of similar events in the past on the current risk of this site. Its calculation rule is as follows: If the number of events within 30 days is ≥5, then R_history += 3; if the number of events within 30 days is ≥3, then R_history += 2; if the number of events within 30 days is ≥1, then R_history += 1; if the frequency trend is increasing and the number of events within 30 days is ≥2, then R_history += 1; if the number of unresolved events is ≥2, then R_history += 1. The upper limit of R_history is 3.

[0104] The risk level is mapped to five levels based on the value of R_total, with the following rules: R_total < 1.0 → Normal (no special action required); 1.0 ≤ R_total < 2.5 → Attention (regular inspections recommended); 2.5 ≤ R_total < 4.5 → Yellow alert (attention and increased inspections required); 4.5 ≤ R_total < 7.0 → Orange alert (on-site verification and temporary protective measures to be implemented within three days); R_total ≥ 7.0 → Red alert (immediate on-site response and reporting to higher authorities).

[0105] The thresholds and weightings of the above-mentioned correction factors can be parameterized according to specific watershed characteristics and historical statistical data. The adjusted parameters are stored in the configuration file to realize the configurability of the scoring rules.

[0106] Specifically, the comparative analysis algorithm: The purpose of comparative analysis algorithms is to compare the characteristics of the current event with historical cases retrieved from the knowledge base across multiple dimensions, thereby enhancing the interpretability of diagnostic conclusions. The comparison dimensions include: Rainfall intensity comparison: The 24-hour rainfall of this event is compared with the historical average rainfall in Xinyi area to determine whether the current rainfall conditions are extreme.

[0107] Model confidence comparison: The confidence of the current identification is compared with the average confidence of similar historical cases to determine the reliability level of the current identification result.

[0108] Event frequency comparison: Compare the number of events on the current site in the past 30 days with the average number of events per month on a normal site (about 1 time) to determine whether there is a continuous deterioration trend.

[0109] Data completeness comparison: The data completeness score of this event is compared with the ideal value (100%) to identify whether there is any missing data that may affect the accuracy of the diagnosis.

[0110] The comparative analysis algorithm outputs a comparison conclusion for each dimension, which includes three elements: the current value, the historical reference value, and the evaluation opinion.

[0111] Specifically, diagnosing text generation algorithms: The diagnostic text generation algorithm integrates risk scoring results and comparative analysis results to generate structured diagnostic text according to a preset template. The diagnostic text includes the following six parts: Event Overview: Event number, time of occurrence, station name, and river in question.

[0112] Model determination: Model name and version, erosion category determination result, and confidence level description.

[0113] Triggering condition analysis: Quantitative description of major environmental triggering factors (such as heavy rain and water level fluctuations).

[0114] Risk score display: R_base, R_env, R_history components and total score, and corresponding risk level.

[0115] Comparative Analysis Summary: Overview of the comparative conclusions for each dimension; Anomaly Detection: Anomalies detected by the perception algorithm and their potential impact on diagnostic conclusions.

[0116] In this embodiment, the specific details of the decision-making algorithm (DecisionAgent) are as follows: The decision-making algorithm is the third stage of the inference chain of this invention. It transforms the diagnostic results output by the inference algorithm into an executable action plan, including two sub-algorithms: work order decision and manual review decision.

[0117] Specifically, the work order decision algorithm: The work order decision algorithm determines whether to create an inspection work order, as well as the work order's priority and response time, based on the risk level. The decision rules are as follows: If the risk level is a red alert, a work order is created with an urgent priority and a response time of 24 hours; if the risk level is an orange alert, a work order is created with a high priority and a response time of 72 hours; if the risk level is a yellow alert, a work order is created with a medium priority and a response time of 7 days; if the risk level is a concern and the frequency trend is increasing, a work order is created with a low priority and a response time of 14 days; if the risk level is normal, no work order is created.

[0118] Specifically, the manual review decision-making algorithm: The manual review decision algorithm determines whether manual review is required based on the anomalies detected in the perception phase and the confidence score calculated in the inference phase. The decision rules are as follows: if the confidence level is critical (confidence < 0.45), manual review is required; if the number of anomalies is ≥ 2, manual review is required; if the inference confidence score Conf_diag < 0.4, manual review is required.

[0119] The output of the decision algorithm includes complete work order information (work order number, title, priority, deadline, inspection instructions, inspection sites) and an action list (each action includes priority, deadline, and specific action description).

[0120] In this embodiment, the specific details of the multi-source data fusion and feature weighting algorithm are as follows: This invention employs a multi-source data feature extraction and anomaly detection algorithm based on a weighted fusion strategy. The core idea of ​​this algorithm is to transform multiple heterogeneous data sources (including event information, image recognition results, rainfall data, historical event records, and equipment status information) from a soil and water conservation monitoring platform into standardized 15-dimensional structured feature vectors through a unified normalization strategy and weighted fusion mechanism, which can then be used by subsequent inference algorithms.

[0121] Specifically, the data source normalization strategy is as follows: For multi-source data with different dimensions and data types, this algorithm adopts the following normalization strategy for unified processing: Rainfall data: The original values ​​(in mm) are retained and mapped to severity level labels (normal / heavy / extreme) through threshold segmentation for subsequent risk scoring.

[0122] Confidence data: The original value (interval [0,1]) is retained and mapped to grade labels (high / medium / low / critical) through thresholds, which are used for subsequent credibility assessment and manual review decision-making.

[0123] Count data (number of events, number of unhandled events): The original integer value is retained and used for calculation of the historical correction score.

[0124] Categorical data (erosion category, frequency trend): Encoding is performed using a predefined encoding mapping table, and the encoding result is directly used as a feature value for subsequent calculations.

[0125] Date data (latest calibration date): Converted to the number of days from today (integer) for equipment status assessment.

[0126] Specifically, the confidence threshold system: The present invention adopts a three-level confidence threshold system to distinguish image recognition results with different reliability levels: High confidence threshold H_th=0.85: When the confidence is ≥H_th, the image recognition result is considered highly reliable and can be used as the main diagnostic basis.

[0127] Medium confidence threshold M_th=0.65: When the confidence is ≥M_th and <H_th, the result is considered to have reference value, but needs to be comprehensively judged in combination with other data sources.

[0128] Low confidence threshold L_th=0.45: When the confidence is <L_th, the result is considered to have insufficient reliability, and a manual review process needs to be triggered.

[0129] The above thresholds can be dynamically adjusted according to the statistical results of recognition accuracy of different river basins and different equipment models in actual deployment.

[0130] Specifically, the feature weighted fusion mechanism: In the weighted fusion of multi-source data, each data source is assigned a weight according to its relative importance in the diagnostic decision-making. The specific weight allocation is as follows: Rainfall data (weight 25%): includes two sub-items of 24-hour rainfall and 72-hour cumulative rainfall, and rainfall is the most important triggering factor for soil erosion; water level data (weight 25%): 24-hour water level variation range, reflecting the impact of hydrodynamic conditions on bank erosion; soil data (weight 25%): soil water content, reflecting soil anti-erodibility and infiltration capacity; equipment data (weight 25%): equipment calibration status, reflecting the reliability of the data source.

[0131] The calculation formula of the data completeness score C is: C=(S_avail / S_total)×100% Where S_avail is the number of data items actually available in the current event, and S_total is the expected total number of data items (S_total=4 in this embodiment). When C<75%, the system automatically adds a message indicating incomplete data to the diagnostic conclusion and suggests supplementing the missing data during on-site inspection.

[0132] In this embodiment, the specific content of the secondary verification algorithm for the image recognition result is as follows: The image recognition result secondary verification algorithm of this invention is a post-verification mechanism. Its design goal is to improve the overall accuracy and reliability of diagnosis by evaluating the credibility of the original recognition results and detecting anomalies through multi-dimensional cross-validation without replacing the original image recognition model. This algorithm is located after feature extraction in the perception algorithm and before diagnosis generation in the inference algorithm, forming a quality assurance layer in the inference chain.

[0133] Specifically, the multi-dimensional cross-validation rules are as follows: The secondary verification algorithm applies the following four cross-validation rules, each of which independently verifies the original recognition result from a different perspective: Rule 1 (Rainfall-Category Consistency Check): If the rainfall severity level is heavy or extreme, but the image recognition result determines the erosion category as NM (Normal Water Body), then it is considered a rainfall-category consistency anomaly. Possible reasons for this anomaly include: the image was acquired before the rainfall occurred, the camera's view was temporarily obstructed, or the image recognition model made a misjudgment.

[0134] Rule 2 (Confidence-Rainfall Joint Verification): If the image recognition confidence is lower than the low confidence threshold L_th (0.45), and there is currently no rainfall data to support the recognition result, it is judged as a low confidence recognition result, and it is recommended to trigger the manual review process.

[0135] Rule 3 (Historical Benchmark Verification): If the number of events at the current monitoring station in 30 days exceeds the normal benchmark value (approximately 1 time per month), and the current identification result is consistent with the historical high-frequency erosion type, then the station is considered to have a risk of continuous soil and water loss, and the credibility weight of the current identification result is increased accordingly.

[0136] Rule 4 (Equipment Status Verification): If the most recent calibration date of the monitored equipment is more than 180 days ago, an equipment uncertainty mark will be added to the current identification result, and the final diagnostic conclusion will indicate the possible impact of the equipment calibration status on the identification accuracy.

[0137] Specifically, the credibility of the reasoning is comprehensively assessed: After completing multi-dimensional cross-validation, the secondary verification algorithm outputs a comprehensive inference confidence score, Conf_diag ∈ [0,1]. This score differs from the confidence score of the original image recognition model; instead, it comprehensively evaluates the reliability of the diagnostic results from the perspective of the quality of the entire inference process. Conf_diag is a weighted synthesis of the following five sub-factors: Conf_diag=0.25×C_data+0.25×C_knowledge+0.25×C_model+0.15×C_anomaly+0.10×C_similarity The definitions and value assignments of each sub-factor are as follows: C_data: Data completeness factor, which takes the value of data_completeness output by the perception algorithm (range [0,1]), reflecting the completeness of the multi-source data on which this diagnosis depends.

[0138] C_knowledge: Knowledge hit rate factor, with a value of C_knowledge=min(N_hit / 5,1.0), where N_hit is the number of valid knowledge entries retrieved from the knowledge base, reflecting the sufficiency of knowledge support obtained in this diagnosis.

[0139] C_model: Model confidence factor, which is directly taken as the confidence value (range [0,1]) output by the image recognition model, reflecting the reliability of the original recognition result.

[0140] C_anomaly: Anomaly penalty factor, with values ​​of: C_anomaly=1-min(N_anomaly×0.15+N_warning×0.05,0.5) Where N_anomaly represents the number of serious anomalies detected by the perception algorithm, and N_warning represents the number of warnings, reflecting the negative impact of problems discovered during the reasoning process on credibility.

[0141] C_similarity: The best case similarity factor, which is the score of the entry with the highest overall similarity score in the knowledge retrieval results, reflecting the degree of matching between the current event and historical cases.

[0142] The grading criteria for the reasoning credibility score Conf_diag are as follows: Conf_diag≥0.7→High reliability, diagnostic results can be directly used for work order decisions.

[0143] 0.4≤Conf_diag<0.7→Medium confidence level; the diagnostic results can be used as a reference, but it is recommended to confirm them in conjunction with on-site inspections.

[0144] Conf_diag < 0.4 → Low confidence level, automatically marked as requiring manual review.

[0145] When Conf_diag < 0.4, the system automatically adds a manual review mark to the diagnostic conclusion and explains the specific reasons for the need for review.

[0146] In this embodiment, the specific details of the graph algorithm for generating the chain of evidence are as follows: The evidence chain generation algorithm of this invention employs a source reasoning method based on a "fact-rule" directed graph representation. This method represents each step of the diagnostic process as a node in a graph, with directed edges between nodes representing the deductive relationship from the previous fact or inference to the next conclusion, ultimately forming a complete reasoning path from the original observation data to the final diagnostic conclusion. The core advantage of this method lies in providing a complete, interpretable, and traceable reasoning basis for the agent's diagnostic conclusions.

[0147] Specifically, the definition of evidence nodes: Each node E_i in the evidence chain is defined as a triple E_i=(fact_i,inference_i,source_i), and the meanings of each field are as follows: fact_i (fact description): A statement of the specific observable facts upon which the current step is based, using natural language, such as "24-hour rainfall 72mm ≥ 50mm (heavy rain)" or "Image recognition result is severe erosion (SEH), confidence level 0.91".

[0148] inference_i (inference conclusion): An intermediate conclusion derived from the current facts and matching rules, using a concise quantitative expression, such as "R_env+2" or "base risk score R_base=4".

[0149] source_i (source reference): The knowledge base rule number or data source identifier on which the inference is based, such as "KB-RULE-003 rainfall correction rule" or "platform historical event database".

[0150] Specifically, the chain of evidence construction algorithm: The evidence chain construction algorithm includes the following five processing steps: Step 1 (Fact Collection): Extract all observable facts from the event context data and the feature vectors output by the perception algorithm, including image recognition categories and confidence levels, rainfall data, water level fluctuation data, soil moisture content data, historical event statistics, and equipment status data.

[0151] Step Two (Rule Matching): Match each collected fact with the diagnostic rule base in the knowledge base. Each diagnostic rule in the knowledge base adopts the production form of "condition → conclusion", for example: IF rainfall_24h≥50mmTHEN R_env+=2(source:KB-RULE-003)IF erosion_class=SEH THEN R_base=4(source:KB-RULE-001) The rule matching process checks whether each fact meets the antecedent conditions of the rule. If it does, the rule is triggered.

[0152] Step 3 (Evidence Generation): For each triggered rule, generate a corresponding evidence node E_i=(fact_i,inference_i,source_i), where fact_i is the specific factual description that triggered the rule, inference_i is the conclusion part of the rule, and source_i is the rule's number in the knowledge base.

[0153] Step 4 (Directed Graph Construction): Connect all generated evidence nodes sequentially according to the causal logic of the reasoning to construct a directed graph G=(V,E). The node set V={E1,E2,…,E_n} in the graph represents a piece of evidence; each edge (E_i,E_{i+1}) in the directed edge set E represents further reasoning from the inference conclusion of E_i to E_{i+1}. The graph's topology reflects the complete reasoning chain from basic facts to the final conclusion.

[0154] Step 5 (Path Extraction): Extract the complete reasoning path from the constructed directed graph, from the starting node (usually the fact node corresponding to the image recognition result) to the ending node (usually the conclusion node corresponding to the final risk level determination). All nodes on this path are arranged in sequence, which constitutes the final output chain of evidence.

[0155] Specifically, the traceability of the chain of evidence is guaranteed: The `source_i` field of each evidence node records the rule number of the knowledge base upon which the inference is based. This number forms a one-to-one reference relationship with the rule documents stored in the knowledge base. Simultaneously, the system uniformly stores all tool call records (including tool name, call parameters, call time, and return result), knowledge base retrieval results (including search query statements, search result lists, and relevance scores), and diagnostic input / output information in the corresponding data tables of the SQLite database. Through this design, any diagnostic conclusion can be traced back from the final conclusion to the original observation data and the knowledge rules upon which each step of reasoning was based, achieving end-to-end traceability of the diagnostic process.

[0156] In this embodiment, the specific details of the knowledge retrieval relevance ranking and rearrangement algorithm are as follows: The knowledge retrieval algorithm of this invention adopts a three-level ranking strategy of "vector semantic retrieval → multi-dimensional feature rearrangement → similarity fusion ranking". This strategy first performs preliminary semantic retrieval through the TF-IDF vectorization model, then uses a multi-dimensional feature weighting algorithm to refine the preliminary results, and finally merges the rearranged results with other inference factors of the current event to form the final knowledge reference ranking output.

[0157] Specifically, the first-level retrieval is TF-IDF vector semantic retrieval: The primary retrieval uses the TF-IDF (Term Frequency-Inverse Document Frequency) vectorization model to perform semantic retrieval of text in the knowledge base. The specific implementation process is as follows: Knowledge base vectorization: For all n knowledge entries in the knowledge base (n=426 in this embodiment), extract the title, keywords, tags, and the first 500 characters of the main text for each entry, and concatenate them into the retrieval text. Use a TF-IDF vectorizer (maximum number of features m=5000, n-gram range (1,2)) to convert the retrieval text of all knowledge entries into m-dimensional TF-IDF vectors, and construct the knowledge base TF-IDF matrix M∈R^{n×m}.

[0158] Query vectorization: During retrieval, the query text Q is converted into a query vector q∈R^{1×m} through the same TF-IDF vectorizer.

[0159] Similarity calculation: Calculate the cosine similarity between the query vector q and the vector d_i of each knowledge entry in the knowledge base matrix M. Where ||·||2 represents the L2 norm of the vector. The cosine similarity ranges from [-1, 1], with a larger value indicating higher semantic relevance.

[0160] Preliminary sorting: All knowledge entries are sorted in descending order of cosine similarity, and the top-k entries with similarity greater than 0 (k=5 in this example) are selected as the preliminary results of the first-level search.

[0161] Specifically, the second-level rearrangement employs a multi-dimensional feature weighting algorithm: Based on the initial top-k results obtained from the first-level retrieval, this algorithm further applies a multi-dimensional feature weighting algorithm for refined re-ranking. The re-ranking algorithm evaluates the matching degree between each knowledge entry and the current event from four dimensions, and then weights and synthesizes a comprehensive similarity score S_overall. S_overall=0.30×S_erosion+0.25×S_site+0.25×S_semantic+0.20×S_base The definitions and calculation methods for each dimension are as follows: S_erosion (Erosion Category Matching, Weight 30%): Measures the consistency between the title or content of a knowledge entry and the erosion category of the current event. If the knowledge entry explicitly contains the erosion category code of the current event (such as "SEH"), then S_erosion = 1.0; if it contains generalized keywords such as "erosion", "soil erosion", and "silt", then S_erosion = 0.5; if it does not contain relevant keywords, then S_erosion = 0.2.

[0162] S_site (Site / River Match, Weight 25%): Measures the spatial relevance of a knowledge item to the site or river involved in the current event. If the knowledge item contains the name of the current site (e.g., "Gaodong Bridge"), then S_site = 1.0; if it contains the name of the current river (e.g., "Jianjiang River"), then S_site = 0.5; otherwise, S_site = 0.0.

[0163] S_semantic (semantic similarity, weight 25%): Directly takes the TF-IDF cosine similarity value from the first-level search. If the value is <0.5, it is multiplied by a stretching factor of 2 to moderately amplify it, thereby enhancing the distinguishability between low-similarity items; if the value is ≥0.5, the original value is retained.

[0164] S_base (baseline matching score, weight 20%): A fixed value S_base=0.20, which provides a baseline score for each retrieved knowledge item, ensuring that the item still has some reference value even if the scores of other dimensions are low.

[0165] The reordering algorithm calculates the S_overall value for each result from the first-level retrieval, and then rearranges them in descending order of S_overall to form the second-level ranking results. Each knowledge entry's output includes scores for each dimension, used for subsequent interpretability demonstrations.

[0166] Specifically, the three-level fusion sorting: The three-level fusion sorting integrates the knowledge entries from the two-level rearrangement with other reasoning factors of the current event to form the final knowledge reference list. Specifically, the system encapsulates each knowledge entry output from the two-level rearrangement into a structured reference object containing the following fields: kb_id: Unique ID of the knowledge entry; title: Title of the knowledge entry; overall: Overall similarity score S_overall; dimensions: Scores for each dimension (erosion_match, site_match, semantic).

[0167] This structured citation list also serves as the source information for "knowledge citation" type evidence in the evidence chain, ensuring that the knowledge citation nodes in the evidence chain contain complete retrieval and tracing information.

[0168] Specifically, the multi-dimensional retrieval query construction algorithm: For a single diagnostic event, this algorithm automatically constructs multi-dimensional search queries to retrieve information from the knowledge base from different perspectives, thus avoiding the omission of important knowledge due to a single query. The specific query dimensions constructed are as follows: Query 1 (Category + Site Dimension): "{erosion_class} {erosion_name} {site_name} Soil erosion".

[0169] Query 2 (Rainfall + Water Quality Dimension): "{rainfall_severity} Water quality exceeding the standard source {river}" (triggered when the rainfall severity is heavy or extreme).

[0170] Query 3 (Emergency Response Dimension): "{erosion_name} Emergency Response Inspection {basin}" (triggered when the erosion category is SEH or SH).

[0171] Query 4 (Trend Deterioration Dimension): "{site_name} Continuous Exceeding Standard Trend Deterioration Countermeasures" (triggered when the number of events within 30 days is ≥ 3).

[0172] Query 5 (Engineering Measures Dimension): "Slope Erosion Interception and Drainage Vegetation Restoration Engineering Measures" (triggered when the erosion category is SEH or SH).

[0173] Each retrieval retrieves the top-3 results. Results from multiple queries are deduplicated and merged before being input into the inference algorithm, ultimately retaining a maximum of 8 knowledge references. This multi-dimensional query strategy ensures comprehensive coverage of diagnostic information needs for events from five different perspectives: category, space, emergency, trend, and engineering.

[0174] Specifically, the degradation strategy for knowledge retrieval: When the TF-IDF vector index is unavailable (e.g., the index file is missing, corrupted, or version incompatible), the system automatically downgrades to LIKE keyword matching mode to ensure the continued availability of knowledge retrieval functionality. In LIKE mode, the retrieval process is as follows: The query statement is split into a keyword list by spaces and common delimiters; LIKE matching is performed on the four fields title, keywords, tags, and content of the knowledge entry table one by one; the matching score is calculated by weighting the number of hits and the position of the hit (the title hit has a higher weight than the body text hit); the results are output in descending order of matching score.

[0175] The degradation strategy ensures that the system can still provide basic knowledge retrieval capabilities when the vector index is abnormal, and that the entire diagnostic process is not interrupted due to the failure of a single component.

[0176] In summary, this invention, through the collaborative work of the five core algorithm modules mentioned above, constructs a complete technical implementation path from multi-source data perception, intelligent reasoning diagnosis, secondary quality verification, evidence chain tracing to precise knowledge retrieval. Compared with existing diagnostic schemes that rely on the output of a single image recognition model, this invention achieves significant improvements in the multi-source nature of diagnostic evidence, the certainty of the reasoning process, the credibility assessment of diagnostic conclusions, the interpretability of the reasoning path, and the accuracy of knowledge references, demonstrating strong practical value and innovative significance.

[0177] The agent-based closed-loop processing method for soil erosion monitoring event diagnosis according to embodiments of the present invention has completed the phased implementation from proof of concept to platform closed-loop verification. Compared with the prior art, the present invention has the following technical effects:

[0178] 1. This invention achieves standardized integration between intelligent agents and monitoring platforms through the MCP Server tool encapsulation mechanism. By encapsulating the monitoring platform's interfaces and knowledge base retrieval capabilities into standardized tools via MCP Server, this invention enables intelligent agents to directly read platform event data, access the knowledge base, write back diagnostic results, and create work orders through a unified tool invocation method. This achieves deep integration between intelligent agents and the monitoring platform, effectively solving the technical problem of the disconnect between intelligent agent capabilities and platform business systems in existing solutions.

[0179] 2. This invention improves the sufficiency of diagnostic evidence by replacing judgment based on a single recognition result with comprehensive diagnosis using multi-source information. This invention acquires complete event context information, including basic event information, monitoring station information, image recognition result information, historical event information, and environmental auxiliary information. Combined with diagnostic rules, historical cases, and handling specifications retrieved from the domain knowledge base, the intelligent agent performs a comprehensive diagnosis. This overcomes the shortcomings of traditional solutions that rely solely on the output of a single image recognition model, resulting in insufficient diagnostic evidence and effectively reducing the false alarm rate.

[0180] 3. This invention improves the interpretability of the diagnostic process through a structured evidence chain generation mechanism. By generating an evidence chain containing at least two evidence items, each item including the source, content, and explanation of the evidence, this invention enables the agent's diagnostic conclusions to have complete interpretability. It can clearly explain the specific basis for determining an event to be at a specific risk level or requiring manual inspection, overcoming the deficiency of existing systems in lacking interpretable evidence chains in diagnostic results, and facilitating manual review and regulatory auditing.

[0181] 4. This invention achieves seamless business integration from intelligent diagnosis to manual inspection through rule-driven automated work order creation. Based on preset work order triggering conditions, this invention automatically determines whether an inspection work order needs to be created. When the risk level reaches a preset threshold, the image recognition result is abnormal, or the environmental data exceeds a warning threshold, an inspection work order is automatically created, containing the work order number, associated event identifier, inspection location, inspection reason, risk level, verification content, and handling suggestions. This directly transforms intelligent diagnostic results into platform business handling tasks, avoiding the efficiency bottleneck of manually creating work orders.

[0182] 5. This invention achieves a complete business loop through automatic event status transition. Through diagnostic result write-back interfaces and event status update interfaces, this invention writes diagnostic reports, diagnostic results, work order information, and event processing status back to the monitoring platform. Based on the diagnostic process and work order creation results, it automatically updates the event status to diagnosed, work order created, no work order required, or diagnostic anomaly status, thus achieving automatic event status transition. This prevents events from remaining in a pending state for extended periods, ensuring the integrity of event handling records and the traceability of business processes.

[0183] 6. This invention achieves traceability of diagnostic results through full-process data storage. It stores the agent's tool call records, knowledge retrieval records, diagnostic input data, diagnostic output data, report generation records, and platform write-back records in a traceability database. This allows for complete traceability of the entire diagnostic process in the database, supporting subsequent auditing and verification, comparison with human expert results, assessment of diagnostic accuracy, and optimization of the diagnostic process.

[0184] Example 2 like Figure 6 As shown, this embodiment of the invention also provides an agent-based closed-loop processing system for soil erosion monitoring event diagnosis, used to execute the agent-based closed-loop processing method for soil erosion monitoring event diagnosis as described in Embodiment 1, including: The platform interface module is used to provide business interfaces for the soil and water loss monitoring platform. The business interfaces include event reading interface, event context acquisition interface, diagnostic result write-back interface, work order creation interface, and event status update interface.

[0185] Specifically, the platform interface module provides the business interface for the soil and water conservation monitoring platform, and is implemented based on the FastAPI framework. The platform interface module includes: The pending event reading interface (GET / api / events / pending) is used to query the list of events with a status of PENDING_AGENT.

[0186] The event context retrieval interface (GET / api / events / {event_id} / context) is used to obtain the complete context information of an event.

[0187] The diagnostic result write-back interface (POST / api / events / {event_id} / diagnosis) is used to write back diagnostic results and reports.

[0188] The inspection work order creation interface (POST / api / events / {event_id} / work-order) is used to create inspection work orders.

[0189] The event status update interface (PATCH / api / events / {event_id} / status) is used to update the event handling status.

[0190] The data storage module is used to store monitoring event data, site data, knowledge documents, diagnostic results, and work order data.

[0191] Specifically, the data storage module stores monitoring events, site information, knowledge documents, diagnostic results, and work order information, and is implemented using an SQLite database. The SQLite database includes the following tables: The event table stores event ID (event_id), event type (event_type), event status (status), event occurrence time (occurred_time), event source (source), event description (description), and preliminary risk screening results (risk_preliminary).

[0192] The station table stores information such as station ID, station name, geographical location (latitude, longitude), administrative region, watershed, and monitoring equipment information (device_info).

[0193] The knowledge document table (knowledge_docs) stores document ID (doc_id), document title (title), document type (type, such as rule / case / specification), document content (content), tags (tags), etc.

[0194] The diagnosis results table stores the diagnosis number (diagnosis_id), associated event number (event_id), risk level (risk_level), diagnosis summary (summary), diagnosis conclusion (conclusion), evidence chain (evidence_chain, JSON format), treatment suggestion (suggestion), report content (report_content), diagnosis time (diagnosis_time), agent version (agent_version), etc.

[0195] The work order table (work_orders) stores the work order number (work_order_id), associated event number (event_id), inspection station (station_id), inspection reason (reason), risk level (risk_level), suggested check items (check_items), handling suggestions (suggestion), work order priority (priority), work order status (status), creation time (created_at), etc.

[0196] The tool service module is used to encapsulate the interfaces of the platform interface module and the knowledge base retrieval interface into standardized tool interfaces that can be called by intelligent agents.

[0197] Specifically, the tool service module is the MCP tool service module. This module encapsulates the business interfaces and knowledge base retrieval capabilities of the platform interface module into intelligent agent-callable tools, exposing standardized tool call interfaces to the outside world. The tools encapsulated by the MCP tool service module include: The `get_pending_events` tool reads the list of events to be diagnosed, corresponding to the platform's event reading interface.

[0198] The get_event_context tool retrieves complete event context information and corresponds to the platform's event context retrieval interface.

[0199] The search_erosion_knowledge tool retrieves knowledge bases related to soil erosion, supporting keyword search and relevance ranking.

[0200] The submit_event_diagnosis tool submits diagnostic results and report content to the platform, and the corresponding diagnostic results are written back to the interface.

[0201] The create_event_work_order tool: creates inspection work orders and corresponds to the inspection work order creation interface.

[0202] The `update_event_status` tool updates the platform's event status and provides a corresponding event status update interface.

[0203] The intelligent agent completes the entire process of event reading, context acquisition, knowledge retrieval, diagnostic reasoning, result writing back, and work order creation by sequentially calling the tools mentioned above.

[0204] The knowledge base module is used to store diagnostic rules, historical cases, risk classification standards, and treatment procedures in the field of soil and water conservation.

[0205] Specifically, the knowledge base module stores knowledge in the field of soil and water conservation, and is built and updated through a knowledge base import script. The knowledge base content includes: rules for judging soil and water conservation, cases for identifying muddy water, risk level classification standards, rules for rainfall-induced soil and water conservation, historical treatment cases, manual inspection specifications, treatment suggestion templates, and report templates. The knowledge base import script converts domain data (documents, rule files, case records, etc.) into structured knowledge documents and stores them in a knowledge document table, while also creating document tags and indexes to support retrieval.

[0206] The intelligent agent diagnostic module is used to obtain complete event context information and knowledge retrieval results of the monitoring event to be diagnosed by calling the standardized tool interface of the tool service module, and generate the risk level, diagnostic conclusion, evidence chain and treatment suggestion of the monitoring event to be diagnosed accordingly. The evidence chain includes at least two evidence items, and each evidence item includes evidence source, evidence content and evidence description.

[0207] Specifically, the agent diagnostic module generates diagnostic conclusions based on event context and knowledge base retrieval results. In this embodiment, the agent diagnostic module calls the tool interface of the MCP tool service module through the agent to read platform event data, retrieve knowledge base content, and perform reasoning according to preset diagnostic prompts. The output of the agent diagnostic module includes: risk level, diagnostic summary, detailed diagnostic conclusion, chain of evidence (containing at least two evidence items), handling suggestions, and whether to recommend creating a work order.

[0208] The report generation module is used to generate a structured diagnostic report based on the risk level, diagnostic conclusion, evidence chain, and treatment recommendations output by the intelligent agent diagnostic module.

[0209] Specifically, the report generation module converts agent diagnostic results into structured diagnostic reports. It generates natural language reports in Markdown format, facilitating front-end display, database storage, and subsequent export. Simultaneously, the module also generates machine-parseable structured fields in JSON format, including event number, risk level, diagnostic summary, list of evidence items, recommended actions, whether a work order creation is recommended, diagnostic time, and agent version information, for automatic parsing and processing by the platform's business systems.

[0210] The work order processing module is used to determine whether to create an inspection work order based on preset work order triggering conditions and the output results of the intelligent agent diagnostic module, and to create an inspection work order through the work order creation interface of the tool service module when the conditions are met.

[0211] Specifically, the work order processing module determines whether an inspection work order needs to be created based on the agent's diagnostic results and preset work order creation rules. When the work order creation conditions are met, the work order processing module calls the inspection work order creation tool (create_event_work_order) through the MCP tool service module to generate the inspection work order. The inspection work order includes the work order number, associated event number, inspection site, risk level, inspection reason, suggested verification content, work order priority, and work order status.

[0212] The platform write-back module is used to write back the structured diagnostic report, the risk level, the diagnostic conclusion, the evidence chain, the handling suggestions, the work order information, and the event handling status to the monitoring platform through the write-back interface of the tool service module, and update the event status of the monitoring event to be diagnosed according to the diagnostic process and the work order creation results.

[0213] Specifically, the platform write-back module is used to write back the agent's diagnostic results, report content, work order information, and event status to the soil and water loss monitoring platform through the MCP tool service module. After the platform write-back, the monitored event completes the status transition from PENDING_AGENT to DIAGNOSED or WORK_ORDER_CREATED, realizing automatic updates of the event processing status and closed-loop business processes.

[0214] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.

Claims

1. A closed-loop processing method for soil erosion monitoring event diagnosis based on intelligent agents, characterized in that, Includes the following steps: S1. Obtain monitoring events with a status of pending diagnosis through the event reading interface of the monitoring platform as monitoring events to be diagnosed; S2. Based on the event identifier of the monitoring event to be diagnosed, obtain the complete event context information of the monitoring event to be diagnosed through the event context acquisition interface encapsulated in the tool service module. The complete event context information includes the monitoring data of the monitoring event to be diagnosed and the associated environmental data. S3. The agent generates search conditions based on the complete event context information, retrieves diagnostic basis information related to the event to be diagnosed and monitored in the domain knowledge base through the knowledge retrieval interface encapsulated by the tool service module, and inputs the retrieval results as diagnostic reference into the agent's reasoning process. S4. The intelligent agent generates the risk level, diagnostic conclusion, evidence chain, and handling suggestion of the monitoring event to be diagnosed based on the complete event context information and the diagnostic reference basis, wherein the evidence chain includes at least two evidence items, and each evidence item includes evidence source, evidence content, and evidence description; S5. Generate a structured diagnostic report based on the risk level, the diagnostic conclusion, the chain of evidence, and the treatment recommendations; S6. Determine whether an inspection work order needs to be created based on the preset work order triggering conditions. If the work order triggering conditions are met, create an inspection work order through the work order creation interface encapsulated by the tool service module and obtain the work order creation result. S7. Through the write-back interface encapsulated in the tool service module, the structured diagnostic report, the risk level, the diagnostic conclusion, the evidence chain, the handling suggestions, the work order information of the inspection work order, and the event processing status of the monitoring event to be diagnosed are written back to the monitoring platform. Based on the diagnostic process and the work order creation result, the event status of the monitoring event to be diagnosed is updated to diagnosed status, work order created status, no work order required status, or diagnostic abnormality status.

2. The closed-loop processing method for water and soil erosion monitoring event diagnosis based on intelligent agents according to claim 1, characterized in that, In step S2, the monitoring data includes one or more of the following: basic event data, monitoring site data, image recognition result data, and historical event data; The environmental data includes one or more of the following: rainfall data, water level data, meteorological data, topographic data, and surrounding disturbance data.

3. The closed-loop processing method for soil erosion monitoring event diagnosis based on intelligent agents according to claim 1, characterized in that, The tool service module encapsulates the interface of the monitoring platform and the retrieval interface of the domain knowledge base into standardized tools that the intelligent agent can call. The standardized tools include at least an event reading tool, a context acquisition tool, a knowledge retrieval tool, a result write-back tool, a work order creation tool, and a status update tool.

4. The closed-loop processing method for water and soil erosion monitoring event diagnosis based on intelligent agents according to claim 1, characterized in that, In step S3, the domain knowledge base stores soil and water loss diagnosis rules, historical treatment cases, risk classification standards, and treatment specifications. Retrieving diagnostic basis information related to the monitored event to be diagnosed from the domain knowledge base includes: A retrieval query is constructed based on the event type, site characteristics, identification tags, and environmental information of the monitoring event to be diagnosed; Retrieve matching rule documents, case documents, and specification documents from the domain knowledge base; rank the search results by relevance. The sorted knowledge fragments will be used as the diagnostic reference. The identification information of the search results is saved for evidence chain tracing.

5. The closed-loop processing method for water and soil erosion monitoring event diagnosis based on intelligent agents according to claim 1, characterized in that, In step S4, the risk level is determined by the intelligent agent based on the abnormal confidence level of the image recognition result, the rainfall before and after the event, the frequency of similar events in the history of the site, the strength of the matching rules in the knowledge base, and the necessity of handling similar historical cases. The risk level includes at least two levels, which are used to determine whether to trigger the creation of an inspection work order and the priority of incident handling.

6. The closed-loop processing method for water and soil erosion monitoring event diagnosis based on intelligent agents according to claim 1, characterized in that, In step S4, the sources of evidence items in the evidence chain include, but are not limited to, image recognition output, rainfall monitoring records, station historical event records, and knowledge base rule matching results; Each piece of evidence includes specific monitoring data or rule provisions, and the evidence description includes a description of how the evidence supports the risk assessment.

7. The closed-loop processing method for water and soil erosion monitoring event diagnosis based on intelligent agents according to claim 1, characterized in that, In step S5, the structured diagnostic report includes a natural language description section for user reading and a structured data section for machine parsing; The natural language description section includes an event summary, diagnostic conclusions, risk level, evidence details, and treatment recommendations; The structured data portion includes event identifiers, risk level codes, evidence lists, recommended action indicators, and diagnostic metadata.

8. The closed-loop processing method for soil erosion monitoring event diagnosis based on intelligent agents according to claim 1, characterized in that, In step S6, the work order triggering conditions include one or more of the following: The risk level reaches the preset threshold, the image recognition result is abnormal and the confidence level exceeds the set threshold, the environmental data exceeds the warning threshold, the frequency of historical events at the site exceeds the set number of times, the intelligent agent's diagnostic conclusion indicates that on-site verification is required, and there is key risk evidence in the chain of evidence. The inspection work order includes the work order number, associated event identifier, inspection location, inspection reason, risk level, verification content, handling suggestions, priority, and creation time.

9. The closed-loop processing method for water and soil erosion monitoring event diagnosis based on intelligent agents according to claim 1, characterized in that, The method further includes a diagnostic tracing step, specifically: The tool call records, knowledge retrieval records, diagnostic input data, diagnostic output data, report generation records, and write-back records of the intelligent agent are stored in a traceability database for subsequent auditing, review, and diagnostic quality assessment. The traceability database includes at least an event data table, a site data table, a knowledge document table, a diagnostic result table, and a work order data table, which are used to store event information, site information, knowledge entries, diagnostic results, and work order information, respectively.

10. A closed-loop processing system for soil erosion monitoring event diagnosis based on intelligent agents, used to execute the closed-loop processing method for soil erosion monitoring event diagnosis based on intelligent agents as described in any one of claims 1-9, characterized in that, include: The platform interface module is used to provide business interfaces for the soil and water loss monitoring platform. The business interfaces include event reading interface, event context acquisition interface, diagnostic result write-back interface, work order creation interface and event status update interface. The data storage module is used to store monitoring event data, site data, knowledge documents, diagnostic results, and work order data. The tool service module is used to encapsulate the interfaces of the platform interface module and the knowledge base retrieval interface into standardized tool interfaces that can be called by intelligent agents. The knowledge base module is used to store diagnostic rules, historical cases, risk classification standards, and treatment procedures in the field of soil and water conservation. The intelligent agent diagnostic module is used to obtain complete event context information and knowledge retrieval results of the monitoring event to be diagnosed by calling the standardized tool interface of the tool service module, and generate the risk level, diagnostic conclusion, evidence chain and treatment suggestion of the monitoring event to be diagnosed accordingly. The evidence chain includes at least two evidence items, and each evidence item includes evidence source, evidence content and evidence description. The report generation module is used to generate a structured diagnostic report based on the risk level, diagnostic conclusion, evidence chain, and treatment recommendations output by the intelligent agent diagnostic module. The work order processing module is used to determine whether to create an inspection work order based on the preset work order triggering conditions and the output results of the intelligent agent diagnosis module, and to create an inspection work order through the work order creation interface of the tool service module when the conditions are met. The platform write-back module is used to write back the structured diagnostic report, the risk level, the diagnostic conclusion, the evidence chain, the handling suggestions, the work order information, and the event handling status to the monitoring platform through the write-back interface of the tool service module, and update the event status of the monitoring event to be diagnosed according to the diagnostic process and the work order creation results.