Rail transit emergency dispatching method based on subgraph retrieval and scene perception and agent system
By constructing a scene feature knowledge graph and subgraph retrieval, and combining a large language model and mixed integer linear programming, the problems of insufficient scene perception and bias in understanding mathematical constraints in rail transit emergency dispatching are solved, and a reliable emergency dispatching decision-making closed loop is realized.
Patent Information
- Application Number
- CN202610617201.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-07
- Publication Date
- 2026-08-25
AI Technical Summary
Existing technologies in rail transit emergency dispatching suffer from problems such as insufficient scene perception capabilities, low accuracy when LLM processes complex mathematical constraints, lack of reliability assurance for generated results, and lack of closed-loop control in the decision-making process.
We construct a scene feature knowledge graph, generate structured emergency dispatch instructions by combining subgraph retrieval and scene perception with a large language model, optimize it with a mixed integer linear programming model, and ensure the reliability and consistency of decision-making through a multi-dimensional credibility assessment framework.
It achieves a reliable bridge from unstructured event descriptions to strict mathematical constraints, ensuring the accuracy and reliability of emergency dispatch, solving the problems of fragmented retrieval and bias in understanding mathematical constraints in traditional methods, and realizing an end-to-end automated decision-making closed loop.
Smart Images

Figure CN122633891A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of rail transit emergency dispatching technology, specifically to a rail transit emergency dispatching method and intelligent agent system based on subgraph retrieval and scene perception. Background Technology
[0002] In many safety-critical fields, decision-makers need to quickly generate accurate decision solutions based on domain expertise within a limited timeframe. With the development of Large Language Models (LLMs) and the intelligent agent technologies they drive, leveraging the semantic understanding and reasoning capabilities of LLMs to assist autonomous decision-making has become a new technological approach. Retrieval-Augmented Generation (RAG) technology effectively expands the knowledge coverage of LLMs in specific domains by injecting external domain knowledge into them.
[0003] However, existing technologies face several prominent technical challenges in intelligent decision-making systems for complex scenarios: First, current knowledge retrieval methods are insufficient in scene perception. Traditional vector similarity retrieval methods segment domain knowledge text into fragments and directly retrieve the most similar fragments. This method fails to capture the structured relationships between scene features. For example, a knowledge item may be associated with multiple scene features (such as event type, severity, and scope of impact), but vector similarity-based retrieval can only match based on the surface semantics of the text, resulting in fragmented retrieval results. It lacks the rule-based dependencies between knowledge items and cannot provide complete knowledge context support for decision-making. Second, LLM suffers from the illusion problem when dealing with complex mathematical constraints. In scenarios requiring the transformation of natural language descriptions into mathematical optimization model constraints, embedding all mathematical expressions of constraints with prompts and then having LLM select the applicable constraint set results in low model selection accuracy. LLM struggles to accurately filter and understand mathematical formulas among numerous complex constraints, leading to problems such as constraint omission, overactivation, and comprehension bias. On the other hand, while traditional mixed-integer linear programming (LLM) methods can find exact optimal solutions under given constraints, their constraint sets and parameters must be manually configured by domain experts for each scenario. They cannot automatically identify the types of constraints to be activated and their corresponding parameter values from unstructured natural language event descriptions, leading to sluggish responses and insufficient flexibility when facing sudden, unforeseen complex scenarios. Therefore, neither relying solely on LLM semantic reasoning nor solely on the mathematical solution of LLM can independently solve the end-to-end automation problem of "from unstructured event description to precise mathematical constraint solution." A technical mechanism that can bridge natural language semantic understanding and rigorous mathematical constraint modeling is urgently needed. Third, LLM generates results based on probabilistic prediction mechanisms, and its output lacks systematic reliability assurance. Existing reliability enhancement methods include thought chain-based prompting methods that generate results through example guidance, but there is a discrepancy between the examples and the reasoning objective; LLM self-feedback-based optimization methods are limited by the model's own cognitive boundaries and lack a structured evaluation framework; and methods based on human supervision require a trade-off between automation and decision quality. Fourth, existing intelligent agent decision-making processes lack formalized state management and closed-loop control mechanisms, making it difficult to achieve a complete decision-making closed loop from perception to execution. Information loss and context inconsistency are prone to occur in multi-step decision chains. Summary of the Invention
[0004] The purpose of this invention is to provide a rail transit emergency dispatching intelligent agent system and method based on subgraph retrieval and scene awareness, so as to solve at least one of the technical problems existing in the background art.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] In a first aspect, the present invention provides a rail transit emergency dispatching method based on subgraph retrieval and scene awareness, comprising:
[0007] S1: Construct a scene feature knowledge graph, which includes a feature node set and a knowledge node set. The feature nodes represent scene feature attributes of domain knowledge, and the knowledge nodes correspond to semantically complete knowledge fragments. Establish multidimensional associations between the feature nodes and the knowledge nodes through relation edges.
[0008] S2: For the input event description, extract scene feature elements, perform feature mapping on the scene feature knowledge graph based on the scene feature elements, and construct a query feature subgraph;
[0009] S3: Using the query feature subgraph as the retrieval unit, perform an initial knowledge retrieval combining structural matching and semantic reordering to obtain knowledge retrieval results related to the event description;
[0010] S4: Enter the iterative scheduling optimization stage, organize the event description and the knowledge retrieval results into a structured prompt input containing event elements, retrieval knowledge context and decision history sequence, and generate a structured emergency dispatch instruction containing instruction type, affected object identifier, operation parameters and execution time window through a large language model;
[0011] S5: Based on the event description and the knowledge retrieval results, a structured scenario parameter set is extracted using a large language model. The structured scenario parameter set includes the affected train set, the affected section set, and the time window parameter. Based on the structured scenario parameter set, constraint activation mapping is performed using a scenario-aware constraint activation function to dynamically determine the set of train operation constraints to be activated. The scenario-aware constraint activation function is a combination of indicator functions. Based on the affected train set, the affected section set, and the time window parameter, the activation status of delay propagation constraints, speed limit operation constraints, and section closure constraints is independently determined. The activation status is a binary variable. When activated, the corresponding constraint takes effect; when not activated, the corresponding constraint degenerates into a basic constraint. The activated constraint set is loaded as constraint conditions into a mixed integer linear programming model for train operation adjustment. The model is solved with a multi-objective weighted optimization that includes train timetable deviation, delay time, and the number of service adjustments, generating a train timetable adjustment scheme.
[0012] S6: The credibility of the emergency dispatch command and the train timetable adjustment plan are evaluated from four dimensions: decision semantic consistency, command parameter validity, target scenario relevance and boundary rule security. The evaluation scores of each dimension are calculated, and the comprehensive credibility score is calculated by weighted summation. The execution strategy is determined according to the relationship between the comprehensive credibility score and the preset threshold.
[0013] S7: Update the decision state based on the execution result, and iterate through steps S4 to S6 until the comprehensive credibility score meets the termination condition or the number of iterations reaches the preset maximum number of iterations.
[0014] S8: After step S7 meets the termination condition, based on the train timetable adjustment scheme, a track section time and space occupancy status update instruction is generated, and the track section time and space occupancy status update instruction is output to the rail transit centralized dispatch control system to drive the control nodes along the line to perform the corresponding physical control actions of train speed limit, stop or departure, and complete the physical adjustment of the train operation status.
[0015] As a further limitation of the first aspect of the present invention, in step S1, the construction of the scene feature knowledge graph includes: automatically extracting scene feature types from the domain specification document through a large language model to form a feature node set, wherein the scene feature types include event type, severity, scope of influence and related departments; dividing the domain specification document into knowledge fragments according to the principle of semantic integrity to form a knowledge node set, and converting each knowledge node into a vector representation through a pre-trained language model; and automatically extracting the relationship edges between feature nodes and knowledge nodes through a large language model based on a predefined set of domain relationship types.
[0016] As a further limitation of the first aspect of the present invention, in step S2, the construction of the query feature subgraph includes: extracting scene feature elements from the event description through a large language model; calculating the similarity between the scene feature elements and the feature node set, filtering feature nodes with similarity exceeding a preset threshold to form a query feature node set; and constructing a query feature subgraph based on the association relationship between the nodes in the query feature node set.
[0017] As a further limitation of the first aspect of the present invention, in step S3, the knowledge retrieval combining structural matching and semantic reordering includes: a structural matching stage: calculating the structural matching degree between the query feature subgraph and the neighborhood feature subgraph of each knowledge node, and filtering candidate knowledge nodes whose structural matching degree exceeds a preset threshold; the structural matching degree is calculated by the average maximum similarity between the query feature node and the neighborhood feature nodes of the knowledge node; a semantic reordering stage: performing vector encoding on the event description, calculating the semantic similarity between each candidate knowledge node and the event description, weighting and fusing the semantic similarity and structural matching degree to obtain a comprehensive relevance score, and selecting the top K knowledge nodes in descending order of the comprehensive relevance score as the final retrieval results.
[0018] As a further limitation of the first aspect of the present invention, in step S5, the activation condition for the delay propagation constraint is that the train belongs to the set of affected trains and the section belongs to the set of affected sections; the activation condition for the speed limit operation constraint is that the section belongs to the set of speed limit sections and the departure time is within the speed limit time window; the activation condition for the section blocking constraint is that the section belongs to the set of blocked sections and the planned departure time is within the blocking time window; the objective function of the multi-objective weighted optimization is a weighted sum of minimizing train timetable deviation, minimizing total delay time, and minimizing the number of canceled trains.
[0019] As a further limitation of the first aspect of the present invention, in step S6, the decision semantic consistency assessment is obtained by weighting the matching ratio between the emergency dispatch instruction and the parameters specified in the knowledge base and the semantic consistency score with the historical decision sequence; the instruction parameter validity assessment is obtained by weighting the coverage rate of the required parameters and the format correctness rate of each parameter; the target scene relevance assessment is obtained by weighting the overlap of the longest common subsequence between the emergency dispatch instruction text and the event description and the semantic similarity with the current subtask target; the boundary rule security assessment is obtained by traversing each rule in the security rule set and calculating the proportion of rules not violated.
[0020] As a further limitation of the first aspect of the present invention, the step of determining the execution strategy based on the relationship between the comprehensive credibility score and the preset threshold includes: when the comprehensive credibility score is greater than the automatic execution threshold, automatically executing the emergency dispatching instruction and the train timetable adjustment scheme; when the comprehensive credibility score is between the manual intervention threshold and the automatic execution threshold, triggering the large language model self-correction to generate an improved emergency dispatching instruction and train timetable adjustment scheme; when the comprehensive credibility score is not greater than the manual intervention threshold, transferring the emergency dispatching instruction and the train timetable adjustment scheme to experts for review.
[0021] As a further limitation of the first aspect of the present invention, the decision semantic consistency assessment is used to measure the degree of conflict between emergency dispatch instructions and retrieved knowledge and historical decisions, and is calculated by weighting the matching ratio of emergency dispatch instructions with parameters specified in the knowledge base and the semantic consistency score of emergency dispatch instructions with historical decision sequences.
[0022] As a further limitation of the first aspect of the present invention, in step S7, the decision state is defined as a five-tuple, including: event description, decision history sequence, knowledge set, scenario parameter set, and current system state; the state update rule includes: appending the current emergency dispatch instruction to the decision history sequence, merging newly retrieved knowledge into the knowledge set, and updating the scenario parameter set and system state according to the execution result; the termination condition includes any of the following situations: the emergency dispatch instruction is a scheme output type and the comprehensive credibility score of the train timetable adjustment scheme is greater than the automatic execution threshold; or the number of iterations reaches the preset maximum number of iterations, at which point the current optimal emergency dispatch instruction and train timetable adjustment scheme are transferred to experts for review.
[0023] Secondly, the present invention provides a rail transit emergency dispatching intelligent agent system based on subgraph retrieval and scene awareness, comprising:
[0024] The data acquisition interface module is used to receive real-time train operation data and emergency alarm information through a standard communication interface. The real-time train operation data includes the actual train location, running time, and section occupancy status.
[0025] The scene feature knowledge graph construction module is used to construct a scene feature knowledge graph containing feature node sets and knowledge node sets, and to establish multi-dimensional associations between feature nodes and knowledge nodes through relation edges;
[0026] The query feature subgraph construction module is used to extract scene feature elements from the event description, perform feature mapping in the scene feature knowledge graph, and construct a query feature subgraph.
[0027] The knowledge retrieval module is used to perform knowledge retrieval combining structural matching and semantic reordering, using the query feature subgraph as the retrieval unit.
[0028] The emergency dispatch instruction generation module is used to organize event descriptions and knowledge retrieval results into structured prompt inputs that include event elements, retrieval knowledge context, and decision history sequence. It generates structured emergency dispatch instructions that include instruction type, affected object identifier, operation parameters, and execution time window through a large language model.
[0029] The scene-aware timetable adjustment module is used to extract a structured scene parameter set from event descriptions and knowledge. The structured scene parameter set includes the set of affected trains, the set of affected sections, and time window parameters. The module performs constraint activation mapping through a scene-aware constraint activation function to dynamically determine the set of train operation constraints that need to be activated. The activated constraint set is then loaded as a constraint condition into a mixed-integer linear programming model for train operation adjustment. The model is solved with a multi-objective weighted optimization that includes train timetable deviation, delay time, and the number of service adjustments, to generate a train timetable adjustment scheme.
[0030] The credibility assessment module is used to assess the credibility of the emergency dispatch instructions and the train timetable adjustment plan from four dimensions: decision semantic consistency, instruction parameter validity, target scenario relevance, and boundary rule security. It calculates the comprehensive credibility score and determines the execution strategy based on the comprehensive credibility score.
[0031] The iterative control module is used to update the decision state based on the execution results and control the iterative execution of the emergency dispatch instruction generation module, the scene-aware operation graph adjustment module, and the credibility assessment module until the termination condition is met or the preset maximum number of iterations is reached.
[0032] The dispatch control output interface module is used to generate track section time and space occupancy status update instructions based on the train timetable adjustment scheme, and output the track section time and space occupancy status update instructions to the rail transit centralized dispatch control system through a standard communication interface, so as to drive the control nodes along the line to perform the corresponding physical control actions of train speed limit, stop or departure.
[0033] Thirdly, the present invention provides a non-transitory computer-readable storage medium for storing computer instructions, which, when executed by a processor, implement the rail transit emergency dispatching method based on subgraph retrieval and scene awareness as described in the first aspect.
[0034] Fourthly, the present invention provides a computer device including a memory and a processor, wherein the processor and the memory communicate with each other, the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the rail transit emergency dispatching method based on subgraph retrieval and scene awareness as described in the first aspect.
[0035] Fifthly, the present invention provides an electronic device, comprising: a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to cause the electronic device to execute instructions for implementing the rail transit emergency dispatching method based on subgraph retrieval and scene awareness as described in the first aspect.
[0036] Beneficial effects of this invention:
[0037] (1) By constructing a scene feature knowledge graph and using feature subgraphs as retrieval units, a knowledge retrieval paradigm shift from vector similarity matching to structural pattern matching and semantic similarity fusion was realized. This enables the retrieval of knowledge contexts containing complete rule dependencies, fundamentally solving the technical problem of fragmented retrieval results in traditional retrieval enhancement generation methods.
[0038] (2) Through the scene-aware operation graph adjustment mechanism, a reliable bridging channel is creatively established between the semantic understanding ability of the large language model and the accurate solution ability of the mixed integer linear programming model: the large language model is responsible for converting unstructured event descriptions into semi-structured scene parameter sets, and the scene-aware constraint activation function is responsible for mapping semi-structured scene parameters into strict binary constraint activation states, thereby transforming the constraint selection problem from the uncertain reasoning task of the model into a deterministic stylized scene classification and constraint mapping process, fundamentally eliminating the illusion risk when the large language model directly processes complex mathematical constraints, while reducing token processing overhead and reasoning complexity;
[0039] (3) Through a multi-dimensional credibility assessment framework, emergency dispatch instructions and train timetable adjustment schemes are structurally evaluated from four dimensions: decision semantic consistency, instruction parameter validity, target scenario relevance and boundary rule security. Combined with a three-level execution strategy routing and iterative self-correction mechanism, a systematic guarantee of the reliability of dispatch decisions is achieved.
[0040] (4) By organically integrating subgraph retrieval, emergency dispatch instruction generation, scene-aware operation graph adjustment, and credibility assessment into an intelligent agent iterative scheduling closed loop, and using a formal state management mechanism to ensure information consistency and contextual coherence in the multi-step decision chain, an end-to-end automated closed loop from event perception to the execution of physical control actions by the rail transit centralized dispatch control system is realized.
[0041] The advantages of additional aspects of the invention will be set forth more clearly in the following description or will be learned by practice of the invention. Attached Figure Description
[0042] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1 This is a schematic diagram of the overall architecture of the rail transit emergency dispatching intelligent agent system based on subgraph retrieval and scene awareness as described in an embodiment of the present invention.
[0044] Figure 2 This is a flowchart of the rail transit emergency dispatching method based on subgraph retrieval and scene awareness as described in an embodiment of the present invention. Detailed Implementation
[0045] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0046] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0047] It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with their meanings in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless defined as here.
[0048] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, and / or groups thereof.
[0049] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.
[0050] To facilitate understanding of the present invention, the present invention will be further explained and described below with reference to the accompanying drawings and specific embodiments. However, the specific embodiments do not constitute a limitation on the embodiments of the present invention.
[0051] Those skilled in the art should understand that the accompanying drawings are merely schematic diagrams of embodiments, and the components in the drawings are not necessarily essential for implementing the present invention.
[0052] This invention provides a rail transit emergency dispatching intelligent agent system and method based on subgraph retrieval and scene awareness. By constructing a scene feature knowledge graph and using feature subgraphs as retrieval units, it achieves accurate scene-aware knowledge retrieval. It creatively constructs a relay conversion mechanism of "unstructured semantics → semi-structured scene parameters → strict mathematical constraints": First, the unstructured event descriptions and knowledge texts are converted into a semi-structured scene parameter set through a large language model. Then, the semi-structured scene parameters are automatically mapped to the binary activation state of the corresponding constraints in the mixed-integer linear programming model through a scene-aware constraint activation function. This achieves a reliable bridge between natural language semantic understanding and strict mathematical constraint modeling, avoiding the illusionary risks of large language models directly processing mathematical constraints and the limitations of traditional optimization methods in understanding unstructured text. It also solves and generates train timetable adjustment schemes. The reliability of dispatching decisions is ensured through a multi-dimensional credibility evaluation framework and an iterative dispatching closed loop of the intelligent agent.
[0053] Example 1
[0054] In this embodiment 1, a rail transit emergency dispatching intelligent agent system based on subgraph retrieval and scene awareness is first provided. This system includes a processor and a memory deployed on a rail transit dispatching center server. The memory stores a computer program, and the processor executes the computer program to implement the functions of the following modules: a data acquisition interface module, used to receive real-time train operation data and emergency alarm information through a standard communication interface. The real-time train operation data includes the train's actual operating location, operating time, and section occupancy status. A scene feature knowledge graph construction module, used to construct a scene feature knowledge graph containing feature node sets and knowledge node sets, and establish multi-dimensional associations between feature nodes and knowledge nodes through relational edges. A query feature subgraph construction module, used to extract scene feature elements from event descriptions, perform feature mapping in the scene feature knowledge graph, and construct a query feature subgraph. A knowledge retrieval module, used to perform knowledge retrieval combining structural matching and semantic reordering using the query feature subgraph as the retrieval unit. The emergency dispatch instruction generation module organizes event descriptions and knowledge retrieval results into structured prompts containing event elements, retrieval knowledge context, and decision history sequences. It generates structured emergency dispatch instructions with instruction type, affected object identifier, operation parameters, and execution time windows using a large language model. The scenario-aware train schedule adjustment module extracts a structured scenario parameter set from event descriptions and knowledge. This set includes the affected train set, affected section set, and time window parameters. A scenario-aware constraint activation function is used for constraint activation mapping to dynamically determine the set of train operation constraints to be activated. This activated constraint set is then loaded as constraints into a mixed-integer linear programming model for train schedule adjustment. The model is solved using a multi-objective weighted optimization approach, considering train schedule deviation, delay time, and the number of service adjustments, to generate a train schedule adjustment scheme. The credibility assessment module evaluates the credibility of the emergency dispatch instructions and the train schedule adjustment scheme from four dimensions: decision semantic consistency, instruction parameter validity, target scenario relevance, and boundary rule security. It calculates a comprehensive credibility score and determines the execution strategy based on this score. The iterative control module updates the decision state based on the execution results and controls the iterative execution of the emergency dispatch instruction generation module, the scene-aware timetable adjustment module, and the credibility assessment module until the termination condition is met or the preset maximum number of iterations is reached. The dispatch control output interface module generates track section spatiotemporal occupancy status update instructions based on the train timetable adjustment scheme and outputs these instructions to the rail transit centralized dispatch control system via a standard communication interface to drive control nodes along the line to execute corresponding physical control actions such as train speed limits, stopping, or departure.
[0055] In this embodiment, the system further includes a decision visualization and interaction module, which is used to display the scores of each dimension of the multi-dimensional credibility assessment and the comprehensive credibility score on the user terminal interface, and generate expert review prompts and decision basis summaries on the user terminal interface when the comprehensive credibility score is not greater than the human intervention threshold.
[0056] In this embodiment, the above-described system is used to implement a computer-executed rail transit emergency dispatching method based on subgraph retrieval and scene awareness, including the following steps:
[0057] S1: Construct a scene feature knowledge graph, which includes a feature node set and a knowledge node set. The feature nodes represent scene feature attributes of domain knowledge, and the knowledge nodes correspond to semantically complete knowledge fragments. Establish multidimensional associations between the feature nodes and the knowledge nodes through relation edges.
[0058] S2: For the input event description, extract scene feature elements, perform feature mapping on the scene feature knowledge graph based on the scene feature elements, and construct a query feature subgraph;
[0059] S3: Using the query feature subgraph as the retrieval unit, perform an initial knowledge retrieval combining structural matching and semantic reordering to obtain knowledge retrieval results related to the event description;
[0060] S4: Enter the iterative scheduling optimization stage, organize the event description and the knowledge retrieval results into a structured prompt input containing event elements, retrieval knowledge context and decision history sequence, and generate a structured emergency dispatch instruction containing instruction type, affected object identifier, operation parameters and execution time window through a large language model;
[0061] S5: Based on the event description and the knowledge retrieval results, a structured scenario parameter set is extracted using a large language model. The structured scenario parameter set includes the affected train set, the affected section set, and the time window parameter. Based on the structured scenario parameter set, constraint activation mapping is performed using a scenario-aware constraint activation function to dynamically determine the set of train operation constraints to be activated. The scenario-aware constraint activation function is a combination of indicator functions. Based on the affected train set, the affected section set, and the time window parameter, the activation status of delay propagation constraints, speed limit operation constraints, and section closure constraints is independently determined. The activation status is a binary variable. When activated, the corresponding constraint takes effect; when not activated, the corresponding constraint degenerates into a basic constraint. The activated constraint set is loaded as constraint conditions into a mixed integer linear programming model for train operation adjustment. The model is solved with a multi-objective weighted optimization that includes train timetable deviation, delay time, and the number of service adjustments, generating a train timetable adjustment scheme.
[0062] S6: The credibility of the emergency dispatch command and the train timetable adjustment plan are evaluated from four dimensions: decision semantic consistency, command parameter validity, target scenario relevance and boundary rule security. The evaluation scores of each dimension are calculated, and the comprehensive credibility score is calculated by weighted summation. The execution strategy is determined according to the relationship between the comprehensive credibility score and the preset threshold.
[0063] S7: Update the decision state based on the execution result, and iterate through steps S4 to S6 until the comprehensive credibility score meets the termination condition or the number of iterations reaches the preset maximum number of iterations.
[0064] S8: After step S7 meets the termination condition, based on the train timetable adjustment scheme, a track section time and space occupancy status update instruction is generated, and the track section time and space occupancy status update instruction is output to the rail transit centralized dispatch control system to drive the control nodes along the line to perform the corresponding physical control actions of train speed limit, stop or departure, and complete the physical adjustment of the train operation status.
[0065] In step S1, the construction of the scene feature knowledge graph includes: automatically extracting scene feature types from the domain specification document using a large language model to form a feature node set, wherein the scene feature types include event type, severity, scope of impact, and relevant departments; segmenting the domain specification document into knowledge fragments according to the principle of semantic integrity to form a knowledge node set, and converting each knowledge node into a vector representation using a pre-trained language model; and automatically extracting the relationship edges between feature nodes and knowledge nodes based on a predefined set of domain relationship types using a large language model.
[0066] In step S2, the construction of the query feature subgraph includes: extracting scene feature elements from the event description using a large language model; calculating the similarity between the scene feature elements and the feature node set, filtering feature nodes with similarity exceeding a preset threshold to form a query feature node set; and constructing a query feature subgraph based on the association between nodes in the query feature node set.
[0067] In step S3, the knowledge retrieval combining structural matching and semantic reordering includes: a structural matching stage: calculating the structural matching degree between the query feature subgraph and the neighborhood feature subgraphs of each knowledge node, and filtering candidate knowledge nodes whose structural matching degree exceeds a preset threshold; the structural matching degree is calculated by the average maximum similarity between the query feature node and the neighborhood feature nodes of the knowledge node; a semantic reordering stage: performing vector encoding on the event description, calculating the semantic similarity between each candidate knowledge node and the event description, weighting and fusing the semantic similarity and structural matching degree to obtain a comprehensive relevance score, and selecting the top K knowledge nodes in descending order of the comprehensive relevance score as the final retrieval results.
[0068] In step S5, the activation condition for the delay propagation constraint is that the train belongs to the set of affected trains and the section belongs to the set of affected sections; the activation condition for the speed limit operation constraint is that the section belongs to the set of speed limit sections and the departure time is within the speed limit time window; the activation condition for the section blocking constraint is that the section belongs to the set of blocked sections and the planned departure time is within the blocking time window. In step S5, the objective function of the multi-objective weighted optimization is a weighted sum of minimizing train timetable deviation, minimizing total delay time, and minimizing the number of canceled trains.
[0069] In step S6, the decision semantic consistency assessment is obtained by weighting the matching ratio between the emergency dispatch instruction and the parameters specified in the knowledge base and the semantic consistency score with the historical decision sequence; the instruction parameter validity assessment is obtained by weighting the coverage of the required parameters and the format correctness of each parameter; the target scenario relevance assessment is obtained by weighting the overlap of the longest common subsequence between the emergency dispatch instruction text and the event description and the semantic similarity with the current subtask target; and the boundary rule security assessment is obtained by traversing each rule in the security rule set and calculating the proportion of rules that are not violated.
[0070] The step of determining the execution strategy based on the relationship between the comprehensive credibility score and a preset threshold includes: when the comprehensive credibility score is greater than the automatic execution threshold, automatically executing the emergency dispatching instruction and the train timetable adjustment plan; when the comprehensive credibility score is between the manual intervention threshold and the automatic execution threshold, triggering the large language model self-correction to generate an improved emergency dispatching instruction and train timetable adjustment plan; when the comprehensive credibility score is not greater than the manual intervention threshold, transferring the emergency dispatching instruction and the train timetable adjustment plan to experts for review.
[0071] The decision semantic consistency assessment measures the degree of conflict between emergency dispatch instructions and retrieved knowledge and historical decisions. It is calculated by weighting the matching ratio of emergency dispatch instructions with parameters specified in the knowledge base and the semantic consistency score between emergency dispatch instructions and historical decision sequences. The instruction parameter validity assessment verifies the completeness and format compliance of tool calls in emergency dispatch instructions. It is calculated by weighting the coverage of required parameters and the format accuracy of each parameter. The target scenario relevance assessment quantifies the responsiveness of emergency dispatch instructions to the current event. It is calculated by weighting the overlap of the longest common subsequence between the emergency dispatch instruction text and the event description and the semantic similarity between the emergency dispatch instruction and the current subtask target. The boundary rule security assessment verifies the compliance of emergency dispatch instructions with core security rules. It is calculated by traversing all rules in the security rule set, determining whether the emergency dispatch instruction violates each rule, and calculating the proportion of rules not violated.
[0072] In step S7, the decision state is defined as a quintuple, including: event description, decision history sequence, knowledge set, scenario parameter set, and current system state. The state update rules include: appending the current emergency dispatch instruction to the decision history sequence, merging newly retrieved knowledge into the knowledge set, and updating the scenario parameter set and system state based on the execution results. In step S7, the termination condition includes any of the following: the emergency dispatch instruction is a scheme output type and the comprehensive credibility score of the train timetable adjustment scheme is greater than the automatic execution threshold; or the number of iterations reaches the preset maximum number of iterations. In this case, the current optimal emergency dispatch instruction and train timetable adjustment scheme are transferred to experts for review.
[0073] Example 2
[0074] This embodiment provides a rail transit emergency dispatching intelligent agent system based on subgraph retrieval and scene awareness, including a processor and memory deployed on a rail transit dispatching center server, as well as a data acquisition interface module, a scene feature knowledge graph construction module, a query feature subgraph construction module, a knowledge retrieval module, an emergency dispatching instruction generation module, a scene-aware operation graph adjustment module, a credibility assessment module, an iterative control module, a dispatching control output interface module, and a decision visualization interaction module. Based on the above system, a rail transit emergency dispatching intelligent agent method based on subgraph retrieval and scene awareness, executed by a computer, is implemented, including the following steps:
[0075] S1: Construct a scene feature knowledge graph, which includes a feature node set and a knowledge node set. The feature nodes represent scene feature attributes of domain knowledge, and the knowledge nodes correspond to semantically complete knowledge fragments. Establish multidimensional associations between the feature nodes and the knowledge nodes through relation edges.
[0076] S2: For the input event description, extract scene feature elements, perform feature mapping on the scene feature knowledge graph based on the scene feature elements, and construct a query feature subgraph;
[0077] S3: Using the query feature subgraph as the retrieval unit, perform an initial knowledge retrieval combining structural matching and semantic reordering to obtain knowledge retrieval results related to the event description;
[0078] S4: Enter the iterative scheduling optimization stage, organize the event description and the knowledge retrieval results into a structured prompt input containing event elements, retrieval knowledge context and decision history sequence, and generate a structured emergency dispatch instruction containing instruction type, affected object identifier, operation parameters and execution time window through a large language model;
[0079] S5: Based on the event description and the knowledge retrieval results, a structured scenario parameter set is extracted using a large language model. The structured scenario parameter set includes the affected train set, the affected section set, and the time window parameter. Based on the structured scenario parameter set, constraint activation mapping is performed using a scenario-aware constraint activation function to dynamically determine the set of train operation constraints to be activated. The scenario-aware constraint activation function is a combination of indicator functions. Based on the affected train set, the affected section set, and the time window parameter, the activation status of delay propagation constraints, speed limit operation constraints, and section closure constraints is independently determined. The activation status is a binary variable. When activated, the corresponding constraint takes effect; when not activated, the corresponding constraint degenerates into a basic constraint. The activated constraint set is loaded as constraint conditions into a mixed integer linear programming model for train operation adjustment. The model is solved with a multi-objective weighted optimization that includes train timetable deviation, delay time, and the number of service adjustments, generating a train timetable adjustment scheme.
[0080] S6: The credibility of the emergency dispatch command and the train timetable adjustment plan are evaluated from four dimensions: decision semantic consistency, command parameter validity, target scenario relevance and boundary rule security. The evaluation scores of each dimension are calculated, and the comprehensive credibility score is calculated by weighted summation. The execution strategy is determined according to the relationship between the comprehensive credibility score and the preset threshold.
[0081] S7: Update the decision state based on the execution result, and iterate through steps S4 to S6 until the comprehensive credibility score meets the termination condition or the number of iterations reaches the preset maximum number of iterations.
[0082] S8: After step S7 meets the termination condition, based on the train timetable adjustment scheme, a track section time and space occupancy status update instruction is generated, and the track section time and space occupancy status update instruction is output to the rail transit centralized dispatch control system to drive the control nodes along the line to perform the corresponding physical control actions of train speed limit, stop or departure, and complete the physical adjustment of the train operation status.
[0083] The scene feature knowledge graph is constructed by automatically extracting feature nodes and knowledge nodes from domain specification documents. Feature nodes represent scene feature attributes, and knowledge nodes correspond to semantically complete knowledge fragments. Each knowledge node is converted into a vector representation through a pre-trained language model. The knowledge retrieval combining structural matching and semantic re-ranking includes: filtering candidate knowledge nodes by calculating the structural matching degree between the query feature subgraph and the neighborhood feature subgraph of the knowledge node, and then performing fine ranking by weighted fusion of semantic similarity and structural matching degree. The scene-aware constraint activation function is a combination of indicator functions, which independently determines the activation state of delay propagation constraints, speed limit operation constraints, and section closure constraints based on the affected train set, affected section set, and time window parameters, respectively. The activation state is a binary variable. The multi-dimensional credibility assessment includes four assessment dimensions: decision semantic consistency assessment, instruction parameter validity assessment, target scene relevance assessment, and boundary rule security assessment. The corresponding execution strategies include automatic execution, large language model self-correction, and expert intervention three-level routing.
[0084] Specifically, such as Figure 1 As shown, a scene feature knowledge graph is constructed. ,in For a set of nodes, This is a set of directed edges. The node set contains two types of nodes: ,in For the feature node set, This is a set of knowledge nodes.
[0085] Feature nodes Representing the scene-specific attributes of domain knowledge. Automatically extracting scene feature types from a large language model of the domain specification document set:
[0086]
[0087] in, A collection of domain specification documents, It is a predefined feature template that includes feature dimensions such as event type, severity, scope of impact, and relevant departments.
[0088] Knowledge Nodes Corresponding to semantically complete knowledge fragments. The domain specification document is divided into independent knowledge fragments according to the principle of semantic integrity. Each knowledge fragment contains independent processing rules or operational requirements. Each knowledge node. Transformed through a pre-trained language model 3D vector representation:
[0089]
[0090] Tie edge Establish multi-dimensional relationships between feature nodes and knowledge nodes. (One edge) Represents feature nodes With knowledge nodes There exists a type of Relationships:
[0091]
[0092] in, For a predefined set of domain relationship types.
[0093] In this embodiment, taking the field of traffic emergency dispatch as an example, the feature nodes include seven event type nodes, ten severity nodes, and nine disposal plan type nodes; the knowledge nodes are semantically complete disposal rule fragments extracted from technical management procedures; the relationship types include "event type" relationship, "severity" relationship, "disposal plan template" relationship, and "applicable conditions" relationship. All knowledge nodes are vectorized and stored in a graph database, and multidimensional associations are established with the feature nodes through relational edges.
[0094] In this embodiment, query feature subgraph construction and knowledge retrieval are performed, such as Figure 1 As shown, given the event description The system first extracts scene feature elements:
[0095]
[0096] Construct query feature subgraph Query feature node set Feature mapping from the knowledge graph feature node set The results obtained from the screening process are as follows:
[0097]
[0098] This indicates the relationships between query feature nodes:
[0099]
[0100] Knowledge retrieval employs a strategy that combines structural matching with semantic reordering.
[0101] In the structure matching phase, a set of candidate knowledge nodes that satisfy the constraints of the query feature subgraph is identified:
[0102]
[0103] The structural matching degree is defined as the average maximum similarity between the query feature node and the neighboring feature nodes of the knowledge node.
[0104]
[0105] For knowledge nodes The set of neighborhood feature nodes.
[0106] In the semantic reordering stage, event descriptions are vector-encoded, and overall relevance is calculated.
[0107]
[0108] in, For semantic similarity, the vector cosine distance is used for calculation: ; The normalized structural matching degree; These are the balancing parameters.
[0109] The final search results are:
[0110]
[0111] Taking the field of traffic emergency dispatch as an example, when receiving an event description of "65 mm of rainfall in a certain section in 1 hour", the system extracts scene feature elements including event type "operating in rainy weather", severity "65 mm / hour", and impact range "a certain section". After constructing a query feature subgraph based on these features, the system retrieves a complete knowledge context containing composite scene features such as "rainfall - speed limit level - section range" and their associated rules in one go through structure matching, rather than fragmented single rules.
[0112] In this embodiment, an emergency dispatch instruction generation, credibility assessment, and iterative dispatching closed loop are implemented.
[0113] Specifically, such as Figure 2 As shown, the intelligent agent is defined in the first... The state at each time step For a quintuple:
[0114]
[0115] in, For event description; For the historical sequence of decisions; A collection of knowledge obtained through knowledge retrieval; A set of scene parameters extracted from events and knowledge; This represents the current system state.
[0116] Each iteration cycle includes the following steps.
[0117] Step 1: Emergency dispatch instructions are generated. Based on the current state. Emergency dispatch instructions are generated using a large language model. :
[0118]
[0119] Emergency dispatch instructions The types include supplementary knowledge retrieval commands (used to expand the initial knowledge retrieval results of step S3 during the iteration process), parameter extraction commands (used to extract structured scenario parameters from events and knowledge to drive constraint activation), and scheme output commands.
[0120] Step two: Generating a scene-aware train schedule adjustment plan. Based on event descriptions and retrieved knowledge, a structured scene parameter set is extracted using a large language model. Based on this structured scene parameter set, a constraint activation mapping is performed using a scene-aware constraint activation function to dynamically determine the set of train operation constraints to be activated. This activated constraint set is then loaded as constraint conditions into a mixed-integer linear programming model for train operation adjustment. The model is solved with a multi-objective weighted optimization approach, encompassing train schedule deviation, delay time, and the number of service adjustments, to generate a train schedule adjustment plan. For a detailed implementation of this step, please refer to Example four.
[0121] Step 3: Multi-dimensional credibility assessment. This involves assessing the credibility of emergency dispatch instructions. A multi-dimensional evaluation of the train timetable adjustment plan was conducted to calculate a comprehensive credibility score:
[0122]
[0123] in, The definitions of each evaluation dimension are as follows.
[0124] Consistency assessment :Measure the degree of conflict between emergency dispatch instructions and retrieved knowledge and historical decisions:
[0125]
[0126] in, This refers to the number of parameters in the emergency dispatch instructions that match the specifications in the knowledge base. The consistency score between emergency dispatch instructions and historical decision sequences is calculated using a semantic similarity model.
[0127] effectiveness assessment Verify the completeness and format compliance of the parameters invoked in the emergency dispatch instructions for tool calls:
[0128]
[0129] in, For the set of parameters required for tool calls, This refers to the set of parameters actually provided in emergency dispatch instructions.
[0130] Correlation assessment Quantifying the degree of response of emergency dispatch instructions to the current event:
[0131]
[0132] in, Measure the longest common subsequence overlap between the emergency dispatch instruction text and the event description. The current subtask objective is dynamically generated based on decision history and event descriptions.
[0133] Security assessment Verify the compliance of emergency dispatch instructions with core safety rules:
[0134]
[0135] in, For a set of security rules, Determine whether emergency dispatch instructions violate rules .
[0136] Step four, execute policy routing. Based on the overall trust score... Determine the execution strategy:
[0137]
[0138] Step 5, State Update and Convergence Determination. Update the agent's state based on the execution result:
[0139]
[0140] The iterative process terminates when any of the following conditions are met:
[0141]
[0142] That is, when the agent generates an emergency dispatch command of the specified type and its credibility score exceeds the automatic execution threshold, the iteration terminates normally; when the number of iterations reaches a certain threshold... Reaching the preset maximum number of iterations When the iteration is terminated, the current optimal emergency dispatch instructions and train timetable adjustment plan will be transferred to experts for review.
[0143] like Figure 1 As shown in the figure, this embodiment describes in detail the specific implementation of the scene-aware runtime graph adjustment scheme generation in step S5.
[0144] First, a structured set of scene parameters is extracted from event descriptions and retrieved knowledge using a large language model:
[0145] The structured scenario parameter set includes scenario-related parameters such as the set of affected trains, the set of affected sections, and time window parameters.
[0146] Then, define the scene-aware activation function. This is a combination of indicator functions that independently determine the activation state of various constraints based on scene parameters. In the train timetable adjustment scenario, the activation function is defined as:
[0147]
[0148] in, For indicator functions; , , Three types of constraint sets are activated: delay propagation, speed limiting, and interval blocking. When an activation function value is 0, the corresponding constraint degenerates into a basic constraint; when the activation function value is 1, the corresponding scenario-specific constraint takes effect.
[0149] Based on scene parameter set The activation function dynamically determines the constraint activation state:
[0150]
[0151] This mechanism separates constraint selection from the reasoning task of large language models, transforming it into a reliable, stylized process of scene recognition and constraint mapping. This avoids the illusion problem when large language models deal with complex mathematical constraints, while also reducing token processing overhead.
[0152] The mathematical optimization model is a mixed-integer linear programming model for train operation adjustment, and its objective function is to minimize the weighted sum of train timetable deviation, total delay time, and the number of canceled trains:
[0153]
[0154] in, Represents objects ,Location and event type The event being represented; and These are the adjusted time and the planned time, respectively. It is a binary variable indicating whether the object is canceled. In position Operation; , These are non-negative weighting coefficients.
[0155] The basic constraint set includes:
[0156] Safety interval constraints ensure that a minimum safety interval is met between adjacent events at the same location:
[0157]
[0158] in, This is the minimum safe interval between adjacent events. A binary variable representing the chronological order of events. It is a sufficiently large positive number.
[0159] Event order uniqueness constraint: .
[0160] Dynamic constraints controlled by scene-aware constraint activation functions include:
[0161] Constraints on delayed propagation: ;
[0162] Speed-limited operation time constraints: ;
[0163] Interval blocking constraints: .
[0164] When the corresponding activation function value When dynamic constraints degenerate into basic constraints or become ineffective; when At that time, scenario-specific additional constraints take effect.
[0165] In this embodiment, taking railway emergency dispatch as a specific application scenario, the complete implementation process of the rail transit emergency dispatch method based on subgraph retrieval and scene awareness is described.
[0166] Scenario: A high-speed railway section operates 260 trains, covering the period from 6:00 to 24:00. The rainfall monitoring subsystem issues an alarm: "Rainfall in a certain section reached 65 mm in 1 hour, and is expected to continue for 1 hour. Request the generation of emergency dispatch instructions and train timetable adjustment plans."
[0167] Steps S1 to S3 (Initial Stage): The system receives alarm information from the rainfall monitoring subsystem through the data acquisition interface module, extracts scene features from the event description (event type: operation in rainy weather; severity: 65 mm / hour; impact range: a certain interval), constructs a query feature subgraph, and retrieves relevant technical management regulations through structural matching and semantic reordering, including regulations such as "when the hourly rainfall reaches 60 mm or more, the speed limit is 45 km / h".
[0168] Steps S4 to S5 (Generation of Emergency Dispatch Instructions and Train Timetable Adjustment Scheme): Based on the retrieved procedures and event descriptions, the large language model generates structured emergency dispatch instructions (temporary speed limit orders), including parameters such as speed limit value, applicable section, and effective time. Through a scenario-aware timetable adjustment mechanism, the system identifies the scenario type as "speed-limited operation." The scenario-aware constraint activation function automatically sets the activation state of the speed-limited operation constraint to 1, while keeping the activation state of the delay propagation constraint and section blocking constraint at 0. The activated speed-limited operation constraint set and additional running time parameters are loaded into a mixed-integer linear programming model for solution, generating the adjusted train timetable.
[0169] Steps S6 to S7 (Evaluation and Termination): The system evaluates the credibility of emergency dispatch instructions and adjusted train schedules from four dimensions: decision semantic consistency, instruction parameter validity, target scenario relevance, and boundary rule security. If the overall credibility score exceeds the automatic execution threshold, the iteration terminates.
[0170] Step S8 (Physical Control Execution): The system generates a track section space-time occupancy status update instruction based on the train timetable adjustment scheme. The instruction is output to the railway centralized dispatching and control system through the dispatching control output interface module, driving the control nodes along the line to perform speed limit control on the affected section, thus completing the adjustment of the train operation status.
[0171] Example 3
[0172] This embodiment 3 provides a non-transitory computer-readable storage medium for storing computer instructions. When the computer instructions are executed by a processor, they implement the rail transit emergency dispatching method based on subgraph retrieval and scene awareness as described above. The method includes:
[0173] S1: Construct a scene feature knowledge graph, which includes a feature node set and a knowledge node set. The feature nodes represent scene feature attributes of domain knowledge, and the knowledge nodes correspond to semantically complete knowledge fragments. Establish multidimensional associations between the feature nodes and the knowledge nodes through relation edges.
[0174] S2: For the input event description, extract scene feature elements, perform feature mapping on the scene feature knowledge graph based on the scene feature elements, and construct a query feature subgraph;
[0175] S3: Using the query feature subgraph as the retrieval unit, perform an initial knowledge retrieval combining structural matching and semantic reordering to obtain knowledge retrieval results related to the event description;
[0176] S4: Enter the iterative scheduling optimization stage, organize the event description and the knowledge retrieval results into a structured prompt input containing event elements, retrieval knowledge context and decision history sequence, and generate a structured emergency dispatch instruction containing instruction type, affected object identifier, operation parameters and execution time window through a large language model;
[0177] S5: Based on the event description and the knowledge retrieval results, a structured scenario parameter set is extracted using a large language model. The structured scenario parameter set includes the affected train set, the affected section set, and the time window parameter. Based on the structured scenario parameter set, constraint activation mapping is performed using a scenario-aware constraint activation function to dynamically determine the set of train operation constraints to be activated. The scenario-aware constraint activation function is a combination of indicator functions. Based on the affected train set, the affected section set, and the time window parameter, the activation status of delay propagation constraints, speed limit operation constraints, and section closure constraints is independently determined. The activation status is a binary variable. When activated, the corresponding constraint takes effect; when not activated, the corresponding constraint degenerates into a basic constraint. The activated constraint set is loaded as constraint conditions into a mixed integer linear programming model for train operation adjustment. The model is solved with a multi-objective weighted optimization that includes train timetable deviation, delay time, and the number of service adjustments, generating a train timetable adjustment scheme.
[0178] S6: The credibility of the emergency dispatch command and the train timetable adjustment plan are evaluated from four dimensions: decision semantic consistency, command parameter validity, target scenario relevance and boundary rule security. The evaluation scores of each dimension are calculated, and the comprehensive credibility score is calculated by weighted summation. The execution strategy is determined according to the relationship between the comprehensive credibility score and the preset threshold.
[0179] S7: Update the decision state based on the execution result, and iterate through steps S4 to S6 until the comprehensive credibility score meets the termination condition or the number of iterations reaches the preset maximum number of iterations.
[0180] S8: After step S7 meets the termination condition, based on the train timetable adjustment scheme, a track section time and space occupancy status update instruction is generated, and the track section time and space occupancy status update instruction is output to the rail transit centralized dispatch control system to drive the control nodes along the line to perform the corresponding physical control actions of train speed limit, stop or departure, and complete the physical adjustment of the train operation status.
[0181] Example 4
[0182] This embodiment 4 provides a computer device, including a memory and a processor. The processor and the memory communicate with each other. The memory stores program instructions that can be executed by the processor. The processor calls the program instructions to execute the rail transit emergency dispatching method based on subgraph retrieval and scene awareness as described above. The method includes:
[0183] S1: Construct a scene feature knowledge graph, which includes a feature node set and a knowledge node set. The feature nodes represent scene feature attributes of domain knowledge, and the knowledge nodes correspond to semantically complete knowledge fragments. Establish multidimensional associations between the feature nodes and the knowledge nodes through relation edges.
[0184] S2: For the input event description, extract scene feature elements, perform feature mapping on the scene feature knowledge graph based on the scene feature elements, and construct a query feature subgraph;
[0185] S3: Using the query feature subgraph as the retrieval unit, perform an initial knowledge retrieval combining structural matching and semantic reordering to obtain knowledge retrieval results related to the event description;
[0186] S4: Enter the iterative scheduling optimization stage, organize the event description and the knowledge retrieval results into a structured prompt input containing event elements, retrieval knowledge context and decision history sequence, and generate a structured emergency dispatch instruction containing instruction type, affected object identifier, operation parameters and execution time window through a large language model;
[0187] S5: Based on the event description and the knowledge retrieval results, a structured scenario parameter set is extracted using a large language model. The structured scenario parameter set includes the affected train set, the affected section set, and the time window parameter. Based on the structured scenario parameter set, constraint activation mapping is performed using a scenario-aware constraint activation function to dynamically determine the set of train operation constraints to be activated. The scenario-aware constraint activation function is a combination of indicator functions. Based on the affected train set, the affected section set, and the time window parameter, the activation status of delay propagation constraints, speed limit operation constraints, and section closure constraints is independently determined. The activation status is a binary variable. When activated, the corresponding constraint takes effect; when not activated, the corresponding constraint degenerates into a basic constraint. The activated constraint set is loaded as constraint conditions into a mixed integer linear programming model for train operation adjustment. The model is solved with a multi-objective weighted optimization that includes train timetable deviation, delay time, and the number of service adjustments, generating a train timetable adjustment scheme.
[0188] S6: The credibility of the emergency dispatch command and the train timetable adjustment plan are evaluated from four dimensions: decision semantic consistency, command parameter validity, target scenario relevance and boundary rule security. The evaluation scores of each dimension are calculated, and the comprehensive credibility score is calculated by weighted summation. The execution strategy is determined according to the relationship between the comprehensive credibility score and the preset threshold.
[0189] S7: Update the decision state based on the execution result, and iterate through steps S4 to S6 until the comprehensive credibility score meets the termination condition or the number of iterations reaches the preset maximum number of iterations.
[0190] S8: After step S7 meets the termination condition, based on the train timetable adjustment scheme, a track section time and space occupancy status update instruction is generated, and the track section time and space occupancy status update instruction is output to the rail transit centralized dispatch control system to drive the control nodes along the line to perform the corresponding physical control actions of train speed limit, stop or departure, and complete the physical adjustment of the train operation status.
[0191] Example 5
[0192] This embodiment 5 provides an electronic device, including: a processor, a memory, and a computer program; wherein, the processor is connected to the memory, and the computer program is stored in the memory. When the electronic device is running, the processor executes the computer program stored in the memory, so that the electronic device executes instructions to implement the rail transit emergency dispatching method based on subgraph retrieval and scene awareness as described above. The method includes:
[0193] S1: Construct a scene feature knowledge graph, which includes a feature node set and a knowledge node set. The feature nodes represent scene feature attributes of domain knowledge, and the knowledge nodes correspond to semantically complete knowledge fragments. Establish multidimensional associations between the feature nodes and the knowledge nodes through relation edges.
[0194] S2: For the input event description, extract scene feature elements, perform feature mapping on the scene feature knowledge graph based on the scene feature elements, and construct a query feature subgraph;
[0195] S3: Using the query feature subgraph as the retrieval unit, perform an initial knowledge retrieval combining structural matching and semantic reordering to obtain knowledge retrieval results related to the event description;
[0196] S4: Enter the iterative scheduling optimization stage, organize the event description and the knowledge retrieval results into a structured prompt input containing event elements, retrieval knowledge context and decision history sequence, and generate a structured emergency dispatch instruction containing instruction type, affected object identifier, operation parameters and execution time window through a large language model;
[0197] S5: Based on the event description and the knowledge retrieval results, a structured scenario parameter set is extracted using a large language model. The structured scenario parameter set includes the affected train set, the affected section set, and the time window parameter. Based on the structured scenario parameter set, constraint activation mapping is performed using a scenario-aware constraint activation function to dynamically determine the set of train operation constraints to be activated. The scenario-aware constraint activation function is a combination of indicator functions. Based on the affected train set, the affected section set, and the time window parameter, the activation status of delay propagation constraints, speed limit operation constraints, and section closure constraints is independently determined. The activation status is a binary variable. When activated, the corresponding constraint takes effect; when not activated, the corresponding constraint degenerates into a basic constraint. The activated constraint set is loaded as constraint conditions into a mixed integer linear programming model for train operation adjustment. The model is solved with a multi-objective weighted optimization that includes train timetable deviation, delay time, and the number of service adjustments, generating a train timetable adjustment scheme.
[0198] S6: The credibility of the emergency dispatch command and the train timetable adjustment plan are evaluated from four dimensions: decision semantic consistency, command parameter validity, target scenario relevance and boundary rule security. The evaluation scores of each dimension are calculated, and the comprehensive credibility score is calculated by weighted summation. The execution strategy is determined according to the relationship between the comprehensive credibility score and the preset threshold.
[0199] S7: Update the decision state based on the execution result, and iterate through steps S4 to S6 until the comprehensive credibility score meets the termination condition or the number of iterations reaches the preset maximum number of iterations.
[0200] S8: After step S7 meets the termination condition, based on the train timetable adjustment scheme, a track section time and space occupancy status update instruction is generated, and the track section time and space occupancy status update instruction is output to the rail transit centralized dispatch control system to drive the control nodes along the line to perform the corresponding physical control actions of train speed limit, stop or departure, and complete the physical adjustment of the train operation status.
[0201] In summary, this invention provides a rail transit emergency dispatching intelligent agent system and method based on subgraph retrieval and scene awareness, relating to the fields of artificial intelligence and knowledge engineering. The method includes: constructing a scene feature knowledge graph containing feature node sets and knowledge node sets; constructing a query feature subgraph for event descriptions and performing knowledge retrieval combining structure matching and semantic reordering; entering the intelligent agent iterative dispatching optimization stage, generating structured emergency dispatching instructions through a large language model; mapping semi-structured scene parameters to binary constraint activation states through a scene-aware constraint activation function, loading them into a mixed-integer linear programming model to generate train timetable adjustment schemes; evaluating credibility from four dimensions: decision semantic consistency, instruction parameter validity, target scene relevance, and boundary rule safety; iteratively updating the decision state until termination conditions are met, and then outputting the adjustment scheme to the rail transit centralized dispatching control system to drive physical control actions. This invention establishes a reliable bridge between the large language model and the mixed-integer linear programming model through a scene-aware constraint activation function, avoiding the illusion problem of the large language model handling mathematical constraints, and ensuring the reliability of dispatching decisions through multi-dimensional credibility evaluation.
[0202] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0203] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0204] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0205] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment, whereby a series of operational steps are performed to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0206] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that, based on the technical solutions disclosed in the present invention, various modifications or variations that can be made by those skilled in the art without creative effort should be included within the scope of protection of the present invention.
Claims
1. A rail transit emergency dispatching method based on subgraph retrieval and scene awareness, characterized in that, include: S1: Construct a scene feature knowledge graph, which includes a feature node set and a knowledge node set. The feature nodes represent scene feature attributes of domain knowledge, and the knowledge nodes correspond to semantically complete knowledge fragments. Establish multidimensional associations between the feature nodes and the knowledge nodes through relation edges. S2: For the input event description, extract scene feature elements, perform feature mapping on the scene feature knowledge graph based on the scene feature elements, and construct a query feature subgraph; S3: Using the query feature subgraph as the retrieval unit, perform an initial knowledge retrieval combining structural matching and semantic reordering to obtain knowledge retrieval results related to the event description; S4: Enter the iterative scheduling optimization stage, organize the event description and the knowledge retrieval results into a structured prompt input containing event elements, retrieval knowledge context and decision history sequence, and generate a structured emergency dispatch instruction containing instruction type, affected object identifier, operation parameters and execution time window through a large language model; S5: Based on the event description and the knowledge retrieval results, extract a structured scenario parameter set through a large language model. The structured scenario parameter set includes the set of affected trains, the set of affected sections, and time window parameters. Based on the structured scenario parameter set, constraint activation mapping is performed through a scenario-aware constraint activation function to dynamically determine the set of train operation constraints to be activated. The scenario-aware constraint activation function is a combination of indicator functions. Based on the set of affected trains, the set of affected sections, and the time window parameter, the activation status of delay propagation constraints, speed limit operation constraints, and section closure constraints is determined independently. The activation status is a binary variable. When activated, the corresponding constraint takes effect; when not activated, the corresponding constraint degenerates into a basic constraint. The activated constraint set is loaded as constraint conditions into a mixed integer linear programming model for train operation adjustment. The model is solved with a multi-objective weighted optimization that includes train timetable deviation, delay time, and the number of service adjustments, generating a train timetable adjustment scheme. S6: The credibility of the emergency dispatch command and the train timetable adjustment plan are evaluated from four dimensions: decision semantic consistency, command parameter validity, target scenario relevance and boundary rule security. The evaluation scores of each dimension are calculated, and the comprehensive credibility score is calculated by weighted summation. The execution strategy is determined according to the relationship between the comprehensive credibility score and the preset threshold. S7: Update the decision state based on the execution result, and iterate through steps S4 to S6 until the comprehensive credibility score meets the termination condition or the number of iterations reaches the preset maximum number of iterations. S8: After step S7 meets the termination condition, based on the train timetable adjustment scheme, a track section time and space occupancy status update instruction is generated, and the track section time and space occupancy status update instruction is output to the rail transit centralized dispatch control system to drive the control nodes along the line to perform the corresponding physical control actions of train speed limit, stop or departure, and complete the physical adjustment of the train operation status.
2. The rail transit emergency dispatching method based on subgraph retrieval and scene awareness according to claim 1, characterized in that, In step S1, the construction of the scene feature knowledge graph includes: automatically extracting scene feature types from the domain specification document using a large language model to form a feature node set, wherein the scene feature types include event type, severity, scope of impact, and relevant departments; segmenting the domain specification document into knowledge fragments according to the principle of semantic integrity to form a knowledge node set, and converting each knowledge node into a vector representation using a pre-trained language model; and automatically extracting the relationship edges between feature nodes and knowledge nodes based on a predefined set of domain relationship types using a large language model.
3. The rail transit emergency dispatching method based on subgraph retrieval and scene awareness according to claim 1, characterized in that, In step S2, the construction of the query feature subgraph includes: extracting scene feature elements from the event description using a large language model; calculating the similarity between the scene feature elements and the feature node set, filtering feature nodes with similarity exceeding a preset threshold to form a query feature node set; and constructing a query feature subgraph based on the association between nodes in the query feature node set.
4. The rail transit emergency dispatching method based on subgraph retrieval and scene awareness according to claim 1, characterized in that, In step S3, the knowledge retrieval combining structural matching and semantic reordering includes: a structural matching stage: calculating the structural matching degree between the query feature subgraph and the neighborhood feature subgraphs of each knowledge node, and filtering candidate knowledge nodes whose structural matching degree exceeds a preset threshold; the structural matching degree is calculated by the average maximum similarity between the query feature node and the neighborhood feature nodes of the knowledge node; a semantic reordering stage: performing vector encoding on the event description, calculating the semantic similarity between each candidate knowledge node and the event description, weighting and fusing the semantic similarity and structural matching degree to obtain a comprehensive relevance score, and selecting the top K knowledge nodes in descending order of the comprehensive relevance score as the final retrieval results.
5. The rail transit emergency dispatching method based on subgraph retrieval and scene awareness according to claim 1, characterized in that, In step S5, the activation condition for the delay propagation constraint is that the train belongs to the set of affected trains and the section belongs to the set of affected sections; the activation condition for the speed limit operation constraint is that the section belongs to the set of speed limit sections and the departure time is within the speed limit time window; the activation condition for the section blocking constraint is that the section belongs to the set of blocked sections and the planned departure time is within the blocking time window; the objective function of the multi-objective weighted optimization is the weighted sum of minimizing train timetable deviation, minimizing total delay time, and minimizing the number of canceled trains.
6. The rail transit emergency dispatching method based on subgraph retrieval and scene awareness according to claim 1, characterized in that, In step S6, the decision semantic consistency assessment is obtained by weighting the matching ratio between the emergency dispatch instruction and the parameters specified in the knowledge base and the semantic consistency score with the historical decision sequence; the instruction parameter validity assessment is obtained by weighting the coverage of the required parameters and the format correctness of each parameter; the target scenario relevance assessment is obtained by weighting the overlap of the longest common subsequence between the emergency dispatch instruction text and the event description and the semantic similarity with the current subtask target. The security assessment of the boundary rules is obtained by traversing all rules in the security rule set and calculating the proportion of rules that are not violated.
7. The rail transit emergency dispatching method based on subgraph retrieval and scene awareness according to claim 6, characterized in that, The step of determining the execution strategy based on the relationship between the comprehensive credibility score and a preset threshold includes: when the comprehensive credibility score is greater than the automatic execution threshold, automatically executing the emergency dispatching instruction and the train timetable adjustment plan; when the comprehensive credibility score is between the manual intervention threshold and the automatic execution threshold, triggering the large language model self-correction to generate an improved emergency dispatching instruction and train timetable adjustment plan; when the comprehensive credibility score is not greater than the manual intervention threshold, transferring the emergency dispatching instruction and the train timetable adjustment plan to experts for review.
8. The rail transit emergency dispatching method based on subgraph retrieval and scene awareness according to claim 6, characterized in that, The decision semantic consistency assessment is used to measure the degree of conflict between emergency dispatch instructions and retrieved knowledge and historical decisions. It is calculated by weighting the matching ratio of emergency dispatch instructions with parameters specified by the knowledge base and the semantic consistency score of emergency dispatch instructions with historical decision sequences.
9. The rail transit emergency dispatching method based on subgraph retrieval and scene awareness according to claim 1, characterized in that, In step S7, the decision state is defined as a quintuple, which includes: event description, decision history sequence, knowledge set, scenario parameter set, and current system state; The status update rules include: appending the current emergency dispatch instructions to the decision history sequence, merging newly retrieved knowledge into the knowledge set, and updating the scenario parameter set and system status according to the execution results; The termination conditions include any of the following: the emergency dispatch instruction is a scheme output type and the comprehensive credibility score of the train timetable adjustment scheme is greater than the automatic execution threshold; or the number of iterations reaches the preset maximum number of iterations. In this case, the current optimal emergency dispatch instruction and train timetable adjustment scheme will be transferred to experts for review.
10. A rail transit emergency dispatching intelligent agent system based on subgraph retrieval and scene awareness, characterized in that, include: The data acquisition interface module is used to receive real-time train operation data and emergency alarm information through a standard communication interface. The real-time train operation data includes the actual train location, running time, and section occupancy status. The scene feature knowledge graph construction module is used to construct a scene feature knowledge graph containing feature node sets and knowledge node sets, and to establish multi-dimensional associations between feature nodes and knowledge nodes through relation edges; The query feature subgraph construction module is used to extract scene feature elements from the event description, perform feature mapping in the scene feature knowledge graph, and construct the query feature subgraph. The knowledge retrieval module is used to perform knowledge retrieval combining structural matching and semantic reordering, using the query feature subgraph as the retrieval unit. The emergency dispatch instruction generation module is used to organize event descriptions and knowledge retrieval results into structured prompt inputs that include event elements, retrieval knowledge context, and decision history sequence. It generates structured emergency dispatch instructions that include instruction type, affected object identifier, operation parameters, and execution time window through a large language model. The scene-aware timetable adjustment module is used to extract a structured scene parameter set from event descriptions and knowledge. The structured scene parameter set includes the set of affected trains, the set of affected sections, and time window parameters. The module performs constraint activation mapping through a scene-aware constraint activation function to dynamically determine the set of train operation constraints that need to be activated. The activated constraint set is then loaded as a constraint condition into a mixed-integer linear programming model for train operation adjustment. The model is solved with a multi-objective weighted optimization that includes train timetable deviation, delay time, and the number of service adjustments, to generate a train timetable adjustment scheme. The credibility assessment module is used to assess the credibility of the emergency dispatch instructions and the train timetable adjustment plan from four dimensions: decision semantic consistency, instruction parameter validity, target scenario relevance, and boundary rule security. It calculates the comprehensive credibility score and determines the execution strategy based on the comprehensive credibility score. The iterative control module is used to update the decision state based on the execution results and control the iterative execution of the emergency dispatch instruction generation module, the scene-aware operation graph adjustment module, and the credibility assessment module until the termination condition is met or the preset maximum number of iterations is reached. The dispatch control output interface module is used to generate track section time and space occupancy status update instructions based on the train timetable adjustment scheme, and output the track section time and space occupancy status update instructions to the rail transit centralized dispatch control system through a standard communication interface, so as to drive the control nodes along the line to perform the corresponding physical control actions of train speed limit, stop or departure.