Interlocking program data verification method and device, electronic equipment and storage medium

By analyzing the structure and data state transition model of the program files of the computer interlocking system, the problem of insufficient data consistency is solved, efficient detection of implicit errors is achieved, and the safety of the railway system is improved.

CN120560718APending Publication Date: 2025-08-29CRSC RESEARCH & DESIGN INSTITUTE GROUP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510659107.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-21
Publication Date
2025-08-29

AI Technical Summary

Technical Problem

In the prior art, implicit errors cannot be found by manually checking the configuration data of the computer interlocking system, and the driving safety of the railway system cannot be guaranteed.

Method used

By obtaining the program files of the railway interlocking system, using the structure state transition model and data state transition model, analyzing the structure declaration and phrases, obtaining the structure and nesting relationships, verifying the structure data, and discovering potential errors.

Benefits of technology

It improves the accuracy and efficiency of implicit error detection and enhances driving safety of the railway system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120560718A_ABST
    Figure CN120560718A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an interlocking program data verification method and device, electronic equipment and a storage medium. Obtaining an original program file in the railway interlocking system, and extracting a structural body declaration statement to obtain a to-be-analyzed program file; analyzing the structural body declaration in the to-be-analyzed program file through the structural state conversion model to obtain each structural body and each structural body nesting relationship; analyzing the phrases in each structural body through a data state conversion model to obtain structural body data; and verifying the structural body data according to the original configuration data corresponding to the original program file, the structural bodies, the structural body nesting relationship and the structural body data. According to the embodiment of the invention, the accuracy and efficiency of implicit error detection are improved, and the driving safety of a railway system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to intelligent information processing technology, and in particular to an interlocking program data verification method, device, electronic device and storage medium. Background Art

[0002] With the development of computer technology, computer interlocking systems have become mainstream within railways. These systems are responsible for establishing control over the core control equipment for railway operations. After configuring control data through the computer interlocking system, testing and verification are required to ensure that the configuration data is correct.

[0003] In the prior art, it is necessary to conduct a test experiment on the configuration data, and manually determine whether the configuration data is consistent with the survey data through the control results.

[0004] However, manually checking the consistency of data through control results cannot detect hidden errors and cannot ensure the driving safety of the entire railway system. Summary of the Invention

[0005] The present application provides an interlocking program data verification method, device, electronic device and storage medium to improve the accuracy and efficiency of implicit error detection and enhance the driving safety of railway systems.

[0006] In a first aspect, an embodiment of the present application provides an interlocking program data verification method, the interlocking program data verification method comprising:

[0007] Obtain the original program file in the railway interlocking system, extract the structure declaration statement, and obtain the program file to be parsed;

[0008] Through the structural state transition model, the structure declaration in the program file to be parsed is parsed to obtain the nested relationship between each structure;

[0009] Through the data state conversion model, the phrases in each structure are parsed to obtain the structure data;

[0010] The structure data is verified according to the original configuration data, each structure, the nested relationship of each structure and the structure data corresponding to the original program file.

[0011] In a second aspect, an embodiment of the present application further provides an interlocking program data verification device, the interlocking program data verification device comprising:

[0012] The module for obtaining the program file to be parsed is used to obtain the original program file in the railway interlocking system and extract the structure declaration statement to obtain the program file to be parsed;

[0013] The structure parsing module is used to parse the structure declaration in the program file to be parsed through the structure state transition model to obtain the nested relationship between each structure;

[0014] The structure data acquisition module is used to parse the phrases in each structure through the data state conversion model to obtain the structure data;

[0015] The structure data verification module is used to verify the structure data according to the original configuration data corresponding to the original program file, each structure, the nested relationship of each structure and the structure data.

[0016] In a third aspect, an embodiment of the present application further provides an electronic device, the electronic device comprising:

[0017] one or more processors;

[0018] a storage device for storing one or more programs;

[0019] When one or more programs are executed by one or more processors, the one or more processors implement any one of the interlocking program data verification methods provided in the embodiments of the present application.

[0020] In a fourth aspect, an embodiment of the present application further provides a storage medium comprising computer-executable instructions, which, when executed by a computer processor, are used to execute any one of the interlocking program data verification methods provided in the embodiments of the present application.

[0021] The present application obtains the original program file in the railway interlocking system and extracts the structure declaration statement to obtain the program file to be parsed; the structure declaration in the program file to be parsed is parsed through the structural state transition model to obtain each structure and the nested relationship of each structure, and the structural statement in the program is parsed through the structural state transition model to ensure that the variables defined in the program file can be fully obtained and implicit errors can be discovered in time later; the phrases in each structure are parsed through the data state transition model to obtain structure data, and the variables and data defined in each structure are accurately obtained through the data state transition model to facilitate the subsequent accurate verification of the structure data; the structure data is verified according to the original configuration data, each structure, the nested relationship of each structure and the structure data corresponding to the original program file, and the verification of implicit errors is realized at the program level, thereby improving the accuracy and efficiency of implicit error detection and improving the driving safety of the railway system. Therefore, the technical solution of this application solves the problem that manual verification of data consistency through control results cannot detect implicit errors and cannot ensure the driving safety of the entire railway system. It achieves the effect of improving the accuracy and efficiency of implicit error detection and improving the driving safety of the railway system. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 This is a flow chart of an interlocking program data verification method in Example 1 of the present application;

[0023] Figure 2a This is a flow chart of an interlocking program data verification method in Example 2 of the present application;

[0024] Figure 2b This is a schematic diagram of state transition in a structural state transition model in Example 2 of the present application;

[0025] Figure 3a This is a flow chart of an interlocking program data verification method in Example 3 of the present application;

[0026] Figure 3b This is a state transition diagram in a data state transition model in Example 3 of the present application;

[0027] Figure 4 This is a structural diagram of an interlocking program data verification device in the fourth embodiment of the present application;

[0028] Figure 5 This is a structural diagram of an electronic device in Example 5 of the present application. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0030] It should be noted that the terms "first" and "second" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0031] Example 1

[0032] Figure 1 This is a flowchart of an interlocking program data verification method provided in Example 1 of the present application. This embodiment can be applied to the situation where data in the control program in the computer interlocking system is parsed and verified. The method can be executed by an interlocking program data verification device, which can be implemented using software and / or hardware and is specifically configured in a verification module in the computer interlocking system.

[0033] See also Figure 1 The interlocking program data verification method shown in the figure specifically includes the following steps:

[0034] S110. Obtain the original program file in the railway interlocking system, and extract the structure declaration statement to obtain the program file to be parsed.

[0035] The railway interlocking system can be a computer interlocking system used in railway scenarios. This computer interlocking system is responsible for establishing control over the core control equipment for railway operation and plays a vital role in ensuring the safety of train operation. The original program file can be a program file configured using a programming language based on preset configuration data. The original program file can be obtained from an electronic device that requires data verification. For example, in a computer interlocking device used in the railway field, the original program file can be a program file configured using a preset programming language based on survey data to control the interlocking device. Therefore, the original program file in the railway interlocking system can be obtained from the computer interlocking device.

[0036] According to the programming syntax rules and definitions of interlocking devices, and by analyzing the data configuration rules of various manufacturers in the industry, the following characteristics can be summarized:

[0037] 1. Data declarations are generally defined in the form of structures. In C language (a professional term, a programming language), the keyword for structure is struct (a professional term, a data type);

[0038] 2. Nested definitions are allowed in data declarations. For example, the nested definitions are as follows:

[0039]

[0040] Among them, A and B are the names of the defined structures, and the ellipsis represents the omitted specific variables.

[0041] 3. The variable types in data declarations generally include types supported by C language, enumeration types, structure types, and custom declaration types;

[0042] 4. Variable definitions in data declarations can have composite types. For example, composite types can be pointers and arrays. Examples are as follows:

[0043]

[0044] 5. Data declarations can be defined with or without typedef (a professional term, a keyword);

[0045] 6. When the variable definition in the data declaration is a composite type, the dimension can use macro definitions or not, or it can be an expression;

[0046] 7. The data in the data definition may be a macro definition, a value, an enumeration, or an expression.

[0047] Considering the above characteristics, the focus of data parsing in original program files can be on parsing structures. A structure is an important data type in the C language. This data type consists of a group of different data called members (or fields, or elements), where each member can have a different type.

[0048] The program file to be parsed can be a structure declaration statement extracted from an original program file, and is used to obtain structure data through parsing. For example, after obtaining the original program file of the railway interlocking system, a complete structure declaration statement can be obtained from the original program file. According to the C language grammar, the included comment statements are removed, multiple lines are merged, and the statement is parsed to obtain a phrase list in the form of words and symbols to obtain the program file to be parsed.

[0049] S120. Parse the structure declarations in the program file to be parsed through the structure state transition model to obtain the nested relationships between the structures.

[0050] The structural state transition model can be a state machine model for parsing the structure in the program file to be parsed. The structure declaration may be a nested structure. The structural state transition model obtains each complete structure declaration and each structure nesting relationship by setting the state transition method for the various phrases that may appear. Exemplarily, the structural state transition model is configured with two stacks for storing the parsed structure declarations and each structure nesting relationship. For example, the two stacks can be a declaration stack and a multi-tree stack, respectively. The declaration stack is used to store the parsed structure declarations, and the multi-tree stack is used to store each structure nesting relationship in the form of a multi-tree node. The program file to be parsed is input into the structural state transition model to obtain each structure and each structure nesting relationship.

[0051] S130 , parsing the phrases in each structure according to the data state conversion model to obtain structure data.

[0052] The data state transition model can be a state machine model used to parse phrases within each structure. The data state transition model establishes state transitions for various possible variable declarations to obtain complete variable declarations within each structure. The structure data can be the variables and data declared within the structure.

[0053] Exemplarily, the data state transition model is configured with two stacks, one for storing parsed structures and variable names, and the other for storing data. For example, the two stacks can be a name stack and a data stack, with the name stack storing the parsed structures and variable names, and the data stack storing the parsed data. Inputting each structure into the data state transition model yields the name of each variable and its corresponding data.

[0054] S140 , verifying the structure data according to the original configuration data, the structures, the nested relationships of the structures, and the structure data corresponding to the original program file.

[0055] The original configuration data may be the configuration data corresponding to the original program file. For example, in the computer interlocking equipment in the railway field, the original configuration data may be the survey data for configuring the original program file. After completing the parsing of each structure, the nested relationship of each structure and the structure data, the structure name, variable name and specific data are obtained. At this time, the variables can be assigned values, and then compared with the original configuration data to verify the structure data. For example, to assign values ​​to variables, the parsed definition multitree can be found according to the structure name, and the specific data can be assigned to the multitree in turn according to the C language syntax. The corresponding relationship between the specific numerical value and the structure variable can be obtained, thereby completing the assignment of the variable. By assigning values ​​to the variables, according to the results of the parsing of the structure and the structure variable, and according to the input assignment, the corresponding numerical value is analyzed, and potential errors in the interlocking control data configured by the structure can be detected in advance, thereby improving the safety of train travel in the railway.

[0056] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data comply with relevant laws, regulations and standards in the relevant regions.

[0057] Interlocking equipment is used in railway signaling to ensure train safety. It controls station routes, switches, and signal equipment through technical means, as well as the interdependencies between them. Therefore, interlocking equipment is a key component of railway signaling, ensuring operational safety, improving efficiency, and reducing labor intensity. As a high-security signaling device within the railway system, interlocking equipment is crucial. It enables timely action in the event of equipment or system failures, preventing accidents from escalating and ensuring operational safety.

[0058] The consequences of interlocking system control system failure are severe, and the economic losses are incalculable. The train derailment in Odisha, India, on June 2, 2023, was caused by a problem with the electronic interlocking device, resulting in serious consequences. Therefore, inspection and testing of interlocking system control systems is crucial and a key step in ensuring factory quality and safety. Black box testing is a key method for verifying data configuration, but it cannot fully verify data. Therefore, data configuration analysis is necessary.

[0059] Currently, while interlocking equipment manufacturers are continuously improving data verification adequacy, the contradiction between data verification adequacy and efficiency persists, creating a bottleneck that restricts interlocking equipment production efficiency. Improving the efficiency and accuracy of interlocking equipment data verification through technical means is a key issue facing manufacturers in the rapidly developing market.

[0060] The testing and verification of interlocking equipment includes functional verification and data verification. Independent verification of data is also an important part of the user acceptance of interlocking equipment. If the function is correct but the data carrying this function is misconfigured, it may eventually send out an erroneous signal command, causing the interlocking equipment to fail, resulting in safety problems, and even catastrophic or fatal consequences.

[0061] Railway signal control system interlocking equipment has evolved through several stages: mechanical interlocking, electromechanical interlocking, relay interlocking, and computer interlocking. With the advancement of computer technology, computer interlocking systems have become the mainstream within railways. These systems are responsible for establishing train routes and are the core control equipment for railway operations. They implement interlocking control between switches, signals, and track circuits within stations, and are essential for safe and efficient railway operations.

[0062] Computer interlocking systems primarily consist of hardware and software. The software, as the core control module, consists of two parts: application software and data. After the application software's logical functionality is verified, the design drawings for the survey and engineering designs of stations on different lines are converted into computer-readable data structures, known as engineering data. For example, engineering data can include the encoding of attributes such as routes, sections, signals, switches, and routes, as well as their associated relationships. While different stations can use the same application software, the resulting engineering data will necessarily be different.

[0063] In existing technical solutions, for software delivered by computer interlocking, each station completes the software compilation through data configuration, ensuring correct functionality. Data correctness is the primary verification component of product delivery testing. Data configuration converts survey and engineering design data into software design data. Deviations or errors during this conversion process can lead to various unexpected results. Currently, manufacturers perform data verification in two aspects: They primarily use black-box testing methods to test and verify visible data. Testing and verification of invisible data, including data legitimacy checks and relevance verification, relies heavily on manual labor. There is an urgent need to improve the quality and efficiency of invisible data verification through technological means.

[0064] The technical solution of this embodiment is to obtain the original program file in the railway interlocking system and extract the structure declaration statement to obtain the program file to be parsed; parse the structure declaration in the program file to be parsed through the structure state transition model to obtain each structure and the nested relationship of each structure, and parse the structure statement in the program through the structure state transition model to ensure that the variables defined in the program file can be fully obtained and implicit errors can be discovered in time later; parse the phrases in each structure through the data state transition model to obtain structure data, and accurately obtain the variables and data defined in each structure through the data state transition model to facilitate the subsequent accurate verification of the structure data; verify the structure data according to the original configuration data, each structure, the nested relationship of each structure and the structure data corresponding to the original program file, realize the verification of implicit errors at the program level, improve the accuracy and efficiency of implicit error detection, and improve the driving safety of the railway system. Therefore, the technical solution of this application solves the problem that manual verification of data consistency through control results cannot detect implicit errors and cannot ensure the driving safety of the entire railway system. It achieves the effect of improving the accuracy and efficiency of implicit error detection and improving the driving safety of the railway system.

[0065] Example 2

[0066] Figure 2aThis is a flow chart of an interlocking program data verification method provided in Example 2 of the present application. The technical solution of this embodiment is further refined on the basis of the above technical solution.

[0067] Furthermore, "through the structural state transition model, the structure declaration in the program file to be parsed is parsed to obtain the nested relationship between each structure" is refined into: "obtain each phrase to be judged from the program file to be parsed; through the structural state transition model, the state transition is performed one by one according to each phrase to be judged, and the nested relationship between each structure is obtained" to obtain the nested relationship between each structure.

[0068] See also Figure 2a The interlocking program data verification method shown includes:

[0069] S210: Acquire the original program file in the railway interlocking system, extract the structure declaration statement, and obtain the program file to be parsed.

[0070] S220: Obtain each phrase to be judged from the program file to be parsed.

[0071] Read a list of phrases in the form of words and symbols from the program file to be parsed. If the list is empty, return it and get the phrases to be judged. The phrases to be judged include words, curly braces, and semicolons.

[0072] In an optional embodiment, before obtaining each phrase to be judged from the program file to be parsed, it also includes: initializing a declaration stack and a multi-tree stack configured for a structural state transition model; the declaration stack is used to store the parsed structure; and the multi-tree stack is used to store the parsed structure nesting relationship.

[0073] Declare a stack to store the parsed structure. Through the storage characteristics of the stack, when a complete structure is parsed, the structure is popped from the stack to ensure the correct order of each phrase in the structure after being popped.

[0074] The multi-tree stack is used to store the parsed nested relationships of structures. Through the storage characteristics of the stack, the nodes pushed into the stack later are used as child nodes of the nodes pushed into the stack earlier. The nested relationships of each structure can be determined by the stacking order, without the need to use fields to identify the nested relationships, thereby improving the efficiency of nested relationship storage.

[0075] By configuring a declaration stack and a multitree stack for the structure state transition model, the structure of the parsed nested structure can be recorded so that when a nested declaration is encountered, the state can be rolled back to the state corresponding to the outer struct definition.

[0076] Before obtaining each phrase to be judged from the program file to be parsed, the declaration stack and multi-tree stack configured for the structural state transition model are initialized. The declaration stack and multi-tree stack can be cleared to ensure the accuracy of the data stored in the declaration stack and multi-tree stack.

[0077] S230 , using a structural state transition model, performing state transitions according to each phrase to be judged, and obtaining nested relationships between structures.

[0078] The structural state transition model performs state transitions based on each phrase to be judged, resulting in nested relationships between structures. For example, the first state transitions to the next state based on the first phrase, and the next state determines its next state based on the second phrase, until the complete structure is parsed, at which point parsing ends.

[0079] The structural state transition model includes the initial state, keyword judgment state, nested keyword judgment state, name judgment state, rollback state and return to the top of the stack state.

[0080] In an optional embodiment, the keyword judgment state is used to judge whether the current phrase to be judged is a structure keyword to identify the structure declaration; the nested keyword judgment state is used to create a child node in the multi-tree stack when the second judgment result is a structure keyword, for identifying the structure declaration nested in the structure; the name judgment state is used to judge whether the current phrase to be judged is an existing name, and when the judgment result is yes, the current phrase to be judged is stored in the declaration stack for identifying the structure name; the fallback state is used to judge whether the current phrase to be judged is an end symbol, and when the judgment result is yes, the phrases in the declaration stack are controlled to be popped out in sequence, and at the same time, the node in the multi-tree stack is controlled to be updated to the structure name after the node is popped out, and the multi-tree node and the corresponding structure name are stored in the global variable to exit the structure, so as to exit the nested structure and ensure the correctness of the identified structure.

[0081] Specifically, the transition rules for the initial state, keyword judgment state, nested keyword judgment state, name judgment state, fallback state, and return to the top of the stack state in the structural state transition model are as follows:

[0082] 1. If the state is q0, if the phrase is a struct, then move the state to q1; if it is a typedef, then move the state to q2 and push the phrase into the stack queStack (a professional term, a type of stack);

[0083] 2. If the state is q1, if the phrase exists in the known structure type stParaTypes (professional term, a type of structure), transition to q6 and push the phrase onto the stack; otherwise, transition to q4, push the phrase onto the stack queStack (professional term, a type of stack), add a multitree node, and push this multitree node onto the stack mutibStack (professional term, a type of stack);

[0084] 3. If the state is q2, if the phrase is a struct, then move to q3; if it is a keyword, move to q9 (terminal state). Finally, push the phrase into the stack queStack; if neither is true, move to q0;

[0085] 4. If the state is q3, if the phrase is a left curly bracket {, move to q7; if it is a keyword, move to q5. Finally, push the phrase into queStack, add a multitree node, and push this multitree node into mutibStack; if neither is true, move to q0;

[0086] 5. If the state is q4, if the phrase is a keyword, transition to q0; if it is a left curly bracket {, transition to q7 and push the phrase into queStack; otherwise, transition to q8 (terminal state), push the phrase into queStack, and pop the multitree stack mutibStack;

[0087] 6. If the state is q5, if the phrase is a keyword, move to q0; if it is a left curly bracket {, move to q7 and push the phrase into queStack;

[0088] 7. If the state is q6, if the phrase is a left curly brace { or a keyword, transition to q0; otherwise, transition to q8 and push the phrase into queStack;

[0089] 8. If the state is q7, if the phrase is typedef, move to q2; if the phrase is struct, move to q1; if the phrase is a right curly brace, move to q10 (terminal state); otherwise, move to q8. Push the phrase into queStack;

[0090] 9. If the state is q8 and the phrase is a semicolon ";", the queStack is popped twice to obtain the variable name and type, and a child node with the variable name and type as the node is added to the top element of the multitree stack mutibStack. The state machine then returns to the state q* at the top of the queStack. Otherwise, the phrase is pushed into the queStack and the state remains unchanged.

[0091] 10. If the state is q9, if the phrase is a semicolon ";", add a new user-defined type and migrate the state to q0; otherwise, push the phrase into queStack;

[0092] 11. If the state is q10, if the phrase is a semicolon ";", a structure type definition is completed, the queStack stack is popped in sequence to obtain the name of this structure, and at the same time, the multitree stack mutibStack is updated with its parameter as the structure type name after being popped. This multitree node and the corresponding structure type name are stored in the global variable and used as the child node at the top of the mutibStack stack, and the state is migrated to q0.

[0093] Among them, q0 is the initial state, the keyword judgment states include q2, q5, q6, and q7, the name judgment state includes q1, the nested keyword judgment state includes q3 and q4, the fallback state includes q*, q9, and q10, and the return to the top of the stack state includes q8. q8, q9, and q10 can be collectively referred to as the termination state, indicating the termination of structure judgment.

[0094] like Figure 2b A schematic diagram of state transition in a structural state transition model. Figure 2b The states q8, q9, and q10 in the middle double circle are used to represent terminal states.

[0095] S240: Parse the phrases in each structure through the data state conversion model to obtain structure data.

[0096] S250 , verifying the structure data according to the original configuration data, the structures, the nested relationships of the structures, and the structure data corresponding to the original program file.

[0097] The technical solution of this embodiment obtains each phrase to be judged from the program file to be parsed; through the structural state transition model, the state transition is performed one by one according to each phrase to be judged, and each structure and the nested relationship of each structure are obtained. The structural state transition model includes: initial state, keyword judgment state, nested keyword judgment state, name judgment state, fallback state and return to top of stack state. By setting multiple states, the parsing of the structure is realized, and when there is a nested structure, it can fall back to the outer definition to ensure the correctness of the structure parsing.

[0098] Example 3

[0099] Figure 3a This is a flow chart of an interlocking program data verification method provided in Example 3 of the present application. The technical solution of this embodiment is further refined on the basis of the above technical solution.

[0100] Furthermore, "through the data state transition model, the phrases in each structure are parsed to obtain the structure data" is refined into: "through the data state transition model, the state transition is performed according to the phrases in each structure one by one to obtain the name and value of each variable" to obtain the name and value of each variable.

[0101] See also Figure 3a The interlocking program data verification method shown includes:

[0102] S310: Acquire the original program file in the railway interlocking system, extract the structure declaration statement, and obtain the program file to be parsed.

[0103] S320: Parse the structure declarations in the program file to be parsed through the structure state transition model to obtain the nested relationships between the structures.

[0104] S330. Through the data state conversion model, perform state conversion according to the phrases in each structure to obtain the name and value of each variable.

[0105] The data state transition model performs state transitions based on the phrases in each structure, obtaining the variable names and values. For example, the first state transitions to the next state based on the first phrase, and the next state determines its next state based on the second phrase. This process continues until the variable names and values ​​are resolved.

[0106] The data state transition model includes: initial state, keyword judgment state, name judgment state, fallback state, syntax detection state and variable definition state.

[0107] In an optional embodiment, the grammar detection state is used to store the current phrase into a grammar detection list to perform bracket grammar detection on the corresponding phrase; the variable definition state is used to determine whether the current phrase is a variable definition, and obtain an iterative string when the determination result is yes.

[0108] The initial state, keyword judgment state, name judgment state and fallback state have the same functions as those in the structural state transition model and will not be described here.

[0109] Specifically, the conversion rules of the initial state, keyword judgment state, name judgment state, fallback state, syntax detection state and assignment judgment module in the data state conversion model are as follows:

[0110] 1. If the state is q0 and the phrase is struct, then migrate to q1; if the phrase is extern (a professional noun, a keyword), then migrate to q2; if the phrase already exists in the parsed structure type stPara (a professional noun, a structure type), then migrate to q4 and assign the phrase the value commType (a professional noun, a phrase assignment);

[0111] 2. If the state is q1, if the phrase already exists in the parsed structure type stPara, then migrate the state to q4 and assign the phrase to commType; otherwise, migrate the state to q0;

[0112] 3. If the state is q2 and the input phrase is struct, then the state is moved to q3; otherwise, if the phrase is a C language keyword, no processing is performed, otherwise the state is moved to q0;

[0113] 4. If the state is q3, directly migrate the state to q0;

[0114] 5. If the state is q4, if the phrase conforms to the C language variable definition rules, then migrate to q5 and iteratively connect the commPara string to the phrase; otherwise, migrate to q0;

[0115] 6. If the state is q5 and the input phrase is =, then move to q6; otherwise, maintain the state and iterate the commPara string to concatenate the phrases.

[0116] 7. If the state is q6 and the input phrase is {, then move the state to q7 and add the phrase to the temporary list for bracket syntax detection;

[0117] 8. If the state is q7 and the input phrase is {, the state remains unchanged and the phrase is added to a temporary list for bracket syntax checking. If the phrase is}, the state is moved to q0. If the phrase is a comma "," the state is moved to q10. Otherwise, the phrase is determined to be data, stored, and the state is moved to q8.

[0118] 9. If the state is q8 and the input phrase is}, then the state is transferred to q9 and the phrase is included in the temporary list for bracket syntax detection; if it is a comma "," then the state is transferred to q10; otherwise, the state is transferred to q0;

[0119] 10. If the state is q9 and the input phrase is {, then the state is transferred to q0; if the phrase is a semicolon ";", then the state is transferred to q11 (terminal state); if the phrase is a comma "," the state is transferred to q10; if the phrase is}, the state remains unchanged and the phrase is included in the temporary list for bracket syntax detection; otherwise, the state is transferred to q0;

[0120] 11. If in state q10, the input phrase is}, transition to state q9 and add the phrase to a temporary list for bracket syntax checking; if the input phrase is a comma "," transition to state q0; if the input phrase is {, transition to state q7 and add the phrase to a temporary list for bracket syntax checking; otherwise, determine and obtain the phrase as data, store the data, and transition to state q8;

[0121] 12. If the state is q11, a data parsing is completed at this time, the stored data is assigned to the corresponding type multi-branch tree, and the commType, commPara and data list are initialized and the state is automatically migrated to q0.

[0122] Among them, q0 is the initial state, the keyword judgment state includes q2, the name judgment state includes q1, the fallback state includes q3 and q11, the syntax detection state includes q6, q7, q8, and q9, and the variable definition state includes q4 and q5. Among them, q11 can also be called the terminal state, indicating the end of the state transition.

[0123] like Figure 3b A schematic diagram of state transition in a data state transition model. Figure 3b A double circle is used to indicate the terminal state.

[0124] S340: Verify the structure data according to the original configuration data, the structures, the nested relationships of the structures, and the structure data corresponding to the original program file.

[0125] The technical solution of this embodiment uses a data state transition model to perform state transition according to the phrases in each structure, obtain the name and value of each variable, accurately obtain the data in the structure, and improve the efficiency and accuracy of data acquisition.

[0126] Example 4

[0127] Figure 4 FIG. 1 is a schematic diagram of the structure of an interlocking program data verification device provided in a fourth embodiment of the present application. This embodiment is applicable to the case of parsing and verifying data in a control program in a computer interlocking system. The specific structure of the interlocking program data verification device is as follows:

[0128] The program file to be parsed acquisition module 410 is used to acquire the original program file in the railway interlocking system and extract the structure declaration statement to obtain the program file to be parsed;

[0129] The structure parsing module 420 is used to parse the structure declaration in the program file to be parsed through the structure state transition model to obtain the structures and the nested relationships between the structures;

[0130] The structure data acquisition module 430 is used to parse the phrases in each structure through the data state conversion model to obtain structure data;

[0131] The structure data verification module 440 is used to verify the structure data according to the original configuration data, each structure, the nested relationship of each structure and the structure data corresponding to the original program file.

[0132] The technical solution of this embodiment is to obtain the original program file in the railway interlocking system and extract the structure declaration statement to obtain the program file to be parsed; parse the structure declaration in the program file to be parsed through the structure state transition model to obtain each structure and the nested relationship of each structure, and parse the structure statement in the program through the structure state transition model to ensure that the variables defined in the program file can be fully obtained and implicit errors can be discovered in time later; parse the phrases in each structure through the data state transition model to obtain structure data, and accurately obtain the variables and data defined in each structure through the data state transition model to facilitate the subsequent accurate verification of the structure data; verify the structure data according to the original configuration data, each structure, the nested relationship of each structure and the structure data corresponding to the original program file, realize the verification of implicit errors at the program level, improve the accuracy and efficiency of implicit error detection, and improve the driving safety of the railway system. Therefore, the technical solution of this application solves the problem that manual verification of data consistency through control results cannot detect implicit errors and cannot ensure the driving safety of the entire railway system. It achieves the effect of improving the accuracy and efficiency of implicit error detection and improving the driving safety of the railway system.

[0133] Optionally, the structure parsing module 420 includes:

[0134] A phrase acquisition unit to be judged is used to obtain each phrase to be judged from the program file to be parsed;

[0135] The state transition unit for the phrase to be judged is used to perform state transition according to each phrase to be judged through a structural state transition model to obtain the nested relationship between each structure; the structural state transition model includes: initial state, keyword judgment state, nested keyword judgment state, name judgment state, fallback state and return to top of stack state.

[0136] Optionally, the structure parsing module 420 further includes:

[0137] The stack initialization unit is used to initialize the declaration stack and multi-tree stack configured for the structure state transition model; the declaration stack is used to store the parsed structure; the multi-tree stack is used to store the parsed structure nesting relationship.

[0138] Optionally, the keyword judgment state is used to judge whether the current phrase to be judged is a structure keyword; the nested keyword judgment state is used to create a child node in the multi-tree stack when the second judgment result is a structure keyword; the name judgment state is used to judge whether the current phrase to be judged is an existing name, and when the judgment result is yes, the current phrase to be judged is stored in the declaration stack; the fallback state is used to judge whether the current phrase to be judged is an end symbol, and when the judgment result is yes, control the phrases in the declaration stack to be popped out in sequence, and at the same time control the node in the multi-tree stack to update the parameter of the node to the structure name after popping, and store this multi-tree node and the corresponding structure name in the global variable.

[0139] Optionally, the structure data acquisition module 430 includes:

[0140] The structure data acquisition unit is used to perform state transitions according to the phrases in each structure through the data state transition model to obtain the names and values ​​of each variable; the data state transition model includes: initial state, keyword judgment state, name judgment state, fallback state, syntax detection state and variable definition state.

[0141] Optionally, the syntax check state is used to store the current phrase in a syntax check list to perform bracket syntax check on the corresponding phrase; the variable definition state is used to determine whether the current phrase is a variable definition, and obtain the iterative string when the judgment result is yes.

[0142] The interlocking program data verification device provided in the embodiment of the present application can execute the interlocking program data verification method provided in any embodiment of the present application, and has the corresponding functional modules and beneficial effects for executing the interlocking program data verification method.

[0143] According to an embodiment of the present invention, the present invention further provides an electronic device, a readable storage medium and a computer program product.

[0144] Example 5

[0145] Figure 5 This is a structural diagram of an electronic device provided in Example 5 of the present application, such as Figure 5 As shown, the electronic device includes a processor 510, a memory 520, an input device 530, and an output device 540; the number of processors 510 in the electronic device can be one or more. Figure 5 In the figure, a processor 510 is used as an example; the processor 510, memory 520, input device 530 and output device 540 in the electronic device can be connected via a bus or other means. Figure 5 The bus connection is taken as an example.

[0146] The memory 520, as a computer-readable storage medium, can be used to store software programs, computer executable programs, and modules, such as the program instructions / modules corresponding to the interlocking program data verification method in the embodiments of the present application (for example, the program file acquisition module 410 to be parsed, the structure parsing module 420, the structure data acquisition module 430, and the structure data verification module 440). The processor 510 executes the various functional applications and data processing of the electronic device by running the software programs, instructions, and modules stored in the memory 520, that is, implementing the above-mentioned interlocking program data verification method.

[0147] The memory 520 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created based on the use of the terminal, etc. In addition, the memory 520 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 520 may further include a memory remotely located relative to the processor 510, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0148] The input device 530 may be used to receive input character information and generate key signal input related to user settings and function control of the electronic device. The output device 540 may include a display device such as a display screen.

[0149] Example 6

[0150] Embodiment 6 of the present application also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to execute an interlocking program data verification method, the method comprising: obtaining an original program file in a railway interlocking system, and extracting structure declaration statements to obtain a program file to be parsed; parsing the structure declarations in the program file to be parsed through a structural state transition model to obtain each structure and the nested relationship between each structure; parsing the phrases in each structure through a data state transition model to obtain structure data; and verifying the structure data according to the original configuration data, each structure, the nested relationship between each structure, and the structure data corresponding to the original program file.

[0151] Of course, the storage medium containing computer-executable instructions provided in an embodiment of the present application is not limited to the method operations described above, and can also execute related operations in the interlocking program data verification method provided in any embodiment of the present application.

[0152] Through the above description of the implementation methods, those skilled in the art can clearly understand that the present application can be implemented with the help of software and necessary general-purpose hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for enabling an electronic device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0153] It is worth noting that in the embodiment of the above-mentioned interlocking program data verification device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application.

[0154] Note that the above are only preferred embodiments of the present application and the technical principles employed. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application has been described in more detail through the above embodiments, the present application is not limited to the above embodiments and may include many other equivalent embodiments without departing from the scope of the present application. The scope of the present application is determined by the scope of the appended claims.

Claims

1. A method for verifying interlocking program data, characterized in that: include: Obtain the original program file in the railway interlocking system, extract the structure declaration statement, and obtain the program file to be parsed; Parsing the structure declarations in the program file to be parsed through the structure state transition model to obtain the nested relationships between the structures; Parsing the phrases in each structure through a data state conversion model to obtain structure data; The structure data is verified according to the original configuration data corresponding to the original program file, each structure, the nesting relationship of each structure and the structure data.

2. The method according to claim 1, characterized in that The structure declaration in the program file to be parsed is parsed by the structure state transition model to obtain each structure and the nested relationship between each structure, including: Obtaining each phrase to be judged from the program file to be parsed; Through the structural state transition model, state transition is performed according to the phrases to be judged one by one to obtain the nested relationship between each structure and each structure; the structural state transition model includes: initial state, keyword judgment state, nested keyword judgment state, name judgment state, rollback state and return to top of stack state.

3. The method according to claim 2, characterized in that Before obtaining each phrase to be judged from the program file to be parsed, the method further includes: Initialize a declaration stack and a multitree stack configured for the structure state transition model; the declaration stack is used to store the parsed structure; the multitree stack is used to store the parsed structure nesting relationship.

4. The method according to claim 3, characterized in that The keyword judgment state is used to judge whether the current phrase to be judged is a structure keyword; The nested keyword judgment state is used to create a child node in the multitree stack when the second judgment result is a structure keyword; The name judgment state is used to judge whether the current phrase to be judged is an existing name, and if the judgment result is yes, the current phrase to be judged is stored in the declaration stack; The fallback state is used to determine whether the current phrase to be determined is an end symbol, and when the judgment result is yes, the phrases in the declaration stack are controlled to be popped out in sequence, and at the same time, the node in the multi-tree stack is controlled to be popped out and the parameter of the node is updated to the structure name, and the multi-tree node and the corresponding structure name are stored in the global variable.

5. The method according to claim 1, characterized in that The data state conversion model is used to parse the phrases in each structure to obtain structure data, including: Through the data state transition model, state transition is performed according to the phrases in the structure one by one to obtain the names and values ​​of each variable; the data state transition model includes: initial state, keyword judgment state, name judgment state, fallback state, syntax detection state and variable definition state.

6. The method according to claim 5, characterized in that The grammar detection state is used to store the current phrase into the grammar detection list to perform bracket grammar detection on the corresponding phrase; the variable definition state is used to determine whether the current phrase is a variable definition, and obtain the iterative string when the determination result is yes.

7. An interlocking program data verification device, characterized in that: include: The module for obtaining the program file to be parsed is used to obtain the original program file in the railway interlocking system and extract the structure declaration statement to obtain the program file to be parsed; A structure parsing module is used to parse the structure declaration in the program file to be parsed through a structure state transition model to obtain each structure and the nested relationship between each structure; A structure data acquisition module, configured to parse the phrases in each structure through a data state conversion model to obtain structure data; The structure data verification module is used to verify the structure data according to the original configuration data corresponding to the original program file, each structure, the nesting relationship of each structure and the structure data.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the interlocking program data verification method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the interlocking program data verification method according to any one of claims 1 to 6 is implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements the interlocking program data verification method according to any one of claims 1 to 6.