A script-based interlocking data automatic configuration method
Patent Information
- Application Number
- CN202310502149.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-06
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2043-05-06
AI Technical Summary
[0003]为了克服上述现有技术中存在的缺陷,本发明公开了一种基于脚本的联锁数据自动配置方法,本发明的目的是解决现有技术中联锁系统规则文件配置主要依靠手工编制,工作量大、容易出现错误的问题
本发明提供的基于脚本的联锁数据自动配置方法,提供了标准化VCF配置开发流程。由于联锁规则的复杂性,传统的人工配置方式需要从多个种类的输入中获设备信息,配置多个表格和配置项目,花费时间较长。自动配置提高了联锁规则文件的生成效率,降低了时间成本,保障了配置数据的准确性。
Smart Images

Figure CN116662110B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of rail transit signaling technology, and more specifically to a script-based automatic configuration method for interlocking data. Background Technology
[0002] The Interlocking Rule File (VCF) is the core document of the interlocking system. It contains the decision-making logic for various devices such as signals, track sections, and switches. Each trackside device is characterized by numerous states, actions, and complex impacts. The configuration logic of the interlocking rule file is complex, requiring reference to multiple input sources. These different input data are closely related and have different file formats. Currently, the configuration of interlocking system rule files mainly relies on manual compilation, which is labor-intensive, error-prone, and requires interlocking rule compilers to be proficient in interlocking signal rules and possess considerable experience. Summary of the Invention
[0003] To overcome the shortcomings of the existing technology, this invention discloses a script-based automatic configuration method for interlocking data. The purpose of this invention is to solve the problem that the configuration of interlocking system rule files in the existing technology mainly relies on manual compilation, which is labor-intensive and prone to errors. This invention uses a script-based approach with custom functions to query, transform, and output data, making it suitable for different interlocking scenarios; it achieves data parsing of input files, correct mapping between input files and scripts, script parsing and execution, and VCF file operations.
[0004] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A script-based method for automatic configuration of interlocking data includes the following steps: S1. Input configuration file and parse the input file. After parsing, save it to a data class object. Preprocess and check the input file. At the same time, set up an index table to establish a data mapping between the input file and the script and store it in the data dictionary. In this invention, the input file is parsed and saved to the corresponding data class object, and an index table is set up to realize the data mapping between the input file and the script. The index table is established so that the script uses filename abbreviations, table name abbreviations, and column name abbreviations as parameters to index the data. The index table records the correspondence between the input file and the script parameters. When parsing and executing the script content, the correspondence is matched first before the data is retrieved.
[0005] Preferably, step S1 includes the following steps: S11. Read the contents of the station basic information table, the TCC interface information table, the RBC interface information table, the neighboring station CBI interface information table, the script file, and the station information comparison table file through the input file path configured in the CONFIG file, and parse and save them as a DataTable data object. S12. Using the file name, table name, and column name of the station information lookup table as index keys, establish a data mapping between the script parameters of the script file and the input file, and store the DataTable data object after establishing the data mapping into the data dictionary; In this invention, the script file contains multiple scripts, each containing multiple script statements (starting and ending with [BEGIN] / ), and each script statement contains a function and a list of function parameters. Data mapping is achieved using a data dictionary and a DataTable (table structure) data object. The association between parameters and input files is achieved by looking up the dictionary and then the table.
[0006] S13. Perform data format standardization checks on the input file, including checking the matching of brackets for turnout conditions in the station information table; when there are multiple data in an Excel cell of the input file, split the cell content and check each data; and issue an alarm when an error is detected. S14. Use the script executor to identify the parameters of the query script and call the corresponding TAB overload function according to the parameter list; In this invention, the purpose of setting the above S14 step is to realize multiple types of search methods based on the judgment conditions corresponding to different parameter lists.
[0007] S15. The query module obtains the actual data object by matching the data dictionary according to the script parameters, and matches the data object cell according to the column name and search conditions in the parameter list. When there are multiple data in the cell, the cell content is split and each data is matched. If the match is successful, the query result is returned; otherwise, an empty set or invalid value is returned.
[0008] In this invention, the purpose of setting the above-mentioned S15 step is to realize the query interface between script parameters and real data.
[0009] S2. Use the script executor to execute the script content. When executing the script content, the script structure is parsed through syntax analysis, the function functions are obtained through lexical analysis, and the station equipment information is obtained by querying the corresponding mapping relationship through the data dictionary and finding the source data through the function parameter list. Preferably, in step S2, the function is a user-defined function, including defining TAB, FIND, ROW, and COL functions, defining functions for deleting, adding, replacing, and extracting strings, defining functions for merging, finding the intersection, and finding the complement of sets, and defining functions for negating, logical AND, and logical OR operations.
[0010] In step S2, the script is segmented by a parser, extracting function names and parameters. Custom functions are crucial for data transformation. To ensure script readability and ease of future maintenance and upgrades, the script defines functions such as TAB / FIND / ROW / COL for indexing input data, string manipulation functions like delete, add, replace, and truncate, set manipulation functions like merge, intersection, and complement, and logical operations like negation, logical AND, and logical OR. The script logic is implemented through combinations of these custom functions.
[0011] Preferably, in step S2, when the script executor encounters start and end tags, the script executor executes the script between the two tags.
[0012] In this invention, the script file contains multiple configuration scripts, and each configuration script has tags at the beginning and end.
[0013] Preferably, in step S2, when the script executor executes the script, the embedded script statements are executed sequentially. Each script defines global variables and functions. Global variables can be called by parameters of scripts executed later. The global variables are called after they have been declared.
[0014] In step S2, when the script executor encounters start and end tags, it executes the script between the two tags. Embedded script statements are executed sequentially. Global variables and functions defined in each script can be accessed as parameters by subsequently executed scripts. Variables must have been declared previously before being accessed; otherwise, the retrieved variable value is unknown.
[0015] Preferably, in step S2, script execution includes the following steps: S21. Select the VCF table and VCF configuration item to be configured in the human-computer interaction interface, and the software records the configuration number. The configuration method of the present invention includes a human-computer interaction interface.
[0016] S22. Compile each script function according to the specified format, including function name, parameter list, and delimiter; S23. Use software to perform syntax checks on the selected script, perform data validity checks on the search conditions of functions with search conditions, perform matching checks on the output devices and the devices defined in the station map, and check the script hierarchy. If the checks fail, the software will report an error and stop execution. S24. After the check is completed, read the table name and configuration item number of the output function configuration in the execution script. If it is output to a table, clear the corresponding table. If it is output to a single configuration item cell, clear the corresponding cell. S25. Initialize function variables, parse and execute script statements, and output the parsing results to the VCF table.
[0017] In the above steps, "software" specifically refers to the configuration method of this patent.
[0018] Preferably, in step S25, the parsing and execution of script statements includes script syntax analysis and script lexical analysis; the script syntax analysis corresponds to the parsing of script structures, including nested assignment, clear, VCF file operations, IF, ESLE IF, ELSE, and WHILE statement blocks; the script lexical analysis breaks down the corresponding script statements into keywords to extract operation names and parameter names.
[0019] In this invention, script parsing can be divided into two processes: syntax analysis and lexical analysis. Syntax analysis corresponds to the parsing of the script structure, including assignment, clearing, VCF file operations, nested IF / ESLE, IF / ELSE, WHILE, and other statement blocks. Lexical analysis breaks down the corresponding script statements into keywords, extracting operation names and parameter names. Based on the syntax sequence of the user-defined function, the script statements are segmented. If a parameter of input file type is encountered, it is matched and validated against the name in the index table. If validation fails, an error message is displayed and execution terminates.
[0020] Preferably, in step S2, the syntax analysis includes the following steps: A. Determine if there is a start symbol. If yes, proceed to the script parsing process and then to step B. Otherwise, consider it an invalid script and skip it. B. Determine if it is an IF statement. If yes, proceed to IF statement block parsing; otherwise, proceed to step C. The IF statement block parsing includes: sequentially searching for the conditions and scopes of IF, ELSE IF, and ELSE statements; after the search is complete, parsing each condition statement in turn; if the returned result is true, executing all scripts within the scope of the IF condition; and exiting the scope of the IF statement block after execution. In the above steps, it is determined whether it is an IF statement. If so, the IF statement block is parsed. First, the condition and scope of the IF statement are searched. Then, the condition and scope of the ELSE IF statement are searched. There may be multiple ELSE IF statement blocks or none. Finally, the scope of the ELSE statement is searched. After the search is completed, each conditional statement is parsed in turn. If the return result is true, all scripts in the scope of that IF condition are executed. After execution, the scope of the IF statement block is exited.
[0021] C. Determine if it is a WHILE statement. If yes, proceed to the WHILE statement block parsing; otherwise, proceed to step D. The WHILE statement block parsing includes: the script WHILE loop condition is the variable name, and the loop count is the number of elements of the variable; after entering the WHILE statement block, the WHILE loop condition and all script statements contained in the WHILE loop body are first obtained; when the variable of the current loop condition is executed in the loop body, it is replaced with the variable element; the equal sign assignment in the loop can accumulate all loop results; D. Determine if there is an assignment statement; if so, proceed to the lexical analysis process. In this invention, apart from IF / WHILE statements, other scripts are assignment statements by default. Assignments include direct variable assignment and assignment using user-defined functions. Direct variable copying results in cumulative values and can be reused within a WHILE loop. User-defined function assignments are parsed based on the function name and parameter list, calling a query function to retrieve station equipment information. The query function can filter specified search conditions and query results. The Index parameter is used as the condition filter, and the KeyIndex parameter is used as the result filter. When KeyIndex is a character, partial matching filtering is performed; when KeyIndex is a number, the result order is matched.
[0022] E. Determine if there is an end symbol. If yes, end and return; otherwise, return to step B.
[0023] Preferably, in step S2, the calculation process of the script executor after parsing the script includes the following steps: a. Obtain the function name and function parameters of the script through the script executor, and retrieve the actual source data storage name by querying the index table based on the parameter name; b. Query the input data class object based on the source data storage name to obtain the actual data value of the script parameters; c. After obtaining the actual data, call the function according to the function name to perform data calculations; d. Perform data processing on the obtained calculation results, including deleting invalid information of empty turnout position conditions, and then simplifying the results of specific logical operations. e. Assign the result of data processing to the variable on the left side of the equals sign.
[0024] In this invention, the above process is the calculation process of the script executor after parsing the script, including parsing (including syntax analysis / lexical analysis) and execution (performing the calculation process according to the script's functions and parameter list).
[0025] In this invention, the function names and parameters of the script are obtained through a parser. The actual source data storage name is retrieved from the index table based on the parameter names, and then the actual data values of the script parameters are obtained by querying the input data class object based on the source data names. After obtaining the actual data, the function class is invoked according to the function name to perform data operations. The obtained operation results need to be processed, including deleting invalid information such as empty turnout position conditions and simplifying specific logical operation results. The processed results are then assigned to the variable on the left side of the equals sign. The purpose of these steps is to delete invalid and redundant data, ensuring the correctness of the script output.
[0026] Preferably, in step S2, during the query, the query conditions are matched twice. When the query condition is turnout location condition + section, a full match search is performed. If no corresponding data is found, a separate section match search is performed. The query results are filtered, including index filtering and content filtering. During index filtering, forward or reverse matching is performed based on the sequence number. During content filtering, the wildcard * represents any string, and content matching is performed based on the combination of the string and the wildcard.
[0027] In this invention, when performing a TAB query, the query conditions can be matched twice. When the query condition is "turnout location condition + section", a full match search is performed first. If no corresponding data is found, a separate section match search is performed. The TAB query results can be filtered, divided into index filtering and content filtering. Index filtering performs forward or reverse matching based on the sequence number; content filtering uses the wildcard * to represent any string, and content matching is performed based on the combination of the string and the wildcard.
[0028] S3. When executing the script, use the script executor to update the contents of the VCF table. After the script is executed, serialize the VCF table data object into a VCF file and save it.
[0029] In the steps described above, the script executor updates the VCF table content by parsing the OUTPUT function. After the script execution is complete, the VCF data object is serialized into a VCF file and saved.
[0030] Preferably, in step S3, the VCF table includes a parameter declaration table, a data configuration table, a communication file table, a special inspection table, a subway list, a single-coupling shunting table, and a non-route shunting table.
[0031] In this invention, the VCF table includes multiple tables such as a parameter declaration table, a data configuration table, a communication file table, a special inspection table, a subway list, single-coupling shunting, and off-route shunting.
[0032] Preferably, in step S3, the VCF file is a binary data file, including a file header, a table content section, and CRC and MD5 code information of the entire VCF file. The file header defines the VCF file identifier, station name, station number, version string, annotations, total number of VCF tables, and table type and name information.
[0033] Preferably, in step S3, the VCF data type includes: Numeric types have a maximum word length of 4 bytes. For string types, the string length is stored as a data prefix along with the string content; A string array, whose length is stored as a data prefix along with the array contents.
[0034] Preferably, in step S3, the VCF parser extracts data from the binary stream, parses the corresponding symbol sequence according to the rules, and saves it to a data class object; when a modification instruction is received, the write function of the VCF data class object writes the data to the corresponding location.
[0035] In this invention, step S3 outputs the variable content to a VCF file. The VCF is a binary data file using a data structure similar to Excel, containing multiple interlocking rule configuration tables. The VCF file content is divided into three parts: the first part is the file header, which defines the VCF file identifier, station name, station number, version string, annotations, the total number of VCF tables, and the type and name of each table. The second part is the table content. The third part is the CRC and MD5 hash information for the entire VCF file. VCF data types can be divided into three categories: 1. Numeric types, with a maximum word length of 4 bytes; 2. String types, where the string length is stored as a data prefix along with the string content; 3. String arrays, where the array length is stored as a data prefix along with the array content. The VCF parser extracts data from the binary stream, parses the corresponding symbol sequence according to the rules, and saves it to a data class object. When a modification command is received, the write function of the VCF data class object writes the data to the corresponding location.
[0036] The beneficial effects of this invention are: This invention provides a script-based automatic configuration method for interlocking data, offering a standardized VCF configuration development process. Due to the complexity of interlocking rules, traditional manual configuration methods require obtaining equipment information from multiple types of inputs, configuring multiple tables and configuration items, which is time-consuming. Automatic configuration improves the efficiency of interlocking rule file generation, reduces time costs, and ensures the accuracy of configuration data.
[0037] This invention identifies and checks station equipment information during the reading of source and output data. If erroneous data or unknown equipment is detected, a log alarm will be output or the configuration process will be directly interrupted to prompt the user to check. This prevents erroneous data from being output to the interlocking rule logic during the configuration process.
[0038] Once the script file of this invention is compiled for the first time, it can be applied to the automatic configuration of rule files for multiple interlocking projects. After configuration on a rule file of a certain version, the tool can recognize the old data and configure the configuration items for the current script execution without affecting the existing configuration items, facilitating future upgrades and maintenance. The script-based approach allows for the customization of function calls for new application scenarios, enhancing flexibility. Attached Figure Description
[0039] Figure 1 This is a schematic diagram of the station equipment information query process of the present invention; Figure 2 This is a schematic diagram of the script parsing process of the present invention; Figure 3 This is a schematic diagram of the script syntax analysis process of the present invention. Detailed Implementation
[0040] The following will provide a clear and complete description of the concept, specific structure, and technical effects of the present invention in conjunction with the embodiments and accompanying drawings, so as to fully understand the purpose, features, and effects of the present invention.
[0041] Example 1 A script-based method for automatic configuration of interlocking data includes the following steps: S1. Input configuration file and parse the input file. After parsing, save it to a data class object. Preprocess and check the input file. At the same time, set up an index table to establish a data mapping between the input file and the script and store it in the data dictionary. S2. Use the script executor to execute the script content. When executing the script content, the script structure is parsed through syntax analysis, the function functions are obtained through lexical analysis, and the station equipment information is obtained by querying the corresponding mapping relationship through the data dictionary and finding the source data through the function parameter list. S3. When executing the script, use the script executor to update the contents of the VCF table. After the script is executed, serialize the VCF table data object into a VCF file and save it.
[0042] Example 2 This embodiment further elaborates on step S1 based on embodiment 1. Step S1 is the step of querying station equipment information. After parsing the input file, it is saved to the corresponding data class object, and an index table is set up to realize the data mapping between the input file and the script. The index table is established, and the script uses file name abbreviations, table name abbreviations, and column name abbreviations as parameters to index the data. The index table records the correspondence between the input file and the script parameters. When parsing and executing the script content, the correspondence is matched first before the data is obtained.
[0043] like Figure 1 As shown, step S1 includes the following steps: S11. Read the contents of the station basic information table, the TCC interface information table, the RBC interface information table, the neighboring station CBI interface information table, the script file, and the station information comparison table file through the input file path configured in the CONFIG file, and parse and save them as a DataTable data object. S12. Using the file name, table name, and column name of the station information lookup table as index keys, establish a data mapping between the script parameters of the script file and the input file, and store the DataTable data object after establishing the data mapping into the data dictionary; S13. Perform data format standardization checks on the input file, including checking the matching of brackets for turnout conditions in the station information table; when there are multiple data in an Excel cell of the input file, split the cell content and check each data; and issue an alarm when an error is detected. S14. Use the script executor to identify the parameters of the query script and call the corresponding TAB overload function according to the parameter list; S15. The query module obtains the actual data object by matching the data dictionary according to the script parameters, and matches the data object cell according to the column name and search conditions in the parameter list. When there are multiple data in the cell, the cell content is split and each data is matched. If the match is successful, the query result is returned; otherwise, an empty set or invalid value is returned.
[0044] Example 3 This embodiment further elaborates on step S2 based on embodiment 2. In step S2, the script is segmented by a parser, extracting function names and parameters. Custom functions are key to data transformation. To ensure script readability and ease of maintenance and upgrades, the script defines functions such as TAB / FIND / ROW / COL for indexing input data, string manipulation functions such as delete, add, replace, and truncate, set manipulation functions such as merge, intersection, and complement, and logical manipulation functions such as negation, logical AND, and logical OR. The script logic is implemented through combinations of custom functions.
[0045] In step S2, when the script executor encounters start and end tags, it executes the script between the two tags. Embedded script statements are executed sequentially. Global variables and functions defined in each script can be accessed as parameters by subsequently executed scripts. Variables must have been declared previously before being accessed; otherwise, the retrieved variable value is unknown.
[0046] like Figure 2 As shown, the script execution steps are as follows: S21. Select the VCF table and VCF configuration item to be configured in the human-computer interaction interface, and the software records the configuration number. S22. Compile each script function according to the specified format, including function name, parameter list, and delimiter; S23. Use software to perform syntax checks on the selected script, perform data validity checks on the search conditions of functions with search conditions, perform matching checks on the output devices and the devices defined in the station map, and check the script hierarchy. If the checks fail, the software will report an error and stop execution. S24. After the check is completed, read the table name and configuration item number of the output function configuration in the execution script. If it is output to a table, clear the corresponding table. If it is output to a single configuration item cell, clear the corresponding cell. S25. Initialize function variables, parse and execute script statements, and output the parsing results to the VCF table.
[0047] In this invention, script parsing can be divided into two processes: syntax analysis and lexical analysis. Syntax analysis corresponds to the parsing of the script structure, including assignment, clearing, VCF file operations, nested IF / ESLE, IF / ELSE, WHILE, and other statement blocks. Lexical analysis breaks down the corresponding script statements into keywords, extracting operation names and parameter names. Based on the syntax sequence of the user-defined function, the script statements are segmented. If a parameter of input file type is encountered, it is matched and validated against the name in the index table. If validation fails, an error message is displayed and execution terminates.
[0048] like Figure 3 As shown, in step S2, the syntax analysis includes the following steps: A. Determine if there is a start symbol. If yes, proceed to the script parsing process and then to step B. Otherwise, consider it an invalid script and skip it. B. Determine if it is an IF statement. If yes, proceed to IF statement block parsing; otherwise, proceed to step C. The IF statement block parsing includes: sequentially searching for the conditions and scopes of IF, ELSE IF, and ELSE statements; after the search is complete, parsing each condition statement in turn; if the returned result is true, executing all scripts within the scope of the IF condition; and exiting the scope of the IF statement block after execution. C. Determine if it is a WHILE statement. If yes, proceed to the WHILE statement block parsing; otherwise, proceed to step D. The WHILE statement block parsing includes: the script WHILE loop condition is the variable name, and the loop count is the number of elements of the variable; after entering the WHILE statement block, the WHILE loop condition and all script statements contained in the WHILE loop body are first obtained; when the variable of the current loop condition is executed in the loop body, it is replaced with the variable element; the equal sign assignment in the loop can accumulate all loop results; D. Determine if there is an assignment statement; if so, proceed to the lexical analysis process. In this invention, apart from IF / WHILE statements, other scripts are assignment statements by default. Assignments include direct variable assignment and assignment using user-defined functions. Direct variable copying results in cumulative values and can be reused within a WHILE loop. User-defined function assignments are parsed based on the function name and parameter list, calling a query function to retrieve station equipment information. The query function can filter specified search conditions and query results. The Index parameter is used as the condition filter, and the KeyIndex parameter is used as the result filter. When KeyIndex is a character, partial matching filtering is performed; when KeyIndex is a number, the result order is matched.
[0049] E. Determine if there is an end symbol. If yes, end and return; otherwise, return to step B.
[0050] In this invention, the function names and parameters of the script are obtained through a parser. The actual source data storage name is retrieved from the index table based on the parameter names, and then the actual data values of the script parameters are obtained by querying the input data class object based on the source data names. After obtaining the actual data, the function class is invoked according to the function name to perform data operations. The obtained operation results need to be processed, including deleting invalid information such as empty turnout position conditions and simplifying specific logical operation results. The processed results are then assigned to the variable on the left side of the equals sign.
[0051] When performing a TAB query, secondary matching can be performed on the query conditions. When the query condition is "turnout location + section", a full match search is performed first. If no corresponding data is found, a section-specific match search is performed. Data filtering can be performed on the TAB query results, divided into index filtering and content filtering. Index filtering performs ascending or descending order matching based on the sequence number; content filtering uses the wildcard * to represent any string, and matches content based on combinations of strings and wildcards.
[0052] Example 4 This embodiment further elaborates on step S3 based on embodiment 3. In step S3, the variable content is output to a VCF file. VCF is a binary data file using a data structure similar to Excel, containing multiple interlocking rule configuration tables. The content of the VCF file is divided into three parts: the first part is the file header, which defines the VCF file identifier, station name, station number, version string, annotations, the total number of VCF tables, and the type and name of the tables. The second part is the table content. The third part is the CRC and MD5 code information of the entire VCF file. VCF data types can be divided into three categories: 1. Numeric type, with a maximum word length of 4 bytes; 2. String type, where the string length is stored as a data prefix along with the string content; 3. String array, where the array length is stored as a data prefix along with the array content. The VCF parser extracts data from the binary stream, parses the corresponding symbol sequence according to the rules, and saves it to a data class object. When a modification command is received, the write function of the VCF data class object writes the data to the corresponding location.
[0053] The embodiments of the present invention have been described in detail above, but the present invention is not limited to the described embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention, and these equivalents or substitutions are all included within the scope defined by the claims of the present invention.
Claims
1. A script-based automatic configuration method for interlocking data, characterized in that, Includes the following steps: S1. Input configuration file and parse the input file. After parsing, save it to a data class object. Preprocess and check the input file. At the same time, set up an index table to establish a data mapping between the input file and the script and store it in the data dictionary. S2. Use the script executor to execute the script content. When executing the script content, the script structure is parsed through syntax analysis, the function functions are obtained through lexical analysis, and the station equipment information is obtained by querying the corresponding mapping relationship through the data dictionary and finding the source data through the function parameter list. S3. When executing the script, use the script executor to update the contents of the VCF table. After the script is executed, serialize the VCF table data object into a VCF file and save it. Step S1 includes the following steps: S11. Read the contents of the station basic information table, the TCC interface information table, the RBC interface information table, the neighboring station CBI interface information table, the script file, and the station information comparison table file through the input file path configured in the CONFIG file, and parse and save them as a DataTable data object. S12. Using the file name, table name, and column name of the station information lookup table as index keys, establish a data mapping between the script parameters of the script file and the input file, and store the DataTable data object after establishing the data mapping into the data dictionary; S13. Perform data format standardization checks on the input file, including checking the matching of brackets for turnout conditions in the station information table; when there are multiple data in an Excel cell of the input file, split the cell content and check each data; and issue an alarm when an error is detected. S14. Use the script executor to identify the parameters of the query script and call the corresponding TAB overload function according to the parameter list; S15. The query module obtains the actual data object by matching the data dictionary according to the script parameters, and matches the data object cell according to the column name and search conditions in the parameter list. When there are multiple data in the cell, the cell content is split and each data is matched. If the match is successful, the query result is returned; otherwise, an empty set or invalid value is returned. In step S2, script execution includes the following steps: S21. Select the VCF table and VCF configuration item to be configured in the human-computer interaction interface, and the software records the configuration number. S22. Compile each script function according to the specified format, including function name, parameter list, and delimiter; S23. Use software to perform syntax checks on the selected script, perform data validity checks on the search conditions of functions with search conditions, perform matching checks on the output devices and the devices defined in the station map, and check the script hierarchy. If the checks fail, the software will report an error and stop execution. S24. After the check is completed, read the table name and configuration item number of the output function configuration in the execution script. If it is output to a table, clear the corresponding table. If it is output to a single configuration item cell, clear the corresponding cell. S25. Initialize function variables, parse and execute script statements, and output the parsing results to the VCF table.
2. The automatic configuration method for interlocking data as described in claim 1, characterized in that, In step S2, the function is a user-defined function, including defining TAB, FIND, ROW, and COL functions, defining functions for deleting, adding, replacing, and extracting strings, defining functions for merging, finding the intersection, and finding the complement of sets, and defining functions for negating, logical AND, and logical OR operations.
3. The automatic configuration method for interlocking data as described in claim 1, characterized in that, In step S2, when the script executor encounters start and end tags, the script executor executes the script between the two tags; When the script executor executes a script, the embedded script statements are executed sequentially. Each script defines global variables and functions. Global variables can be accessed by parameters of scripts executed later. Global variables are accessed only if they have been declared previously.
4. The automatic configuration method for interlocking data as described in claim 1, characterized in that, In step S2, the syntax analysis includes the following steps: A. Determine if there is a start symbol. If yes, proceed to the script parsing process and then to step B. Otherwise, consider it an invalid script and skip it. B. Determine if it is an IF statement. If yes, proceed to IF statement block parsing; otherwise, proceed to step C. The IF statement block parsing includes: sequentially searching for the conditions and scopes of IF, ELSE IF, and ELSE statements; after the search is complete, parsing each condition statement in turn; if the returned result is true, executing all scripts within the scope of the IF condition; and exiting the scope of the IF statement block after execution. C. Determine if it is a WHILE statement. If yes, proceed to the WHILE statement block parsing; otherwise, proceed to step D. The WHILE statement block parsing includes: the script WHILE loop condition is the variable name, and the loop count is the number of elements of the variable; after entering the WHILE statement block, the WHILE loop condition and all script statements contained in the WHILE loop body are first obtained; when the variable of the current loop condition is executed in the loop body, it is replaced with the variable element; the equal sign assignment in the loop can accumulate all loop results; D. Determine if there is an assignment statement; if so, proceed to the lexical analysis process. E. Determine if there is an end symbol. If yes, end and return; otherwise, return to step B.
5. The automatic configuration method for interlocking data as described in claim 1, characterized in that, In step S2, the calculation process of the script executor after parsing the script includes the following steps: a. Obtain the function name and function parameters of the script through the script executor, and retrieve the actual source data storage name by querying the index table based on the parameter name; b. Query the input data class object based on the source data storage name to obtain the actual data value of the script parameters; c. After obtaining the actual data, call the function according to the function name to perform data calculations; d. Perform data processing on the obtained calculation results, including deleting invalid information of empty turnout position conditions, and then simplifying the results of specific logical operations. e. Assign the result of data processing to the variable on the left side of the equals sign.
6. The automatic configuration method for interlocking data as described in claim 1, characterized in that, In step S2, during the query, the query conditions are matched twice. When the query conditions are turnout location conditions and section, a full match search is performed. If no corresponding data is found, a separate section match search is performed. The query results are filtered, including index filtering and content filtering. When filtering by index, the results are matched in ascending or descending order based on the sequence number. When filtering by content, the wildcard * represents any string, and the results are matched based on the combination of the string and the wildcard.
7. The automatic configuration method for interlocking data as described in claim 1, characterized in that, In step S3, the VCF table includes a parameter declaration table, a data configuration table, a communication file table, a special inspection table, a subway list, a single-coupling shunting table, and a non-route shunting table. In step S3, the VCF file is a binary data file, including a file header, table content, and CRC and MD5 code information of the entire VCF file. The file header defines the VCF file identifier, station name, station number, version string, annotations, total number of VCF tables, and table type and name information.
8. The automatic configuration method for interlocking data as described in claim 1, characterized in that, In step S3, the VCF data types include: Numeric types have a maximum word length of 4 bytes. For string types, the string length is stored as a data prefix along with the string content; A string array, where the array length is stored as a data prefix along with the array contents; In step S3, the VCF parser extracts data from the binary stream, parses the corresponding symbol sequence according to the rules, and saves it to a data class object; when a modification instruction is received, the write function of the VCF data class object writes the data to the corresponding location.
Citation Information
Patent Citations
Method for automated verification and regression test of software unit
CN105117335A
Automatic configuration method of computer interlocking configuration data, medium and electronic equipment
CN115981740A