Rail transit passenger flow prediction method and system based on traffic interpretable large model

By constructing a knowledge graph in the transportation field and combining it with the causal logic guidance and consistency verification of a large language model, the problems of explanation illusion and insufficient prediction accuracy in existing models are solved, and the integration of high accuracy and interpretability in rail transit passenger flow prediction is achieved.

CN122155011APending Publication Date: 2026-06-05QINGDAO UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
QINGDAO UNIV
Filing Date
2026-02-27
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing rail transit passenger flow prediction models are prone to generating illusions that violate the laws of traffic physics during the generation and interpretation process, and have failed to establish a closed-loop coupling mechanism between semantic interpretation and numerical prediction, making it difficult to achieve both prediction accuracy and interpretability.

Method used

We construct a knowledge graph for the transportation sector, use a large language model for causal logic-guided chain-like reasoning, combine the knowledge graph with factual consistency verification and correction, integrate causal logic information with the spatiotemporal characteristics of historical passenger flow data, and output passenger flow prediction values ​​and natural language interpretation reports.

Benefits of technology

It achieves synergistic optimization of passenger flow prediction accuracy and interpretability, ensuring that the generated explanations conform to traffic physics laws, improving the model's responsiveness and prediction robustness in emergency scenarios, and providing credible explanations for high-risk operational decisions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122155011A_ABST
    Figure CN122155011A_ABST
Patent Text Reader

Abstract

The application discloses a rail transit passenger flow prediction method and system based on a traffic interpretable large model, and the method comprises the following steps: constructing a traffic field knowledge graph, constructing an input instruction containing a cause-effect logic guide based on obtained historical passenger flow data and external environment information; triggering the thinking chain reasoning of a preset large language model based on the input instruction to generate reasoning text containing a cause-effect logic chain, and performing fact consistency verification and correction on the reasoning text through the knowledge graph to obtain verified cause-effect logic information; fusing the cause-effect logic information and the spatiotemporal characteristics of the historical passenger flow data to obtain fusion characteristics; and outputting a passenger flow prediction value of a future period and a corresponding natural language explanation report based on the fusion characteristics. Through the knowledge graph, the thinking chain reasoning of the large language model is constrained, and the cause-effect logic information and the spatiotemporal numerical characteristics are fused, so that the collaborative optimization of the passenger flow prediction accuracy and the interpretability is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent traffic flow prediction technology, and in particular to a method and system for predicting rail transit passenger flow based on a large traffic interpretable model. Background Technology

[0002] Urban rail transit passenger flow forecasting is one of the core functions of intelligent transportation systems, and its technological evolution has undergone a paradigm shift from traditional statistical models to deep learning, and then to large language models. Early statistical-based forecasting models, while computationally simple, struggled to capture the nonlinear spatiotemporal dependencies of passenger flow. With the introduction of graph convolutional neural networks and the Transformer architecture, deep learning models, such as ST-GCN and GCN-Transformer, have achieved high prediction accuracy in conventional scenarios by explicitly modeling the road network topology and long-range time dependencies. However, these models are essentially end-to-end numerical fitting systems, and their internal decision-making processes are completely unobservable. When the prediction results are used for high-risk operational decisions such as station closures and passenger flow restrictions, dispatchers cannot know the causal basis of the model's judgments, severely restricting the reliable application of artificial intelligence systems in critical rail transit safety scenarios.

[0003] To overcome the limitations of the "black box" approach, recent research has attempted to introduce large language models into the field of passenger flow prediction. Through techniques such as Prompt engineering or adapter fine-tuning, these models can generate natural language explanations that include trend descriptions. However, due to the lack of hard constraints from domain knowledge, such methods are prone to generating illusions that violate traffic physics when generating explanations. For example, they might fabricate non-existent line faults as the cause of passenger flow declines, or generate attribution analyses that logically contradict numerical prediction results. More importantly, existing technologies have failed to establish a closed-loop coupling mechanism between semantic explanation and numerical prediction. This results in the explanation content being merely an additional text generation result, unable to substantially guide or correct the prediction process, creating a technical dilemma where prediction accuracy and interpretability are difficult to reconcile. Therefore, there is an urgent need for a technical solution that can deeply integrate causal logical reasoning with numerical prediction, providing credible explanations that conform to traffic physics and have causal traceability while ensuring prediction accuracy. Summary of the Invention

[0004] In view of this, this invention proposes a method and system for predicting rail transit passenger flow based on a large-scale interpretable traffic model, which can achieve synergistic optimization of passenger flow prediction accuracy and interpretability. This invention provides the following technical solution: A method for predicting rail transit passenger flow based on a large-scale interpretable traffic model, the method comprising: Construct a knowledge graph in the transportation domain, which includes entities related to rail transit passenger flow and the causal relationships between entities; Based on the acquired historical passenger flow data and external environment information, input instructions guided by causal logic are constructed. Based on the input command, the thought chain reasoning of the preset large language model is triggered to generate reasoning text containing causal logic chains, and the reasoning text is verified and corrected for factual consistency through the knowledge graph to obtain verified causal logic information. By integrating the causal logic information with the spatiotemporal characteristics of the historical passenger flow data, a fused feature is obtained; Based on the fusion features, the system outputs passenger flow forecasts for future time periods and corresponding natural language interpretation reports.

[0005] Optionally, the construction of the transportation domain knowledge graph includes: Define the entity set and relation set of the knowledge graph; The entity set includes at least physical entities and environmental entities that characterize the physical structure of the rail transit network; The set of relationships includes at least topological relationships that characterize the connections between stations, and causal relationships that characterize the impact of external environments or events on passenger flow.

[0006] Optionally, the construction including causal logic-guided input instructions includes: The acquired historical passenger flow data is converted into a natural language description representing the trend of passenger flow changes. The acquired external environmental information is encoded into semantic descriptions that characterize the relationship between environmental events and passenger flow; The natural language description, the semantic description, and the guiding instructions used to trigger the large language model to perform step-by-step causal reasoning are combined to form an input instruction that includes causal logic guidance.

[0007] Optionally, the step of performing fact consistency verification and correction on the reasoning text using the knowledge graph includes: Extract entity pairs from the reasoning text and query the semantic relationships between the entity pairs based on the knowledge graph; Calculate the consistency score between the semantic relationships implied in the reasoning text and the semantic relationships retrieved from the knowledge graph; The consistency score is used to determine whether the inference text passes the verification. If the verification fails, a correction instruction is generated based on the semantic relationships in the knowledge graph, and the preset large language model is re-triggered to generate new reasoning text based on the correction instruction, until the verification is passed or the preset correction limit is reached.

[0008] Optionally, the fusion of the causal logic information and the spatiotemporal features of the historical passenger flow data to obtain the fused features includes: The causal logic information is mapped to a semantic feature vector, the spatiotemporal features of the historical passenger flow data are mapped to a numerical feature vector, and the two are aligned in dimensions. Using the semantic feature vector as the query vector and the numerical feature vector as the key vector and value vector, feature interaction is performed through a cross-attention mechanism to generate a semantically guided numerical context representation. The fused features are obtained by dynamically fusing the numerical context representation with the original numerical feature vector using learnable gating parameters.

[0009] Optionally, the step of outputting the passenger flow prediction value for future time periods and the corresponding natural language interpretation report based on the fused features includes: The fused features are input into the predictive regression model, which outputs the passenger flow forecast for future time periods. Based on the aforementioned causal logic information, a natural language text containing attribution analysis of passenger flow changes and prediction confidence level descriptions is generated as a natural language interpretation report.

[0010] Optionally, the gating parameter is determined based on the consistency score obtained in the fact consistency check: When the consistency score is higher than the preset threshold, the value of the gating parameter is set to be larger, so that the fused feature contains more information of numerical context representation; When the consistency score is lower than or equal to the preset threshold, the value of the gating parameter is set to be smaller, making the fused feature more dependent on the numerical feature vector.

[0011] This invention further discloses a rail transit passenger flow prediction system based on a large interpretable traffic model, comprising: A knowledge graph construction module is used to construct a knowledge graph in the transportation field, which contains entities related to rail transit passenger flow and the causal relationships between entities. The instruction generation module is used to construct input instructions guided by causal logic based on the acquired historical passenger flow data and external environmental information. The reasoning and verification module is used to trigger the thought chain reasoning of the preset large language model based on the input command to generate reasoning text containing causal logic chain, and to perform fact consistency verification and correction on the reasoning text through the knowledge graph to obtain verified causal logic information. The feature fusion module is used to fuse the causal logic information with the spatiotemporal features of the historical passenger flow data to obtain fused features; The output module is used to output passenger flow prediction values ​​for future time periods and corresponding natural language interpretation reports based on the fused features.

[0012] The present invention further discloses a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.

[0013] The present invention further discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described method.

[0014] According to the technical solution of this invention, a knowledge graph of the transportation domain containing rail transit entities and causal relationships is constructed. Based on historical passenger flow data and external environmental information, input instructions guided by causal logic are generated to trigger a large language model to perform chain-like reasoning to explicitly generate causal logic chains. Then, the knowledge graph is used to perform factual consistency verification and closed-loop correction on the reasoning text. Finally, the verified causal logic information is deeply integrated with the spatiotemporal characteristics of historical passenger flow to simultaneously output passenger flow prediction values ​​and natural language interpretation reports. This ensures prediction accuracy while transforming the black-box decision-making of traditional deep learning models into a logically traceable white-box reasoning process. It effectively suppresses the illusion phenomenon that large models are prone to in professional fields, ensuring that the generated interpretation content strictly conforms to the laws of traffic physics. Furthermore, the active guidance of numerical prediction through causal logic significantly improves the model's response sensitivity and prediction robustness in emergency scenarios, achieving synergistic optimization of prediction accuracy and interpretability. This provides a dual guarantee of numerical accuracy and logical credibility for high-risk operation decisions in rail transit. Attached Figure Description

[0015] For illustrative and not limiting purposes, the present invention will now be described in conjunction with embodiments and accompanying drawings, wherein: Figure 1 This is a schematic diagram of the method for predicting rail transit passenger flow based on a large traffic interpretable model in an embodiment of the present invention. Figure 2 This is a schematic diagram of the components of the rail transit passenger flow prediction system based on a large traffic interpretable model in an embodiment of the present invention. Figure 3 This is a schematic diagram of the structure of the electronic device in an embodiment of the present invention; Figure 4 This is a schematic diagram of the process architecture of the rail transit passenger flow prediction method based on a large traffic interpretable model in an embodiment of the present invention. Figure 5 This is a schematic diagram of the construction of a knowledge graph in the transportation field according to an embodiment of the present invention; Figure 6 This is a diagram of the thought chain reasoning architecture in an embodiment of the present invention; Figure 7 This is a schematic diagram illustrating the principle of cross-attention mechanism feature interaction in an embodiment of the present invention; Figure 8 This is a schematic diagram of the comparative experimental results of multi-model passenger flow prediction in an embodiment of the present invention; Figure 9 This is a schematic diagram comparing model prediction errors in different complex scenarios according to embodiments of the present invention. Detailed Implementation

[0016] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present application.

[0017] It should be noted that, where there is no conflict, the embodiments and features of the embodiments in this application can be combined with each other. The embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0018] refer to Figure 1 This embodiment discloses a method for predicting rail transit passenger flow based on a large interpretable traffic model, the method comprising: S100: Construct a knowledge graph for the transportation domain, which contains entities related to rail transit passenger flow and the causal relationships between entities. This knowledge graph provides a logical benchmark for reasoning in large language models that conforms to the physical rules and operational common sense of rail transit, and is the foundation for achieving predictive interpretability.

[0019] Specifically, firstly, a structured representation of the knowledge graph is defined. This transportation domain knowledge graph is represented as a set of triples G=(E, R, T), where E is the entity set, R is the relation set, and T is the triple instance set. This knowledge graph serves as the domain knowledge benchmark for subsequent large language model inference, constraining the inference process to conform to the physical operation laws of rail transit. The entity set E includes at least two types of entities: physical entities representing the physical structure of the rail transit network and environmental entities representing external influencing factors. Physical entities include, but are not limited to, infrastructure such as rail transit stations and lines; environmental entities include, but are not limited to, external factors that may affect passenger flow changes, such as weather events (e.g., heavy rain, strong winds) and large-scale events (e.g., concerts, sporting events). Furthermore, the relation set R includes at least two types of relations: topological relations representing spatial connections between stations, and causal relations representing the impact of external environments or events on passenger flow. The topological relationships are used to describe the physical connectivity characteristics of the rail transit network, including "adjacent" relationships (representing that two stations are directly connected through the same section) and "transfer" relationships (representing that there is a transfer passage between two stations). The causal relationships are used to describe the driving logic between external factors and changes in passenger flow, including "causing congestion" (representing that large-scale events cause station congestion) and "causing an increase in station entry" (representing that severe weather causes ground transportation to shift to rail transit).

[0020] To enable computers to quantify the aforementioned discrete traffic rules, this implementation further employs the TransE algorithm to learn the embedded representation of the knowledge graph. Specifically, for any triple (head entity h, relation r, tail entity t) in the knowledge graph, vector space mapping is used to make the sum of the head entity vector and the relation vector approximately equal to the tail entity vector, i.e., satisfying h + r ≈ t. To learn the above multi-vector representation, the following knowledge embedding loss function is constructed. : ,in, It is the set of actual triples in the knowledge graph. This is a set of negative samples constructed by replacing the head or tail entities. For distance measurement function, This indicates taking the positive value. The interval hyperparameter is greater than 0. By minimizing this loss function, the model can transform traffic rules such as "heavy rain leads to increased station entry volume" into geometric constraints in vector space. The resulting entity and relation vectors serve as the knowledge base in subsequent inference and verification steps, used to quantitatively evaluate the authenticity of the large model's generation logic. The architecture diagram of this knowledge graph is attached. Figure 5 As shown, this embedding representation preserves the semantic relationships between entities and provides a computable vector basis for subsequent factual consistency verification.

[0021] S200: Based on acquired historical passenger flow data and external environmental information, construct input instructions guided by causal logic. This process unifies structured historical passenger flow data and unstructured external environmental information into natural language instructions that the large language model can understand and trigger its logical reasoning capabilities. This process also connects raw data with intelligent reasoning and explicitly requires the model to perform causal analysis.

[0022] Specifically, firstly, passenger flow time-series data and external environmental information for the target rail transit station or area within a historical time window are obtained. Let the target time to be predicted be... Obtain from historical moments up to the current moment The passenger flow numerical sequence is denoted as: ,in, This represents the passenger flow observation value at time i, while also acquiring the external environment information at the current time. This includes, but is not limited to, semantic descriptions of weather conditions, special events, and holiday types, such as "There is a concert at the Olympic Sports Center during Friday evening rush hour."

[0023] Secondly, define a prompt constructor. It transforms structured numerical data and semantic information into natural language descriptions and combines them into complete input prompts: ,in, This indicates a text concatenation operation. A complete input command example is: Historical data shows that passenger flow entering the station has been increasing exponentially over the past 30 minutes. A red rainstorm warning has been issued for the current area, and a large-scale concert is currently being held at the Olympic Sports Center. Please perform step-by-step reasoning based on knowledge of the transportation domain: First, observe the current passenger flow status and environmental characteristics; second, invoke relevant causal rules; and finally, deduce the future passenger flow trend. To convert numerical sequences This is transformed into natural language describing passenger flow trends. For example, first, the statistical characteristics of the sequence (such as mean and slope) are calculated, and then an example is generated: "In the past T time steps, the passenger flow entering station A has increased from..." People gradually rise to The description states that "the overall population shows a linear growth trend." To directly introduce the external environment description This serves as background information for the prediction. To forcefully trigger the large language model to perform step-by-step causal reasoning, this implementation provides the following exemplary final input instruction: "In the past 60 minutes, the passenger flow entering People's Square Station has gradually increased from 200 people / 5 minutes to 800 people / 5 minutes, showing an overall exponential growth trend. The known external environmental information is as follows: the current period is the evening rush hour on a weekday, and the meteorological observatory has issued a red rainstorm warning. Based on the above historical trends and external environment, please analyze the situation following the thought process of 'observing the current situation - recalling relevant physical or empirical rules - step-by-step deducing the causes and trends of future passenger flow changes'." The input instructions constructed in the above manner not only include the historical dynamic characteristics of passenger flow and the semantics of the external environment, but also force the large language model to generate explicit causal reasoning chains by guiding the instructions, thus laying the instruction foundation for the subsequent realization of interpretable passenger flow prediction.

[0024] S300: Based on the input command, trigger the thought chain reasoning of the preset large language model to generate reasoning text containing causal logic chains, and use the knowledge graph to perform factual consistency verification and correction on the reasoning text to obtain verified causal logic information. This step enables the large language model to generate causal explanations that are not only "readable" but also "credible." Its implementation is a closed-loop control system consisting of a generator, a validator, and a corrector.

[0025] Specifically, the input prompt containing causal logic, constructed in step S200, is input into a pre-defined large language model, triggering it to perform chain-of-thought reasoning. Upon receiving the input prompt, the large language model generates a set of reasoning steps containing causal logic chains, according to the logical order requirements contained in the prompt. The set of reasoning steps consists of observation steps. , recall steps and deduction steps The structure includes an observation step, used to extract key current-state features from the Prompt. For example: "Observing at current time t, the number of passengers entering People's Square Station is..." And received an external 'rainstorm warning' The information step involves recalling rules from internal model knowledge or external retrieval, such as: "Heavy rain usually leads to traffic congestion on the ground, which in turn triggers a surge in rail transit passenger flow." The deduction step is used to draw intermediate conclusions by combining the current situation with the rules, such as: "It is expected that passenger flow entering the station will show a non-linear growth from t+1 to t+3 in the future." This multi-stage reasoning mechanism ensures the explicitness and structure of the reasoning process, avoiding the model directly outputting conclusions without the missing intermediate logical chains.

[0026] Secondly, factual consistency is verified on the generated reasoning text. Specifically, a triplet verification algorithm is used, including: Entity extraction: Named entity recognition technology extracts a set of entity pairs from the reasoning text. The entity pairs include combinations of entities such as stations, routes, weather events, and large-scale events mentioned in the reasoning text; Relationship verification: Knowledge graph constructed in step S100 In the query, each entity pair Is there a direct relationship or an indirect relationship that can be reached by the shortest path between them? .

[0027] Consistency scoring: Calculates the implicit relation vectors in the generated text. With the true relation vector in the graph Cosine similarity, defining consistency score : At the same time, a high confidence threshold is set. ,like If so, then the reasoning in this step is considered to have passed factual verification and is logically reliable. If the error is not found, it is determined that there may be an "illusion" or a logical error at that point, and the correction process begins.

[0028] When a consistency check fails, the result is not discarded directly, but a self-correcting loop is initiated. This includes: Construct correction instructions: Generate a negative feedback prompt that explicitly points out the error. For example: "Your previous reasoning was incorrect. The knowledge base shows that the relationship between [Entity A] and [Entity B] is [negatively correlated], while you inferred that it was [positively correlated]. Please regenerate your reasoning based on this fact." Secondary inference: The original Prompt is concatenated with the above-mentioned correction instructions, and then input into the large language model again, requiring it to regenerate the inference steps. .

[0029] Re-verify: Repeat the above fact consistency verification steps.

[0030] Infinite Loop Circuit Breaker: To avoid infinite loops, set a maximum number of corrections. (For example, 3 times). If more than If the second correction still fails the verification, a downgrade strategy will be triggered. The system will abandon the use of controversial causal logic, retain only the descriptive statistical text extracted from historical data as the "explanation," and indicate in the final report that "this explanation failed the high-confidence logic verification," thereby avoiding misleading the system.

[0031] Finally, the verified causal logic information is output. Through the above closed-loop process, a set of verified reasoning steps is obtained. This set of reasoning steps includes judgments about future trends and causal chains that align with domain knowledge and lead to those judgments. The set of reasoning steps is the "verified causal logic information" output in this step. Furthermore, it is transformed into a structured feature vector for deep fusion in subsequent steps. The closed-loop reasoning and verification process is shown in the attached figure. Figure 6 As shown.

[0032] S400: The causal logic information and the spatiotemporal characteristics of the historical passenger flow data are fused to obtain fused features. This step is used to solve the problem of how qualitative logic can accurately determine quantitative calculations. Through adaptive and guided feature fusion, deep interaction between causal logic and historical patterns is achieved at the feature level.

[0033] Specifically, the causal logic information that passes the verification output in step S300 is encoded by a pre-trained language model encoder to obtain semantic features. Historical passenger flow data Input a spatiotemporal encoder to capture the spatial topological dependencies and temporal dynamics in the data, and obtain spatiotemporal numerical features. .

[0034] Subsequently, semantic features were analyzed. and spatiotemporal numerical characteristics Performing feature dimension alignment is necessary due to the semantic vector dimension of large models. With the dimension of spatiotemporal numerical vectors The differences are significant, necessitating projection onto a unified model dimension. This is achieved through linear projection layers and layer normalization. Semantic feature projection: ; Numerical feature projection: .

[0035] Furthermore, to achieve data retrieval based on logic, this implementation constructs a cross-attention mechanism that uses semantic features as "Query" and numerical features as "Key" and "Value". This enables the model to proactively focus on the most relevant segments in historical data based on the inferred causal logic.

[0036] Specifically, query, key, and value vectors are first generated using a learnable weight matrix: , , ,in , , These are learnable parameters. The attention-weighted output is then calculated: ,in, This is a mask matrix used to mask out irrelevant time steps. This is the scaling factor used to stabilize the gradient.

[0037] Furthermore, to prevent low-confidence semantic information from interfering with numerical prediction, this implementation introduces learnable gating coefficients. The contribution of semantically guided context to the final prediction is dynamically adjusted. Specifically, the calculation of the gating coefficient involves adjusting the original numerical features... Context-weighted output guided by semantics, i.e., attention-weighted output After concatenation, gating coefficients are generated through a linear transformation and a sigmoid activation function: ,in and For learnable parameters, This is the Sigmoid function. The final fused features are then obtained through dynamic weighted fusion using gating coefficients. : In this embodiment, the gating coefficient It is not fixed, but rather consistent with the consistency score obtained in step S300. Indirect association. During training, when the reasoning logic of the input sample has high credibility ( At high levels, the model will learn to assign larger values. Value, making It absorbs more semantically guided information; conversely, when the logic is unreliable or in a conventional scenario, it does not. The value will decrease, and the model will rely more on purely historical numerical patterns. This mechanism achieves a balance between robustness and interpretability of predictions at the architectural level. Thus, the output... This involves a deep integration of causal logic and historical patterns, serving as the direct input for the final prediction. The architecture of this dual-tower fusion and cross-attention mechanism is shown in the attached figure. Figure 7 As shown.

[0038] S500: Based on the fused features, output the passenger flow forecast for future time periods and the corresponding natural language interpretation report. This step is used to simultaneously generate high-precision passenger flow forecast values ​​and natural language diagnostic reports with business guidance value based on the deeply fused features, realizing the synchronous output of prediction and interpretation.

[0039] Specifically, it includes bimodal output generation, namely, passenger flow prediction value generation and natural language diagnostic report generation. The passenger flow prediction value output includes: the fusion features obtained in step S400. Input a lightweight predictive regression head and output a numerical prediction of passenger flow for future time periods. This process can be formally represented as: Here, MLP(⋅) represents a multilayer perceptron. The model can predict passenger flow at multiple future time steps (e.g., t+1, t+2, ..., t+H) in one go, forming a prediction sequence. The generation of the natural language diagnostic report includes: the verified causal logic information obtained in step S300. The generated diagnostic report, as provided in this implementation, is an example of a predicted increase in passenger flow due to ground transportation relocation caused by heavy rain, with a confidence level of 95%. Finally, this natural language diagnostic report is compared with the predicted values. Synchronous output.

[0040] Furthermore, to enable the model to simultaneously optimize prediction accuracy and logical realism during training, this implementation constructs a joint loss function. : ,in, and To balance the weighting hyperparameters of the two losses, where the prediction error loss is... To ensure the accuracy of numerical predictions, mean squared error is used for calculation: ,in, For actual future passenger traffic. Causal consistency loss. The core constraint used to ensure the validity of interpretability is to maximize the consistency between the reasoning content of the thought chain and the knowledge graph. Specifically, for each reasoning step R, the corresponding true relationship in the knowledge graph G should be as close as possible to the actual relationship in the vector space. This loss is constructed based on the consistency score. The negative log-likelihood form: By minimizing The model is forced to learn and generate reasoning logic that conforms to the physical rules and common sense of the transportation field, thereby suppressing "illusions" and improving the credibility of the explanation.

[0041] Finally, a structured result is output: Numerical prediction results: a sequence of passenger flow forecasts for the next H time steps.

[0042] Diagnostic report: The corresponding natural language explanation includes key attributions, trend analysis, and confidence level descriptions.

[0043] In summary, this specific implementation constructs a knowledge graph in the transportation domain and designs a closed-loop reasoning-verification-correction thought chain based on it. This ensures that the causal logic generated by the large language model is always constrained by physical rules, effectively suppressing "illusions." Furthermore, through semantically guided cross-attention and adaptive gating fusion mechanisms, the verified logical information is deeply coupled with spatiotemporal numerical features, enabling dynamic adjustment of prediction weights based on logical credibility. Finally, multi-task joint loss synchronously optimizes prediction accuracy and logical consistency, outputting an integrated result that combines high-precision passenger flow predictions with a natural language diagnostic report. Technically, this solution achieves a shift from "black-box fitting" to "white-box reasoning," significantly improving the timeliness and robustness of predictions in emergency scenarios and providing transparent and credible explanatory basis for operational decisions. It effectively solves the trust and practicality challenges in the implementation of intelligent transportation systems.

[0044] refer to Figure 8 and Figure 9 To verify the effectiveness of the proposed method, a comparative experiment was conducted on a real urban rail transit passenger flow dataset. The experiment included various scenarios such as regular time periods (off-peak and morning peak) and sudden, complex time periods (evening peak combined with heavy rain and large-scale events), comparing the performance of the proposed method with several existing mainstream prediction models.

[0045] Figure 8This paper presents a comparison of passenger flow prediction curves using multiple models across all weather conditions. During the typical period from 06:00 to 16:00, the model in this specific implementation exhibits good fitting ability compared to benchmark models such as the Spatiotemporal Graph Convolutional Network (ST-GCN) and conventional large models based on adapter fine-tuning. The predicted curves closely match the actual passenger flow, demonstrating that this invention, while introducing an interpretable mechanism, does not sacrifice the modeling accuracy of fundamental spatiotemporal patterns. The key difference occurs during the complex period from 17:30 to 20:00, when the evening peak coincides with a sudden event. At this time, influenced by both sudden heavy rainfall and the dispersal of large-scale events, the actual passenger flow experiences a non-periodic explosive growth. The traditional statistical model ARIMA completely fails, exhibiting severe prediction lag. The current mainstream ST-GCN and conventional large models based on adapter fine-tuning also show significant "response lag," with their prediction curves only starting to follow the actual passenger flow surge approximately 30 to 45 minutes later, and the peak prediction is lower than expected. This reveals the passive fitting defects of existing data-driven models when lacking external causal perception for sudden events. In contrast, the model in this implementation exhibits extremely high responsiveness at the peak of passenger flow around 17:30, with the predicted curve rising almost synchronously with the actual trend, showing no significant lag. This is directly attributed to the "knowledge-constrained thinking chain" mechanism, whereby the model successfully perceives the external semantic factors of "heavy rain" and "event" and proactively increases the prediction weights through causal reasoning, achieving a paradigm shift from "passively fitting history" to "actively predicting causality." Furthermore, compared to the drastic and unreasonable oscillations observed in the baseline of existing general-purpose language models during this period, the curve of this invention is stable and conforms to physical characteristics, confirming that the knowledge graph verification mechanism effectively suppresses generated noise.

[0046] Figure 9 The performance of different models in four scenarios was quantitatively compared using the Mean Absolute Percentage Error (MAPE). In off-peak and regular peak scenarios, the errors of this implementation and models such as ST-GCN were both low (MAPE < 10%), with only a small difference, indicating that all models can work effectively under strong periodicity. In large-scale event and extreme weather scenarios, the errors of traditional models (ARIMA, ST-GCN) increased exponentially with the increase in scenario complexity; the existing general-purpose large language model baseline still had high and unstable errors due to the lack of physical constraints. The model of this specific implementation maintained a significant advantage in complex scenarios, that is, in the most challenging extreme weather scenario, the prediction error was reduced by about 35% compared with the current conventional large models based on adapter fine-tuning. This result strongly proves that in abnormal scenarios where regular data patterns fail, this implementation, through explicit logical reasoning of "knowledge graph + thought chain", can effectively fill the gaps in data patterns, thus demonstrating excellent robustness and practical application value.

[0047] Therefore, by combining the prediction curves and error analysis, the prediction method based on the interpretable traffic model proposed in this embodiment not only maintains high accuracy in conventional scenarios, but also completely overcomes the prediction lag and logical deficiencies of existing technologies in sudden and complex scenarios, achieving a unity of accuracy, robustness and interpretability, and providing reliable technical support for the intelligent operation of urban rail transit.

[0048] refer to Figure 2 This embodiment further discloses a rail transit passenger flow prediction system based on a large interpretable traffic model, including: The knowledge graph construction module 21 is used to construct a knowledge graph in the transportation domain. The knowledge graph contains entities related to rail transit passenger flow and causal relationships between entities. It includes defining the entity set and the relationship set of the knowledge graph. The entity set includes at least physical entities and environmental entities that represent the physical structure of the rail transit network. The relationship set includes at least topological relationships that represent the connection relationships between stations, and causal relationships that represent the impact of external environment or events on passenger flow.

[0049] The instruction generation module 22 is used to construct input instructions containing causal logic guidance based on the acquired historical passenger flow data and external environmental information; including: converting the passenger flow numerical sequence in the acquired historical passenger flow data into a natural language description representing the passenger flow change trend; encoding the acquired external environmental information into a semantic description representing the relationship between environmental events and passenger flow; and combining the natural language description, the semantic description, and the guidance instruction used to trigger the large language model to perform step-by-step causal reasoning to form an input instruction containing causal logic guidance.

[0050] The reasoning and verification module 23 is used to trigger the thought chain reasoning of a preset large language model based on the input command to generate reasoning text containing causal logic chains, and to perform fact consistency verification and correction on the reasoning text through the knowledge graph to obtain verified causal logic information. The fact consistency verification and correction includes: extracting entity pairs from the reasoning text and querying the semantic relationships between the entity pairs according to the knowledge graph; calculating the consistency score between the semantic relationships implicit in the reasoning text and the semantic relationships queried from the knowledge graph; determining whether the reasoning text passes the verification based on the consistency score; if it fails the verification, generating a correction command based on the semantic relationships in the knowledge graph, and re-triggering the preset large language model to generate new reasoning text based on the correction command, until the verification is passed or the preset correction limit is reached.

[0051] The feature fusion module 24 is used to fuse the causal logic information and the spatiotemporal features of the historical passenger flow data to obtain fused features. This includes: mapping the causal logic information to a semantic feature vector, mapping the spatiotemporal features of the historical passenger flow data to a numerical feature vector, and aligning the dimensions of both; using the semantic feature vector as a query vector and the numerical feature vector as a key vector and value vector, and performing feature interaction through a cross-attention mechanism to generate a semantically guided numerical context representation; dynamically fusing the numerical context representation with the original numerical feature vector using a learnable gating parameter to obtain the fused features; wherein the gating parameter is determined based on the consistency score obtained in the factual consistency check: when the consistency score is higher than a preset threshold, the value of the gating parameter is set to be larger, so that the fused features contain more information from the numerical context representation; when the consistency score is lower than or equal to the preset threshold, the value of the gating parameter is set to be smaller, so that the fused features are more dependent on the numerical feature vector.

[0052] Output module 25 is used to output passenger flow prediction values ​​for future periods and corresponding natural language interpretation reports based on the fused features; including: inputting the fused features into a prediction regression model and outputting passenger flow prediction values ​​for future periods; and generating natural language text containing passenger flow change attribution analysis and prediction confidence level descriptions based on the causal logic information, as a natural language interpretation report.

[0053] Figure 3 A schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention, such as... Figure 3 As shown, the electronic device 50 includes: a processor 501, a memory 502, and a bus 503; The processor 501 and the memory 502 communicate with each other via the bus 503; the processor 501 is used to call the program instructions in the memory 502 to execute the methods provided in the above-described embodiments.

[0054] This embodiment provides a non-transitory computer-readable storage medium that stores computer instructions that cause a computer to execute the methods provided in the above-described embodiments.

[0055] Those skilled in the art will understand that all or part of the steps of the above-described method implementation can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above-described method implementation. The aforementioned storage medium includes various storage media capable of storing program code, such as ROM, RAM, magnetic disk, or optical disk.

[0056] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0057] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of each embodiment or some parts of the embodiments.

[0058] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for predicting rail transit passenger flow based on a large interpretable traffic model, characterized in that, The method includes: Construct a knowledge graph in the transportation domain, which includes entities related to rail transit passenger flow and the causal relationships between entities; Based on the acquired historical passenger flow data and external environment information, input instructions guided by causal logic are constructed. Based on the input command, the thought chain reasoning of the preset large language model is triggered to generate reasoning text containing causal logic chains, and the reasoning text is verified and corrected for factual consistency through the knowledge graph to obtain verified causal logic information. By integrating the causal logic information with the spatiotemporal characteristics of the historical passenger flow data, a fused feature is obtained; Based on the fusion features, the system outputs passenger flow forecasts for future time periods and corresponding natural language interpretation reports.

2. The rail transit passenger flow prediction method according to claim 1, characterized in that, The construction of the knowledge graph in the transportation field includes: Define the entity set and relation set of the knowledge graph; The entity set includes at least physical entities and environmental entities that characterize the physical structure of the rail transit network; The set of relationships includes at least topological relationships that characterize the connections between stations, and causal relationships that characterize the impact of external environments or events on passenger flow.

3. The rail transit passenger flow prediction method according to claim 1, characterized in that, The input instructions for constructing the system, which are guided by causal logic, include: The acquired historical passenger flow data is converted into a natural language description representing the trend of passenger flow changes. The acquired external environmental information is encoded into semantic descriptions that characterize the relationship between environmental events and passenger flow; The natural language description, the semantic description, and the guiding instructions used to trigger the large language model to perform step-by-step causal reasoning are combined to form an input instruction that includes causal logic guidance.

4. The rail transit passenger flow prediction method according to claim 1, characterized in that, The step of performing fact consistency verification and correction on the reasoning text using the knowledge graph includes: Extract entity pairs from the reasoning text and query the semantic relationships between the entity pairs based on the knowledge graph; Calculate the consistency score between the semantic relationships implied in the reasoning text and the semantic relationships retrieved from the knowledge graph; The consistency score is used to determine whether the inference text passes the verification. If the verification fails, a correction instruction is generated based on the semantic relationships in the knowledge graph, and the preset large language model is re-triggered to generate new reasoning text based on the correction instruction, until the verification is passed or the preset correction limit is reached.

5. The rail transit passenger flow prediction method according to claim 1, characterized in that, The spatiotemporal features obtained by fusing the causal logic information and the historical passenger flow data include: The causal logic information is mapped to a semantic feature vector, the spatiotemporal features of the historical passenger flow data are mapped to a numerical feature vector, and the two are aligned in dimensions. Using the semantic feature vector as the query vector and the numerical feature vector as the key vector and value vector, feature interaction is performed through a cross-attention mechanism to generate a semantically guided numerical context representation. The fused features are obtained by dynamically fusing the numerical context representation with the original numerical feature vector using learnable gating parameters.

6. The rail transit passenger flow prediction method according to claim 1, characterized in that, The output of the passenger flow forecast for future time periods and the corresponding natural language interpretation report based on the fusion features includes: The fused features are input into the predictive regression model, which outputs the passenger flow forecast for future time periods. Based on the aforementioned causal logic information, a natural language text containing attribution analysis of passenger flow changes and prediction confidence level descriptions is generated as a natural language interpretation report.

7. The rail transit passenger flow prediction method according to claim 5, characterized in that, The gating parameters are determined based on the consistency score obtained in the fact consistency check: When the consistency score is higher than the preset threshold, the value of the gating parameter is set to be larger, so that the fused feature contains more information of numerical context representation; When the consistency score is lower than or equal to the preset threshold, the value of the gating parameter is set to be smaller, making the fused feature more dependent on the numerical feature vector.

8. A rail transit passenger flow prediction system based on a large interpretable traffic model, characterized in that, include: A knowledge graph construction module is used to construct a knowledge graph in the transportation field, which contains entities related to rail transit passenger flow and the causal relationships between entities. The instruction generation module is used to construct input instructions guided by causal logic based on the acquired historical passenger flow data and external environmental information. The reasoning and verification module is used to trigger the thought chain reasoning of the preset large language model based on the input command to generate reasoning text containing causal logic chain, and to perform fact consistency verification and correction on the reasoning text through the knowledge graph to obtain verified causal logic information. The feature fusion module is used to fuse the causal logic information with the spatiotemporal features of the historical passenger flow data to obtain fused features; The output module is used to output passenger flow prediction values ​​for future time periods and corresponding natural language interpretation reports based on the fused features.

9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, implements the method of any one of claims 1-7.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method of any one of claims 1-7.