Subway driving plan generation method and device and storage medium

By aligning external events with passenger flow data in a time-series model and generating train schedules, the problem of traditional models being unable to predict subway passenger flow fluctuations is solved, thereby improving subway operation efficiency and passenger experience.

CN121809934APending Publication Date: 2026-04-07PCI TECH & SERVICE CO LTD +4
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-25
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Traditional subway passenger flow forecasting models are unable to accurately and in real time predict passenger flow fluctuations caused by unexpected events such as holidays, leading to problems such as passenger waiting and resource waste.

Method used

By acquiring external event information and passenger flow data from the future target date and the same period in history, and aligning them in time and space, a feature sequence is constructed, and a time-series base model is used for prediction to generate a driving plan.

Benefits of technology

It improved the accuracy and timeliness of passenger flow forecasting, optimized capacity allocation, reduced congestion in carriages during peak hours and empty rates during off-peak hours, and improved subway operation efficiency and resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121809934A_ABST
    Figure CN121809934A_ABST
Patent Text Reader

Abstract

The invention provides a subway driving plan generation method and device and a storage medium, and the method comprises the steps: obtaining the external event information of a target date and a historical period for each subway station, and obtaining the passenger flow data of the historical period and adjacent dates; aligning the external event information with known passenger flow data in time and space dimensions; on the basis of the aligned data, constructing a feature sequence of each time period in the target date and the historical same period; an input sequence is constructed according to the feature sequence and the passenger flow data of the adjacent date, and the predicted passenger flow data of each time period in the target date takes a mask as a missing value in the input sequence; and inputting the input sequence into the trained time sequence base model to obtain a passenger flow prediction result of the current subway station in each time period in the target date, and determining a driving plan of the target date. The accuracy and timeliness of passenger flow prediction are improved by constructing the input sequence fusing historical passenger flow and future event features and performing prediction by using the time sequence model.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of urban traffic, and particularly relates to a subway train operation plan generation method, device and storage medium. BACKGROUND

[0002] As a core part of the urban public transportation system, the subway plays a key role in the efficient operation of the city. Holiday passenger flow has obvious volatility, suddenness and uncertainty, and there are significant differences from the regular weekday passenger flow pattern. This special passenger flow pattern brings great difficulty to the operation and management of the subway and poses a severe challenge to the formulation of the subway train operation plan.

[0003] Traditional statistical models, such as ARIMA (Autoregressive Integrated Moving Average Model) and ES (Exponential Smoothing), can capture the trend and seasonal changes of data to some extent, but they are difficult to accurately and timely predict when faced with subway passenger flow data with high complexity and uncertainty. Specifically, subway passenger flow is influenced by many factors, including but not limited to weather changes, holiday arrangements, city event hosting, and sudden events. These factors are intertwined with each other, forming complex nonlinear relationships, making it difficult for statistical models to accurately predict passenger flow. For example, when encountering sudden severe weather, passengers who originally planned to travel may change their travel plans, resulting in a significant decrease in subway passenger flow. Statistical models are difficult to capture this change in a timely manner, which can lead to problems such as long waiting times for passengers, train overloading, or resource waste, severely affecting passenger travel experience and subway operation efficiency. SUMMARY

[0004] Therefore, the present application provides a subway train operation plan generation method, device and storage medium to improve the accuracy of passenger flow prediction and enhance passenger travel experience and subway operation efficiency.

[0005] A first aspect of the present application provides a subway train operation plan generation method, comprising:

[0006] For each subway station, obtain external event information for a future target date and a historical same period, and obtain passenger flow data for the historical same period and adjacent dates, the adjacent dates being dates in a continuous time window immediately preceding the target date;

[0007] Align the external event information with known passenger flow data in time and space dimensions;

[0008] Based on the aligned data, construct feature sequences for each time period in the target date and the historical same period.

[0009] An input sequence is constructed based on the feature sequence and the passenger flow data of the adjacent dates, wherein the predicted passenger flow data for each time period in the target date is masked as missing values ​​in the input sequence;

[0010] The input sequence is fed into the trained time series base model to obtain the passenger flow prediction results of the current subway station in each time period of the target date;

[0011] The train schedule for the target date is determined based on the passenger flow forecasts for all subway stations.

[0012] A second aspect of the present invention provides a subway train schedule generation apparatus, comprising:

[0013] The data acquisition module is used to acquire external event information for a future target date and the same period in history for each subway station, and to acquire passenger flow data for the same period in history and adjacent dates, wherein the adjacent dates are dates in a continuous time window immediately preceding the target date;

[0014] The alignment module is used to align the external event information with known passenger flow data in the time and space dimensions.

[0015] The feature sequence construction module is used to construct feature sequences for the target date and each time period in the same historical period based on the aligned data;

[0016] An input sequence construction module is used to construct an input sequence based on the feature sequence and the passenger flow data of the adjacent dates, wherein the predicted passenger flow data for each time period in the target date is masked as missing values ​​in the input sequence;

[0017] The passenger flow prediction module is used to input the input sequence into the trained time series base model to obtain the passenger flow prediction results of the current subway station in each time period of the target date;

[0018] The train schedule construction module is used to determine the train schedule for the target date based on the passenger flow forecast results of all subway stations.

[0019] A third aspect of the present invention provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the subway train schedule generation method as described in the first aspect above.

[0020] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the subway train schedule generation method as described in the first aspect above.

[0021] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0022] This method effectively identifies key external factors influencing passenger flow fluctuations by spatiotemporally aligning multi-source information such as weather, holidays, and urban events with historical passenger flow data. Based on this, it improves the accuracy and timeliness of passenger flow forecasting by constructing an input sequence that integrates historical passenger flow and future event characteristics and using a time-series model for prediction. Finally, it generates train schedules based on predicted passenger flow at each station, ensuring that capacity allocation closely matches actual demand. This helps reduce congestion during peak hours, lowers empty load rates during off-peak hours, and improves overall operational efficiency and resource utilization. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 This is a schematic diagram of a subway train schedule generation method provided in an embodiment of the present invention;

[0025] Figure 2 This is a schematic diagram of a time-series pedestal model training process provided in an embodiment of the present invention;

[0026] Figure 3 This is an architecture diagram of a timing base model provided in an embodiment of the present invention;

[0027] Figure 4 This is a schematic diagram of a subway train schedule generation method provided in an embodiment of the present invention;

[0028] Figure 5 This is a schematic diagram of a subway train schedule generation device provided in an embodiment of the present invention;

[0029] Figure 6 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0030] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the present invention. However, those skilled in the art will understand that the present application may be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of the present application with unnecessary detail.

[0031] To aid in understanding the terminology used in this invention, the following explanations are provided for the relevant parts.

[0032] 1. Train Operation Plan: The train operation plan is the basis for compiling the subway train timetable, including train routes, headway, turnaround methods, and train utilization methods for each time period.

[0033] 2. Routes: Refers to the fixed turnaround sections in the operation of rail transit mainline trains, that is, the line sections where trains travel back and forth between the originating station and the terminal turnaround station. The route plan determines the length of the train operation section, the turnaround stations, and the number of train pairs operating on different routes, and is the basis for determining the train operation schedule.

[0034] 3. Cross-sectional passenger flow: The number of passengers passing through a specific section (cross-section) of a rail transit line per unit time, divided into uphill and downhill cross-sectional flow. It is a key basis for train operation organization, station scale design, and equipment capacity configuration. For example, the maximum cross-sectional passenger flow during peak hours directly affects the train formation scheme.

[0035] 4. Load factor: The ratio of the actual number of passengers in a train car to its maximum designed capacity, reflecting passenger comfort and transportation efficiency. For example, when the load factor of a subway car exceeds 80%, it is necessary to increase the frequency of trains or implement passenger flow control measures to avoid overcrowding and potential safety hazards.

[0036] The technical solution of the present invention will be illustrated below through specific embodiments.

[0037] Reference Figure 1 This diagram illustrates a subway train schedule generation method according to an embodiment of the present invention. The method can be executed by a subway train schedule generation device, which can be implemented in hardware and / or software. This subway train schedule generation device can be configured in an electronic device. Figure 1 As shown, the method may specifically include the following steps:

[0038] S101. For each subway station, obtain external event information for the future target date and the same period in history, and obtain passenger flow data for the same period in history and adjacent dates.

[0039] Each subway line includes two or more stations, typically numbering a dozen or even dozens. Due to the different locations of each station, their passenger flow varies. For example, if station A is in a bustling shopping mall while station B is in a suburban area on the city's edge, station A will generally have a much higher passenger flow than station B. However, external events can cause changes in passenger flow between the two.

[0040] External event information mainly includes three categories: city event information, weather information, and holiday information. For example, the external event information for October 1st can be briefly recorded as the weather at that time (sunny, 25℃), the holiday calendar (Dragon Boat Festival), and the city event (dragon boat race).

[0041] Information on city events can be collected regularly from local media platforms, government websites, and social media platforms. Local media platforms provide structured event data, while social media platforms offer more timely information on smaller events. For example, if there is a large sports center near subway station A1, and information from external events indicates that the sports center is hosting a major event soon, then subway station A1 may experience a significant increase in passenger traffic.

[0042] Regarding weather information, historical weather and forecast information can be obtained regularly from the China Weather Network to help analyze the impact of weather on passenger flow. For example, during rainy or snowy weather, people tend to go out less, which will reduce passenger flow at subway stations.

[0043] Regarding holiday information, the domestic holiday schedule can be obtained through the open-source toolkit chinese_calendar, which helps determine the impact of date type on passenger flow. During holidays, people tend to travel and participate in activities, so subway station passenger flow usually increases.

[0044] The target date is the specific date to be predicted, and the historical period refers to the same date in previous years. For example, if the target date is October 1, 2025, then the historical period could be October 1, 2022 to 2024. Optionally, the target date is a date when the target subway users are likely to travel in large numbers. Specifically, the target date is a public holiday, which can be a holiday stipulated by the region, city, or country.

[0045] The nearest dates are dates within a consecutive time window immediately preceding the target date. For example, it could be 3 days before the target date. For instance, if the target date is October 1, 2025, then the nearest dates would be September 28 to September 30, 2025.

[0046] By extracting historical passenger flow records for each time period within these dates from the subway business database, the corresponding passenger flow data can be obtained. Passenger flow data can be obtained for historical dates (both the same period in history and adjacent dates to the target date), while the target date has not yet been reached; its corresponding passenger flow data is precisely what this invention aims to predict.

[0047] S102. Align external event information with known passenger flow data in time and space dimensions.

[0048] Time alignment refers to associating known passenger flow data with a specific time period within a specific date, and of course, with subway stations. In this embodiment, S101-S105 describe a single subway station at a time. For example, the event "light show (20:00-20:30)" is associated with the time period it affects (e.g., 19:00-21:00), rather than simply associating it with the entire date.

[0049] Spatial alignment refers to matching specific urban activity coordinates with a subway station coordinate database using geocoding services. Normally, weather conditions are directly matched with subway stations across the city. However, in situations where the city area is large and weather conditions vary across different areas, different weather information is matched with subway station coordinates separately.

[0050] For example, the activity coordinates (116.41, 39.91) of "Wangfujing Commercial Area" are matched with the subway station coordinate database using a geocoding service. The calculation shows that the activity mainly affects Exits A and C of "Wangfujing Station," and its main impact area is linked to "Wangfujing Station." The "sunny" weather condition is then matched with the citywide station association table to confirm its impact attributes on "Wangfujing Station."

[0051] Ultimately, the system generates a structured alignment table, where each row corresponds to a unique station-time period combination, and integrates passenger flow observations (if any) under that combination and all external event labels aligned with it.

[0052] S103. Based on the aligned data, construct the feature sequences of the target date and each time period in the same historical period.

[0053] For each row in the alignment data table (i.e., a "site-time period" unit), the system extracts and combines two types of features: time type features and external event labels. Time type features include parsing "hour", "day of the week", "whether it is a weekend / holiday", "day number in a long holiday", etc. from the timestamp. External event labels include "weather: sunny, event: large event".

[0054] The length and division method of the time period can be set according to actual needs. The time period can be half a day, 3 hours, or a finer time granularity (such as 1 hour). When the length of each time period is 1 hour, the division method is usually based on the hour. Of course, other methods can also be used, for example, a time period of 13:30-14:30.

[0055] The system combines the aforementioned features of all time period units (arranged chronologically) contained within the target date and each historical period to form multiple independent feature sequences. Each feature sequence fully depicts the state changes of all relevant external factors over time within a specific date.

[0056] S104. Construct an input sequence based on the feature sequence and passenger flow data of adjacent dates, wherein the predicted passenger flow data for each time period in the target date is masked as missing values ​​in the input sequence.

[0057] This step involves integrating historical passenger flow data from nearby dates with future characteristic information and assembling it into a specific format required by the model.

[0058] First, the sequence is concatenated. The system constructs a long sequence that includes all time periods of both the "nearby dates" and the "target date". For the "nearby dates" (e.g., from September 28 to 30, 2025), the data for each time point is: [actual passenger flow value, and the feature vector corresponding to that time point].

[0059] For the target date (2025-10-01), the data for each time point is: [MASK (mask placeholder), the feature vector corresponding to that time point].

[0060] The prediction task is to replace the actual passenger flow value on the target date with a MASK symbol. Therefore, the system explicitly defines the task objective for subsequent models: to infer these masked passenger flow values ​​based on known historical passenger flow and known future characteristics (on the target date).

[0061] S105. Input the input sequence into the trained time series base model to obtain the passenger flow prediction results of the current subway station in each time period of the target date.

[0062] Temporal pedestal models are a type of deep neural network (such as the temporal variant of Transformer) that have powerful sequence modeling capabilities.

[0063] The complete input sequence containing the mask, constructed in step S104, is input into the time-series base model. The time-series base model, through its internal multi-layer attention mechanism, simultaneously analyzes multiple aspects of the input sequence: historical passenger flow fluctuation patterns, recent trends, and detailed characteristics (holidays, events, etc.) accompanying each time period of the target date. Based on these analyses, the model outputs its estimation results for passenger flow values ​​at each mask location (i.e., each time period of the target date), forming a complete prediction of passenger flow for all time periods throughout the day on the target date.

[0064] S106. Determine the train schedule for the target date based on the passenger flow forecasts for all subway stations.

[0065] S101-S105 are repeatedly executed for all stations in the network to obtain a fine-grained (station × time period) passenger flow forecast matrix covering the entire network and the entire day of the target date. The operation planning system imports this forecast matrix as its core input, with the primary constraint being to meet the predicted passenger flow demand. Specifically, it can consider actual constraints such as line capacity, turnaround conditions, and vehicle inventory, and set optimization objectives (such as minimizing operating costs or passenger waiting time). Through mathematical programming or intelligent algorithms, a detailed train schedule is automatically generated. This schedule specifically specifies the train departure intervals, the number of trains in service, and possible route arrangements for each line at different times, thus completing a closed loop from data prediction to execution.

[0066] The subway train schedule generation method provided in this invention effectively identifies key external factors affecting passenger flow fluctuations by spatiotemporally aligning multi-source information such as weather, holidays, and urban events with historical passenger flow data. Based on this, it improves the accuracy and timeliness of passenger flow forecasting by constructing an input sequence that integrates historical passenger flow and future event characteristics and using a time-series model for prediction. Finally, train schedules are generated based on the predicted passenger flow at each station, ensuring that capacity allocation closely matches actual demand. This helps reduce congestion in train carriages during peak hours, lowers empty load rates during off-peak hours, and improves overall operational efficiency and resource utilization.

[0067] In an optional embodiment, based on the aligned data, a feature sequence is constructed for the target date and various time periods within the same historical period, including:

[0068] Based on the aligned data, for each time period of the target date and the same historical period, a multi-dimensional feature vector containing time attributes, external events, spatial attributes and historical statistical features is constructed; the feature vectors are arranged in chronological order to obtain the feature sequence of the current time period.

[0069] This embodiment focuses on the core step of structuring the aligned data output from step S102. First, the input and unit are defined. The input is the aligned data table generated in step S102. The system focuses on the target date (e.g., 2025-10-01) and each historical date within the same period (e.g., 2024-10-01, 2023-10-01). For each time period within these dates (e.g., 20:00-20:15), the system treats it as an independent processing unit. Its known information includes the unit's time tag, spatial tag (belonging station), aligned external event tag, and available historical passenger flow data.

[0070] The system dynamically constructs a multi-dimensional feature vector for each date-time period unit. This feature vector describes the state of the unit and mainly includes the following types of features:

[0071] Time attributes: inherent attributes directly parsed from the timestamp, such as "year, month, day, hour, day of the week", as well as derived attributes such as "whether it is a weekday / weekend / holiday", "holiday name", and "day of the long holiday".

[0072] External events: Directly attach event labels that are aligned with the unit in S102, such as {Weather: Sunny, Event Type: Large Light Show, Event Scale: High}. These labels become part of the feature vector in a structured form (such as classification codes or text labels).

[0073] Spatial attributes: These describe the spatial location characteristics of the unit, such as "station number", "line to which it belongs", "station type (e.g., transfer station, terminal station)" and "surrounding land use (commercial area, residential area)". These attributes are usually static or semi-static and are pre-stored in the system knowledge base.

[0074] Historical statistical characteristics: The passenger flow data selected for this study corresponds to the same historical period and is used to calculate the statistical indicators for this unit. For example, "the average passenger flow during the same period of the same holiday over the past three years". These characteristics provide the model with a reference for the passenger flow level for each time period on the target date.

[0075] After constructing the feature vectors for each time segment of all the aforementioned dates, the system arranges all feature vectors belonging to the same date strictly in chronological order (from 00:00 to 23:59), thus forming a coherent feature sequence describing the evolution of the state throughout the day on that date. Therefore, the system will ultimately generate multiple feature sequences, including the feature sequence for the target date and several historical feature sequences for the same period.

[0076] In an optional embodiment, an input sequence is constructed based on a feature sequence and passenger flow data from adjacent dates, including:

[0077] Using a pre-trained regression model, the feature sequence is converted into a feature code that matches the numerical scale of the passenger flow data. Passenger flow data from nearby dates are concatenated with the corresponding feature codes to obtain the input sequence. In the input sequence, passenger flow data for each time period on the target date is represented by placeholders.

[0078] This embodiment integrates historical passenger flow data with feature information representing future conditions, assembling them into a standardized input sequence that the time-series base model can directly receive and process.

[0079] The feature sequence is a multi-dimensional feature vector sequence describing the status of the target date and the same period in history. The passenger flow data of the adjacent date is the sequence of actual observed passenger flow values ​​for each time period in the historical dates (such as from September 28 to September 30, 2025) that are adjacent to the target date (such as October 1, 2025).

[0080] To eliminate the differences in numerical dimensions and distribution between the original feature vectors and passenger flow data, and to avoid training instability or prediction bias caused by inconsistent feature scales, this embodiment introduces a pre-trained regression model as a converter. This regression model has been trained on massive amounts of historical data, and its learning objective is to predict the typical passenger flow impact value that may correspond to a given multi-dimensional feature vector for a given time period. Essentially, it learns the statistical mapping relationship between the external environment and passenger flow data. The regression model can be a random forest, gradient boosting tree, or shallow neural network; this invention does not impose any limitations on this.

[0081] The feature sequence (including the target date and historical data for the same period) is input into this regression model. The regression model outputs a single, continuous feature code for each feature vector in the sequence. Furthermore, this code value maintains the same numerical scale as the actual passenger flow data (e.g., the unit is "passengers / 15 minutes"). The result is no longer the original feature vector sequence, but a feature code sequence. Each code value in this sequence quantifies the expected impact of the external environment combination on passenger flow during the corresponding time period. Encoding the features refers to encoding the feature vectors for each time period, not the entire sequence. This is because the purpose of encoding is to convert the feature vectors into feature codes at the same scale as the passenger flow values; therefore, the encoding operation is performed independently for the feature vectors at each time point.

[0082] Then, the processed feature encoding sequence is concatenated with the original passenger flow data sequence according to time points.

[0083] Historical component concatenation: For each time period of a nearby date, the actual passenger flow value is concatenated with the feature code value corresponding to that time period to form a tuple [actual passenger flow, feature code], which serves as the historical component of the input sequence.

[0084] Future part concatenation: For each time period of the target date, since the actual passenger flow is unknown, the system uses a specific placeholder (such as the number 0 or a special marker [MASK]) to represent the passenger flow value to be predicted, and concatenates it with the feature code value corresponding to that time period to form [placeholder, feature code], which serves as the future part of the input sequence.

[0085] Finally, the input sequence is constructed by connecting the historical and future parts in chronological order to form a complete and coherent input sequence. Through this sequence, the model can understand that the historical part consists of known results (passenger flow data) and their codes, while the future part consists of known codes from which results (passenger flow data) need to be inferred.

[0086] The final output of this embodiment is an input sequence that conforms to the model input format requirements. By introducing a regression model for feature encoding transformation, all input features are uniformly mapped to the same numerical scale as the target variable (passenger flow), greatly simplifying the learning task of the subsequent time-series base model. Furthermore, high-dimensional, sparse feature vectors are compressed into a single intensity index rich in business semantics, improving information density.

[0087] In an optional embodiment, before inputting the input sequence into the trained time-series base model to obtain the passenger flow prediction results for the current subway station in each time period of the target date, the method further includes:

[0088] The external event information for the target date is input into a pre-defined large language model. The large language model analyzes the consistency between the external event information and the feature sequence, and outputs the verification result. The verification result includes at least one of the following:

[0089] Instructions to continue execution, correction instructions, or reports describing the analysis process.

[0090] Temporal-based models have some limitations in processing unstructured information. For example, they are typically designed to process structured time-series data (such as sensor readings and timestamp records), while unstructured information (such as text, images, and audio) requires feature extraction or transformation before being input into the model. This can lead to information loss or reduced processing efficiency. Before feeding the constructed input sequence into the temporal-based model for final prediction, this embodiment introduces a pre-verification step. Utilizing the deep semantic understanding and common-sense reasoning capabilities of Large Language Models (LLM), the logical consistency of the data is reviewed to improve the quality of the input data and the reliability of the prediction process.

[0091] To compensate for the limitations of time-series-based models in handling unstructured information and to enhance their sensitivity to external factors that cause drastic fluctuations in passenger flow, this method introduces a large language model with deep reasoning capabilities for knowledge-assisted verification and prediction correction. The large language model comprehensively utilizes unstructured information such as common sense related to the target prediction date, subway operation industry knowledge, and event information (e.g., festivals, planned events, online hotspots), as well as historical structured data (e.g., passenger flow and weather), to analyze and verify the quantile prediction results generated by the time-series-based model, thereby dynamically adjusting the final prediction value.

[0092] LLM, based on its internalized general knowledge, industry common sense (such as holiday travel patterns and the impact paradigms of large-scale events), and logical reasoning ability, performs cross-analysis on input information. Its core objective is to evaluate the consistency between external event information and feature sequences.

[0093] Predicting subway passenger flow during holidays requires external information (events, weather, holidays), but this information is scattered across different sources. In particular, activity information on social media is unstructured text, which is difficult to process using traditional methods. The core innovation of this solution is the design of an LLM-based workflow to transform this messy, unstructured information into structured, high-quality features that computers can use for prediction.

[0094] The LLM workflow includes the following:

[0095] 1. Event Filtering: With a large and mixed amount of information, LLM quickly filters out advertisements, travel guides, outdated information, out-of-town events, and incomplete information from a large number of online posts, leaving only local, recent, and fully described real event announcements.

[0096] 2. Event formatting: Information is not organized. LLM accurately extracts key fields such as event name, specific time, and detailed location from various event posts and stores them in association.

[0097] 3. Subway Station Matching: The information is independent of each other, and LLM works in conjunction with the map API. First, the map API provides coordinates and candidate stations, and then LLM understands which subway station exit is most relevant to the location based on the activity location description (such as "North Gate of Entertainment Plaza"), thus completing the key association from the activity location to the subway station that affects it.

[0098] 4. Activity Deduplication: Information is often repetitive and redundant. Different users may use different words to describe the same activity, such as "Saturday National Comic Exhibition" or "ACG Exhibition January 18th". LLM can understand semantics, determine whether they are the same event, and thus merge and deduplicate them to avoid data exaggeration.

[0099] 5. Reasonableness Check: Information may be inaccurate. The LLM acts as a common-sense quality inspector, using global knowledge to conduct the final check. For example, if an LLM finds that a "100,000-person music festival" is listed as being held in a "community park," or that the event time is logically incorrect (e.g., the music festival is scheduled for 2 AM, while the city clearly stipulates that music festivals should not exceed 11 PM), the LLM will mark this as unreasonable data and remove it to ensure data quality.

[0100] LLM outputs structured verification results, which the system uses to determine subsequent processes. The results mainly include the following types:

[0101] Continue execution instruction: If the analysis determines that the external event information is consistent with the feature sequence logic, then this instruction is output, and the system executes step S105 normally, submitting the input sequence to the time series base model.

[0102] Correction Instructions: If significant inconsistencies are found (e.g., the quantification of the impact of a feature sequence on a major event is significantly insufficient), LLM may directly output correction suggestions or trigger a feature back-calculation process. Specifically, under normal circumstances, the model uses the median of the predicted interval distribution as the final predicted value; however, in special scenarios, the large language model will correct the final predicted value based on the context. For example, if a large-scale event is held at a scenic spot along the route during holidays, it tends to choose a higher quantile (e.g., 80%), while in severe weather (e.g., heavy rain), it may choose a lower quantile (e.g., 30%).

[0103] Report describing the analysis process: When outputting correction instructions, LLM usually generates a natural language report that presents its reasoning process and decision-making logic, providing interpretability support for the prediction results.

[0104] This optional embodiment adds a verification step to the entire automated prediction process. It leverages the generalization knowledge of LLM to compensate for the large errors that may arise in time series base models due to data noise or missing rules, enhancing robustness in dealing with complex events and improving the interpretability and reliability of the prediction process.

[0105] In an optional embodiment, the feature vector includes at least one of time features, date type features, and weather features;

[0106] Time characteristics are used to characterize periodic changes;

[0107] Date type features are used to describe differences in travel patterns among people during holidays;

[0108] Weather features are used to simulate the impact of weather conditions on travel;

[0109] To enhance the model's ability to perceive changes in external factors, in addition to historical passenger flow sequences, this method introduces several types of time-related external information as auxiliary features for holiday passenger flow prediction, mainly including time features, date type features, and weather features. Among these, date type features and weather features are converted into numerical values ​​through encoding.

[0110] 1. Time characteristics: Extract basic time components such as year, month, day, hour, and minute as time characteristics to capture periodic and trend changes including daily cycle, weekly cycle, monthly fluctuation, and annual growth.

[0111] 2. Date Type Features: Date type features reflect the differences in travel patterns among people at different times, covering basic categories such as weekdays, weekends, and holidays. Considering the special growth trends in passenger flow during the transition between weekdays and rest days, and the passenger flow fluctuations on the first and last dates of long public holidays in different countries, date types such as "the day before the holiday," "the day before the weekend," and "the day of the holiday" are introduced to characterize various changing patterns of people's travel activities. In addition, features such as holiday names and holiday day numbers are included to enhance the model's ability to model the structural impact of holidays.

[0112] 3. Weather characteristics: Weather characteristics include weather type (classified according to precipitation, such as sunny, cloudy, rain, snow), minimum temperature and maximum temperature for each date, which are used to simulate the impact of weather on travel behavior.

[0113] All categorical features are converted into numerical features that the model can recognize through integer encoding, mapping each enumerated category to a unique numerical value.

[0114] In this embodiment, the feature vector integrates time features, date type features, and weather features to construct a multi-dimensional state descriptor. Specifically, non-numerical date type and weather information are converted into numerical forms that the model can process through encoding techniques, enabling the subsequent model to systematically learn the correlation between these external factors and passenger flow dynamics.

[0115] Figure 2The diagram illustrates a training process for a time-series pedestal model provided by the present invention. In one optional embodiment, such as... Figure 2 As shown, the time-series pedestal model is trained in the following way:

[0116] S201. From historical passenger flow data, construct sample sequences using a sliding window. Each sample sequence consists of consecutive time steps.

[0117] From historical passenger flow data, a sliding window technique is used to extract continuous segments, each of which is considered a sample sequence. Each sample sequence consists of a series of continuous time steps, such as a sequence of 100 hours (one week) in length, with a time step granularity of 15 minutes or 1 hour.

[0118] S202. Apply a mask to a portion of the observations in each sample sequence, and use the masked time step with the real passenger flow value as the target time step.

[0119] For each constructed sample sequence, a subset of time steps containing passenger flow observations are randomly selected and masked (i.e., hidden or replaced with special labels). These masked time steps, which originally contained real passenger flow values, are defined as the target time steps for this training. This operation simulates scenarios where data is missing or prediction is required, forcing the model to learn to infer the hidden values ​​based on contextual information.

[0120] In an optional embodiment, to further enhance the model's generalization ability under diverse time series structures, this embodiment employs a self-supervised pre-training approach. Each training sample will randomly mask part of its observations, forming a training target pair with the original training sample itself. Specifically, this method uses three different masking strategies:

[0121] Random time point mask: Randomly select several time points in the time series at a specified ratio, and set the observation values ​​at the corresponding positions as missing to simulate the scenario of missing sporadic data.

[0122] Sliding time window mask: By setting a portion of the data in a time series to be missing with a specified sliding step size and masking length, the model's ability to model discontinuous positions in the time series is enhanced, simulating scenarios of periodic missing data.

[0123] Continuous time block mask: Masks data of a specified length at the end of a time series to simulate a scenario where recent data intervals are missing.

[0124] During training, the three masking methods mentioned above are used in combination with a certain probability to generate training samples with diverse structures. This allows the model to be exposed to various data missing scenarios during the training phase, learn robust and generalized time series representations, and improve its robustness and generalization ability in prediction tasks.

[0125] In addition, to improve the model's adaptability to different input lengths and missing patterns, online masking is used during training. New masks are dynamically generated in each iteration, which further increases the learning difficulty of the model and makes the model more capable of modeling.

[0126] S203. A quantile regression loss function is used to learn the conditional distribution of passenger flow values ​​at different quantiles at each masked time step.

[0127] The model training employs a quantile regression loss function. Unlike ordinary regression, which only predicts a single expected value, quantile regression aims to learn the conditional distribution of the actual passenger flow at different quantiles (e.g., 10%, 50%, 90%) at each masked target time step. This allows the model to not only predict the most probable value (e.g., the median) but also estimate the range of uncertainty in the prediction, such as the prediction interval.

[0128] S204. For each sample sequence, calculate the quantile regression loss only at the target time step in that sample sequence to obtain the loss at each target time step.

[0129] For each sample sequence, the model outputs a set of quantile predictions for each target time step based on its context (the unmasked portion). Loss calculation is performed only for these target time steps. The model compares the predicted quantiles with the actual values ​​at locations where the true values ​​are known, and calculates the loss for each target time step using the quantile loss function. The unmasked portions of the sequence are not included in the loss calculation, thus focusing on the model's data completion or prediction capabilities.

[0130] S205. Solve for the model loss value based on the loss of all quantiles, all sample sequences, and all target time steps.

[0131] The losses at all target time steps are aggregated across all quantiles and all sample sequences to obtain a global model loss value. Optionally, the model loss value is obtained by summing and averaging the losses at all quantiles, all sample sequences, and all target time steps.

[0132] The final loss value is obtained by summing and averaging over all quantiles, all samples, and time steps, as shown in the following formula, where I(⋅) is an indicator function, which is 1 if the condition is met, and 0 otherwise.

[0133] ;

[0134] Where R is the model loss value, , Let be the actual value and predicted value of the passenger flow data for sample i at time step t, respectively; N be the total number of training samples (sample sequences); i be the sample index; Q be the preset total number of quantiles; q be the quantile index; and τ be the quantile index. q t represents the level value of the q-th quantile; L represents the total number of time steps in a single sample sequence, and t represents the time step index. Let be the binary mask indicator function for sample i at time step t.

[0135] S206. Determine whether the model loss value is less than the preset loss threshold.

[0136] If the value is below the threshold, it means the model training is sufficient, and proceed to step S207; if the value is not below the threshold, return to step S202, regenerate the mask in the next round of training, and continue iterative optimization until the model performance meets the requirements (the model loss value is less than the loss threshold).

[0137] S207. Update the model parameters of the time series base model based on the model loss value.

[0138] Based on the calculated model loss value, the gradient is calculated using a backpropagation algorithm (such as stochastic gradient descent and its variants), and all trainable parameters of the time series pedestal model are updated accordingly. Through numerous such iterations, the model gradually learns to robustly infer the overall sequence pattern and its probability distribution from partial observations.

[0139] This embodiment drives the model to learn deep features of passenger flow sequences through a self-supervised task of mask reconstruction; and through a loss design of quantile regression, the model is equipped with the ability to output uncertain predictions.

[0140] In an optional embodiment, Figure 3 An architecture diagram of a timing-based base model is shown.

[0141] Taking cross-sectional passenger flow prediction as an example, the passenger flow data of N cross-sectional intervals over a time period of length L are considered as N sets of time series. The i-th set of time series can be expressed as follows, where x t i Let represent the observation value of the i-th time series at timestamp t.

[0142] x i =(x1 i x2 i ,…x L i ),x t i ∈R;

[0143] The model first processes the original time series through an input embedding module. Each time series x i Use the mean μ within the sequence iand standard deviation σ i Perform data normalization to remove statistical effects between samples:

[0144]

[0145]

[0146] Then, the normalized time series is divided into blocks, forming k non-overlapping segments of length s, where the j-th segment of the i-th time series can be represented as... The segmentation process reduces the length of the time series from L to k, where L = k × s. This operation exponentially reduces the computational cost of subsequent attention relationship modeling, improves model efficiency, and aggregates data from several single time points into subsequences, which helps the model capture higher-level semantic information.

[0147] Drawing inspiration from the Chronos series models that explicitly model missing values ​​in the input time series, a mask sequence of the same length as the input is constructed for each time series. The missing values ​​are 0, and the rest are 1. After block segmentation, it is concatenated with the corresponding sequence fragments (missing values ​​are replaced with 0) and then mapped to a fixed-length vector representation by the input embedding module. The input embedding module adopts a residual connection structure, which can retain the original input information while feature mapping, alleviate the gradient vanishing problem in deep networks, and improve training stability and convergence speed. This structure contains two branches: branch one extracts features through two layers of linear transformation, and branch two performs dimension matching on the input through linear mapping. The results of the two branches are added to form the final vector representation of the input sequence. The formal expression of this process is shown in the following formula, where For the parameters of the linear transformation, The dimension of the vectorized representation of the input sequence. The dimension for the vectorized representation of intermediate results of the linear layer. Represents the activation function ReLU:

[0148] ;

[0149] ;

[0150] ;

[0151] The encoder module uses a stacked Transformer encoder structure, consistent with the T5 model encoder, as its backbone to model the temporal context of the vector representation of the input sequence. In the attention relation calculation within the encoder module, if a segment contains only missing values ​​(i.e., its mask sequence is all 0s), that segment does not participate in the attention calculation. An attention mask is constructed based on this design. Invalid input segments are masked in the encoder. The hidden state of the last layer output by the encoder module is represented as follows:

[0152] ;

[0153] The hidden state representation output by the encoder module is decoded by the output embedding module to restore the hidden state representation to the size of the original sequence, and multiple component values ​​are predicted for each time point to form a passenger flow distribution estimate.

[0154] ;

[0155] This module uses the same residual connection structure as the input embedding module, but the input and output dimensions are different. The parameters of the linear transformation are respectively... Q represents the number of predicted quantiles.

[0156] The final passenger flow forecast results for each time point are obtained through inverse normalization:

[0157] .

[0158] In an optional embodiment, determining the train schedule for a target date based on passenger flow forecasts for all subway stations includes:

[0159] Based on the passenger flow forecast results of each subway station during each time period within the target date, an objective function and constraints are constructed. The objective function aims to minimize operating costs and / or maximize service levels. Operating costs are related to train travel distance and / or the number of trains used, while service levels are related to average passenger waiting time and / or average cross-sectional occupancy rate. By solving for the optimal solution of the objective function under the constraints, a train operation plan is generated. The train operation plan includes at least one of the following: train departure interval, train formation scheme, and route plan.

[0160] The objective function defines the optimization direction, and the system supports combinations of one or more of the following objectives:

[0161] Minimize operating costs: Costs are mainly directly related to the physical consumption of train operation, including the total travel distance of trains and the number of trains in use.

[0162] Maximize service levels: Service levels focus on passenger experience, with key indicators including average passenger wait time (reflecting the adequacy of departure frequency) and average cross-sectional occupancy rate (reflecting the degree of crowding in the carriages).

[0163] Constraints define the physical and operational limitations that the driving plan must meet, ensuring the feasibility and safety of the solution. Optional constraints mainly include:

[0164] Rolling stock constraint: The number of rolling stock required for the operation plan should be less than or equal to the number of rolling stock available on the line;

[0165] Maximum interval constraint: The non-overlapping interval of the train operation plan should be less than or equal to the maximum interval set by the system to ensure service level.

[0166] System capacity constraints: The interval between overlapping sections of the train operation plan should be greater than or equal to the minimum interval constraint set by the system to ensure operational safety.

[0167] In addition, constraints may include constraints such as maximum cross-sectional load factor, turnaround capacity, available train quantity, and passenger demand coverage.

[0168] Passenger flow during holidays exhibits tidal and other spatiotemporal imbalances, making it difficult for traditional single-route operation models to effectively utilize transport capacity and rolling stock, and also hindering the guarantee of reasonable train intervals. To scientifically and rationally utilize urban rail transit system resources, reduce transportation costs, and improve transport capacity and vehicle utilization efficiency without compromising service levels, an increasing number of urban rail transit lines are adopting shared-route operation modes. Shared-route operation is not only inevitable due to the connectivity structure of the lines but also arises from differences in the spatial distribution of passenger flow.

[0169] In this scenario, this method starts from the passenger flow characteristics of urban rail transit lines and combines the specific turnaround conditions of the lines to propose a train schedule configuration method based on passenger flow analysis and turnaround conditions. The train schedule configuration includes: time period, route type, interval and number of trains for each route, and number of trains required.

[0170] Since the number of turnaround stations on urban rail transit lines is limited, and the number of stations that can actually operate short routes on a given line is usually limited due to actual circumstances, all feasible short and long route schemes on a single line can be obtained through traversal. At the same time, the departure ratio of short and long routes is considered to be 4:1, 3:1, 2:1, 1:1, and 1:2. Based on the predicted passenger flow at the time segment, the total travel cost of each route scheme is calculated. All short and long route schemes that meet the constraints are compared with the single route scheme to select the optimal route scheme.

[0171] When applying this model, the following conditions are assumed to be met:

[0172] 1. Trains on different types of routes in the plan have the same operating speed and the same energy consumption per unit distance.

[0173] 2. The operation plan shall involve a maximum of two types of routes, namely large routes and small routes, and their origin and destination shall be set at stations with turnaround capabilities.

[0174] 3. Long-distance routes always run from the starting station to the ending station, while short-distance routes start and end within the long-distance operating section.

[0175] 4. Assuming that when passengers are waiting for a train in the same operating section, and given that the remaining capacity of the arriving trains is sufficient, the waiting passengers will board the train that arrives first.

[0176] 5. All trains stop at every station, without considering trains that do not stop at intermediate stations.

[0177] 6. The number of passengers on a train shall not exceed its maximum carrying capacity.

[0178] In summary, based on cross-sectional passenger flow analysis and turnaround conditions, under the constraint of maximum cross-sectional load factor, the service level and operating cost performance of each scheme under single-route and co-route modes need to be calculated separately, including two indicators: average cross-sectional load factor and train travel distance.

[0179] Calculation of the number of train carriages on a route: The calculation of the number of train carriages on a route is the core foundation of this model. It aims to calculate the number of train pairs, intervals, and number of train carriages for each route, given the input of the operating routes, the ratio of trains to trains, and the maximum cross-section load factor. It is divided into two cases: independent use of train carriages and combined operation.

[0180] When used independently, given the headway and headway ratio of collinear segments, the following equations can be solved simultaneously:

[0181]

[0182]

[0183] ;

[0184] In the formula, The ratio of large to small routes (input); The cycle time for the large loop (input); The cycle time of the short loop (input); The headway for collinear segments (output); This is the virtual average interval (output); Output the total number of vehicles. Output the number of buses on the main route. Output the base number of small-route vehicles; Maximum cross-sectional load factor constraint (input). is the hourly passenger flow at the maximum passenger flow section (input), and C is the train capacity (input). tu This represents the minimum number of trains (or train sets) required for theoretical calculations.

[0185] Sub-constraints:

[0186] ① The period of the two routes is the virtual average interval between trains on their respective routes. Integer multiples of.

[0187] ②The turnaround time of the train at each turnaround station must meet the minimum and maximum requirements.

[0188] When applying the algorithm in a nested manner, the calculation formulas and parameter meanings are the same as when applying it independently, and the sub-constraints are:

[0189] 1. The cycle of the two routes is the train interval on the shared section. Integer multiples.

[0190] 2. The turnaround time of the train at each turnaround station must meet the minimum and maximum requirements.

[0191] 3. Long cycle time ( () represents the average headway for each route. Integer multiples of.

[0192] The above model is a multi-objective nonlinear mixed-integer programming model, which is solved using the ILOGCPLEX optimizer. , , , , .

[0193] Passenger Service Level Calculation: Under known passenger flow data and relevant operational parameters, and based on the allocation of reasonable train operating periods, the passenger service level indicator aims to meet passenger demand, ensure passenger interests, reduce capacity waste, and improve the company's transportation efficiency. Assuming multiple route schemes i, if the maximum cross-sectional load factor η calculated based on the restricted section... max Under the same conditions, the average cross-sectional load factor η of each scheme will be... i Compare with the minimum cross-sectional average load factor η0 selected in the scheme comparison.

[0194] The average cross-sectional load factor of route scheme i is calculated according to the following formula:

[0195] ηi ;

[0196] Standardized section load factor (passenger service level) index for route scheme i The smaller the value, the higher the service level and the better the solution.

[0197] Standardized section load factor (passenger service level) index for route scheme i The smaller the value, the higher the service level and the better the solution.

[0198] =η i / η0.

[0199] Regarding enterprise operating costs, these costs are related to train operation costs and operating mileage. When train speed remains constant, the greater the mileage traveled, the longer the travel time; the two are directly proportional, resulting in higher costs. Therefore, operating costs can be represented by the mileage traveled. In this method, within a specified time period, the train's mileage is defined as the sum of the product of the number of trips made by each train per unit time and the length of the train's route. Therefore, the total mileage traveled is related to the number of train formations, train departure frequency, and the length of both long and short routes. The greater the total mileage traveled, the greater the total resource consumption. Reasonably setting the number of train formations and train departure frequency can minimize total resource consumption, thereby improving the operational efficiency of urban rail transit to a certain extent.

[0200] The enterprise operating cost of the i-th route configuration scheme is represented by the number of vehicles (train formations) operating on its large and small routes. ×Number of vehicles n i The sum of the products of the distance traveled by the corresponding route type and the distance traveled by the route type The option with the smallest travel distance selected is [missing information]. Therefore, the standardized indicator of enterprise operating cost for the i-th route configuration scheme. The formula is as follows:

[0201] ;

[0202] ;

[0203] The objective function is shown in the following equation, where the standardized index of passenger service level for the i-th route is: The standardized indicators for enterprise operating costs are , The weights for each are determined manually.

[0204] ;

[0205] When calculating the scheme, the route type (single route or large and small routes and their operation ratio) and the full load of the train are used as decision variables. The possible decision variables are iterated. The full load of the train can be iterated from 10% to 150%. The route type can be iterated from the route forms that can be operated. The operation ratio can usually be iterated from large:small (4:1, 3:1, 2:1, 1:1, 1:2).

[0206] The results of the traversal are not applicable to all solutions. It is necessary to set constraints to ensure that the solutions meet the feasibility requirements. The solutions selected by comparison are screened under the above strong constraints, and those that meet the constraints are considered feasible solutions.

[0207] The multiple index values ​​Zi obtained through scheme comparison are sorted from low to high (from best to worst), and the value of the optimal scheme (minimum value) is set as Z_min. All values ​​are standardized to 100 (Zmin / Z_min). i The standardization is performed using a percentage system for ranking.

[0208] Reference Figure 4 The diagram illustrates a subway train schedule generation method provided by an embodiment of the present invention, which specifically includes a passenger flow prediction part and a train schedule part.

[0209] In the passenger flow prediction section, external information is first acquired, then features are quantified to obtain the input sequence, which is then sent to the time-series base model. Next, the time-series base model is trained using historical data, and the trained time-series base model is used to output the prediction results for the input sequence. Finally, the external information and prediction results are analyzed using LLM to determine whether to continue execution or correct the results, thus obtaining the cross-sectional passenger flow results.

[0210] In the driving plan section, multiple schemes (driving plans) are obtained by calculating routes and driving intervals, and the optimal scheme is obtained by screening the multiple schemes.

[0211] This method proposes a subway holiday train schedule generation approach based on multi-source data passenger flow prediction. By deeply integrating multi-source data and a deep learning model, it effectively captures the complex spatiotemporal evolution patterns of passenger flow during holidays. It leverages a large language model with deep reasoning capabilities to comprehensively analyze structured and unstructured data, improving the accuracy of passenger flow prediction for different time periods. Furthermore, it achieves dynamic optimization of train schedules under capacity resource constraints. This approach addresses the problem of uneven spatiotemporal distribution of subway passenger flow during holidays and the difficulty of dynamically matching demand with traditional train schedules. It conducts research on subway holiday train schedule generation based on a time-series foundation and a large language model. Through a two-step framework of accurate passenger flow prediction and train schedule optimization, it effectively solves the core contradiction of capacity and demand mismatch in subway operations during holidays. Experimental data shows that this method significantly improves passenger flow prediction accuracy compared to traditional scheduling models, and the generated train schedules demonstrate outstanding performance in alleviating station congestion, reducing costs and increasing efficiency, and improving operational efficiency.

[0212] At the practical level, the research findings can be directly applied to subway operation decisions. Through accurate forecasting and dynamic adjustment of train schedules, it can effectively alleviate station congestion during holidays, reduce the risk of train overloading, and improve passenger travel experience and operational efficiency. Future research will further expand its scope, such as incorporating more granular information like real-time traffic conditions and passenger transfer behavior, or exploring multi-line network-level collaborative optimization of train schedules to adapt to more complex urban rail transit operation scenarios.

[0213] It should be noted that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0214] Reference Figure 5 The diagram illustrates a subway train schedule generation device according to an embodiment of the present invention, which may specifically include the following modules:

[0215] The data acquisition module 501 is used to acquire external event information for a future target date and the same period in history for each subway station, and to acquire passenger flow data for the same period in history and adjacent dates, wherein the adjacent dates are dates in a continuous time window immediately preceding the target date;

[0216] Alignment module 502 is used to align the external event information with known passenger flow data in the time and space dimensions.

[0217] The feature sequence construction module 503 is used to construct feature sequences of the target date and each time period in the historical same period based on the aligned data;

[0218] The input sequence construction module 504 is used to construct an input sequence based on the feature sequence and the passenger flow data of the adjacent dates, wherein the predicted passenger flow data of each time period in the target date is masked as missing values ​​in the input sequence;

[0219] The passenger flow prediction module 505 is used to input the input sequence into the trained time series base model to obtain the passenger flow prediction results of the current subway station in each time period of the target date;

[0220] The train schedule construction module 506 is used to determine the train schedule for the target date based on the passenger flow forecast results of all subway stations.

[0221] Optionally, the feature sequence construction module 503 is used for:

[0222] Based on the aligned data, for the target date and each time period in the same historical period, a multi-dimensional feature vector containing time attributes, external events, spatial attributes and historical statistical features is constructed.

[0223] The feature vectors are arranged in chronological order to obtain the feature sequence for the current time period.

[0224] Optionally, the input sequence construction module 504 is used for:

[0225] Using a pre-trained regression model, the feature sequence is converted into a feature code that is consistent with the numerical scale of the passenger flow data;

[0226] The passenger flow data of the adjacent dates is concatenated with the corresponding feature codes to obtain an input sequence. In the input sequence, the passenger flow data corresponding to each time period of the target date is represented by placeholders.

[0227] Optionally, the device further includes a calibration module, which is used for:

[0228] The external event information for the target date is input into a preset large language model. The large language model analyzes the consistency between the external event information and the feature sequence, and outputs the verification result.

[0229] The verification result includes at least one of the following:

[0230] Instructions to continue execution, correction instructions, or reports describing the analysis process.

[0231] Optionally, the feature vector includes at least one of time features, date type features, and weather features;

[0232] The time feature is used to characterize periodic changes;

[0233] The date type feature is used to describe the differences in travel patterns among people related to holidays;

[0234] The weather features are used to simulate the impact of weather conditions on travel;

[0235] The date type feature and the weather feature are converted into numerical values ​​through an encoding method.

[0236] Optionally, the device further includes a training module, through which the time-series base model is trained. The training module is used for:

[0237] From historical passenger flow data, a sample sequence is constructed using a sliding window, and each sample sequence consists of consecutive time steps.

[0238] A partial mask is applied to the observations in each sample sequence, and the masked time step with the real passenger flow value is taken as the target time step;

[0239] A quantile regression loss function is used to learn the conditional distribution of passenger flow values ​​at different quantiles at each masked time step;

[0240] For each sample sequence, the quantile regression loss is calculated only at the target time step in that sample sequence to obtain the loss for each target time step;

[0241] The model loss value is calculated based on the loss of all quantiles, all sample sequences, and all target time steps.

[0242] The model parameters of the time series base model are updated based on the model loss value, and the process of applying a mask to a portion of the observations in each sample sequence is returned until the model loss value is less than a preset loss threshold.

[0243] Optionally, when the training module calculates the model loss value based on the loss of all quantiles, all sample sequences, and all target time steps, it performs the following steps:

[0244] The model loss value is obtained by summing and averaging the losses of all quantiles, all sample sequences, and all target time steps.

[0245] Optionally, the driving plan construction module 506 is used for:

[0246] Based on the passenger flow forecast results of each subway station during each time period within the target date, an objective function and constraints are constructed; the objective function aims to minimize operating costs and / or maximize service levels, wherein the operating costs are related to train travel distance and / or the number of trains used, and the service levels are related to average passenger waiting time and / or average cross-sectional occupancy rate.

[0247] A train operation plan is generated by solving the objective function under the constraints. The train operation plan includes at least one of train departure intervals, train formation schemes, and route plans.

[0248] The present invention provides a subway train schedule generation device, which can realize the steps in the aforementioned subway train schedule generation method embodiments.

[0249] It should be noted that the module division in the various subway train schedule generation devices provided in the above embodiments is illustrative and only represents a logical functional division. In actual implementation, other division methods may also be used. Furthermore, the functional modules in the various embodiments of this invention can be integrated into a single processor, exist as separate physical entities, or be integrated into a single module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0250] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the technical solution of the embodiments of the present invention can be embodied in the form of a computer program product, which is stored in a computer storage medium and includes several instructions to cause an electronic device or processor to execute all or part of the steps of the methods in the various embodiments of the present invention. The aforementioned computer storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0251] Furthermore, the subway train schedule generation device and the subway train schedule generation method provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0252] Reference Figure 6 The diagram illustrates an electronic device according to an embodiment of the present invention. Figure 6 As shown, the electronic device in this embodiment of the invention includes: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the above-described subway train schedule generation method embodiment. Alternatively, when the processor executes the computer program, it implements the functions of each module in the above-described subway train schedule generation device embodiment.

[0253] For example, the computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to complete this application. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which can be used to describe the execution process of the computer program in the electronic device.

[0254] The electronic device may be a desktop computer, a cloud server, or other computing device. The electronic device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 6 This is merely one example of an electronic device and does not constitute a limitation on the electronic device. It may include more or fewer components than illustrated, or combine certain components, or different components. For example, the electronic device may also include input / output devices, network access devices, buses, etc.

[0255] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0256] The memory can be an internal storage unit of the electronic device, such as a hard drive or RAM. Alternatively, it can be an external storage device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc. Furthermore, the memory can include both internal and external storage units. The memory is used to store the computer program and other programs and data required by the electronic device. The memory can also be used to temporarily store data that has been output or will be output.

[0257] This invention also discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the subway train schedule generation method as described in the foregoing embodiments.

[0258] This invention also discloses a computer-readable storage medium storing a computer program that, when executed by a processor, implements the subway train schedule generation method as described in the foregoing embodiments.

[0259] This invention also discloses a computer program product that, when run on a computer, causes the computer to execute the subway train schedule generation method described in the foregoing embodiments.

[0260] The embodiments described above are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A method for generating subway train schedules, characterized in that, include: For each subway station, external event information for the future target date and the same historical period is obtained, and passenger flow data for the same historical period and adjacent dates is obtained, wherein the adjacent dates are dates in a continuous time window immediately preceding the target date; Align the external event information with the known passenger flow data in both time and space dimensions; Based on the aligned data, a feature sequence of the target date and each time period in the same historical period is constructed. An input sequence is constructed based on the feature sequence and the passenger flow data of the adjacent dates, wherein the predicted passenger flow data for each time period in the target date is masked as missing values ​​in the input sequence; The input sequence is fed into the trained time series base model to obtain the passenger flow prediction results of the current subway station in each time period of the target date; The train schedule for the target date is determined based on the passenger flow forecasts for all subway stations.

2. The method according to claim 1, characterized in that, The process of constructing feature sequences for the target date and various time periods within the same historical period based on the aligned data includes: Based on the aligned data, for the target date and each time period in the same historical period, a multi-dimensional feature vector containing time attributes, external events, spatial attributes and historical statistical features is constructed. The feature vectors are arranged in chronological order to obtain the feature sequence for the current time period.

3. The method according to claim 1, characterized in that, The step of constructing the input sequence based on the feature sequence and the passenger flow data of adjacent dates includes: Using a pre-trained regression model, the feature sequence is converted into a feature code that is consistent with the numerical scale of the passenger flow data; The passenger flow data of the adjacent dates is concatenated with the corresponding feature codes to obtain an input sequence. In the input sequence, the passenger flow data corresponding to each time period of the target date is represented by placeholders.

4. The method according to claim 1, characterized in that, Before inputting the input sequence into the trained time-series base model to obtain the passenger flow prediction results for the current subway station in each time period of the target date, the method further includes: The external event information for the target date is input into a preset large language model. The large language model analyzes the consistency between the external event information and the feature sequence, and outputs the verification result. The verification result includes at least one of the following: Instructions to continue execution, correction instructions, or reports describing the analysis process.

5. The method according to claim 1, characterized in that, The feature vector includes at least one of time features, date type features, and weather features; The time feature is used to characterize periodic changes; The date type feature is used to describe the differences in travel patterns among people related to holidays; The weather features are used to simulate the impact of weather conditions on travel; The date type feature and the weather feature are converted into numerical values ​​through an encoding method.

6. The method according to any one of claims 1-5, characterized in that, The time-series base model is trained in the following way: From historical passenger flow data, a sample sequence is constructed using a sliding window, and each sample sequence consists of consecutive time steps. A partial mask is applied to the observations in each sample sequence, and the masked time step with the real passenger flow value is taken as the target time step; A quantile regression loss function is used to learn the conditional distribution of passenger flow values ​​at different quantiles at each masked time step; For each sample sequence, the quantile regression loss is calculated only at the target time step in that sample sequence to obtain the loss for each target time step; The model loss value is calculated based on the loss of all quantiles, all sample sequences, and all target time steps. The model parameters of the time series base model are updated based on the model loss value, and the process of applying a mask to a portion of the observations in each sample sequence is returned until the model loss value is less than a preset loss threshold.

7. The method according to claim 6, characterized in that, The step of calculating the model loss value based on the loss of all quantiles, all sample sequences, and all target time steps includes: The model loss value is obtained by summing and averaging the losses of all quantiles, all sample sequences, and all target time steps.

8. The method according to any one of claims 1-5, characterized in that, The step of determining the train schedule for the target date based on the passenger flow forecast results of all subway stations includes: Based on the passenger flow forecast results of each subway station during each time period within the target date, an objective function and constraints are constructed; the objective function aims to minimize operating costs and / or maximize service levels, wherein the operating costs are related to train travel distance and / or the number of trains used, and the service levels are related to average passenger waiting time and / or average cross-sectional occupancy rate. A train operation plan is generated by solving the objective function under the constraints. The train operation plan includes at least one of train departure intervals, train formation schemes, and route plans.

9. 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 computer program, it implements the subway train schedule generation method as described in any one of claims 1-8.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the subway train schedule generation method as described in any one of claims 1-8.