Interlocking table configuration special condition data structure generation optimization method

By using Python scripts to parse and tile complex Boolean logical expressions in the interlock table of the rail transit signal system, generating special conditional data structures and separating configuration data and applications, the problems of interlock table processing complexity and software cost in the existing technology are solved, and clearer data structures and lower software release costs are achieved.

CN119806536APending Publication Date: 2025-04-11SHANGHAI ELECTRIC THALES TRANSPORTATION AUTOMATION SYST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411904854.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

When the existing rail transit signal system is interlocked, there are multiple levels of nesting of special condition Boolean logical expressions in the interlock table, resulting in complex processing, poor readability and scalability of software code, and the software modules generated by special conditions cannot be completely isolated from the application, which increases the cost of software release.

Method used

Python scripts are used to read the special condition table items of the interlock table, and the complex Boolean logical expressions are removed and then tiled and disassembled through operation rules, parsed into multiple or basic expressions of operations, generated special condition data structures of table items, and defined common special condition call interface functions to complete the complete separation of configuration data and application.

Benefits of technology

The clarity and readability of the interlock table data structure are realized, and the special conditional logic is stripped away from the application software, and the interlock table structure is dynamically adjusted to meet the needs of different projects, reducing the software release cost, and simplifying the interlock code logic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806536A_ABST
    Figure CN119806536A_ABST
Patent Text Reader

Abstract

The invention discloses an interlocking table configuration special condition data structure generation optimization method. The method comprises the following steps: S1, reading interlocking table special condition table items by adopting a python script; s2, removing brackets of the complex Boolean logic expression through an operation rule, then tiling and disassembling the complex Boolean logic expression, and analyzing the complex Boolean logic expression into a plurality of basic expressions of OR operation; s3, analyzing the basic expressions one by one, and generating a table item special condition data structure; s4, defining a universal special condition calling interface function; and S5, calling a table item special condition data structure through an interface function to complete the complete separation of the configuration data and the application program. According to the method, the interlocking table can be dynamically expanded according to different special conditions, and complete separation of the configuration data and the application program is completed so as to adapt to different project requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to an optimization method for generating a special condition data structure for interlocking table configuration. Background Art

[0002] When performing interlocking control, the existing rail transit signal system usually configures interlocking conditions according to different station requirements. There are many special conditions, namely Boolean logic expressions, in the interlocking tables used in the interlocking systems of domestic manufacturers, and the Boolean logic expressions are nested at multiple levels. Different manufacturers have different processing methods for complex Boolean expressions. Many of them directly use parsing tools to generate a set of special condition software modules independent of the interlocking table data for Boolean logic expressions without any conversion, which makes the readability and scalability of the interlocking software code very poor. In addition, the Boolean expression software module generated by special conditions cannot be completely isolated from the application program. Any upgrade or modification of the special condition data of the station requires modification of the application software, which greatly increases the cost of software release.

[0003] Aiming at the above problems, a method for optimizing the generation of special condition data structure for interlock table configuration is provided. Summary of the invention

[0004] The purpose of the present invention is to overcome the existing defects and provide an optimization method for generating a special condition data structure for an interlocking table configuration, which can dynamically expand the interlocking table according to different special conditions, complete the complete separation of configuration data and application programs, and adapt to different project requirements.

[0005] The technical solution to achieve the above purpose is:

[0006] A method for optimizing the generation of a special condition data structure for an interlocking table configuration, comprising:

[0007] Step S1, using a python script to read the special condition table items of the interlocking table;

[0008] Step S2, removing brackets from the complex Boolean logic expression and disassembling it flatly according to the operation rules, and parsing it into multiple basic expressions of OR operation;

[0009] Step S3, parsing basic expressions one by one to generate a table entry special condition data structure;

[0010] Step S4, defining a general special condition calling interface function;

[0011] Step S5, complete separation of configuration data and application program by calling the table entry special condition data structure through the interface function.

[0012] Preferably, in step S2, if the python script reads the special condition table item of the interlocking table as (a+b)*c+(d+e)*f, the complex Boolean logic expression is flattened after removing the brackets according to the operation rules, and parsed into multiple basic expressions of OR operations as a*c+b*c+d*f+e*f.

[0013] Preferably, in step S3, Special Condition Common is defined as a general structure of special condition expressions, the Special Condition Common structure includes the number of Nodes and a Special Condition Node structure, and a logical OR operation is used between all Nodes;

[0014] If the complex Boolean logic expression is unbracketed and flattened according to the operation rules, it can be parsed into multiple basic expressions of OR operation, namely a*c+b*c+d*f+e*f. Then the number of nodes is 4, namely a*c, b*c, d*f and e*f.

[0015] The Special Condition Common structure indicates that as long as the execution result of one Node of the interlocking special condition is True, the special condition can meet the system requirements.

[0016] Preferably, in step S3, the Special Condition Node structure defines the number of Element (number of elements) contained in each Node and the Special Condition Element (special condition element) structure, and a logical AND operation is used between all elements contained in each Node;

[0017] If the basic expression after the script parses the complex Boolean expression and flattens it into a*c, then number of Element is 3;

[0018] The Special Condition Node structure indicates a special condition. If at least one element has a FALSE execution result, the Node execution result will be FALSE.

[0019] Preferably, in step S3, the Special Condition Element structure defines detailed information of the equipment contained in each element, including but not limited to equipment type, equipment ID and equipment status required by special conditions; equipment types include but are not limited to turnouts, routes, signals and inspections.

[0020] Preferably, in step S5, the execution result of each Node is traversed in the defined calling interface function is Special Condition NodeStatisfied(), and as long as the condition of one Node is satisfied, it can be indicated that the execution result of the special condition is TRUE.

[0021] Preferably, in step S5, the execution result in each Element data is judged in the defined calling interface function is Special Condition NodeStatisfied(). As long as the condition of one Element is not satisfied, it can be said that the execution result of the Node condition is FALSE. Only when the execution results of all Element are TRUE, the execution result of the Node condition is TRUE.

[0022] Preferably, in step S5, the defined calling interface function is Special Condition NodeStatisfied() determines whether the special condition of each Element is satisfied, and returns TRUE if satisfied, otherwise returns FALSE.

[0023] Preferably, in step S5, the interface function is flexibly expanded according to the requirements of specific signal device scenarios.

[0024] The beneficial effects of the present invention are as follows: the present invention uses a python script to add a Boolean logic expression conversion rule method for special conditions to an existing interlocking table data conversion tool. The method generates a new data type and member structure based on the Boolean expression analysis of the special conditions, and stores the new data type and member structure in the interlocking data, so that the interlocking table data structure is clearer and more convenient to read. This technology completely separates the special conditions of the interlocking table from the trackside application software code, and can dynamically adjust the interlocking table structure according to different special conditions to meet the data upgrade requirements of different projects; the trackside configuration data and the application program are completely separated, and the data and the application program can be upgraded separately, which greatly saves the project cost on the premise of only upgrading and transforming the station data; the interlocking code is simpler to implement, the interface function provided to the outside is unified, and the code logic is clearer and easier to read; if a Boolean expression special condition is defined in a new signal device table item, or a new state is added to a certain signal device, the interlocking software can be implemented by simply extending the structure Special Condition Element and the interface function is Special Condition ElementStatisfied(), which is convenient for expansion. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 It is a flow chart of an optimization method for generating a special condition data structure for configuring an interlocking table according to the present invention;

[0026] Figure 2 is a schematic diagram of the Special Condition Common structure of the present invention;

[0027] Figure 3 It is a schematic diagram of the Special Condition Node structure in the present invention;

[0028] Figure 4 is a schematic diagram of the Special Condition Element structure in the present invention;

[0029] Figure 5 It is a schematic diagram of a special condition data structure generated in the switch999 interlock table in an embodiment of the present invention;

[0030] Figure 6 It is a schematic diagram of the structure of the interface function is Special Condition Node Statisfied() in the present invention;

[0031] Figure 7 It is a schematic diagram of the execution result of the interface function is Special Condition Node Statisfied() traversing each Node in the present invention;

[0032] Figure 8 It is a schematic diagram of the execution result of the interface function is Special Condition Node Statisfied() in the present invention for judging each Element data. DETAILED DESCRIPTION

[0033] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. In the description of the present invention, it should be noted that the terms "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside" and the like indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, which are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as a limitation on the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance.

[0034] The present invention will be further described below in conjunction with the accompanying drawings.

[0035] Special conditions in the interlocking table items will appear in the form of a Boolean expression. Complex Boolean expressions generally use variables, and ("*"), or ("+"), and brackets ("(", ")") to form a logical expression. This patent description takes the following two special conditions as examples, where the variables represent the interlocking device status, "+" represents logical or, and "*" represents logical and.

[0036] For example, (a+b)*(c+d), (a+b)*c+(d+e)*f; each sub-item of the above expression, such as "a", represents a combination of a specific signal device and its status. For example, "GD1000_VACANT" means that the segment GD1000 is in an idle state. It can be seen that (a+b) represents a combination of two signal device states.

[0037] The implementation idea of ​​this patent uses a python (Python is a commonly used programming language) script to read the special condition table items of the interlocking table, and removes the brackets of the complex Boolean logic expression through the operation rules and then flattens it out, that is, the following steps:

[0038] like Figure 1 As shown, a method for optimizing the generation of a special condition data structure for an interlocking table configuration includes:

[0039] Step S1, using a python script to read the special condition table items of the interlocking table.

[0040] Step S2, removing brackets from the complex Boolean logic expression and breaking it up flatly according to the operation rules, and parsing it into multiple basic expressions of OR operation.

[0041] In the embodiment, if the Python script reads the interlock table special condition item as (a+b)*(c+d), the complex Boolean logic expression is flattened and disassembled after removing the brackets according to the operation rules, and parsed into multiple basic expressions of OR operations as a*c+a*d+b*c+b*d;

[0042] If the Python script reads the special condition item of the interlocking table as (a+b)*c+(d+e)*f, the complex Boolean logic expression is flattened after removing the brackets according to the operation rules, and parsed into multiple basic expressions of OR operations: a*c+b*c+d*f+e*f.

[0043] The execution result of the Boolean logic expression is the result of the logical OR operation of multiple simple expressions, and all special conditions in each simple expression are logically ANDed.

[0044] A Boolean logic expression evaluates to true as long as at least one of the simple expressions evaluates to true.

[0045] For example, the basic logic expression "a*c" can be mapped to "Switch999_Left*ZCJ_Low". As long as any of the device scenarios appears, the value of the original logic expression is true, which triggers the related locking logic, such as route authorization.

[0046] In summary, complex logical expressions can be parsed and decomposed into a list of basic logical expressions that are logically ORed with each other. When the value of any basic logical expression is TRUE, the value of the complex logical expression is TRUE. The basic logical expressions generated in this way are more convenient for expressing and identifying special conditional scenarios.

[0047] Considering that the special conditions defined by the interlocking system are scattered in various interlocking equipment items, such as some special conditions for route authorization added to the interlocking route equipment item, some special conditions for switch locking added to the switch locking equipment, etc. Based on complex Boolean expressions, the special condition software module is separated from the interlocking application program, and the following general special condition data structure members are defined in the interlocking signal equipment data structure containing the special condition table items.

[0048] Step S3, parsing basic expressions one by one to generate a table entry special condition data structure.

[0049] In the embodiment, Special Condition Common is defined as a general structure of a special condition expression, such as Figure 2 As shown, the Special Condition Common structure contains the number of Nodes and the Special Condition Node structure, and all Nodes use logical OR operations;

[0050] If the complex Boolean logic expression is unbracketed and flattened according to the operation rules, it can be parsed into multiple basic expressions of OR operation, namely a*c+b*c+d*f+e*f. Then the number of nodes is 4, namely a*c, b*c, d*f and e*f.

[0051] The Special Condition Common structure indicates that as long as the execution result of one Node of the interlocking special condition is True, the special condition can meet the system requirements.

[0052] In the embodiment, Figure 3 As shown, the Special Condition Node structure defines the number of elements contained in each Node and the Special Condition Element structure. All elements contained in each Node use logical AND operations.

[0053] If the basic expression after the script parses the complex Boolean expression and flattens it into a*c, then number of Element is 3;

[0054] The Special Condition Node structure indicates a special condition. If at least one element has a FALSE execution result, the Node execution result will be FALSE.

[0055] In the embodiment, Figure 4 As shown, the Special Condition Element structure defines the detailed information of the equipment contained in each element, including but not limited to the equipment type, equipment ID and equipment status required by special conditions; equipment types include but are not limited to turnouts, routes, signals and inspections; the structure can be flexibly and dynamically expanded according to specific needs; in the above-mentioned expression "Switch999_Left", the equipment type deviceTyp e is a turnout, the equipment ID, i.e., deviceId, is 999, and the equipment status deviceStatus is Left.

[0056] Take the special conditions in the lock table of switch999 as an example:

[0057] (GC13-16_OCC+GC11-12_FV)*C13_NOT_LEFT+(GC15-22_OCC+GC15-22_FV)*C15_NOT_RIGHT;

[0058] The special condition data structure generated in the switch999 interlocking table by the optimization method of the present invention is as follows Figure 5 shown.

[0059] The above explains the method for generating special condition data structure. On the one hand, this patent can dynamically adjust the interlocking table according to the requirements of different special condition scenarios to facilitate expansion; on the other hand, the interlocking table configuration data and application software are completely isolated to facilitate the upgrade and transformation of the project, and then define the external interface.

[0060] Step S4, define a general special condition calling interface function, such as Figure 6 shown.

[0061] Step S5, complete separation of configuration data and application program by calling the table entry special condition data structure through the interface function.

[0062] In the embodiment, the defined calling interface function is Special Condition Node Statisfied() traverses the execution result of each Node, such as Figure 7As shown, as long as one of the Node conditions is met, it can be said that the execution result of the special condition is TRUE.

[0063] In the embodiment, the defined calling interface function is Special Condition Node Statisfied() determines the execution result in each Element data, such as Figure 8 As shown, as long as one of the Element's conditions is not met, it can be said that the Node condition execution result is FALSE. Only when all the Element execution results are TRUE, the Node condition execution result is TRUE.

[0064] In the embodiment, the defined calling interface function is Special Condition Node Statisfied() determines whether the special condition of each Element is satisfied, and returns TRUE if satisfied, otherwise returns FALSE.

[0065] In the embodiment, the interface function is flexibly expanded according to the requirements of specific signal device scenarios.

[0066] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions described in the above embodiments may still be modified, or some or all of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for optimizing the generation of special condition data structure for interlock table configuration, characterized in that: include: Step S1, using a python script to read the special condition table items of the interlocking table; Step S2, removing brackets from the complex Boolean logic expression and disassembling it flatly according to the operation rules, and parsing it into multiple basic expressions of OR operation; Step S3, parsing basic expressions one by one to generate a table entry special condition data structure; Step S4, defining a general special condition calling interface function; Step S5, complete separation of configuration data and application program by calling the table entry special condition data structure through the interface function.

2. The method for optimizing the generation of interlock table configuration special condition data structure according to claim 1, characterized in that: In step S2, if the python script reads the special condition entry of the interlocking table as (a+b)*c+(d+e)*f, the complex Boolean logic expression is flattened after removing the brackets according to the operation rules, and parsed into multiple basic expressions of OR operations as a*c+b*c+d*f+e*f.

3. The method for optimizing the generation of interlock table configuration special condition data structure according to claim 2, characterized in that: In the step S3, Special Condition Common is defined as a general structure of a special condition expression. The Special Condition Common structure includes the number of Nodes and the Special Condition Node structure. A logical OR operation is used between all Nodes. If the complex Boolean logic expression is unbracketed and flattened according to the operation rules, it can be parsed into multiple basic expressions of OR operation, namely a*c+b*c+d*f+e*f. Then the number of nodes is 4, namely a*c, b*c, d*f and e*f. The Special Condition Common structure indicates that as long as the execution result of one Node of the interlocking special condition is True, the special condition can meet the system requirements.

4. The method for optimizing the generation of interlock table configuration special condition data structure according to claim 3, characterized in that: In step S3, the Special Condition Node structure defines the number of elements and the Special Condition Element structure contained in each Node, and a logical AND operation is used between all elements contained in each Node; If the basic expression after the script parses the complex Boolean expression and flattens it into a*c, then the number of Elements is 3; The Special Condition Node structure indicates a special condition. If at least one element has a FALSE execution result, the Node execution result will be FALSE.

5. The method for optimizing the generation of interlock table configuration special condition data structure according to claim 4, characterized in that: In step S3, the Special Condition Element structure defines detailed information of the equipment contained in each element, including but not limited to the equipment type, equipment ID and equipment status required by the special condition; the equipment type includes but is not limited to turnout, route, signal and inspection.

6. The method for optimizing the generation of interlock table configuration special condition data structure according to claim 3, characterized in that: In the step S5, the defined calling interface function is Special Condition Node Statisfied() traverses the execution result of each Node, and as long as the condition of one Node is satisfied, it can be indicated that the execution result of the special condition is TRUE.

7. The method for optimizing the generation of interlock table configuration special condition data structure according to claim 4, characterized in that: In the step S5, the defined calling interface function is Special Condition Node Statisfied() judges the execution result in each Element data. As long as the condition of one Element is not satisfied, it can be said that the execution result of the Node condition is FALSE. Only when the execution results of all Elements are TRUE, the execution result of the Node condition is TRUE.

8. The method for optimizing the generation of interlock table configuration special condition data structure according to claim 5, characterized in that: In step S5, the defined calling interface function is Special Condition Node Statisfied() determines whether the special condition of each Element is satisfied, and returns TRUE if satisfied, otherwise returns FALSE.

9. The method for optimizing the generation of interlock table configuration special condition data structure according to claim 1, characterized in that: In step S5, the interface function is flexibly expanded according to the specific signal device scenario requirements.