Directed Graph-Based Interlocking Logic Segment Device Sequencing Method
By constructing a topological directed graph and sorting it, the problem of insufficient speed and accuracy of sorting of section equipment in the existing technology is solved, especially the sorting chaos in the crossover turnout scenario, and efficient sorting is achieved to complete the route locking and unlocking operations within 1-2 cycles.
Patent Information
- Application Number
- CN202510634949.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2045-05-16
AI Technical Summary
Existing section equipment sorting methods struggle to guarantee the speed and accuracy of sorting results when dealing with rule bases related to routes and locking, resulting in low reliability of sorting results. This is especially true in crossover turnout scenarios, where sorting efficiency is difficult to complete within 1-2 cycles.
By constructing a topological directed graph between equipment sections, and using the topological sorting rules of the directed graph, the section nodes are sorted based on the ASCII code order to ensure that the relative order between the sorted sections is consistent with the relative order of the sections inside the route. In particular, the turnouts of the crossover type are processed by switching, and then processed as loops in the directed graph.
It improves the accuracy and efficiency of section equipment sequencing, ensuring that route locking and unlocking operations are completed within 1-2 cycles, avoiding confusion in sequencing results, and improving the controller's processing capacity.
Smart Images

Figure CN120735822B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of train signal processing technology, specifically to a method for sequencing interlocking logic section equipment based on directed graphs. Background Technology
[0002] Currently, the Boolean algebraic logic expressions used in interlocking systems can be automatically generated by software. Different Boolean algebraic logic expressions belong to different rule bases based on function. By combining these with the BOOL timing table, the software can output timing-sequential logic files in a specific order. The generation order of Boolean algebraic logic expressions under different rule bases is closely related to the device sorting method under the corresponding timing, usually sorted using ASCII or reverse ASCII codes. However, for rule bases related to route locking and unlocking, sorting by ASCII codes alone cannot guarantee that the controller can complete the locking or unlocking of all segments within 1-2 cycles. For example, when locking a route, the interlocking process proceeds sequentially from the first segment to the last. Because the controller calculates Boolean logic line by line according to the order of the Boolean algebraic logic expressions in the rule base of the logic file, if the expressions are not generated in the order of the segments within the route, it will be impossible to complete the locking of all segments within 1-2 cycles. Therefore, in order to ensure the accuracy of the generation order of Boolean algebraic logic expressions under the rule base related to route locking and unlocking, and at the same time meet the sorting requirements under various station types, it is an urgent problem to provide a sorting method for section equipment.
[0003] Chinese patent, publication number: CN117873423A, publication date: April 12, 2024, discloses a method for sequencing interlocking equipment based on Boolean logic. It generates a doubly linked list structure of station section elements, determines the sequence of section elements based on the doubly linked list structure, and determines the sequence of signal and route elements based on the sequence of section elements. Although it can correctly sequence when multiple sets of switches are contained in the same section and multiple sections are intertwined, its sequencing process relies on Boolean algebra to develop interlocking logic. When encountering crossover switches, it is difficult to complete the locking or unlocking of all sections within one or two cycles, and the sequencing efficiency is difficult to meet the actual needs. Summary of the Invention
[0004] This invention addresses the problem of low reliability in segment device sorting results caused by the difficulty in guaranteeing the generation speed and accuracy of sorting results when existing segment device sorting methods involve rule bases related to routes and interlocking. It provides a directed graph-based interlocking logic segment device sorting method. This method constructs segment node objects by collecting all segment information, builds a topological directed graph of connections between segment devices based on the logical relationships between them, and sorts all segment nodes in the topological directed graph sequentially based on ASCII code order and topological sorting rules. This converts the inter-segment connections into a directed graph, and the topological sorting process of the directed graph completes the sorting of segment devices. This ensures that the relative order between sorted segments is consistent with the relative order of the inner segments in each route, improving both sorting efficiency and result accuracy.
[0005] In a first aspect, one technical solution provided in this embodiment of the invention is: a method for sequencing interlocking logic segment devices based on directed graphs, comprising the following steps: S1. Obtain information on all sections within the valid range of the station map, and construct section node objects based on the positional relationships between the equipment in each section; S2. Based on the logical topological relationship between segment node objects, obtain the segment device information connected to each segment node object and construct a topological directed graph between segments; S3. Based on the ASCII code order and topological sorting rules, the segment nodes are sorted in the topological directed graph to obtain the processing order of the segment devices.
[0006] In this solution, a directed topological graph connecting the devices in each segment is constructed based on their logical topological relationships. This graph is then converted into a directed graph, and the devices are sorted using a topological sorting process. This ensures that the relative order between the sorted segments matches the relative order of the inner segments within each route, improving sorting accuracy. Furthermore, by using topological sorting rules, when dealing with route and locking-related rule bases, the solution addresses the issue of inconsistent relative order between sorted segments with the relative order of inner segments within routes, leading to disordered generated logical expressions. This ensures that route locking and unlocking operations are completed within 1-2 cycles.
[0007] Preferably, in step S1, information on all sections within the effective range of the station map is obtained, and section node objects are constructed based on the positional relationships between the equipment in each section, including the following steps: Obtain information on all section equipment in the current centralized station and its neighboring stations, as well as information on all cross-station sections in the cross-station routes of neighboring stations; Define each segment from all the acquired segment information and segment device information as a segment node object for topological sorting; The attributes of the segment node object include the current segment device name, the list of segment nodes for the downlink connections of the current segment, and the in-degree of the current segment node.
[0008] In this solution, by constructing segment node objects, a unified data structure can be achieved, providing a data foundation for subsequent topology analysis and device sorting.
[0009] Preferably, the in-degree of the current segment node is the number of upstream connected segment nodes of the current segment.
[0010] In this scheme, the number of upstream connected segment nodes of the current segment, i.e., the in-degree of the current segment node, is used as one of the attributes of the current segment node. This provides a data foundation for subsequent segment nodes to analyze and process the in-degree value, thereby meeting the segment equipment sorting requirements under various complex station types and ensuring the correctness of the expression order in the logical rule base.
[0011] Preferably, in S2, the segment device information connected to each segment node object is obtained based on the logical topological relationship between segment node objects to construct a directed topological graph between segments, including the following steps: If the segment device for the downlink connection of the current segment does not exist, then the segment node list for the downlink connection of the current segment will not be processed. If a downlink connection device exists in the current segment, add the found downlink connection device to the segment node list of the downlink connection in the current segment, and increment the in-degree value of the segment node corresponding to the downlink connection device by 1.
[0012] In this scheme, a directed graph of the section is constructed by improving each section node object. The complex connection relationship of equipment such as tracks, switches, and signals is transformed into a graph composed of nodes (sections) and edges (connection directions), making the station structure clear at a glance and intuitively expressing the logical relationship of the station. This provides a strong foundation for the subsequent sorting of section equipment.
[0013] Preferably, if the downlink connection device in the current section exists and is one of the following: signal, turnout, miscellaneous equipment, and over-limit insulation point equipment, then the downlink connection device is used as the target device, and the downlink connection device of the target device is searched until the downlink connection device found is not one of the following: signal, turnout, miscellaneous equipment, and over-limit insulation point equipment. The found downlink connection device is then added to the section node list of the downlink connection in the current section, and the in-degree value of the section node corresponding to the downlink connection device is incremented by 1.
[0014] In this scheme, since there are many types of logical devices connected to the segment, and some logical devices do not have a dependency relationship with downstream or upstream logical devices, when searching for the downlink connection device of the current segment, if such a device is found, it cannot be used as the segment node of the downlink connection of the current node. By skipping such logical devices, the search efficiency and sorting speed can be significantly improved.
[0015] Preferably, if the downlink connection device is a turnout, and the turnout type is a crossover turnout, then the two section nodes in the crossover turnout are each other's downlink connection section nodes.
[0016] In this scheme, when encountering a crossover turnout, since this type of turnout contains two sections, each containing two turnouts, the downstream connected section nodes of the two sections will contain the other section nodes. After sorting, the relative order between the sections cannot be consistent with the relative order of the sections within the route, resulting in disordered order of the generated related logical expressions. This causes the controller to be unable to complete the operation related to route locking and unlocking within 1-2 cycles when performing Boolean logic operations. In order to ensure the correct transmission of route logic unlocking and locking information, the two turnouts in the section need to be swapped when constructing the interlocking logic topology connection relationship. When constructing the directed graph, it is converted into a loop in the directed graph. By processing the loop, that is, the two downstream connected section nodes are sorted according to the ASCII code of the device name and output sequentially, it is ensured that the other section nodes after the two section nodes forming the loop can be sorted and output normally.
[0017] Preferably, in S3, the segment nodes are sorted in the topological directed graph based on ASCII code order and topological sorting rules to obtain the processing order of the segment devices, including the following steps: Sort the segment devices corresponding to the segment nodes with an in-degree of 0 in the topological directed graph according to the ASCII code of the device name, and save the sorted segment nodes into the sorting queue in sequence. Dequeue all segment nodes in the sorted queue sequentially and save each dequeued segment node to the result queue. Decrement the in-degree of all downlink connected segment nodes corresponding to the segment nodes in the result queue by 1. Sort the segment devices corresponding to the downlink connected segment nodes whose in-degree is 0 after decrementing by 1 according to the ASCII code of the device name. Save the sorted segment nodes sequentially to the sorted queue. Repeat the above process until the number of segment nodes in the sorted queue is 0. Then, use the result queue as the processing order of the segment devices.
[0018] In this scheme, by using separate operations for sorting queues and result queues, the complexity algorithm is applied to ultra-large-scale stations, realizing pipelined queue processing. Sorting is only triggered when the in-degree is reduced to 0, which reduces unnecessary calculations and thus significantly improves sorting efficiency. By analyzing the in-degree of each segment node, it is only included in the sorting queue when the in-degree is 0, which ensures that the relative order between sorted segments is consistent with the relative order of the inner segments in each path, thus improving the accuracy of the sorting results.
[0019] Preferably, if there are two segment nodes in the topological directed graph that are each other's downlink segment nodes, then these two segment nodes are removed from each other's downlink segment node list, and then the segment nodes are sorted in the topological directed graph based on ASCII code order and topological sorting rules.
[0020] In this scheme, during the sorting process, if two section nodes are each other's downlink connected section nodes, i.e., there is a crossover turnout, the in-degree value of these two section nodes can never be 0. If sorting is performed in this case, the relative order between the sorted sections will not be consistent with the relative order of the sections inside the route, and the order of the generated related logical expressions will be disordered. In order to avoid train conflicts, the crossover turnout needs to be fixed in one direction at a certain time. Therefore, according to this principle, these two section nodes can be removed from the list of the downlink connected section nodes of each other before continuing the sorting. In this way, the impact of the crossover turnout on the sorting result can be solved without affecting the actual situation.
[0021] Preferably, the neighboring stations of the current centralized station are other centralized stations directly connected to the current centralized station; the cross-station section in the cross-station route of the neighboring station is a section under the neighboring station of the neighboring station of the current centralized station.
[0022] In this scheme, in order to collect the section information in the station map as comprehensively as possible, the current centralized station is used as the benchmark, and the centralized stations going up and down are searched in turn to collect the section information of these centralized stations, so as to ensure the integrity of the data.
[0023] Preferably, the neighboring stations of the current centralized station are other centralized stations that are directly connected to the neighboring stations of the current centralized station, excluding the current centralized station.
[0024] In this scheme, a cross-station route is a route whose starting signal is in a neighboring station of the current central station, but whose ending signal is neither in the current central station nor in a neighboring station of the current central station; a cross-station section is all sections in a cross-station route that are neither in the current central station nor in a neighboring station of the current central station. Through the above division, information on all sections within the effective range of the station map is collected.
[0025] The beneficial effects of the present invention are as follows: (1) The present invention constructs a topological directed graph connecting the segment devices according to the logical topological relationship between the segment devices, converts the connection relationship between the segments into a directed graph, and uses the topological sorting process of the directed graph to complete the sorting of the segment devices, ensuring that the relative order between the sorted segments is consistent with the relative order of the inner segments in each path, thereby improving the accuracy of sorting. (2) This invention transforms two segments in a crossover turnout that are logically related to each other into a loop in a directed graph. By processing the loop, that is, sorting the nodes of the two segments connected to each other in the opposite direction according to the ASCII code of the equipment name and outputting them in sequence, it ensures that the other segment nodes after the two segment nodes that constitute the loop can be sorted and output normally. This solves the problem that in station types, due to the presence of crossover turnouts, the relative order between the sorted segments cannot be consistent with the relative order of the segments inside the route, resulting in disordered order of the generated related logical expressions, which leads to low efficiency of the controller in handling route locking and unlocking operations when performing Boolean logic operations.
[0026] The above description of the invention is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0027] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings. The drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings.
[0028] Figure 1 This is a flowchart of the interlocking logic section device sequencing method based on directed graphs according to the present invention; Figure 2 This is an example diagram of the crossover turnout of the present invention; Figure 3 This is an example diagram showing the switchover section below the crossover type turnout of the present invention after the switchover is changed; Figure 4 This is an example diagram of the crossover type turnout after the switch is exchanged in the section above it according to the present invention; Figure 5 This is an example diagram of the topology connection after the crossover type turnout is switched with the turnout according to the present invention; Figure 6 This is an example diagram of the station type of the present invention; Figure 7 This is a schematic diagram of the topological directed graph connection relationship formed by the segments in the station type example diagram of the present invention. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only one preferred embodiment of this invention and are only used to explain this invention. They do not limit the scope of protection of this invention. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0030] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations (or steps) can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but it may also have additional steps not included in the figures; the process may correspond to a method, function, procedure, subroutine, subroutine, etc.
[0031] Example: Figure 1 As shown, to address the problem of low reliability in segment equipment sorting results due to the difficulty in guaranteeing the generation speed and accuracy of sorting results when existing segment equipment sorting methods involve rule bases related to routes and interlocking, this embodiment provides a segment equipment sorting method based on directed graph interlocking logic, including the following steps: S1: Obtain information on all sections within the valid range of the station map, and construct section node objects based on the positional relationships between the equipment in each section.
[0032] In this embodiment, information on all sections within the effective range of the station map is obtained, and section node objects are constructed based on the positional relationships between the equipment in each section, including the following steps: Obtain information on all section equipment in the current centralized station and its neighboring stations, as well as information on all cross-station sections in the cross-station routes of neighboring stations; Define each segment from all the acquired segment information and segment device information as a segment node object for topological sorting; The attributes of the segment node object include the current segment device name, the list of segment nodes for the downlink connections of the current segment, and the in-degree of the current segment node.
[0033] This embodiment constructs segment node objects to unify the data structure, providing a data foundation for subsequent topology analysis and device sorting.
[0034] In this implementation, the in-degree of the current segment node is the number of upstream connected segment nodes of the current segment.
[0035] This embodiment uses the number of upstream connected segment nodes of the current segment, i.e., the in-degree of the current segment node, as one of the attributes of the current segment node. This provides a data foundation for subsequent segment nodes to analyze and process the in-degree value, thereby meeting the segment equipment sorting requirements under various complex station types and ensuring the correctness of the expression order in the logical rule base.
[0036] In this embodiment, the neighboring stations of the current centralized station are other centralized stations directly connected to the current centralized station; the cross-station section in the cross-station route of the neighboring station is a section under the neighboring station of the neighboring station of the current centralized station; the neighboring station of the neighboring station of the current centralized station is other centralized stations directly connected to the neighboring station of the current centralized station, excluding the current centralized station.
[0037] In order to collect the section information in the station map as comprehensively as possible, this embodiment uses the current centralized station as the reference and searches the upstream and downstream centralized stations in turn to collect the section information of these centralized stations, thus ensuring the integrity of the data.
[0038] In this embodiment, a cross-station route with the starting signal of the route is in a neighboring station of the current central station, but the ending signal of the route is neither in the current central station nor in a neighboring station of the current central station; a cross-station section is all sections in the cross-station route that are neither in the current central station nor in a neighboring station of the current central station. Through the above division, all section information within the effective range of the station map is collected.
[0039] S2: Based on the logical topological relationship between segment node objects, obtain the segment device information connected to each segment node object and construct a directed topological graph between segments.
[0040] In this embodiment, the topological directed graph between segments is constructed by obtaining the segment device information connected to each segment node object based on the logical topological relationship between segment node objects, including the following steps: If the segment device for the downlink connection of the current segment does not exist, then the segment node list for the downlink connection of the current segment will not be processed. If a downlink connection device exists in the current segment, add the found downlink connection device to the segment node list of the downlink connection in the current segment, and increment the in-degree value of the segment node corresponding to the downlink connection device by 1.
[0041] This embodiment constructs a directed graph of the section by perfecting each section node object, transforming the complex connection relationships of equipment such as tracks, switches, and signals into a graph composed of nodes (sections) and edges (connection directions), making the station structure clear at a glance and intuitively expressing the logical relationships of the station, providing a strong foundation for subsequent sorting of section equipment.
[0042] In this embodiment, if the downlink connection device of the current section exists and is one of the following: signal, turnout, miscellaneous equipment, and over-limit insulation point equipment, then the downlink connection device is used as the target device, and the downlink connection device of the target device is searched until the downlink connection device found is not one of the following: signal, turnout, miscellaneous equipment, and over-limit insulation point equipment. The found downlink connection device is then added to the section node list of the downlink connection of the current section, and the in-degree value of the section node corresponding to the downlink connection device is incremented by 1.
[0043] In this embodiment, since there are many types of logical devices connected to the segment, and some logical devices do not have a dependency relationship with downstream or upstream logical devices, when searching for the downlink connection device of the current segment, if such a device is found, it cannot be used as the segment node of the downlink connection of the current node. By skipping such logical devices, the search efficiency and sorting speed can be significantly improved.
[0044] In this embodiment, if the downlink connection device is a turnout and the type of turnout is a crossover turnout, then the two section nodes in the crossover turnout are each other's downlink connection section nodes.
[0045] Specifically, for crossover turnouts, such as Figure 2 As shown, this type of turnout comprises two sections, ST1001 and ST1003, each containing two turnouts. Section ST1001 contains turnouts P1001 and P1004, and section ST1003 contains turnouts P1002 and P1003. To ensure the correct transmission of route logic unlocking and locking information, the two turnouts in the sections need to be swapped when constructing the interlocking logic topology. An example of the swapped turnouts is shown below. Figure 3 and Figure 4 As shown, the topological connections within the two sections, from top to bottom, are P1004, ST1001, P1001, P1003, ST1003, P1002, respectively. The topological connections between sections are respectively connected by the reverse of turnout P1002 to the reverse of turnout P1004, and the reverse of turnout P1001 to the reverse of turnout P1003, as shown. Figure 5 As shown, when constructing a directed graph, the list of downstream connected segments of two segment nodes will contain nodes of the other segment. That is, the two segment nodes are each other's next connected segment nodes. Therefore, when constructing a directed graph, a cycle will exist in the graph. Figure 6 Taking the station type as an example, the constructed topological directed graph is as follows: Figure 7 As shown in the figure, the downlink connection segment equipment of segments ST1005 and ST1008 both include each other. Table 1 shows... Figure 7 Attributes of nodes in each segment of a mid-topological directed graph: Table 1. Attributes of nodes in each segment of the topological directed graph From this, we can see that the in-degree values of T1001 and T1002 are 0, so these two segment nodes will be prioritized for sorting in subsequent arrangements.
[0046] In this embodiment, when encountering a crossover turnout, since this type of turnout contains two sections, each containing two turnouts, the downstream connected section nodes of the two sections will contain the other section nodes. After sorting, the relative order between the sections cannot be consistent with the relative order of the sections within the route, resulting in disordered order of the generated related logical expressions. This causes the controller to be unable to complete the operation related to route locking and unlocking within 1-2 cycles when performing Boolean logic operations. In order to ensure the correct transmission of route logic unlocking and locking information, the two turnouts in the section need to be swapped when constructing the interlocking logic topology connection relationship. When constructing the directed graph, it is converted into a loop in the directed graph. By processing the loop, that is, the two downstream connected section nodes are sorted according to the ASCII code of the device name and output sequentially, it is ensured that the other section nodes after the two section nodes forming the loop can be sorted and output normally.
[0047] S3: Based on the ASCII code order and topological sorting rules, the segment nodes are sorted in the topological directed graph to obtain the processing order of the segment devices.
[0048] In this embodiment, the processing order of segment devices is obtained by sorting segment nodes in the topological directed graph based on ASCII code order and topological sorting rules, including the following steps: Sort the segment devices corresponding to the segment nodes with an in-degree of 0 in the topological directed graph according to the ASCII code of the device name, and save the sorted segment nodes into the sorting queue in sequence. Dequeue all segment nodes in the sorted queue sequentially and save each dequeued segment node to the result queue. Decrement the in-degree of all downlink connected segment nodes corresponding to the segment nodes in the result queue by 1. Sort the segment devices corresponding to the downlink connected segment nodes whose in-degree is 0 after decrementing by 1 according to the ASCII code of the device name. Save the sorted segment nodes sequentially to the sorted queue. Repeat the above process until the number of segment nodes in the sorted queue is 0. Then, use the result queue as the processing order of the segment devices.
[0049] This embodiment applies a complex algorithm to ultra-large-scale stations through step-by-step operations of sorting queues and result queues, realizing pipelined queue processing. Sorting is only triggered when the in-degree is reduced to 0, which reduces unnecessary calculations and thus significantly improves sorting efficiency. By analyzing the in-degree of each segment node, it is only included in the sorting queue when the in-degree is 0, which ensures that the relative order between sorted segments is consistent with the relative order of the inner segments in each path, thus improving the accuracy of the sorting results.
[0050] In this embodiment, if there are two segment nodes in the topological directed graph that are each other's downlink connection segment nodes, then these two segment nodes are removed from each other's downlink connection segment node list, and then the segment nodes are sorted in the topological directed graph based on ASCII code order and topological sorting rules.
[0051] Specifically, with Figure 7For example, first, find all segment nodes with an in-degree of 0 in the directed graph, namely T1001 and T1002. After sorting them according to their device name ASCII codes, save them to the sorting queue A to obtain A[T1001, T1002]. Then, dequeue them one by one and save them to the result queue B to obtain B[T1001, T1002]. Then, decrement the in-degree of all segment nodes in the segment node list of the downlink connections of these two segment nodes by 1, that is, ST1001's in-degree becomes 0 and ST1002's in-degree becomes 1. Then ST1001 enters the sorting queue. The process involves dequeuing ST1001 to obtain B[T1001, T1002, ST1001]. At this point, the in-degree of all segment nodes in the downlink connection segment node list of ST1001 is decremented by 1, meaning the in-degree of T1003 becomes 0, and the in-degree of ST1002 becomes 0. Then, T1003 and ST1002 are sorted according to their device name ASCII codes and added to the sorting queue before being dequeued. This process continues until it is found that the downlink connection segment node lists of ST1005 and ST1008 contain each other's segment nodes, meaning the two segment nodes are each other's next node. Connecting the segment nodes indicates the presence of crossover turnouts in the station diagram, requiring further processing. Decrement the in-degree value of these two nodes by 1. Then, find all segment nodes with an in-degree value of 0 from these two segments, sort them according to their device name ASCII codes, and add them to the sorting queue. Simultaneously, remove these two segment nodes from the list of segment nodes connected to each other's downstream connections. Continue this process until the number of segment nodes in the sorting queue is 0. The final result queue is B[T1001, T1002, ST1001, ST1002, T1003, ST1004, T1005, S...]. If the sequence is T1006, ST1003, T1004, T1007, ST1005, ST1008, T1009, T1006, then the final sorting result is T1001, T1002, ST1001, ST1002, T1003, ST1004, T1005, ST1006, ST1003, T1004, T1007, ST1005, ST1008, T1009, T1006. This order is the downlink processing order. If the uplink processing order is needed, the results obtained from the downlink processing order can be sorted in reverse order.
[0052] In this embodiment, during the sorting process, if two section nodes are each other's downlink connected section nodes, i.e., there is a crossover turnout, the in-degree value of these two section nodes can never be 0. If sorting is performed in this case, the relative order between the sorted sections will not be consistent with the relative order of the sections inside the route, and the order of the generated related logical expressions will be disordered. In order to avoid train conflicts, the crossover turnout needs to be fixed in one direction at a certain time. Therefore, according to this principle, these two section nodes can be removed from each other's downlink connected section node list before continuing the sorting. In this way, the impact of the crossover turnout on the sorting result can be solved without affecting the actual situation.
[0053] As can be seen from the above embodiments, it has at least the following substantial effects: (1) This invention constructs a directed graph of the connections between the segment devices based on the logical topological relationship between the segment devices, converts the connection relationship between the segments into a directed graph, and uses the topological sorting process of the directed graph to complete the sorting of the segment devices, ensuring that the relative order between the sorted segments is consistent with the relative order of the inner segments in each path, thus improving the accuracy of sorting. (2) This invention transforms two segments in a crossover turnout that are logically related to each other into a loop in a directed graph. By processing the loop, that is, sorting the nodes of the two segments connected to each other in the opposite direction according to the ASCII code of the equipment name and outputting them in sequence, it ensures that the other segment nodes after the two segment nodes that constitute the loop can be sorted and output normally. This solves the problem that in station types, due to the presence of crossover turnouts, the relative order between the sorted segments cannot be consistent with the relative order of the segments inside the route, resulting in disordered order of the generated related logical expressions, which leads to low efficiency of the controller in handling route locking and unlocking operations when performing Boolean logic operations.
[0054] The specific embodiments described above are preferred embodiments of the interlocking logic segment device sequencing method based on directed graphs of the present invention, and are not intended to limit the specific scope of the present invention. The scope of the present invention includes, but is not limited to, these specific embodiments. All equivalent changes made in accordance with the shape and structure of the present invention are within the protection scope of the present invention.
Claims
1. A method for sequencing interlocking logic segment devices based on directed graphs, characterized in that: Includes the following steps: S1. Obtain information on all sections within the valid range of the station map, and construct section node objects based on the positional relationships between the equipment in each section; S2. Based on the logical topological relationship between segment node objects, obtain the segment device information connected to each segment node object and construct a topological directed graph between segments; S3. Based on ASCII code order and topological sorting rules, sort the segment nodes in the topological directed graph to obtain the processing order of the segment devices; In S1, information on all sections within the valid range of the station map is obtained, and section node objects are constructed based on the positional relationships between the equipment in each section, including the following steps: Obtain information on all section equipment in the current centralized station and its neighboring stations, as well as information on all cross-station sections in the cross-station routes of neighboring stations; Define each segment from all the acquired segment information and segment device information as a segment node object for topological sorting; The attributes of the segment node object include the current segment device name, the list of segment nodes for the downlink connections of the current segment, and the in-degree of the current segment node; In S2, the topological directed graph between segments is constructed by obtaining the segment device information connected to each segment node object based on the logical topological relationship between segment node objects, including the following steps: If the segment device for the downlink connection of the current segment does not exist, then the segment node list for the downlink connection of the current segment will not be processed. If a downlink connection device exists in the current segment, add the found downlink connection device to the segment node list of the downlink connection in the current segment, and increment the in-degree value of the segment node corresponding to the downlink connection device by 1; If the downlink connection device in the current section exists and is one of the following: signal, turnout, miscellaneous equipment, and over-limit insulation point equipment, then use this downlink connection device as the target device and search for the downlink connection device of the target device until the downlink connection device found is not one of the following: signal, turnout, miscellaneous equipment, and over-limit insulation point equipment. Then, add the found downlink connection device to the section node list of the downlink connection in the current section and increment the in-degree value of the section node corresponding to the downlink connection device by 1. If the downlink connection device is a turnout, and the turnout type is a crossover turnout, then the two section nodes in the crossover turnout will be the downlink connection section nodes of each other.
2. The method for sequencing interlocking logic segment devices based on directed graphs according to claim 1, characterized in that: The in-degree of the current segment node is the number of upstream connected segment nodes of the current segment.
3. The method for sequencing interlocking logic segment devices based on directed graphs according to claim 1, characterized in that: In S3, the segment nodes are sorted in the topological directed graph based on ASCII code order and topological sorting rules to obtain the processing order of segment devices, including the following steps: Sort the segment devices corresponding to the segment nodes with an in-degree of 0 in the topological directed graph according to the ASCII code of the device name, and save the sorted segment nodes into the sorting queue in sequence. Dequeue all segment nodes in the sorted queue in sequence, and save each dequeued segment node to the result queue; Decrement the in-degree of all downlink connected segment nodes corresponding to the segment nodes in the result queue by 1; sort the segment devices corresponding to the downlink connected segment nodes whose in-degree is 0 after decrementing by 1 according to the ASCII code of the device name, and save the sorted segment nodes to the sort queue in sequence. Repeat the above process until the number of segment nodes in the sort queue is 0, and then use the result queue as the processing order of segment devices.
4. The method for sequencing interlocking logic segment devices based on directed graphs according to claim 3, characterized in that: If two segment nodes in the topological directed graph are each other's downlink segment nodes, then these two segment nodes are removed from each other's downlink segment node list, and then the segment nodes are sorted in the topological directed graph based on ASCII code order and topological sorting rules.
5. The method for sequencing interlocking logic segment devices based on directed graphs according to claim 1, characterized in that: The neighboring stations of the current centralized station are other centralized stations that are directly connected to the current centralized station; The cross-station section in the adjacent station cross-station route is a section under the adjacent station of the current centralized station.
6. The method for sequencing interlocking logic segment devices based on directed graphs according to claim 5, characterized in that: The neighboring stations of the current centralized station are other centralized stations that are directly connected to the neighboring stations of the current centralized station, excluding the current centralized station.
Citation Information
Patent Citations
Interlocking equipment sequencing method and equipment based on Boolean logic and medium
CN117873423A
