A Method for Constructing a Public Transportation Operation Safety Intelligent Agent Based on Risk Evolution Mechanism
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-22
- Publication Date
- 2026-08-14
AI Technical Summary
[0007]系统缺乏自适应演化能力:现有策略多为固定规则,无法根据实际与预测偏差动态调整风险表征、演化模型与控制策略,缺乏闭环学习机制
本发明实现了风险的可计算表达。传统方法仅依赖经验判断的问题,缺乏统一量化模型。本发明通过构建风险函数,将不同因素统一转化为可计算数值,实现风险从经验判断到量化评估的转变。
Smart Images

Figure CN122573137A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent transportation and public safety technology, and more specifically to a method for constructing a public transportation operation safety intelligent agent based on a risk evolution mechanism. Background Technology
[0002] With the continuous development of urban public transportation systems, the operating environment of buses is becoming increasingly complex. The coupling relationship between driving behavior, road conditions, and passenger factors has significantly strengthened, leading to greater uncertainty in bus operation safety. The risk evolution mechanism is crucial for bus operation safety control. Specifically, it refers to the dynamic process by which a relatively safe state during bus operation gradually accumulates and amplifies under the combined influence of multiple risk factors, potentially evolving into a traffic accident. Currently, bus safety management mainly relies on video surveillance, rule constraints, and statistical analysis methods based on historical data to identify and warn of abnormal behavior. However, there are significant shortcomings in understanding and modeling the risk evolution mechanism, specifically manifested in the following ways:
[0003] Lack of forward-looking risk evolution characterization: Existing methods mainly target abnormal behaviors that have occurred or are occurring, without constructing a model of the transition relationship between states, making it difficult to predict future risk evolution paths and trends, and unable to intervene in the early stages of risk evolution.
[0004] Difficulty in handling risks from multiple coupled factors: Existing systems are mostly based on single indicators or static rules, ignoring the interactive coupling effects between different risk factors, resulting in inaccurate risk assessment in complex scenarios.
[0005] Lack of a continuous risk evolution modeling perspective: Existing technologies treat risks as discrete events and fail to continuously depict the accumulation process of risks from low to high over time, making it difficult to make an overall assessment of the complete evolution path.
[0006] Lack of holistic intervention in future risk paths: Existing control strategies focus more on reducing current instantaneous risks, without constraining or reducing high-risk evolution paths, resulting in a short-sighted risk control perspective.
[0007] The system lacks adaptive evolution capabilities: existing strategies are mostly fixed rules, which cannot dynamically adjust risk representation, evolution model and control strategy according to the deviation between actual and predicted results, and lack a closed-loop learning mechanism.
[0008] Therefore, how to construct a safety intelligent agent that can uniformly model the operation status of public transportation, characterize and control the risk evolution process, and has adaptive optimization capabilities is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0009] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, embodiments of the present invention provide a method for constructing a public transport operation safety intelligent agent based on a risk evolution mechanism, comprising the following steps: S100: Collect multi-source data during bus operation and preprocess it to build a unified state representation model. Map the multi-source data into a high-dimensional state vector to form a bus operation state space. S200: Based on historical operational data and safety event data, the risk value of each state vector is calculated using a risk function to construct a risk representation structure; S300: Construct a risk evolution relationship model describing the transition relationship between state vectors in the state space, calculate the risk evolution gradient to determine the risk rising or falling trend, input the current state vector of bus operation and the corresponding risk representation into the risk evolution relationship model, and predict the state evolution path of multiple future time steps and the risk evolution trend corresponding to each path. S400: Based on the risk evolution relationship model, a state control model is constructed. The current state vector of the bus operation and the corresponding risk representation, as well as the predicted state evolution paths for multiple future time steps and the risk evolution trends corresponding to each path are input into the state control model. The model outputs and executes intervention constraint instructions to constrain or reduce high-risk evolution paths, so that the bus operation state tends to the preset safe state set. S500: Based on the deviation between actual operating results and predicted results, the state control model is dynamically adjusted; at the same time, the risk characterization structure and risk evolution model are updated based on continuously collected multi-source data.
[0010] The beneficial effects of the above-described technical solutions provided in the embodiments of the present invention include at least the following: This invention enables a calculable expression of risk. Traditional methods rely solely on empirical judgment and lack a unified quantitative model. This invention constructs a risk function, transforming different factors into calculable numerical values, thus realizing the transformation of risk from empirical judgment to quantitative assessment.
[0011] This invention enables early identification of risk trends. Existing technologies can only identify current risks and fail to model the relationships between changing states. This invention, through a risk evolution model and the magnitude of risk changes, can identify whether a risk is increasing or decreasing, thereby enabling early intervention.
[0012] This invention achieves multi-factor coupled risk identification. Existing technologies often use a single indicator and suffer from inaccurate risk assessment, ignoring the interactions between different factors. This invention, through coupling terms, can identify superimposed risks, improving identification accuracy.
[0013] This invention achieves end-to-end risk control. Existing risk control technologies mostly focus on instantaneous risks and lack time-dimensional analysis. This invention, through a path risk function, supports a holistic assessment of risks over a future period, thereby achieving end-to-end control.
[0014] This invention achieves system self-learning capability. Existing systems often employ fixed risk control strategies, lacking feedback optimization mechanisms. This invention, through its strategy update method, automatically determines the effectiveness of the current strategy based on the difference between actual and predicted results; it balances stability and adaptability by controlling the adjustment range through the learning rate; and it guides the optimization direction through error gradients, enabling the strategy to continuously evolve towards a better outcome. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0016] Figure 1 This is a flowchart of the method for constructing a public transport operation safety intelligent agent based on a risk evolution mechanism provided in this invention.
[0017] Figure 2 The flowchart is shown in the first embodiment of the method for constructing a public transport operation safety intelligent agent based on a risk evolution mechanism provided by the present invention.
[0018] Figure 3 The flowchart is a second embodiment of the method for constructing a public transport operation safety intelligent agent based on a risk evolution mechanism provided by the present invention.
[0019] Figure 4 The flowchart is for Embodiment 4 of the method for constructing a public transport operation safety intelligent agent based on a risk evolution mechanism provided by the present invention.
[0020] Figure 5 The flowchart illustrates a specific application scenario of the method for constructing a public transport operation safety intelligent agent based on a risk evolution mechanism provided by this invention. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] like Figure 1 As shown in the figure, this invention discloses a method for constructing a public transport operation safety intelligent agent based on a risk evolution mechanism, including the following steps: S100: Collect multi-source data during bus operation and preprocess it to build a unified state representation model. Map the multi-source data into a high-dimensional state vector to form a bus operation state space. S200: Based on historical operational data and safety event data, the risk value of each state vector is calculated using a risk function to construct a risk representation structure; S300: Construct a risk evolution relationship model describing the transition relationship between state vectors in the state space, calculate the risk evolution gradient to determine the risk rising or falling trend, input the current state vector of bus operation and the corresponding risk representation into the risk evolution relationship model, and predict the state evolution path of multiple future time steps and the risk evolution trend corresponding to each path. S400: Based on the risk evolution relationship model, a state control model is constructed. The current state vector of the bus operation and the corresponding risk representation, as well as the predicted state evolution paths for multiple future time steps and the risk evolution trends corresponding to each path are input into the state control model. The model outputs and executes intervention constraint instructions to constrain or reduce high-risk evolution paths, so that the bus operation state tends to the preset safe state set. S500: Based on the deviation between actual operating results and predicted results, the state control model is dynamically adjusted; at the same time, the risk characterization structure and risk evolution model are updated based on continuously collected multi-source data.
[0023] This invention constructs a public transport operation state space by collecting multi-source data, uses a risk function to quantify and assess risks, establishes a risk evolution relationship model to predict future state evolution paths and trends, and then uses a state control model to actively constrain and intervene in high-risk paths. Based on actual feedback, it performs dynamic adaptive adjustments and model updates to achieve intelligent closed-loop control of public transport operation safety.
[0024] The specific steps of the above-mentioned method for constructing a public transport operation safety intelligent agent based on a risk evolution mechanism according to the present invention are described in detail below: S1: Multi-source data acquisition and preprocessing: Collect bus operation data, driving behavior data, environmental perception data, and passenger-related data, and then clean, align, and merge the data.
[0025] S2: State-space modeling: A unified state representation model is constructed to map multi-source data into high-dimensional state vectors, forming a public transport operation state space.
[0026] S3: Risk Characterization Structure Construction: Based on historical operational data and security incident data, risk quantification assessment is performed on different states in the state space to construct a risk characterization structure.
[0027] S4: Risk Evolution Relationship Modeling: A state transition relationship model is constructed in the state space to describe the transformation probability and evolution path between different states, forming a risk evolution relationship network to characterize the dynamic development process of risk from a low-risk state to a high-risk state.
[0028] Furthermore, to clarify the regulatory objectives and means, the following core concepts are defined: 1. Set of safe states: The set of safe states is the state space. A subset The states within this set satisfy: .in, This is a relatively low risk threshold, representing an acceptable level of safety for the system. The ultimate goal of system regulation is to guide state evolution to either enter or remain at a certain level. Inside.
[0029] 2. Path constraint operations: The constraint operations on high-risk evolution paths include technical interventions to reduce their probability of occurrence, such as limiting vehicle speed and adjusting traffic light phases through vehicle network commands; and operational reduction operations, such as directly canceling or adjusting the schedules of trains that may generate the high-risk path during the scheduling phase.
[0030] S5: Construction of the State Regulation Model: Based on the risk evolution relationship model, a state control model is constructed, and the state transition process is constrained by an optimization algorithm to make the system operating state tend towards a set of safe states. .
[0031] S6: Evolutionary Path Generation and Constraints Based on the current state, future multi-step state evolution paths are generated to form a multi-path set, and high-risk evolution paths are constrained or reduced.
[0032] S7: Adaptive policy adjustment: Based on the deviation between actual operating results and predicted results, the state control model is dynamically adjusted to improve the risk control effect.
[0033] S8: Model Update and System Evolution: Based on continuously collected data, the risk representation structure and risk evolution model are updated to achieve the system's long-term self-evolution capability.
[0034] Preferably, the state space modeling adopts a multi-dimensional feature fusion method to represent the bus operation state as a high-dimensional state vector:
[0035] in: The normalized instantaneous vehicle speed is calculated from the current vehicle speed. Speed limit of the road section The ratio is calculated, that is , The range is 0 to 1. The closer the value is to 1, the closer the vehicle speed is to the upper limit, and the higher the risk of collision. The normalized absolute value of acceleration is derived from the current absolute value of acceleration. With the vehicle's maximum safe acceleration and deceleration threshold The ratio is calculated, that is , It can be obtained from continuous velocity difference calculation. The range is 0 to 1, and the closer the value is to 1, the more violent the acceleration and deceleration behavior is; Braking intensity, representing a characteristic index of braking frequency, is obtained by normalizing the ratio of the number of braking actions in the past 10 seconds to the theoretical maximum number of braking actions, i.e.: ,in The number of braking operations within the time window. This represents the theoretical maximum number of braking operations within the time window, calculated as once per second. The range is 0 to 1. The larger the value, the more frequent the braking behavior and the higher the cumulative risk. The road congestion index ranges from 0 to 1. It is calculated based on the ratio of real-time traffic flow speed to free flow speed, or obtained from the local traffic information platform API interface. The closer the value is to 1, the more congested the traffic is. Environmental factors, ranging from 0 to 1, are obtained by querying a pre-defined environmental risk mapping table. For example: sunny day = 0.0, light rain = 0.2, moderate rain = 0.4, heavy rain / foggy day = 0.6, torrential rain / dense fog / snow = 0.8-1.0. This mapping table can be developed based on historical accident statistics and expert experience. Passenger density inside the vehicle is obtained from onboard passenger flow statistics equipment; A comprehensive driving behavior score, ranging from 0 to 1, is calculated based on a short time window, such as the frequency of rapid accelerations within the past 60 seconds. Frequency of rapid deceleration Abnormal lane change frequency We obtain the following by weighting and merging the sub-indicators:
[0036] Each frequency metric is defined as the number of times the corresponding behavioral event occurs within the short time window. For example, the frequency of rapid acceleration. It can be defined as the vehicle's longitudinal acceleration over the past 60 seconds. Exceeding a preset threshold, such as 2.5 m / s 2 The number of times. Weight , , It can be determined through correlation analysis of various behaviors and risk events in historical data.
[0037] By mapping multi-source data to the same state vector, we can achieve co-domain representation of different risk factors and provide a unified computational basis for subsequent risk modeling.
[0038] Preferably, the risk representation function is defined as:
[0039] in: This represents the risk value of the current state; the higher the value, the more dangerous the situation. The first in the state vector Variables, such as velocity, acceleration, etc.; For the first The risk weight of each variable indicates the importance of that factor; The coupling risk weight between two factors describes the interactive effects between the factors.
[0040] Preferably, the risk weight With coupling weights It can be determined by one or more of the following methods: Statistical learning based on historical data: Collect a large amount of data on the normal operation status and the state before the occurrence of safety accidents, and use models such as logistic regression, support vector machine or neural network for training, and use the model coefficients as weights.
[0041] The AHP (Analytical Hierarchy Process) method based on expert experience: Experts in the field of traffic safety are invited to conduct pairwise comparisons and scores of various risk factors and their interactions, and the weights are obtained through calculation.
[0042] Online adaptive adjustment: The initial weights can be set using method 1 or 2. During system operation, the weights are fine-tuned based on the adaptive update mechanism in step S8, using the deviation between the actual risk events and the prediction results.
[0043] Preferably, the risk evolution relationship is represented by a state transition probability model:
[0044] in: Let be the state transition probability. This indicates the current bus operation status. For the next moment of bus operation status, The control actions output by the public transport operation safety intelligent agent in this state, such as reminding the driver and adjusting the dispatch, are then implemented.
[0045] Further define the risk evolution gradient:
[0046] in, For risk evolution gradient; when A value greater than 0 indicates an upward trend in public transportation operation risk, necessitating preventative intervention. A value less than 0 indicates a decreasing risk trend and a tendency towards safer operation.
[0047] This optimization step minimizes the expected value of the risk evolution gradient.
[0048] Preferably, the objective function for regulation is:
[0049] in: To regulate the objective function, To impose control actions on the operation status of public transportation The risk value at the next moment. The costs associated with performing this control action, such as the cost of scheduling intervention, This is a balancing factor used to weigh safety risks against control costs, such as driver experience and operational efficiency. Its value can be set according to the operator's safety strategy. A smaller value, such as 0.1, can be set when pursuing ultimate safety, while a larger value, such as 0.5, can be set when emphasizing economy. It can also be designed as an adaptive parameter, increasing during stable system operation. Reduce interventions and minimize interventions during high-risk periods. Strengthen control.
[0050] Preferred, the future path is defined as:
[0051] A future evolution path represents the process of change of the system from the present to a certain period in the future.
[0052] Path risk is defined as:
[0053] Constraints:
[0054] in: This represents the cumulative risk value for the entire path. This represents a future evolutionary path starting from the current state. For the first on the path Risk value at each point in time. For time step indexing, from the current moment to the next T steps, This is the cumulative risk threshold for the path, which can be set based on historical safety levels. The instantaneous safety boundary of a single-time state is defined, while This is used to constrain a future period of time. The total amount of risk accumulated within a step. Together, these two constitute the system's two-layered risk defense line. The settings can be referenced. With path length For example, take , A leniency factor greater than 1, or based on historical accident-free operating conditions. The high quantile of the statistical distribution, such as the 95th percentile, is determined. Different thresholds can be used for different routes and time periods to achieve dynamic risk management.
[0055] Based on this preferred approach, the cumulative effect of risk can be controlled by limiting the overall risk of the path, rather than the risk at a single point.
[0056] Preferably, the strategy update rule is as follows:
[0057] in: For the current control strategy, such as the frequency of reminders and the intensity of intervention, For the updated control strategy, The learning rate, adjusted by the magnitude of the adjustment. This indicates the direction of the error in the current strategy's effect.
[0058] Based on this preferred procedure, gradient optimization is performed through feedback error to achieve continuous policy improvement.
[0059] The technical solution of this invention is not only applicable to a single algorithm implementation, but can also be implemented based on different computational paradigms. Therefore, in specific implementation, multiple different technical paths can be used to achieve the same inventive idea. To enhance the applicability and resistance to circumvention of this invention, this invention provides the following three types of implementation methods that all follow the core logic of S100 to S500, each with its own emphasis in terms of technical implementation, data requirements, and applicable scenarios: Example 1 like Figure 2As shown, this embodiment provides a bus safety control implementation method based on rule models and optimization methods. This embodiment combines rule models and optimization methods to conduct risk assessment and control of the bus operation process. This embodiment is suitable for the initial construction phase of the system or scenarios with a small amount of historical data.
[0060] This embodiment includes steps S1 to S8.
[0061] S1: Data Acquisition and Preprocessing S11: Collect the following multi-source data: 1. Vehicle operation data: vehicle speed, braking signal, with a value range of 0~1; 2. Dynamic behavioral data: Acceleration, calculated as follows:
[0062] in: That is, 100ms, which is consistent with the time step of subsequent data synchronization.
[0063] 3. Environmental data: Congestion index Weather risk factors ; 4. Load data: Passenger density .
[0064] S12: Process the raw data: 1. Outlier removal, when ,or When this happens, the data is deemed invalid and removed. 2. Missing value imputation, using linear interpolation:
[0065] 3. Data synchronization: The unified time step is 100ms.
[0066] S13: Normalize the data and map it uniformly to the [0,1] interval, as follows: Speed normalization: Calculated using the ratio of current vehicle speed to the maximum speed limit for the road segment.
[0067] in This is the maximum speed limit for the current road section, in km / h. Acceleration normalization:
[0068] in The maximum safe acceleration / deceleration threshold set according to vehicle performance, in m / s². Braking intensity normalization:
[0069] in The number of braking operations within the time window. This represents the theoretical maximum number of braking events within the time window (e.g., once per second). The range is 0 to 1; Environmental factors, congestion index, and passenger density: The raw data have been categorized into the [0,1] interval and no additional normalization is required.
[0070] Step S2: State space construction: S21: Definition of state vector: Constructing the state vector:
[0071] S22: Behavioral Feature Calculation: Define a rapid acceleration index, which is the criterion for judging rapid acceleration after acceleration normalization, using 80% of the safe upper limit:
[0072] Based on the acceleration history sequence calculated using S1, the number of accelerations that occurred within the past 60 seconds was counted:
[0073] S3: Construction of the risk representation function: S31: Definition of risk function:
[0074] Among them, s t Let x be the bus operation state vector. i x j w is the risk variable in the state vector. i Let w be the risk weight of the i-th variable. ij The coupling risk weights between variables.
[0075] S32: Weight Setting: The initial weights are set based on expert experience values, for example:
[0076] S33: Definition of Coupling Term:
[0077] S34: Complete expression of risk calculation:
[0078] S4: Risk Evolution Trend Analysis: S41: Changes in risk:
[0079] S42: Trend Determination
[0080] S43: Determining Continuous Trends If the following conditions are met:
[0081] This indicates a continuously rising risk.
[0082] S5: Control Strategy Generation S51: Definition of control variables:
[0083] in: For voice reminders, For speed control, For scheduling intervention.
[0084] S52: Control objective function:
[0085] in, To control costs, To balance the factors, set .
[0086] S53: Rule-based decision execution: Define the rules:
[0087] S6: Path Generation and Constraints S61: Path Prediction The following is an example of path generation using simple linear extrapolation:
[0088] in This is a simplified example of an increment estimated based on the current state trend. In actual deployment, a more accurate vehicle dynamics model or a data-driven prediction method based on sequence models such as LSTM can be used.
[0089] S62: Path Risk Calculation
[0090] S63: Set constraints , .
[0091] S64: Perform path filtering and delete paths that do not meet the conditions.
[0092] S7: Execution Control S71: Voice control, output: Please slow down; S72: Vehicle control, speed limited to:
[0093] S8: Adaptive Optimization S81: Execution error calculation:
[0094] S82: Execution parameter update: Based on prediction error Gradient descent is used to update the weight parameters in the risk function that are strongly correlated with the current state. For example, if the current state is moving at high speed... and high congestion If it is the primary factor, then its corresponding weights should be adjusted accordingly. , and coupling weights
[0095]
[0096] in: For different weight parameter types, For the new corresponding weights, For the old corresponding weights, Set the learning rate. .
[0097] Example 2 like Figure 3 As shown, this embodiment provides a method for implementing bus safety control based on Markov Decision Process (MDP). The bus operation safety control problem is modeled as a Markov Decision Process (MDP). By discretizing the bus operation state, a state transition probability matrix and a reward function are constructed. The optimal control strategy is solved through policy iteration or value iteration methods, thereby achieving optimal regulation of future risk evolution.
[0098] In this embodiment, an MDP model needs to be constructed, and the system is defined as a quintuple:
[0099] in, For state space, For the action space, Let be the state transition probability. For the reward function, This is a discount factor used to weigh the importance of current rewards against future rewards. The closer its value is to 1, the more the strategy focuses on long-term risk control and safe returns.
[0100] S1: State space discretization construction: S11: Definition of original continuous variables: Define continuous variables:
[0101] S12: Discretization rule design: Discretize continuous variables into finite states: 1. Velocity discretization:
[0102] 2. Acceleration discretization:
[0103] 3. Congestion decoupling:
[0104] Discretization interval division can be based on: 1. Traffic regulations and speed limits; 2. Quantiles of historical operating data distribution, such as tertiles; 3. Physical thresholds that significantly differentiate risks, such as the acceleration threshold of 2.5 m / s² for rapid acceleration. 2 .
[0105] S13: State Combinations Constructing the state space:
[0106] Total number of states:
[0107] S14: Status Code: Map the state to an integer index:
[0108] S2: Action space definition: S21: Action Set:
[0109] in: No operation performed. For voice reminders, To limit speed, This is to force a reduction in speed.
[0110] S22: Action codes are shown in Table 1: Table 1: Action Coding Table
[0111] S3: Construction of the state transition probability matrix: S31: Data Statistical Methods Statistical analysis of transition probabilities from historical data:
[0112] in: This is the current state. For the actions to be performed at the moment, For the state at the next moment, To count the number of successes, in historical data, it is in the state. And perform the action Ultimately, it really did shift to the right state of mind. Number of times, For the total number of attempts, in the historical data, it is in the state. And perform the action Number of times, For the transition probability, in state Execute action Afterwards, it was transferred to The probability of.
[0113] S32: Transition matrix structure: Constructing a three-dimensional matrix:
[0114] S33: Smoothing process to prevent zero probability: Laplacian smoothing is used:
[0115] S4: Reward Function Design S41: Definition of risk function:
[0116] S42: Reward function construction:
[0117] Parameter description: Among them, and The normalization coefficient is used to normalize the risk value. With action cost When scaled to the same order of magnitude, their ratio / In essence, it serves as a trade-off coefficient with the target function of regulation. Similar effects can be determined through offline strategy evaluation or online learning.
[0118] S43: Motion cost is defined as shown in Table 2: Table 2: Motion Costs
[0119] S5: Solving for valued functions, core calculations: S51: Value Iteration Formula:
[0120] Parameter settings are as follows =0.9.
[0121] S52: Iteration stopping condition:
[0122] Among them, setting .
[0123] S6: Strategy Extraction S61: Optimal Strategy
[0124] S62: The strategy table output is shown in Table 3: Table 3: Strategy Table Output Table
[0125] S7: Online Decision Execution S71: Real-time status recognition, calculates the current status ID every 100ms; S72: Table lookup decision, Cost-effective and efficient; S73: Execution control, achieved through voice prompts and CAN speed limiting.
[0126] S8: Online Learning and Updates S81: Real-time update of transition probability:
[0127] S82: Dynamically adjust the reward function:
[0128] Setting parameters , .
[0129] Example 3 like Figure 4As shown, this embodiment, based on the aforementioned numerical modeling method, introduces a Large Language Model Agent (LLM). By constructing a processing chain encompassing structured states, semantic representations, risk inference, and decision generation, it achieves the identification and proactive control of hidden risks in complex traffic scenarios. The core of this embodiment lies in utilizing the semantic understanding and complex reasoning capabilities of a large language model (LLM) to supplement or enhance the parts that are difficult to accurately characterize in the aforementioned numerical model, particularly: 1) Fuse multi-source heterogeneous information, such as fuzzy natural language descriptions and image events, to form richer state semantic representations; 2) Perform common-sense or causal reasoning on the implicit, nonlinear risk evolution relationships between states, especially in long-tail scenarios with sparse data. 3) Generate risk control strategy descriptions that are consistent with human experience and can be explained.
[0130] This embodiment requires defining the system model structure, and the system is defined by the following mapping process:
[0131] in, This is the current structured state vector. It is a historical state sequence. For semantic path, For path risk, For control strategies.
[0132] S1: Construction of structured state vectors: S11: Input feature definition: Construct the input vector:
[0133] S12: Semantic mapping preprocessing: Mapping numerical variables to semantic labels: For example: >0.7 is high speed >0.8 indicates rapid acceleration A score of >0.7 indicates severe congestion. >0.4 mm indicates moderate rain S13: Semantic State Representation Define semantic state:
[0134] For example: High speed + traffic congestion + rainy weather + frequent braking indicates that the vehicle is traveling at high speed on a severely congested rainy road and the driver is frequently braking.
[0135] S2: Prompt construction mechanism: S21: Definition of the Prompt function: Define the Prompt generation function:
[0136] in: To control template parameters.
[0137] S22: Prompt structure layering: A Prompt consists of three parts: 1. Role layer Define model identity: You are a public transport safety risk analysis expert, skilled at identifying traffic risks and predicting future behavior.
[0138] 2. State layer Structured input: Current status: Speed: Highway Acceleration: Rapid acceleration Congestion: Severe congestion Weather: Moderate rain Passenger density: High Driving behavior: Frequent braking 3. Task layer Define the task: Based on the current state and historical evolution trends, we predict three possible state evolution paths within the next 5 seconds, analyze how the risks on each path gradually change, are generated, spread, or transformed, and give the final risk score of the path, from 0 to 1.
[0139] S23: Prompt parameterized control: Define control parameters:
[0140] in: Risk sensitivity can influence whether a score is too high or too low. This represents the number of paths, typically between 3 and 5. To a degree of conservatism.
[0141] S3: Semantic path generation mechanism: S31: Path generation function:
[0142] S32: Path structure definition: Each path is defined as:
[0143] in, For path description, semantics, For behavior sequences, Risk scoring.
[0144] Example output: Path description: The vehicle ahead slowed down, and the driver reacted slightly too slowly, resulting in sudden braking.
[0145] Behavioral sequence: following too closely The brake lights of the car in front are on. The driver applied the brakes forcefully after a 0.5-second delay.
[0146] Risk score: 0.85.
[0147] S33: Path Quantity Control
[0148] Normal setting: N=3.
[0149] S34: Risk Score Normalization: Normalize the risk output of the model:
[0150] S4: Multi-round reasoning and path correction mechanism: S41: First round of reasoning, initial path generation: Output path set:
[0151] S42: Consistency check: Define the consistency function:
[0152] like If so, then corrections will be made.
[0153] S43: Second round of reasoning, correction: Constructing a second Prompt: Please check the following paths for any inconsistencies and correct them.
[0154] S44: Path stability calculation:
[0155] in, This is the number of rounds of reasoning, usually taken as 2 to 3.
[0156] S5: Risk Assessment of Numerical Semantic Fusion S51: Definition of Numerical Risk
[0157] S52: Fusion function:
[0158] Parameter description: Settings , .
[0159] S53: Risk Ranking:
[0160] S6: Decision generation mechanism, second-stage reasoning: S61: Decision Prompt Construction: enter: Optimal path; Current status; Task: Specific control strategies are proposed for this high-risk path.
[0161] S62: Output Structure: definition:
[0162] in, For driver operation, For system control, For scheduling measures.
[0163] Example output: Driver's operation: Immediate voice prompt: The road is slippery in the rain, please increase the following distance and apply the brakes gently.
[0164] System control: Limit the maximum vehicle speed to 40km / h via vehicle-to-everything (V2X) network.
[0165] Dispatch measures: None.
[0166] S63: Prevent excessive intervention through decision constraints:
[0167] S7: Self-referential optimization mechanism: S71: Error Definition:
[0168] S72: Prompt adjustment function:
[0169] S73: Adjustment Strategy: when When the value remains positive, the predicted risk is higher than the actual risk, and the system is too sensitive. Therefore, the risk sensitivity should be reduced. when When the value remains negative, the predicted risk is lower than the actual risk, and the system is too sluggish, so the risk sensitivity should be increased. S74: Example Enhancement Mechanism, Fewshot: Add historical failure cases to the Prompt:
[0170] S8: System operating parameter settings are shown in Table 5: Table 5: System Operating Parameters Table
[0171] like Figure 5 As shown, to more clearly illustrate the method of the present invention, the following uses a typical high-risk scenario as an example to briefly explain the entire process of the system from perception to decision-making: Scenario: A bus is traveling at 60 km / h on an urban expressway during the evening rush hour. =60km / h is considered "highway". At this time, it was raining moderately, making the environment slippery, and environmental factors... The train is saturated with passengers, and the passenger density is high. During the driving process, the driver followed too closely, and due to the pressure of rush hour traffic, exhibited frequent and intermittent braking, indicating poor driving behavior. The current actual braking acceleration... Braking strength .
[0172] All continuous variables are normalized to [0,1] according to preset rules; speed is normalized based on the maximum speed limit of 70km / h for the road segment; considering the actual operating characteristics of buses, the upper limit of acceleration normalization is set to ( The absolute value normalization method is used to characterize the degree of drastic deviation of the vehicle from a smooth and uniform driving speed.
[0173] S1 / S2 State Mapping: The system integrates the above data to form a state vector. Speed normalization:
[0174] Acceleration normalization:
[0175] State vector generation:
[0176] S3 Risk Quantification: Risk function is calculated using a risk fusion function:
[0177] The initial weights are set based on expert experience values (see Example 1):
[0178] The selection of coupling terms is based on statistics of public transport safety accidents and expert experience, with a focus on two key types of interactive risks:
[0179] Linear risk term calculation: 0.15×0.857+0.1×0.52+0.2×0.4+0.1×0.7+0.1×0.4 + 0.05×0.8+0.3×0.7=0.6206 Calculation of coupling risk term: 0.2 × 0.857 × 0.7 + 0.1 × 0.52 × 0.8 = 0.1616 Total risk value calculation:
[0180] Set safety status risk threshold Current risk level The readings are significantly higher than the safety threshold, indicating a high-risk operating state that requires preventative safety intervention and control measures.
[0181] S4 Evolution Prediction: Based on the risk evolution relationship model, the simulation shows that the current vehicle is in a high-risk superposition scenario of high speed, wet and slippery weather, traffic congestion, full passenger load, close following and continuous frequent light braking; if the vehicle in front suddenly decelerates, due to the multiple constraints of reduced road surface adhesion coefficient in rainy weather, insufficient following distance and delayed driver reaction, the driver will be forced to increase braking force, switching from the original light and frequent braking to a defensive heavy braking state.
[0182] Set the evolution duration for the next 2 seconds, and increase the braking deceleration to [value missing]. The initial speed was 60 km / h, which dropped to 45.6 km / h at the end of 2 seconds. The braking intensity and the level of aggressive driving behavior were significantly increased compared to the current state, and the risk continued to rise.
[0183] Speed normalization:
[0184] Acceleration normalization:
[0185] Normalized future state vector:
[0186] Calculation of future linear risk term: 0.15×0.651+0.1×0.8+0.2×0.85+0.1×0.7+0.1×0.4+0.05×0.8+0.3×0.90=0.7677 Calculation of future coupling risk terms: 0.2 × 0.651 × 0.7 + 0.1 × 0.8 × 0.8 = 0.1551 Calculation of total future risk value: 0.9228 Risk evolution gradient:
[0187] This indicates that within a short-term simulation period, the driving risk shows a significant upward trend, and this evolution path poses a safety hazard.
[0188] S5 / S6 Path Constraints and Control: The system generates multiple state evolution paths, including uniform coasting, smooth deceleration, and defensive braking, and calculates the cumulative risk of each path. Based on the control requirements of this scenario, the prediction duration, and the tolerance boundary for driving risks, a cumulative risk threshold for the route is set. The cumulative risk of the aforementioned defensive reinforcing braking evolution path exceeds the set threshold and is therefore identified as a high-risk evolution path.
[0189] State regulation model with To optimize the objective, and balancing driving safety risks with control execution costs, a hierarchical optimal intervention strategy is sought: Level 1 Low Intervention Cost Warning: Announces in-vehicle voice prompt: "Roads are slippery in the rain, please increase following distance, slow down smoothly, and avoid frequent braking." Intervention cost... ; Secondary safety net control: If the driver does not respond to the warning and the driving condition does not improve, the system issues a control command via the vehicle network, limiting the vehicle's maximum speed to 50 km / h, minimizing intervention costs. Under the premise of adapting to the traffic conditions of urban expressways, we should curb the escalation of risks from the source and take into account both safety management and traffic efficiency.
[0190] S7 / S8 Feedback and Updates: After receiving the warning, the driver promptly increased the following distance and smoothly reduced speed, avoiding high-risk evolution paths and returning the driving status to a reasonable and safe range. The system compares the predicted risk path with the actual driving status and calculates the prediction deviation; using a risk-cost joint objective function... To optimize the carrier, a gradient descent strategy is used to fine-tune the strategy parameters. The update rule is as follows:
[0191] This optimizes various risk weights, coupling coefficients, and trade-off coefficients. Meanwhile, relying on real-time multi-source on-board operating data, the risk characterization model and state evolution transition model are continuously iterated and updated to improve the risk prediction accuracy and intelligent control capabilities under similar rainy weather congestion and poor driving conditions.
[0192] In summary, this invention constructs a risk representation function by structurally modeling the operation status of public transportation and introducing a risk evolution mechanism to extrapolate the state at multiple time steps in the future. Based on this, it achieves forward-looking safety control of the public transportation operation process through path risk assessment and constraints.
[0193] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the method section.
[0194] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for constructing a public transport operation safety intelligent agent based on a risk evolution mechanism, characterized in that, Includes the following steps: S100: Collect multi-source data during bus operation and preprocess it to build a unified state representation model. Map the multi-source data into a high-dimensional state vector to form a bus operation state space. S2 00: Based on historical operational data and security incident data, the risk value of each state vector is calculated using a risk function to construct a risk representation structure; S300: Construct a risk evolution relationship model describing the transition relationship between state vectors in the state space, calculate the risk evolution gradient to determine the risk rising or falling trend, input the current state vector of bus operation and the corresponding risk representation into the risk evolution relationship model, and predict the state evolution path of multiple future time steps and the risk evolution trend corresponding to each path. S400: Based on the risk evolution relationship model, a state control model is constructed. The current state vector of the bus operation and the corresponding risk representation, as well as the predicted state evolution paths for multiple future time steps and the risk evolution trends corresponding to each path are input into the state control model. The model outputs and executes intervention constraint instructions to constrain or reduce high-risk evolution paths, so that the bus operation state tends to the preset safe state set. S5 00: Based on the deviation between the actual operating results and the predicted results, the state control model is dynamically adjusted; at the same time, based on the continuously collected multi-source data, the risk characterization structure and risk evolution model are updated.
2. The method as described in claim 1, characterized in that, In step S100, the multi-source data includes one or more of vehicle operation data, dynamic behavior data, environmental data, and load data; The preprocessing includes: data cleaning, time alignment, outlier removal, missing value imputation, and normalization.
3. The method as described in claim 1, characterized in that, In step S200, considering the nonlinear coupling characteristics among multiple risk factors in the public transportation operation scenario, the risk function is defined as follows: Among them, s t Let x be the bus operation state vector. i x j w is the risk variable in the state vector. i Let w be the risk weight of the i-th variable. ij The coupling risk weights between variables.
4. The method as described in claim 1, characterized in that, In step S300, the risk evolution relationship model uses a state transition probability model to represent the dynamic transition law of the bus operation state during the risk evolution process: in, Let be the state transition probability. This indicates the current bus operation status. For the next moment of bus operation status, The control behavior output by the public transport operation safety intelligent agent in this state.
5. The method as described in claim 1, characterized in that, In step S300, to quantify the dynamic changing trend of public transport operation risks during the evolution process, the risk evolution gradient is defined as: in, For risk evolution gradient; when A value greater than 0 indicates an upward trend in public transportation operation risk, necessitating preventative intervention. A value less than 0 indicates a decreasing risk trend and a tendency towards safer operation.
6. The method as described in claim 1, characterized in that, In step S400, the state control model includes a control objective function: in, To regulate the objective function, To impose control actions on the operation status of public transportation The risk value at the next moment. The cost of performing this control action, This is a weighting factor.
7. The method as described in claim 1, characterized in that, The specific construction methods of the risk evolution relationship model and state control model include: any one of the following: rule-based model and numerical optimization, Markov decision process and iteration, directed weighted graph and shortest path search, or semantic reasoning and numerical semantic fusion evaluation based on large language model.
8. The method as described in claim 1, characterized in that, In step S400, constraining high-risk evolution paths includes: Set a cumulative risk threshold ε for the path, and calculate the cumulative risk value of the entire evolution path: in, This represents a future evolutionary path starting from the current state. R(τ) represents the risk value at time point t+k on the path, where k is the time step index and T is the total number of predicted time steps. When R(τ)≥ε, the path is constrained or reduced.
9. The method as described in claim 1, characterized in that, In step S400, constraining or reducing high-risk evolution paths includes: using technical interventions such as limiting vehicle speed through vehicle network commands and adjusting traffic light phases to reduce the probability of the path occurring, or canceling or adjusting scheduled trips that may generate the high-risk path during the scheduling phase.
10. The method as described in claim 1, characterized in that, In step S500, the rules for updating the risk representation structure and risk evolution model are as follows: in, For the current control strategy, For the updated control strategy, For learning rate, This indicates the direction of the error in the current strategy's effect.