Passenger flow prediction method based on language model fusion
By combining the time-series prediction model with the language big data model, cross-modal information fusion for passenger flow prediction is achieved, which solves the accuracy and interpretability problems of traditional methods in complex scenarios and provides more accurate and interpretable prediction results.
Patent Information
- Application Number
- CN202511533829.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-25
- Publication Date
- 2026-01-30
AI Technical Summary
Existing passenger flow forecasting methods struggle to effectively address the impact of unconventional factors such as holidays and sudden weather events in complex railway transportation scenarios. This results in decreased forecast accuracy, poor interpretability of the results, and an inability to fully utilize the semantic information of external events.
A passenger flow prediction method based on language model fusion is adopted. Passenger flow data is initially predicted through a time series prediction model, and then converted into natural language text and fused with external semantic information. The large language model is used for optimization, and interpretable optimized prediction values are output.
It achieves cross-modal information fusion, improves the accuracy and interpretability of passenger flow forecasting, has a wider range of applications, can accurately analyze the impact of passenger flow in the event of emergencies, and provide clear adjustment basis.
Smart Images

Figure CN121436264A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of passenger flow prediction, and particularly relates to a passenger flow prediction method based on language model fusion. BACKGROUND
[0002] A railway transportation system needs to make train operation diagrams, transport capacity allocation and passenger flow guidance in advance, and the making of these decisions relies on accurate prediction of future passenger flow. In the prior art, passenger flow prediction methods mainly use time series analysis, which includes statistical models (such as ARIMA models) and deep learning models (such as LSTM models, GRU models and Transformer models). The above models can capture the time variation trend of passenger flow to some extent and provide a basic prediction reference for railway operation, but there are still many problems to be solved in the actual complex railway transportation scene.
[0003] Traditional time series prediction methods first lack deep use of natural language event information, making it difficult to effectively deal with significant fluctuations in passenger flow caused by irregular factors such as holidays, sudden weather and construction, resulting in a significant decrease in prediction accuracy in such special scenarios. Secondly, the prediction results output by traditional methods have poor interpretability, and railway operation departments cannot clearly understand the basis for adjusting the prediction values, which is not conducive to making accurate operation strategies based on the prediction results. In addition, the way external features are fused in traditional technology is usually to input the external features as numerical or categorical features after splicing, which makes it difficult to describe the complex semantic information contained in external events. Language large models (LLM) have strong natural language understanding and reasoning capabilities and can analyze the semantics of external events and infer their impact on passenger flow. If the numerical results of time series model prediction and the event semantic information analyzed by language large models are combined, the accuracy and interpretability of passenger flow prediction can be significantly improved. However, the existing technology has not realized this fusion application, and the synergistic effect of multi-source information cannot be fully utilized. Therefore, in view of the above status, it is urgent to develop a passenger flow prediction method based on language model fusion to overcome the shortcomings in current practical applications. SUMMARY
[0004] The present application aims to provide a passenger flow prediction method based on language model fusion to solve the problems raised in the background.
[0005] To achieve the above-mentioned purpose, the present application provides the following technical solutions: A passenger flow prediction method based on language model fusion, comprising the following steps: S1, collecting multi-source data and performing preprocessing, wherein the multi-source data at least includes passenger flow data; S2, first stage prediction: a time series prediction model is used to predict the preprocessed passenger flow data, and a preliminary prediction value of passenger flow in a future period is output; S3, second stage optimization: the preliminary prediction value is converted into natural language text, external semantic information in the prediction period is combined to construct a fusion Prompt, the fusion Prompt is input into a large language model, and an optimized passenger flow prediction value is output after analysis and reasoning of the large language model.
[0006] As a further scheme of the application: in step S1, the multi-source data further includes holiday data, meteorological data and event data; The holiday data is derived from the announcement of national holiday and memorial day holidays, the meteorological data is derived from the open data interface of the meteorological department, and the event data is derived from the hot event announcement website and the railway train operation adjustment notice.
[0007] As a further scheme of the application: the preprocessing of step S1 includes the following sub-steps: S11, passenger flow data conversion: taking a station pair as a unit, daily passenger flow data is constructed into multi-dimensional time series data, and each column represents the change trend of passenger flow of a station pair with time.
[0008] As a further scheme of the application: in step S2, the time series prediction model is selected from a PatchTST model, an iTransformer model, an LSTM model or an Informer model; The input of the time series prediction model is passenger flow data in a preset time window length in the past, the time window length is 30 days, and the output is a preliminary prediction value in a preset number of days in the future, and the preset number of days is 7 days.
[0009] As a further scheme of the application: when the time series prediction model is a PatchTST model, step S2 specifically includes the following sub-steps: S21, patch division: the input historical passenger flow time series is divided into a plurality of patches, and the number of patches is the ratio of the time window length to the length of each patch; S22, patch encoding and attention calculation: each patch is linearly mapped to a fixed-dimensional vector, and all vectors are input into a Transformer encoder for self-attention calculation; S23, preliminary prediction value output: the self-attention calculation result is processed by a Transformer decoder to output the preliminary prediction value.
[0010] As a further scheme of the present application: in step S3, when converting the preliminary prediction value into natural language text, a passenger flow trend description is also added in the text, the passenger flow trend description includes a gradual upward trend of passenger flow or a slight decrease of passenger flow compared with the previous day.
[0011] As a further scheme of the present application: in step S3, the external semantic information includes meteorological semantic information, holiday semantic information and event semantic information. The meteorological semantic information is constructed according to a template of "date, city name, weather state, temperature, wind direction and wind force", the holiday semantic information is generated based on holiday data extraction, and the event semantic information is generated based on event data construction.
[0012] As a further scheme of the present application: in step S3, the content of the fusion Prompt includes: The natural language text converted from the preliminary prediction value, the external semantic information, and the optimization task description and output format requirement of the language large model; The output format requirement is that the language large model needs to output the optimized prediction value, and the adjustment reason or no adjustment reason of each prediction value is attached.
[0013] As a further scheme of the present application: in step S3, the inference optimization logic of the language large model includes the following sub-steps: S31, analyzing the preliminary prediction value in the fusion Prompt to master the basic trend of passenger flow; S32, extracting key influencing factors in the external semantic information, judging the influence direction of each factor on passenger flow, the influence direction including promoting passenger flow growth or inhibiting passenger flow growth; S33, combining the basic trend of passenger flow with the influence direction of each factor to correct the preliminary prediction value and obtain the optimized passenger flow prediction value.
[0014] As a further scheme of the present application: the method is applied to the railway operation scene of train working diagram dynamic adjustment, marshalling optimization, transport capacity allocation or holiday transportation organization.
[0015] Compared with the prior art, the present application has the following advantages: 1. Cross-modal information fusion is realized, the numerical trend output by the traditional time series model can be cooperatively modeled with the natural language semantics processed by the language large model, the time variation law reflected by the objective historical passenger flow data is fully utilized, the influence of external events (such as holidays, weather, large activities) on passenger flow is effectively integrated, the limitation of traditional prediction methods relying on single modal data is broken, and deep utilization of multi-source information is realized. 2. Stronger generalization, as the language large model has excellent natural language understanding and reasoning capabilities, in the event of emergencies (such as temporary large concerts, sudden rainstorms), new types of activities, and other scenarios lacking training samples, it can still accurately analyze the potential impact of events on passenger flow. Compared to traditional models, it performs better in complex and variable scenarios and has a wider range of applications. 3. Significantly improve the explainability of the prediction results. The language large model can provide a reason for each prediction value adjustment (such as "increased during the National Day holiday", "decreased due to high temperature", and "increased due to a concert") when outputting the optimized prediction values. This allows railway operation departments to clearly understand the basis for the adjustment of the prediction results, solving the "black box" problem of traditional prediction results and providing clear support for train operation diagram dynamic adjustment, marshalling optimization, and operational decision-making. 4. The overall structure is flexible. This method does not rely on a specific model architecture. The time series prediction in the first stage can choose different models (such as PatchTST, iTransformer, LSTM, Informer, etc.) according to actual needs. The semantic fusion optimization in the second stage also supports replacing any language large model with natural language understanding capabilities, allowing flexible adaptation to different railway operation application scenarios. 5. Effectively improve the prediction accuracy in special scenarios. Through the two-stage prediction structure (time series prediction + semantic optimization), for scenarios such as holidays, emergencies, and special weather that traditional models cannot handle, the preliminary prediction values can be accurately corrected, significantly improving the accuracy of passenger flow prediction in such scenarios, providing reliable prediction basis for holiday transportation organization and other key operational work, and ensuring the efficient and orderly operation of the railway transportation system. BRIEF DESCRIPTION OF DRAWINGS
[0016] Figure 1 The figure is a two-stage process diagram for railway passenger flow prediction with external semantic information fusion in the embodiment of the present application.
[0017] Figure 2 The figure is a JSON format label example for holiday data in the embodiment of the present application.
[0018] Figure 3 The figure is an example of holiday semantic information description in the embodiment of the present application. DETAILED DESCRIPTION
[0019] The technical solutions in the embodiments of the present application will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor are within the scope of protection of the present application.
[0020] The specific implementation of the present application is described in detail below in conjunction with specific embodiments.
[0021] Please refer to Figures 1-3 The embodiment of the present application provides a passenger flow prediction method based on language model fusion. Through a two-stage prediction structure, the numerical prediction result of a traditional time sequence model and external event semantic information are fused into a language large model, so that the precise prediction of railway passenger flow is realized, and the result interpretability is improved. The method is suitable for railway operation application scenarios such as train working diagram dynamic adjustment, marshalling optimization, transport capacity allocation and holiday transportation organization. The specific content is as follows: I. Data acquisition and preprocessing (1) Historical passenger flow data acquisition In order to ensure that the subsequent prediction model can fully capture the multi-dimensional factors affecting passenger flow, multi-source historical data needs to be collected first. The specific collection contents are as follows: Passenger flow data collection: Collect passenger flow data between target stations in a certain period of time, and construct time series data with day as granularity. The data fields include the name of the departure station, the name of the arrival station, and the daily passenger flow between the two stations. For example, collect the daily passenger flow of the station pair (hereinafter referred to as "OD pair") of "Hangzhou East-Jiangning" and "Shanghai Hongqiao-Nanjing", and form the basic passenger flow time series. Holiday data collection: Collect the holiday arrangement announcement of national holidays and memorial days published by the General Office of the State Council (such as "Notice of the General Office of the State Council on the Arrangement of Part of Holidays in 2025"), extract the holiday date, holiday name and holiday information in the announcement, and convert it to JSON format for marking (example: {"name":"Spring Festival","date":"2024-02-10","isOffDay":true}), form holiday data, and use it to mark the holiday period in the passenger flow data. Weather data collection: Collect the weather data of the cities where the departure station and the arrival station are located through the open data interface of China Meteorological Administration. The data fields include date, city name, weather state (such as sunny, light rain, heavy snow, cloudy, etc.), highest temperature, lowest temperature, wind direction and wind force. For example, collect "Nanjing 2024-07-15, overcast to cloudy, highest temperature 31℃, lowest temperature 27℃, northeast wind 1 level" and other data, and form the weather data of the two places. Event data collection: By crawling the hot event announcement websites of the cities where the departure station and arrival station are located (such as concert, exhibition, large conference activity announcement websites), combined with the train operation adjustment notice published by the railway department (such as the information of additional train and suspended train), the major activities, hot events and train operation adjustment information of the two places are collected, and after artificial screening, event data is formed, such as "2025.05.31, Jacky Cheung held a show in Shanghai 2025 concert", "2025.6.1, 3 trains are added from Shanghai Hongqiao station to Nanjing South station" and the like.
[0022] Therefore, by collecting passenger flow, holidays, weather, and event multi-source data, the time dimension law (historical passenger flow) and external influencing factors (holidays, weather, events) affecting the change of railway passenger flow are completely covered, providing basic data support for subsequent time series prediction models, and laying a data foundation for external semantic information fusion, avoiding prediction bias caused by missing data dimensions.
[0023] (2) Data preprocessing; In order to improve data quality and adapt to the input format of subsequent prediction models, the historical data collected needs to be preprocessed, and the specific steps are as follows: Passenger flow data conversion: Taking each pair of OD (such as Nanjing South-Hangzhou East, Nanjing South-Shanghai Hongqiao, Nanjing South-Beijing South) as a unit, the corresponding daily passenger flow data of each OD pair is constructed into a column to form multi-dimensional time series data, and each column represents the trend of passenger flow of an OD pair with time. The example data is shown in the following table: Date Nanjing South-Hangzhou East Nanjing South-Hangzhou South Nanjing South-Shanghai Hongqiao Nanjing South-Beijing South 2023 / 1 / 5 14 2 3867 1910 2023 / 1 / 6 16 9689 5657 11 2023 / 1 / 7 81 5 3409 4184 2023 / 1 / 8 27 10 3774 3618 2023 / 1 / 9 88 4 4237 3491 2023 / 1 / 10 56 65 3550 44 2023 / 1 / 11 6 2674 3875 4 2023 / 1 / 12 15 6 6729 4167 2023 / 1 / 13 61 5 5101 4073 Through data cleaning, invalid data is removed to improve data reliability; through OD pair dimension passenger flow data conversion, scattered passenger flow data is integrated into a multi-dimensional input format suitable for time series prediction model, so that the model can model different OD pair passenger flow characteristics respectively, and improve the pertinence and accuracy of prediction.
[0024] II. First stage: Time series prediction of passenger flow data; In this stage, the traditional time series prediction model is used to preliminarily predict the preprocessed multi-dimensional passenger flow data to capture the change law of passenger flow in time dimension. In this embodiment, the PatchTST model (other time series prediction models such as iTransformer can also be selected) is preferred, and the specific implementation process is as follows: (1) Model input and core principle Taking the historical passenger flow time series of an OD pair (such as Nanjing South-Shanghai Hongqiao) as an example, let the historical passenger flow time series of the OD pair be: ; where p is the length of the time window (p is set to 30 in this embodiment, i.e., the passenger flow data of the past 30 days is used as input), y t is the passenger flow of the OD pair on the t-th day.
[0025] The core principle of the PatchTST model is to divide the input time series into several "patches" for encoding. After each patch is converted into a vector through linear mapping, it is input into the Transformer encoder for self-attention calculation to improve the modeling ability of long sequences (such as 30-day passenger flow data) and avoid the gradient disappearance or information loss problem in traditional time series modeling.
[0026] (II) Specific prediction steps; Patch division: the above historical passenger flow time series Y is divided into m patches, each patch has a length of l (m = p / l), and the expression of the i-th patch is: ; That is, the first patch is {y1, y2, …, y6}, the second patch is {y7, y8, …, y 12}, and so on, until the 30-day historical passenger flow data is divided; Patch encoding and attention calculation: each patch is linearly mapped to a fixed-dimensional vector (the vector dimension is set to 512 in this embodiment), and then all patch vectors are input into the Transformer encoder to capture the time sequence association between different patches (such as the trend of passenger flow change and periodicity between adjacent time periods); Preliminary prediction result output: the attention calculation result is processed by the Transformer decoder to output the preliminary prediction value of the OD pair for the next h days (h is set to 7 in this embodiment, i.e., the passenger flow for the next 7 days is predicted), and the expression is: where Y t+1:t+h is the preliminary prediction value sequence for the next 7 days, f PatchTST (⋅) is the prediction function of the PatchTST model.
[0027] In this embodiment, the preliminary prediction results of the Nanjing South-Shanghai Hongqiao OD pair are shown in the following table (the prediction period is from 2025 / 5 / 27 to 2025 / 6 / 02): Date Nanjing South-Shanghai Hongqiao (preliminary forecast passenger flow) 2025 / 5 / 27 10047 2025 / 5 / 28 11167 2025 / 5 / 29 16494 2025 / 5 / 30 10751 2025 / 5 / 31 17435 2025 / 6 / 1 10610 2025 / 6 / 2 12700 Through the "Patch division + Transformer attention" mechanism of the PatchTST model, the time correlation characteristics of long sequence passenger flow data (such as the passenger flow difference between weekdays and weekends, the weekly periodicity) are effectively captured, and the preliminary prediction value provides a numerical basis for the subsequent semantic fusion optimization of the second stage. At the same time, the model supports replacement with other time series prediction models such as LSTM and Informer, and has high structural flexibility. It can select and adapt the appropriate model according to the actual application scenario.
[0028] III. Second stage: language large model optimization with external semantic information fusion In this stage, the preliminary prediction value is converted into text format and fused with external event semantic information, and input into the language large model (LLM) for inference optimization, realizing the collaborative modeling of "numerical trend + semantic information". The specific steps are as follows: (I) Numerical text of prediction value In order to adapt to the input format of the language large model (natural language), the numerical preliminary prediction result output by the first stage needs to be converted into natural language text, and passenger flow trend description (such as "passenger flow shows a gradual upward trend" and "passenger flow is slightly lower than the previous day") needs to be added to help the model understand the passenger flow change pattern.
[0029] Taking the preliminary prediction result of Nanjing South-Shanghai Hongqiao OD pair as an example, the converted text is as follows: Nanjing South-Shanghai Hongqiao OD pair, predicted passenger flow: Day 1 (2025 / 5 / 27) 10047 people, Day 2 (2025 / 5 / 28) 11167 people, Day 3 (2025 / 5 / 29) 16494 people, Day 4 (2025 / 5 / 30) 10751 people, Day 5 (2025 / 5 / 31) 17435 people, Day 6 (2025 / 6 / 1) 10610 people, Day 7 (2025 / 6 / 2) 12700 people; The overall passenger flow shows a fluctuating trend, with higher passenger flow on Day 3 and Day 5 than other days.
[0030] Through numerical text, the abstract numerical value output by the time series model is converted into natural language that the language large model can understand, and trend description is added to provide the model with context information of passenger flow changes, avoiding the model relying solely on isolated numerical values for optimization and improving the accuracy of subsequent semantic fusion.
[0031] (II) Generation of external semantic information Convert holiday, weather, and event data in the prediction period (2025 / 5 / 27 to 2025 / 6 / 02) into natural language semantic information, and the specific organization method is as follows: Weather semantic information: Based on the collected weather data, the text is constructed according to the template of "date, city name, weather state, temperature (minimum temperature-maximum temperature), wind direction and wind force", for example: 2025-05-27, Nanjing, cloudy, temperature 19-29 degrees, east wind 3 levels; 2025-05-28, Nanjing, cloudy, temperature 20-27 degrees, southeast wind 4 levels; 2025-05-29, Nanjing, sunny, temperature 22-30 degrees, south wind 2 levels; 2025-05-30, Nanjing, cloudy, temperature 21-28 degrees, northeast wind 3 levels; 2025-05-31, Nanjing, cloudy, temperature 23-31 degrees, southwest wind 2 levels; 2025-06-01, Nanjing, light rain, temperature 19-22 degrees, east wind 4 levels; 2025-06-02, Nanjing, cloudy, temperature 20-25 degrees, southeast wind 3 levels; 2025-05-27, Shanghai, cloudy, temperature 18-26 degrees, southeast wind 4 levels; 2025-05-28, Shanghai, cloudy, temperature 19-24 degrees, southeast wind 4 levels; 2025-05-29, Shanghai, cloudy, temperature 20-27 degrees, south wind 3 levels; 2025-05-30, Shanghai, sunny, temperature 21-29 degrees, southwest wind 2 levels; 2025-05-31, Shanghai, cloudy, temperature 22-30 degrees, southeast wind 3 levels; 2025-06-01, Shanghai, moderate rain, temperature 16-20 degrees, southeast wind 4 levels; 2025-06-02, Shanghai, cloudy, temperature 18-23 degrees, northeast wind 3 levels; Holiday semantic information: Through matching the JSON data converted by the State Council Office holiday announcement, the holiday information in the predicted time period is extracted, and the text is constructed as follows: 2025-05-31: Dragon Boat Festival (public holiday), 2025-06-01: Dragon Boat Festival (public holiday), 2025-06-02: Dragon Boat Festival (public holiday); Event semantic information: Based on the event data screened by artificial selection, the text is constructed as follows: On May 31, 2025, Jacky Cheung held a concert in Shanghai; On June 1, 2025, 3 trains were added from Shanghai Hongqiao Station to Nanjing South Station.
[0032] Integrate the above three types of semantic information to form a complete external semantic information text, for example: Weather information: 2025-05-27, Nanjing, overcast, temperature 19-29 degrees, east wind 3 levels; 2025-05-27, Shanghai, overcast, temperature 18-26 degrees, southeast wind 4 levels; …… 2025-06-02, Shanghai, overcast, temperature 18-23 degrees, northeast wind 3 levels; Holiday information: 2025-05-31: Dragon Boat Festival (public holiday), 2025-06-01: Dragon Boat Festival (public holiday), 2025-06-02: Dragon Boat Festival (public holiday); Event information: 2025.05.31, Jacky Cheung held a big show in Shanghai 2025 concert; 2025-06-01, Shanghai Hongqiao Station adds 3 trains to Nanjing South Station.
[0033] By converting structured external data (weather, holidays, events) into natural language semantics, the characteristics of external factors affecting passenger flow in the prediction period are fully presented, enabling the language large model to directly understand the potential impact of "good or bad weather", "whether it is a holiday" and "whether there is a large-scale activity" on passenger flow, providing semantic support for subsequent fusion optimization.
[0034] (Three) Construct a fusion prompt; Based on "numerical text results + external semantic information", construct the input prompt (Prompt) of the language large model, and clearly define the optimization task and output format of the model. The specific Prompt example is as follows: Please optimize the prediction value based on the following daily passenger flow prediction results of Nanjing South-Shanghai Hongqiao OD pair and external event information; when optimizing, you need to analyze the passenger flow trend and the impact of external events on passenger flow, output the optimized prediction value, and provide reason explanation for each adjusted prediction value (no adjustment of the prediction value needs to be explained "no special event, normal weather").
[0035] [Prediction results]: Nanjing South-Shanghai Hongqiao OD pair, predicted passenger flow: 1st day (2025 / 5 / 27) 10047 people, 2nd day (2025 / 5 / 28) 11167 people, 3rd day (2025 / 5 / 29) 16494 people, 4th day (2025 / 5 / 30) 10751 people, 5th day (2025 / 5 / 31) 17435 people, 6th day (2025 / 6 / 1) 10610 people, 7th day (2025 / 6 / 2) 12700 people; The overall passenger flow presents a fluctuating trend, with higher passenger flow on the 3rd day and the 5th day than other days.
[0036] [External event information]: Weather information: 2025-05-27, Nanjing, overcast, temperature 19-29 degrees, east wind 3 levels; 2025-05-27, Shanghai, overcast, temperature 18-26 degrees, southeast wind 4 levels; 2025-05-28, Nanjing, overcast, temperature 20-27 degrees, southeast wind 4 levels; 2025-05-28, Shanghai, overcast, temperature 19-24 degrees, southeast wind 4 levels; 2025-05-29, Nanjing, sunny, temperature 22-30 degrees, south wind 2 levels; 2025-05-29, Shanghai, overcast, temperature 20-27 degrees, south wind 3 levels; 2025-05-30, Nanjing, overcast, temperature 21-28 degrees, northeast wind 3 levels; 2025-05-30, Shanghai, sunny, temperature 21-29 degrees, southwest wind 2 levels; 2025-05-31, Nanjing, overcast, temperature 23-31 degrees, southwest wind 2 levels; 2025-05-31, Shanghai, overcast, temperature 22-30 degrees, southeast wind 3 levels; 2025-06-01, Nanjing, light rain, temperature 19-22 degrees, east wind 4 levels; 2025-06-01, Shanghai, moderate rain, temperature 16-20 degrees, southeast wind 4 levels; 2025-06-02, Nanjing, overcast, temperature 20-25 degrees, southeast wind 3 levels; 2025-06-02, Shanghai, overcast, temperature 18-23 degrees, northeast wind 3 levels; Holiday information: 2025-05-31: Dragon Boat Festival (public holiday), 2025-06-01: Dragon Boat Festival (public holiday), 2025-06-02: Dragon Boat Festival (public holiday); Event information: 2025.05.31, Jacky Cheung held a concert in Shanghai; 2025-06-01, Shanghai Hongqiao Station added 3 trains to Nanjing South Station.
[0037] [Output format]: Date: Optimized passenger flow (reason for adjustment / no adjustment).
[0038] Through structured Prompt design, the language large model is clearly informed of the "input information (predicted results + external events)" "optimization task (correct the predicted value after comprehensive analysis)" and "output requirements (optimized results with reason explanation)", avoiding optimization deviation caused by task ambiguity, and ensuring that the model output meets the demand of the railway operation department for "predicted results + adjustment basis".
[0039] (Four) Language large model reasoning optimization; The above structured fusion Prompt input is input into the language large model (not limited to specific language large models in this embodiment, GPT series, LLaMA series, etc. models with natural language understanding and reasoning capabilities can be selected), and the model performs reasoning optimization through the following logic: First, analyze the numerical prediction results in the Prompt to understand the basic trend of passenger flow (such as higher passenger flow on 2025 / 5 / 29, 2025 / 5 / 31); Secondly, the key influencing factors in external semantic information are extracted, and the influence direction of each factor on passenger flow is judged (such as holidays, large concerts, and increasing train services will promote passenger flow growth, while heavy rain and high temperature will inhibit passenger flow growth); Finally, the passenger flow trend is combined with the influence of external factors to modify the preliminary prediction value. For example, the double factors of "Dragon Boat Festival + concert" will superimpose to promote passenger flow growth, so the prediction value needs to be increased. In the factor of "Dragon Boat Festival + moderate rain", the rainfall will offset part of the passenger flow growth brought by the holiday, so the prediction value needs to be moderately increased (the increase is lower than that in the pure holiday scenario).
[0040] In this embodiment, the optimization results output by the language large model are as follows: 2025 / 5 / 27: 10047 people (no special event, normal weather, passenger flow maintains the preliminary prediction level); 2025 / 5 / 28: 11167 people (no special event, normal weather, passenger flow maintains the preliminary prediction level); 2025 / 5 / 29: 16494 people (no special event, normal weather, passenger flow maintains the preliminary prediction level); 2025 / 5 / 30: 10751 people (no special event, normal weather, passenger flow maintains the preliminary prediction level); 2025 / 5 / 31: about 21,000 people (the Dragon Boat Festival public holiday promotes travel demand, and the Shanghai Mo Wanwei concert attracts passenger flow, the double factors superimpose to significantly promote passenger flow growth, so the prediction value is appropriately increased based on the preliminary prediction value); 2025 / 6 / 1: about 11,700 people (the Dragon Boat Festival public holiday promotes travel demand, and the Shanghai moderate rain weather inhibits part of the travel demand, the two offset each other and still show a small increase trend, so the prediction value is slightly increased based on the preliminary prediction value; at the same time, 3 additional trains are opened at Shanghai Hongqiao Station to meet the increased passenger flow demand, so there is no need to reduce the prediction value due to capacity constraints); 2025 / 6 / 2: about 14,600 people (the last day of the Dragon Boat Festival public holiday, the return travel demand is still high, and the weather is normal without inhibiting factors, so the prediction value is moderately increased based on the preliminary prediction value).
[0041] Through the natural language understanding and reasoning ability of the language large model, the cross-modal fusion of "numerical trend (time series model output)" and "semantic information (external events)" is realized. Compared with the traditional prediction method which only relies on numerical features, the prediction value after optimization in this stage has significantly improved in the scenes of holidays, emergencies, and special weather; at the same time, the reason for the model output solves the problem of "poor interpretability" of traditional prediction results, so that the railway operation department can clearly understand the basis for adjusting the prediction value, and facilitate the subsequent development of train operation diagram, marshalling scheme, and capacity allocation strategy.
[0042] In summary, this invention's passenger flow prediction method based on language model fusion achieves effective utilization and collaborative modeling of multi-source information through a complete process of "data acquisition and preprocessing → first-stage time-series prediction → second-stage semantic fusion optimization." Specifically, the first-stage time-series model (such as PatchTST) ensures the capture of passenger flow time-dimensional patterns, providing a numerical foundation for prediction; the second-stage large-scale language model, by fusing external semantic information, corrects deviations in the initial prediction, improving prediction accuracy and interpretability. It has the following advantages: Cross-modal fusion: Breaking through the limitations of traditional models that only utilize numerical features, it achieves the fusion of "numerical trends + natural language semantics", taking into account both objective historical patterns and the influence of external events; Strong generalization ability: The language big model has the ability to reason about sudden events (such as temporary large-scale events and sudden rainstorms), and can still accurately optimize the prediction value in new scenarios where there are few training samples; Good interpretability: The output results include the reasons for the adjustments, meeting the needs of railway operating departments for decision-making basis; Flexible structure: The first stage can be replaced with different time series prediction models, and the second stage can be replaced with different language large models to adapt to the needs of different application scenarios.
[0043] This embodiment fully discloses the technical solution of the present invention through specific data and steps. Those skilled in the art can adjust the model selection and parameter values (such as time window length p and prediction days h) based on the description of this embodiment without departing from the concept of the present invention, and all such adjustments fall within the protection scope of the present invention.
[0044] It should be noted that, in this invention, although the specification describes the embodiments, not every embodiment contains only one independent technical solution. This way of describing the specification is only for clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1.A passenger flow prediction method based on language model fusion, characterized in that, The method comprises the following steps: S1, collecting multi-source data and preprocessing, wherein the multi-source data at least includes passenger flow data; S2, first stage prediction: using a time series prediction model to predict the preprocessed passenger flow data, and outputting passenger flow preliminary prediction values in future time periods; S3, second stage optimization: converting the preliminary prediction values into natural language texts, combining external semantic information in the prediction period to construct a fusion Prompt, inputting the fusion Prompt into a large language model, and outputting optimized passenger flow prediction values after analysis and reasoning by the large language model. 2.The passenger flow prediction method based on language model fusion according to claim 1, characterized in that, In step S1, the multi-source data further includes holiday data, meteorological data and event data; Wherein, the holiday data is derived from the national annual holiday and memorial day holiday arrangement announcement, the meteorological data is derived from the meteorological department open data interface, and the event data is derived from the hot event announcement release website and the railway train operation adjustment notice. 3.The passenger flow prediction method based on language model fusion according to claim 1, characterized in that, The preprocessing of step S1 includes the following sub-steps: S11, passenger flow data conversion: taking a station pair as a unit, the daily passenger flow data is constructed into multi-dimensional time series data, and each column represents the passenger flow trend of a station pair with time. 4.The passenger flow prediction method based on language model fusion according to claim 1, characterized in that, In step S2, the time series prediction model is selected from PatchTST model, iTransformer model, LSTM model or Informer model; The input of the time series prediction model is the passenger flow data in the past preset time window length, the time window length is 30 days, and the output is the preliminary prediction value in the future preset days, and the future preset days are 7 days. 5.The passenger flow prediction method based on language model fusion according to claim 4, characterized in that, When the time series prediction model is the PatchTST model, step S2 specifically includes the following sub-steps: S21, patch division: dividing the input historical passenger flow time series into several patches, and the number of patches is the ratio of the time window length to the length of each patch; S22, patch encoding and attention calculation: linearly mapping each patch to convert it into a fixed-dimensional vector, and then inputting all vectors into a Transformer encoder for self-attention calculation; S23, preliminary prediction value output: processing the self-attention calculation result by a Transformer decoder to output the preliminary prediction value. 6.The passenger flow prediction method based on language model fusion according to claim 1, characterized in that, In step S3, when converting the preliminary prediction value into a natural language text, a passenger flow trend description needs to be added in the text, and the passenger flow trend description includes a gradual upward trend of passenger flow or a slight decrease of passenger flow compared with the previous day. 7.The passenger flow prediction method based on language model fusion according to claim 1, characterized in that, In step S3, the external semantic information includes meteorological semantic information, holiday semantic information and event semantic information; Wherein, the meteorological semantic information is constructed according to the template of "date, city name, weather state, temperature, wind direction and wind power", the holiday semantic information is generated based on the holiday data extraction, and the event semantic information is generated based on the event data construction. 8.The passenger flow prediction method based on language model fusion according to claim 1, characterized in that, In step S3, the content of the fusion Prompt includes: The natural language text converted from the preliminary prediction value, the external semantic information, and the optimization task description and output format requirement of the large language model; The output format requirement is that the language large model needs to output the optimized prediction value, and attach the adjustment reason or no adjustment reason of each prediction value. 9.The passenger flow prediction method based on language model fusion according to claim 1, characterized in that, In step S3, the inference optimization logic of the language large model includes the following sub-steps: S31, analyze the preliminary prediction value in the fused Prompt, and master the basic trend of passenger flow; S32, extract key influencing factors from external semantic information, and judge the influence direction of each factor on passenger flow, the influence direction including promoting passenger flow growth or inhibiting passenger flow growth; S33, combine the basic trend of passenger flow with the influence direction of each factor, and correct the preliminary prediction value to obtain the optimized passenger flow prediction value. 10.The passenger flow prediction method based on language model fusion according to claim 1, characterized in that, The method is applied to the railway operation scenarios of train working diagram dynamic adjustment, marshalling optimization, transport capacity allocation or holiday transportation organization.
Citation Information
Cited By
Large-model-driven urban railway newly-opened station flow prediction method
CN122022896A
Rail transit cross-modal prediction method based on search-enhanced reasoning and spatio-temporal knowledge graph
CN122388520A
