Train control system test scene and test case management method based on knowledge graph

By constructing an ordered many-to-many relationship knowledge graph in a graph database, the complex relationship between test scenarios and test cases in the train control system was solved, enabling efficient and accurate test sequence management and change impact analysis, thus improving the efficiency and accuracy of the joint debugging and testing phase.

CN121635277APending Publication Date: 2026-03-10SIGNAL & COMM RES INST OF CHINA ACAD OF RAILWAY SCI +3
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202511919872.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-18
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In existing technologies, the complex many-to-many relationships between test scenarios and test cases in train control systems are difficult to express, maintain, and trace efficiently. The lack of automation and change tracing capabilities results in a large workload for test sequence arrangement, which is prone to errors and makes it difficult to quickly and accurately reverse locate the affected test scenarios and sequences.

Method used

By employing a knowledge graph-based approach, an ordered many-to-many relationship between test scenarios and test cases is constructed in a graph database. Execution sequence attributes are set, and through transactional operations and consistency checks, graph query language is used for sorting and change impact analysis to achieve intelligent management of test assets.

Benefits of technology

It improves the efficiency and accuracy of test sequence writing, ensures data consistency and robustness, supports flexible management and precise location of change impacts, and reduces manual reliance and resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121635277A_ABST
    Figure CN121635277A_ABST
Patent Text Reader

Abstract

The invention discloses a train control system test scene and test case management method based on a knowledge graph, and relates to the technical field of railway signal and train operation control system testing. Comprising the following steps: constructing a knowledge graph in a graph database; establishing an ordered many-to-many relationship between the test scene set and the test case set, and setting execution sequence attributes on the ordered many-to-many relationship; importing into a graph database, and constructing a test knowledge graph; transactional dynamic adjustment operation is carried out in the database, consistency verification is executed at the same time, and if verification fails, automatic rollback is carried out; aiming at any test scene, utilizing a graph query language to sort the associated test cases, and automatically extracting an ordered test case set; and filling of the test execution document and change influence analysis are realized. According to the method, the compiling efficiency and accuracy of the test sequence in the joint debugging and test stage are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of railway signal and train operation control system testing, and more particularly to a train control system test scene and test case management method based on a knowledge graph. BACKGROUND

[0002] The high-speed railway train operation control system is a complex system composed of core devices such as on-board ATP equipment, ground RBC (wireless block center), interlocking system, and track circuit, and is a key technical system for ensuring the high-speed, safe, and reliable operation of trains. After the system is built or renovated, strict joint debugging must be carried out to verify the function, performance, and collaboration between devices. The industry's testing method has formed a technical system organized and executed in the form of "test case-test scene-test sequence". The knowledge graph technology has been widely used in the graph modeling and efficient retrieval of heterogeneous entities due to its advantages in complex data association and reasoning management.

[0003] During the joint debugging and testing phase of the train control system, there are still significant defects in the management of test scenes and test cases, such as the difficulty in efficiently expressing and maintaining the relationship, and the complex relationship between test scenes and test cases, which is many-to-many and needs to maintain the execution order. The current management method mainly based on tables or relational databases cannot intuitively and effectively maintain and express this high-coupling ordered association relationship, resulting in a blurred cross-system information logical link, limited traceability efficiency, lack of automation and change traceability capability, and a huge workload and high error rate in the arrangement of test sequences mainly relying on manual retrieval, screening, and sorting. More importantly, the existing system lacks a machine-readable ordered relationship expression and automatic reasoning mechanism, making it difficult to quickly and accurately locate all affected test scenes and sequences when the requirements or data change.

[0004] Therefore, a train control system test scene and test case management method based on a knowledge graph is proposed to solve the problems existing in the prior art, which is a problem that needs to be solved by those skilled in the art. SUMMARY

[0005] Therefore, the present application provides a train control system test scene and test case management method based on a knowledge graph to solve the problem of complex many-to-many association relationship between test scenes and test cases being difficult to efficiently express, maintain, and trace, and the problem of the lack of structured expression of ordered relationship and sequential derivation capability in the arrangement of test sequences, thereby improving the efficiency and accuracy of test sequence compilation during the joint debugging and testing phase.

[0006] To achieve the above-mentioned purpose, the present application provides the following technical solutions: A train control system test scene and test case management method based on a knowledge graph, comprising the following steps: S1. Construct a knowledge graph in a graph database, and define the test scenario set S and its attribute model, and the test case set C and its attribute model; S2. Establish an ordered many-to-many relationship between the test scenario set S and the test case set C. and in Set execution sequence properties , Used to specify the execution order of test cases in the test scenario; S3. Establish the ordered many-to-many relationship between the test scenario set S and the test case set C. Import the graph database and construct a test knowledge graph; S4. Perform transactional dynamic adjustment operations within the database and simultaneously execute consistency checks. If the check fails, automatically roll back. S5. For any test scenario s, use graph query language to determine the relation attributes. Sort the associated test cases and automatically extract the ordered test case set. ; S6, Based on an ordered set of test cases This enables the filling of test execution documents and the analysis of the impact of changes.

[0007] Optionally, the attributes of the test scenario set S in S1 include scenario number, scenario description, expected results, and selection requirements, and the attributes of the test case set C include case number, content description, inspection items, and remarks.

[0008] Optionally, an ordered many-to-many relationship exists between the test scenario set S and the test case set C in S2. With attributed quadruples Formal storage, in which It is a set of edge attributes, including execution sequence attributes. And the version tense attributes ValidFrom / ValidTo.

[0009] Optionally, S4 performs transactional dynamic adjustment operations within the database and simultaneously executes consistency checks. If the check fails, it automatically rolls back. The specific details are as follows: Transactional dynamic adjustment operations within the database include association, unassociation, and replacement; After the transactional dynamic adjustment operation is completed, the system synchronously generates an audit event quadruple. The quadruple is mapped to an event node in the graph and connected to the affected object, realizing full traceability of the relational operation.

[0010] Optionally, a consistency check is performed, and if the check fails, an automatic rollback is initiated. The specific details are as follows: For database validity and consistency constraints, define the adaptation predicate: , Indicates permission to establish The association, typically including atomic constraints, can be:

[0011] Import consistency predicates :

[0012] Both import and maintenance must meet the requirements. ∈ : .

[0013] Optionally, in S6, change impact analysis refers to the system using the reverse path lookup capability of the graph database to immediately locate all test scenarios containing the test case and calculate its impact range when a test case fails or changes. It also outputs an impact list, forming an audit log.

[0014] Optionally, the knowledge graph constructed in the graph database in S1 also includes an extended node set A, which includes functional modules, requirements, defects, equipment, operating modes, or preconditions and prerequisites.

[0015] As can be seen from the above technical solution, compared with the prior art, the present invention provides a knowledge graph-based method for managing test scenarios and test cases of train control systems, which has the following beneficial effects: (1) This invention models the complex ordered many-to-many relationship between test scenarios and test cases as ordered edges in a knowledge graph, using attributed quadruples. Graph databases effectively solve the problems of unintuitive relational representation and difficulty in maintaining consistency in traditional databases. Their flexible structure supports dynamic expansion of test assets, significantly improving data consistency, readability, and system robustness. (2) This invention sets the core execution sequence attribute on the relation. By setting metadata such as sequence position on the relationship, it supports sequential presentation and sequential export of ordered case sets based on relationship attributes. Combined with the sorting algorithm, it can significantly improve the efficiency and accuracy of writing test sequences in the joint debugging and testing phase, completely eliminating the dependence on human experience. (3) The present invention is based on transactional management and adaptive constraint predicates for relational operations. Verification ensures the atomicity of relation updates and data integrity through auditing event quadruples. The mechanism enables full auditing and verifiable dynamic adjustment of relationship status changes, meeting the flexible management needs of test assets. (4) This invention utilizes the reverse path query capability of knowledge graphs and the temporal effective interval in relation attributes. It can accurately locate all test scenarios and related sequences affected by any test case change, which builds an end-to-end traceability link for test assets, provides accurate basis for change impact analysis, and saves test resources and time. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0017] Figure 1 This invention provides a schematic diagram of a knowledge graph-based test scenario, test cases, and attributes. Figure 2 A flowchart of a knowledge graph-based test scenario and test case management method for train control systems is provided for this invention. Figure 3 This is a partial schematic diagram of the knowledge graph nodes and relationships of the CTCS-2 level train control system test field test, provided by the present invention. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] See Figure 1 and Figure 2 As shown, this invention discloses a method for managing test scenarios and test cases of a train control system based on a knowledge graph, including the following steps: S1. Construct a knowledge graph in a graph database, and define the test scenario set S and its attribute model, and the test case set C and its attribute model; S2. Establish an ordered many-to-many relationship between the test scenario set S and the test case set C. and in Set execution sequence properties , Used to specify the execution order of test cases in the test scenario; S3. Establish the ordered many-to-many relationship between the test scenario set S and the test case set C. Import the graph database and construct a test knowledge graph; S4. Perform transactional dynamic adjustment operations within the database and simultaneously execute consistency checks. If the check fails, automatically roll back. S5. For any test scenario s, use graph query language to determine the relation attributes. Sort the associated test cases and automatically extract the ordered test case set. ; S6, Based on an ordered set of test cases This enables the filling of test execution documents and the analysis of the impact of changes.

[0020] Furthermore, the attributes of the test scenario set S in S1 include scenario number, scenario description, expected results, and selection requirements, while the attributes of the test case set C include case number, content description, inspection items, and remarks.

[0021] Furthermore, the ordered many-to-many relationship between the test scenario set S and the test case set C in S2. With attributed quadruples Formal storage, in which It is a set of edge attributes, including execution sequence attributes. And the version tense attributes ValidFrom / ValidTo.

[0022] Furthermore, S4 performs transactional dynamic adjustment operations within the database and simultaneously executes consistency checks. If the check fails, it automatically rolls back. The specific details are as follows: Transactional dynamic adjustment operations within the database include association, unassociation, and replacement; After the transactional dynamic adjustment operation is completed, the system synchronously generates an audit event quadruple. The quadruple is mapped to an event node in the graph and connected to the affected object, realizing full traceability of the relational operation.

[0023] Furthermore, the consistency check is performed, and if the check fails, an automatic rollback is initiated. The specific details are as follows: For database validity and consistency constraints, define the adaptation predicate: , Indicates permission to establish The association, typically including atomic constraints, can be:

[0024] Import consistency predicates :

[0025] Both import and maintenance must meet the requirements. ∈ : .

[0026] Furthermore, in S6, change impact analysis refers to the system's ability to immediately locate all test scenarios containing the test case when a test case fails or changes, utilizing the reverse path lookup capability of the graph database, and calculating its impact scope. It also outputs an impact list, forming an audit log.

[0027] Furthermore, the knowledge graph constructed in the graph database in S1 also includes an extended node set A, which includes functional modules, requirements, defects, equipment, operating modes, or preconditions and prerequisites.

[0028] In a specific embodiment, such as Figure 3 As shown, it includes the following: This invention focuses on the graphical management and intelligent combination of test scenarios and test cases. Its core is to facilitate the establishment, adjustment and maintenance of an ordered many-to-many relationship between the two, and to provide constraint verification, impact scope analysis and audit traceability capabilities.

[0029] This invention is based on a Python 3.9 environment, uses the Neo4j graph database as the underlying storage, employs Py2neo for program interaction, and uses the Cypher query language to maintain the relationship between test scenarios and test cases, as well as output data. Specifically, it is divided into four stages: data preparation, graph construction, data import and verification, and sequence generation and application. The specific steps are as follows: To achieve the management and efficient reuse of test scenarios and test cases for the train control system, the original tabular data of existing test scenarios and test cases for the train control system commissioning and testing were first collected, as shown in Tables 1 and 2.

[0030] Table 1. Test Case Nodes and Attribute Information Based on Knowledge Graph

[0031] Table 2. Test Scenario Nodes and Attribute Information Based on Knowledge Graph

[0032] The Pandas library was used to read and clean the original tables, with a focus on structuring the description text of the test scenarios and test cases. Key information was extracted and tagged, including scenario and case constraints such as driving mode, direction of travel, location, and preconditions / preconditions. Preconditions and postconditions were extracted from the test case steps to support subsequent adaptation constraint predicates. Verification, for example: "The train is in FS mode".

[0033] To ensure data import quality and query performance, core node labels and their attributes are defined in the graph database, and indexes are created. Among them, unique indexes, such as unique constraint indexes for the test scenario primary key of the test scenario node and the test case primary key of the test case node, ensure the atomicity of the graph data. Composite indexes are mainly created for commonly used retrieval combinations (such as: scene level + driving mode) to speed up the query.

[0034] Establish a directed edge from test scenario node s to test case node c, (s)-[r:CONTAINS]->(c), which is the set of relations. .

[0035] Set the execution sequence attribute on the relation. (SequenceNum), an integer type, specifies the execution order of test case c in test scenario s, providing a sorting basis for sequence generation. Reusability and auditing attributes include ReuseFlag, SourceVersion, ValidFrom / ValidTo, etc., used to support cross-scenario reuse and version control of test cases.

[0036] Data import is achieved using script tools. This process mainly includes foolproof verification, which involves performing non-null checks on key primary keys before importing data into the graph database to eliminate structural defects in the data source and ensure the data quality of the graph. It also includes batch import, which uses Cypher's UNWIND statement to write data in blocks in batches to improve write performance.

[0037] Each time for the relationship When performing link(s,c)), unlink(s,c)), or replace(s,c) operations, ensure that the operation is completed within a database transaction, and execute the adaptation constraint predicate before the operation. If the verification fails or the integrity verification fails, the transaction will be automatically rolled back. When the transaction is committed, the system synchronously generates an audit event quadruple. The corresponding change event node records the operator, timestamp, and difference summary to achieve atomicity and full traceability of relational operations.

[0038] For the user-selected test scenario Using the Cypher query language, with relational attributes Using the sorting key, extract the ordered test case set and export it as a test sequence. .

[0039] The system will As input, the preset document template interface is called, and the attributes (ID, description, check items, etc.) of each case are automatically filled into the template according to the execution sequence, realizing one-click generation and export of on-site test execution files that conform to the joint debugging and testing specifications. As shown in Tables 3 and 4.

[0040] Table 3. Sorted test scenarios and associated test case information returned by Cypher query.

[0041] Table 4. Partial table of field test sequences generated using this method.

[0042] Utilizing the reverse path query capability of graph databases, change impact analysis is performed. During field testing, a specific test case... If the observed phenomena after execution are inconsistent with the expected results, the system can immediately query the test cases associated with the device under test, which facilitates quick problem location, analysis and resolution, and generates a list of the scope of impact, which is recorded as an audit event, greatly improving the maintainability of the test assets.

[0043] In summary, this invention achieves intelligent combination and efficient maintenance of test assets by modeling test scenarios and test cases using attribute graph knowledge graphs. By formally defining ordered many-to-many relationships and introducing transactional operations, constraint verification, and audit trail mechanisms, it significantly improves the efficiency, accuracy, traceability, and collaborative efficiency of test asset management during the joint debugging and testing phase, and supports multiple versions coexisting and cross-project reuse.

[0044] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0045] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A knowledge graph-based management method for test scenarios and test cases of a train control system, characterized in that, The method comprises the following steps: S1, constructing a knowledge graph in a graph database, defining a test scene set S and its attribute model and a test case set C and its attribute model; S2, establish an ordered many-to-many relationship between the test scenario set S and the test case set C , and set the execution sequence attribute on , to explicitly define the execution order of the test cases in the test scenarios;​ S3, an ordered many-to-many relationship between the test scenario set S and the test case set C Import the graph database and build the test knowledge graph; S4, performing transactional dynamic adjustment operations in the database and simultaneously performing consistency verification, and if the verification fails, automatically rolling back; S5, for any test scene s, using graph query language, according to the relationship attribute Sort the associated test cases, and automatically extract an ordered test case set ; S6、based on the ordered test case set , to implement the filling of test execution documents and change impact analysis.

2. The knowledge graph-based test scene and test case management method for a train control system according to claim 1, characterized in that, The attributes of the test scene set S in S1 include scene serial number, scene description, expected result and selected point requirement, and the attributes of the test case set C include case number, content description, check item and note.

3. The knowledge graph-based test scene and test case management method for a train control system according to claim 1, characterized in that, S2 ordered many-to-many relation between test scenario set S and test case set C with attribute four-tuple formal storage, where is a set of edge attributes, including execution sequence attribute and version temporal attribute ValidFrom / ValidTo.

4. The knowledge graph-based test scene and test case management method for a train control system according to claim 1, characterized in that, The specific content of performing transactional dynamic adjustment operations in the database and simultaneously performing consistency verification, and if the verification fails, automatically rolling back in S4 is: The transactional dynamic adjustment operations in the database include association, disassociation and replacement; After the transactional dynamic adjustment operations are completed, the system synchronously generates an audit event quadruple, the quadruple is mapped as an event node in the graph, connected with the affected object, and the whole process of the relationship operation is traced back.

5. The knowledge graph-based test scene and test case management method for a train control system according to claim 4, characterized in that, The specific content of performing consistency verification, and if the verification fails, automatically rolling back is: For the legality and consistency constraints of the database, an adaptive predicate is defined: , indicates that the establishment of an association is allowed Typical atomic constraints can include: Importing a Consistent Predicate : Both import and maintenance need to satisfy ∈ : .

6. The knowledge graph-based test scene and test case management method for a train control system according to claim 1, characterized in that, The change impact analysis in S6 refers to when a test case fails or is changed, the system uses the reverse path query capability of the graph database to immediately locate all test scenario sets containing the test case, calculate its impact range, and output the impact list to form an audit record. ​ 7. The knowledge graph-based test scene and test case management method for a train control system according to claim 1, characterized in that, The knowledge graph constructed in the graph database in S1 further includes an extended node set A, and the extended node set A includes a function module, a requirement, a defect, a device, a running mode or a pre-post condition.

Citation Information

Patent Citations

  • Fault prediction method for complex equipment

    CN115827888A

  • Knowledge graph completion method fusing weight and tense information

    CN116304089A

  • Process industry process optimization method based on knowledge graph reasoning and completion

    CN116484006A

  • Code testing method and device and storage medium

    CN116578477A

  • Automatic interface testing method and device based on knowledge graph, electronic equipment, storage medium and program product

    CN119415416A