Rail transit operation evaluation agent implementation method and system based on large model
By constructing an intelligent agent for rail transit operation assessment using a large model, the problems of rigid assessment logic and poor module coordination in existing tools are solved. This achieves automation, intelligence, and integration of rail transit operation assessment, improving assessment efficiency and accuracy, and adapting to complex and ever-changing operation scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-04-07
AI Technical Summary
Existing rail transit operation assessment tools cannot achieve automation, intelligence, and integration, cannot adapt to the complex and ever-changing operational scenarios, have rigid assessment logic, poor module coordination, low level of intelligence, and are difficult to achieve an efficient and accurate assessment closed loop.
A large model is used to construct an intelligent agent for rail transit operation evaluation. The agent's role information is solidified through a memory storage component, toolsets and memories are configured, execution processes are defined, and roles, tools, memories and processes are integrated to achieve multi-dimensional capability synergy and support data query, parameter configuration and report generation.
It has achieved automation, intelligence and integration of rail transit operation assessment, improved assessment efficiency and accuracy, adapted to the needs of complex and ever-changing operation scenarios, and generated assessment results that are traceable and logically verifiable, providing comprehensive and accurate decision-making basis.
Smart Images

Figure CN121810104A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of rail transit operation management and artificial intelligence technology, and in particular to a method and system for implementing an intelligent agent for rail transit operation evaluation based on a large model. Background Technology
[0002] As the scale of the rail transit network continues to expand, the complexity of operational assessments is increasing exponentially. These assessments must simultaneously consider five core indicators: basic technology, service, connectivity, safety, and efficiency. They must cover assessments at the network, line, and station levels, and be adaptable to dynamic scenarios such as weekdays, holidays, and special days. Currently, automated assessment tools in the industry mainly adopt a framework of "fixed rule engine + single functional module," relying on Excel, BI reporting tools, or simple scripts to achieve data extraction and visualization. They only remain at the "data presentation" level and cannot automatically complete assessment and analysis.
[0003] Existing technologies suffer from the following significant drawbacks: First, the evaluation logic is rigid, with fixed rules hard-coded into the code, limiting their ability to handle simple evaluation tasks within preset scenarios. Second, module collaboration is poor, with most modules being "single-scenario dedicated" and lacking comprehensive collaborative capabilities across scenarios and indicators. Third, the level of intelligence is low, failing to adapt to complex and ever-changing operational scenarios and the increasing evaluation demands, making it difficult to achieve a "efficient, accurate, and automated" evaluation loop. Therefore, there is an urgent need to design a method and system for implementing an intelligent agent for rail transit operation evaluation based on a large model. This would enable the automation, intelligence, and integration of rail transit operation evaluation, improve evaluation efficiency and accuracy, adapt to the needs of complex and ever-changing operational scenarios, and address the aforementioned problems of existing technologies. Summary of the Invention
[0004] The purpose of this application is to provide a method and system for implementing an intelligent agent for rail transit operation assessment based on a large model, which can realize the automation, intelligence and integration of rail transit operation assessment, improve assessment efficiency and accuracy, and adapt to the needs of complex and ever-changing operation scenarios.
[0005] To achieve the above objectives, this application provides the following solution.
[0006] Firstly, this application provides a method for implementing an intelligent agent for rail transit operation evaluation based on a large model, which specifically includes the following steps.
[0007] Assigning roles: The role information of the intelligent agent is solidified using a memory storage component; the role information includes the intelligent agent's identity, core capabilities, and working principle.
[0008] Configuration tools: Construct a toolset adapted to rail transit operation assessment; the toolset includes tools related to data query, parameter configuration, assessment execution and report generation, supporting agents to obtain operational data, configure assessment parameters and execute assessment operations.
[0009] Memory construction: Configure dialogue memory and long-term memory for the intelligent agent; the dialogue memory is used to store interaction context information, and the long-term memory is used to vectorize professional knowledge in the field of rail transit and store it in a vector database to support knowledge retrieval and reuse.
[0010] Define the process: A pre-defined operational evaluation execution process is provided for the intelligent agent. This process refers to the intelligent agent's sequential execution of operations after receiving user requests, following the order of request parsing, data acquisition, parameter configuration, scheme creation, evaluation execution, report generation, and result feedback. Specifically, the execution process includes: parsing user requests and extracting operational evaluation information, including evaluation route, evaluation operation day, and evaluation scope information; confirming with the user if the operational evaluation information is missing and determining the evaluation scenario based on the evaluation operation day; obtaining a list of evaluation indicators and corresponding indicator data; obtaining the evaluation weights and indicator standard values under the evaluation scenario; creating an evaluation scheme and recording relevant information; calculating the evaluation score based on the indicator data, the evaluation weights, and the indicator standard values; and generating an evaluation report according to a pre-defined template based on the operational evaluation information, the list of evaluation indicators, and the evaluation score, and providing feedback to the user.
[0011] Creating an intelligent agent: Integrating the role information, toolset, dialogue memory, long-term memory, and execution process, an intelligent agent with rail transit operation evaluation capabilities is constructed based on a large model.
[0012] Secondly, this application provides a rail transit operation evaluation intelligent agent implementation system based on a large model. The rail transit operation evaluation intelligent agent implementation system based on a large model is used to implement the rail transit operation evaluation intelligent agent implementation method based on a large model described in the first aspect. The rail transit operation evaluation intelligent agent implementation system based on a large model includes the following modules.
[0013] A role assignment module is used to solidify the role information of the intelligent agent using a memory storage component; the role information includes the intelligent agent's identity, core capabilities, and working principle.
[0014] The configuration tool module is used to build a toolset adapted to rail transit operation assessment. The toolset includes tools related to data query, parameter configuration, assessment execution, and report generation, which support agents in obtaining operational data, configuring assessment parameters, and executing assessment operations.
[0015] A memory module is constructed to configure dialogue memory and long-term memory for the intelligent agent; the dialogue memory is used to store interaction context information, and the long-term memory is used to vectorize professional knowledge in the field of rail transit and store it in a vector database to support knowledge retrieval and reuse.
[0016] A process module is defined to pre-define the operational evaluation execution process for the intelligent agent. This execution process refers to the intelligent agent performing operations sequentially after receiving user requests: request parsing, data acquisition, parameter configuration, scheme creation, evaluation execution, report generation, and result feedback. Specifically, the execution process includes: parsing the user request and extracting operational evaluation information, including the evaluation route, evaluation operation day, and evaluation scope; confirming with the user if the operational evaluation information is missing and determining the evaluation scenario based on the evaluation operation day; obtaining a list of evaluation indicators and corresponding indicator data; obtaining the evaluation weights and indicator standard values under the evaluation scenario; creating an evaluation scheme and recording relevant information; calculating the evaluation score based on the indicator data, the evaluation weights, and the indicator standard values; and generating an evaluation report according to a pre-defined template based on the operational evaluation information, the list of evaluation indicators, and the evaluation score, and providing feedback to the user.
[0017] A smart agent module is created to integrate the role information, the toolset, the dialogue memory, the long-term memory, and the execution process, and to build a smart agent with rail transit operation evaluation capabilities based on a large model.
[0018] According to the specific embodiments provided in this application, this application has the following technical effects.
[0019] This application provides a method and system for implementing an intelligent agent for rail transit operation assessment based on a large model. By solidifying the agent's role, core capabilities, and working principles through a memory storage component, the agent focuses on the core tasks of rail transit operation assessment, avoiding functional generalization. It can accurately respond to assessment needs at multiple levels, including network, line, and station, and adapt to comprehensive assessment scenarios encompassing basic technology, services, connectivity, safety, and efficiency, overcoming the limitations of existing tools that are "single-scenario dedicated." By constructing a complete toolset covering data querying, parameter configuration, assessment execution, and report generation, it enables collaborative invocation of tools throughout the entire assessment process without requiring manual switching between multiple independent modules. The toolset directly interfaces with the underlying data storage environment, supporting rapid acquisition of operational data, dynamic configuration of assessment parameters, and automated assessment execution. This solves the problems of "disconnect between data presentation and assessment analysis" and "lack of collaboration between modules" in traditional tools, improving the continuity and convenience of assessment operations. By configuring the agent with dialogue memory and long-term memory, dialogue memory stores interaction context information, allowing the agent to connect with historical communication content without requiring users to repeatedly supplement evaluation background information, thus improving the interactive experience. Long-term memory, by vectorizing and storing professional knowledge in the rail transit field and supporting similarity retrieval, enables the agent to quickly reuse professional knowledge such as operation manuals and emergency plans during the evaluation process, providing solid support for evaluation decisions, avoiding evaluation bias caused by a lack of domain knowledge, and improving the professionalism and accuracy of evaluation results. Through a pre-defined standardized process of "requirements analysis - data acquisition - parameter configuration - solution creation - evaluation execution - report generation - result feedback," combined with the logical reasoning capabilities of the large model, the agent can automatically complete the entire process from receiving requirements to outputting reports. This eliminates the need for manual intervention in tedious steps such as data querying, weight configuration, and score calculation, overcoming the shortcomings of traditional tools that "rely on hard-coded logic" and "can only handle simple evaluation tasks," significantly improving the efficiency of operational evaluation and reducing labor costs. By integrating four core elements—roles, tools, memory, and processes—and using the large model as the central hub, multi-dimensional capabilities are synergistically linked. The large-scale model's natural language processing capabilities support accurate parsing of users' fuzzy needs, while its logical reasoning capabilities ensure orderly process execution. Combined with dynamically adjustable evaluation parameters and toolsets, it enables automated, intelligent, and integrated rail transit operation evaluation, improving evaluation efficiency and accuracy. The intelligent agent adapts to complex and ever-changing operational scenarios, responding to evaluation needs in different scenarios without modifying the underlying code, significantly enhancing the flexibility and scalability of operation evaluation. Furthermore, this application relies on the full volume of operational indicator data and evaluation parameter configuration data in the underlying data storage environment, combined with domain-specific knowledge reuse and standardized evaluation processes, ensuring that the intelligent agent's evaluation process is data-traceable and logically verifiable. The generated evaluation results include not only a comprehensive score but also detailed indicator breakdowns, problem analysis, and optimization suggestions, providing comprehensive and accurate decision-making basis for rail transit operation optimization and helping to improve operational service quality and management level. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a flowchart illustrating a method for implementing a rail transit operation evaluation intelligent agent based on a large model, as provided in one embodiment of this application.
[0022] Figure 2 The flowchart illustrates the core principle of a method for implementing a rail transit operation evaluation intelligent agent based on a large model, as provided in one embodiment of this application.
[0023] Figure 3 This is a flowchart illustrating the process of equipping an intelligent agent with tools, as provided in one embodiment of this application.
[0024] Figure 4 This is a schematic diagram of a database table structure provided in an embodiment of this application.
[0025] Figure 5 This is a schematic diagram of the evaluation results exported by calling the evaluation report generation tool according to an embodiment of this application.
[0026] Figure 6 A schematic diagram illustrating the operational status assessment process of Line 5 on August 13, 2025, provided as an embodiment of this application.
[0027] Figure 7 This is a schematic diagram of the structure of a rail transit operation evaluation intelligent agent implementation system based on a large model, provided as an embodiment of this application. Detailed Implementation
[0028] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0029] The purpose of this application is to provide a method and system for implementing an intelligent agent for rail transit operation assessment based on a large model. The large model serves as its core, assigning roles, functions, and relationships with other intelligent agents to the agent. By combining the operation indicator system, operation assessment relationship data model, and assessment algorithms from a rail transit big data platform, the agent is provided with a toolset for performing operation assessment tasks. Unstructured documents containing rail transit domain knowledge are input into the agent, giving it long-term memory of rail transit business knowledge. Process design tools are used to plan the execution flow of operation assessment tasks, achieving automation, intelligence, and integration of rail transit operation assessment, improving assessment efficiency and accuracy, and adapting to complex and ever-changing operational scenarios.
[0030] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0031] like Figure 1 As shown in the figure, this embodiment proposes a method for implementing a rail transit operation evaluation intelligent agent based on a large model, which specifically includes the following steps.
[0032] S1: Assigning Roles: The role information of the intelligent agent is solidified using a memory storage component; the role information includes the intelligent agent's identity, core capabilities, and working principle.
[0033] S2: Configuration tools: Construct a toolset adapted to rail transit operation assessment; the toolset includes tools related to data query, parameter configuration, assessment execution and report generation, supporting agents to obtain operation data, configure assessment parameters and execute assessment operations.
[0034] S3: Memory Construction: Configure dialogue memory and long-term memory for the agent; the dialogue memory is used to store interaction context information, and the long-term memory is used to vectorize professional knowledge in the field of rail transit and store it in a vector database to support knowledge retrieval and reuse.
[0035] S4: Define the process: Pre-set the operation evaluation execution process for the intelligent agent; the execution process refers to the intelligent agent performing operations in the following order after receiving user requirements: requirement parsing, data acquisition, parameter configuration, solution creation, evaluation execution, report generation, and result feedback.
[0036] S5: Create an intelligent agent: Integrate the role information, the toolset, the dialogue memory, the long-term memory, and the execution process to build an intelligent agent with rail transit operation evaluation capabilities based on a large model.
[0037] As an optional implementation, in step S1, the memory storage component adopts the Simple Memory memory storage component, the intelligent agent is a rail transit operation evaluation intelligent agent, the core capability is rail transit system operation evaluation and analysis based on the Click House operation indicator data warehouse and MySQL operation evaluation relational database, and the working principle is to obtain data and configuration based on REST API and perform data-driven comprehensive evaluation based on dynamic parameters.
[0038] As an optional implementation, in step S2, the toolset is developed based on an underlying data storage environment, which includes an indicator data warehouse and an evaluation relation library. The indicator data warehouse is used to store full operational indicator data, and the evaluation relation library is used to store evaluation parameter configuration data. The evaluation parameter configuration data includes indicator weights, scenario standard values, evaluation methods, and evaluation scenario information.
[0039] As an optional implementation, step S2 involves building a toolset adapted for rail transit operation assessment, which specifically includes the following steps.
[0040] S21: Develop API services based on the Java Spring framework; the API services include services for querying operational indicators, querying and configuring evaluation indicator libraries, querying and configuring evaluation methods, creating and querying evaluation weights, creating evaluation schemes, executing evaluations, and generating reports.
[0041] S22: Based on the API service, encapsulate tool functions and describe the functions of each tool function to form a tool list for intelligent agents to identify and call.
[0042] As an optional implementation, in step S21, during the API service development process, MySQL interaction uses MyBatis-Plus's Base Mapper and Service interface to encapsulate CRUD operations, and Click House interaction is implemented through Click House Driver combined with Spring Jdbc Template, and the SQL statement is optimized to query by operational day partition.
[0043] As an optional implementation, step S3 configures long-term memory for the agent, specifically including the following steps.
[0044] S31: Based on RAG (Retrieval Augmented Generation) technology, professional documents in the field of rail transit are divided into several text blocks according to a preset size; each text block includes corresponding text block information.
[0045] S32: Vectorize each of the text blocks using a pre-trained embedding model to generate corresponding vectors.
[0046] S33: Store the vector and the corresponding text block information in the vector database.
[0047] S34: When it is necessary to retrieve professional knowledge, the query text is vectorized and then a similarity query is performed in the vector database to return the text block information with the highest relevance.
[0048] As an optional implementation, in step S32, the embedding model adopts the all-mpnet-base-v2 model, the vector database adopts the Chroma DB database, the text block splitting size is set to 2000KB, and the similarity query adopts the cosine similarity algorithm.
[0049] As an optional implementation, step S4, the execution process specifically includes the following steps.
[0050] S41: Analyze user needs and extract operational evaluation information from user needs. The operational evaluation information includes evaluation route, evaluation operation day and evaluation scope information. If the operational evaluation information is missing, confirm with the user and determine the evaluation scenario based on the evaluation operation day.
[0051] S42: Obtain the list of evaluation indicators and the corresponding indicator data.
[0052] S43: Obtain the evaluation weights and indicator standard values under the evaluation scenario.
[0053] S44: Create an evaluation plan and record relevant information.
[0054] S45: Calculate the evaluation score based on the indicator data, the evaluation weight, and the indicator standard value.
[0055] S46: Based on the operational evaluation information, the list of evaluation indicators, and the evaluation score, generate an evaluation report according to a preset template and provide it to the user.
[0056] As an optional implementation, step S5 integrates the role information, the toolset, the dialogue memory, the long-term memory, and the execution process to construct an intelligent agent with rail transit operation evaluation capabilities based on a large model, specifically including the following steps.
[0057] The role information, toolset, dialogue memory, long-term memory, and execution process are embedded into a large model through the Prompt project to initialize an intelligent agent with rail transit operation evaluation capabilities.
[0058] To make the technical solution of this application clearer, the specific implementation steps of the technical solution of this application will be explained in detail below with examples.
[0059] The proposed method and system for implementing intelligent agents for rail transit operation evaluation based on large models, as described in this application, are executed in the following environment.
[0060] (1) Underlying data environment: It relies on the Click House operation indicator data warehouse and the MySQL operation evaluation relational database. The two provide the full amount of operation indicator data (such as the number of late arrival columns, congestion, etc.) and evaluation parameter configuration data (such as indicator weights, scenario standard values, etc.) required for evaluation, which are the basic data sources for the role to perform the "data-based evaluation" responsibility.
[0061] (2) Development and runtime environment: Subsequent tool development (such as API services and Python utility functions) is based on the JavaSpring framework (API layer) and the Python runtime environment (utility function layer). The responsibilities in the role definition, such as "obtaining data through REST API interface" and "dynamically adjusting evaluation parameters", need to be implemented in this development environment through code logic and tool integration.
[0062] (3) Large model central environment: The large model is the core central hub of the intelligent agent. The "analysis and decision-making" and "business knowledge understanding" capabilities of the role definition rely on the natural language processing (NLP) and logical reasoning capabilities of the large model. The role instructions are embedded in the Prompt engineering configuration stage of the large model, so that the large model can respond to tasks according to the identity of "rail transit operation evaluation intelligent agent".
[0063] This embodiment proposes a method for implementing an intelligent agent for rail transit operation evaluation based on a large model, such as... Figure 2 As shown, the core components include defining roles, providing tool modules, providing memory modules, providing execution processes, and creating intelligent agents. The specific steps are as follows.
[0064] Step 1: Assign roles.
[0065] The Simple Memory memory storage component is used to solidify role information, corresponding to the role memory initialization function in step three, "Assigning Memory". In step one, by calling the function named _init_memory, the Simple Memory memory storage component is used to complete the fixed storage of the agent's role information, thus clarifying the agent's identity and core capabilities.
[0066] In this embodiment, the function definition and functional positioning include the following:
[0067] (1) Define a function named _init_memory. The core function of this function is to initialize the memory system of the agent, focusing on the creation and information filling of the "role memory", and giving the agent exclusive identity attributes and working logic.
[0068] (2) Creation of the role memory component: Inside the function, a role memory object named role_memory is created. This object is built based on the Simple Memory component. Simple Memory is a memory component used to store simple key-value pair data. It is suitable for storing basic information that does not need to be frequently modified dynamically. Here, it is specifically used to store the role-related data of the agent.
[0069] (3) Role Information Content Population: In the role_memory object, three types of core role information are stored in the form of key-value pairs. Role Identity (agent_role): The agent's exclusive identity is clearly defined as "rail transit operation evaluation agent", directly defining its service area and core positioning, distinguishing it from other general agents or industry-specific agents. Core Competency (core_competency): The agent's core skill is defined as "rail transit system operation evaluation and analysis based on ClickHouse and MySQL data", clearly explaining its data sources (ClickHouse operation indicator data warehouse, MySQL operation evaluation relational database) and core tasks (operation evaluation, system analysis), clarifying the capability boundaries. Working Principle (working_principle): The basic operating logic of the agent is explained as "obtaining data and configuration through REST API, and conducting data-driven comprehensive evaluation based on dynamic parameters", revealing its method of obtaining data and configuration information (calling REST API interface), the core basis of evaluation (dynamic parameters) and evaluation mode (data-driven comprehensive evaluation), allowing the agent to understand the workflow and logic.
[0070] (4) Role memory: The role memory stored in the above way will become the basic identity recognition of the intelligent agent. When receiving user instructions and calling tools to perform evaluation tasks, it will always work as the "rail transit operation evaluation intelligent agent" to ensure that all operations revolve around the core goal of "operation evaluation".
[0071] Step 2: Provide the tools.
[0072] Giving intelligent agents tools and processes such as Figure 3 As shown, it mainly includes the following steps.
[0073] Step 1: Data initialization.
[0074] Before configuring the toolset for the intelligent agent, a data warehouse of operational indicators for rail transit and an operational evaluation relationship model need to be established as foundational dependencies. The data in the operational indicator data warehouse is processed using ETL tools to generate indicator data for the intelligent agent to access. The operational evaluation relationship library stores evaluation parameter information, such as scenarios, schemes, and weights. During initialization, business personnel import basic parameter information in batches, and the intelligent agent can access and adjust the evaluation parameters through the toolset.
[0075] The rail transit operation indicator data warehouse adopts the Click House operation indicator data warehouse, which is used to collect professional data from various lines, including automatic fare collection, signaling, rolling stock, communication, and integrated monitoring. This data is then subjected to layered data governance to form a comprehensive rail transit operation indicator system. The operational evaluation requires indicators in four categories: basic technology, service, connectivity, safety, and efficiency. Data governance is divided into six core layers: data access layer, data storage layer, data cleaning layer, data integration layer, indicator calculation layer, and data service layer. Data governance is not the main focus of this application and therefore will not be described in detail.
[0076] The intelligent agent will evaluate and score the operational status of each line based on the indicators already calculated by the big data platform (the big data platform is the fundamental dependency for the implementation of the intelligent agent; this application does not provide a specific description of the big data platform). This application uses the Click House operational indicator data warehouse as the repository for operational indicator data. A list of indicators required for operational evaluation is shown in Table 3.
[0077] The MySQL operational evaluation relational database is used to store and manage evaluation-related scheme information, including evaluation indicator standard parameters, evaluation weights, evaluation scenarios, methods, schemes, and evaluation results. The agent will use this relational model to obtain and correct evaluation parameters by calling tools configured for the agent, and record evaluation schemes and results. This application uses the MySQL operational evaluation relational database as the database for the operational evaluation relational model data. The database table structure is as follows: Figure 4 As shown, after the database tables are created, it is necessary to initialize the evaluation index categories, evaluation indicators, and evaluation method parameters, and pre-initialize the evaluation scenarios commonly used in rail transit operations and the evaluation methods for different indicators into the system.
[0078] Before initializing the data, it is necessary to design the table structure and create the corresponding core data tables in MySQL, ensuring that the field definitions, data types, primary key / foreign key constraints match the business requirements. Referring to the table structure, the core tables and key fields to be created are shown in Table 1 (field design must conform to MySQL syntax specifications).
[0079] Table 1. Core Tables and Key Fields Created
[0080] Data preparation needs to be combined with the "Operational Evaluation Indicator List" (55 indicators, including basic technology, service, connectivity, safety, and efficiency) and common operating scenarios of rail transit (such as weekday morning / evening peak, weekends, holidays, and special days). Business rules should be transformed into structured data, and all initial data should be organized into CSV format (or Excel format, for easy maintenance by business personnel). The field order should be completely consistent with the MySQL table fields to avoid field misalignment during import.
[0081] The initial data of each table is converted into INSERT INTO VALUES statements, generating independent SQL scripts. These scripts are then executed via MySQL clients (such as Navicat or MySQL Workbench) or command lines to complete the data insertion.
[0082] Step 2: Develop API services.
[0083] Based on the operational metric data warehouse and operational evaluation relational database, we will develop operational metric query and operational evaluation API services using the Java Spring framework. The API services to be developed are shown in Table 2.
[0084] Table 2 API Service Information
[0085] The development of all API services is based on a standardized process of "request reception - parameter validation - database interaction - data processing - response return". The specific general technical implementation is as follows.
[0086] The API service needs to connect to both the operational metrics data from the Click House operational metrics data warehouse and the evaluation parameter data from the MySQL operational evaluation relational database. It needs to achieve efficient data reading and writing through differentiated technical solutions to avoid database interaction becoming a performance bottleneck.
[0087] MySQL interaction (evaluation of relational database): This uses MyBatis-Plus's BaseMapper and Service interfaces to implement CRUD operations on evaluation parameters. For example: Define the EvaluationIndexMapper interface, which inherits from BaseMapper. <evaluationindex>(EvaluationIndex is the entity class corresponding to the MySQL "Evaluation Indicator Table"), the "fuzzy query by indicator type" is implemented through the selectList(Wrapper query Wrapper) method (adapted to the "Evaluation Indicator Library Query API"); the "Evaluation Indicator Information Update" is implemented using MyBatis-Plus's UpdateWrapper (adapted to the "Evaluation Indicator Library Configuration API").
[0088] Click House Interaction (Operations Metrics Data Warehouse): SQL queries are implemented using the official Click House driver (ru.yandex.clickhouse.ClickHouse Driver) and Spring's JDBC Template. Since Click House excels at batch data reading, SQL statements need to be optimized (e.g., using PARTITIONBY for day-based partitioned queries) to improve efficiency.
[0089] Step 3: Call the API utility function.
[0090] In this embodiment, a utility function is written using Python. The following is an example of the tool for retrieving operational metric data. The `get_operation_data` function retrieves operational metric data. This function takes three parameters: the data metric (`data_type`), the start date (`start_date`), and the end date (`end_date`), and returns a dictionary. Internally, the function first constructs the request URL, concatenating the base URL (`self.base_url`) and " / operation-data". Then, it defines the request parameters, including the data type, start date, and end date. Next, it uses the `get` method of the `requests` library to send the request, passing in the constructed URL, parameters, and request headers (`self.headers`). Then, it uses `response.raise_for_status()` to determine if the request was successful; if it fails, it throws an exception. Finally, it returns the response in JSON format as the function's output.
[0091] Step 4: Describe the API tool.
[0092] Based on the `get_operation_data` function defined in step three, each utility function is described to help the agent understand its purpose. The utility information is described using a JSON structure as follows.
[0093] Define a variable `tool_list`, which will be used to set the function name, method name (the method name is the function name defined in step three, such as `get_operation_data()`), and tool purpose information for all utility functions. This `tool_list` variable will be passed to the agent as an input parameter during agent initialization. See step five.
[0094] In the "Describe API Tools" section, the core is to create the tool_list variable and use this variable to manage the key information of all tool functions in a unified manner, so that the agent can clearly identify the name, calling method and purpose of each tool. The specific process is as follows.
[0095] (1) Create a tool_list variable: First, define a variable named tool_list. This variable is essentially a tool collection container, used to centrally store all tool-related configuration information for the agent to call. When the agent is initialized later, this variable will be passed in as an input parameter so that the agent can obtain the complete tool list.
[0096] (2) Add tool configuration to tool_list: Inside the tool_list variable, configure the information of each tool one by one in the form of "tool objects". Taking "Get Operation Metrics Data Tool" as an example, each tool object needs to contain three types of core information.
[0097] 1) Tool function name (name): Set the identifier name of the tool, such as "get_operation_data". This name should be concise and reflect the function of the tool so that the intelligent agent can quickly identify the purpose of the tool.
[0098] 2) Tool method name (func): Specifies the actual execution function corresponding to the tool. It needs to be associated with the Python tool function written in step 3 (such as self.tools.get_operation_data). Self.tools is an object that stores all tool functions. With this configuration, the agent can accurately locate the specific code to be executed when calling the tool.
[0099] 3) Tool Description: Use natural language to describe the tool's function in detail, such as "Operational indicator query service, supporting queries for various operational indicator data such as service type, efficiency type, basic type, and security type." This description must be clear and easy to understand, ensuring that the agent understands the applicable scenarios and effects that the tool can achieve. If other tools exist (such as evaluation weight query tools or evaluation scheme creation tools), add the corresponding tool objects to tool_list according to the above format of "tool function name + tool method name + tool description," forming a complete tool list to ensure that all tools that the agent can call are included in unified management.
[0100] Step 3: Imbue with memory.
[0101] Step 1: Dialogue Memory. Dialogue memory is used to configure the agent's contextual memory, enabling the agent to understand the current communication context and the content of previous communications. In the first step of "Assigning Memory," the core of dialogue memory configuration is to create and configure the dialogue memory component by calling the _init_memory function, allowing the agent to store and associate historical communication content and understand the current communication context. The specific process is as follows.
[0102] (1) Initialize the dialogue memory component within the function: In the _init_memory function (used to initialize the overall memory system of the agent), a dialogue memory object named conversation_memory is first created. This object is built based on the Conversation Buffer Memory component, which is a memory component specifically used to store the dialogue context and supports recording dialogue content in the order of interaction.
[0103] (2) Set the core parameters of conversation memory: Configure two key parameters for conversation_memory to ensure that the memory function meets the requirements.
[0104] 1) Memory Identifier Key (memory_key="chat_history"): Define a key name "chat_history" to uniquely identify dialogue memory data in the agent's memory system. When recalling or reading historical dialogues later, the corresponding memory content can be accurately located through this key.
[0105] 2) Message return format (return_messages=True): When the memory component returns dialogue content, it outputs it in the form of a "message object" (instead of a plain text string). The message object will contain information such as the roles in the dialogue (such as "user" and "agent"), content, and time sequence, so that the agent can clearly distinguish the interaction logic between the two parties in the dialogue and accurately connect the context.
[0106] (3) The role of dialogue memory: After configuration, conversation_memory will record every round of interaction between the agent and the user in real time (such as the user's request to "evaluate the operation of Line 5 on August 13" and the agent's response). When the user makes a related request later (such as "supplement the analysis of the congestion of the line during the evening peak on that day"), the agent can read the memory data corresponding to "chat_history" to identify the relationship between the current request and the historical dialogue, without the user having to repeat the background information, thus achieving a contextually coherent interaction.
[0107] Step Two: Long-Term Memory. Long-term memory serves as the agent's "knowledge base," storing knowledge and experience extracted from historical data and professional documents. By configuring a vector database using RAG, professional documents related to train dispatching in the urban rail transit industry (such as operation manuals, emergency plans, and historical accident analysis reports) are transformed into vector form, facilitating querying and learning by the agent. The core of long-term memory is the vectorization of knowledge from professional documents and their storage in the vector database. When relevant knowledge needs to be retrieved, the current context or problem text is vectorized, and a similarity query is performed in the vector database.
[0108] In this embodiment, the vectorization implementation process includes the following:
[0109] The vectorization process mainly involves converting professional documents related to train dispatching in the urban rail transit industry (such as operation manuals and emergency plans) into a vector form that can be understood by computers. This is achieved through the following steps.
[0110] (1) File preprocessing: The professional file is split into several text blocks according to the configured chunk_token_size (2000KB). This step is to avoid the inefficiency of vectorization or the limitation of model processing due to the large file size, and at the same time, it can also allow each text block to focus on a specific knowledge unit.
[0111] (2) Load the pre-trained model: Use the embedding_model specified in the configuration (such as the all-mpnet-base-v2 model), which has been downloaded to the local system in advance. This model has the ability to convert text into vectors and can capture semantic information in the text.
[0112] (3) Text block vectorization: Each split text block is input into the loaded embedding_model, and the model will generate a fixed-dimensional vector for each text block. This vector is a numerical representation of the text semantics, which allows text that is originally difficult to calculate relationships directly to be mathematically operated through vectors.
[0113] (4) Vector storage: The generated vectors and their corresponding text block information are stored in the vector database (Chroma DB database) through the configured client (chroma db.persistent client), and the correspondence between the vectors and the original files is associated so that the original knowledge source can be traced in subsequent queries.
[0114] In this embodiment, the implementation process of similarity query includes the following:
[0115] When you need to retrieve relevant knowledge, you can perform a vector-based similarity query by following these steps.
[0116] (1) Query text processing: Preprocess the current situation or problem text (such as a description of a specific problem in traffic scheduling) to ensure that its format meets the model requirements.
[0117] (2) Query text vectorization: Using the same embedding_model as file vectorization, the processed query text is converted into the corresponding vector, ensuring that the query vector and the text block vector stored in the database are in the same vector space, thus ensuring the effectiveness of similarity calculation.
[0118] (3) Vector similarity calculation: In the vector database, the similarity query function of the vector database is called by the client to calculate the similarity between the query vector and all text block vectors in the database (cosine similarity and other algorithms are commonly used). Cosine similarity can measure the degree of proximity between the directions of two vectors. The closer the value is to 1, the more similar the semantics.
[0119] (4) Return search results: Sort by similarity score from high to low, return the most relevant text block information and their corresponding original file sources, and provide the agent with knowledge support to solve the current problem.
[0120] Step 4: Execution process.
[0121] After configuring the toolset for the agent, it is also necessary to plan and execute the steps to enable the agent to understand the operational evaluation process. The specific execution process is as follows.
[0122] Step 1: Accept user input instructions, such as "Please evaluate the operation of Line 5 on August 13, 2025". The operation evaluation intelligent agent receives the user input, parses the line information to be evaluated, and determines whether the operation day to be evaluated is a weekday, weekend, holiday or special day, in order to match the subsequent evaluation scenario.
[0123] Step 2: Obtain operational indicator data based on the evaluation indicator list. This step consists of two sub-steps. First, obtain the list of indicators to be queried from the evaluation indicator library query tool, and then use the operational indicator query tool to obtain the indicator data.
[0124] Step 3: Use the evaluation weight query tool to obtain the evaluation weight for the specified scenario.
[0125] Step 4: Use the evaluation method query tool to obtain the standard values of operational indicators.
[0126] Step 5: Use the evaluation scheme creation tool to create an evaluation scheme.
[0127] Step 6: Call the performance evaluation tool to derive the performance score based on the operational indicator data, evaluation weight data, and standard value data of operational indicators obtained in steps 2, 3, and 4.
[0128] Step 7: Use the assessment report generation tool to export the assessment results, which will be in the following format: Figure 5 As shown.
[0129] When you receive a user's evaluation request, you should follow these steps. After each step, you should confirm that the result is correct before proceeding to the next step.
[0130] (1) Requirements Analysis: First, extract the key information from the requirements, including ① the line to be evaluated (e.g., "Line 5"), ② the operating day to be evaluated (e.g., "August 13, 2025"), and ③ the scope of evaluation (network level / line level / station level). If any information is missing, it is necessary to confirm with the user (example: "Please supplement the specific line you need to evaluate, such as 'Line 5'"). At the same time, determine the scenario type based on the operating day (weekday / weekend / holiday / special day, which needs to match the scenario in the t_evaluation_scenario table in MySQL).
[0131] (2) Data acquisition of indicators, including the following steps.
[0132] (2a) First, call the evaluation index library query tool, pass in the "evaluation line" and "evaluation scope" parameters, and obtain the list of indicators to be evaluated (such as "number of delays" for safety and "average waiting time" for service).
[0133] (2b) Then call the operation indicator query tool, pass in the parameters "Evaluation Operation Day" and "Indicator List" to get the specific value of the corresponding indicator (such as "Number of late columns: 3 times").
[0134] (3) Evaluation parameters are obtained, including the following steps.
[0135] (3a) Call the evaluation weight query tool, pass in the "scenario type" and "evaluation route" parameters, and obtain the weight percentage of various indicators in the scenario (e.g., "safety indicators weight 30%, service indicators weight 25%").
[0136] (3b) Call the evaluation method query tool, pass in the "scenario type" and "indicator list" parameters, and obtain the standard values of each indicator (such as "number of late arrivals: the highest standard value is 5 times, the lowest standard value is 0 times") and evaluation rules (such as "the smaller the better" and "reasonable range").
[0137] (4) Evaluation scheme creation: Call the evaluation scheme creation tool, pass in the parameters "evaluation route", "evaluation operation day", "scenario type", "indicator list" and "evaluation weight", generate a unique evaluation scheme ID (such as "SCH20250813001"), and record the scheme information to the evaluation scheme table in MySQL.
[0138] (5) Execution evaluation scoring: Call the execution evaluation tool, pass in the parameters "evaluation scheme ID", "indicator data", "indicator standard value" and "evaluation weight", and calculate the comprehensive evaluation score (e.g. "85 points") and the scores of each indicator item according to the preset algorithm (e.g. "the score of the comparison between the actual value of the indicator and the standard value × the weight ratio").
[0139] (6) Evaluation report generation: Call the evaluation report generation tool, pass in the parameters "evaluation scheme ID", "overall score" and "sub-item score", and generate a report according to a fixed template (including evaluation overview, indicator score details, problem analysis and optimization suggestions). The report format supports JSON or PDF.
[0140] (7) Results feedback: Output the core conclusions of the evaluation report to the user (such as "Line 5's overall operational score on August 13, 2025 (working day) was 85 points, with excellent performance in safety indicators and the 'average waiting time' in service indicators being slightly higher than the standard value"), and ask if the user needs to obtain the complete report file.
[0141] Step 5: Create an intelligent agent.
[0142] By simultaneously assigning the role definition (role information) from step one, the tool definition (toolset) from step two, the memory capabilities (dialogue memory and long-term memory) from step three, and the execution process from step four to the intelligent agent, an intelligent agent with rail transit operation assessment capabilities is obtained. Once the intelligent agent is created, it possesses rail transit operation assessment capabilities. Table 3 shows the list of operation assessment indicators.
[0143] Table 3 List of Operational Evaluation Indicators
[0144] Below is a practical application example, such as Figure 6 As shown, when a user inputs the command "Please evaluate the operation of Line 5 on August 13, 2025", the intelligent agent executes the following process.
[0145] (1) Demand analysis: Extract the evaluation line "Line 5", the evaluation operation date "August 13, 2025" (judged as a working day), and the evaluation scope is defaulted to line level.
[0146] (2) Data acquisition: Use the evaluation indicator library query tool to obtain the list of indicators to be evaluated at the line level, and then use the operation indicator query tool to obtain the specific values of these indicators on August 13, 2025.
[0147] (3) Evaluation parameter acquisition: Call the evaluation weight query tool to obtain the indicator weights in the workday scenario, and call the evaluation method query tool to obtain the standard values and evaluation rules of each indicator.
[0148] (4) Create an evaluation scheme: Generate a unique evaluation scheme ID and record the scheme information to MySQL.
[0149] (5) Execution evaluation: Calculate the overall score and sub-item scores according to the preset algorithm.
[0150] (6) Generate report: Generate a report containing an assessment overview, details, problem analysis and optimization suggestions according to a fixed template.
[0151] (7) Results feedback: Output the core conclusions to the user and ask if they need a full report.
[0152] Through the above-described implementation methods, this application achieves intelligent, automated, and efficient rail transit operation assessment, effectively solving many pain points of existing technologies and possessing broad application prospects.
[0153] Based on the same inventive concept, this application also provides a system for implementing the above-described method for implementing a large-model-based intelligent agent for rail transit operation evaluation. The solution provided by this system is similar to the solution described in the above method. Therefore, the specific limitations in the embodiments of the system provided below can be found in the limitations of the method for implementing a large-model-based intelligent agent for rail transit operation evaluation described above, and will not be repeated here.
[0154] In one exemplary embodiment, such as Figure 7 As shown, a rail transit operation evaluation intelligent agent implementation system based on a large model is provided, which includes the following modules.
[0155] A role assignment module is used to solidify the role information of the intelligent agent using a memory storage component; the role information includes the intelligent agent's identity, core capabilities, and working principle.
[0156] The configuration tool module is used to build a toolset adapted to rail transit operation assessment. The toolset includes tools related to data query, parameter configuration, assessment execution, and report generation, which support agents in obtaining operational data, configuring assessment parameters, and executing assessment operations.
[0157] A memory module is constructed to configure dialogue memory and long-term memory for the intelligent agent; the dialogue memory is used to store interaction context information, and the long-term memory is used to vectorize professional knowledge in the field of rail transit and store it in a vector database to support knowledge retrieval and reuse.
[0158] A process definition module is used to pre-set an operational evaluation execution process for the intelligent agent; the execution process refers to the intelligent agent performing operations in the following order after receiving user requirements: requirement parsing, data acquisition, parameter configuration, solution creation, evaluation execution, report generation, and result feedback.
[0159] A smart agent module is created to integrate the role information, the toolset, the dialogue memory, the long-term memory, and the execution process, and to build a smart agent with rail transit operation evaluation capabilities based on a large model.
[0160] The proposed method and system for implementing an intelligent agent for rail transit operation evaluation based on a large model has the following advantages.
[0161] (1) Achieve full automation of the assessment process: covering the entire process from requirements analysis to report generation, without the need for manual intervention, greatly improving assessment efficiency.
[0162] (2) Adapt to complex evaluation scenarios: Supports comprehensive evaluation of multiple types of indicators, multiple ranges and multiple dynamic scenarios, solving the limitation of existing tools being "single-scenario dedicated".
[0163] (3) Possess knowledge learning and iteration capabilities: continuously accumulate industry knowledge through long-term memory modules, and achieve capability iteration by updating professional documents.
[0164] (4) User-friendly and contextually coherent: The dialogue memory function allows the agent to understand the content of historical interactions without requiring the user to repeatedly provide background information, thus improving the user experience.
[0165] (5) Reliable data support: A stable data storage environment is built based on Click House and MySQL, and the API service optimizes the efficiency of data reading and writing, ensuring the accuracy and timeliness of the evaluation results.
[0166] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0167] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.< / evaluationindex>
Claims
1. A method for implementing an intelligent agent for rail transit operation evaluation based on a large model, characterized in that, include: Assigning roles: The role information of the intelligent agent is permanently stored using a memory storage component; The role information includes the agent's identity, core capabilities, and working principles; Configuration tools: Construct a toolset adapted to rail transit operation assessment; the toolset includes tools related to data query, parameter configuration, assessment execution, and report generation, supporting agents to acquire operational data, configure assessment parameters, and execute assessment operations; Memory construction: Configure dialogue memory and long-term memory for the intelligent agent; the dialogue memory is used to store interaction context information, and the long-term memory is used to vectorize professional knowledge in the field of rail transit and store it in a vector database to support knowledge retrieval and reuse. Define the process: A pre-defined operational evaluation execution process is provided for the intelligent agent. This process refers to the intelligent agent performing operations sequentially after receiving user requests: request parsing, data acquisition, parameter configuration, scheme creation, evaluation execution, report generation, and result feedback. Specifically, the execution process includes: parsing user requests and extracting operational evaluation information, including evaluation route, evaluation operation day, and evaluation scope information; confirming with the user if the operational evaluation information is missing and determining the evaluation scenario based on the evaluation operation day; obtaining a list of evaluation indicators and corresponding indicator data; obtaining the evaluation weights and indicator standard values under the evaluation scenario; creating an evaluation scheme and recording relevant information; calculating the evaluation score based on the indicator data, the evaluation weights, and the indicator standard values; and generating an evaluation report according to a pre-defined template based on the operational evaluation information, the list of evaluation indicators, and the evaluation score, and providing feedback to the user. Creating an intelligent agent: Integrating the role information, toolset, dialogue memory, long-term memory, and execution process, an intelligent agent with rail transit operation evaluation capabilities is constructed based on a large model.
2. The method for implementing a rail transit operation evaluation intelligent agent based on a large model according to claim 1, characterized in that, The memory storage component adopts the Simple Memory memory storage component, the intelligent agent is a rail transit operation evaluation intelligent agent, the core capability is rail transit system operation evaluation and analysis based on the Click House operation indicator data warehouse and MySQL operation evaluation relational database, and the working principle is to obtain data and configuration based on REST API and perform data-driven comprehensive evaluation based on dynamic parameters.
3. The method for implementing a large-model-based intelligent agent for rail transit operation evaluation according to claim 1, characterized in that, The toolset is developed based on an underlying data storage environment, which includes an indicator data warehouse and an evaluation relationship database. The indicator data warehouse is used to store all operational indicator data, and the evaluation relationship database is used to store evaluation parameter configuration data, which includes indicator weights, scenario standard values, evaluation methods, and evaluation scenario information.
4. The method for implementing a rail transit operation evaluation intelligent agent based on a large model according to claim 1, characterized in that, The toolset for building a rail transit operation assessment system includes: The API service is developed based on the Java Spring framework; the API service includes services for querying operational indicators, querying and configuring evaluation indicator library, querying and configuring evaluation methods, creating and querying evaluation weights, creating evaluation schemes, executing evaluations, and generating reports. Based on the API service, encapsulate tool functions and describe the functions of each tool function to form a tool list for intelligent agents to recognize and call.
5. The method for implementing a rail transit operation evaluation intelligent agent based on a large model according to claim 4, characterized in that, In the development of the API service, MySQL interaction uses MyBatis-Plus's Base Mapper and Service interface to implement CRUD operations, and Click House interaction is implemented through Click House Driver combined with Spring Jdbc Template, and the SQL statement is optimized to query by operational day partition.
6. The method for implementing a rail transit operation evaluation intelligent agent based on a large model according to claim 1, characterized in that, Configuring long-term memory for intelligent agents specifically includes: Based on RAG technology, professional documents in the field of rail transit are divided into several text blocks according to a preset size; each text block includes corresponding text block information. The text blocks are vectorized using a pre-trained embedding model to generate corresponding vectors; The vector and its corresponding text block information are stored in a vector database; When professional knowledge needs to be retrieved, the query text is vectorized and a similarity query is performed in the vector database to return the text block information with the highest relevance.
7. The method for implementing a rail transit operation evaluation intelligent agent based on a large model according to claim 6, characterized in that, The embedding model uses the all-mpnet-base-v2 model, the vector database uses the Chroma DB database, the text block splitting size is set to 2000KB, and the similarity query uses the cosine similarity algorithm.
8. The method for implementing a large-model-based intelligent agent for rail transit operation evaluation according to claim 1, characterized in that, By integrating the role information, toolset, dialogue memory, long-term memory, and execution process, an intelligent agent with rail transit operation evaluation capabilities is constructed based on a large model, specifically including: The role information, toolset, dialogue memory, long-term memory, and execution process are embedded into a large model through the Prompt project to initialize an intelligent agent with rail transit operation evaluation capabilities.
9. A rail transit operation evaluation intelligent agent implementation system based on a large model, characterized in that, The large-model-based intelligent agent implementation system for rail transit operation evaluation is used to implement the large-model-based intelligent agent implementation method for rail transit operation evaluation as described in any one of claims 1-8. The large-model-based intelligent agent implementation system for rail transit operation evaluation includes: A role assignment module is used to solidify the role information of the intelligent agent using a memory storage component; the role information includes the intelligent agent's identity, core capabilities, and working principle. The configuration tool module is used to build a toolset adapted to rail transit operation assessment; the toolset includes tools related to data query, parameter configuration, assessment execution and report generation, which support agents to obtain operational data, configure assessment parameters and execute assessment operations. A memory module is constructed to configure dialogue memory and long-term memory for the intelligent agent; the dialogue memory is used to store interaction context information, and the long-term memory is used to vectorize professional knowledge in the field of rail transit and store it in a vector database to support knowledge retrieval and reuse. A process module is defined to pre-define the operation evaluation execution process for the intelligent agent. The execution process refers to the intelligent agent performing operations sequentially after receiving user requests, following the order of request parsing, data acquisition, parameter configuration, scheme creation, evaluation execution, report generation, and result feedback. Specifically, the execution process includes: parsing user requests and extracting operation evaluation information from them, including evaluation route, evaluation operation day, and evaluation scope information; confirming with the user if the operation evaluation information is missing and determining the evaluation scenario based on the evaluation operation day; obtaining a list of evaluation indicators and corresponding indicator data; obtaining the evaluation weights and indicator standard values under the evaluation scenario; creating an evaluation scheme and recording relevant information; calculating the evaluation score based on the indicator data, the evaluation weights, and the indicator standard values; and generating an evaluation report according to a pre-defined template based on the operation evaluation information, the list of evaluation indicators, and the evaluation score, and providing feedback to the user. A smart agent module is created to integrate the role information, the toolset, the dialogue memory, the long-term memory, and the execution process, and to build a smart agent with rail transit operation evaluation capabilities based on a large model.