ATC subsystem test scheme generation method and system

By performing semantic understanding and structured extraction of test requirement documents, combined with standardized conversion of pseudocode intermediate layer, the problem of low efficiency in simulation testing of train control systems across different versions is solved, realizing the generation of efficient and maintainable test solutions, which are suitable for train control systems in high-density operation and unmanned driving scenarios.

CN121106428APending Publication Date: 2025-12-12ZHONGHE ZHIXING RAIL TRANSIT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511122400.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-12
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

Existing train control system simulation testing makes it difficult to quickly build feasible test plans across different test versions, resulting in low testing efficiency. This is especially true in highly customized SA projects, where compatibility issues and efficiency bottlenecks are prominent.

Method used

By performing semantic understanding and structured extraction of test requirements documents, test cases are generated using domain matching principles. A pseudocode intermediate layer is used to achieve standardized conversion of test cases to scripts, supporting template reuse and rapid adjustment of test strategies.

Benefits of technology

It improves the accuracy of requirement parsing between complex line versions, enhances the adaptability of customized scenarios, significantly shortens the development cycle, improves testing efficiency and maintainability, and meets the SIL4 level security standard.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121106428A_ABST
    Figure CN121106428A_ABST
Patent Text Reader

Abstract

The invention discloses an ATC subsystem test scheme generation method and system, belongs to the technical field of rail transit signal system testing, and aims to improve the accuracy of demand analysis between complex line versions and enhance the adaptability to customized scenes by performing semantic understanding on a test demand document. Standardized conversion from the test case to the script is achieved through the pseudo-code middle layer, script generation efficiency and maintainability are improved, template reuse and rapid test strategy adjustment are supported, and therefore the development period is remarkably shortened, the test efficiency is improved, and the test cost is reduced. The problem of low test efficiency caused by difficulty in quickly constructing feasible test schemes in different test versions in the existing train control system simulation test is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of rail transit signal system testing, in particular to an ATC subsystem test scheme generation method and system. BACKGROUND

[0002] With the rapid development of urban rail transit systems towards high-density operation and unmanned driving, the structure of the simulation signal system is increasingly complex, and its safety level requirement is also upgraded to SIL4 level. In order to ensure the stability and safety of each functional module of the system, the test and verification based on the simulation system has become one of the core means. Currently, the rail transit signal simulation system needs to support the test requirements of both the general application (GA) and the special application (SA) versions. Due to the differences in operating parameters, vehicle configuration and control logic of different lines, the SA version test usually needs to be modified and adapted based on the GA version, thereby causing the problems of high difficulty in adapting to multiple version requirements, low efficiency in version change transmission and low efficiency in developing automated scripts. The current automated development process of the train control system simulation test mainly includes two key stages: one is to convert the natural language description requirements into structured test cases; the other is to further convert the test cases into executable automated test scripts. For these two stages, the industry generally adopts manual methods. With the rapid development of deep learning and artificial intelligence technology, some development engineers try to apply model-driven technology or AI-assisted generation methods in test development. However, in the train control system, especially in the SA project with high customization degree, these methods have exposed obvious adaptability problems and efficiency bottlenecks.

[0003] A method and device for generating test cases of temporary speed limit messages of a train control system are disclosed in Chinese Patent CN111003030A published on April 14, 2020. The method includes reading an engineering data table, which at least includes: a route information table, a phase separation information table, a transponder position table, a signal point track section data table, a line slope table, a mileage system information table, a line mileage chain detail table, and a line speed table; when receiving a user-triggered test scenario generation request, generating a test scenario by calling the engineering data table; and when receiving a user-triggered expected result calculation request, calculating the expected result corresponding to the test scenario by calling a preset rule. However, when generating test cases, the method needs to be developed specifically for various different line conditions, which results in excessive workload for the developers and low adaptability and development efficiency among different test cases. SUMMARY

[0004] The present application aims at the problem that the existing train control system simulation test is difficult to quickly build a feasible test scheme in different test versions, thereby causing low test efficiency, by performing semantic understanding on the test requirement document, improving the accuracy of requirement analysis between complex line versions, enhancing the adaptability to customized scenarios, and realizing standardized conversion of test cases to scripts through a pseudo code intermediate layer, improving script generation efficiency and maintainability, while supporting template reuse and rapid adjustment of test strategies, thereby significantly shortening the development cycle and improving test efficiency.

[0005] In a first aspect, a technical solution provided in an embodiment of the present application is an ATC subsystem test scheme generation method, including the following steps: S1, performing semantic understanding and structured extraction on the test requirement document to obtain a test target; S2, performing related domain knowledge matching on the test target based on a domain matching principle to obtain a test case; S3, performing business logic configuration on the test case based on a business logic configuration table and performing structured file processing to obtain a test outline; S4, performing pseudo code expression processing on the test outline through a pseudo code expression layer to obtain a test pseudo code; performing scripting processing on the test pseudo code to obtain a test script, and filling in safety logic to obtain a test scheme.

[0006] In the present scheme, by performing semantic understanding on the test requirement document, the accuracy of requirement analysis between complex line versions is improved, and the adaptability to customized scenarios is enhanced; by automatically associating the test target and the corresponding domain knowledge through a knowledge matching mechanism, it is ensured that the generated test case conforms to the industry specifications, and the domain adaptability of the finally obtained test scheme is enhanced; by realizing standardized conversion of test cases to scripts through a pseudo code intermediate layer, the script generation efficiency and maintainability are improved, parameter template reuse and rapid adjustment of test strategies are supported, and the development cycle is significantly shortened; by rapid generation of a test outline and efficient deployment of automated code, the test preparation and verification cycle is shortened, and higher level safety protection is provided for train control systems in high-density operation and unmanned driving scenarios.

[0007] As a preferred, in S1, the test requirement document is subjected to semantic understanding and structured extraction to obtain a test target, including the following steps: The test requirement document is subjected to text processing to obtain a test requirement text, and a large language model is used to perform semantic understanding on the test requirement text to obtain key entity text and relationship text; The key entity text and the relationship text are subjected to semantic annotation based on a preset special business dictionary, and the words in the key entity text and the relationship text are associated based on context to obtain a test text; The test text is subjected to standardized format processing to obtain a test target.

[0008] In the scheme, by uniformly processing different formats of requirement documents, unstructured contents such as tables and graphics are converted into parseable texts, the text heterogeneity problem is solved, and the difficulty of subsequent understanding of the test requirement documents is reduced; by performing semantic labeling on the texts, texts with similar semantics but non-professional terms are converted into professional texts, so that the understanding ability of fuzzy expressions can be improved, and the dependency relationship between the requirement items is analyzed through context association, so that the logical association between the preconditions and operation steps required in the test process is recognized.

[0009] Preferably, the test requirement document includes an ATC subsystem requirement specification and a software requirement specification; and the special business dictionary includes train operation state related terms, control logic related terms and interlocking control related terms.

[0010] In the scheme, the ATC subsystem requirement specification and the software requirement specification are taken as core inputs, the core control module of the train control system is focused, and it is ensured that the test target does not deviate from the core function verification of the signal system; through the classification of each term in the special business dictionary, semantic ambiguity can be targetedly eliminated, so that the domain adaptability in semantic understanding is improved; through the definition of the test requirement document range and the special dictionary classification, the two form a synergistic effect of "input range focusing + term resolution accuracy", so as to provide a structured input with "clear boundary and accurate term" for subsequent test case generation, reduce the invalid or repeated test cases caused by requirement analysis deviation, and improve the test efficiency.

[0011] Preferably, in S2, the test target is matched with related domain knowledge based on a domain matching principle to obtain a test case, including the following steps: A domain rule library is constructed, key entity texts in the test target are matched with rule items of various types in the domain rule library, and the matched rule items are taken as target rule items; Based on the contents in the target rule items, a test target and corresponding preconditions and expected results are constructed, and the test case is obtained by saving and numbering.

[0012] In the scheme, by keyword matching and rule library predefinition, typical test scenarios of the train control system are constructed, manual design of verification logic of each test case by test engineers is not needed, manual intervention is reduced, and the test case generation efficiency is improved; by generating the test case in strict accordance with the domain rules, it can be ensured that the test case covers the safety critical scenarios, and by using standardized terms in the rule library, the terms in the test case are uniformly expressed, which not only avoids understanding deviation caused by inconsistent terms, but also ensures the test coverage, guarantees the test effect and reliability.

[0013] As preferred, the construction of the domain rule library comprises the following steps: Based on relevant domain technical specifications and industry experience, the domain rule items are sorted, classified based on business scenarios, and integrated to obtain a domain rule library. The rule categories in the domain rule library include interlocking verification rules, movement authorization rules, station function logic rules, and fault tolerance and boundary rules.

[0014] In this scheme, through the dual protection of "authoritative specifications + practical experience", the precise matching of "scenario classification", and the flexible maintenance of "structured management", high-quality domain knowledge support is provided for test case generation, ultimately achieving the comprehensive effect of test efficiency improvement, test quality guarantee, and version adaptability enhancement. It is especially suitable for the high safety and high customization testing needs of complex train control system SA projects.

[0015] As preferred, in S3, the test cases are configured with business logic based on a business logic configuration table and are processed as structured files to obtain a test outline, comprising the following steps: The content in the business logic configuration table includes configurable function enumeration, test function name, and test project configuration column; Based on the type corresponding to the rule item in the test case, the corresponding configurable function and the corresponding test function name are matched from the business logic configuration table; Based on the test purpose in the test case, the corresponding test project is matched from the business logic configuration table, and the configuration parameters of the test project are set according to the preconditions and expected results, and the corresponding operation steps are set based on the set configuration parameters; The test cases and corresponding operation steps are stored in EXCEL form based on the order of case numbers to obtain a test outline.

[0016] In the scheme, the customized function specific to the SA project is explicitly marked by setting the business logic configuration table, the function related to the project is loaded only by matching the rule item type of the test case, the content irrelevant to the current SA project in the GA general regulation is avoided to be introduced, and thus the pertinence of the test outline is significantly improved; when the business logic of the SA project is changed, only the "configurable function enumeration" and the "test project configuration column" in the business logic configuration table need to be modified, and the test case core logic does not need to be re-written, and the system will automatically regenerate the operation steps according to the updated configuration parameters, so that the maintenance cost in the version iteration is greatly reduced; the accurate binding of the test case and the customized demand of the SA project is realized through the business logic configuration table, the consistency, the maintainability and the traceability of the test outline are improved through the standardized storage and the parameterized configuration, and finally the high-quality and high-adaptation input is provided for the subsequent pseudo code generation and the scripting processing, and the efficient test and verification of the SA project of the train control system in the high-frequency iteration scene is supported.

[0017] Preferably, in S4, the pseudo code expression layer includes a general syntax layer, a domain-specific instruction set and an instruction template library; The general syntax layer is used to define corresponding logic codes for the judgment logic, the loop logic and the sequential execution logic in the corresponding rule item; The domain-specific instruction set selects a corresponding instruction category based on the corresponding scene of the test case in the test outline and matches a corresponding instruction template from the instruction template library; The configuration parameters of the corresponding test project in the test outline are input into the instruction template, and the test pseudo code is generated through logical connection of the logic codes.

[0018] In the scheme, the natural language logic in the test outline is converted into structured code through the pre-defined judgment logic, loop logic and the like, so that the expression difference in manual pseudo code writing is eliminated, the team collaboration efficiency is improved, and the understanding cost is reduced; by setting the instruction template library, the pre-defined instruction templates for common test scenes can avoid repeated writing of basic logic, and when the related basic test appears in the test outline, the template can be directly called, so that the repeated code writing is reduced, and the test efficiency is improved; the pseudo code expression layer provides a "business-friendly, technology-neutral and flexible extension" intermediate layer for the test of the train control system through standardized logic expression, domain-specific instruction design and parameterized template reuse, so that the test outline can be efficiently converted into an executable script, and the consistency, maintainability and traceability of the test logic are guaranteed.

[0019] Preferably, in S4, the test script is obtained by scripting the test pseudo code, including the following steps: Based on the content of the test pseudo code, the test function is named in the format of the test case number plus the business scene; The test function is converted into a Python test script based on the pytest framework, and the execution order and priority of the test script are determined based on the operation steps in the test outline.

[0020] In this scheme, the test function is named by adding the test case number and the business scenario, a bidirectional traceability link of "test case → pseudo code → script" is established, so that the tester can directly locate the corresponding test target and business logic through the function name, and if a problem occurs during testing, the associated test case number and business scenario can also be found through the function name, which facilitates the traceability of the problem; by converting the test function into a Python script based on the pytest framework, it can be directly integrated into the automated testing platform to realize unattended batch operation, which can greatly reduce the workload of the tester; in summary, by standardizing the naming, framework adaptation and execution logic planning, the test pseudo code is converted into a "traceable, automated and easy-to-maintain" Python test script, which not only ensures the strong association of the script with the test case and the business scenario, but also adapts to the mainstream automated testing ecosystem, providing an efficient and reliable execution carrier for the high-frequency iterative testing of the train control system SA project.

[0021] As preferred, in S4, the test script is filled with safety logic to obtain a test scheme, including the following steps: Inserting mandatory check points between steps in the test script related to SIL4 level safety requirements, and setting and storing safety detection rules at the mandatory check points to obtain a test scheme; Directly importing the test scheme into the test simulation software for simulation testing; If the previous steps of the mandatory check point fail during testing, the test is automatically terminated and the exception is recorded.

[0022] In this scheme, by inserting mandatory check points, it can be ensured that each safety critical scenario is strictly verified, for example, inserting a check point "verify whether the ATP module normally receives the section speed limit parameter" between the "train enters section 3" and "speed monitoring" steps can avoid safety hazards caused by parameter transmission errors; through the setting of mandatory check points and the exception handling mechanism, the test scheme not only meets the compliance requirements of the SIL4 level safety standard, but also actively intercepts risks and improves efficiency during testing, and through seamless integration with the simulation software, it ensures the automation and consistency of safety logic verification.

[0023] In a second aspect, a technical solution provided in an embodiment of the present application is: an ATC subsystem test scheme generation system, comprising a requirement analysis module, a domain rule matching module, a business logic configuration module, a pseudo code generation module and a script generation module; The requirement analysis module performs semantic understanding and structured extraction on the test requirement document to obtain a test target; The field rule matching module matches the test target with related field knowledge based on field matching principles to obtain test cases; The business logic configuration module configures the test cases with business logic based on a business logic configuration table and performs structured file processing to obtain a test outline; The pseudo code generation module performs pseudo code expression processing on the test outline with the help of a pseudo code expression layer to obtain test pseudo codes; The script generation module performs scripting processing on the test pseudo codes to obtain test scripts, and fills the test scripts with security logic to obtain test schemes.

[0024] In the scheme, the test scheme generation method in the scheme is carried by constructing a corresponding system, human-computer interaction is realized, and the use experience of test personnel is improved.

[0025] The present application has the following advantages: (1) The present application realizes deep understanding and structured extraction of non-standardized documents, improves the accuracy of demand analysis between complex circuit versions, and enhances the adaptability to customized scenarios; (2) The present application realizes standardized conversion from test cases to scripts through a pseudo code intermediate layer, improves the script generation efficiency and maintainability, supports parameter template reuse and rapid adjustment of test strategies, and significantly shortens the development cycle.

[0026] The above invention content is only a summary of the technical scheme of the present application, in order to more clearly understand the technical means of the present application, which can be implemented according to the content of the specification, and in order to make the above and other purposes, characteristics and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application are described below. BRIEF DESCRIPTION OF DRAWINGS

[0027] Other features, objects and advantages of the present application will become more apparent from the following detailed description of non-limiting embodiments made with reference to the accompanying drawings. The drawings are for the purpose of illustrating preferred embodiments only and are not to be construed as limiting the present application. Moreover, the same reference numerals are used throughout the accompanying drawings to refer to the same or like parts.

[0028] Figure 1 A flow chart of a test scheme generation method of an ATC subsystem according to the present application; Figure 2 A principle block diagram of a test scheme generation system of an ATC subsystem according to the present application. DETAILED DESCRIPTION

[0029] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only one preferred embodiment of this invention and are only used to explain this invention. They do not limit the scope of protection of this invention. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0030] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations (or steps) can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but it may also have additional steps not included in the figures; the process may correspond to a method, function, procedure, subroutine, subroutine, etc.

[0031] Example 1: As Figure 1 As shown, in order to solve the problem of low testing efficiency caused by the difficulty in quickly constructing feasible test plans for different test versions in existing train control system simulation testing, this embodiment provides an ATC subsystem test plan generation method, including the following steps: S1: Semantic understanding and structured extraction of test requirements documents yield the test objectives.

[0032] In this embodiment, the test objectives are obtained by semantic understanding and structured extraction of the test requirements document, including the following steps: The test requirement document is digitized to obtain the test requirement text. A large language model is used to perform semantic understanding on the test requirement text to obtain the key entity text and relation text. Based on a pre-defined dedicated business dictionary, semantic annotation is performed on key entity text and relation text, and test text is obtained by associating terms in key entity text and relation text based on context. The test target is obtained by standardizing the format of the test text.

[0033] Specifically, for tabular documents, including Excel business configuration tables, fields such as initial conditions, operation steps, and expected results are extracted and converted into key-value pairs of text; for flowchart documents, flowchart node text is recognized through OCR and converted into time sequence description text; for plain text paragraphs, sentence segmentation, deduplication, and punctuation standardization are performed.

[0034] With large language models including DEEPSEEK class models as the core, key entities in the text are identified, including train ID, signal machine number, line name, and function module name, etc. For example, from the field "Train T001 needs to comply with 30 km / h permanent speed limit when running in the section", the entities "Train T001", "running in the section" and "30 km / h permanent speed limit" are extracted; then the logical relationship between entities is identified, for example, from "When the turnout S101 is positioned, the route S1001-S1201 is allowed to be handled", the relationship "Turnout S101 positioning → Route S1001-S1201 can be handled" is extracted.

[0035] Firstly, by constructing a semantic annotation system, the model ensures accurate understanding of ambiguous expressions with the help of a special business dictionary, for example: clearly annotating CBTC communication train safety interval and point train safety interval as subtypes of safety interval; annotating specific fault types such as communication interruption, turnout failure, and on-board ATP failure as fault scenarios, providing a basis for subsequent test case generation, and then analyzing the dependency relationship between requirement items through context association, for example: identifying that train arrival at a station requires preconditions such as route establishment and signal green light; then analyzing the logical association between speed monitoring function and safety margin calculation rule to ensure the completeness of test element extraction; finally, outputting the extracted test text in a unified format, for example: "Preconditions: ["Train T001 arrives at Station A", "Platform cleaning is completed"]" "Expected results: ["Turnout S101 successfully switches to reverse position", "Train T001 starts to turn around after 3 seconds", "Finally arrives at Station A reverse platform"]" and other fields.

[0036] In this embodiment, different formats of requirement documents including Word, Excel and flowcharts are uniformly processed, and unstructured content such as tables and graphics is converted into parseable text, solving the problem of text heterogeneity and reducing the difficulty of subsequent understanding of test requirement documents; through semantic annotation of the text, non-professional terms with similar semantics are converted into professional text, thereby improving the understanding ability of ambiguous expressions; and by analyzing the dependency relationship between requirement items through context association, the logical association between preconditions and operation steps required in the test process is identified.

[0037] In this embodiment, the test requirement document includes ATC subsystem requirement specification and software requirement specification; the special business dictionary includes train operation state related terms, control logic related terms and interlocking control related terms.

[0038] Specifically, the test requirement document includes BiCC subsystem requirement specification, ATO, ATP, TOD, FATO software requirement specification and BiZC subsystem software requirement specification, etc. The above documents are usually presented in mixed text format, containing a large amount of non-standardized description, table and flowchart information. In order to effectively extract the test intention, the system integrates a large language model, and combines a pre-trained rail transit signal system semantic dictionary to perform syntax analysis, entity recognition and test element extraction. By constructing a lexical template and a context window judgment model, the system can accurately identify the key elements such as preconditions, operation steps and expected results. At the same time, the content association algorithm is used to model the dependency relationship between the requirement items, including point control level, interlocking condition and vehicle parameter matching, etc., to provide semantic support for subsequent test logic generation.

[0039] The embodiment specifies the ATC subsystem requirement specification and software requirement specification as the core input, focuses on the core control module of the line control system, and ensures that the test target does not deviate from the core function verification of the signal system; through the classification of each entry in the special business dictionary, the semantic ambiguity can be targetedly eliminated, thereby improving the domain adaptability in semantic understanding; by specifying the scope of the test requirement document and the classification of the special dictionary, the two form a synergistic effect of input range focusing + accurate term resolution, thereby providing a structured input with clear boundaries and accurate terminology for subsequent test case generation, reducing the invalid or repeated test cases caused by requirement analysis deviation to improve the test efficiency.

[0040] S2: obtaining a test case by matching the test target with related domain knowledge based on the domain matching principle.

[0041] In the embodiment, the test case is obtained by matching the test target with related domain knowledge based on the domain matching principle, including the following steps: Constructing a domain rule library, matching the key entity text in the test target with various rule entries in the domain rule library, and taking the matched rule entry as a target rule entry; Based on the content in the target rule entry, constructing the test purpose and its corresponding preconditions and expected results, and saving and numbering them to obtain a test case.

[0042] The embodiment constructs a typical test scene of the train control system through keyword matching and rule library predefinition, without the need for test engineers to manually design verification logic of each use case, reduces manual intervention, and improves the generation efficiency of test cases; by generating test cases in strict accordance with domain rules, it can be ensured that test cases cover safety-critical scenarios, and by using standardized terms in the rule library, the terms in the test cases are uniformly expressed, which not only avoids understanding deviation caused by inconsistent terms, but also ensures test coverage, and guarantees test effectiveness and reliability.

[0043] In the embodiment, the construction of the domain rule library includes the following steps: Based on relevant domain technical specifications and industry experience, domain rule items are sorted and classified based on business scenarios, and all domain rule items are integrated to obtain a domain rule library; the rule categories in the domain rule library include interlocking verification rules, movement authorization rules, station function logic rules, and fault tolerance and boundary rules.

[0044] Specifically, the interlocking verification rules include: route establishment conditions, such as the need to simultaneously satisfy the correct position of the turnout, the idle of the signal machine, and the conflict-free route; turnout state verification, such as needing to remain stable for 3 seconds after positioning / reposition switching, otherwise an alarm is triggered; signal display logic, such as the signal machine turning from red to green after the route is established, and immediately turning red after the route is cancelled; the movement authorization rules include CBTC communication train safety interval, such as interval ≥ train length + 20 meters of safety margin; point train safety interval, such as interval ≥ 50 meters, which is a fixed value and does not change with speed; non-communication trains, such as fault trains, need to set a protection section to prohibit subsequent trains from entering; the station function logic rules include setting the upper and lower limits of speed, such as normal operation ≤ 80 km / h, and emergency braking trigger threshold ≥ 100 km / h; fault recovery mechanism, such as automatically downgrading to point control within 10 seconds after communication interruption; data exception handling, such as immediately triggering ATP protection when the on-board speed signal jumps by more than 20 km / h.

[0045] The embodiment provides high-quality domain knowledge support for test case generation through the dual protection of authoritative specifications and practical experience, precise matching of scenario classification, and flexible maintenance of structured management, and finally realizes the comprehensive effect of test efficiency improvement, test quality guarantee, and version adaptability enhancement, especially suitable for high-safety and high-customization test requirements of complex train control system SA projects.

[0046] S3: Business logic configuration of test cases based on business logic configuration table and structured file processing to obtain a test outline.

[0047] In the embodiment, the business logic configuration of test cases based on the business logic configuration table and the structured file processing to obtain a test outline includes the following steps: The content in the business logic configuration table includes configurable function enumeration, test function name and test item configuration column; Based on the type corresponding to the rule entry in the test case, the corresponding configurable function and the corresponding test function name are matched from the business logic configuration table; Based on the test purpose in the test case, the corresponding test item is matched from the business logic configuration table, the configuration parameters of the test item are set according to the preconditions and expected results, and the corresponding operation steps are set based on the set configuration parameters; The test case and the corresponding operation steps are stored in the form of EXCEL based on the order of the case number to obtain the test outline.

[0048] In the business logic configuration table, the configurable function enumeration represents the customized function specific to the SA project, such as regional speed limit customization and special turn-back mode, etc.; the test function name is the specific name of the customized function, such as LineA interval 3 special speed limit 25km / h; the test item configuration list represents the parameters and trigger conditions of the customized function, such as "train ID = T001 and position ∈ [interval 3 start point, interval 3 end point]"; and the parameters, such as speed limit value = 25km / h.

[0049] Specifically, the structured semantics output by the natural language requirement analysis module, such as the speed limit function of the test LineA train in interval 3, are matched with the knowledge base to generate test cases that meet the requirements of the SA project, and the specific process is as follows: First, the entities in the analysis result are matched with the keywords of the knowledge base rules, and the speed limit function is mapped to the mobile authorization rule; then the business logic configuration table is matched, wherein the SA project customized rules are preferentially adapted, and then the domain rule base is associated, which is used to supplement general rules. For example, in specific implementation, "LineA interval 3 special speed limit (25km / h)" is matched from the configuration table, and the safety interval = train length + 10 meters is supplemented according to the mobile authorization rule 1, i.e. safety interval calculation, in the associated domain rule base; then based on the matched rules and the configuration table, the structured test case is automatically generated by combining the preset test case template, for example, the test purpose of a certain test case is the core verification target of the integrated matching rules; the preconditions are the trigger conditions extracted from the rules, including train position and turnout state; the expected results of the case are generated based on the verification logic of the rules, and the result content includes boundary value and fault tolerance requirement; the case number is automatically generated in the format of "SA - project name - rule category - serial number", and the corresponding type is marked as function test and safety test, etc. The operation steps are supplemented according to the set parameters, and the test outline is generated based on the operation sequence in the rules, and is stored in the form of structured file such as EXCEL, and supports version management and script conversion, providing a stable data basis for subsequent pseudo code generation and script deployment.

[0050] The embodiment can avoid introducing irrelevant contents of the GA general regulations to the current SA project by setting the business logic configuration table to explicitly mark the customized functions specific to the SA project, loading only the functions related to the project by matching the rule entry type of the test case, thereby significantly improving the pertinence of the test outline; when the business logic of the SA project is changed, only the "configurable function enumeration" and "test project configuration column" in the business logic configuration table need to be modified, without the need to re-write the core logic of the test case, and the system will automatically regenerate the operation steps according to the updated configuration parameters, thereby greatly reducing the maintenance cost during version iteration; the business logic configuration table realizes the accurate binding of the test case and the customized requirements of the SA project, and the standardized storage and parameterized configuration improve the consistency, maintainability and traceability of the test outline, and finally provide high-quality and high-adaptation input for subsequent pseudo code generation and scripting processing, supporting efficient testing and verification of the SA project of the train control system in the high-frequency iteration scenario.

[0051] S4: performing pseudo code expression processing on the test outline by the pseudo code expression layer to obtain test pseudo code; performing scripting processing on the test pseudo code to obtain a test script, and filling the test script with security logic to obtain a test scheme.

[0052] In the embodiment, the pseudo code expression layer includes a general syntax layer, a domain-specific instruction set and an instruction template library; The general syntax layer is configured to define corresponding logic codes for the judgment logic, the loop logic and the sequential execution logic in the corresponding rule entries; The domain-specific instruction set is configured to select a corresponding instruction category based on the corresponding scene of the test case in the test outline and match a corresponding instruction template from the instruction template library; The configuration parameters of the corresponding test project in the test outline are input into the instruction template, and the test pseudo code is generated by logically connecting the configuration parameters through the logic codes.

[0053] Specifically, first, define the special data types of the train control scene, such as defining the train ID as a string, the speed value as a floating-point type, the unit as km / h, the signal state as an enumeration type including red light / green light / yellow light, the route number as an integer type, etc.; then define the control logic, including conditional judgment, such as IF interlocking state == 'healthy' THEN check the signal lamp S1001 =='red light', loop logic, such as WHILE train speed < 30km / h DO execute the acceleration instruction, and sequential logic, such as SEQUENCE handle route S1001.S1201; check the signal lamp S1001 == 'green light'.

[0054] defining a library of command templates, including train state control commands, such as operating the train <id>The mode is raised to the form of <mode> for controlling the train to switch to the automatic / manual / turnback operation mode; the signal and route instruction such as inspection signal <id>Status is in the form of <status> to validate signal display logic; movement authorization management instructions such as calculating CBTC train <id>The form of safety interval <distance> is used to calculate the minimum safety distance of the train based on the mobile authorization rule; the form of fault injection and fault-tolerant instructions such as injecting <fault type> to <module> and waiting for <time length> is used to simulate abnormal scenarios such as turnout failure and communication interruption; the form of data interaction instructions such as obtaining simulation message <type> and analyzing <field> is used to extract key parameters in the simulation system log.

[0055] For example, a typical pseudo-code statement is as follows: IF interlocking state == 'healthy' THEN check signal lamp S1001 =='red light' THEN handle route S1001.S1201 THEN check signal lamp S1001 == 'green light'. The pseudo-code can be directly recognized and converted into standard Python statements by the subsequent script generation module, realizing seamless connection from test logic to code logic.

[0056] In this embodiment, the natural language logic in the test outline is converted into structured code through predefined judgment logic and loop logic, thereby eliminating the expression differences when manually writing pseudo-code, improving team collaboration efficiency, and reducing understanding cost; by setting an instruction template library, the common test scenario predefined instruction templates can avoid repeated writing of basic logic, and when related basic tests appear in the test outline, the templates can be directly called, thereby reducing repeated code writing and improving test efficiency; the pseudo-code expression layer provides a "business-friendly, technology-neutral, and flexible extension" intermediate layer for the train control system test through standardized logic expression, domain instruction design, and parameterized template reuse, so that the test outline can be efficiently converted into executable scripts, while ensuring the consistency, maintainability, and traceability of the test logic.

[0057] In this embodiment, the test pseudo-code is processed to obtain a test script, including the following steps: Based on the content of the test pseudo-code, the test function is named in the format of test case number plus business scenario; The test function is converted into a Python test script based on the pytest framework, and the execution order and priority of the test script are determined based on the operation steps in the test outline.

[0058] Specifically, a conversion mapping rule of pseudo code into script is defined, including that the pseudo code is a judgment logic, which is converted into the script as assert <condition>; <operation function call>, the pseudo code is a check of a certain state, for example, the check signal lamp S1001 == 'green light' is converted into the script as assert signal_mgr.get_state('S1001') == 'GREEN', the pseudo code is a sequential logic, for example, the SEQUENCE operation 1; operation 2 is converted into the script as def test_case(): Operation 1 function() Operation 2 function(), the pseudo code is a parameter variable reading, for example, the parameter variable {{limit speed value}} is converted into the script as limit_speed = config['limit_speed']. By constructing the corresponding mapping rule, the pseudo code is converted into the script without obstacles, which can be directly imported into the test software for simulation testing.

[0059] In this embodiment, the test function is named by adding the test case number and the business scenario, and a bidirectional traceability link of "test case → pseudo code → script" is established, so that the tester can directly locate the corresponding test target and business logic through the function name. If a problem occurs during testing, the associated case number and business scenario can also be found through the function name, which facilitates the traceability of the problem. By converting the test function into a Python script of the pytest framework, the test function can be directly integrated into the automatic test platform, realizing unattended batch operation, which can greatly reduce the workload of the tester. In summary, by standardizing the naming, adapting the framework, and planning the execution logic, the test pseudo code is converted into a "traceable, automated, and easy-to-maintain" Python test script, which not only ensures the strong association of the script with the test case and the business scenario, but also adapts to the mainstream automatic test ecosystem, providing an efficient and reliable execution carrier for the high-frequency iterative testing of the train control system SA project.

[0060] In this embodiment, the test script is filled with safety logic to obtain a test scheme, including the following steps: Inserting a mandatory check point between steps in the test script related to SIL4 level safety requirements, setting and storing a safety detection rule at the mandatory check point to obtain a test scheme; Directly importing the test scheme into the test simulation software for simulation testing; If the previous steps of the mandatory check point fail during testing, the test is automatically terminated and the exception is recorded.

[0061] ​The embodiment can ensure that each safety critical scene is strictly verified by inserting a forced checkpoint, for example, inserting a checkpoint between "train enters section 3" and "speed monitoring" steps to verify whether the ATP module normally receives the section speed limit parameter, so as to avoid safety hazards caused by parameter transmission errors; through the setting of the forced checkpoint and the abnormal processing mechanism, the test scheme not only meets the compliance requirements of the SIL4 safety standard, but also actively intercepts risks and improves efficiency during test execution, and through seamless connection with simulation software, the automation and consistency of safety logic verification are ensured.

[0062] Embodiment 2: As shown in Figure 2 The embodiment also provides an ATC subsystem test scheme generation system, which comprises a requirement analysis module, a domain rule matching module, a business logic configuration module, a pseudo code generation module and a script generation module; The requirement analysis module performs semantic understanding and structured extraction on the test requirement document to obtain a test target; The domain rule matching module matches the test target based on a domain matching principle to obtain a test case; The business logic configuration module configures the test case based on a business logic configuration table and performs structured file processing to obtain a test outline; The pseudo code generation module performs pseudo code expression processing on the test outline by means of a pseudo code expression layer to obtain a test pseudo code; The script generation module performs scripting processing on the test pseudo code to obtain a test script, and fills the test script with safety logic to obtain a test scheme.

[0063] From the above embodiments, at least the following substantial effects can be obtained: (1) The embodiment realizes deep understanding and structured extraction of non-standardized documents (tables, paragraphs, flowcharts and the like), improves the accuracy of requirement analysis between complex line versions, and enhances the adaptability to customized scenarios; (2) The embodiment realizes standardized conversion of the test case to the script through the pseudo code intermediate layer, improves the script generation efficiency and maintainability, supports parameter template reuse and rapid adjustment of the test strategy, and significantly shortens the development cycle; (3) The embodiment realizes rapid generation of the test outline, efficient deployment of the automated code and intelligent analysis of differences between versions, shortens the test preparation and verification period, provides SIL4 safety guarantee for train control systems in high-density operation and unmanned driving scenarios, and has engineering value for multi-project promotion; (4) Based on the field rule base filtering invalid test combination, the actual executable use case ratio is increased by more than 30% compared with the traditional AI model, redundant content is reduced, test coverage is improved, and SIL4 level safety verification requirements are met.

[0064] The above specific embodiments are preferred embodiments of the ATC subsystem test scheme generation method and system of the present application, and are not intended to limit the specific implementation range of the present application. The scope of the present application includes, but is not limited to, the present specific embodiment. Any equivalent changes made in accordance with the shape and structure of the present application are within the scope of protection of the present application.< / id> < / id> < / id>

Claims

1. A method for generating a test plan for an ATC subsystem, characterized in that: Includes the following steps: S1. Semantic understanding and structured extraction of test requirements documents to obtain test objectives; S2. Based on the domain matching principle, test cases are obtained by matching the test target with relevant domain knowledge. S3. Configure the test cases with business logic based on the business logic configuration table and process them into structured files to obtain the test outline; S4. Construct a pseudocode expression layer to process the test outline into pseudocode to obtain test pseudocode. The test pseudocode is scripted to obtain the test script, and the test plan is obtained by filling it with security logic.

2. The method for generating an ATC subsystem test plan according to claim 1, characterized in that: In S1, the test objectives are obtained by semantic understanding and structured extraction of the test requirements document, including the following steps: The test requirement document is digitized to obtain the test requirement text. A large language model is used to perform semantic understanding on the test requirement text to obtain the key entity text and relation text. Based on a pre-defined dedicated business dictionary, semantic annotation is performed on key entity text and relation text, and test text is obtained by associating terms in key entity text and relation text based on context. The test target is obtained by standardizing the format of the test text.

3. The method for generating an ATC subsystem test plan according to claim 2, characterized in that: The test requirements document includes the ATC subsystem requirements specification and the software requirements specification; the dedicated business dictionary includes entries related to train operation status, control logic, and interlocking control.

4. The method for generating an ATC subsystem test plan according to claim 2, characterized in that: In S2, test cases are obtained by matching relevant domain knowledge to the test target based on the domain matching principle, including the following steps: Construct a domain rule base, perform keyword matching between the key entity text in the test target and various rule entries in the domain rule base, and use the matched rule entries as target rule entries; Based on the content in the target rule entries, construct the test objectives, their corresponding preconditions, and expected results, and save and number them to obtain test cases.

5. The method for generating an ATC subsystem test plan according to claim 4, characterized in that: The construction of the domain rule base includes the following steps: Based on relevant technical specifications and industry experience, domain rule entries are compiled, and these entries are categorized according to business scenarios. All domain rule entries are then integrated to form a domain rule library. The rule categories in the domain rule library include interlocking verification rules, movement authorization rules, station functional logic rules, and fault tolerance and boundary rules.

6. The method for generating an ATC subsystem test plan according to claim 4, characterized in that: In S3, the test cases are configured with business logic based on the business logic configuration table and processed into structured files to obtain the test outline, including the following steps: The business logic configuration table includes a configurable function enumeration, test function name, and test item configuration column. Based on the type of the rule entries in the test cases, the corresponding configurable functions and test function names are matched from the business logic configuration table. Based on the test objectives in the test cases, the corresponding test items are matched from the business logic configuration table, and the configuration parameters of the test items are set according to the preconditions and expected results. Based on the set configuration parameters, the corresponding operation steps are set. The test cases and their corresponding operation steps are stored in Excel format according to the order of the test case numbers to obtain the test outline.

7. The method for generating an ATC subsystem test plan according to claim 1, characterized in that: In S4, the pseudocode expression layer includes a general syntax layer, a domain-specific instruction set, and an instruction template library; The general syntax layer is used to define the corresponding logic code for the judgment logic, loop logic, and sequential execution logic in the corresponding rule entries; The domain-specific instruction set selects the corresponding instruction category based on the corresponding scenario of the test cases in the test outline and matches the corresponding instruction template from the instruction template library; Input the configuration parameters of the corresponding test items in the test outline into the instruction template, and generate test pseudocode by logical connection through logic code.

8. The method for generating an ATC subsystem test plan according to claim 1, characterized in that: In S4, the test pseudocode is scripted to obtain the test script, including the following steps: Based on the content of the test pseudocode, name the test functions in the format of test case number plus business scenario; The test functions are transformed into Python test scripts based on the pytest framework, and the execution order and priority of the test scripts are determined based on the operation steps in the test outline.

9. The method for generating an ATC subsystem test plan according to claim 1, characterized in that: In S4, the test script is populated with security logic to obtain the test plan, including the following steps: The test plan is obtained by inserting mandatory verification points between the steps in the test scripts related to SIL4 level security requirements, setting security detection rules at the mandatory verification points, and storing them. The test plan is directly imported into the test simulation software for simulation testing; If the preceding steps of the forced verification point fail during testing, the test will automatically terminate and the exception will be logged.

10. An ATC subsystem test plan generation system, applicable to the ATC subsystem test plan generation method according to any one of claims 1-9, characterized in that: It includes a requirements parsing module, a domain rule matching module, a business logic configuration module, a pseudocode generation module, and a script generation module; The requirement parsing module performs semantic understanding and structured extraction of the test requirement document to obtain the test target; The domain rule matching module obtains test cases by matching the test target with relevant domain knowledge based on the domain matching principle. The business logic configuration module configures the business logic of the test cases based on the business logic configuration table and processes the data into a structured file to obtain the test outline. The pseudocode generation module uses the pseudocode expression layer to process the test outline into pseudocode to obtain test pseudocode. The script generation module processes the test pseudocode into a script to obtain a test script, and fills it with security logic to obtain a test plan.

Citation Information

Patent Citations

  • Method and device for generating train control system temporary speed limit message test case

    CN111003030A