A Formal Safety Data Generation Method for Interlocking Based on the Divide-and-Conquer Method

Through the partitioning and conquer method, large-scale variable collections are decomposed into small-scale parts, which solves the problem of high complexity in generating seif files, and improves generation efficiency and post-maintenance convenience.

CN115048410BActive Publication Date: 2025-07-29CASCO SIGNAL LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210805878.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-08
Publication Date
2025-07-29
Estimated Expiration
2042-07-08

AI Technical Summary

Technical Problem

When the prior art generates interlocking formal security data seif files, the time complexity is high, resulting in an exponential increase in the generation time, affecting the efficiency and security of formal verification.

Method used

The variable collection is decomposed into several small-scale parts by using the partitioning method. Through classified storage and partitioning method search, the variable search time is reduced and the seif file is generated.

Benefits of technology

Improves the efficiency of variable search, reduces the time complexity of generating seif files, and facilitates post-maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115048410B_ABST
    Figure CN115048410B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for generating interlocking formal safety data based on the divide-and-conquer method, which classifies and stores the variables on the left side of the Boolean expression, and uses the divide-and-conquer method to search for and find in the variables on the right side of the Boolean expression, so as to generate input variables. This method can greatly reduce the time for variable search and query, and improve the search efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of interlocking data, and particularly relates to a method for generating interlocking formal safety data based on the divide-and-conquer method. Background Art

[0002] In the formal verification of interlocking based on Prover iLock (Prover iLock is a desktop tool for developing application software for railway interlocking systems), the interlocking formal safety data seif file is a file storing interlocking logic, and this file is generated by converting the VTL file in the interlocking application data. The VTL file records the interlocking relationships between the station interlocking devices. BOOL equations of each interlocking logic variable are defined in the VTL file, and the BOOL equations are composed of logical boolean variables and budget symbols, as Figure 1 shown.

[0003] As safety data recording interlocking logic, the station VTL data contains thousands to tens of thousands of BOOL equations according to the size of the station yard, and each BOOL equation contains 2 to 1024 variables of different numbers. The station VTL data contains tens of thousands to hundreds of thousands of variables.

[0004] The seif file contains four parts: input parameter variables, timer parameter variables, boolean equations, and all parameter variables. The boolean equations correspond to the boolean expressions in the VTL file; the input parameter variables are variables not defined by equations as input variables, that is, if a variable on the right side of the equation does not appear on the left side of the equation, it is an input variable; the timer parameter variables are the variables on the left side of the equal sign of the boolean expression defining the delay time; all parameter variables are the set variables after removing duplicates of all variables on the left side and the right side of the boolean expression, which includes the input parameter variables and the time parameter variables.

[0005] Currently, when generating the seif file, search operations need to be performed among all expressions and variables. Each search needs to traverse tens of thousands of variables. When searching for input parameter variables, if a search is performed on all variables, its time complexity is extremely high. When the scale of the station type is larger, the conversion and generation time of the seif file will increase exponentially. This way of generating seif is time-consuming and inefficient, affecting the efficiency and safety of formal verification, and does not conform to the characteristics of fast and safe formal verification. Summary of the Invention

[0006] Currently, the efficiency of generating the interlocking formal safety data seif file is low. To solve this problem, the present invention proposes a method for generating interlocking formal safety data based on the divide-and-conquer method.

[0007] To achieve the above objectives, the present invention proposes a method for generating interlocking formalized safety data based on a divide-and-conquer approach. The core idea of the divide-and-conquer approach is to break down a large, difficult-to-solve problem into smaller, identical problems, allowing for individual solutions. Searching for a single variable within a set of tens or even hundreds of thousands of variables is like a massive problem to solve. Directly searching across all variables is time-consuming and inefficient. By breaking down all variables into smaller, smaller sets according to specific principles, and then performing a search, the target variable can be quickly found.

[0008] A method for generating interlocking formal safety data based on a divide-and-conquer approach includes the following steps:

[0009] S1. Initialize and read all Boolean expressions in the VTL file, obtain all variables on the left side of the Boolean expression equal sign, and store them in the left variable set; obtain all variables on the right side of the Boolean expression equal sign, and store them in the right variable set; obtain all complete Boolean expressions and store them in the Boolean expression set;

[0010] S2. Use a divide-and-conquer method to search in the left variable set and the right variable set to generate an input variable set;

[0011] S3, traversing the Boolean expression set to generate a timer variable set;

[0012] S4, traversing the Boolean expression set, replacing the operator symbols, and generating a Boolean equation set;

[0013] S5. Merge the variable set on the left and the variable set on the right, remove duplication, and generate a set of all parameter variables;

[0014] S6. Output the input variables, timer variables, Boolean equations and all parameter variables in the input variable set, timer variable set, Boolean equation set and all parameter variable sets in sequence and save them to the seif file in the order of input variables, timer variables, Boolean equations and all parameter variables to generate interlocking formal safety data.

[0015] Preferably, the Boolean expression stored in the Boolean expression set includes: a complete Boolean expression string, a delay time, a variable on the left side of the Boolean expression equal sign, and a variable on the right side of the Boolean expression equal sign.

[0016] Preferably, step S2 further comprises the following steps:

[0017] S21, traversing the left variable set, and classifying the variables in the left variable set and storing them in a key-value pair set;

[0018] S22. Traverse the right variable set, search the key-value pair set using a divide-and-conquer method, and generate an input variable set.

[0019] Preferably, the step S21 further comprises the following steps:

[0020] S211. Initialize and create a key-value pair set for classifying and storing left-side variables, where the key of the key-value pair is a string and the value is the left-side variable;

[0021] S212, setting a set size control value;

[0022] S213. Traverse the left variable set, and for each left variable LeftVar, sequentially intercept the preceding character, the preceding two characters, ..., the preceding n characters as a first intercepted character string, where n is not greater than the character length of the variable LeftVar; and classify the variables in the left variable set into variable sets with different first intercepted character strings as keys according to the different lengths of the first intercepted character strings.

[0023] S214 , traverse the left variable set, execute S213 for each variable in the left variable set, thereby adding all left variables to the variable set with the first intercepted string as the key, and generating a final key-value pair set.

[0024] Preferably, the set size control value is the integer of the square root of the number of variables in the left variable set.

[0025] Preferably, the step S213 further comprises the following steps:

[0026] S2131, intercept the previous character of the left variable LeftVar as the first intercepted character string;

[0027] S2132: If the first intercepted string is not a key in the key-value pair set, add the first intercepted string as a key in the key-value pair set, and add the variable LeftVar to the variable set with the first intercepted string as the key;

[0028] S2133: If the first intercepted character string has been used as a key in the key-value pair set, determining whether the number of variables in the variable set with the first intercepted character string as the key is less than the set size control value;

[0029] S2133a. If the number of variables in the variable set with the first intercepted string as the key is less than the set size control value, add the variable LeftVar to the variable set with the first intercepted string as the key;

[0030] S2133b. If the number of variables in the variable set with the first intercepted string as the key is not less than the set size control value, then determine whether the first intercepted string is equal to the variable LeftVar: if the first intercepted string is equal to the variable LeftVar, then add the variable LeftVar to the variable set with the first intercepted string as the key; if the first intercepted string is not equal to the variable LeftVar, then based on the length of the existing first intercepted string, intercept the variable LeftVar backward by one more character to form a new first intercepted string, and substitute the new first intercepted string into steps S2132-S2133 until the variable LeftVar is added to the variable set with the first intercepted string as the key.

[0031] Preferably, the step S22 further comprises the following steps:

[0032] S221, traverse the right variable set, and obtain the right variables in the right variable set in sequence;

[0033] S222. For each right-side variable rightVar, sequentially intercept the preceding character, the preceding two characters, ..., the preceding n' characters as a second intercepted character string, where n' is not greater than the character length of the variable rightVar; and determine whether the variable rightVar is an input variable based on whether the second intercepted character strings of different lengths are keys of the key-value pair set;

[0034] S223, traverse the right variable set, execute S222 for each variable in the right variable set, determine whether it is an input variable in turn, and store all input variables in the input variable set.

[0035] Preferably, the step S222 further comprises the following steps:

[0036] S2221, intercept the previous character of the right variable rightVar as the second intercepted character string;

[0037] S2222: If the second intercepted character string is not in the key set of the key-value pair set, it indicates that the right variable rightVar is not an input variable;

[0038] S2223. If the second intercepted string is in the key set of the key-value pair set, use the second intercepted string as a key to search for a variable set associated with the key, traverse the variable set, and determine whether the variable rightVar is in the variable set associated with the key;

[0039] S2223a. If the variable rightVar is in the variable set associated with the key, it indicates that the variable rightVar is an input variable, and the variable rightVar is stored in the input variable set.

[0040] S2223b. If the variable rightVar is not in the set of variables associated with the key, then based on the length of the existing second intercepted string, intercept one more character of rightVar backward to form a new second intercepted string, and substitute this new second intercepted string into steps S2222 - S2223; repeat the above process until it is determined whether the variable rightVar is the input variable.

[0041] Preferably, the step S3 further includes the following steps:

[0042] S31. For the timer expressions in the set of boolean expressions, store the variables on the left side of the equal sign of the timer expression into the timer variable set;

[0043] S32. Traverse all the boolean expressions in the set of boolean expressions, and execute S31 for each boolean expression in the set of boolean expressions, so as to store the variables on the left side of all the timer expressions into the timer variable set until the traversal is completed, and generate the final timer variable set.

[0044] Preferably, the step S31 further includes the following steps:

[0045] S311. For the boolean expressions in the set of boolean expressions, first determine whether it contains the TIME DELAY definition;

[0046] S312. The boolean expressions that do not contain the TIME DELAY definition are general expressions and are skipped without processing;

[0047] S313. The boolean expressions that contain the TIME DELAY definition are timer expressions. For the timer expressions, obtain the variables on the left side of the equal sign and store the variables into the timer variable set.

[0048] Preferably, the step S4 further includes the following steps:

[0049] S41. For each boolean expression in the set of boolean expressions, replace the operation symbols in the boolean expression, and store the boolean expression after replacement into the set of boolean equalities;

[0050] S42. Traverse all the boolean expressions in the set of boolean expressions, and process each boolean expression using step S41 to generate the final set of boolean equalities.

[0051] Preferably, the replacement method of the operation symbols in the boolean expression is: replace "=" with ":=", replace "+" with "#", replace "*" with "&", and replace ".N." with "~".

[0052] Preferably, step S5 further includes the following steps:

[0053] S51. Initialize and create a set for storing all parameter variables;

[0054] S52. For the variables in the left variable set, determine whether they exist in the set of all parameter variables; if they exist, skip and do not process; if they do not exist, add the variables to the set of all parameter variables;

[0055] S53. Traverse all the variables in the left variable set and perform the operation of S52 on them in sequence until the traversal is completed;

[0056] S54. For the variables in the right variable set, sequentially determine whether they already exist in the set of all parameter variables; if they exist, skip and do not process; if they do not exist, add the variables to the set of all parameter variables;

[0057] S55. Traverse all the variables in the right variable set and perform the operation of S54 on them in sequence until the traversal is completed to obtain the final set of all parameter variables.

[0058] In summary, compared with the prior art, the method of the present invention has at least the following advantages:

[0059] 1. The present invention classifies and stores the left variables of the Boolean expressions that are frequently searched, divides a large set into several small sets according to certain principles, so that the search and query of variables can greatly reduce time, and overcomes the disadvantage of time-consuming and inefficient sequential search in the existing solutions;

[0060] 2. The present invention processes input variables, timer variables, Boolean expressions, and all variable sets respectively according to the storage order of the seif file, with clear levels and convenient for later maintenance. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 is a schematic flowchart of a method for generating interlocking formal safety data based on the divide-and-conquer method of the present invention;

[0062] Figure 2 is an example of two types of Boolean expressions in the VTL file;

[0063] Figure 3 is a data structure for storing Boolean expressions;

[0064] Figure 4 is a schematic diagram of a method for classifying and storing the left variables of the Boolean expression equal sign;

[0065] Figure 5 is a search flowchart of input variables. Detailed implementation manners

[0066] The following will combine with the Figures 1 to 5 in the embodiments of the present invention to detail the technical solutions, structural features, achieved purposes and effects in the embodiments of the present invention.

[0067] It should be noted that the attached drawings adopt a very simplified form and all use non-precise scales, only for conveniently and clearly assisting in explaining the purpose of the implementation manners of the present invention, not for limiting the limiting conditions for the implementation of the present invention. Therefore, it has no technical substantial meaning. Any modification of the structure, change of the proportional relationship or adjustment of the size, without affecting the effects that the present invention can produce and the purposes that can be achieved, should still fall within the scope covered by the technical content disclosed by the present invention.

[0068] It should be noted that in the present invention, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprising", "including" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes the clearly listed elements, but also includes other elements not clearly listed, or also includes elements inherent to such process, method, article or device.

[0069] A method for generating interlocking formal safety data based on the divide-and-conquer method, as Figure 1 shown, includes the following steps:

[0070] S1. Initialize and read the Boolean expressions in the VTL file to obtain all the variables on the left side of the equal sign, all the variables on the right side of the equal sign, and the complete Boolean expression of the Boolean expression;

[0071] According to the differences in the train station types, the VTL files of different station types contain thousands to tens of thousands of Boolean expressions. Each Boolean expression has one variable on the left side of the equal sign and multiple variables on the right side, and the lengths of the individual variables are not uniform, some are long and some are short. The Boolean expressions in the VTL file include two types, as Figure 2 shown. Formula a is a general expression, and formula b is a timer expression, where "TIME DELAY" is a general delay time representation flag.

[0072] Specifically, create a set for storing Boolean expressions and name it EXPRESS_LIST; create a set for storing variables on the left side of the equal sign in Boolean expressions and name it LEFTVAR_LIST; create a set for storing variables on the right side of the equal sign in Boolean expressions and name it RIGHTVAR_LIST.

[0073] Read all Boolean expressions in the VTL file and store the complete Boolean expressions in the Boolean expression set EXPRESS_LIST; the Boolean expressions stored in the Boolean expression set EXPRESS_LIST are special-defined data structures, such as Figure 3 As shown, a Boolean expression structure contains a complete Boolean expression string, a delay time, variables on the left side of the equal sign in the expression, and variables on the right side of the expression; among them, boolExpression stores the string of the whole Boolean expression; timeDelay stores the delay time of the timer expression, and if the Boolean expression is not a timer expression, the value of this attribute is empty; leftVar stores the variable on the left side of the equal sign; listRightVar stores the variable on the right side of the equal sign, and the above attribute values are all sets.

[0074] Decompose each of the Boolean expressions in the VTL file to obtain the variables on the left and right sides of the equal sign in the expression, store all the variables on the left side of the equal sign in the left variable set LEFTVAR_LIST, and store all the variables on the right side of the equal sign in the right variable set RIGHTVAR_LIST.

[0075] S2. Use the divide-and-conquer method to search and generate input variables, which further includes the following steps:

[0076] S21. Classify and store the variables on the left side of the equal sign in Boolean expressions. Specifically, classify and store the variables in the left variable set LEFTVAR_LIST into the key-value pair set KEY_VALUES, such as Figure 4 As shown, it further includes the following steps;

[0077] S211. Initialize and create a key-value pair set KEY_VALUES for classifying and storing left variables. The key of the key-value pair is a string, and the value is a left variable;

[0078] S212. Obtain the number of variables in the left variable set LEFTVAR_LIST, take the integer part of the square root of this number of variables to obtain the set size control value m;

[0079] It should be noted that the set size control value m is used to control the size of the set of values in the key-value pair set. The size of m can be set as needed, and is generally rounded to the square root of the number of variables in the left variable set LEFTVAR_LIST.

[0080] S213, traversing the left variable set LEFTVAR_LIST, for each left variable LeftVar, sequentially intercepting the first character, the first two characters, ..., the first n characters as a first intercepted character string, where n is not greater than the character length of the variable LeftVar; and classifying and storing the variables in the left variable set LEFTVAR_LIST into variable sets with different first intercepted character strings as keys according to the different lengths of the first intercepted character strings, specifically comprising the following steps;

[0081] S2131. For each left variable LeftVar, first intercept its preceding character as a first intercepted character string, and determine whether the first intercepted character string has been used as a key in the key-value pair set KEY_VALUES;

[0082] S2132: If the first intercepted string is not a key in KEY_VALUES, add the first intercepted string as a key in KEY_VALUES, and add the variable LeftVar to the variable set with the first intercepted string as a key;

[0083] S2133: If the first intercepted character string has been used as a key of KEY_VALUES, determine whether the number of variables in the variable set with the first intercepted character string as a key is less than the set size control value m;

[0084] S2133a. If it is less than m, add the variable LeftVar to the variable set with the first intercepted string as the key;

[0085] S2133b, if it is not less than m, determining whether the first intercepted character string is equal to the variable LeftVar: if the first intercepted character string is equal to the variable LeftVar, adding the variable LeftVar to the variable set with the first intercepted character string as the key;

[0086] If the first intercepted string is not equal to the variable LeftVar, then based on the first intercepted string, the length of the first intercepted string is increased by one as the new first intercepted string. That is, when intercepting the string of the variable LeftVar, one more character is intercepted backward as the new first intercepted string. The new first intercepted string is substituted into steps S2132-S2133 until the variable LeftVar is added to the variable set with the first intercepted string as the key.

[0087] S214. Traverse all variables in the left variable set LEFTVAR_LIST, and use the method in step S213 to add all variables to the variable set with the first intercepted string as the key. At this time, the generation process of the key-value pair set KEY_VALUES is completed.

[0088] The following shows part of the code for step S21 in this embodiment.

[0089]

[0090]

[0091] S22. Traverse the right variable set RIGHTVAR_LIST, and use the divide-and-conquer method to search and generate the input variable set INPUTS in the key-value pair set KEY_VALUES, as Figure 5 shown, specifically including the following steps;

[0092] S221. Traverse the right variable set RIGHTVAR_LIST to sequentially obtain the right variables in the set;

[0093] S222. For each right variable rightVar, sequentially intercept its first character, first two characters... first n' characters as the second intercepted string, where n' is not greater than the character length of the variable rightVar; determine whether the variable rightVar is an input variable according to whether the second intercepted strings of different lengths are the keys of the key-value pair set, specifically including the following steps;

[0094] S2221. For each right variable rightVar, intercept the first character of the variable rightVar as the second intercepted string, and determine whether the second intercepted string exists in the key set of the key-value pair set KEY_VALUES;

[0095] S2222. If the second intercepted string does not exist in the key set of the key-value pair set KEY_VALUES, it means that the variable rightVar is not an input variable;

[0096] S2223. If the second intercepted string exists in the key set of the key-value pair set KEY_VALUES, use the second intercepted string as the key to find the variable set associated with the key, traverse the variable set, and determine whether the variable rightVar is in the variable set associated with the key;

[0097] S2223a. If the variable rightVar is in the variable set associated with the key, it means that the variable rightVar is an input variable, and store the variable rightVar in the input variable set INPUTS;

[0098] S2223b. If the variable rightVar is not in the variable set associated with the key, then based on the current second intercepted string, one more character of the variable rightVar is intercepted backward to obtain a new second intercepted string, and it is substituted into step S222. Repeat the above process until the variable rightVar meets the situation of S2222 or S2223a, that is, to determine whether the variable rightVar is an input variable.

[0099] S223. Traverse all the variables in the right variable set RIGHTVAR_LIST, and use step S222 to sequentially determine whether each right variable is an input variable, and store all the variables that meet S2223a into the input variable set INPUTS, so as to obtain all input variables.

[0100] The following is part of the code for step S22 in this embodiment.

[0101]

[0102]

[0103] S3. Traverse the boolean expression set, generate timer variables, and store them in the timer variable set TIMERS, which further includes the following steps;

[0104] S31. For the timer expressions in the boolean expression set, store the variables on the left side of the equal sign of the timer expression into the timer variable set, which specifically includes the following steps;

[0105] S311. For the boolean expressions in the boolean expression set EXPRESS_LIST, first determine whether it contains the TIME DELAY definition;

[0106] S312. For the boolean expressions that do not contain the TIME DELAY definition, that is, general expressions, skip them without processing;

[0107] S313. For the boolean expressions that contain the TIME DELAY definition, that is, timer expressions, obtain the variable on the left side of the equal sign of the timer expression, and store the variable into the timer variable set TIMERS.

[0108] S32. Traverse all the expressions in the boolean expression set EXPRESS_LIST, and execute the process of S31 for each boolean expression, so as to store all the variables on the left side of the equal sign of the timer expressions into the set TIMERS, and generate the final timer variable set TIMERS.

[0109] S4. Traverse the set of Boolean expressions, replace the arithmetic operators, and generate a set of Boolean equations EQUATIONS;

[0110] S41. For each Boolean expression in the set of Boolean expressions EXPRESS_LIST, replace the arithmetic operators in the Boolean expression: replace "=" with ":=", "+" with "#", "*" with "&", and ".N." with "~", and store the replaced Boolean expression in the set of Boolean equations EQUATIONS;

[0111] S42. Traverse all the Boolean expressions in the set of Boolean expressions EXPRESS_LIST, and process each Boolean expression using step S41 to generate the final set of Boolean equations EQUATIONS.

[0112] S5. Merge the set of left variables LEFTVAR_LIST and the set of right variables RIGHTVAR_LIST, remove duplicates, and generate a set of all parameter variables VARIABLES, which specifically includes the following steps;

[0113] S51. Initialize and create a set VARIABLES for storing all parameter variables;

[0114] S52. For the left variables in the set of left variables LEFTVAR_LIST, determine whether it exists in the set VARIABLES; if it exists, skip it without processing; if it does not exist, add the left variable to the set VARIABLES;

[0115] S53. Traverse all the left variables in the set of left variables LEFTVAR_LIST, and perform the operation of S52 on them in sequence until the traversal is completed;

[0116] S54. For the right variables in the set of right variables RIGHTVAR_LIST, sequentially determine whether it already exists in the set VARIABLES; if it exists, skip it without processing; if it does not exist, add the right variable to the set VARIABLES;

[0117] S55. Traverse all the right variables in the set of right variables RIGHTVAR_LIST, and perform the operation of S54 on them in sequence until the traversal is completed to obtain the final set of all parameter variables VARIABLES.

[0118] S6. In the order of input variables, timer variables, Boolean equations, and all parameter variables, print the input variables, timer variables, Boolean equations, and all parameter variables in the input variable set INPUTS, timer variable set TIMERS, Boolean equation set EQUATIONS, and all parameter variable set VARIABLES to the seif file in sequence, so as to generate interlock formal safety data.

[0119] Although the content of the present invention has been described in detail through the above preferred embodiments, it should be recognized that the above description should not be regarded as a limitation of the present invention. After those skilled in the art have read the above content, various modifications and alternatives to the present invention will be obvious. Therefore, the protection scope of the present invention should be defined by the appended claims.

Claims

1. A formal safety data generation method for interlocks based on the divide-and-conquer method, characterized in that It includes the following steps: S1. Initialize and read all Boolean expressions in the VTL file, obtain all variables on the left side of the equal sign of the Boolean expressions, and store them in the left variable set; Obtain all variables on the right side of the equal sign of the Boolean expressions, and store them in the right variable set; Obtain all complete Boolean expressions, and store them in the Boolean expression set; S2. Use the divide-and-conquer method to search and generate the input variable set in the left variable set and the right variable set; S3. Traverse the Boolean expression set to generate the timer variable set; S4. Traverse the Boolean expression set, replace the operation symbols, and generate the Boolean equation set; S5. Merge the left variable set and the right variable set, remove duplicates, and generate all parameter variable sets; S6. In the order of input variables, timer variables, Boolean equations, and all parameter variables, output the input variables, timer variables, Boolean equations, and all parameter variables in the input variable set, timer variable set, Boolean equation set, and all parameter variable sets in turn and save them to the seif file to generate interlock formal safety data; Among them, the step S2 further includes the following steps: S21. Traverse the left variable set, and classify and store the variables in the left variable set into the key-value pair set; S22. Traverse the right variable set, and use the divide-and-conquer method to search in the key-value pair set to generate the input variable set; Among them, the step S21 further includes the following steps: S211. Initialize and create a key-value pair set for classifying and storing left variables. The key of the key-value pair is a string, and the value is the left variable; S212. Set a set size control value; S213. Traverse the left variable set. For each left variable LeftVar, successively intercept its first character, first two characters... first n characters as the first intercepted string, where n is not greater than the character length of the variable LeftVar; according to the first intercepted strings of different lengths, classify and store the variables in the left variable set into the variable sets with different first intercepted strings as keys; S214. Traverse the left variable set, and execute S213 for each variable in the left variable set, so as to add all left variables to the variable sets with the first intercepted string as the key, and generate the final key-value pair set; Among them, the step S22 further includes the following steps: S221. Traverse the right variable set, and successively obtain the right variables in the right variable set; S222. For each right variable rightVar, successively intercept its first character, first two characters... first n' characters as the second intercepted string, where n' is not greater than the character length of the variable rightVar; determine whether the variable rightVar is an input variable according to whether the second intercepted strings of different lengths are the keys of the key-value pair set; S223. Traverse the right variable set, execute S222 for each variable in the right variable set, and successively judge whether it is an input variable, and store all input variables in the input variable set.

2. The method for generating interlocking formal safety data based on the divide-and-conquer method according to claim 1, wherein The Boolean expression stored in the Boolean expression set includes: a complete Boolean expression string, a delay time, a variable on the left side of the Boolean expression equal sign, and a variable on the right side of the Boolean expression equal sign.

3. The method for generating interlocking formal safety data based on the divide-and-conquer method according to claim 1, wherein, The set size control value is the integer of the square root of the number of variables in the left variable set.

4. A method for generating interlocking formal safety data based on the divide-and-conquer method according to claim 1, characterized in that The step S213 further comprises the following steps: S2131, intercept the previous character of the left variable LeftVar as the first intercepted character string; S2132: If the first intercepted string is not a key in the key-value pair set, add the first intercepted string as a key in the key-value pair set, and add the variable LeftVar to the variable set with the first intercepted string as the key; S2133: If the first intercepted character string has been used as a key in the key-value pair set, determining whether the number of variables in the variable set with the first intercepted character string as the key is less than the set size control value; S2133a. If the number of variables in the variable set with the first intercepted string as the key is less than the set size control value, add the variable LeftVar to the variable set with the first intercepted string as the key; S2133b. If the number of variables in the variable set with the first intercepted string as the key is not less than the set size control value, then determine whether the first intercepted string is equal to the variable LeftVar: if the first intercepted string is equal to the variable LeftVar, then add the variable LeftVar to the variable set with the first intercepted string as the key; if the first intercepted string is not equal to the variable LeftVar, then based on the length of the existing first intercepted string, intercept the variable LeftVar backward by one more character to form a new first intercepted string, and substitute the new first intercepted string into steps S2132-S2133 until the variable LeftVar is added to the variable set with the first intercepted string as the key.

5. The formalized safety data generation method for interlocks based on the divide-and-conquer method according to claim 1, characterized in that The step S222 further comprises the following steps: S2221, intercept the previous character of the right variable rightVar as the second intercepted character string; S2222: If the second intercepted character string is not in the key set of the key-value pair set, it indicates that the right variable rightVar is not an input variable; S2223: If the second intercepted string is in the key set of the key-value pair set, use the second intercepted string as the key to find the variable set associated with the key, traverse the variable set, and determine the variable Whether rightVar is in the variable set associated with the key; S2223a. If the variable rightVar is in the variable set associated with the key, it indicates that the variable rightVar is an input variable, and the variable rightVar is stored in the input variable set. S2223b. If the variable rightVar is not in the variable set associated with the key, then, based on the length of the existing second intercepted string, intercept one more character of rightVar backward to form a new second intercepted string, and substitute this new second intercepted string into steps S2222 - S2223; repeat the above process until it is determined whether the variable rightVar is the input variable.

6. The formalized safety data generation method for interlocks based on the divide-and-conquer method according to claim 1, characterized in that The step S3 further includes the following steps: S31. For the timer expressions in the set of boolean expressions, store the variables on the left side of the equal sign of the timer expression in the timer variable set; S32. Traverse all the boolean expressions in the set of boolean expressions, and execute S31 for each boolean expression in the set of boolean expressions, so as to store the variables on the left side of all the timer expressions in the timer variable set until the traversal is completed, generating the final timer variable set.

7. The method for generating interlocking formal safety data based on the divide-and-conquer method according to claim 6, characterized in that, The step S31 further includes the following steps: S311. For the boolean expressions in the set of boolean expressions, first determine whether it contains the TIME DELAY definition; S312. The boolean expressions that do not contain the TIME DELAY definition are general expressions and are skipped without processing; S313. The boolean expressions that contain the TIME DELAY definition are timer expressions. For the timer expressions, obtain the variables on the left side of the equal sign and store the variables in the timer variable set.

8. The method for generating interlocking formal safety data based on the divide-and-conquer method according to claim 1, wherein, The step S4 further includes the following steps: S41. For each boolean expression in the set of boolean expressions, replace the operation symbols in the boolean expression, and store the boolean expression after replacement in the set of boolean equations; S42. Traverse all the boolean expressions in the set of boolean expressions, and process each boolean expression using step S41 to generate the final set of boolean equations.

9. The method for generating interlocking formal safety data based on the divide-and-conquer method according to claim 8, characterized in that, The replacement method of the operation symbols in the boolean expression is: replace "=” with ":=”, replace "+” with "#”, replace "*” with "&”, and replace ".N.” with "~”.

10. A method for generating interlocking formal safety data based on the divide-and-conquer method according to claim 1, characterized in that, The step S5 further includes the following steps: S51. Initialize and create a set for storing all parameter variables; S52. For the variables in the left variable set, determine whether they exist in the set of all parameter variables; if they exist, skip without processing; if they do not exist, add the variable to the set of all parameter variables; S53. Traverse all the variables in the left variable set and perform the operation in S52 on them in sequence until the traversal is completed; S54. For the variables in the right variable set, sequentially determine whether they already exist in the set of all parameter variables; if they exist, skip without processing; if they do not exist, add the variable to the set of all parameter variables; S55. Traverse all the variables in the right variable set and perform the operation in S54 on them in sequence until the traversal is completed to obtain the final set of all parameter variables.

Citation Information

Patent Citations

  • Optimization method for interlocking Boolean logic

    CN107977493A

  • An LL (K)-based interlocking Boolean logic dynamic generation system and a dynamic generation method

    CN109558634A