Automatic scene generation method and device based on railway topological relation
By generating and analyzing railway topological relationships, combined with algorithms such as B-spline curves, automatic scene generation is realized, solving the problems of inefficiency, error-prone and lack of special functions in the existing technology, ensuring that the generated scene complies with railway industry standards.
Patent Information
- Application Number
- CN202510244611.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-06-17
AI Technical Summary
The existing railway scenario modeling technology is inefficient, error-prone, and difficult to expand. The existing tools lack special functions in the railway field, so they cannot automatically generate layouts that meet industry standards.
By generating topological relationship data in the form of UML-like graphs, data structure transformation is carried out, standardized format data is obtained, and the railway element library is used to calculate the location information of the facility element, and the track path is generated using the B-spline curve to achieve automatic scene generation.
Improve the efficiency and accuracy of scene generation, ensure that the generated scenes comply with railway industry standards, and reduce manual intervention and repetitive labor.
Smart Images

Figure CN120162859A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of modeling technology, and in particular, to an automatic scene generation method based on railway topological relationships and an automatic scene generation device based on railway topological relationships. Background Art
[0002] Currently, railway scene modeling technology mainly relies on the following two implementation methods:
[0003] 1. Traditional manual design
[0004] Designers usually manually draw facilities such as tracks, stations, and signal lights in modeling tools according to the actual situation of the railway system. This method requires high experience and skills of designers and takes a lot of time to complete scene layout and adjustment work. However, this manual method has the following significant disadvantages:
[0005] Low efficiency: The position of each railway element needs to be calculated one by one and placed manually, which is time-consuming and laborious.
[0006] Error-prone: Due to the lack of an automatic verification mechanism, the railway elements arranged manually may not meet industry standards, such as too small a radius of the track curve, insufficient signal light spacing, misalignment between the platform and the track, etc.
[0007] Difficult to expand: When the railway topological structure changes (such as adding new nodes or adjusting connection relationships), the scene needs to be adjusted from scratch, resulting in repetitive labor.
[0008] 2. Auxiliary design with existing scene construction tools
[0009] Some commercial or open-source tools (such as Unreal Engine 4, abbreviated as UE4) provide basic functions for scene construction, and users can complete part of the scene construction by dragging and dropping models. These tools reduce the modeling burden to a certain extent, but still have the following limitations:
[0010] Lack of dedicated functions in the railway field: The existing tools are designed in a general way and cannot automatically generate layouts according to railway topological relationships. Users still need to manually adjust the positions of railway elements.
[0011] Random layout: Some tools support basic automatic layout functions, but the generated results lack consideration of railway industry standards, such as random distribution of signal light positions and non-standard track spacing.
[0012] No dynamic update mechanism: Once the scene is generated, adjusting the topological structure or adding new elements requires re-design, and real-time updates cannot be achieved, resulting in high work repetition.
[0013] Therefore, it is desirable to have a technical solution to solve or at least mitigate the above deficiencies of the existing technology. Summary of the Invention
[0014] The objective of the present invention is to provide an automatic scene generation method based on railway topological relationships to at least solve one of the above technical problems.
[0015] Glossary of terms:
[0016] 1. Railway topological relationship: Refers to the relative positional relationship and structural layout among facilities such as tracks, stations, and signal lights in the railway system, usually represented in the form of nodes and connecting edges.
[0017] 2. Static mesh: In 3D modeling, it is a model used to represent fixed structures, such as tracks, stations, and signal lights.
[0018] 3. Automatic scene generation: Based on the parsed railway topological relationships, for example, automatically generating railway scenes in the Unreal Engine (UE4) through Python scripts to replace manual modeling.
[0019] The present invention provides the following solutions:
[0020] According to one aspect of the present invention, there is provided an automatic scene generation method based on railway topological relationships, and the automatic scene generation method based on railway topological relationships includes:
[0021] Generating topological relationship data in the form of a UML class diagram;
[0022] Converting the data structure of the topological relationship data in the form of a UML class diagram to obtain standardized format data;
[0023] Obtaining a railway element library;
[0024] Calculating the position information of each facility element according to the standardized format data and the railway element library, and performing scene layout according to the position information of each facility element, thereby generating railway scene information including each facility element.
[0025] Optionally, the generating of topological relationship data in the form of a UML class diagram includes:
[0026] Obtaining the topological relationship input by the user, where the topological relationship includes the relative positions, connection relationships, and attributes of each facility element;
[0027] Generating topological data according to the obtained relative positions, connection relationships, and attributes of each facility element;
[0028] Generating topological relationship data in the form of a UML class diagram according to the obtained topological data.
[0029] Optionally, the railway element library includes a track element geometric model, a station element geometric model, a signal light element geometric model, and a turnout element geometric model.
[0030] Optionally, calculating the position information of each facility element according to the standardized format data and the railway element library, and performing scene layout according to the position information of each facility element, so as to generate railway scene information including each facility element, includes:
[0031] Generating a track path using a B-spline curve;
[0032] Calculating the positions of the station element geometric model, the signal light element geometric model, the turnout element geometric model, and the foreign object model according to the track path.
[0033] Optionally, the generating a track path using a B-spline curve includes:
[0034] Collecting the spatial coordinates (including longitude, latitude, and elevation) of each key position point (such as turnouts, stations, etc.) on the track. Establishing bidirectional connection edges based on the node spatial positions to form a track network adjacency list structure. Requiring track centerline data, topological structure data, sliding window size, and Gaussian smoothing parameters.
[0035] Optionally, the calculating the position of the signal light element geometric model according to the track path includes:
[0036] Obtaining track terrain information;
[0037] Obtaining the type information of the signal light element geometric model at each position;
[0038] Setting total offset information for the signal light element geometric model at each position respectively according to the type information of the signal light element geometric model at each position;
[0039] Placing each signal light element geometric model on the track path according to the calculated total offset information.
[0040] Optionally, the track terrain information includes curvature information, slope information, and special area information; where
[0041] The curvature information includes: for each data point, determining the window range around it, calculating the first and second derivatives of the x, y, z coordinates within this range, and calculating the curvature using the curvature formula;
[0042] The slope information includes: calculating the slope using the adjacent point difference method;
[0043] The special area information includes: respectively setting curvature thresholds and slope thresholds, and screening out points with high curvature and high slope. Merging consecutive qualified points into areas, and recording the start and end positions of each area.
[0044] Optionally, setting the total offset information for the signal light element geometric models at each position according to the type information of the signal light element geometric models at each position includes:
[0045] Performing the following operations on the signal light element geometric models at each position:
[0046] Obtain a basic offset database, where the basic offset database includes at least one preset type information and the corresponding basic offset for each preset type information;
[0047] Obtain the basic offset corresponding to the preset type information that is the same as the type information of the signal light element geometric model;
[0048] Calculate the braking distance information according to the train basic information and the slope information;
[0049] Obtain the total offset according to the track terrain information and the basic offset.
[0050] Optionally, calculating the position of the foreign object model according to the track path includes:
[0051] Generate the position of the foreign object model according to the track path;
[0052] Generate an update probability for the foreign object model at each foreign object model position.
[0053] This application also provides an automatic scene generation device based on railway topological relationships. The automatic scene generation device based on railway topological relationships includes:
[0054] A UML class diagram form topological relationship data generation module, which is used to generate UML class diagram form topological relationship data;
[0055] A conversion module, which is used to perform data structure conversion on the UML class diagram form topological relationship data to obtain standardized format data;
[0056] A railway element library acquisition module, which is used to acquire a railway element library;
[0057] A scene establishment module, which is used to calculate the position information of each facility element according to the standardized format data and the railway element library, and perform scene layout according to the position information of each facility element, so as to generate railway scene information including each facility element.
[0058] The automatic scene generation method based on railway topological relationships in this application realizes the automatic generation of the geometric layout and attribute assignment of railway elements in the scene by creating and parsing railway topological relationships (including nodes, edges and their attributes), ensuring the consistency of the scene with the actual railway operation rules. Brief Description of the Drawings
[0059] Figure 1 is a schematic flowchart of an automatic scene generation method based on railway topological relationships in an embodiment of the present application.
[0060] Figure 2 is a schematic diagram of the generation of track elements in an embodiment of the present application.
[0061] Figure 3 is a schematic diagram of the railway modeling effect in an embodiment of the present application.
[0062] Figure 4 is a schematic diagram of the railway modeling effect in another embodiment of the present application. Detailed Description of the Embodiment
[0063] Next, the technical solution of the present invention will be clearly and completely described in conjunction with the accompanying drawings. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0064] As Figure 1 shown, the automatic scene generation method based on railway topological relationships includes:
[0065] Generate topological relationship data in the form of a UML class diagram;
[0066] Perform data structure conversion on the topological relationship data in the form of a UML class diagram to obtain data in a standardized format;
[0067] Obtain a railway element library;
[0068] Calculate the position information of each facility element according to the standardized format data and the railway element library, and perform scene layout according to the position information of each facility element, so as to generate railway scene information including each facility element.
[0069] The automatic scene generation method based on railway topological relationships of the present application realizes the automatic generation of the geometric layout and attribute assignment of railway elements in the scene by creating and parsing railway topological relationships (including nodes, edges and their attributes), ensuring the consistency of the scene with the actual railway operation rules.
[0070] In this embodiment, the generation of topological relationship data in the form of a UML class diagram includes:
[0071] Obtain the topological relationship input by the user, where the topological relationship includes the relative positions, connection relationships, and attributes of each facility element; specifically, the user can manually input the railway topology description through a graphical interface (such as the graphical interface in Unreal Engine). The topological relationship includes the relative positions, connection relationships, and attributes of elements such as stations, tracks, and signal lights. For example, the user creates a railway topology structure by dragging nodes (such as stations, tracks, signal lights, etc.) and connecting lines (representing the connection relationships between facilities) on the graphical interface. For example, the user drags a station node onto the graph and connects the track to the station through a line, representing the topological relationship between the station and the track. The user can define specific attributes (such as the length of the track, the capacity of the station, the type of signal light, etc.) for each facility node through an interactive input box. These attributes will be parsed by the system and used as the characteristic data of the facility. The system provides real-time feedback. When the user makes modifications on the graphical interface, the topology graph will be updated immediately, showing the changes of the facilities and the connection relationships, ensuring that the user can intuitively see the adjustments made.
[0072] Generate topological data based on the obtained relative positions, connection relationships, and attributes of each facility element; specifically, after the user inputs the topological relationship, the system converts this information into a standardized internal data structure and generates a topological relationship based on the UML modeling method. The specific implementation includes:
[0073] Facility type definition: The system defines different types of facilities (such as stations, tracks, signal lights, etc.) as "classes" in the UML class diagram. Each class node represents a facility, and the attributes of the class represent the characteristic information of the facility (such as the length of the track, the color of the signal light, etc.).
[0074] Relationship modeling: The connections between facilities (such as the relationship between the track and the station, the signal light and the track) are represented by association relationships (Association) in the class diagram. These association relationships are represented by lines with arrows, indicating the connection direction and dependency relationship between the facilities.
[0075] Sequence diagram and state diagram: When considering the dynamic behavior of facilities (such as the state change of signal lights, the train operation path, etc.), the system will automatically generate a sequence diagram and a state diagram to simulate the dynamic interaction between facilities. For example, the sequence relationship of the signal light state change can be represented by a sequence diagram, and the change of the train driving trajectory can be expressed by a state diagram.
[0076] Generate topological relationship data in the form of a UML class diagram based on the obtained topological data; for example, the system (such as the Unreal Engine) automatically generates a UML class diagram and its associated relationships according to the topological data input by the user to form a standardized topological model. Each facility (such as a track, a station, a signal light) is used as a node (class) in the UML diagram, and the connection relationships between them are represented by an association diagram. Automatically generate a relationship diagram: by parsing the input topological data (such as nodes and connections), the system can automatically identify the relationships between facilities and generate a complete topological relationship diagram.
[0077] In this embodiment, the conversion into a standardized format can be achieved through the following methods:
[0078] Standardized data structure: The system converts the topological data into a standardized data structure (such as Python objects, dictionaries, or custom classes). For example, facilities such as stations, tracks, and signal lights are represented as instances of classes, and each instance contains attributes and connection relationships. The edges of the topological graph represent the connections between facilities, and the nodes represent individual facilities.
[0079] Definition of nodes and edges:
[0080] Nodes: Railway facilities such as stations, tracks, signal lights, etc.
[0081] Edges: The connection relationships between facilities, such as the connections between tracks and stations, and between tracks and signal lights.
[0082] The system outputs the standardized topological model in a format that can be used by other tools or simulation platforms (such as XMI files, JSON, or XML formats). This process enables the data to be conveniently exchanged and shared, facilitating subsequent application or editing in other systems.
[0083] In one embodiment, the railway element library includes a track element geometric model, a station element geometric model, a signal light element geometric model, and a turnout element geometric model.
[0084] In this embodiment, calculate the position information of each facility element according to the standardized format data and the railway element library, and perform a scene layout according to the position information of each facility element, so as to generate railway scene information including each facility element, including:
[0085] Generate a track path using a B-spline curve, Figure 2 For the track path established in one embodiment;
[0086] Calculate the positions of the station element geometric model, the signal light element geometric model, the turnout element geometric model, and the foreign object model according to the track path.
[0087] In this embodiment, the generating a track path using a B-spline curve includes:
[0088] Step 1: Define control points and design parameters
[0089] Control points:
[0090] Control points are key nodes of the track path, usually including the starting point, the ending point, and intermediate key positions. Each control point has 3D spatial coordinates P i (x i , y i , z i ).
[0091] In actual operation, control points are obtained from track design documents, measuring devices (such as lidar), or GPS data.
[0092] Design parameters:
[0093] Minimum curvature radius: The minimum radius at the track turning, which affects the bending degree of the curve.
[0094] Track width: The width requirements on both sides of the track.
[0095] Other geometric constraints, such as maximum gradient, switch position, etc.
[0096] Step 2: Select knot vector and parameterization
[0097] Knot vector:
[0098] The knot vector T = {t0, t1, t2,..., t m} is the knot vector of the B-spline curve, which defines the parameterization interval and is used to define the parameterization of the B-Spline curve.
[0099] The size of the knot vector determines the smoothness of the curve and the number of control points. Usually, the knot vector is automatically generated according to the design requirements and has a uniform distribution or a non-uniform distribution.
[0100] For example, a simple knot vector may be as follows:
[0101] T = {0, 0, 0, 1, 1, 1}
[0102] This means that the B-Spline curve has 3 control points, and the knots at both ends are repeated (to ensure that the curve starts from the first control point and ends at the last control point).
[0103] Parameterization of the curve:
[0104] The curve is parameterized through the interpolation function N i , k(t), and is defined based on the relationship between the knot vector and the control points.
[0105] Step 3: Calculate B-Spline basis functions
[0106] Calculate basis functions:
[0107] The basis function N i , k(t) defines the influence range of the curve at each control point. It is recursively defined based on the knot vector and the positions of the control points.
[0108] For k = 0 (i.e., linear B-Spline), the basis function is defined as:
[0109]
[0110] For k > 1 (i.e., higher-order B-Spline), the basis function is recursively defined as:
[0111]
[0112] This recursive process calculates higher-order basis functions from the basis functions of the previous order.
[0113] Calculate control point weights:
[0114] The weight w i is the value associated with each control point P i and is usually set to 1, but can be adjusted according to design requirements, especially when considering non-uniform B-Splines.
[0115] Step 4: Generate the trajectory path
[0116] Trajectory path generation:
[0117] The trajectory path generated by the B-Spline curve is:
[0118]
[0119] where P(t) is the three-dimensional coordinate of the trajectory path at parameter t, P i is the control point, w i is the weight of the control point, and N i,k(t) is the calculated basis function.
[0120] Step 5: Curvature calculation and optimization
[0121] Calculate curvature:
[0122] The curvature κ(t) of the trajectory path represents the degree of curve bending, and the calculation formula is:
[0123]
[0124] where r(t) = (x(t), y(t), z(t)) is the position vector (location vector) of the track path at the parameter and r'(t) and r''(t) are the first and second derivatives of the position vector r(t), respectively.
[0125] Step 6: Integrate with Unreal Engine 4 (UE4)
[0126] Map the track path to the UE4 Spline component:
[0127] Map the discrete points P(t0), P(t1),... generated by the B-Spline curve to the Spline component in Unreal Engine 4 to ensure the geometric accuracy of the track path in the virtual environment.
[0128] Visualization and adjustment:
[0129] In UE4, use the Spline component to display the track path and adjust the appearance and behavior of the path according to actual needs to ensure that the track meets the design standards.
[0130] In this embodiment, the sliding window size: The sliding window is used to smooth the track path to ensure the continuity of the track path and the smoothness of the curve. The size of the sliding window is determined by the curvature of the track and the complexity of the track layout. Generally, the window size can be dynamically adjusted according to the curvature change of the track to ensure the fitting effect of the B-spline curve. The selection of the window size is optimized through trial and error analysis and is usually set to a fixed distance (such as 50 meters or 100 meters) on the track path.
[0131] Gaussian smoothing parameter: It is used to further smooth the track path and eliminate the mutations caused by measurement errors or path complexity. Gaussian smoothing is a common curve smoothing method, and the Gaussian kernel function therein is used to weight the surrounding points to smooth the track path. Specifically, the standard deviation (σ) is used as the key parameter for smoothing, and the selection of σ is set according to the accuracy requirements of the track and the error range of the measurement equipment used.
[0132] In this embodiment, a bidirectional connection edge can be established based on the node spatial position to form the adjacency list structure of the track network. Specifically:
[0133] For each collected key position point (such as turnout, station, etc.), calculate the Euclidean distance of its spatial coordinates to establish the connection between nodes, and use the bidirectional connection edge to represent the interdependence between different facility elements. For example, the connection between the station and the track, the connection between the signal light and the turnout, etc.
[0134] Adopt the adjacency matrix or adjacency list structure in graph theory to store these connection relationships, and use the Dijkstra algorithm to calculate the paths between different nodes.
[0135] In this embodiment, calculating the position of the signal lamp element geometric model according to the track path includes:
[0136] Obtaining track terrain information;
[0137] Obtaining the type information of the signal lamp element geometric model at each position;
[0138] Setting total offset information for the signal lamp element geometric model at each position respectively according to the type information of the signal lamp element geometric model at each position;
[0139] Placing each signal lamp element geometric model on the track path according to the calculated total offset information.
[0140] In this embodiment, the track terrain information includes curvature information, slope information, and special area information; among them,
[0141] The curvature information includes: for each data point, determining the window range around it, calculating the first and second derivatives of the x, y, and z coordinates within this range, and calculating the curvature using the curvature formula;
[0142] The slope information includes: calculating the slope using the adjacent point difference method;
[0143] The special area information includes: respectively setting a curvature threshold and a slope threshold, screening out points with high curvature and high slope. Merging continuous qualified points into areas, and recording the start and end positions of each area.
[0144] In this solution, a "data point" refers to discrete points on the track path, which are obtained through sensors (such as lidar, GPS, track surveying instruments, etc.). Each data point contains the spatial coordinates (x, y, z) of this position, where x and y are planar coordinates and z is the elevation coordinate. Data points are usually discretized samples of the track center line and can be obtained through track design documents or laser scanning data.
[0145] When calculating the curvature of each data point, it is first necessary to calculate the first derivative (i.e., the change rate of the tangent) and the second derivative (i.e., the change rate of the acceleration) of the track path within this window range. Then use the curvature formula of the track path to calculate the curvature of each data point. Specifically, for a planar curve, the calculation formula for the curvature κ is:
[0146] where x′ and y′ are the first derivatives of the track path in the x and y directions, and x″ and y″ are the second derivatives of the track path in the x and y directions.
[0147] Calculating the slope using the adjacent point difference method:
[0148] 1. Obtain track data points:
[0149] Collect the spatial coordinates of multiple data points on the track path.
[0150] 2. Calculate the height difference between adjacent data points:
[0151] Calculate the height difference between adjacent points through the following steps:
[0152] Δz = z i+1 - z i
[0153] where Δz represents the elevation difference between adjacent data points (unit: meter).
[0154] 3. Calculate the horizontal distance difference:
[0155] Between adjacent two points, calculate the distance difference between them on the horizontal plane (i.e., the distance on the x - y plane), and this distance can be calculated by the Euclidean distance formula:
[0156]
[0157] where Δd represents the horizontal distance difference between adjacent data points (unit: meter)
[0158] 4. Calculate the slope:
[0159] Based on the calculated height difference Δz and horizontal distance difference Δd, calculate the slope:
[0160]
[0161] where θ represents the slope angle;
[0162] Special areas are regions where, under certain specific conditions, the geometric features of the track (such as curvature and slope) exceed the normal range. There may be some specific safety or operation problems in these areas.
[0163] Special areas do not mean that signals cannot be set. In some cases, special areas may require additional signals or warning facilities. For example: at high slopes or sharp curves, speed limit signals may need to be set up; warning signals such as "Dangerous Curve" or "Steep Slope Warning" may also need to be set up in special areas.
[0164] In this embodiment, the placement of signals: The layout of the signals comprehensively considers multiple factors such as the track slope, track curvature, train running speed, and braking distance. The main purpose of the algorithm is to analyze the given track terrain data and place signals on the track, taking into account the curvature and slope of the terrain.
[0165] In this embodiment, setting the total offset information for the geometric models of the signal elements at each position according to the type information of the geometric models of the signal elements at each position includes:
[0166] Performing the following operations on the geometric models of the signal elements at each position:
[0167] Obtain a basic offset database, where the basic offset database includes at least one preset type information and the basic offset corresponding to each preset type information;
[0168] Obtain the basic offset corresponding to the preset type information that is the same as the type information of the geometric model of the signal element;
[0169] Calculate the braking distance information according to the basic train information and the slope information; in this embodiment, the basic train information refers to various basic information of the facility elements stipulated by the national standard. For example, the positions and attributes of each facility (such as platform length, signal light position, etc.) are arranged according to the railway industry standard.
[0170] Obtain the total offset according to the track terrain information and the basic offset.
[0171] Determine the signal light type: According to the function of the signal light (such as in - station, out - station, turnout, main signal light), set a basic offset (d base ) for each type of signal light.
[0172] Offset caused by curvature and slope
[0173] The slope adjustment amount is calculated by the formula:
[0174]
[0175] where Δd gradient represents the offset caused by the track slope, θ represents the slope angle, e represents the natural constant, k g1 and k g2 represent the slope influence coefficients, which are determined coefficients based on the railway industry standard.
[0176] The curvature adjustment amount is calculated by the formula:
[0177] Δd curvature =k c ·k
[0178] where Δd curvature represents the offset caused by the track curvature, k represents the curvature, and k c represents the curvature influence coefficient, which is a determined coefficient set according to safety specifications.
[0179] Braking distance calculation: Considering the basic deceleration and response time of the train, as well as the slope information in the analysis area, the braking distance is dynamically calculated. Considering the basic deceleration and response time of the train, as well as the slope information in the analysis area, the braking distance is dynamically calculated. The specific formula is as follows:
[0180] a adjust = a base + g·sinθ
[0181]
[0182] Where, a adjust represents the adjusted deceleration considering the influence of the slope, represents the average adjusted deceleration, a base represents the basic braking deceleration (unit: m / s 2 ), g represents the acceleration due to gravity, which is 9.8 m / s 2 , Δd braking represents the braking distance (the distance traveled by the train from the start of braking to a complete stop), v represents the designed speed of the train (unit: meters per second), t response represents the system response time (unit: seconds).
[0183] Calculating the offset: Combining factors such as track slope, curvature, expected train speed, and braking distance, use the following formula to calculate the total offset (d offset ) of the signal lights to ensure that the distance between signal lights meets the minimum spacing requirements:
[0184] d offset = d base + Δd gradient + Δd curvature + Δd braking ;
[0185] Where, d offset represents the total offset of the signal lights, d base represents the basic offset, Δd gradient represents the offset caused by the track slope, Δd curvature represents the offset caused by the track curvature, Δd braking represents the braking distance.
[0186] · Signal light placement: Place the signal lights on the track according to the calculated total offset. At the same time, check whether the placed signal lights meet the requirements such as at least 80 meters between turnout signal lights and at least 120 meters between signal lights.
[0187] In this embodiment, the calculating the position of the foreign object model according to the track path includes:
[0188] Generate the foreign object model positions according to the rail path;
[0189] Generate an update probability for the foreign object models at each foreign object model position.
[0190] Specifically, the foreign object intrusion probability model aims to simulate foreign object intrusion scenarios by analyzing the risk probabilities and location rules in different regions, enhance the diversity and authenticity of the scenarios, and then evaluate their impact on railway operation safety. The core process of this model includes two steps: generating foreign object positions and updating probabilities:
[0191] (1) Generate foreign object positions: Predetermine high-risk regions (such as curves, slopes, level crossings) and their initial intrusion probabilities, and at the same time associate regional characteristics (such as the surrounding population density, vegetation coverage rate) with the likelihood value of intrusion risk. Traverse each key region and generate a random number R ∈ [0, 1]. If R is less than the intrusion probability of the current region, randomly generate foreign object coordinates within the boundary constraints of this region, add them to the list, record the intrusion event, and trigger probability update.
[0192] (2) Update probabilities: Update the intrusion history of the region based on the foreign object positions, and dynamically adjust the regional probability by means of Bayes' theorem, so that the model can timely reflect the actual risk changes. Calculate the posterior probability based on the historical intrusion data: Let the existence state of a certain regional characteristic be F (taking values of True or False), and its prior probability be P(F). When the characteristic F is detected, update the intrusion probability of this region according to the following formula:
[0193] where P(F) = P(F|intrusion)·P(intrusion) + P(F|non - intrusion)·(1 - P(intrusion)).
[0194] Among them, F represents the existence state (Boolean variable) of a specific characteristic in a certain region. P represents the general symbol of probability. P(F) represents the prior probability of the existence of regional characteristic F. P(intrusion) represents the prior probability of an intrusion event occurring in this region, and its initial value is the preset initial intrusion probability; P(F|intrusion) represents the probability of the existence of regional characteristic F in the case of an intrusion event; P(F|non - intrusion) represents the probability of the existence of regional characteristic F in the case of no intrusion event; P(intrusion|F) is the updated intrusion probability of this region when the characteristic F exists.
[0195] In this embodiment, the automatic scenario generation method based on the railway topology relationship of the present application further includes:
[0196] A step of performing constraint verification after establishing the railway scenario information, specifically, ensuring that the generated scenario conforms to the predetermined topology rules and railway operation specifications. The specific methods include:
[0197] Geometric verification:
[0198] Track and platform alignment: Check the alignment of the platform and the track to ensure that the distance between the platform and the track complies with the regulations.
[0199] Minimum radius verification of curved tracks: Ensure that the curve radius of the track complies with the railway design specifications to avoid unsafe turns.
[0200] Signal light position verification: Ensure that the distance between the signal light and the track complies with safety standards to avoid overlap or unreasonable configuration between the signal light and the track.
[0201] Logical verification:
[0202] Topological consistency: Check whether the connections between tracks are correct to ensure that the connections between tracks, stations, and signal lights comply with topological rules.
[0203] Automatic correction: When the verification fails, the system can automatically adjust the layout or prompt the user to correct it. For example, when the distance between tracks is too close, the system will automatically increase the distance and adjust the track path to ensure compliance with the specifications.
[0204] In this embodiment, the automatic scenario generation method based on railway topological relationships of the present application further includes:
[0205] Store the railway topological model, scenario element configuration, and user modification records.
[0206] In this embodiment, storing the railway topological model, scenario element configuration, and user modification records specifically includes:
[0207] Model storage:
[0208] Database storage: Store the generated railway topological model and scenario configuration in the database for storing nodes, edges, and their attribute information.
[0209] File storage: In addition to database storage, it also supports saving the model and configuration in formats such as JSON and XML as files for easy import and export.
[0210] Data backup and export:
[0211] Support backing up the scenario and topological data as a portable file format and ensuring the integrity of the data.
[0212] In this embodiment, the railway scenario information of the present application can automatically generate a visual scenario through a virtual simulation platform (such as UE4).
[0213] Specifically, according to the parsed railway scenario information including various facility elements, generate a Python script and use the UE4 API to automatically generate the scenario.
[0214] Scenario Export and Verification:
[0215] Convert the generated scenario data into formats supported by UE4 (such as FBX, UAsset), and load it into UE4 through Python scripts to automatically generate a complete railway scenario.
[0216] This application has the following advantages over the prior art:
[0217] 1. Automatic Scenario Generation Method Based on Railway Topological Relationships
[0218] By creating and parsing railway topological relationships (including nodes, edges, and their attributes), realize the automatic generation of the geometric layout and attribute assignment of railway elements in the scenario, ensuring the consistency between the scenario and the actual railway operation rules. In particular, by using algorithms such as B-spline curves to accurately generate the track path, avoid manual dragging modeling, reduce manual intervention, and improve the generation efficiency and accuracy.
[0219] 2. Standardized Representation of Railway Topological Data
[0220] The present invention converts railway topological relationships into standardized data formats such as UML models, XML, JSON, etc., enabling the interoperability and sharing of railway system modeling among different simulation platforms and systems. The standardized topological data can simplify the construction of railway simulation systems and improve efficiency.
[0221] 3. High-Fidelity Scenario Output Method for Railway Simulation Platforms
[0222] Provide a method to convert railway topological models and scenario elements into high-fidelity simulation scenario files (compatible with platforms such as UE4), ensuring that the generated scenarios can be directly used for simulation testing and visual display. It can perform railway simulation testing more efficiently, saving the time of manual modeling and scenario construction, while ensuring the accuracy and consistency of the scenario layout.
[0223] 3. Implementation Effects and Example Demonstration
[0224] See Figure 3 , Example 1: Generate a scenario where two parallel tracks are connected in a tunnel
[0225] Topological Description: Define a tunnel that contains two parallel tracks. Each end of each track is connected to a station, and signal lights are set beside the station. The layout of the tracks in the scenario follows the standards of the railway industry to ensure that the spacing between the tracks meets the regulations.
[0226] Result: The system automatically generates a scenario containing platforms, tracks, and signal lights, and the layout meets the standards.
[0227] Effect diagram: An effect diagram of a railway scene automatically generated by the system, including the layout of platforms, tracks, and signal lights.
[0228] See Figure 4 , Example 2: Generate a railway scene with parallel tracks, stations, and intersections
[0229] Topological description: Define a scene containing two parallel tracks that connect to an intersection in the front. Signal lights are set between the two tracks, a station is located beside the tracks, and there is a train passing through the intersection on one of the tracks.
[0230] Result: The system automatically generates a railway scene containing two parallel tracks, a station, an intersection, and signal lights. The train travels through the intersection, the signal lights are arranged at standard intervals between the tracks, and the overall scene layout complies with railway operation and safety regulations.
[0231] Effect diagram: An effect diagram of a railway scene, including the specific layout of two parallel tracks, a station, signal lights, train movement, and an intersection
[0232] This application also provides an automatic scene generation device based on railway topological relationships. The automatic scene generation device based on railway topological relationships includes a topological relationship data generation module in the form of a UML class diagram, a conversion module, a railway element library acquisition module, and a scene establishment module. Among them,
[0233] The topological relationship data generation module in the form of a UML class diagram is used to generate topological relationship data in the form of a UML class diagram;
[0234] The conversion module is used to perform data structure conversion on the topological relationship data in the form of a UML class diagram to obtain standardized format data;
[0235] The railway element library acquisition module is used to acquire a railway element library;
[0236] The scene establishment module is used to calculate the position information of each facility element according to the standardized format data and the railway element library, and perform scene layout according to the position information of each facility element, so as to generate railway scene information including each facility element.
[0237] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. An automatic scene generation method based on railway topological relationship, characterized in that: The automatic scene generation method based on railway topological relationship includes: Generate topological relationship data in the form of UML class diagram; Performing data structure conversion on the topological relationship data in the form of the UML class diagram, thereby obtaining standardized format data; Get the railway element library; The location information of each facility element is calculated according to the standardized format data and the railway element library, and the scene layout is performed according to the location information of each facility element, so as to generate railway scene information including each facility element.
2. The automatic scene generation method based on railway topological relationship according to claim 1, characterized in that: The generating of topological relationship data in the form of UML class diagram includes: Acquire the topological relationship input by the user, wherein the topological relationship includes the relative position, connection relationship and attributes of each facility element; Generate topological data based on the relative positions, connection relationships and attributes of each facility element obtained; Generate topological relationship data in the form of UML class diagram based on the acquired topological data.
3. The automatic scene generation method based on railway topological relationship as claimed in claim 2, characterized in that: The railway element library includes a track element geometric model, a station element geometric model, a signal light element geometric model, and a turnout element geometric model.
4. The automatic scene generation method based on railway topological relationship according to claim 3 is characterized in that: The calculating of the location information of each facility element according to the standardized format data and the railway element library, and performing scene layout according to the location information of each facility element, thereby generating railway scene information including each facility element includes: Generate track paths using B-spline curves; The positions of the station element geometric model, signal light element geometric model, turnout element geometric model and foreign object model are calculated according to the track path.
5. The automatic scene generation method based on railway topological relationship according to claim 4, characterized in that: The use of the B-spline curve to generate a track path includes: Define control points and design parameters, the control points include the starting point, the end point and the intermediate key position; the design parameters include the minimum radius of curvature, track width, maximum slope, and turnout position; Select node vectors and parameterization; Calculate B-Spline basis functions; Calculate the control point weights; A track path is generated based on the control points and design parameters, node vectors and parameterization, B-Spline basis functions, and control point weights.
6. The automatic scene generation method based on railway topological relationship according to claim 5, characterized in that: Calculating the position of the geometric model of the signal light element according to the track path includes: Get track terrain information; Obtain the type information of the geometric model of the signal light element at each position; Total offset information is set for the signal light element geometric model at each position according to the type information of the signal light element geometric model at each position; According to the calculated total offset information, each signal light element geometric model is placed on the track path.
7. The automatic scene generation method based on railway topological relationship according to claim 6, characterized in that: The track terrain information includes curvature information, slope information, and special area information; wherein, The curvature information includes: for each data point, determining the window range around it, calculating the first-order and second-order derivatives of the x, y, and z coordinates within the range, and calculating the curvature using the curvature formula; The slope information includes: calculating the slope using an adjacent point difference method; The special area information includes: setting a curvature threshold and a slope threshold respectively, screening out points with high curvature and high slope, merging continuous points that meet the conditions into areas, and recording the start and end positions of each area.
8. The automatic scene generation method based on railway topological relationship according to claim 7, characterized in that: The step of respectively setting the total offset information for the signal light element geometric model at each position according to the type information of the signal light element geometric model at each position comprises: Perform the following operations for the signal light element geometry at each location: Acquire a basic offset database, wherein the basic offset database includes at least one preset type of information and a basic offset corresponding to each preset type of information; Acquire a basic offset corresponding to preset type information that is the same as the type information of the signal light element geometric model; Calculate braking distance information based on basic train information and slope information; The total offset is obtained according to the track terrain information and the basic offset.
9. The automatic scene generation method based on railway topological relationship according to claim 8, characterized in that: Calculating the position of the foreign body model according to the track path includes: generating a foreign body model position according to the track path; Generate updated probabilities for the foreign body models at each foreign body model location.
10. An automatic scene generation device based on railway topological relationship, characterized in that: The automatic scene generation device based on railway topological relationship includes: A UML class diagram form topology relationship data generation module, wherein the UML class diagram form topology relationship data generation module is used to generate UML class diagram form topology relationship data; A conversion module, the conversion module is used to perform data structure conversion on the topological relationship data in the form of the UML class diagram, so as to obtain standardized format data; A railway element library acquisition module, wherein the railway element library acquisition module is used to acquire a railway element library; The scene establishment module is used to calculate the location information of each facility element according to the standardized format data and the railway element library, and to perform scene layout according to the location information of each facility element, so as to generate railway scene information including each facility element.
Citation Information
Cited By
Railway construction simulation model generation method based on full-line design parameters
CN120745261A
A railway construction simulation model generation method based on full-line design parameters
CN120745261B
Method and system for generating ground environment model along subway and electronic equipment
CN120850619A