A route generation method based on constraint inference

By constructing sets of positive and difficult negative samples, calculating the basic credibility, and performing hard constraint elimination and soft constraint weight reduction, combined with two-stage decoding and bitmap verification, the problems of low efficiency and high false alarm rate in railway station route generation are solved, and efficient and accurate route generation is achieved.

CN122232696APending Publication Date: 2026-06-19BEIJING JIAOTONG UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING JIAOTONG UNIV
Filing Date
2026-03-31
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing technologies suffer from low efficiency, high false alarm rate, and large invalid search space in railway station route generation, making it difficult to effectively combine existing data patterns with railway station constraints.

Method used

A path generation method based on constraint inference is adopted. By constructing a set of positive samples and difficult negative samples, the basic confidence is calculated. Then, hard constraint elimination and soft constraint weighting are used, combined with a two-stage decoding strategy to generate candidate paths that meet local and global constraints. Finally, a bitmap verification mechanism is used for global verification.

Benefits of technology

It significantly reduces computational complexity and false alarm rate, and improves the accuracy and efficiency of route inference, making it particularly suitable for complex railway throat areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122232696A_ABST
    Figure CN122232696A_ABST
Patent Text Reader

Abstract

This invention provides a route generation method based on constraint inference, relating to the fields of railway transport organization and railway signal interlocking technology. The method involves: acquiring existing route sequence data and a set of route generation constraints for railway stations; constructing a positive sample set based on the existing route sequence data and a difficult negative sample set based on the station topology; calculating the basic reliability of connections between nodes within the station; calibrating the basic reliability using the set of route generation constraints to generate candidate connections and their calibrated reliability; generating path prefixes based on the candidate connections and their calibrated reliability to obtain candidate routes; mapping the candidate routes to a route bitmap and performing global verification to obtain the potential routes that pass the verification. This invention solves the problems of disconnect between the scoring model and constraints, large invalid search space, and high false alarm rate for high-risk connections in existing technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of railway transport organization and railway signal interlocking technology, and in particular to a route generation method based on constraint inference. Background Technology

[0002] Railway station routes are a crucial foundation for the safe and orderly operation of trains or shunting within the station yard. Route generation involves not only the physical connectivity of track sections but also strict adherence to complex interlocking constraints such as signal access conditions, directional consistency, adversarial route exclusion relationships, and coverage of critical sections.

[0003] Currently, the generation of railway station routes or the completion of interlocking tables mainly rely on the following methods: Manual compilation and review: This method relies on engineers manually compiling rules based on design specifications and experience. This approach is inefficient, and different personnel may have differing interpretations of the rules, making it difficult to guarantee consistent results.

[0004] Topology-based exhaustive search: This method performs a full path search based on the topological relationships of the station map, followed by filtering using rule filters. However, when the station area is large or the throat area has a complex structure, the number of candidate paths explodes exponentially, generating a large number of paths that are topologically reachable but invalid according to railway rules, resulting in significant waste of computational resources.

[0005] Simple matching based on historical data: Inference is made using local patterns of existing routes. However, existing methods often suffer from a disconnect between scoring and constraints, meaning that some connections that seem reasonable historically (e.g., topological adjacency) may actually violate specific hard railway constraints (e.g., directional conflicts or prohibitions). This generation-then-verification approach leads to a high false alarm rate and makes it difficult to identify seemingly high-risk connections.

[0006] In summary, existing technologies lack a route inference method that can effectively combine existing data patterns with railway station constraints, while also being computationally efficient and having a low false alarm rate. Summary of the Invention

[0007] To address the aforementioned shortcomings in existing technologies, this invention provides a path generation method based on constraint inference, which solves the problems of disconnect between the scoring model and constraints, large invalid search space, and high false alarm rate for high-risk connections in existing technologies.

[0008] To achieve the aforementioned objectives, the present invention employs the following technical solution: a path generation method based on constraint inference, comprising: S1: Obtain the existing route sequence data of railway stations and the set of route generation constraints; S2: Construct a positive sample set based on existing route sequence data, and construct a difficult negative sample set based on the station topology; S3: Calculate the basic reliability of the connection between nodes in the station based on the positive sample set and the difficult negative sample set; S4: Use the path generation constraint set to calibrate the basic credibility, and generate candidate connections and their calibrated credibility through hard constraint elimination and soft constraint weight reduction; S5: Based on candidate connections and their calibration reliability, a two-stage decoding strategy is used to generate path prefixes that satisfy local constraints, thereby obtaining candidate paths that satisfy global constraints; S6: Map candidate routes to route bitmaps, use the bitmap verification mechanism to perform global verification on the route bitmaps, obtain the potential route results that pass the verification, and complete the route generation based on constraint inference.

[0009] Furthermore, a positive sample set is constructed based on existing route sequence data; Based on the existing route sequence data and the station topology, unobserved connections that do not appear in the positive sample set are identified. Calculate the shortest topological distance of the unobserved connection in the station topology, and determine whether the start and end nodes of the unobserved connection belong to the same throat zone; Unobserved connections whose shortest topological distance is less than a preset threshold and belong to the same throat region are selected to obtain the set of difficult negative samples.

[0010] Further, the feature vector connecting the positive sample set and the difficult negative sample set is extracted; The feature vector is calculated using a pre-trained scoring model to obtain the basic reliability of the connections between nodes within the station.

[0011] Furthermore, the expression for the basic credibility is: ; in, Represents a node To the node The basic credibility of the connection; The first one representing the connection The components of each eigenvector; Indicates the first The weights corresponding to each feature vector; Indicates the bias term; This represents the normalized mapping function.

[0012] Further, S4 includes: Based on the prohibited constraints, directional constraints, and conflict constraints in the set of constraints for generating the route, a hard constraint mask is generated. The basic credibility is filtered using the hard constraint mask to eliminate connections that violate the hard constraints and retain the initial candidate connections. Based on the length constraint, key segment coverage constraint, and consistency constraint in the set of route generation constraints, calculate the soft constraint penalty term; The basic confidence of the initial candidate connection is corrected using the soft constraint penalty term to obtain the candidate connection and its calibration confidence.

[0013] Furthermore, the expression for the soft constraint penalty term is: ; in, This represents the soft constraint penalty term for the initial candidate connection; Indicates the first The degree of violation of soft constraints on the initial candidate connections; Indicates the first The penalty weight corresponding to the soft constraint; the degree of violation It is calculated based on length deviation, critical coverage insufficiency rate, and the proportion of local inconsistencies.

[0014] Furthermore, the expression for the calibration confidence level is: ; in, This indicates the calibration confidence level of the candidate connection; This is a hard constraint mask, set to 0 when the initial candidate connection violates the hard constraint, and 1 otherwise; This is the basic level of credibility; This is an enhancement term, used to characterize the enhancement value of directional consistency or historical support; This refers to the soft constraint penalty term.

[0015] Further, S5 includes: Based on the candidate connections and their calibration reliability, a constrained bundle search algorithm is used for local expansion, and local constraints are used for pruning during the expansion process to obtain path prefixes that satisfy the local constraints. Based on the path prefix and target endpoint, a heuristic search algorithm is used for global expansion, and global constraints are used for pruning during the expansion process to obtain candidate paths that satisfy the global constraints.

[0016] Furthermore, the expression for the score of the path prefix satisfying the local constraints is: ; in, Indicates path prefix The score; Indicates the edge in the path prefix Calibration reliability; To prevent tiny positive numbers whose logarithms are meaningless; This represents the cumulative constraint cost of the path prefix; This represents the heuristic distance from the end node of the path prefix to the target endpoint; and These represent the adjustment coefficients for the constraint penalty term and the heuristic distance term, respectively.

[0017] The expression for the comprehensive score of the candidate paths that satisfy the global constraints is: ; in, Indicates a complete candidate path The overall score; This represents the connection confidence term of the candidate path; This represents the constraint consistency term of the candidate path; This represents the key coverage item of the candidate path; , , These represent the corresponding weighting coefficients.

[0018] Further, S6 includes: A route bitmap is generated based on the segment sequence of the candidate routes; Obtain the pre-generated forbidden bitmap, collision bitmap, and key overlay mask; Perform a bitwise AND operation between the route bitmap and the forbidden bitmap and the conflict bitmap respectively to obtain the bitwise AND operation result, and perform a bitwise comparison between the route bitmap and the key overlay mask to obtain the bitwise comparison result; When the bitwise AND operation result is empty and the bitwise comparison result meets the preset coverage requirement, the candidate path is determined to have passed the global verification, and the potential path result that has passed the verification is obtained, thus completing the path generation based on constraint inference.

[0019] The beneficial effects of this invention are as follows: This invention provides a path generation method based on constraint inference. Before path generation, the basic confidence level is calibrated using a set of path generation constraint conditions. Connections that violate prohibition, direction, or conflict rules are directly eliminated through hard constraint masks, and risky connections are downweighted using soft constraint penalty terms. This constraint-first strategy ensures that the subsequent two-stage decoding process is performed only on high-quality candidate connections, avoiding the generation of a large number of invalid paths (topologically reachable but prohibited by rules) from the source, significantly reducing the search space and computational complexity.

[0020] Instead of randomly selecting negative samples during sample construction, a set of difficult negative samples is specifically constructed based on the station topology, consisting of topologically adjacent connections that do not appear in existing routes. By allowing the model to learn these easily confused seemingly similar connections, the system can more accurately identify and suppress high-risk false alarms that are physically connected but logically unconnected, thereby improving the accuracy of route inference.

[0021] A two-stage strategy is adopted, which combines local decoding to generate a prefix and global decoding to generate a complete route. The first stage quickly generates short paths that satisfy local constraints, and the second stage expands towards the destination while satisfying global constraints. This hierarchical approach avoids the combinatorial explosion problem caused by directly performing a full search on long paths, and is particularly suitable for route generation in complex railway bottleneck areas.

[0022] The complex path verification logic is transformed into bitmap operations. Candidate paths are mapped to path bitmaps, and then bitwise AND / OR comparisons are performed with pre-generated forbidden bitmaps, conflict bitmaps, and key overlay masks. This mechanism leverages the computer's bit-parallel processing capabilities, enabling the completion of forbidden, conflict, and overlay checks for the entire path within a constant instruction cycle. Compared to traditional rule-by-rule matching methods, this represents an order-of-magnitude improvement in verification speed. Attached Figure Description

[0023] This specification will be further described by way of exemplary embodiments, which will be described in detail with reference to the accompanying drawings. These embodiments are not limiting; in these embodiments, the same reference numerals denote the same structures, wherein: Figure 1 This is an exemplary flowchart of a route generation method based on constraint inference, as shown in some embodiments of this specification. Detailed Implementation

[0024] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.

[0025] Example Figure 1 This is an exemplary flowchart illustrating a route generation method based on constraint inference, according to some embodiments of this specification. Figure 1 As shown, the process includes the following steps. In some embodiments, the process may be executed by a processor.

[0026] S1: Obtain the existing route sequence data of railway stations and the set of route generation constraints.

[0027] Existing route sequence data refers to the set of routes that have existed in the history of railway station operation, have been verified as legitimate, or are recorded. Each existing route data includes a route number and a sequence of sections composed of multiple track sections (such as turnout sections, turnoutless sections, tracks, etc.) arranged in an orderly manner according to the direction of train operation.

[0028] In some embodiments, the processor can obtain the data by reading historical interlocking tables, maintenance ledgers, design drawing data, or train operation logs of railway stations. The system preferably uses an integer-encoded sequence pool for storage, converting the route segment sequence into a one-dimensional integer array, and recording the starting offset and length of each route through a metadata table to obtain existing route sequence data.

[0029] In some embodiments, the processor may employ a four-layer data structure consisting of a sequence pool, a metadata table, a sparse adjacency table, and a bitmap constraint table to store massive route segment sequences in order to solve the problem of low efficiency in data storage and retrieval for large-scale station sites.

[0030] Sequence Pool (SeqPool): Writes the segment numbers of all existing routes into a one-dimensional array consecutively as integers to achieve compact storage.

[0031] RouteMeta: This table records the index information for each route. Specific fields include: route number, starting anchor point, ending anchor point, direction label, starting offset in SeqPool, sequence length, and key segment bitmap number.

[0032] Sparse adjacency list (CSRAdj): Used to store the station topology, recording the set of valid or candidate successors for each segment. Compared to dense matrices, compressed sparse row adjacency lists reduce storage space complexity from... Reduced to (in For the number of segments, (For effective connections), significantly reducing memory usage.

[0033] The RuleBitset (Bitmap Constraint Table) stores various constraints. In addition to the aforementioned static bitmaps, it also supports dynamically generating candidate path bitmaps and access bitmaps at runtime. This structure allows constraint determination to be transformed into bitwise operations, avoiding repeated parsing of text rules.

[0034] The route generation constraint set refers to the set of rules that must be followed or referenced during the route inference and generation process, and is divided into two categories: hard constraints and soft constraints. Specifically, these include: Prohibition constraints: specifying sections or connections where train passage is strictly prohibited (e.g., due to equipment failure or construction closures). Direction constraints: requiring that the train's direction of travel must be consistent with the design direction of the track circuits and signals (e.g., an up-line route cannot include a dedicated down-line section). Conflict constraints: referring to opposing routes or mutually exclusive resource occupancy relationships (e.g., intersecting routes in the same throat area cannot be established simultaneously). Length constraints: requiring that the total length of the route or the number of sections it contains be within a reasonable range (e.g., avoiding excessive detours). Critical section coverage constraints: requiring that specific types of routes must pass through certain critical nodes (e.g., departure routes must pass through the section where the departure signal is located). Consistency constraints: requiring that the attributes (such as electrification attributes, load rating) of each section within the route be consistent.

[0035] In some embodiments, the processor can pre-enter the rule base according to the railway signal design specifications and station interlocking diagram, or parse it into a bitmap matrix (such as a prohibition bitmap or a conflict bitmap) and store it to obtain a set of route generation constraints.

[0036] S2: Construct a positive sample set based on existing route sequence data, and construct a difficult negative sample set based on the station topology.

[0037] The positive sample set refers to the set of adjacent segment pairs that have actually appeared in the existing route sequence data and reflect legitimate connection relationships.

[0038] In some embodiments, the processor can traverse all existing route sequences and extract each pair of adjacent track segments. They are then labeled as positive samples, resulting in a set of positive samples.

[0039] The station topology refers to the digital representation of all track sections and their physical connections within a railway station, typically represented as a graph structure. ,in For the set of segment nodes, It is the set of physically adjacent edges.

[0040] In some embodiments, the processor can parse and generate the station topology based on the station layout plan or signal layout plan, preferably using a sparse adjacency list for storage to support fast querying of physical successor nodes in any segment.

[0041] The set of difficult negative samples refers to the set of segments that are physically adjacent or structurally similar, but do not appear in existing paths and are highly unlikely to be considered legitimate connections. These samples are used to train models to identify seemingly legitimate but incorrect connections.

[0042] In some embodiments, the processor can calculate the shortest topological distance of the connections in the station topology that do not appear in the positive sample set, filter out the connections whose distance is less than a preset threshold (e.g., 2 or 3) and belong to the same throat partition as difficult negative samples, and obtain a difficult negative sample set.

[0043] In some embodiments, to further enhance the model's ability to identify high-risk connections, the processor preferably employs a hybrid sampling strategy when constructing the set of difficult negative samples. Specifically, the set of difficult negative samples is composed of the following three parts mixed in a preset ratio: unobserved neighbor connections: connections whose topological distance is within a threshold range but do not appear in existing paths; hard constraint violation connections: connections that, although topologically adjacent, trigger at least one hard constraint (such as no-entry or direction conflict); and manually rejected backflow connections: connections that have been manually and explicitly determined to be invalid during historical review.

[0044] In some embodiments, the preferred mixing ratio of the three types of samples is 5:3:2. This ratio ensures that the model can learn common topological false alarm features while also taking into account rule boundaries and human experience, thereby obtaining a more robust discrimination boundary during training.

[0045] In some embodiments, the processor can be based on existing route sequence data and station topology maps. Automatically filter difficult negative sample sets Its initial screening set The expression is: ; in, : Indicates a connection pair consisting of any two track sections within the station area, where Starting from, The endpoint. : Indicates the station topology map From arrive The shortest topological distance (e.g., the number of segments in the middle interval). : Represents a preset topological distance threshold. In this embodiment, The preferred value is 2; for large and complex stations, the value can be relaxed to 3. : Represents the set of positive samples, that is, the set of connections that actually appeared in the existing path. This indicates that the connection never appeared in the historical data. : Indicates a segment and section They belong to the same pharyngeal region number, meaning they are located in the same pharyngeal region. : Indicates a segment arrive The direction conforms to basic physical connectivity, for example, no reverse travel occurs. Connections filtered by this expression are those that are physically adjacent (…). ), and belong to the same high-density area ( (Similar to the original), but never appeared in history, thus it is a very valuable difficult negative sample.

[0046] In some embodiments, the processor may construct a positive sample set based on existing route sequence data; determine unobserved connections that do not appear in the positive sample set based on the existing route sequence data and the station topology; calculate the shortest topological distance of the unobserved connection in the station topology and determine whether the start and end nodes of the unobserved connection belong to the same throat partition; filter out unobserved connections whose shortest topological distance is less than a preset threshold and belong to the same throat partition to obtain the difficult negative sample set.

[0047] Unobserved connections refer to connections or paths that physically exist in the station topology but have never appeared as adjacent segments in existing route sequence data.

[0048] In some embodiments, the processor can obtain unobserved connections by comparing the edge set of the station topology with the set of positive samples and taking the difference.

[0049] A "same throat zone" refers to a physical convergence area within a railway station formed by adjacent turnout groups, signal boundaries, and operating directions. Sections within the same throat zone typically have dense topological connections, making them prone to false alarms. Track sections within the same throat zone often have extremely high topological adjacency density, meaning they are physically interconnected and functionally similar in reachability, all leading to tracks or sections. However, it is precisely this similarity in local structure that makes them easily misclassified as connected by ordinary algorithms. Conversely, sections crossing different throats or belonging to independent operating areas are naturally not directly accessible; using them as negative samples would be overly simplistic and fail to approximate the true false alarm boundary. Therefore, limiting the definition to "same throat zone" forces the model to learn connectivity patterns within the most difficult-to-distinguish regions.

[0050] In some embodiments, the processor can obtain the same throat partition by using a preset region partitioning table or by performing a breadth-first search with the throat key node (such as the entrance signal) as the source point.

[0051] S3: Calculate the basic reliability of the connections between nodes within the station based on the positive sample set and the difficult negative sample set.

[0052] Basic confidence refers to the probability or confidence score of a legal connection between two segments, predicted solely based on historical data distribution and topological characteristics without considering specific constraints.

[0053] In some embodiments, the processor can input the connected feature vectors into a pre-trained scoring model to calculate the basic confidence level.

[0054] In some embodiments, the processor can extract feature vectors connecting the positive sample set and the difficult negative sample set; and use a pre-trained scoring model to calculate the feature vectors to obtain the basic credibility of the connections between nodes in the station.

[0055] Feature vectors are used to describe two segments Numerical features of the connections between nodes. Specifically, these include: Normalized co-occurrence frequency: the frequency of the connection in historical data; Predecessor / successor overlap: the number of nodes... The successor set and nodes The intersection-union ratio of the predecessor set. Topological distance decay value: arrive The reciprocal of the shortest path length or the value of the decay function. Direction consistency indicator: and Does the direction attribute match (0 or 1)? Critical section association indicator: Does the connection involve critical switches or signals?

[0056] In some embodiments, the processor can statistically extract feature vectors based on existing route sequence data and station topology. Specifically, when calculating the basic confidence level, the processor will perform a feature vector extraction for each candidate connection. Represented as eigenvectors The specific meanings and calculation methods of each characteristic component are as follows: (Normalized co-occurrence frequency): Connect The normalized value of the number of occurrences in all existing routes; (Predecessor / Successor overlap): Calculation node The successor set and nodes Jaccard similarity coefficient of the predecessor set; (Topological distance decay value): Calculated by performing a bounded breadth-first search based on the compressed sparse row adjacency list (CSRAdj). arrive shortest topological distance ,Pick or As the attenuation value; (Direction Consistency Indicator): Reads the direction label and direction constraint matrix; if... and The value is 1 if the orientation is compatible, and 0 otherwise. (Critical Section Association Indication): Use the critical section mask to determine whether the connection involves critical turnouts or signals; (Consistency of pharyngeal regions): Query the pharyngeal region number table to determine... and Whether they belong to the same pharyngeal region, if yes, it is 1, otherwise it is 0.

[0057] The scoring model is a mathematical model used to predict the underlying reliability of a connection based on its feature vectors.

[0058] In some embodiments, the processor may employ a formula ,in, For the scoring model, As weight, For characteristic components, For bias, This is the normalized mapping function. The weights are obtained by training the scoring model using positive samples as positive examples and difficult negative samples as negative examples.

[0059] In some embodiments, the expression for the basic credibility is: ; in, Represents a node To the node The basic credibility of the connection; The first one representing the connection The components of each eigenvector; Indicates the first The weights corresponding to each feature vector; Indicates the bias term; This represents the normalized mapping function.

[0060] In some embodiments, to accommodate human review feedback, the processor supports online parameter updates. When a human feedback tag is received... (When 1 indicates valid, 0 indicates invalid), the weight vector The update formula is: ; in, Represents the weight vector at the current moment; This represents the updated weight vector; Indicates the learning rate; This indicates a genuine label that has been manually verified. This represents the model's current predicted output value; This represents the feature vector of the current connection.

[0061] This formula allows the system to adjust the weights of each feature in reverse based on feedback from false positives or false negatives, making the model more accurate in subsequent inferences.

[0062] S4: Use the path to generate a set of constraints to calibrate the basic credibility. Through hard constraint elimination and soft constraint weight reduction, generate candidate connections and their calibrated credibility.

[0063] Candidate connections refer to connections that the system determines to be possible and valid after constraint calibration, serving as the search basis for subsequent path generation.

[0064] In some embodiments, the processor can perform hard constraint elimination and soft constraint weight reduction on the basic confidence level, and retain the connections with a confidence level greater than a preset threshold to obtain candidate connections.

[0065] The calibration confidence of a candidate connection refers to the connection confidence score after correction by combining railway business constraints (hard constraints and soft constraints).

[0066] In some embodiments, the processor can generate a hard constraint mask based on the prohibition constraints, direction constraints, and conflict constraints in the path generation constraint set; use the hard constraint mask to filter the basic confidence level, eliminate connections that violate the hard constraints, and retain the initial candidate connections; calculate a soft constraint penalty term based on the length constraints, key segment coverage constraints, and consistency constraints in the path generation constraint set; and use the soft constraint penalty term to correct the basic confidence level of the initial candidate connections to obtain the candidate connections and their calibration confidence levels.

[0067] A hard constraint mask is a binary variable (0 or 1) used to indicate whether a connection violates an absolute prohibition rule.

[0068] In some embodiments, the processor can query the prohibition constraint table, the direction constraint table, and the conflict constraint table. If the connection... If the path is in the prohibited list, the direction is inconsistent, or there is a hostile conflict, the mask is 0; otherwise, it is 1.

[0069] Initial candidate connections refer to the set of connections that have only been filtered by hard constraints and have not yet undergone soft constraint weight reduction.

[0070] In some embodiments, after the basic confidence level calculation is completed, the processor can eliminate connections with hard constraint masks of 0 to obtain initial candidate connections.

[0071] Soft constraint penalty terms are numerical values ​​used to quantify the degree of violation of non-absolute rules such as length, coverage, and consistency in connections.

[0072] In some embodiments, the expression for the soft constraint penalty term is: ; in, This represents the soft constraint penalty term for the initial candidate connection; Indicates the first The degree of violation of soft constraints on the initial candidate connections; Indicates the first The penalty weight corresponding to the soft constraint; the degree of violation It is calculated based on length deviation, critical coverage insufficiency rate, and the proportion of local inconsistencies.

[0073] In some embodiments, the expression for calibration confidence is: ; in, This indicates the calibration confidence level of the candidate connection; This is a hard constraint mask, set to 0 when the initial candidate connection violates the hard constraint, and 1 otherwise; This is the basic level of credibility; This is an enhancement term, used to characterize the enhancement value of directional consistency or historical support; This refers to the soft constraint penalty term.

[0074] In some embodiments, to enable the processor to self-evolve based on human review results, this embodiment also provides an online update mechanism for soft constraint weights. When a connection is manually identified as a false alarm, i.e., invalid, the processor updates the weights according to the following formula: ; in: : indicates the number before the update Class penalty weight : indicates the updated number Class penalty weight. : indicates the first The learning rate (positive number) of the class rule. : Indicator function. If the false alarm connection triggers the first Class rules (e.g., the connection does indeed cause a length deviation), then ,otherwise The physical meaning of this formula is: if a certain type of rule (such as length deviation) frequently appears in false positive samples, the system will automatically increase the penalty weight of that rule, thereby more severely suppressing similar connections in future inferences.

[0075] S5: Based on candidate connections and their calibration reliability, a two-stage decoding strategy is used to generate path prefixes that satisfy local constraints, thereby obtaining candidate paths that satisfy global constraints.

[0076] The path prefix refers to a local segment sequence generated in the first stage of two-stage decoding, starting from the starting point. It satisfies local constraints but has not yet extended to the endpoint.

[0077] In some embodiments, the processor may utilize constrained bundle search to select several candidate connections with the highest calibration confidence each time to expand and obtain a path prefix.

[0078] Candidate paths refer to the complete segment sequence generated in the second stage of two-stage decoding, extending from the starting point to the ending point.

[0079] In some embodiments, the processor can expand towards the target endpoint based on path prefixes using heuristic search (such as the A* algorithm) until connectivity is achieved and global length and coverage requirements are met, thus obtaining candidate routes. Specifically, in the second-stage global decoding, to avoid the A* algorithm expanding invalid nodes that are topologically reachable but violate railway rules, this embodiment employs a special heuristic function. The processor does not directly calculate the standard shortest path distance, but instead performs a constrained Dijkstra's search or breadth-first search on the reverse topology graph beforehand. During the search, the system dynamically removes the following edges: forbidden edges (connections marked as 1 in the ForbiddenBitset); directional conflict edges (connections incompatible with the target destination direction label); and adversary partition crossing edges (connections crossing adversary partition boundaries without satisfying the interlocking condition). Based on the filtered reverse graph, the shortest path distance for each segment is calculated. To the destination The minimum residual cost is denoted as If a node is unreachable in the filtered graph, simply set... This construction method ensures the heuristic function It not only reflects physical distance, but also includes directional and forbidden constraints, thereby guiding the search tree to avoid a large number of invalid branches.

[0080] In some embodiments, to reduce memory consumption, the processor stores the state of each path prefix during the search process. Compress into a single tuple: ; in, : The current segment number (integer); : Direction label of the current path (up / down); : A bitmap of visited nodes, used for fast loop detection; : Current cumulative cost (including length and penalty); Number of key segments that have been covered.

[0081] Based on this state representation, the system performs dominance pruning: if there are two states... and ,and The current node, direction label, and key coverage number are related to Same, but The cost If it's lower, discard it directly. Only retain Further expansion is needed. This strategy can significantly reduce the generation of repetitive states.

[0082] In some embodiments, the processor may perform local expansion using a constrained bundle search algorithm based on the candidate connections and their calibration confidence, and prune using local constraints during the expansion process to obtain path prefixes that satisfy the local constraints; and perform global expansion using a heuristic search algorithm based on the path prefixes and the target endpoint, and prune using global constraints during the expansion process to obtain candidate paths that satisfy the global constraints.

[0083] In some embodiments, the expression for the score of a path prefix that satisfies the local constraints is: ; in, Indicates path prefix The score; Indicates the edge in the path prefix Calibration reliability; To prevent tiny positive numbers whose logarithms are meaningless; This represents the cumulative constraint cost of the path prefix; This represents the heuristic distance from the end node of the path prefix to the target endpoint; and These represent the adjustment coefficients for the constraint penalty term and the heuristic distance term, respectively.

[0084] The expression for the comprehensive score of the candidate paths that satisfy the global constraints is: ; in, Indicates a complete candidate path The overall score; This represents the connection confidence term of the candidate path; This represents the constraint consistency term of the candidate path; This represents the key coverage item of the candidate path; , , These represent the corresponding weighting coefficients.

[0085] In some embodiments, to avoid search space explosion in two-stage decoding, the processor performs a sort-based local truncation operation before outputting the candidate connection set. Specifically, the processor does not retain all It is not a connection, but rather a connection for each starting point. Outgoing edge according to calibration confidence Sort in descending order, keeping only the first few. Outgoing edges; similarly, for each endpoint Only the front edge is retained. The edge is entered. and : Indicates the local retention threshold. In this embodiment, it is preferred to set . This strategy can force the average branching factor of the subsequent search graph to a constant level, thus ensuring that the computational complexity of path decoding remains controllable regardless of the size of the station.

[0086] S6: Map candidate routes to route bitmaps, use the bitmap verification mechanism to perform global verification on the route bitmaps, obtain the potential route results that pass the verification, and complete the route generation based on constraint inference.

[0087] A path bitmap refers to mapping the set of segments contained in a candidate path to a binary bit string in computer memory.

[0088] In some embodiments, the processor may maintain a global segment number mapping table, the first segment of the route bitmap A bit value of 1 indicates that the route contains the number [number]. The segment is 0 if it is not 0 otherwise.

[0089] Potential path results refer to the path data that ultimately passes all validation steps and is output by the system as a recommended result.

[0090] In some embodiments, the processor can mark candidate paths as potential paths after global bitmap verification to obtain potential path results.

[0091] In some embodiments, a standardized failure reason coding system is defined to support interpretability and auditing requirements. When a candidate route fails the global check, the processor outputs the corresponding failure reason code (FailCode) according to the triggered rule type, which includes, but is not limited to: F01 (forbidden route trigger): the bitwise AND result between the route bitmap and the forbidden route bitmap is not empty; F02 (direction conflict): the overall direction of the route is inconsistent with the attributes of the first and last segments; F03 (loop detection): VisitedBitset detects duplicate bit settings; F04 (length out of bounds): the total length of the route exceeds the preset range of [MinLen, MaxLen]; F05 (insufficient critical coverage): the bitwise comparison result between the route bitmap and the critical coverage mask shows a coverage rate lower than the threshold. F06 (Overall consistency check failed): The route contains sections with conflicting electrification attributes or load class.

[0092] In some embodiments, to improve verification efficiency, global verification is preferably implemented on a 64-bit or higher bit-width processor using bit-parallel techniques. Specifically, for processors containing... The system divides the station area into sections into Each segment is a 64-bit machine word. During prohibition checks, the processor performs a bitwise AND instruction on two 64-bit integers at once, simultaneously checking the status of all 64 segments. This is significantly faster than checking each segment one by one. The complexity is reduced; the theoretical number of instruction cycles for this method is reduced to... It has significant performance advantages when dealing with large-scale stations.

[0093] In some embodiments, the processor can generate a path bitmap based on the segment sequence of the candidate path; obtain a pre-generated forbidden bitmap, a conflict bitmap, and a key coverage mask; perform a bitwise AND operation on the path bitmap with the forbidden bitmap and the conflict bitmap respectively to obtain the bitwise AND operation result, and perform a bitwise comparison on the path bitmap with the key coverage mask to obtain the bitwise comparison result; when the bitwise AND operation result is empty and the bitwise comparison result meets the preset coverage requirement, it is determined that the candidate path has passed the global verification, and the potential path result that has passed the verification is obtained, thus completing the path generation based on constraint inference.

[0094] A restricted area bitmap refers to a binary bit string that represents all prohibited sections or connections within the current station area.

[0095] In some embodiments, the processor can generate a restricted bitmap based on real-time device status or construction plan, if the segment If blocked, then the restricted area map number is [number]. Position 1.

[0096] A collision bitmap is a binary bit string that represents, bit by bit, the set of segments that are hostile or mutually exclusive with the current path. Typically, a collision domain is predefined for each path or segment.

[0097] In some embodiments, the processor can generate a conflict bitmap based on the adversarial route field of the interlocking table.

[0098] A critical overlay mask is a binary bit string that represents the set of critical segments that a path of the current type must pass through.

[0099] In some embodiments, the processor can query the rule base according to the route type (such as receiving, dispatching, shunting) and locate the position 1 corresponding to the signal or turnout that must be passed.

[0100] The result of a bitwise AND operation refers to the binary result of performing a logical AND operation between the allowed bitmap and the forbidden bitmap or the conflicting bitmap.

[0101] In some embodiments, if the result of a bitwise AND operation is not all zeros (i.e., there is a bit that is 1), it indicates that the route contains a prohibited or conflicting segment, triggering a violation.

[0102] The bitwise comparison result refers to the judgment result after performing logical operations (such as comparing the bitwise AND result with the key coverage mask to see if it equals the mask, or calculating the coverage ratio) on the route bitmap and the key coverage mask. It is used to determine whether the route completely includes all the key nodes that must be traversed.

[0103] In some embodiments, to meet the requirements for traceability in railway engineering applications, the processor simultaneously generates structured evidence messages while outputting potential routes. The message is preferably stored in JSON or XML format, with the following field definitions: SourceType (Source Category): Indicates whether the candidate path originates from an existing reproduction, similar inference, or a completely new generation. ScoreInfo (Score Information): Includes the initial base confidence level. Final credibility after constraint calibration And various soft constraint penalty values. ConstraintLog: Records all hard constraints (such as "Triggering forbidden rule ID: 1024") and soft constraints (such as "Length deviation: +2 segment") triggered during the inference process. KeyEnhancement: Records key factors that lead to improved credibility, such as hitting high-frequency connection patterns or strong correlations in key segments. AuditTag: Includes the generation timestamp, algorithm model version number, and operator ID.

[0104] In some embodiments, for candidate routes rejected by the processor, the system also records their failure reason codes (FailCode) (e.g., F01-F06). These records are not output to the user as final results, but are written to the background audit log. Engineers can analyze the main bottlenecks of the current site by querying the distribution of failure reason codes (FailCode) within a specific time period (e.g., if F02 direction conflicts occur frequently, it may mean that there are batch errors in the direction attributes of the basic data), thereby assisting in data governance.

[0105] In some embodiments, the processor employs an online update strategy based on the idea of ​​gradient descent, which uses the deviation between the manual review results and the system prediction results to dynamically adjust the weights of the basic evaluation model and the soft constraint penalty weights.

[0106] (1) The formula for updating the basic evaluation weights: ; in: The weight vector of the basic evaluation model at the current moment (corresponding to the feature) to ). : The updated weight vector. The base learning rate is used to control the update step size and prevent parameter oscillations. Manually verify the label. If the connection is confirmed to be valid, If confirmed as invalid (false alarm), . The system calculates the current connection's basic credibility. ). : The feature vector of the current connection.

[0107] Physical meaning: When the system falsely reports ( high, When ), weight It will reduce the feature The direction of the impact is adjusted; when the system misses a report ( Low, When ), weight It will increase the feature The direction of the influence has been adjusted.

[0108] (2) Update formula for soft constraint penalty weights: ; in: : Current number Penalty weights for soft constraints (such as length deviation). : Updated penalty weights. : Rule update learning rate (usually a positive value). : Rule trigger indicator function. Only if the connection is manually determined to be invalid (false positive), and the connection actually triggers the first... When using soft constraints, ,otherwise .

[0109] Physical meaning: If a certain type of soft constraint (such as "slight deviation in length") frequently appears in false positive connections that are manually rejected, it indicates that the system's current penalty for this type of risk is insufficient. The formula will automatically increase. This means that in subsequent inferences, any connection that triggers this rule will be subject to more severe suppression of its credibility, thereby reducing false alarms.

[0110] In some embodiments, to prevent model forgetting, the processor maintains a fixed-size replay pool, HardNegReplay. Whenever a connection is determined to be invalid during manual review (i.e., a new hard negative sample is found), the processor stores its feature vector and label in the replay pool. During subsequent model retraining phases, the processor randomly samples a batch of samples from the replay pool and mixes them with the new data, assigning them higher loss weights. This forces the model to focus on optimizing these persistent error patterns.

Claims

1. A route generation method based on constraint inference, characterized in that, include: S1: Obtain the existing route sequence data of railway stations and the set of route generation constraints; S2: Construct a positive sample set based on existing route sequence data, and construct a difficult negative sample set based on the station topology; S3: Calculate the basic reliability of the connection between nodes in the station based on the positive sample set and the difficult negative sample set; S4: Use the path generation constraint set to calibrate the basic credibility, and generate candidate connections and their calibrated credibility through hard constraint elimination and soft constraint weight reduction; S5: Based on candidate connections and their calibration reliability, a two-stage decoding strategy is used to generate path prefixes that satisfy local constraints, thereby obtaining candidate paths that satisfy global constraints; S6: Map candidate routes to route bitmaps, use the bitmap verification mechanism to perform global verification on the route bitmaps, obtain the potential route results that pass the verification, and complete the route generation based on constraint inference.

2. The route generation method based on constraint inference according to claim 1, characterized in that, S2 includes: Construct a positive sample set based on existing route sequence data; Based on the existing route sequence data and the station topology, unobserved connections that do not appear in the positive sample set are identified. Calculate the shortest topological distance of the unobserved connection in the station topology, and determine whether the start and end nodes of the unobserved connection belong to the same throat zone; Unobserved connections whose shortest topological distance is less than a preset threshold and belong to the same throat region are selected to obtain the set of difficult negative samples.

3. The route generation method based on constraint inference according to claim 1, characterized in that, S3 includes: Extract the feature vector connecting the positive sample set and the difficult negative sample set; The feature vector is calculated using a pre-trained scoring model to obtain the basic reliability of the connections between nodes within the station.

4. The route generation method based on constraint inference according to claim 3, characterized in that, The expression for the basic credibility is: ; in, Represents a node To the node The basic credibility of the connection; The first one representing the connection The components of the eigenvectors; Indicates the first The weights corresponding to each feature vector; Indicates the bias term; This represents the normalized mapping function.

5. The route generation method based on constraint inference according to claim 1, characterized in that, S4 includes: Based on the prohibited constraints, directional constraints, and conflict constraints in the set of constraints for generating the route, a hard constraint mask is generated. The basic credibility is filtered using the hard constraint mask to eliminate connections that violate the hard constraints and retain the initial candidate connections. Based on the length constraint, key segment coverage constraint, and consistency constraint in the set of route generation constraints, calculate the soft constraint penalty term; The basic confidence of the initial candidate connection is corrected using the soft constraint penalty term to obtain the candidate connection and its calibration confidence.

6. The route generation method based on constraint inference according to claim 5, characterized in that, The expression for the soft constraint penalty term is: ; in, This represents the soft constraint penalty term for the initial candidate connection; Indicates the first The degree of violation of soft constraints on the initial candidate connections; Indicates the first The penalty weight corresponding to the soft constraint; the degree of violation It is calculated based on length deviation, critical coverage insufficiency rate, and the proportion of local inconsistencies.

7. The route generation method based on constraint inference according to claim 5, characterized in that, The expression for the calibration reliability is: ; in, This indicates the calibration confidence level of the candidate connection; This is a hard constraint mask, set to 0 when the initial candidate connection violates the hard constraint, and 1 otherwise; This is the basic level of credibility; This is an enhancement term, used to characterize the enhancement value of directional consistency or historical support; This refers to the soft constraint penalty term.

8. The route generation method based on constraint inference according to claim 1, characterized in that, S5 includes: Based on the candidate connections and their calibration reliability, a constrained bundle search algorithm is used for local expansion, and local constraints are used for pruning during the expansion process to obtain path prefixes that satisfy the local constraints. Based on the path prefix and target endpoint, a heuristic search algorithm is used for global expansion, and global constraints are used for pruning during the expansion process to obtain candidate paths that satisfy the global constraints.

9. The route generation method based on constraint inference according to claim 8, characterized in that, The expression for the score of the path prefix that satisfies the local constraints is: ; in, Indicates path prefix The score; Indicates the edge in the path prefix Calibration reliability; To prevent tiny positive numbers whose logarithms are meaningless; This represents the cumulative constraint cost of the path prefix; This represents the heuristic distance from the end node of the path prefix to the target endpoint; and These represent the adjustment coefficients for the constraint penalty term and the heuristic distance term, respectively. The expression for the comprehensive score of the candidate paths that satisfy the global constraints is: ; in, Indicates a complete candidate path The overall score; This represents the connection confidence term of the candidate path; This represents the constraint consistency term of the candidate path; This represents the key coverage item of the candidate path; , , These represent the corresponding weighting coefficients.

10. The route generation method based on constraint inference according to claim 1, characterized in that, S6 includes: A route bitmap is generated based on the segment sequence of the candidate routes; Obtain the pre-generated forbidden bitmap, collision bitmap, and key overlay mask; Perform a bitwise AND operation between the route bitmap and the forbidden bitmap and the conflict bitmap respectively to obtain the bitwise AND operation result, and perform a bitwise comparison between the route bitmap and the key overlay mask to obtain the bitwise comparison result; When the bitwise AND operation result is empty and the bitwise comparison result meets the preset coverage requirement, the candidate path is determined to have passed the global verification, and the potential path result that has passed the verification is obtained, thus completing the path generation based on constraint inference.