Method and device for cooperative control and intelligent optimization of urban rail transit regional passenger flow

By constructing a spatiotemporal-state network and a deep reinforcement learning framework, a reward function was designed to optimize passenger flow control in urban rail transit. This solved the problem that traditional methods are unable to cope with large passenger flow events, achieving intelligent and efficient passenger flow management, improving operational efficiency and reducing passenger waiting time.

CN121328986APending Publication Date: 2026-01-13GUANGZHOU METRO GRP CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202511360837.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-23
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Traditional urban rail transit passenger flow control methods are difficult to effectively cope with large passenger flow events, and the reward function design of reinforcement learning algorithms relies on human experience, which limits their practicality and adaptability.

Method used

Based on the topology of the urban rail network and historical passenger flow data, a spatiotemporal-state network is constructed. Combining a deep reinforcement learning framework, a reward function is designed and an agent is trained to optimize the passenger flow control strategy. A large language model is used to generate a reward function that adapts to passenger flow control, and the optimization strategy is improved through interactive training and correction.

Benefits of technology

It improves the operational efficiency of urban rail transit systems, reduces passenger waiting time, and provides intelligent and efficient decision support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121328986A_ABST
    Figure CN121328986A_ABST
Patent Text Reader

Abstract

The invention provides an urban rail transit regional passenger flow cooperative control and intelligent optimization method and device, and the method comprises the steps: describing the passenger flow evolution through a space-time state network, building a regional cooperative passenger flow control optimization model which takes the minimization of passenger waiting time as an objective function, and considers the constraints such as flow balance and capability constraints; and converting the optimization model into a deep reinforcement learning framework based on a Markov decision process, generating a reward function adaptive to passenger flow control by using a large language model LLM, and continuously optimizing a reward strategy according to the test performance of the agent through interactive training of a deep reinforcement learning agent and establishment of a reward function correction mechanism. Finally, a regional passenger flow control scheme is extracted from the trained agent model, more intelligent and efficient decision support is provided for subway managers, the operation efficiency of an urban rail transit system is improved, and the queuing waiting time of passengers is shortened.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of rail transit, in particular to a regional passenger flow coordination control and intelligent optimization method for urban rail transit, a regional passenger flow coordination control and intelligent optimization device for urban rail transit, an electronic device and a computer readable medium. BACKGROUND

[0002] With the continuous expansion of urban rail transit network and the increase of line density, the complexity of operation organization and the challenge of passenger flow management are increasingly prominent. In actual operation, the imbalance between supply and demand often occurs, and the traditional urban rail transit passenger flow control method is often difficult to effectively respond to frequent large passenger flow events. Although reinforcement learning has significant advantages in solving large-scale, dynamic and complex passenger flow control problems, the design of its reward function mainly depends on artificial experience and needs to go through repeated trial and error, which greatly limits the practicality and adaptability of the algorithm. SUMMARY

[0003] In view of the above problems, the present application is proposed in order to provide a regional passenger flow coordination control and intelligent optimization method for urban rail transit and corresponding regional passenger flow coordination control and intelligent optimization device for urban rail transit, electronic device and computer readable medium which overcome the above problems or at least partially solve the above problems.

[0004] The present application discloses a regional passenger flow coordination control and intelligent optimization method for urban rail transit, which comprises:

[0005] Based on the topological structure, historical passenger flow and train working diagram data of the urban rail line network, a space-time-state network is constructed to describe passenger flow evolution, and a regional coordinated passenger flow control optimization model is established;

[0006] The regional coordinated passenger flow control optimization process is reconstructed into a deep reinforcement learning framework based on Markov decision process, including environment, action, reward, state and policy;

[0007] A prompt engineering is designed to describe passenger flow control objectives, background knowledge, deep reinforcement learning framework and specific output objectives, and a reward function conforming to urban rail passenger flow control optimization is generated by a large language model LLM;

[0008] Using the generated reward function, a deep reinforcement learning agent is trained and tested, and the training and testing results are recorded for reward function modification and analysis;

[0009] According to the reward function analysis result, the current reward function is adjusted by using the large language model LLM, and the regional passenger flow control scheme is output after training.

[0010] The application further discloses a device for urban rail transit regional passenger flow coordination control and intelligent optimization.

[0011] A regional coordination passenger flow control optimization model construction module is used for constructing a space-time-state network to describe passenger flow evolution and establishing a regional coordination passenger flow control optimization model based on the topological structure, historical passenger flow and train operation diagram data of the urban rail line network.

[0012] A deep reinforcement learning framework construction module is used for reconstructing the regional coordination passenger flow control optimization process into a deep reinforcement learning framework based on a Markov decision process, including an environment, an action, a reward, a state and a policy.

[0013] A reward function generation module is used for designing a prompt engineering for describing passenger flow control objectives, background knowledge and a deep reinforcement learning framework and specific output objectives, and generating a reward function meeting the urban rail passenger flow control optimization through a large language model (LLM).

[0014] A correction analysis module is used for training and testing a deep reinforcement learning intelligent agent using the generated reward function, recording training and testing results, and performing reward function correction and analysis.

[0015] A regional passenger flow control scheme generation module is used for adjusting the current reward function through a large language model (LLM) according to the reward function analysis result, and outputting a regional passenger flow control scheme after training.

[0016] The application further discloses an electronic device, which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus.

[0017] The memory is used for storing a computer program.

[0018] The processor is used for executing the program stored on the memory, and realizes the urban rail transit regional passenger flow coordination control and intelligent optimization method.

[0019] The application further discloses a computer readable medium, which stores instructions, and when executed by one or more processors, causes the processor to execute the urban rail transit regional passenger flow coordination control and intelligent optimization method.

[0020] The application has the following advantages:

[0021] The urban rail transit regional passenger flow cooperative control and intelligent optimization method provided by the present application utilizes a space-time state network to describe passenger flow evolution, establishes a regional cooperative passenger flow control optimization model with a minimum passenger waiting time as an objective function, considers flow balance and capacity constraints and other constraints, converts the optimization model into a deep reinforcement learning framework based on a Markov decision process, utilizes a large language model (LLM) to generate a reward function suitable for passenger flow control, trains a deep reinforcement learning agent through interaction, establishes a reward function correction mechanism, continuously optimizes the reward strategy according to the test performance of the agent, and finally extracts a regional passenger flow control scheme from the trained agent model, thereby providing more intelligent and efficient decision support for subway managers and helping to improve the operation efficiency of the urban rail transit system and reduce the queuing waiting time of passengers. BRIEF DESCRIPTION OF DRAWINGS

[0022] Figure 1 is a step flow chart of an urban rail transit regional passenger flow cooperative control and intelligent optimization method provided by an embodiment of the present application;

[0023] Figure 2 is a reinforcement learning flow chart fusing a large language model provided by an embodiment of the present application. DETAILED DESCRIPTION

[0024] The present application fuses a large language model and deep reinforcement learning to intelligently optimize urban rail transit passenger flow control strategies, thereby providing more intelligent and efficient decision support for subway managers and helping to improve the operation efficiency of the urban rail transit system and reduce the queuing waiting time of passengers.

[0025] In order to make the above-mentioned objects, features and advantages of the present application more apparent and easy to understand, the present application will be further described in detail below with reference to the drawings and specific embodiments.

[0026] Reference Figure 1 is a step flow chart of an urban rail transit regional passenger flow cooperative control and intelligent optimization method provided by an embodiment of the present application, which can specifically include the following steps:

[0027] Step 101, based on the topological structure of the urban rail line network, passenger flow data and train operation diagram data, a space-time-state network is constructed to describe passenger flow evolution, and a regional cooperative passenger flow control optimization model is established;

[0028] In an optional embodiment of the present application, based on the topological structure of the urban rail line network, historical passenger flow and train operation diagram data, a space-time-state network is constructed to describe passenger flow evolution, and a regional cooperative passenger flow control optimization model is established, which includes:

[0029] The space-time-state network is constructed to describe passenger flow evolution:

[0030] The topology of the urban rail transit network is abstracted into a topological network, wherein nodes represent a set of facilities and equipment within stations, and edges represent a set of arcs connecting nodes, including operating lines and transfer channels between adjacent stations, and train operation intervals between adjacent stations are abstracted into two one-way arc segments, respectively corresponding to up and down platform nodes;

[0031] A time dimension is introduced into the topological network to expand it into a space-time network, forming a space-time point set and a space-time arc set for representing dynamic distribution of passenger flow;

[0032] Discrete passenger flow states are defined based on pedestrian flow characteristics, and the space-time arcs are further expanded into space-time state arcs, attributes of each space-time state arc including flow, density and speed attributes, and a time interval of the space-time state arc is obtained according to travel time in the corresponding state of an entering arc or a transfer arc, the travel time being obtained from a train operation timetable;

[0033] A regional collaborative passenger flow control optimization model is established:

[0034] An urban rail transit network flow limiting model is established with the objective of minimizing total waiting time of all passengers, the total waiting time of passengers including waiting time required by passengers at each platform to wait for arrival of a train, and constraint conditions including passenger flow balance constraint, train and channel capacity constraint, observation equation between network passenger flow density and space-time arc state, space-time arc state uniqueness constraint, 0-1 variable constraint and passenger flow control proportion constraint.

[0035] The detailed construction process of the regional collaborative passenger flow control optimization model is as follows:

[0036] 1. Constructing a space-time state network to describe passenger flow evolution:

[0037] A space-time-state network considering passenger travel process is constructed to convert the urban rail transit network from a static topological network into a dynamic space-time network, and to deeply depict the whole process of passenger travel, including entering a station, waiting, boarding, transferring and leaving a station, so as to simulate changes in passenger flow environment under the influence of passenger flow organization strategies and to provide an environmental basis for strategy optimization. The specific steps are as follows:

[0038] 1) The actual subway network is abstracted into a topological network G=(V,E), wherein nodes V={i|i∈V} represent a set of facilities and equipment within stations, and edges E={(i,j)|i,j∈V} represent a set of arcs connecting nodes, such as operating lines and transfer channels between adjacent stations. Train operation intervals between adjacent stations are abstracted into two one-way arc segments, respectively starting and ending at up and down platform nodes.

[0039] 2) Considering the dynamic distribution of passenger flow in the road network, the time dimension is introduced into the physical topology network, and the topology network G(V, E) is expanded into a space-time network G_st(V_st, E_st) to form a space-time point set V_st={(i, t)} and a space-time arc set E_st={(i, j, t, t')}, to represent the dynamic distribution of passenger flow.

[0040] 3) Based on the analysis of the characteristics of pedestrian flow, the discrete passenger flow state m is defined, and the space-time arc (i, j, t, t') is expanded into a space-time state arc (i, j, t, t', m, m'). Each space-time state arc (i, j, t, t', m, m') has its own attributes, including flow Qij(m), density Kij(m) and speed vij(m) and the like. It should be noted that the time interval sequence number t' of the arc (i, j, t, t', m, m') is calculated according to the following formula:

[0041] t' = t + TT ij (m)

[0042] Where the travel time TTij(m) in state m through the entering arc or transfer arc (i, j) can be calculated according to the following formula, and TTij(m) can be obtained from the train operation timetable.

[0043]

[0044] The model index is shown in Table 1:

[0045] Table 1 Index Description

[0046]

[0047]

[0048] The model set is shown in Table 2:

[0049] Table 2 Set Description

[0050]

[0051] The model variables and parameters are shown in Table 3:

[0052] Table 3 Variable and Parameter Description

[0053]

[0054] 2、Regional collaborative passenger flow control optimization model objective function and decision variables

[0055] A flow control model of urban rail transit network is established to minimize the total waiting time of all passengers. The total waiting time T of passengers includes the waiting time t1 of passengers waiting for trains at each platform, the additional waiting time t2 or t3 of passengers due to the flow control outside the station or in the station hall, which dynamically changes with the passenger flow control strategy of the station, as shown below:

[0056] T=t1+t2+t3

[0057]

[0058] wherein V plf ,V in ,V trf represent the set of platform nodes, the set of inbound nodes and the set of transfer nodes respectively. E ride represents the set of boarding arcs. m, m', m0 represent the space-time arc state, and m, m', m0∈M. p represents a passenger, and p∈P.

[0059] The decision variable a i,t represents the passenger flow control strength of the passenger flow control strength of node i at time t, which specifically refers to the ratio of the number of passengers directly controlled by the passenger flow control to the number of passengers at the spatial position represented by the node.

[0060] 3. Establishment of constraint conditions of regional collaborative passenger flow control optimization model

[0061] 1) The passenger flow balance constraint refers to the inflow of passenger flow at space-time node (i, t) being equal to the outflow. Wherein, E ts (p) is the set of alternative paths of passenger p, as shown below:

[0062]

[0063] 2) The capacity constraint of trains and channels refers to the total number of passengers on inbound arcs, transfer arcs, platform waiting arcs and boarding arcs (i, j) within a time period (t, t') being lower than the carrying capacity cap(i, j), as shown below:

[0064]

[0065] 3) The observation equation between network passenger flow density and space-time arc state

[0066] The network passenger flow density K ij (m) under the discrete passenger flow state m can be consistent with the passenger flow congestion degree represented by the space-time state m through the aggregated passenger flow on inbound arcs, transfer arcs and outbound arcs (i, j) within any time interval t, as shown below:

[0067]

[0068] 4) The spatio-temporal arc state uniqueness constraint means that any physical arc (i,j) in the metro system has a unique discrete passenger flow state in any time interval t, as shown below:

[0069]

[0070] 5) 0-1 variable constraint: represents the decision variable x p (i,j,t,t',m,m') variable and z(i,j,t,m) are 0-1 integer variables, as shown below:

[0071] x p (i,j,t,t',m,m')∈{0,1}

[0072] z(i,j,t,m)∈{0,1}

[0073] 6) Passenger flow control ratio constraint: represents the direct passenger flow control ratio, specifically the proportion of the number of passengers directly controlled to the total passenger flow demand, the spatio-temporal arc (i,j,t,t') includes the entry arc, the waiting arc, and the transfer arc, and the spatio-temporal arc (i,i,t,t') can only represent the waiting arc at node i, and the feasible region of the passenger flow control strength is between 0 and 1, a i,t = 0 means that passenger flow control is not needed at this location a i,t = 1 means that no passengers can enter the station at this location, as shown below:

[0074]

[0075] a i,t ∈[0,1]

[0076] Step 102, reconstructing the regional collaborative passenger flow control optimization process into a deep reinforcement learning framework based on Markov decision process, including environment, action, reward, state, and policy;

[0077] In an optional embodiment of the present application, the regional collaborative passenger flow control optimization process is reconstructed into a deep reinforcement learning framework based on Markov decision process, including:

[0078] The action space is the passenger flow control strategy, representing the proportion of passenger flow allowed to enter the station to the passenger flow demand, and in the transfer channel, representing the proportion of transfer allowed to enter the platform to the total transfer passenger flow demand;

[0079] The passenger flow state in the state space includes entry passenger flow demand, transfer channel passenger flow, cross-section passenger flow, and waiting number on the platform;

[0080] A dynamic environment simulator is built by using space-time-state network, and the state transition model is based on Markov. According to the current passenger flow control strategy, the space-time distribution of passenger flow is simulated under the influence of passenger flow organization strategy, and the state of passenger flow in each node and arc segment of the network is dynamically updated to provide an environmental basis for strategy optimization.

[0081] The reward function is used to determine whether the passenger flow state in the passenger flow control optimization problem reaches the set target, and is constructed based on the cumulative waiting time of passengers outside the station, the cumulative waiting time of passengers on the platform, and the cumulative waiting time of passengers in the transfer channel.

[0082] The strategy function is used to represent the way of selecting passenger flow control actions under a given passenger flow state. The strategy function combines and processes state information and target information through an artificial neural network, and outputs corresponding action decisions.

[0083] The reinforcement learning process based on Markov decision process is as follows:

[0084] (1) Action space: The action represents the passenger flow control strategy, specifically the proportion of passenger flow allowed to enter the station to the passenger flow demand, and in the transfer channel, it represents the proportion of transfer allowed to enter the platform to the total transfer passenger flow demand, which is referred to as control rate in this paper. Action set A = {a i,t |a i,t ∈ [0, 1], i ∈ N, t ∈ T}, where N represents the set of internal facilities of the station, and t represents the start time of passenger flow control. For example, assuming that there are 100 people who need to enter the internal facilities i of the station at control stage t. If the action a i,t = 10%, then the number of people allowed to enter the station facilities i at stage t is equal to 90. If the action a i,t = 0, it means no passenger flow control, and everyone can enter the station; the action a i,t = 100%, which means no one is allowed to enter the station facilities i. In the space-time-state network model, because the running interval of the train is 2 minutes, the minimum time step is 1 minute. Assuming that the vacancy rate of the station entry volume changes at the beginning of control, the control time step Δt = 5 minutes, and the station entry volume control rate changes every 5 minutes.

[0085] Assuming that a certain station n needs to consider passenger flow control at the station entrance and the transfer channel:

[0086] Let a represent the station entry passenger flow control rate.

[0087] Let a represent the inflow control rate on the transfer channel. If the station n is not a transfer station, then a Here, all stations are unified in dimension for convenience. a tThis is a sequence of passenger flow control strategies. Where n∈N.

[0088] (2) State Space: The passenger flow state in the road network includes the passenger demand at the station, the passenger flow in the transfer passage, the passenger flow in the cross section, and the number of people waiting on the platform. It is worth noting that the state in the passenger flow control reinforcement learning problem refers to the passenger flow of the road segment, while the state dimension of the spatiotemporal-state network is a discrete passenger flow state defined according to the congestion degree of the spatiotemporal arc. The two have different meanings.

[0089] In the passenger flow evolution module, state s i,t As shown below:

[0090]

[0091] To facilitate observation of the objective function, we need to consider passenger flow outside the station, passenger flow on the platform, and passenger flow in the transfer passage. Assuming a station n, the passenger flow status of this station needs to consider passenger flow at three locations: the station entrance, the platform, and the transfer passage.

[0092] make This represents the demand for passenger flow entering the station.

[0093] make This represents the passenger flow in the transfer corridor. If station n is not a transfer station, then...

[0094] make This represents the number of passengers waiting on the platform.

[0095] s t As a passenger flow control sequence, Where n∈N, and N is the set of stations.

[0096] The basic reinforcement learning framework does not consider constraints imposed on the decision space. Combining the set capability constraints, the passenger flow state at all stages t is normalized, as shown below. The dimension of the normalized state is exactly the same as the actual state, only... All elements are defined in the interval [0,1]. According to the following formula, we can... The elements in are reduced to s t The corresponding element in.

[0097]

[0098] Normalized s will be replaced in the deep reinforcement learning module later. t .

[0099] (3) Environment simulation: A dynamic environment simulator is constructed by using the space-time-state network G_{st} to simulate the change of the passenger flow distribution under the influence of the passenger flow organization strategy according to the current passenger flow control strategy through the Markov state transition model, and dynamically update the passenger flow state of each node and arc segment in the network to provide an environmental basis for strategy optimization.

[0100] (4) Reward function: The passenger flow coordination control strategy aims to alleviate the congestion at the station, prevent passengers from staying for a long time, reduce the operational safety risk, and improve the operational efficiency. Therefore, the effect of the passenger flow coordination control strategy can be evaluated according to the expected waiting time of passengers at the station, the waiting time of passengers outside the station, and the waiting time of passengers in the transfer channel, and the reward function is used to determine whether the passenger flow state reaches the set target in the reinforcement learning problem. At time t, the reward R(t) is obtained as follows.

[0101]

[0102] where q = 1, 2, 3 represents the target number; q = 1 is the cumulative waiting time of passengers outside the station, q = 2 is the cumulative waiting time of passengers on the platform, and q = 3 is the cumulative waiting time of passengers in the transfer channel.

[0103] Expected return function G of passenger flow control optimization problem t as follows.

[0104]

[0105] where the discount factor (Discount Factor) γ ∈ (0, 1] determines how the cost at each future stage is evaluated, that is, the farther away from the current stage, the smaller the reward converted to the current stage. The γ of different targets g can be calculated by the following formula.

[0106]

[0107] (5) Strategy function: Strategy π Φ is the most important element in reinforcement learning, which represents how to choose action a t in state s . The universal value function approximator based on ANN combines V Φ and g, and inputs into π as follows. In the deep reinforcement learning network, π Φ can also be composed of ANN, so V and g can be directly combined into a deeper ANN.

[0108]

[0109] ​Step 103: Design a prompting engineering that describes the passenger flow control objectives, background knowledge, deep reinforcement learning framework, and specific output objectives, and generate a reward function that conforms to the optimization of urban rail passenger flow control through a large language model LLM.

[0110] In an optional embodiment of the present invention, a cueing engineering is designed to describe the passenger flow control objective, background knowledge, and deep reinforcement learning framework, as well as a specific output objective. A reward function conforming to urban rail passenger flow control optimization is generated through a large language model (LLM), including:

[0111] Injecting structured hints into large language models (LLMs) involves four dimensions:

[0112] By injecting role-based information, the large language model is set as a role with the ability to control passenger flow in rail transit, and a vectorized knowledge base consisting of industry standards, technical manuals and professional literature is provided so that the model can master the methods of calculating platform carrying capacity and assessing passenger flow density.

[0113] The task is injected with hierarchical description information and a spatiotemporal coupling decomposition strategy is adopted to decompose the macro-level passenger flow control target into three sub-tasks: platform-level passenger flow balance, train-level load factor control, and passenger-level waiting time optimization. The sub-tasks are then associated with evolution equations based on dynamic network flow theory.

[0114] The system injects explicit modeling information into a deep reinforcement learning mechanism, including a spatiotemporal-state network, a regional collaborative passenger flow control optimization model, a deep reinforcement learning framework, a platform waiting passenger flow state matrix, a passenger control action space, and a state transition function that considers passenger flow propagation delay.

[0115] Inject and output formal constraint information;

[0116] Based on structured prompting engineering, a reward function that conforms to the optimization of urban rail passenger flow control is generated.

[0117] Using LLM, a reward function initialization generator is constructed and the reward function is generated as follows:

[0118] Generating an executable reward function using LLM is essentially a process of transforming domain knowledge into control logic through natural language interaction. This can be viewed as a Q&A (Question & Answer) process. Since the deep reinforcement learning reward function needs to simultaneously satisfy passenger flow control objectives (such as minimizing waiting time) and environmental constraints (such as train capacity, platform capacity, and flow balance), the initial generator function for the reward function was first constructed, as shown below:

[0119]

[0120] In the formula: R0 represents the generated initial reward function; Task represents the specific content and purpose of this task; Env represents the specific parameters and mechanism of action of the reinforcement learning model; and represents the requirements for generating the reward function.

[0121] For complex and specialized tasks like this, LLM cannot generate correct information based solely on the above inputs. Simply inputting the task objective (Task), reinforcement learning environment parameters (Env), and reward function generation requirements cannot enable LLM to accurately capture the characteristics of passenger flow control strategy optimization. Therefore, in addition to considering the above conditions, this invention achieves four-dimensional information injection through structured Prompt engineering:

[0122] 1) Role Assignment Mechanism: In the role assignment mechanism, LLM is not only set as "rail transit passenger flow control expert", but also injected with vectorized knowledge bases including high-level relevant papers and literature, as well as "Urban Rail Transit Passenger Flow Organization Specification" and "Metro Operation and Dispatch Manual", so that it has professional domain knowledge such as platform carrying capacity calculation and passenger flow density assessment, and has the prior logic for solving domain problems.

[0123] 2) Task layered description: The task layered description adopts a spatiotemporal coupling decomposition strategy, which decomposes the macro passenger flow control target into three sub-tasks: platform-level passenger flow balance, train-level full load rate control, and passenger-level waiting time optimization, and associates them with evolution equations based on dynamic network flow theory.

[0124] 3) Explicit modeling of DRL mechanism: Input state space, action space and transition equation to ensure that the generation function is compatible with the reinforcement learning framework. That is, when modeling the DRL mechanism, the complete input must include the platform waiting passenger flow state matrix, passenger control action space and state transition function considering passenger flow propagation delay.

[0125] 4) Output formal constraints: Output constraints require the generation of Python code, including comments for core logic modules such as passenger flow balance and waiting time.

[0126] Through the above mechanism, the initial reward function generated by LLM can be directly used for DRL training, realizing the automated transformation from natural language objectives to executable control logic. The following is a sample project template and a specific example of a reward function-based reward function optimization tool that adapts to passenger flow control strategies generated by LLM:

[0127] Role assignment

[0128] (The LLM role and capabilities need to be clearly described here, including role description, knowledge acquired, and books read. Expand this template as needed, and please pay attention to the format.)

[0129] Character Description

[0130] (The LLM's identity needs to be stated here, and the basic situation of the task needs to be clearly stated. If necessary, relevant actions and adjectives can be added to enhance their related abilities.)

[0131] Example: You are now a skilled reward function designer for a reinforcement learning (RL) agent. You need to write a correct and appropriate reward function for a reinforcement learning agent. After training, this agent will be able to control passenger flow at a subway station using passenger flow control measures. Specific details will be provided in the task description below.

[0132] Domain knowledge

[0133] (This section supplements the LLM professional knowledge, clarifying which courses were taken, which books were read, and the task processing logic.)

[0134] Example: You are also a rail transit passenger flow control expert, cultivating high-quality skilled professionals who possess urban rail transit expertise and can engage in urban rail transit operation management, production, operation, and service work. The curriculum includes courses such as Principles of Management, Introduction to Transportation, Economic Law and Traffic Regulations, Introduction to Transportation Economics, Railway Transportation Equipment, Railway Traffic Organization and Management, Railway Freight Organization, Railway Passenger Organization, and Introduction to Urban Rail Transit.

[0135] Literature Foundation

[0136] (Provide the LLM with directly relevant paper references. The LLM will grasp the relevant knowledge in the papers, but please note the size limit of the input block.)

[0137] Example: You have read the ample literature on urban rail transit passenger flow control provided to you.

[0138] Task Description

[0139] (This task needs to be clearly described here, including the basic background, the definition of the evolution of passenger flow in time and space, etc. This template can be expanded as needed, please pay attention to the format.)

[0140] Background Description

[0141] (The background of this task needs to be clearly described here, including the purpose, time, location and other basic information, as well as any additional precautions.)

[0142] Example: In a subway system, due to the carrying capacity of rail transit, the platform capacity, and the randomness of passenger flow, large passenger flows can easily accumulate at certain stations, causing the stations to be unable to handle the load. Even if the station increases its capacity and the number of trains operating, it will still affect the normal operation and service of trains. Therefore, it is necessary to control the number of passengers entering and exiting each platform, and to rationally design train operation and passenger flow control with the goal of minimizing the total waiting time for passengers.

[0143] Basic Definition of Spatiotemporal Passenger Flow Evolution

[0144] (For this task, it is necessary to clearly explain the basic definition of the spatiotemporal passenger flow evolution, including the actual modeling of the subway network, the passenger flow distribution in the network, and the definition of passenger flow evolution in the model.)

[0145] Example:

[0146] 1) The actual subway network is abstracted as a topological network G = (V, E), where nodes V = {i | i ∈ V} represent the set of facilities and equipment within a station, and edges E = {(i, j) | i, j ∈ V} represent the set of arcs connecting nodes, such as transfer passages between operating lines and adjacent stations. The train interval between adjacent stations is abstracted as two unidirectional arcs, starting and ending at the up and down platform nodes respectively.

[0147] 2) Considering the dynamic distribution of passenger flow in the road network, a time dimension is introduced into the physical topology network to form a space-time point set V_{st}={(i,t)} and a space-time arc set E_{st}={(i,j,t,t')} to represent the dynamic distribution of passenger flow.

[0148] 3) Based on the analysis of pedestrian flow characteristics, a discrete passenger flow state m is defined, and the space-time arc (i,j,t,t') is extended into a space-time state arc (i,j,t,t',m,m').

[0149] Intelligent agent description

[0150] (The agent to be trained needs to be clearly described here, including its reinforcement learning process, agent definition, etc. This template can be expanded as needed, please pay attention to the format.)

[0151] Reinforcement learning process

[0152] (The reinforcement learning process needs to be clearly described here, including the definition of the internal space, the description of the relevant functions, the interaction between the environment and the agent, and the agent's state, etc.)

[0153] Example:

[0154] Action space: Action represents passenger flow control strategy, specifically the proportion of passenger flow allowed to enter the station to the total passenger flow demand. In the transfer passage, it represents the proportion of transfers allowed to enter the platform to the total transfer passenger flow demand. This is referred to as the control rate in this article.

[0155] State space: Passenger flow states in the road network include passenger demand at stations, passenger flow at transfer channels, passenger flow at cross-sections, and the number of people waiting on platforms. It is worth noting that the state in the passenger flow control reinforcement learning problem refers to the passenger flow of a road segment, while the state dimension of a spatiotemporal-state network is a discrete passenger flow state defined according to the congestion level of the spatiotemporal arc; the two have different meanings.

[0156] Environment Simulation: A dynamic environment simulator is constructed using a spatiotemporal-state network G_{st}. Through a Markov state transition model, the spatiotemporal distribution changes of passenger flow under the influence of the current passenger flow control strategy are simulated based on the current passenger flow control strategy. The passenger flow status of each node and arc in the network is dynamically updated, providing an environmental basis for strategy optimization.

[0157] Reward Function: Passenger flow coordination control strategies aim to alleviate station congestion, prevent passengers from prolonged stays, reduce operational safety risks, and improve operational efficiency. Therefore, the effectiveness of the passenger flow coordination control strategy can be evaluated based on expected waiting times within the station, waiting times outside the station, and passenger waiting times in transfer corridors. The reward function is used to calibrate whether the passenger flow state in the reinforcement learning problem has achieved the set objective. At time t, a reward is obtained.

[0158] Policy function: Policy π Φ It is the most important element in reinforcement learning, representing the state. When choosing action a t Merging using a universal value function accessor based on ANN. And g, then input π Φ In deep reinforcement learning networks, π Φ It can also be constructed from ANNs, therefore, it can be... It is directly merged with g into a deeper ANN.

[0159] Intelligent agent definition

[0160] (The intelligent agent needs to be clearly described here, including its work and related definitions.)

[0161] Example: Using the generated reward function, train and test a deep reinforcement learning (DRL) agent. The agent will interact with passenger flow distribution in a spatiotemporal state network simulated by a city rail network through random exploration actions (passenger control scheme), and record the training and testing results. Based on the test results, the final reward value obtained from the reward function is used to determine the outcome.

[0162] Output requirements

[0163] (The final output requirements need to be clearly described here, including the output content and format. This template can be expanded as needed, but please pay attention to the format.)

[0164] Reward function output requirements

[0165] (The reward function needs to be defined here, and its output should be specified.)

[0166] Example:

[0167] Agent actions are represented as "action" in the code.

[0168] The state of the agent at the start of an action is represented in the code as "current state".

[0169] The state of the agent after an action is completed is represented as "next state" in the code.

[0170] You should write a reward function to implement the task description.

[0171] Structured output

[0172] (The output content of the LLM needs to be set here last; additional requirements can be added.)

[0173] Example: The reward function needs to be written in Python 3.8.16.

[0174] Output only the code block. Do not output anything outside the code block.

[0175] You should include sufficient comments in your reward functionality to explain your ideas, goals, and implementation details. The implementation can be specified down to a particular line of code.

[0176] Ensure that the reward value is neither too large nor too small, as this would render the reward meaningless.

[0177] If you need to import function libraries and packages (such as math, numpy) or define helper functions, define them at the beginning of the function and the program. Do not use or generate unimported packages or undefined functions. Ensure that there are no variables in the reward function that require tuning. Finally, the reward function should be ready to use directly.

[0178] Output format

[0179] (The output format needs to be set here last; additional requirements can be added.)

[0180] Example: Strictly follow the format below. Do not output anything outside the code block.

[0181] def reward(current state, action, next state, and other information parameters):

[0182] (Define the reward function and basic calculation logic)

[0183] Calculation:

[0184] (Reward Initialization)

[0185] reward=0

[0186] (Import packages and define helper functions)

[0187] (Import the required function libraries and packages)

[0188] Import numpy as np

[0189] (Finish)

[0190] (Modification of the reward function by actions and states)

[0191] Cation to reward

[0192] return reward

[0193] Now you need to write a reward function. I will use this reward function to train the RL agent and test it in an environment. I will provide possible reasons for failures found during testing, and you should modify the reward function based on this information. Do not output anything outside the code block. Please carefully check the output code. Ensure there are no errors, and that any variables or functions used have been defined previously.

[0194] Step 104: Use the generated reward function to train and test the deep reinforcement learning agent, record the training and testing results, and perform reward function correction and analysis.

[0195] In an optional embodiment of the present invention, the generated reward function is used to train and test a deep reinforcement learning agent, and the training and testing results are recorded. The reward function is then corrected and analyzed, including:

[0196] Using the currently generated reward function, a deep reinforcement learning agent is trained in a spatiotemporal state network simulation of an urban rail transit network environment. The agent interacts with the passenger flow distribution state in the environment by performing random exploration passenger flow control actions.

[0197] Record the training and testing results of the agent, and determine the performance of the agent based on the final reward value obtained from the testing results;

[0198] If this is not the first iteration, and the test performance of the agent trained using the current reward function is not better than or equal to the performance of the previous iteration, then jump to the reward function corrector to correct the reward function;

[0199] If the current iteration is the first iteration, or the test performance of the agent trained by the current reward function is better than that of the previous iteration, and the preset convergence state has not been reached, then the process jumps to the agent performance analyzer for analysis; the convergence state is defined as the agent's performance reward value remaining stable in a preset number of consecutive iterations of training.

[0200] In one optional embodiment of the present invention

[0201] Jump to the reward function corrector to correct the reward function, including:

[0202] Analyze the code structure and calculation logic of the current reward function to locate the logical segments that cause the agent's policy performance to degrade.

[0203] The system connects to a pre-built expert knowledge analysis base for comparative analysis. The pre-built expert knowledge analysis base records the types of reward function defects that occurred in historical training, the corresponding abnormal performance of deep reinforcement learning training, and the corrected effect verification data.

[0204] Based on the comparative analysis results, correction suggestions are generated, and targeted adjustments are made while maintaining the overall framework of the original reward function to obtain the corrected reward function;

[0205] The modified reward function is iteratively verified, including its syntactic correctness, numerical stability, and physical feasibility.

[0206] The corrected reward function, which satisfies all verification conditions and the total passenger waiting time reaches a set threshold, is submitted to the next iteration of the training process.

[0207] The structured prompting engineering used by the agent performance analyzer is consistent with the prompting engineering format of the reward function generator. The analysis then jumps to the agent performance analyzer, including:

[0208] Based on the recorded training and testing data, the training performance, testing performance, and decision-making behavior characteristics of the deep reinforcement learning agent are analyzed by the agent performance analyzer, and improvement suggestions for the current reward function are generated.

[0209] The improvement suggestions are fed back into the reward function generation or correction process to optimize the reward function in subsequent iterations when convergence has not been achieved.

[0210] The process of training and testing a deep reinforcement learning agent based on a reward function, and of refining the reward function, is as follows:

[0211] The generated reward function is used to train and test a deep reinforcement learning (DRL) agent. The agent interacts with passenger flow distribution in a spatiotemporal state network environment simulated by the urban rail transit network through random exploration actions (passenger flow control scheme), and the training and testing results are recorded. Based on the test results, the final reward value obtained from the reward function is used to determine the outcome.

[0212] (1) If it is not the first iteration and the agent trained with the current modified reward function does not achieve better or similar test performance compared to the previous iteration, it indicates a knowledge illusion and jumps to the reward function modifier.

[0213] (2) If the training effect of the first iteration or the current modified reward function is better than the previous iteration, and the convergence state has not been reached (the effect of the reward function remains unchanged within a certain period, such as setting the output effect unchanged for 20 iterations as the convergence state), then jump to the agent performance analyzer.

[0214] The reward function modifier is as follows:

[0215] To address the unavoidable "knowledge illusion" errors inherent in LLM models, an LLM is deployed as a reward function corrector. An error is considered to have occurred if the agent's performance in a test is worse than in the previous test. Considering practical needs, the total passenger waiting time T is used as the criterion. When the reward function corrector needs to be activated, the model refines the previous reward function using insights gained from the current function's failure and re-evaluates the new reward function according to the criteria until a reward function meets the criteria; only then is that function included in the workflow of the next iteration. The model's functional role is as follows:

[0216]

[0217] Among them, R L-1 R represents the reward function generated in the last iteration. M-1 This is the reward function revised in the last iteration, Sugg L-1 Includes modifications to R M-1 Recommendation, Rslt M-1 That is the total waiting time from the last time.

[0218] The reward function corrector's prompt project includes role settings, task description, basic definition information, DRL agent description, internal operating mechanism and parameters, reward function, and other information, as well as output requirements and formats. Before the LLM-based reward function corrector operates, the system first establishes a metric-based judgment mechanism. When it detects that the value of the important DRL agent's metric "total waiting time T for all passengers in the network" has deteriorated compared to the previous period and exceeds a preset threshold, the reward function correction process will be automatically triggered. The core working mechanism of this corrector includes three key stages:

[0219] First, an error source analysis is performed. By parsing the generated reward function code and calculation logic, the logical segments in the reward function that may lead to policy degradation are located. Then, a pre-built expert knowledge analysis base containing "problem-cause-impact" is set up and connected. The cases recorded in this knowledge base include in detail the types of reward function defects that occurred in historical training (such as missing constraint handling), the corresponding abnormal DRL training performance (such as value function oscillation, sudden drop in policy entropy, etc.), and the effect verification data after correction. This makes it easy for the reward function corrector to accurately find the problem and propose the correct modification suggestions.

[0220] Finally, a structured correction output is executed. While maintaining the original function framework, targeted adjustments are made to address identified issues. The entire correction process employs an iterative verification mechanism. Each corrected function undergoes rapid verification in a simplified environment. Only correction schemes that simultaneously meet the three basic requirements of syntactic correctness, numerical stability, and physical feasibility, and that improve the T-index in the verification environment to a set threshold, are submitted to the complete training process. This addresses the "knowledge illusion" problem in LLM and endows the reward function with continuous evolution capabilities, meeting the dynamic optimization needs of complex operational scenarios. The reward function corrector hint project is obtained by perfecting the hint project template of the reward function generator.

[0221] The specific implementation process of the LLM-based reward function modifier is as follows:

[0222] Role assignment

[0223] Character Description

[0224] You are now a skilled reward function modifier for a reinforcement learning (RL) agent. You need to modify the reward function of an RL agent based on feedback. After training, this agent will be able to control passenger flow at a subway station using crowd control measures. Specific details will be provided in the task description below.

[0225] Domain knowledge

[0226] You will also become an expert in rail transit passenger flow control, cultivating high-quality, skilled professionals who possess specialized skills in urban rail transit and can engage in urban rail transit operation management, production, operation, and service work. The curriculum includes courses such as Principles of Management, Introduction to Transportation, Economic Law and Traffic Regulations, Introduction to Transportation Economics, Railway Transportation Equipment, Railway Traffic Organization and Management, Railway Freight Organization, Railway Passenger Organization, and Introduction to Urban Rail Transit.

[0227] Literature Foundation

[0228] You have read the ample literature on urban rail transit passenger flow control provided to you.

[0229] Task Description

[0230] Background Description

[0231] In subway systems, due to the carrying capacity of rail transit, the platform capacity, and the randomness of passenger flow, large passenger flows can easily accumulate at certain stations, causing the stations to be unable to cope. Even if the station increases its capacity and the number of trains operating, it will still affect the normal operation and service of trains. Therefore, it is necessary to control the number of passengers entering and exiting each platform, and to rationally design train operation and passenger flow control with the goal of minimizing the total waiting time for passengers.

[0232] Basic Definition of Spatiotemporal Passenger Flow Evolution

[0233] 1) The actual subway network is abstracted as a topological network G = (V, E), where nodes V = {i | i ∈ V} represent the set of facilities and equipment within a station, and edges E = {(i, j) | i, j ∈ V} represent the set of arcs connecting nodes, such as transfer passages between operating lines and adjacent stations. The train interval between adjacent stations is abstracted as two unidirectional arcs, starting and ending at the up and down platform nodes respectively.

[0234] 2) Considering the dynamic distribution of passenger flow in the road network, a time dimension is introduced into the physical topology network to form a space-time point set V_{st}={(i,t)} and a space-time arc set E_{st}={(i,j,t,t')} to represent the dynamic distribution of passenger flow.

[0235] 3) Based on the analysis of pedestrian flow characteristics, a discrete passenger flow state m is defined, and the space-time arc (i,j,t,t') is extended into a space-time state arc (i,j,t,t',m,m').

[0236] Intelligent agent description

[0237] Reinforcement learning process

[0238] (1) Action space: Action represents the passenger flow control strategy, specifically the proportion of passenger flow allowed to enter the station to the total passenger flow demand. In the transfer passage, it represents the proportion of transfer volume allowed to enter the platform to the total transfer passenger flow demand. This is referred to as the control rate in this article.

[0239] (2) State Space: The passenger flow state in the road network includes the passenger demand at the station, the passenger flow in the transfer passage, the passenger flow in the cross section, and the number of people waiting on the platform. It is worth noting that the state in the passenger flow control reinforcement learning problem refers to the passenger flow of the road segment, while the state dimension of the spatiotemporal-state network is a discrete passenger flow state defined according to the congestion degree of the spatiotemporal arc. The two have different meanings.

[0240] (3) Environment simulation: A dynamic environment simulator is constructed using the spatiotemporal-state network G_{st}. Through the Markov state transition model, the spatiotemporal distribution of passenger flow is simulated under the influence of the current passenger flow control strategy. The passenger flow status of each node and arc in the network is dynamically updated to provide an environmental basis for strategy optimization.

[0241] (4) Reward Function: The passenger flow coordination control strategy aims to alleviate station congestion, prevent passengers from staying for extended periods, reduce operational safety risks, and improve operational efficiency. Therefore, the effectiveness of the passenger flow coordination control strategy can be evaluated based on the expected waiting time within the station, the waiting time outside the station, and the waiting time for passengers in transfer channels. The reward function is used to calibrate whether the passenger flow state in the reinforcement learning problem has achieved the set objective. At time t, a reward is obtained.

[0242] (5) Policy function: Policy π Φ It is the most important element in reinforcement learning, representing the state. When choosing action a t Merging using a universal value function accessor based on ANN. And g, then input π Φ In deep reinforcement learning networks, π Φ It can also be constructed from ANNs, therefore, it can be... It is directly merged with g into a deeper ANN.

[0243] Intelligent agent definition

[0244] The generated reward function is used to train and test a deep reinforcement learning (DRL) agent. The agent interacts with passenger flow distribution in a spatiotemporal state network environment simulated by the urban rail transit network through random exploration actions (passenger flow control scheme), and the training and testing results are recorded. Based on the test results, the final reward value obtained from the reward function is used to determine the outcome.

[0245] Reward Function Adjustment Strategy

[0246] Please consider the analysis and suggestions above. Modify and improve the current reward function.

[0247] 1. It can both modify the current row and add a new row. The reward function can be defined using any variable in the t parameter of the reward function.

[0248] 2. If necessary, you can write a reward function that is completely different from the current one.

[0249] 3. Consider modifying the reward and penalty values ​​in the current reward function to achieve balance.

[0250] 4. In the first part of the reward function, you should provide your ideas for modifying the reward function. Keep your ideas concise.

[0251] 5. Ensure that the reward value is neither too large nor too small, otherwise the reward will be meaningless.

[0252] 6. Ensure that there are no variables in the rewards feature that need to be adjusted.

[0253] reward function

[0254]

[0255]

[0256] Output requirements

[0257] Structured output

[0258] The reward function needs to be written in Python 3.8.16.

[0259] Output only the code block. Do not output anything outside the code block.

[0260] You should include sufficient comments in your reward functionality to explain your ideas, goals, and implementation details. The implementation can be specified down to a particular line of code.

[0261] Ensure that the reward value is neither too large nor too small, as this would render the reward meaningless.

[0262] If you need to import function libraries and packages (such as math, numpy) or define helper functions, define them at the beginning of the function and the program. Do not use or generate unimported packages or undefined functions. Ensure that there are no variables in the reward function that require tuning. Finally, the reward function should be ready to use directly.

[0263] Output format

[0264] Now modify the reward function according to the format described above. Then, in each iteration, I will use the reward function to train the RL agent and test it in the environment. I will provide possible reasons for failures encountered during testing, and you should modify the reward function accordingly. Do not output anything outside the code block. Please carefully check the output code. Ensure there are no errors and that the variables or functions used are defined.

[0265] The agent performance analyzer is as follows:

[0266] The agent performance analyzer meticulously records the reward function, key training parameters, the agent's complete decision-making trajectory, and the final training results for each iteration during deep reinforcement learning training. By designing a Prompt project, it guides the large language model to deeply analyze the agent's performance from multiple dimensions and perspectives. The analyzer not only focuses on the final performance metrics but also delves into the agent's decision-making characteristics, potential performance bottlenecks, and optimization potential under different customer flow scenarios. While training has not yet reached convergence, the analyzer continuously generates professional optimization suggestions. t .

[0267] The agent's decision trajectory consists of the agent's observations and actions taken at each step, capturing a series of decisions made by the agent based on its perception of the environment. It is worth noting that the number of action steps L in the agent's decision trajectory is less than or equal to 50. When it exceeds this number, it is truncated to L = 50 steps by default.

[0268] The Prompt project for the agent performance analyzer consists of LLM role settings, task description, basic definition information, DRL agent description and internal action mechanism and parameters, reward function generation requirements, output requirements and format, and also includes the current reward function and improvement suggestions. The final relevant functions are shown below:

[0269]

[0270] Among them: Sugg t This is the final output, representing suggestions for improving the analyzer. It is the test trajectory of the agent, Rslt L It is a test result indicator.

[0271]

[0272] In the above function, TrainAgent and TestAgent represent the training and testing functions of the agent, respectively. init It is the neural network initialization structure of the intelligent agent, A L For the agent trained in the Lth iteration, R LThis represents the reward function generated this time.

[0273] The specific implementation process of the LLM-based reward function analyzer is as follows:

[0274] Role assignment

[0275] Character Description

[0276] You are now a skilled reward function analyst for a reinforcement learning (RL) agent. You need to generate specific optimization details and content based on the agent's operating status and reward function scores, and modify and optimize the reward function to obtain higher scores.

[0277] Domain knowledge

[0278] You will also become an expert in rail transit passenger flow control, cultivating high-quality, skilled professionals who possess specialized skills in urban rail transit and can engage in urban rail transit operation management, production, operation, and service work. The curriculum includes courses such as Principles of Management, Introduction to Transportation, Economic Law and Traffic Regulations, Introduction to Transportation Economics, Railway Transportation Equipment, Railway Traffic Organization and Management, Railway Freight Organization, Railway Passenger Organization, and Introduction to Urban Rail Transit.

[0279] Literature Foundation

[0280] You have read the ample literature on urban rail transit passenger flow control provided to you.

[0281] Task Description

[0282] Background Description

[0283] In subway systems, due to the carrying capacity of rail transit, the platform capacity, and the randomness of passenger flow, large passenger flows can easily accumulate at certain stations, causing the stations to be unable to cope. Even if the station increases its capacity and the number of trains operating, it will still affect the normal operation and service of trains. Therefore, it is necessary to control the number of passengers entering and exiting each platform, and to rationally design train operation and passenger flow control with the goal of minimizing the total waiting time for passengers.

[0284] Basic Definition of Spatiotemporal Passenger Flow Evolution

[0285] 1) The actual subway network is abstracted as a topological network G = (V, E), where nodes V = {i | i ∈ V} represent the set of facilities and equipment within a station, and edges E = {(i, j) | i, j ∈ V} represent the set of arcs connecting nodes, such as transfer passages between operating lines and adjacent stations. The train interval between adjacent stations is abstracted as two unidirectional arcs, starting and ending at the up and down platform nodes respectively.

[0286] 2) Considering the dynamic distribution of passenger flow in the road network, a time dimension is introduced into the physical topology network to form a space-time point set V_{st}={(i,t)} and a space-time arc set E_{st}={(i,j,t,t')} to represent the dynamic distribution of passenger flow.

[0287] 3) Based on the analysis of pedestrian flow characteristics, a discrete passenger flow state m is defined, and the space-time arc (i,j,t,t') is extended into a space-time state arc (i,j,t,t',m,m').

[0288] Intelligent agent description

[0289] Reinforcement learning process

[0290] (1) Action space: Action represents the passenger flow control strategy, specifically the proportion of passenger flow allowed to enter the station to the total passenger flow demand. In the transfer passage, it represents the proportion of transfer volume allowed to enter the platform to the total transfer passenger flow demand. This is referred to as the control rate in this article.

[0291] (2) State Space: The passenger flow state in the road network includes the passenger demand at the station, the passenger flow in the transfer passage, the passenger flow in the cross section, and the number of people waiting on the platform. It is worth noting that the state in the passenger flow control reinforcement learning problem refers to the passenger flow of the road segment, while the state dimension of the spatiotemporal-state network is a discrete passenger flow state defined according to the congestion degree of the spatiotemporal arc. The two have different meanings.

[0292] (3) Environment simulation: A dynamic environment simulator is constructed using the spatiotemporal-state network G_{st}. Through the Markov state transition model, the spatiotemporal distribution of passenger flow is simulated under the influence of the current passenger flow control strategy. The passenger flow status of each node and arc in the network is dynamically updated to provide an environmental basis for strategy optimization.

[0293] (4) Reward Function: The passenger flow coordination control strategy aims to alleviate station congestion, prevent passengers from staying for extended periods, reduce operational safety risks, and improve operational efficiency. Therefore, the effectiveness of the passenger flow coordination control strategy can be evaluated based on the expected waiting time within the station, the waiting time outside the station, and the waiting time for passengers in transfer channels. The reward function is used to calibrate whether the passenger flow state in the reinforcement learning problem has achieved the set objective. At time t, a reward is obtained.

[0294] (5) Policy function: Policy π Φ It is the most important element in reinforcement learning, representing the state. When choosing action a t Merging using a universal value function accessor based on ANN. And g, then input π Φ In deep reinforcement learning networks, π ΦIt can also be constructed from ANNs, therefore, it can be... It is directly merged with g into a deeper ANN.

[0295] Intelligent agent definition

[0296] The generated reward function is used to train and test a deep reinforcement learning (DRL) agent. The agent interacts with passenger flow distribution in a spatiotemporal state network environment simulated by the urban rail transit network through random exploration actions (passenger flow control scheme), and the training and testing results are recorded. Based on the test results, the final reward value obtained from the reward function is used to determine the outcome.

[0297] Intelligent agent operation status

[0298] Includes training reward curves (including mean and standard deviation), state-action trajectory during the testing phase (first 50 steps), key performance indicators (congestion, waiting time, flow control intensity), and failure cases (such as uncontrolled congestion at transfer stations).

[0299] Reward function optimization requirements

[0300] When optimizing the reward function, it is necessary to consider the mathematical structure of the reward function, the weight distribution of each component, the multi-objective balancing strategy, the mapping relationship between state, action, and reward, as well as training stability and convergence speed.

[0301] reward function

[0302]

[0303]

[0304] Output requirements

[0305] Structured output

[0306] Please write an appropriate analysis of training performance (i.e., convergence) and testing performance. Try to provide some suggestions for improving the reward system; you should not limit yourself to the task description above, but also identify other inefficient scenarios based on the training and testing results. The analysis and suggestions should be concise. Now, based on the agent's performance, write your analysis and suggestions for improving the reward function.

[0307] Step 105: Based on the reward function analysis results, adjust the current reward function using the Large Language Model (LLM). After training, output the regional passenger flow control plan.

[0308] In an optional embodiment of the present invention, based on the reward function analysis results, the current reward function is adjusted using a Large Language Model (LLM), and after training, a regional passenger flow control scheme is output, including:

[0309] Based on the improvement suggestions output by the agent performance analyzer, the current reward function is adjusted using a large language model (LLM).

[0310] The adjusted reward function is then input back into the training and testing process to form a closed-loop optimization until the output of the reward function reaches a stable convergence state.

[0311] Extract regional passenger flow control schemes from the trained deep reinforcement learning agent, including the timing and intensity of passenger flow control for all stations within the region.

[0312] The reward function adjuster and agent retraining are as follows:

[0313] The reward function adjuster is a crucial link connecting performance analysis and continuous optimization. Based on the detailed feedback provided by the agent performance analyzer, the large language model will adjust the current reward function. The essence of the reward function adjuster's Prompt hint project is the same as that of the reward function generator's Prompt hint project, consisting of role settings, task description, basic definition information, DRL agent description, internal action mechanism and parameters, reward function, and other information, as well as output requirements and formats. The function is shown below:

[0314]

[0315] Based on feedback from the analyzer, LLM adjusts the current reward function to better match the actual demand for urban rail passenger flow. Subsequently, training and testing are repeated, forming a closed-loop optimization until the reward function output reaches convergence. Through this closed-loop optimization mechanism, the system repeatedly trains and tests until the reward function output reaches a stable convergence state. Ultimately, a set of precise passenger flow control strategies suitable for specific urban rail transit systems is extracted from the trained deep reinforcement learning agent. These strategies can be applied in actual urban rail transit systems, including passenger flow control time and intensity for all stations in a region, enabling precise regulation of passenger flow allocation time and intensity for all stations within the region.

[0316] The technical advantages of this invention are as follows:

[0317] Compared to traditional manual parameter tuning methods, this corrector, by integrating Large Language Model (LLM) and deep reinforcement learning, breaks through the bottleneck of traditional manual RL parameter tuning, demonstrating two important innovations: 1. It transforms expert experience into computable cue word rules, achieving efficient utilization of knowledge; 2. It constructs a cross-scenario knowledge transfer mechanism. Once the correction rules are validated and proven effective, LLM can automatically adapt to other reward functions through analogical learning, thereby significantly improving correction efficiency. This "data-driven + knowledge-guided" model not only effectively solves the "knowledge illusion" problem of LLM but also endows the reward function with the ability to continuously evolve, meeting the dynamic optimization needs of complex urban rail transit operation scenarios. This mechanism enables the LLM-driven passenger flow control optimization reward design to form a self-circulating structure, capable of identifying and correcting model knowledge illusions and erroneous outputs online, thus providing metro managers with more intelligent and efficient decision support.

[0318] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0319] The urban rail transit area passenger flow collaborative control and intelligent optimization device provided in this embodiment of the invention may specifically include the following modules:

[0320] The regional collaborative passenger flow control optimization model construction module is used to construct a spatiotemporal-state network to describe passenger flow evolution and establish a regional collaborative passenger flow control optimization model based on the topology of the urban rail network, historical passenger flow, and train timetable data.

[0321] The deep reinforcement learning framework construction module is used to reconstruct the regional collaborative passenger flow control optimization process into a deep reinforcement learning framework based on Markov decision process, including environment, action, reward, state, and policy.

[0322] The reward function generation module is used to design a prompting engineering that describes the passenger flow control objectives, background knowledge, deep reinforcement learning framework, and specific output objectives. It generates a reward function that conforms to the optimization of urban rail passenger flow control through a large language model LLM.

[0323] The correction and analysis module is used to train and test deep reinforcement learning agents using the generated reward function, record the training and testing results, and perform reward function correction and analysis.

[0324] The regional passenger flow control scheme generation module is used to adjust the current reward function based on the reward function analysis results using a large language model (LLM), and output the regional passenger flow control scheme after training is completed.

[0325] Optionally, the regional collaborative passenger flow control optimization model building module is also used for:

[0326] Constructing a spatiotemporal-state network to describe passenger flow evolution:

[0327] The topology of the urban rail network is abstracted into a topological network, where nodes represent the set of facilities and equipment within a station, and edges represent the set of arcs connecting nodes, including the operating lines and transfer channels between adjacent stations. The train interval between adjacent stations is abstracted into two unidirectional arcs, corresponding to the up and down platform nodes respectively.

[0328] By introducing a time dimension into the topological network, it is expanded into a space-time network, forming a space-time point set and a space-time arc set, which are used to represent the dynamic distribution of passenger flow.

[0329] Based on the characteristics of pedestrian flow, discrete passenger flow states are defined, and the space-time arc is further extended into a space-time state arc. The attributes of each space-time state arc include flow rate, density and speed attributes. The time interval of the space-time state arc is calculated based on the travel time of the entry arc or transfer arc in the corresponding state. The travel time is obtained from the train timetable.

[0330] Establish a regional collaborative passenger flow control optimization model:

[0331] A flow control model for urban rail transit network is established with the goal of minimizing the total waiting time of all passengers. The total waiting time of passengers includes the waiting time required for passengers to wait for the arriving train at each platform. The constraints include passenger flow balance constraints, train and passage capacity constraints, observation equation between network passenger flow density and spatiotemporal arc state, spatiotemporal arc state uniqueness constraints, 0-1 variable constraints, and passenger flow control ratio constraints.

[0332] Optionally, the deep reinforcement learning framework building block is also used for:

[0333] The action space represents the passenger flow control strategy, indicating the proportion of passenger flow allowed to enter the station relative to the total passenger flow demand. In the transfer passage, it represents the proportion of transfers allowed to enter the platform relative to the total transfer passenger flow demand.

[0334] The passenger flow status in the road network in the state space includes the passenger flow demand at the station, the passenger flow in the transfer channel, the passenger flow in the cross section, and the number of people waiting on the platform;

[0335] A dynamic environment simulator is constructed using a spatiotemporal-state network. Through a Markov state transition model, the spatiotemporal distribution of passenger flow is simulated under the influence of the current passenger flow control strategy. The passenger flow status of each node and arc in the network is dynamically updated to provide an environmental basis for strategy optimization.

[0336] The reward function is used to determine whether the passenger flow status in the passenger flow control optimization problem has reached the set target. It is constructed based on the cumulative waiting time of passengers outside the station, the cumulative waiting time of passengers on the platform, and the cumulative waiting time of passengers in the transfer channel.

[0337] The strategy function is used to represent the way to select passenger flow control actions under a given passenger flow state. The strategy function combines state information and target information through an artificial neural network and outputs the corresponding action decision.

[0338] Optionally, the reward function generation module is also used for:

[0339] Injecting structured hints into large language models (LLMs) involves four dimensions:

[0340] By injecting role-based information, the large language model is set as a role with the ability to control passenger flow in rail transit, and a vectorized knowledge base consisting of industry standards, technical manuals and professional literature is provided so that the model can master the methods of calculating platform carrying capacity and assessing passenger flow density.

[0341] The task is injected with hierarchical description information and a spatiotemporal coupling decomposition strategy is adopted to decompose the macro-level passenger flow control target into three sub-tasks: platform-level passenger flow balance, train-level load factor control, and passenger-level waiting time optimization. The sub-tasks are then associated with evolution equations based on dynamic network flow theory.

[0342] The system injects explicit modeling information into a deep reinforcement learning mechanism, including a spatiotemporal-state network, a regional collaborative passenger flow control optimization model, a deep reinforcement learning framework, a platform waiting passenger flow state matrix, a passenger control action space, and a state transition function that considers passenger flow propagation delay.

[0343] Inject and output formal constraint information;

[0344] Based on structured prompting engineering, a reward function that conforms to the optimization of urban rail passenger flow control is generated.

[0345] Optionally, the correction analysis module is also used for:

[0346] Using the currently generated reward function, a deep reinforcement learning agent is trained in a spatiotemporal state network simulation of an urban rail transit network environment. The agent interacts with the passenger flow distribution state in the environment by performing random exploration passenger flow control actions.

[0347] Record the training and testing results of the agent, and determine the performance of the agent based on the final reward value obtained from the testing results;

[0348] If this is not the first iteration, and the test performance of the agent trained using the current reward function is not better than or equal to the performance of the previous iteration, then jump to the reward function corrector to correct the reward function;

[0349] If the current iteration is the first iteration, or the test performance of the agent trained by the current reward function is better than that of the previous iteration, and the preset convergence state has not been reached, then the process jumps to the agent performance analyzer for analysis; the convergence state is defined as the agent's performance reward value remaining stable in a preset number of consecutive iterations of training.

[0350] Optionally,

[0351] The correction analysis module is also used for:

[0352] Analyze the code structure and calculation logic of the current reward function to locate the logical segments that cause the agent's policy performance to degrade.

[0353] The system connects to a pre-built expert knowledge analysis base for comparative analysis. The pre-built expert knowledge analysis base records the types of reward function defects that occurred in historical training, the corresponding abnormal performance of deep reinforcement learning training, and the corrected effect verification data.

[0354] Based on the comparative analysis results, correction suggestions are generated, and targeted adjustments are made while maintaining the overall framework of the original reward function to obtain the corrected reward function;

[0355] The modified reward function is iteratively verified, including its syntactic correctness, numerical stability, and physical feasibility.

[0356] The corrected reward function, which satisfies all verification conditions and the total passenger waiting time reaches a set threshold, is submitted to the next iteration of the training process.

[0357] The structured suggestion engineering used by the agent performance analyzer is consistent with the suggestion engineering format of the reward function generator. The correction analysis module is also used for:

[0358] Based on the recorded training and testing data, the training performance, testing performance, and decision-making behavior characteristics of the deep reinforcement learning agent are analyzed by the agent performance analyzer, and improvement suggestions for the current reward function are generated.

[0359] The improvement suggestions are fed back into the reward function generation or correction process to optimize the reward function in subsequent iterations when convergence has not been achieved.

[0360] Optionally, the regional passenger flow control scheme generation module is also used for:

[0361] Based on the improvement suggestions output by the agent performance analyzer, the current reward function is adjusted using a large language model (LLM).

[0362] The adjusted reward function is then input back into the training and testing process to form a closed-loop optimization until the output of the reward function reaches a stable convergence state.

[0363] Extract regional passenger flow control schemes from the trained deep reinforcement learning agent, including the timing and intensity of passenger flow control for all stations within the region.

[0364] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0365] In addition, embodiments of the present invention also provide an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus.

[0366] Memory, used to store computer programs;

[0367] When the processor executes the program stored in the memory, it implements the urban rail transit area passenger flow collaborative control and intelligent optimization method as described in the above embodiments.

[0368] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0369] The communication interface is used for communication between the aforementioned terminal and other devices.

[0370] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0371] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be 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, or discrete hardware components.

[0372] In another embodiment of the present invention, a computer-readable storage medium is also provided, which stores instructions that, when executed on a computer, cause the computer to perform the urban rail transit area passenger flow collaborative control and intelligent optimization method described in the above embodiments.

[0373] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute the urban rail transit area passenger flow collaborative control and intelligent optimization method described in the above embodiments.

[0374] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0375] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0376] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0377] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.

Claims

1. A method for coordinated control and intelligent optimization of passenger flow in urban rail transit areas, characterized in that, The method includes: Based on the topology of the urban rail network, passenger flow data, and train operation diagram data, a spatiotemporal-state network is constructed to describe the evolution of passenger flow, and a regional collaborative passenger flow control optimization model is established. The regional collaborative passenger flow control optimization process is reconstructed into a deep reinforcement learning framework based on Markov decision process, including environment, action, reward, state, and policy. Design a prompting engineering that describes the passenger flow control objectives, background knowledge, deep reinforcement learning framework, and specific output objectives, and generate a reward function that conforms to the optimization of urban rail passenger flow control through a large language model LLM. The generated reward function is used to train and test the deep reinforcement learning agent, and the training and testing results are recorded for reward function correction and analysis. Based on the reward function analysis results, the current reward function is adjusted using a large language model (LLM), and a regional passenger flow control scheme is output after training is completed.

2. The method according to claim 1, characterized in that, Based on the urban rail network topology, historical passenger flow, and train timetable data, a spatiotemporal-state network is constructed to describe passenger flow evolution, and a regional collaborative passenger flow control optimization model is established, including: Constructing a spatiotemporal-state network to describe passenger flow evolution: The topology of the urban rail network is abstracted into a topological network, where nodes represent the set of facilities and equipment within a station, and edges represent the set of arcs connecting nodes, including the operating lines and transfer channels between adjacent stations. The train interval between adjacent stations is abstracted into two unidirectional arcs, corresponding to the up and down platform nodes respectively. By introducing a time dimension into the topological network, it is expanded into a space-time network, forming a space-time point set and a space-time arc set, which are used to represent the dynamic distribution of passenger flow. Based on the characteristics of pedestrian flow, discrete passenger flow states are defined, and the space-time arc is further extended into a space-time state arc. The attributes of each space-time state arc include flow rate, density and speed attributes. The time interval of the space-time state arc is calculated based on the travel time of the entry arc or transfer arc in the corresponding state. The travel time is obtained from the train timetable. Establish a regional collaborative passenger flow control optimization model: A flow control model for urban rail transit network is established with the goal of minimizing the total waiting time of all passengers. The total waiting time of passengers includes the waiting time required for passengers to wait for the arriving train at each platform. The constraints include passenger flow balance constraints, train and passage capacity constraints, observation equation between network passenger flow density and spatiotemporal arc state, spatiotemporal arc state uniqueness constraints, 0-1 variable constraints, and passenger flow control ratio constraints.

3. The method according to claim 1, characterized in that, The regional collaborative passenger flow control optimization process is reconstructed into a deep reinforcement learning framework based on Markov decision processes, including: The action space represents the passenger flow control strategy, indicating the proportion of passenger flow allowed to enter the station relative to the total passenger flow demand. In the transfer passage, it represents the proportion of transfers allowed to enter the platform relative to the total transfer passenger flow demand. The passenger flow status in the road network in the state space includes the passenger flow demand at the station, the passenger flow in the transfer channel, the passenger flow in the cross section, and the number of people waiting on the platform; A dynamic environment simulator is constructed using a spatiotemporal-state network. Through a Markov state transition model, the spatiotemporal distribution of passenger flow is simulated under the influence of the current passenger flow control strategy. The passenger flow status of each node and arc in the network is dynamically updated to provide an environmental basis for strategy optimization. The reward function is used to determine whether the passenger flow status in the passenger flow control optimization problem has reached the set target. It is constructed based on the cumulative waiting time of passengers outside the station, the cumulative waiting time of passengers on the platform, and the cumulative waiting time of passengers in the transfer channel. The strategy function is used to represent the way to select passenger flow control actions under a given passenger flow state. The strategy function combines state information and target information through an artificial neural network and outputs the corresponding action decision.

4. The method according to claim 3, characterized in that, The design describes the passenger flow control objectives, background knowledge, deep reinforcement learning framework, and specific output target prompting engineering. It generates a reward function that conforms to urban rail passenger flow control optimization through a large language model (LLM), including: Injecting structured hints into large language models (LLMs) involves four dimensions: By injecting role-based information, the large language model is set as a role with the ability to control passenger flow in rail transit, and a vectorized knowledge base consisting of industry standards, technical manuals and professional literature is provided so that the model can master the methods of calculating platform carrying capacity and assessing passenger flow density. The task is injected with hierarchical description information and a spatiotemporal coupling decomposition strategy is adopted to decompose the macro-level passenger flow control target into three sub-tasks: platform-level passenger flow balance, train-level load factor control, and passenger-level waiting time optimization. The sub-tasks are then associated with evolution equations based on dynamic network flow theory. The system injects explicit modeling information into a deep reinforcement learning mechanism, including a spatiotemporal-state network, a regional collaborative passenger flow control optimization model, a deep reinforcement learning framework, a platform waiting passenger flow state matrix, a passenger control action space, and a state transition function that considers passenger flow propagation delay. Inject and output formal constraint information; Based on structured prompting engineering, a reward function that conforms to the optimization of urban rail passenger flow control is generated.

5. The method according to claim 1, characterized in that, Using the generated reward function, train and test the deep reinforcement learning agent, record the training and testing results, and perform reward function correction and analysis, including: Using the currently generated reward function, a deep reinforcement learning agent is trained in a spatiotemporal state network simulation of an urban rail transit network environment. The agent interacts with the passenger flow distribution state in the environment by performing random exploration passenger flow control actions. Record the training and testing results of the agent, and determine the performance of the agent based on the final reward value obtained from the testing results; If this is not the first iteration, and the test performance of the agent trained using the current reward function is not better than or equal to the performance of the previous iteration, then jump to the reward function corrector to correct the reward function; If the current iteration is the first iteration, or the test performance of the agent trained by the current reward function is better than that of the previous iteration, and the preset convergence state has not been reached, then the process jumps to the agent performance analyzer for analysis; the convergence state is defined as the agent's performance reward value remaining stable in a preset number of consecutive iterations of training.

6. The method according to claim 5, characterized in that, Jump to the reward function corrector to correct the reward function, including: Analyze the code structure and calculation logic of the current reward function to locate the logical segments that cause the agent's policy performance to degrade. The system connects to a pre-built expert knowledge analysis base for comparative analysis. The pre-built expert knowledge analysis base records the types of reward function defects that occurred in historical training, the corresponding abnormal performance of deep reinforcement learning training, and the corrected effect verification data. Based on the comparative analysis results, correction suggestions are generated, and targeted adjustments are made while maintaining the overall framework of the original reward function to obtain the corrected reward function; The modified reward function is iteratively verified, including its syntactic correctness, numerical stability, and physical feasibility. The corrected reward function, which satisfies all verification conditions and the total passenger waiting time reaches a set threshold, is submitted to the next iteration of the training process. The structured prompting engineering used by the agent performance analyzer is consistent with the prompting engineering format of the reward function generator. The analysis then jumps to the agent performance analyzer, including: Based on the recorded training and testing data, the training performance, testing performance, and decision-making behavior characteristics of the deep reinforcement learning agent are analyzed by the agent performance analyzer, and improvement suggestions for the current reward function are generated. The improvement suggestions are fed back into the reward function generation or correction process to optimize the reward function in subsequent iterations when convergence has not been achieved.

7. The method according to claim 6, characterized in that, Based on the reward function analysis results, the current reward function is adjusted using a large language model (LLM). After training, a regional passenger flow control scheme is output, including: Based on the improvement suggestions output by the agent performance analyzer, the current reward function is adjusted using a large language model (LLM). The adjusted reward function is then input back into the training and testing process to form a closed-loop optimization until the output of the reward function reaches a stable convergence state. Extract regional passenger flow control schemes from the trained deep reinforcement learning agent, including the timing and intensity of passenger flow control for all stations within the region.

8. A device for coordinated control and intelligent optimization of passenger flow in urban rail transit areas, characterized in that, The device includes: The regional collaborative passenger flow control optimization model construction module is used to construct a spatiotemporal-state network to describe passenger flow evolution and establish a regional collaborative passenger flow control optimization model based on the topology of the urban rail network, historical passenger flow, and train timetable data. The deep reinforcement learning framework construction module is used to reconstruct the regional collaborative passenger flow control optimization process into a deep reinforcement learning framework based on Markov decision process, including environment, action, reward, state, and policy. The reward function generation module is used to design a prompting engineering that describes the passenger flow control objectives, background knowledge, deep reinforcement learning framework, and specific output objectives. It generates a reward function that conforms to the optimization of urban rail passenger flow control through a large language model LLM. The correction and analysis module is used to train and test deep reinforcement learning agents using the generated reward function, record the training and testing results, and perform reward function correction and analysis. The regional passenger flow control scheme generation module is used to adjust the current reward function based on the reward function analysis results using a large language model (LLM), and output the regional passenger flow control scheme after training is completed.

9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is used to store computer programs; When the processor executes the program stored in the memory, it implements the urban rail transit area passenger flow collaborative control and intelligent optimization method as described in any one of claims 1-7.

10. A computer-readable medium, characterized in that, It stores instructions that, when executed by one or more processors, cause the processors to perform the urban rail transit area passenger flow collaborative control and intelligent optimization method as described in any one of claims 1-7.

Citation Information

Cited By

  • Method for optimizing operation of hydrogen-containing building energy system assisted by multi-role large model

    CN121544087A

  • Urban travel cooperative control method based on graph neural network and multiple agents

    CN121960998A

  • Urban travel coordination control method based on graph neural network and multi-agent

    CN121960998B