Safety-oriented rail transit interlocking system consistency test method and device

Through STPA technology and symbolic finite state machines, safety requirements are converted into linear temporal logical attributes and atomic propositions, and test cases are generated, which solves the problem of inability to perform consistency testing for safety requirements in the existing technology and improves rail transit connectivity. Lock system security and testing completeness.

CN118427841BActive Publication Date: 2024-10-22HUAQIAO UNIVERSITY
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410886462.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-03
Publication Date
2024-10-22
Estimated Expiration
2044-07-03

AI Technical Summary

Technical Problem

The existing technology cannot formally express the safety requirements analyzed by STPA. As a result, the testing method of the rail transit interlocking system cannot achieve consistency testing for safety requirements, and errors or faults are often missed.

Method used

Use STPA technology to analyze the rail transit interlocking system, convert it into linear temporal logical attributes and atomic propositions, and use symbolic finite state machines to generate test cases to ensure that the system meets refined software safety requirements.

Benefits of technology

Achieved detailed safety requirements analysis and formal expression of the rail transit interlocking system to ensure the completeness of the test and the safety and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118427841B_ABST
    Figure CN118427841B_ABST
Patent Text Reader

Abstract

The invention discloses a rail transit interlocking system consistency test method and device oriented to safety requirements, which relate to the field of software testing, including: using STPA technology to analyze the rail transit interlocking system, obtaining refined software safety requirements and converting them into linear temporal logic attributes, and obtaining an atomic proposition set; using a symbolic finite state machine to model the rail transit interlocking system to obtain a reference model; calculating all valuation functions in the rail transit interlocking system, and generating symbolic traces and their corresponding specific traces according to the valuation functions; improving the reference model to obtain an improved reference model, mapping the valuation function to the atomic proposition set, and obtaining proposition abstraction; generating test cases based on the symbolic traces and proposition abstractions of the reference model, and executing the test cases on the improved reference model until the test cases meet the refined software safety requirements, thereby solving the problem that the consistency test of the rail transit interlocking system cannot be oriented to its safety requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of software testing, and in particular to a safety-oriented rail transit interlocking system consistency testing method and device. Background Art

[0002] With the development of modern cities, rail transit interlocking systems play a vital role in urban transportation. However, the safety of rail transit interlocking systems has always been one of the focuses of people's attention, especially for interlocking systems, whose safety is directly related to the safety, efficiency and reliability of train operation.

[0003] In order to ensure the safety of rail transit interlocking systems, they need to be rigorously analyzed and tested. A common method is to use STPA (System Safety Analysis) technology to identify the safety requirements of the system. STPA is a systematic method that aims to evaluate the safety of the system by identifying and analyzing the control structure, functions and failure modes of the system, and generate corresponding safety requirements.

[0004] Although the existing technology can use STPA to conduct a comprehensive analysis of the rail transit interlocking system, it cannot express the safety requirements analyzed by STPA in a formal language. At the same time, it cannot be used as an additional condition for software testing, which makes the testing methods in the existing technology unable to perform consistency testing for safety requirements. This leads to the test methods in the existing technology being a mode of testing first and then correcting errors based on the test results. This test mode mostly misses errors or faults. Summary of the invention

[0005] The purpose of this application is to propose a rail transit interlocking system consistency testing method and device oriented to safety requirements in response to the above-mentioned technical problems.

[0006] In a first aspect, the present invention provides a rail transit interlocking system consistency test method oriented to safety requirements, comprising the following steps:

[0007] The rail transit interlocking system is analyzed using STPA technology to obtain refined unsafe control actions and refined software safety requirements. The refined software safety requirements are converted into linear temporal logic attributes and further converted into atomic propositions to form an atomic proposition set.

[0008] The rail transit interlocking system is modeled using a symbolic finite state machine to obtain a reference model;

[0009] Based on the reference model, several mutants are constructed and the fault domain is obtained. All valuation functions in the rail transit interlocking system are calculated. The symbol traces in the reference model and their corresponding specific traces are generated according to the valuation functions.

[0010] The reference model is improved based on the first-order expression to obtain the improved reference model. The improved reference model and the reference model are in the same fault domain. The valuation function is mapped to the set of atomic propositions it satisfies to obtain propositional abstraction. The propositional abstraction is extended to the assignment sequence and specific traces through recursive definition.

[0011] Generate test cases based on the symbolic trace and propositional abstraction of the reference model, execute the test cases on the improved reference model, and detect whether the improved reference model meets the refined software safety requirements. If so, determine that the test cases meet the refined software safety requirements. If not, reconstruct the fault domain and repeat the above two steps until the test cases meet the refined software safety requirements.

[0012] As a preferred method, STPA technology is used to analyze the rail transit interlocking system to obtain refined unsafe control actions and refined software safety requirements, including:

[0013] Define the boundaries and scope of the rail transit interlocking system, including the various components of the rail transit interlocking system, their interactions, and interfaces with the external environment;

[0014] Model the rail transit interlocking system to determine the normal operating mode of the rail transit interlocking system and the interaction between various components;

[0015] Determine the control actions performed by each component in the rail transit interlocking system, identify the refined unsafe control actions in the control actions, and the refined unsafe control actions are four-tuples (CA, Cs, C, TC), which are used to describe the key combination of control actions that lead to danger and their related process model variables. CA represents the control actions that lead to danger. The control action, is the key combination of the state variables and key variables of the control action CA, C is to provide the control action or not to provide the control action, TC is the type of situation in which the control action CA is provided, which is divided into any time, too early or too late;

[0016] The unsafe control actions are analyzed to obtain refined unsafe control actions and refined software safety requirements.

[0017] Preferably, the unsafe control actions are analyzed to obtain refined unsafe control actions and refined software safety requirements, specifically including:

[0018] Analyze the accidents, hazards and corresponding system-level safety constraints of rail transit interlocking systems;

[0019] Analyze the refined unsafe control behaviors when enlisting, canceling, and revoking paths, and convert them into refined software safety requirements;

[0020] Analyze the refined unsafe control behaviors when requisitioning, canceling and revoking paths and track segments and convert them into refined software safety requirements;

[0021] Analyze the refined unsafe control behaviors when switching, locking, and unlocking switches, and convert them into refined software safety requirements;

[0022] Analyze the refined unsafe control behaviors with respect to signals and convert them into refined software safety requirements.

[0023] Preferably, the refined software safety requirements are converted into linear temporal logic attributes, and further converted into atomic propositions to form an atomic proposition set, specifically including:

[0024] The refined software safety requirements are converted into linear temporal logic properties according to the following rules:

[0025] When sending the key combination Cs i The software controller should always provide no control action CA i , , the conversion formula is: ,in, ;

[0026] In the key combination Cs i Before this happens, the software controller should not provide control actions too early. i , the conversion formula is: ;

[0027] In the key combination Cs i After the occurrence, the software controller should not provide control actions too late CA i , the conversion formula is: ;

[0028] The occurrence of a critical combination means that the software controller must provide a control action immediately before the next time node CA i Without delay, the conversion formula is: ;

[0029] The linear temporal logic property formula η is given by the following grammar: , where the linear temporal logic attribute formula η is taken as an atomic proposition and expressed as , AP denotes the set of atomic propositions, written as a quantifier-free first-order expression for symbols from Var:

[0030] ;

[0031] represents any linear temporal logic property formula, π is a proposition trace, and the expression π iSuffix indicating trace ,and , for a finite prefix of the infinite length of the proposition trace π ,writing to specify that π' is a finite prefix of π;

[0032] The semantics of the path operators F, G, and W are defined by the following grammatical abbreviations:

[0033] , , Indicates the definition, Indicates or It means to take the opposite;

[0034] A refined software safety requirement is a set P of propositional traces that satisfies: ;

[0035] Map the valuation function to the set of atomic propositions it satisfies to obtain propositional abstraction, which is then extended to the assignment sequence and specific traces through recursive definition, including:

[0036] For D Var Assign a valuation function σ, and the propositional abstraction ω(σ) is the set of atomic propositions satisfied by the valuation function σ, denoted as:

[0037] ;

[0038] Represents the corresponding mapping relationship. Through recursive definition, the propositional abstraction ω is extended to the assignment sequence and the specific trace:

[0039] ;

[0040] For linear temporal logic property formula η and finite prefix , if and only if π' is a bad prefix of η, use the symbol ; If and only if any specific trace of the reference model M is not abstracted into π' by the propositional abstraction ω, then the reference model M is the model corresponding to the linear temporal logic attribute, that is, .

[0041] Preferably, the reference model is represented as a tuple , where the finite set S represents the state space, is the initial state, the finite set I contains the input variable symbols, the finite set O contains the output variable symbols, and the variable set Var represents The set D represents the union of all variables in the type domain, and R represents the conversion relationship. represents the input alphabet, i.e., the set of input events consisting of a finite number of input conditions, each of which is a quantifier-free first-order expression on the input variables, Denotes the output alphabet, i.e., the set of output events consisting of output expressions. Deviations from the reference model include: incorrect or swapped input conditions, incorrect or swapped output expressions, transmission failures, added or lost states. Transmission failures include additional transitions, lost transitions, or misleading transitions, and require that the incorrect input conditions are also included in the input alphabet. I In the output alphabet, the wrong output expression is also included in the output alphabet In,but not anywhere in the reference model, multiple mutants constitute a,fault domain.

[0042] Preferably, the evaluation function σ maps each variable symbol v to its corresponding type value σ(v), and for the input event of the variable symbol v from the variable set Var ,Will Expressed as the valuation function σ is the input event Model, which will input events The Boolean expression obtained by replacing each variable symbol v with the type value σ(v) evaluates to true; for the conjunction of the input event and the output event At least one model exists , Represents and; for any set X, use Denote the set of finite sequences, and use X ω represents a set of infinite sequences. The symbolic path ζ of the reference model M is an infinite sequence, which can be expressed as:

[0043] ;

[0044] Among them, "." represents the sequence concatenation symbol. is the initial state of the reference model M. For all , ;

[0045] Symbol trace of reference model M is a finite sequence, represented by:

[0046] ,satisfy:

[0047] , , so that

[0048] ,in, Indicates existence, The set of symbol traces representing any reference model M is denoted by T(M);

[0049] The specific transformation path of the reference model M is an infinite sequence, expressed as: ;in, , D Var Denote the set of functions that map from Var to D such that there exists a symbolic path to M:

[0050] satisfy , where i ≥ 1;

[0051] The specific trace κ of the reference model M is a finite sequence of estimation functions, expressed as:

[0052] ;

[0053] So that the reference model M has a symbol trace ,satisfy , if it satisfies, then the specific trace κ is called a symbolic trace Witness, symbolized by , the set of specific traces is represented by L(M), where ;

[0054] Provide a finite set Q of free variables from The quantifier-free first-order expression is divided into two parts: a subset Q g contains only input expressions from I, and another subset Q h Contains at least one output expression from O, creating a modified reference model , for any subset and , define a Boolean expression:

[0055] ;

[0056] ;

[0057] in, Indicates the definition, Indicates negation. represents the complement, means and;

[0058] Define the input alphabet and output alphabet of Q(M) as shown below:

[0059] ;

[0060] ;

[0061] Define the transfer relationship of Q(M) as shown below:

[0062] ;

[0063] Fault domains are represented as , with the following properties:

[0064] Each modified reference model M′ has at most m states, m ≥ n, represented in observable form;

[0065] Each modified reference model M' references input and output variables from I and O and is typed by D;

[0066] Each modified reference model M' uses The input conditions and Output expression in ;

[0067] Linear temporal logic properties use atomic propositions in the set AP, where the free variables are in middle;

[0068] The alphabet of fault domain Z is the union of all input conditions, output expressions, and atomic propositions of the formula to be verified ;

[0069] For a pair of symbol traces , if there exists a symbol input / output sequence , distinguish the states A and B corresponding to the symbol traces α and β, then α and β are considered distinguishable, using This represents the set of all distinguished sequences:

[0070] ;

[0071] The distinguishing set of propositional abstractions ω(α) and ω(β) is defined as:

[0072] ;

[0073] A test case set TS is a set of symbolic input / output sequences, i.e. , each test case in the test case set TS meets the following requirements:

[0074] (1) TS contains the minimum state cover V of the reference model M, where ;

[0075] (2) For any different test cases , there exists a symbol input / output sequence , so that ;

[0076] (3) TS contains the following sets:

[0077] ;

[0078] (4) For satisfaction Any and ,exist , so that , represents the empty set;

[0079] (5) For satisfaction and Any ,exist , so that , Pref() means prefix.

[0080] In a second aspect, the present invention provides a rail transit interlocking system consistency test device oriented to safety requirements, comprising:

[0081] An analysis module is configured to analyze the rail transit interlocking system using STPA technology to obtain refined unsafe control actions and refined software safety requirements, convert the refined software safety requirements into linear temporal logic attributes, and further convert them into atomic propositions to form an atomic proposition set;

[0082] A modeling module is configured to model the rail transit interlocking system using a symbolic finite state machine to obtain a reference model;

[0083] The mutation module is configured to construct a number of mutants based on the reference model, obtain the fault domain, calculate all valuation functions in the rail transit interlocking system, and generate the symbol traces and their corresponding specific traces in the reference model according to the valuation functions;

[0084] The improvement module is configured to improve the reference model based on the first-order expression to obtain an improved reference model. The improved reference model and the reference model are in the same fault domain. The valuation function is mapped to the set of atomic propositions it satisfies to obtain propositional abstraction. The propositional abstraction is extended to the assignment sequence and the specific trace through recursive definition.

[0085] The test module is configured to generate test cases based on the symbolic traces and propositional abstractions of the reference model, execute the test cases on the improved reference model, and detect whether the improved reference model meets the refined software safety requirements. If so, it is determined that the test cases meet the refined software safety requirements. If not, the fault domain is reconstructed and the above two modules are repeated until the test cases meet the refined software safety requirements.

[0086] In a third aspect, the present invention provides an electronic device comprising one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner in the first aspect.

[0087] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any implementation manner in the first aspect.

[0088] In a fifth aspect, the present invention provides a computer program product, comprising a computer program, which, when executed by a processor, implements the method described in any implementation manner in the first aspect.

[0089] Compared with the prior art, the present invention has the following beneficial effects:

[0090] (1) The safety-oriented rail transit interlocking system consistency test method proposed in this invention uses STPA technology to perform safety analysis on the system, which can effectively derive unsafe control actions at various levels and refined software safety requirements, and describe the safety requirements in more detail.

[0091] (2) The safety-oriented rail transit interlocking system consistency testing method proposed in this invention further formalizes the refined software safety requirements, converts the safety requirements into a formal language in the form of LTL, and uses them as attribute requirements. Then, a symbolic finite state machine is used to generate test cases, and these test cases are used to perform consistency testing to ensure the safety and reliability of the system.

[0092] (3) The safety-oriented rail transit interlocking system consistency test method proposed in this invention uses a symbolic finite state machine to model the rail transit interlocking system, and further generates test cases using LTL. Each LTL formula can be regarded as a test attribute to verify whether the system meets the attribute, i.e., software safety requirements, when facing different situations. At the same time, this method ensures the completeness of the test. BRIEF DESCRIPTION OF THE DRAWINGS

[0093] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0094] Figure 1 A schematic flow chart of a rail transit interlocking system consistency test method oriented to safety requirements according to an embodiment of the present application;

[0095] Figure 2 A flowchart of a rail transit interlocking system consistency test method oriented to safety requirements according to an embodiment of the present application;

[0096] Figure 3 A schematic diagram of a rail transit interlocking system of a rail transit interlocking system consistency testing method oriented to safety requirements according to an embodiment of the present application;

[0097] Figure 4 A schematic diagram of a reference model of a rail transit interlocking system consistency test method oriented to safety requirements according to an embodiment of the present application;

[0098] Figure 5 A schematic diagram of a mutant of a rail transit interlocking system consistency test method oriented to safety requirements according to an embodiment of the present application;

[0099] Figure 6 A schematic diagram of a rail transit interlocking system consistency test device oriented to safety requirements according to an embodiment of the present application;

[0100] Figure 7 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0101] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0102] Figure 1 A rail transit interlocking system consistency test method for safety requirements provided by an embodiment of the present application is shown, comprising the following steps:

[0103] S1, STPA technology is used to analyze the rail transit interlocking system to obtain refined unsafe control actions and refined software safety requirements, and the refined software safety requirements are converted into linear temporal logic attributes, and further converted into atomic propositions to form an atomic proposition set.

[0104] In a specific embodiment, the STPA technology is used to analyze the rail transit interlocking system to obtain refined unsafe control actions and refined software safety requirements, including:

[0105] Define the boundaries and scope of the rail transit interlocking system, including the various components of the rail transit interlocking system, their interactions, and interfaces with the external environment;

[0106] Model the rail transit interlocking system to determine the normal operating mode of the rail transit interlocking system and the interaction between various components;

[0107] Determine the control actions performed by each component in the rail transit interlocking system, identify the refined unsafe control actions in the control actions, and the refined unsafe control actions are four-tuples (CA, Cs, C, TC), which are used to describe the key combination of control actions that lead to danger and their related process model variables. CA represents the control actions that lead to danger. The control action, is the key combination of the state variables and key variables of the control action CA, C is to provide the control action or not to provide the control action, TC is the type of situation in which the control action CA is provided, which is divided into any time, too early or too late;

[0108] The unsafe control actions are analyzed to obtain refined unsafe control actions and refined software safety requirements.

[0109] In a specific embodiment, the unsafe control action is analyzed to obtain refined unsafe control actions and refined software safety requirements, which specifically include:

[0110] Analyze the accidents, hazards and corresponding system-level safety constraints of rail transit interlocking systems;

[0111] Analyze the refined unsafe control behaviors when enlisting, canceling, and revoking paths, and convert them into refined software safety requirements;

[0112] Analyze the refined unsafe control behaviors when requisitioning, canceling and revoking paths and track segments and convert them into refined software safety requirements;

[0113] Analyze the refined unsafe control behaviors when switching, locking, and unlocking switches, and convert them into refined software safety requirements;

[0114] Analyze the refined unsafe control behaviors with respect to signals and convert them into refined software safety requirements.

[0115] In a specific embodiment, the refined software safety requirements are converted into linear temporal logic attributes, and further converted into atomic propositions to form an atomic proposition set, specifically including:

[0116] The refined software safety requirements are converted into linear temporal logic properties according to the following rules:

[0117] When sending the key combination Cs i The software controller should always provide no control action CA i , , the conversion formula is: ,in, ;

[0118] In the key combination Cs i Before this happens, the software controller should not provide control actions too early. i , the conversion formula is: ;

[0119] In the key combination Cs i After the occurrence, the software controller should not provide control actions too late CA i , the conversion formula is: ;

[0120] The occurrence of a critical combination means that the software controller must provide a control action immediately before the next time node CA i Without delay, the conversion formula is: ;

[0121] The linear temporal logic property formula η is given by the following grammar: , where the linear temporal logic attribute formula η is taken as an atomic proposition and expressed as , AP denotes the set of atomic propositions, written as a quantifier-free first-order expression for symbols from Var:

[0122] ;

[0123] represents any linear temporal logic property formula, π is a proposition trace, and the expression π i Suffix indicating trace ,and , for a finite prefix of the infinite length of the proposition trace π ,writing to specify that π' is a finite prefix of π;

[0124] The semantics of the path operators F, G, and W are defined by the following grammatical abbreviations:

[0125] , , Indicates the definition, Indicates or It means to take the opposite;

[0126] A refined software safety requirement is a set P of propositional traces that satisfies: ;

[0127] Map the valuation function to the set of atomic propositions it satisfies to obtain propositional abstraction, which is then extended to the assignment sequence and specific traces through recursive definition, including:

[0128] For D Var Assign a valuation function σ, and the propositional abstraction ω(σ) is the set of atomic propositions satisfied by the valuation function σ, denoted as:

[0129] ;

[0130] Represents the corresponding mapping relationship. Through recursive definition, the propositional abstraction ω is extended to the assignment sequence and the specific trace:

[0131] ;

[0132] For linear temporal logic property formula η and finite prefix , if and only if π' is a bad prefix of η, use the symbol ; If and only if any specific trace of the reference model M is not abstracted into π' by the propositional abstraction ω, then the reference model M is the model corresponding to the linear temporal logic attribute, that is, .

[0133] Specifically, STPA (System-Theoretic Process Analysis) is a system-theoretic process analysis technique designed to identify and solve safety issues in complex systems. It is different from traditional safety analysis methods because it focuses on the relationship between the structure, function and behavior of the system rather than just identifying faults or failures.

[0134] In rail transit interlocking systems, the use of STPA technology to analyze the system usually involves the following steps and methods:

[0135] System Definition: First, the boundaries and scope of the rail transit interlocking system need to be clearly defined, including the various components of the system, their interactions, and interfaces with the external environment.

[0136] Functional modeling: Model the functions of the system to understand the normal operating mode of the system and the interaction between various components.

[0137] Identify control actions: Determine the control actions in the system, that is, the operations performed by each component in the system and how these operations affect the state of the system.

[0138] Identify unsafe control actions: Use STPA methods and tools to identify potential unsafe control actions, that is, control operations that may cause system hazards.

[0139] Analyze unsafe control actions: Analyze identified unsafe control actions to understand how they interact with the system structure, function, and environment, and assess their impact on system safety.

[0140] Propose safety requirements: Based on the analysis of unsafe control actions, propose improvement measures and safety control measures to reduce or eliminate potential safety risks.

[0141] Verification: Verify the proposed security measures to ensure that they can effectively reduce the security risks of the system and will not introduce new security issues.

[0142] Through these steps and methods, STPA technology can help designers and maintainers of rail transit interlocking systems to fully understand the safety of the system and formulate effective safety measures to ensure the safe operation of the system.

[0143] The embodiment of the present application proposes a method based on unsafe control behavior (UCA) and software safety requirements (SSR) to identify and handle control actions (CA) that may cause danger. In this method, the embodiment of the present application focuses on the hazards (HA) associated with control actions and process model variables (PMV), which include state variables (train occupied sections, train application for requisitioned sections, etc.) and key variables (signal values, train location information, etc.).

[0144] First, this application introduces the concept of refined unsafe control action (RUCA), which is a four-tuple (CA, Cs, C, TC) used to describe the key combination of control actions and their related process model variables that lead to danger. Among them:

[0145] CA stands for Causing Danger control action.

[0146] It is the combination of state variables and key variables of the control action CA (i.e., the combination of PMVs).

[0147] C is providing or not providing control action. In different situations, this application formulates corresponding rules based on whether control action is provided (C1) or not (C2).

[0148] TC is the type of situation in which the control action CA is provided, classified as any time, too early or too late.

[0149] According to these rules, this application transforms the refined unsafe control actions into refined software safety requirements (RSSR) and forms the corresponding formal specification of linear temporal logic (LTL).

[0150] Then convert the LTL into attribute requirements and perform consistency testing on the symbolic finite state machine modeled according to the interlocking system. For the specific flowchart, please refer to Figure 2 , each step is described in detail below.

[0151] The rail transit interlocking system is a key system for managing railway traffic operations. Its main function is to ensure the safe and smooth passage of trains in the railway network. The main components of the rail transit interlocking system include signal systems, turnout control systems, train detection equipment, etc. The basic principle of the rail transit interlocking system is to ensure the safe travel of trains on the railway line by controlling equipment such as signals, turnouts, and track circuits. The system will dynamically adjust the signal status and turnout position according to information such as the position, speed, and direction of travel of the train to avoid collisions between trains or other unexpected events. When a train applies for a certain route (path), the controller uses a series of sensors to obtain information about the system path, and arranges the route applied by the train based on this information to prevent accidents such as collisions, rear-end collisions, and derailments.

[0152] The railway network includes a certain number of track sections, which include various elements such as sections, turnouts, and intersections. These track sections serve as units that provide physical paths for trains to travel. Turnouts have two positions that enable one track section to establish precise and predetermined connections with other track sections. By configuring these connections, turnouts effectively determine the path and direction of train travel. And turnouts have a locking function to fix them in a specified position without loosening.

[0153] Signals are entities that convey information to trains. Each signal is associated with a specific route in a specific direction. Signals can be in one of two states: red or green. By default, signals are set to red. Trains are expected to obey signals, specifically to stop when the signal is red.

[0154] Requisitioning (reserving) a path means applying for the corresponding resources for the path and allocating them to a single train. Releasing (revoking) involves the train releasing the resources after the corresponding resources have been used by the train.

[0155] When a train enters, the train automatic monitor communicates with the rail transit interlocking system to apply for a route for it. The rail transit interlocking system then applies for resources based on the corresponding path information. If it is safe, the rail transit interlocking system will approve the application, and if it is not safe, it will cancel or revoke the application.

[0156] A simple rail transit interlocking system Figure 3As shown. The figure contains four track sections, a turnout, and two signal lights. When a train applies for a path consisting of B1-B2-B4, the interlocking controller will first check whether the path and the sections in the path conflict with those applied for by other trains. If there is a conflict, the path cannot be requisitioned. If the sections are occupied by trains, the path cannot be requisitioned. After the path application is completed, the controller marks that the path and the sections in the path have been used, switches the turnout to the corresponding position and locks it, and then turns the signal light green to prompt the train driver to enter normally. At the same time, during the train's movement, the rail transit interlocking system will monitor the path information, turnout status, signal status, etc. at any time to avoid emergencies.

[0157] After the train leaves the section, the rail transit interlocking system will first change the signal to red, then unlock the switch, and then cancel the section's authority to allow other trains to use it.

[0158] For the rail transit interlocking system, the embodiments of the present application are divided into the following parts to analyze unsafe control actions.

[0159] 1. Analyze accidents, hazards, and system-level safety constraints:

[0160] An accident represents a safety-critical problem. For rail transit interlocking systems, it is obvious that there are the following four accidents:

[0161] A1: Rear-end collision;

[0162] A2: Head-on collision;

[0163] A3: Side impact;

[0164] A4: Derailed.

[0165] A hazard is a system state that, together with an unsafe control action, leads to an accident. For the above four accidents, the embodiment of the present application analyzes and obtains the following five hazards and the accidents they may cause (indicated by numbers):

[0166] H1: Allowing a train to enter an occupied route. This could result in an A1 accident.

[0167] H2: The rail transit interlocking system simultaneously requisitions two or more conflicting paths. This may lead to A-1, A-2, and A-3 accidents.

[0168] H3: One or more turnouts are not aligned to the required position. This may result in an A-1, A-2, A-3, A-4 accident.

[0169] H4: One or more switches on an occupied track are not locked. This may result in A-1, A-2, A-3, A-4 accidents.

[0170] H5: The route is cancelled when the train enters the route but does not leave the route. This may cause A-1, A-2, A-3, A-4 accidents.

[0171] From the above-mentioned hazards, the embodiments of the present application can derive the following four system-level safety constraints (SC) and associate them with relevant hazards (indicated by numbers). These safety constraints cannot be violated. Once these constraints are violated, accidents may occur.

[0172] SC1: Once a train occupies a path, other trains cannot enter [H1];

[0173] SC2: The path controller cannot requisition any conflicting paths [H2];

[0174] SC3: All turnouts on the requisitioned route section must be aligned to the corresponding position and locked [H3, H4];

[0175] SC4: The path currently occupied by a train cannot be revoked [H5].

[0176] 2. Analyze the refined unsafe control behaviors and refined software safety requirements when requisitioning, canceling, and revoking paths:

[0177] First, the embodiments of the present application identify three control actions of the path controller when managing the train path:

[0178] Apply for the initial path for requisition (PReserve);

[0179] Unclaim the initial path (PCancel);

[0180] Release the requisition path (PRelease).

[0181] Secondly, the embodiment of the present application identifies the process model variables of the path controller when managing the train path, which includes four variables, and the variable names and their respective values ​​are shown in Table 1:

[0182] Table 1 Path process model variables and their values;

[0183]

[0184] Among them, the meaning of V1 path status is whether there is a train running on it, and its value is "Free; Occ; Uoc". It is respectively represented as: the path is free (the train has not entered), the path is occupied by the train, and the path is not occupied (the train has left). V2 focuses on whether there is a conflicting path requisitioned by other controllers, and its value is Yes; No.

[0185] Based on the identified hazards and process model variables of the path, the embodiment of the present application can derive the following three unsafe control behaviors:

[0186] UCA1: [PReserve] Provided [any; too early; too late] If [No conflicting path is requisitioned by other controllers = No] (When there is a conflicting path requisitioned by other controllers, requisition the path);

[0187] UCA2: [PCancel] Provided [any; too early; too late]If [path status = Occ] (when the path status is occupied, cancel the path);

[0188] UCA3: [PRelease] Provided [any; too early; too late] If [Path Status=Occ] (When the path status is occupied, release the path).

[0189] In order to automatically convert each unsafe control action UCA into an unsafe software scenario, the embodiment of the present application sets the following rules:

[0190] Rule 1: When providing control actions CA i In case (C1), each refined unsafe control action (RUCA) can be expressed as: When < > Provide RUCA when it occurs i = <ca> <tc>is dangerous.

[0191] Rule 2: When no control action CA is provided i In the case (C2), each refined unsafe control action (RUCA) can be expressed as: when < >When it occurs, RUCA i = <ca>Not providing it is dangerous.

[0192] Taking the above-mentioned UCA1 as an example, the embodiment of the present application converts it into: when [no conflicting path is requisitioned by other controllers = No] occurs, providing RUCA1 = <PReserve> [any; too early; too late] is dangerous.

[0193] Here, UCA in the following description will be directly expressed as the converted version.

[0194] By using Rule 1 and Rule 2, the embodiment of the present application refines the unsafe control actions identified based on the combination set of process model variables. Refined software safety requirements are automatically generated from the refined unsafe control actions. At the same time, the embodiment of the present application identifies the following rules for automatically generating refined software safety requirements (RSSR):

[0195] Rule 3: When providing control actions CA i In case (C1), each RUCA i can be automatically converted into a new software safety requirement as follows: RSSR i = <ca>Must be in < >When it happens <tc>Neither are available.

[0196] Similarly, the embodiment of the present application takes UCA1 as an example, and the converted RSSR is as follows: RSSR1= <preserve>Must be provided when [No conflicting paths are enlisted by other controllers = No] and neither [any; too early; too late] is provided.

[0197] The RSSR in the following description will no longer describe the conversion process and will be listed directly.

[0198] Rule 4: When no control action CA is provided i In case (C2), each RUCA i can be automatically converted into a new software safety requirement as follows: RSSR i = <ca>Must be in < > Provided when it occurs.

[0199] RSSR2 and RSSR3 obtained by the above rules in the embodiment of the present application are as follows:

[0200] RSSR2: <PCancel> must be provided when [path state = Occ], neither [any; too early; too late].

[0201] RSSR3: <PRelease> must be provided when [path state = Occ] and [any; too early; too late] is not provided.

[0202] 3. Analyze the refined unsafe control behaviors and refined software safety requirements when requisitioning, canceling and revoking paths and track sections:

[0203] First, the embodiments of the present application identify six control actions of the path controller when managing the train path and the track segments therein:

[0204] Apply for the initial path for requisition (PReserve);

[0205] Unclaim the initial path (PCancel);

[0206] Release the requisition path (PRelease);

[0207] Apply for section requisition (BReserve);

[0208] Cancellation of the requisitioned section (BCancel);

[0209] Release the requisitioned section (BRelease).

[0210] Then, the embodiment of the present application identifies the process model variables of the path controller when managing the train path and section, which includes five variables, and the variable names and their respective values ​​are shown in Table 2:

[0211] Table 2 Process model variables and their values ​​for the segments;

[0212]

[0213] Among them, V3 No Segment Occupancy means whether there is a train running on it, and its value is "Yes; No", which respectively means that the segment is not occupied and the segment is occupied by a train. V4 is concerned with whether the segment is requisitioned by other controllers, and its value is also "Yes; No". V6 Segment Mode means whether this segment has been requisitioned by other controllers, and its value is "Res; Free", which means requisition and free respectively. The meaning of V7 Segment Status is the same as the Path Status.

[0214] Based on the identified hazards and process model variables of the path, the embodiment of the present application can derive the following 8 refined unsafe control actions:

[0215] RUCA4: It is dangerous to provide RUCA4 = < BReserve > [any; too early; too late] when [segment mode = Res] occurs.

[0216] RUCA5: It is dangerous to provide RUCA5 = < BCancel >[any; too early; too late] when [segment mode = Res, segment status = Occ] occurs.

[0217] RUCA6: Providing RUCA6 = < BRelease >[any; too early; too late] is dangerous when [segment mode = Res, segment status = Occ] occurs.

[0218] RUCA7: Providing RUCA7 = < BRelease >[any; too early; too late] is dangerous when [segment mode = Res, segment state = Free] occurs.

[0219] RUCA8: It is dangerous to provide RUCA8 = < PReserve > [any; too early; too late] when [No segments occupied = No] occurs.

[0220] RUCA9: When [All Segments Have Been Requisitioned = No] occurs, it is dangerous to provide RUCA9 = < PReserve > [any; too early; too late].

[0221] RUCA 10 : When [No segment is occupied = No] occurs, RUCA is provided 10 = < BCancel > [any; too early; too late] is dangerous.

[0222] RUCA 11 : When [No segment is occupied = No] occurs, RUCA is provided 11 = < PRelease > [any; too early; too late] is dangerous.

[0223] The resulting refined software safety requirements are as follows:

[0224] RSSR4: < BReserve > must be provided when [segment mode = Res] [any; too early; too late].

[0225] RSSR5: <BCancel> must be provided when [segment mode = Res, segment status = Occ] [any; too early; too late].

[0226] RSSR6: <BRelease> must be provided when [segment mode = Res, segment status = Occ], and neither [any; too early; too late] is provided.

[0227] RSSR7: <BRelease> must be provided when [segment mode = Res, segment status = Free], and neither [any; too early; too late].

[0228] RSSR8: <PReserve> must be provided when [no segment is occupied = No] [any; too early; toolate] is not provided.

[0229] RSSR9: <PReserve> must be provided when [all segments have been requisitioned = No] [any; too early; toolate] is not provided.

[0230] RSSR 10 :< PCancel > must be provided when [No segment is occupied = No] and [any; too early; toolate] is not provided.

[0231] RSSR 11 : <PRelease> must be provided when [no segment is occupied=No] and [any; too early; toolate] is not provided.

[0232] 4. Analyze the refined unsafe control behaviors and refined software safety requirements when switching, locking, and unlocking turnouts:

[0233] First, we identified four control actions of the path controller when switching, locking, and unlocking the turnout:

[0234] Apply for the initial path for requisition (PReserve);

[0235] Switch

[0236] Lock the turnout (Lock);

[0237] Unlock the switch (Unlock).

[0238] Then, the embodiment of the present application identifies the process model variables of the path controller when switching, locking and unlocking the turnout, which includes four variables, and the variable names and their respective values ​​are shown in Table 3:

[0239] Table 3. Process model variables and their values ​​of turnout;

[0240]

[0241] Among them, V8 All switches have reached the specified position means whether the switch has been switched to the specified position, and its value is "Yes; No". V10 Switch position means where the switch is, and its value is "Ali; Una". If it is in the specified position, it is Ali, and if it is not in the specified position, it is Una. V11 Switch status means whether the switch is locked, and its value is "Loc; Unl", indicating locked and unlocked.

[0242] Based on the identified hazards and process model variables of the path, the embodiment of the present application can derive the following 8 refined unsafe control actions:

[0243] RUCA 12 : When [All switches have reached the specified position = No] occurs, RUCA is provided 12 = < PReserve >[any; too early; too late] is dangerous.

[0244] RUCA 13 : When [All switches have reached the specified position = Yes, all switches have been locked = No] occurs, RUCA is provided 13 = <PReserve> [any; too early; too late] is dangerous.

[0245] RUCA 14 : When [turnout position = Ali] occurs, provide RUCA 14 = < Switch > [any; too early; too late] is dangerous.

[0246] RUCA 15 : When [turnout position = Una] occurs, RUCA is provided at will 15 = < Switch > can be dangerous.

[0247] RUCA 16 : When [switch position = Ali, switch status = Unl] occurs, RUCA is not provided 16 = < Lock > can be dangerous.

[0248] RUCA 17 : When [switch position = Una; switch status = Unl] occurs, RUCA is provided at will 17 = < Lock > is dangerous.

[0249] RUCA 18 : When [path mode = Res, section mode = Res, section status = Free, turnout position = Ali, turnout status = Loc] occurs, RUCA is provided 18 = < Unlock > [any; too early; too late] is dangerous.

[0250] RUCA 19 : When [Section Mode = Res, Section Status = Occ, Switch Position = Ali, Switch Status = Loc] occurs, RUCA is provided 19 = < Unlock > [any; too early; too late] is dangerous.

[0251] The resulting refined software safety requirements are as follows:

[0252] RSSR 12 :<PReserve> must not be provided when [all switches have reached the specified position = No] [any; too early; too late].

[0253] RSSR 13 :<PReserve> must be provided when [all switches have reached the specified position = Yes, all switches have been locked = No] [any; too early; too late] is not provided.

[0254] RSSR 14 :< Switch > must be provided when [switch position = Ali] [any; too early; too late] is not provided.

[0255] RSSR 15 :< Switch > must not be provided when [Switch Position = Una].

[0256] RSSR 16 :< Lock > must be provided when [switch position = Ali, switch status = Unl].

[0257] RSSR 17 :< Lock > must not be provided when [switch position = Una; switch status = Unl] [any; too early; too late].

[0258] RSSR 18 :< Unlock > must be provided when [path mode = Res, section mode = Res, section status = Free, turnout position = Ali, turnout status = Loc] and [any; too early; too late] are not provided.

[0259] RSSR 19 :< Unlock > must be provided when [section mode = Res, section status = Occ, switch position = Ali, switch status = Loc] and [any; too early; too late] are not provided.

[0260] 5. Analyze the refined unsafe control behaviors and refined software safety requirements regarding signals:

[0261] First, the embodiment of the present application identifies two control actions of the path controller on the signal:

[0262] Turn green (Green);

[0263] Turn red.

[0264] Then, the embodiment of the present application identifies the process model variables of the path controller regarding the signal, which only includes one variable, and the variable name and value are shown in Table 4:

[0265] Table 4 Signal process model variables and their values

[0266]

[0267] Based on the identified hazards and process model variables of the path, the embodiment of the present application can derive the following 8 refined unsafe control actions:

[0268] RUCA 20 : When [No segment is occupied = No] occurs, RUCA is provided 20 = < Green > [any; too early; too late] is dangerous.

[0269] RUCA 21 : Provide RUCA when [No segment is requisitioned by other controllers = No] occurs 21 = < Green >[any; too early; too late] is dangerous.

[0270] RUCA 22 : Provide RUCA when [All segments have been requisitioned = No] occurs 22 = < Green > [any; too early; too late] is dangerous.

[0271] RUCA 23 : When [All switches have reached the specified position = No] occurs, RUCA is provided 23 = < Green >[any;too early; too late] is dangerous.

[0272] RUCA 24 : When [All switches are locked = No] occurs, RUCA is provided 24 = < Green >[any; too early; too late] is dangerous.

[0273] RUCA 25 : When [No segment is occupied = No; Signal status = Green] occurs, RUCA is provided at will 25 = <red>[Too early] is dangerous.

[0274] RUCA 26 : When [No segment is occupied = No, signal status = Green] occurs, RUCA is provided at will 26 = <red>Could be dangerous.

[0275] RUCA 27 : When [path mode = Can, signal status = Green] occurs, RUCA is provided 27 = < Red > can be dangerous.

[0276] The resulting refined software safety requirements are as follows:

[0277] RSSR 20 :< Green >Must be provided when [No segment is occupied=No] [any; too early; too late].

[0278] RSSR 21 : < Green > Must be provided when [No segment is requisitioned by other controller = No].

[0279] RSSR 22 : < Green >Must not be provided when [All segments are requisitioned = No].

[0280] RSSR 23 :< Green > must not be provided when [All switches have reached the specified position = No].

[0281] RSSR 24 :< Green >Must not be provided when [All switches are locked = No].

[0282] RSSR 25 :< Red > must not be provided when [No segment is occupied = No; signal status = Green] [too late].

[0283] RSSR 26 :< Red > must be provided when [No segment is occupied = No, signal status = Green].

[0284] RSSR 27 :< Red >Must be provided when [Path Mode = Can, Signal Status = Green].

[0285] So far, the embodiments of the present application have derived all refined software security requirements, which can now be converted into the formal specifications of LTL.

[0286] Through Rules 1 and 2, we can automatically transform each refined software safety requirement RSSRi identified from the refined unsafe control action RUCAi into a formal specification in LTL.

[0287] According to Rule 1, software safety requirements can be divided into three types.

[0288] Rule 1.1: When a critical combination Cs occurs i That is < >, the software controller should always provide no control action CA i The conversion formula is: ,in .

[0289] Rule 1.2 In the key combination Cs i Before this happens, the software controller should not provide control actions too early. i . Conversion: ;

[0290] Rule 1.3 states that in the key combination Cs i After the occurrence, the software controller should not provide control actions too late CA i The conversion formula is: .

[0291] Rule 2 defines a type of software safety requirement. According to Rule 2, the occurrence of a critical combination value means that the software controller must immediately provide a control action CA in the next time i , without delay. The conversion formula is:

[0292] ,in .

[0293] The following embodiment of the present application provides four examples corresponding to the 27 refined software safety requirements mentioned above according to four rules to illustrate how these four rules convert the refined software safety requirements into LTL.

[0294] RUCA 12 : When [All switches have reached the specified position = No] occurs, RUCA is provided 12 = < PReserve >[any; too early; too late] is dangerous. Applying rule 1.1, it can be converted to:

[0295] ;

[0296] RSSR 25 :< Red > must not be provided when [No segment is occupied = No; signal status = Green] [too late].

[0297] .

[0298] RSSR 24 :< Green > must not be provided when [All switches are locked = No], and using rule 1.3, it can be converted to:

[0299] .

[0300] RSSR 26 :< Red > must be provided when [No segment is occupied = No, signal status = Green]. Applying rule 2, it can be converted to:

[0301] .

[0302] Here, this application simply gives four examples. In fact, most of the 27 refined software safety requirements mentioned above can be converted using rules 1.1 and 2, and will not be listed here one by one. The generated LTL attributes will be further converted into atomic proposition sets AP in the future for the generation of test cases.

[0303] S2, a symbolic finite state machine is used to model the rail transit interlocking system and obtain a reference model.

[0304] S3, construct several mutants based on the reference model, obtain the fault domain, calculate all valuation functions in the rail transit interlocking system, and generate the symbol traces in the reference model and their corresponding specific traces according to the valuation functions.

[0305] S4, improve the reference model based on the first-order expression to obtain the improved reference model. The improved reference model and the reference model are in the same fault domain. The valuation function is mapped to the set of atomic propositions it satisfies to obtain propositional abstraction. The propositional abstraction is extended to the assignment sequence and specific traces through recursive definition.

[0306] S5, generate test cases based on the symbolic trace and propositional abstraction of the reference model, execute the test cases on the improved reference model, and detect whether the improved reference model meets the refined software safety requirements. If so, determine whether the test cases meet the refined software safety requirements. If not, rebuild the fault domain and repeat the above two steps until the test cases meet the refined software safety requirements.

[0307] In a specific embodiment, the reference model is represented as a tuple , where the finite set S represents the state space, is the initial state, the finite set I contains the input variable symbols, the finite set O contains the output variable symbols, and the variable set Var represents The set D represents the union of all variables in the type domain, and R represents the conversion relationship. represents the input alphabet, i.e., the set of input events consisting of a finite number of input conditions, each of which is a quantifier-free first-order expression on the input variables, Denotes the output alphabet, i.e., the set of output events consisting of output expressions. Deviations from the reference model include: incorrect or swapped input conditions, incorrect or swapped output expressions, transmission failures, added or lost states. Transmission failures include additional transitions, lost transitions, or misleading transitions, and require that the incorrect input conditions are also included in the input alphabet. I In the output alphabet, the wrong output expression is also included in the output alphabet In,but not anywhere in the reference model, multiple mutants constitute a,fault domain.

[0308] In a specific embodiment, the evaluation function σ maps each variable symbol v to its corresponding type value σ(v), and for the input event of the variable symbol v from the variable set Var ,Will Expressed as the valuation function σ is the input event Model, which will input events The Boolean expression obtained by replacing each variable symbol v with the type value σ(v) evaluates to true; for the conjunction of the input event and the output event At least one model exists , Represents and; for any set X, use Denote the set of finite sequences, and use X ω represents a set of infinite sequences. The symbolic path ζ of the reference model M is an infinite sequence, which can be expressed as:

[0309] ;

[0310] Among them, "." represents the sequence concatenation symbol, is the initial state of the reference model M. For all , ;

[0311] Symbol trace of reference model M is a finite sequence, represented by:

[0312] ,satisfy:

[0313] , , so that

[0314] ,in, Indicates existence, The set of symbol traces representing any reference model M is denoted by T(M);

[0315] The specific transformation path of the reference model M is an infinite sequence, expressed as: ;in, , D Var Denote the set of functions that map from Var to D such that there exists a symbolic path to M:

[0316] satisfy , where i ≥ 1;

[0317] The specific trace κ of the reference model M is a finite sequence of estimation functions, expressed as:

[0318] ;

[0319] So that the reference model M has a symbol trace ,satisfy , if it satisfies, then the specific trace κ is called a symbolic trace Witness, symbolized by , the set of specific traces is represented by L(M), where ;

[0320] Provide a finite set Q of free variables from The quantifier-free first-order expression is divided into two parts: a subset Q g contains only input expressions from I, and another subset Q h Contains at least one output expression from O, creating a modified reference model , for any subset and , define a Boolean expression:

[0321] ;

[0322] ;

[0323] in, Indicates the definition, Indicates negation. represents the complement, means and;

[0324] Define the input alphabet and output alphabet of Q(M) as shown below:

[0325] ;

[0326] ;

[0327] Define the transfer relationship of Q(M) as shown below:

[0328] ;

[0329] Fault domains are represented as , with the following properties:

[0330] Each modified reference model M′ has at most m states, m ≥ n, represented in observable form;

[0331] Each modified reference model M' references input and output variables from I and O and is typed by D;

[0332] Each modified reference model M' uses The input conditions and Output expression in ;

[0333] Linear temporal logic properties use atomic propositions in the set AP, where the free variables are in middle;

[0334] The alphabet of fault domain Z is the union of all input conditions, output expressions, and atomic propositions of the formula to be verified ;

[0335] For a pair of symbol traces , if there exists a symbol input / output sequence , distinguish the states A and B corresponding to the symbol traces α and β, then α and β are considered distinguishable, using This represents the set of all distinguished sequences:

[0336] ;

[0337] The distinguishing set of propositional abstractions ω(α) and ω(β) is defined as:

[0338] ;

[0339] A test case set TS is a set of symbolic input / output sequences, i.e. , each test case in the test case set TS meets the following requirements:

[0340] (1) TS contains the minimum state cover V of the reference model M, where ;

[0341] (2) For any different test cases , there exists a symbol input / output sequence , so that ;

[0342] (3) TS contains the following sets:

[0343] ;

[0344] (4) For satisfaction Any and ,exist , so that , represents the empty set;

[0345] (5) For satisfaction and Any ,exist , so that , Pref() means prefix.

[0346] Specifically, the following steps describe a test case generation process that aims to guide the test case generation process for a set of atomic propositions (security properties from linear temporal logic LTL) and a symbolic finite state machine (SFSM) as a reference model and as a test object. The reference model may be uncertain. The generated test cases aim to verify whether the system satisfies each atomic proposition satisfied by the model in each LTL security property.

[0347] The method proposed in the embodiment of the present application is different from the method based on finite state machine (FSM). It handles potential uncertainty SFSM and uses LTL formula as the specification form of attributes. When modeling complex reaction systems, SFSM has stronger expressive power than FSM. In addition, specifying attributes in LTL is more general and intuitive than the previously used FSM-specific restricted specification style.

[0348] Symbolic finite state machine is a method of modeling a system. It builds a virtual rail transit interlocking system in a computer and uses it as a reference model to abstract the state in the system and simulate the response of the real rail transit interlocking system to various input events. It is a tuple .in:

[0349] The finite set S represents the state space, is the initial state.

[0350] The finite set I contains the input variable symbols, and the finite set O contains the output variable symbols. Sets I and O must be disjoint. This application uses Var to abbreviate A collection of .

[0351] Events and requests caused by environmental factors and parameter changes will be used as input events in SFSM to request the system to process, and the processing behavior or the behavior or control action of the system when facing these input events is the output event. Input events and output events constitute a set of state transition conditions (referred to as traces in this application) that allow the system to transfer from the current state to another state. For example: In the rail transit interlocking system, the path sensor detects that a train has entered the station, and then the monitor applies for a path (also called an approach). This is like Figure 4 In the reference model SFSM shown in the figure, an input event is triggered: the path sensor senses the train position information, indicating that the train enters the station. Then the monitor will react and output: the monitor applies for entry. The path sensor senses the train position information and the monitor applies for entry, which is a set of state transition conditions that causes the system to transition from state S0 to state S1.

[0352] The set D represents the union of all variable type domains.

[0353] The input alphabet is the collection of input events It consists of a finite number of input conditions, each of which is a quantifier-free first-order expression on the input variables.

[0354] A finite output alphabet is the set of output events Consists of output expressions; these are quantifier-free first-order expressions on the input variables and at least one output variable. The application allows constants, function symbols, and arithmetic operators in these expressions, but requires that they can be solved based on some decision theory, such as by an SMT solver.

[0355] The set of formulas that use the Var symbol is denoted by F(Var). Indicates a transition relationship.

[0356] Example 1:

[0357] Figure 4 In this paper, some states of the rail transit interlocking system case are used as an example to illustrate the symbolic finite state machine. The rail transit interlocking system (Rail Interlocking System) is hereinafter referred to as RIS, where s0 is the initial state. In this state, the sensor will detect the location information of the train and apply for an approach (path). s1 is the monitor processing path requests. In this state, the monitor processes the route applications from different trains and detects whether there are path conflicts. s2 is the controller processing the path. In this state, the controller will convert the switches in the corresponding path to the corresponding position and lock them according to the successfully applied path information, and turn the signal light green. Therefore, the following transitions (traces) appear:

[0358] When the path sensor senses the train position information input event in the s0 state, the output monitor applies for the route and switches to the s1 state, and the monitor processes the route request.

[0359] In the s1 state, if an application failure input event occurs due to path conflict or other reasons, the output monitor cancels the route application and switches to the s0 state to re-detect the train position information or re-apply for the route. If an application success input event occurs, the output controller adjusts the turnout signal light and switches to the s2 state.

[0360] In the s2 state, if a turnout or signal light damage input event occurs, the output controller will feedback the fault information and switch to the s1 state, and the monitor will cancel the path request. If a path handling success input event occurs, the output train is allowed to enter and switches to the s0 state, waiting for a new train to enter. The state machine diagram of this example is as follows:

[0361] SFMS in the above picture: ;

[0362] With state space and initial state s0. Its variable symbol is , , type domain D RIS , which represents the input range and also covers the reachable output variable range y∈[monitor applies for route, monitor cancels route application, controller adjusts switch signal, controller feedback fault information, train is allowed to enter]. The input alphabet of RIS can be rewritten as:

[0363] ={ {The path sensor senses the train location information, the application fails, the application succeeds, the turnout or signal light is damaged, and the path is successfully processed}};

[0364] Likewise, the output alphabet can be expressed as:

[0365] ={The monitor applies for a route, the monitor cancels the route application, the controller adjusts the switch signal light, the controller feeds back fault information, and the train is allowed to enter};

[0366] The conversion relationship can be expressed as:

[0367] ={( s0 , the path sensor senses the train position information, the monitor applies for route entry, s1), ( s1 , the application fails, the monitor cancels the application for route entry, s0), ( s1 , the application is successful, the controller adjusts the switch signal light, s2), ( s2 , the switch or signal light is damaged, the controller feedbacks the fault information, s1), ( s2 , the path is successfully processed, the train is allowed to enter, s0)}.

[0368] Mutants are usually variants created by introducing intentional errors or changes to the original system or model. These mutants are used to evaluate how tolerant the system is to errors and whether the system can correctly detect, handle or prevent these errors.

[0369] The erroneous behavior of the system under test is captured by a finite set of mutant SFSMs, whose behavior may deviate from the reference model SFSM, including:

[0370] wrong or swapped input conditions;

[0371] Wrong or swapped output expressions;

[0372] transmission failures, including extra, lost, or misdirected conversions;

[0373] The state of being added or lost (always involves a transport failure).

[0374] In order to treat mutants and reference models in the same context, this application requires:

[0375] Wrong input conditions are also included in the input alphabet middle;

[0376] The wrong output expression is also included in the output alphabet but does not appear anywhere in the referenced model.

[0377] Example 2:

[0378] Taking Example 1 as an example, we introduce Figure 5 The SFSM shown is Figure 4 The reference model SFSM RIS mutants are specified in . Figure 5 As shown in the figure, the input conditions marked in bold are wrong. The input conditions for switching from s2 to s0 state should be successful path processing, but here it becomes unsuccessful. In this case, the controller will allow the train to enter when the path is not successfully processed, which will cause an accident.

[0379] During the test process, the embodiment of the present application needs to verify whether the improved reference model can produce correct output when processing correct input, and also needs to examine the processing ability of the improved reference model for erroneous input. For this reason, the present application needs to introduce some mutants and include them in the test case. Only when the improved reference model can correctly detect, process or prevent all possible errors, can it pass the test. The input events of these mutants are a kind of wrong system behavior, and if the system does not do the correct processing, serious consequences will occur. The present application can introduce a variety of input events to form multiple mutants, and then form a fault domain to verify the fault tolerance of the system.

[0380] The valuation function σ maps each variable symbol v to its corresponding type value σ(v), where the variable symbol v belongs to the variable set Var. Var An abbreviation for the set of functions that map from Var to D. represents the set of all finite sequences that map from Var to D. For a variable symbol the first-order expression from Var , Indicates an input event. This application will Expressed as the valuation function σ is the input event Model, which will input events Each variable symbol v in is replaced by σ(v) and the resulting Boolean expression evaluates to true. This application only considers well-formed SFSMs, which means that for the conjunction of the input event and the output event At least one model exists This application assumes that each SFSM is fully specified, i.e., in each state, the union of each model in the set of inputs that apply to at least that state is equal to the entire set of input evaluations D I .

[0381] Example 3:

[0382] The valuation function is a model of specific input events and corresponding output events, such as:

[0383] yes The model, that is . is an input event and an output event. It indicates that there is a segment conflict in the route requested by the train, and the train is not allowed to enter the route. However, there are multiple segments in a route. Whether it is a segment 1 conflict or a segment 2 conflict, the system will determine that there is a segment conflict in the route and trigger an input event. , Both A model of.

[0384] According to the valuation function, specific input events and output events can be identified and classified. These specific input events and output events can not only guide the generation of symbolic traces and specific traces (specific traces are finite sequences of valuation functions), but also prepare for further improvement of SFMS (because input and output events need to be classified). In this step, all valuation functions in the system will be obtained and prepared for use.

[0385] It is easy to see that all traces (transitions) of RIS and its mutants have models, so both SFSMs are well-formed. Furthermore, both SFSMs are fully specified.

[0386] Symbol traces are multiple A finite sequence of , which represents this execution path in the test. Figure 4 In the SFSM, the system needs to test the path from s0 to s1 and then to s2. It needs to test in sequence

[0387] , , These three sequences, for this test, the symbol trace .

[0388] This application uses a visual representation inherited from the Mealy machine represents these predicate pairs, because Specify input events. Specify output events. The set of symbol traces of the reference model M is denoted by T(M).

[0389] In the field of system modeling formalism, the behavior (or language) of a reference model M is usually defined by its concrete trace set and expressed as Two SFSMs are (linguistically) equivalent if and only if they have the same set of concrete traces.

[0390] Example 4:

[0391] Some symbols of SFSM RIS are as follows:

[0392] ;

[0393] (x=path sensor senses train position information, y=monitor applies for route entry). (x=application successful, y=controller adjusts switch signal light). (x=switch or signal light is damaged, y=controller feedbacks fault information);

[0394] (x=section conflict in the path, y=train is not allowed to enter). (x=section conflict in the path, y=train is not allowed to enter). (x=section conflict in the path, y=train is not allowed to enter);

[0395] The specific transformation path of the reference model M is an infinite sequence .

[0396] in, , so that there exists a symbol path for the reference model M:

[0397] satisfy , where i ≥ 1. The specific trace κ of the reference model M is a finite sequence of evaluation functions:

[0398] ,

[0399] So that the reference model M has a symbol trace ;satisfy

[0400] If this condition is satisfied, κ is called Witness, this application uses abbreviated symbols .

[0401] Example 5:

[0402] For symbol traces , . . is the specific input event of the condition (x=segment conflict in the path), and is also the symbolic trace Testimony, As shown in Example 4.

[0403] The reference model SFSM of this application is required to be observable, which means that for any specific specific trace , the target state reached after applying the specific trace κ to the initial state s0 is uniquely determined. Specifically, during testing, if the specific trace κ of this test is already known, it is possible to determine which input event the system has executed and which state it has reached based on its output events. Observability is very important because this method is performed in a black box test environment, which makes it impossible to distinguish what state the system is currently in. However, since errors may occur when the system executes the test, it is necessary to know the results of this test and whether the test state reached meets safety requirements. This requires the system to be observable, and at the same time, distinguishing traces requires the system to be observable. The rail transit interlocking system itself is a deterministic system and an observable system.

[0404] In the improved reference model SFSM based on the first-order expression, given the reference model , and a finite set Q, where Q is the set of free variables from A quantifier-free first-order expression. Q can be divided into two parts: a subset Q g contains only input expressions from I, and another subset Q h Contains at least one output expression from O. Since all input expressions and output expressions have been obtained in the evaluation function, the corresponding Q is directly derived here g and Q h For the improved reference model , grouping the same type of input events together, and grouping the same type of output events together; the input alphabet of Q(M) consists of the original input conditions Composition, further through the first-order positive expression and the negative expression The output alphabet consists of the output expressions of M', which are further constrained by The restriction is that any combination of the conjunction of the positive and negative expressions in . Again, any conjunction without a model is discarded.

[0405] Q(M) is called a first-order expression-based improvement of the reference model M. The "improvement" here means that the input events and output events associated with Q(M) are more "refined", that is, more restricted than those of the reference model M. However, this improvement does not change the language of the original SFSM. At the same time, the following theorem exists:

[0406] If the reference model M is a SFSM and Q(M) is a refinement of the reference model M constructed as described above, then L(Q(M))=L(M).

[0407] The SFSM improvement based on the first-order expression will initially divide the input events and output events, so that the input events and output events as well as the input alphabet and output alphabet are no longer disordered, but are divided according to the corresponding intervals. Because the test is completely automatic (of course it can also be manual, but it is too time-consuming to manually input test cases each time), the test system is disordered. For example, if you want to test the system's response to the input event (x=segment conflict in the path), but just after executing one test case, the next one executes (x=incorrect turnout position). Repeatedly switching the system will inevitably increase the test time. Therefore, it is necessary to improve the SFSM. Here, the same type of input events and output events will be divided separately, and then tested according to the results of the division, that is, the generated and Will be used for test case generation.

[0408] In order to describe the behavior properties of a given SFSM M, this application uses linear temporal logic LTL. In this application, the syntax of LTL formula η is given by the following grammar: ,in represents an atomic proposition, written as a quantifier-free first-order expression for symbols from Var.

[0409] Intuitively, any violation of the safety requirement P (i.e. ) can be identified by a finite prefix π' < π (a so-called bad prefix), so that any continuation of π' can never be part of P. Therefore, this method restricts itself to testing for safety requirements. Here, each safety property Violation You can use only the operator , , X, and U to express it.

[0410] Example 6:

[0411] for Figure 4 In the example of the reference model RIS in , this application considers two security characteristics. In natural language, they are expressed as two requirements:

[0412] R1: When the application fails, the controller cannot forcibly requisition the path.

[0413] R2: When the switches are not all aligned to the correct position, the controller cannot commandeer the path.

[0414] Converted to LTL like this:

[0415] ;

[0416] .

[0417] According to the definition of operator W, the formula expresses one of two things: over an infinite number of transformations, either Never happens and Globally established, either Eventually happens, but at this point make sure At least in The ending trace prefix is ​​established, that is, Convert R2 to The process is very simple, because the formula structure is exactly the same as the text structure. and The atomic propositions that appear in each are AP1 = { , } and AP2 = { , }.

[0418] If an LTL formula has a model on its set of atomic propositions, then extending that set will also result in a model on the extended set.

[0419] The LTL in this application has been derived from steps S1 and S2, so it can be directly applied to generate test cases. This application automatically converts the refined software safety requirements into LTL attributes, which are further transformed into an atomic proposition set AP. This AP is used for the following proposition abstraction and test case generation.

[0420] Propositional abstraction is used to map valuation functions σ to the set of atomic propositions they satisfy, so that it is possible to identify which specific traces or valuation functions σ correspond to which LTLs. In this way, when testing the corresponding specific traces, it is also possible to verify whether the valuation function satisfies its corresponding LTL.

[0421] Let AP be the set of atomic propositions in the symbol Var. In general, AP contains the atomic propositions that appear in the LTL that are satisfied by the SFSM reference model and verified against the SUT. The propositional abstraction ω maps assignments to the set of atomic propositions they satisfy. In other words, for a proposition belonging to D Var Assign a valuation function σ, ω(σ) is the set of atomic propositions satisfied by the valuation function σ. Through recursive definition, ω can be extended to the assignment sequence and specific traces.

[0422] Example 7: For the specific trace in Example 5:

[0423] . . ;

[0424] AP={ , };

[0425] The following are propositional abstractions:

[0426] . . .

[0427] For a security formula η and a finite proposition trace , if and only if π' is a bad prefix of η, use the symbol This means that any infinite proposition with π' as a prefix will be SFSM M is the model of the LTL security formula η (written as ) if and only if no concrete trace of M can be abstracted into a bad prefix of η through ω (i.e. ).

[0428] The following theorem shows that if all concrete traces of the improved reference model M' are abstracted on the set of atomic propositions and are included in the concrete traces of the equally abstract reference model M, then any security formula about atomic propositions satisfied by the reference model M will also be satisfied by the improved reference model M'.

[0429] Theorem: Assume , and AP given, and

[0430] M' = (S' , s0', R' , I, O, D, ∑ I , ∑ O ) are two well-formed SFSMs. Assume For an LTL safety formula η about an atomic proposition, if ,but .

[0431] In black box testing, fault domains are introduced to limit possible erroneous behaviors, thereby ensuring that limited test cases can guarantee exhaustiveness. It is a set of SFSMs (Finite State Machines). The potential fault system captured by the fault domain has The real behavior of the fault domain Z is represented by a modified reference model M', where the modified reference model M' has at most m distinguishable states and is a mutant of the reference model M. Therefore, the modified reference model M' may perform transport faults and use input expressions and output expressions that are never used by the reference model. In addition, the modified reference model M' may use input expressions and output expressions from the alphabet of the reference model, with arbitrary transformations. For the actual construction of the fault domain Z, all input expressions and output expressions appearing in the reference model can be collected and mutations of all potential input expressions and output expressions expected to appear in the faulty realization can be added.

[0432] The purpose of the fault domain is to verify the fault tolerance of the system. This application will introduce some faults to test whether the system can handle these faults correctly. These introduced input faults are mutants.

[0433] As we all know, in black box testing, the applicant does not know what state the system under test is in. In order to distinguish the different states of the system under test and determine whether the current test has reached the target state that the applicant wants to reach, observability is required. Whether it starts from the original state that the applicant wants, it is necessary to use differentiation traces to distinguish different states.

[0434] Consider an alphabet with symbols SFSM M, here and All come from the improved reference model M' and Assume that M has been modified so that its symbol trace is represented by the set of input / output sequences T(M).

[0435] For SFSM M, a pair of symbol traces is called a distinguishable trace of the reference model M if there exists a symbol input / output sequence , so that is the symbol trace of the reference model M, but No, and vice versa. At the same time, for two states A and B, they can both execute α and β, and state A can execute But can't , State B is the opposite, it can execute But it cannot be executed , which also distinguishes the two states A and B. The execution of this condition can be specified by the following formula:

[0436] .

[0437] If α and β are distinguishable, then we say that γ in the formula distinguishes α and β, and use This represents the set of all distinguished sequences:

[0438] .

[0439] It should be noted that if is the symbol trace of M, then it is contained in All specific traces of are contained in L(M). Conversely, if ,but No specific trace of is in L(M).

[0440] Correspondingly, for propositional abstraction ω, this application also has a distinguishing set definition of abstract traces:

[0441] .

[0442] In black box testing, since we do not know what state the system under test is in, in order to distinguish different states and determine whether the current test has reached the target state we want, we need to use differentiation traces to distinguish different states.

[0443] State coverage of a symbolic finite state machine M , where V is the set of symbolic traces of the input / output expressions of M. This ensures that for any state of M , there is a , so that Here, this application assumes that the empty trace ε is included in the state cover since it can reach the initial state.

[0444] A test case set TS is a set of symbolic input / output sequences, i.e. . Symbolic input / output sequence is called a test case. ,when When the application says that M passes the test case ; Otherwise, M fails the test case α. SFSM M passes the test case set TS, which means that M passes every test case in TS, that is, .

[0445] set up are two SFSMs in the same fault domain, where M is the reference model with n states. This application says that M and M' are equivalent in terms of TS if and only if Intuitively, this means that the corresponding test cases of M and M' have exactly the same passing rate.

[0446] The test case generation method is specified in the above requirements, and its basic method is explained in the following paragraphs:

[0447] In step 1, a minimal state cover is constructed It ensures that the test cases can cover every state to avoid missing states and losing completeness, and at the same time ensures that for any , there exists a distinguishing trace set And it is not empty, so that the state can be distinguished.

[0448] In step 2, for each pair of different symbol traces Find a sign-differentiated trace γ and , Added to the test case.

[0449] The goal of the test cases created in steps 1 and 2 is to check whether the state coverage of M also reaches n states in the implementation M' and can be used for the same γ differentiation of the reference model. If this is not the case, the test fails because the internal state and transition structure of the implementation differs greatly from the reference model, the system under test is definitely not equivalent to the model in the first place, and the test cases constructed here cannot be used to test the required properties because exhaustivity cannot be guaranteed.

[0450] In step 3, the test case is further extended by a set T of symbolic traces, each of which is a prefix of the state coverage set V and a The symbol trace and distinguishing trace set composed of any sequence in The suffix composition is The length of the sequences in varies from 0 to m−n+1. Assuming that the SUT passes the test cases constructed in steps 1 and 2, the trace subset

[0451] ;

[0452] It is sufficient to reach every implementation state, provided that the test case is a member of the fault domain, so there are at most m states.

[0453] Furthermore, T ensures that in every state case reached, every applicable input / output sequence will be executed, guaranteeing completeness. This allows the application to conclude that if the SUT passes all test cases created in steps 1 to 3, then the SUT has no output faults.

[0454] At the same time, some elements of T may overlap with traces already created in step 2. Therefore, traces in test cases that are just prefixes of longer test cases can be deleted.

[0455] There are also transport faults in the SUT to be tested that could lead to violations of the formulas satisfied by the reference model. This will be investigated by the test cases created in steps 4 and 5.

[0456] Finally, this method executes all generated test cases and then compares them with the LTL attributes converted from the security requirements analyzed by STPA for consistency, to check whether the improved reference model under test meets the security requirements, that is, consistency testing.

[0457] Further references Figure 6 As an implementation of the methods shown in the above figures, the present application provides an embodiment of a rail transit interlocking system consistency test device oriented to safety requirements. Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0458] The embodiment of the present application provides a rail transit interlocking system consistency test device oriented to safety requirements, including:

[0459] The analysis module 1 is configured to analyze the rail transit interlocking system using the STPA technology to obtain refined unsafe control actions and refined software safety requirements, convert the refined software safety requirements into linear temporal logic attributes, and further convert them into atomic propositions to form an atomic proposition set;

[0460] A modeling module 2 is configured to model the rail transit interlocking system using a symbolic finite state machine to obtain a reference model;

[0461] Mutation module 3 is configured to construct a number of mutants based on the reference model, obtain the fault domain, calculate all valuation functions in the rail transit interlocking system, and generate the symbol traces and their corresponding specific traces in the reference model according to the valuation functions;

[0462] Improvement module 4 is configured to improve the reference model based on the first-order expression to obtain an improved reference model. The improved reference model and the reference model are in the same fault domain. The valuation function is mapped to the set of atomic propositions satisfied by the improved reference model to obtain propositional abstraction. The propositional abstraction is extended to the assignment sequence and the specific trace through recursive definition.

[0463] Test module 5 is configured to generate test cases based on the symbolic traces and propositional abstractions of the reference model, execute the test cases on the improved reference model, and detect whether the improved reference model meets the refined software safety requirements. If so, it is determined that the test cases meet the refined software safety requirements. If not, the fault domain is reconstructed and the above two modules are repeated until the test cases meet the refined software safety requirements.

[0464] Figure 7 Schematic diagram of the hardware structure of the electronic device provided by the embodiment of the present invention. Figure 7 As shown, the electronic device of this embodiment includes: a processor 701 and a memory 702; wherein the memory 702 is used to store computer-executable instructions; the processor 701 is used to execute the computer-executable instructions stored in the memory to implement the various steps performed by the electronic device in the above embodiment. For details, please refer to the relevant description in the above method embodiment.

[0465] Optionally, the memory 702 may be independent or integrated with the processor 701 .

[0466] When the memory 702 is independently provided, the electronic device further includes a bus 703 for connecting the memory 702 and the processor 701 .

[0467] The embodiment of the present invention further provides a computer storage medium, in which computer execution instructions are stored. When the processor 701 executes the computer execution instructions, the above method is implemented.

[0468] The embodiment of the present invention further provides a computer program product, including a computer program. When the computer program is executed by the processor 701, the above method is implemented.

[0469] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0470] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.

[0471] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each module may exist physically separately, or two or more modules may be integrated into one unit. The above-mentioned module-composed unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0472] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor 701 to perform some steps of the methods of various embodiments of the present application.

[0473] It should be understood that the processor 701 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or the processor 701 may be any conventional processor 701, etc. The steps of the method disclosed in the invention may be directly embodied in the execution of the hardware processor 701, or may be executed by a combination of hardware and software modules in the processor 701.

[0474] The memory 702 may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk, or an optical disk.

[0475] The bus 703 may be an Industry Standard Architecture (ISA), a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus 703 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus 703 in the drawings of the present application is not limited to only one bus 703 or one type of bus 703.

[0476] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.

[0477] An exemplary storage medium is coupled to the processor 701, so that the processor 701 can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor 701. The processor 701 and the storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as ASIC). Of course, the processor 701 and the storage medium can also exist as discrete components in an electronic device or a main control device.

[0478] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0479] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.< / red> < / red> < / ca> < / preserve> < / tc> < / ca> < / ca> < / tc> < / ca>

Claims

1. A rail transit interlocking system consistency test method oriented to safety requirements, characterized in that: The following steps are involved: The rail transit interlocking system is analyzed by using STPA technology to obtain refined unsafe control actions and refined software safety requirements, and the refined software safety requirements are converted into linear temporal logic attributes, and further converted into atomic propositions to form an atomic proposition set; Modeling the rail transit interlocking system using a symbolic finite state machine to obtain a reference model; Based on the reference model, several mutants are constructed and the fault domain is obtained, all valuation functions in the rail transit interlocking system are calculated, and the symbol traces and their corresponding specific traces in the reference model are generated according to the valuation functions; The reference model is improved based on a first-order expression to obtain an improved reference model, the improved reference model and the reference model are in the same fault domain, the valuation function is mapped to a set of atomic propositions satisfied by the valuation function to obtain a propositional abstraction, and the propositional abstraction is extended to an assignment sequence and a specific trace through a recursive definition; Generate test cases based on the symbolic trace and propositional abstraction of the reference model, execute the test cases on the improved reference model, detect whether the improved reference model meets the refined software safety requirements, if so, determine that the test cases meet the refined software safety requirements, if not, reconstruct the fault domain and repeat the above two steps until the test cases meet the refined software safety requirements; the reference model is represented by a tuple M=(S, s0, R, I, O, D, ∑ I ,∑ O ), where the finite set S represents the state space, s0∈S is the initial state, the finite set I contains the input variable symbols, the finite set O contains the output variable symbols, the variable set Var represents the set I∪O, the set D represents the union of all variables on the type domain, R represents the conversion relationship, ∑ I represents the input alphabet, i.e., the set of input events consisting of a finite number of input conditions, each of which is a quantifier-free first-order expression on the input variables, ∑ O represents the output alphabet, i.e., the set of output events consisting of output expressions, wherein the valuation function σ maps each variable symbol v to its corresponding type value σ(v), and for an input event φ whose variable symbol v comes from the variable set Var, σ|=φ is represented as the valuation function σ being the model of the input event φ, i.e., the Boolean expression obtained by replacing each variable symbol v in the input event φ with the type value σ(v) evaluates to true; for the conjunction φ∧ψ of the input event and the output event, there exists at least one model ∧ means and; for any set X, use X * Denote the set of finite sequences, and use X λ represents a set of infinite sequences. The symbolic path ζ of the reference model M is an infinite sequence, which can be expressed as: ζ=(s0,φ1,ψ1,s1).(s1,φ2,ψ2,s2).(s2,φ3,ψ3,s3)…∈(S×∑ I ×∑ O ×S) λ ; Among them, "." represents the sequence concatenation symbol, S0∈S is the initial state of the reference model M, and for all i≥1, (S i-1 ,φ i , ψ i , S i )∈R; The symbol trace τ of the reference model M is a finite sequence, expressed as: τ=(φ1 / ψ1)…(φ n / ψ n )∈(∑ I ×∑ O ) * ,satisfy: So that (s i-1 ,φ i , ψ i ,s i )∈R, where Indicates existence, The set of symbol traces representing any reference model M is denoted by T(M); The specific transformation path of the reference model M is an infinite sequence, expressed as: (s0, σ1, s1).(s1, σ2, s2)…∈(S×D Var ×S) λ ; Among them, σ i ∈D Var , D var Denote the set of functions that map from Var to D such that there exists a symbolic path to M: (s0, φ1, ψ1, s1). (s1, φ2, ψ2, s2)...satisfy σ i |=φ i ∧ψ i , where i≥1; The specific trace K of the reference model M is a finite sequence of estimation functions, expressed as: K = σ 1 …σ d ∈(D Var ) * ; So that the reference model M has a symbol trace τ=(φ1 / ψ1)…(φ n / ψ n ),satisfy If it satisfies, then the specific trace K is called the witness of the symbolic trace τ, and the symbol is expressed as The set of specific traces is represented by L(M), where Provide a finite set Q of quantifier-free first-order expressions with respect to free variables from I∪O, and divide it into two parts: a subset Q g contains only input expressions from I, and another subset Q h Contains at least one output expression from O, creating a modified reference model M'=Q(M)=(S,s0,Q(R),I,O,D,Q(∑ I ), Q(∑ O ), for any subset and Define a Boolean expression: Among them, ≡ represents the definition, represents negation, \ represents complement, ∧ represents and; Define the input alphabet and output alphabet of Q(M) as shown below: Define the transfer relationship of Q(M) as shown below: The fault domain is represented as Z(I,O,D,∑ I ,∑ O ,AP,n,m), has the following properties: Each modified reference model M′ has at most m states, m ≥ n, represented in observable form; Each modified reference model M' references input and output variables from I and O and is typed by D; Each modified reference model M' uses Q(Σ I ) and Q(Σ O ) in the output expression; Linear temporal logic properties use atomic propositions in the atomic proposition set AP, where the free variables are in I∪O; The alphabet of the fault domain Z is the union of all input conditions, output expressions, and atomic propositions of the formula to be verified Σ = Q (Σ I )∪Q(Σ O )∪AP; For a pair of symbol traces α, β∈T(M), if there exists a symbol input / output sequence γ∈T(M), the state s corresponding to the symbol traces α and β α 、s β If we distinguish them, then α and β are considered distinguishable, and Δ(α, β) is used to represent the set of all distinguishing sequences: The distinguishing set of propositional abstractions ω(α) and ω(β) is defined as: A test case set TS is a set of symbolic input / output sequences, i.e. Each test case in the test case set TS meets the following requirements: (1) TS contains the minimum state cover set V of the reference model M, where ε∈V; (2) For any different test cases α∈V, β∈V, there exists a symbolic input / output sequence γ∈Δ(α, β) such that α.γ∈TS, β.γ∈TS; (3)TS contains the following sets: (4) For satisfaction For any α∈V and β∈T∩T(M), there exists γ∈Δ(α,β) such that α.γ∈TS, β.γ∈TS, represents the empty set; (5) For the case where α∈Pref(β) and For any α∈T∩T(M), β∈T∩T(M), there exists γ∈Δ(α, β) such that α.γ∈TS, β.γ∈TS, and Pref() represents a prefix.

2. The safety-oriented rail transit interlocking system consistency testing method according to claim 1 is characterized in that: The STPA technology is used to analyze the rail transit interlocking system to obtain refined unsafe control actions and refined software safety requirements, including: Defining the boundaries and scope of the rail transit interlocking system, including the various components of the rail transit interlocking system, their interactions, and interfaces with the external environment; Modeling the rail transit interlocking system to determine the normal operating mode of the rail transit interlocking system and the interaction between various components; Determine the control actions performed by each component in the rail transit interlocking system, identify the refined unsafe control actions in the control actions, and the refined unsafe control actions are four-tuples (CA, Cs, C, TC), which are used to describe the key combination of control actions leading to danger and their related process model variables, CA represents the control action leading to danger H∈HA, Cs=∪(P1=v1,…,P B =v B ) is the key combination of the state variables and the key variables of the control action CA, C is to provide the control action or not to provide the control action, TC is the type of the situation in which the control action CA is provided, which is divided into any time, too early or too late; The unsafe control actions are analyzed to obtain refined unsafe control actions and refined software safety requirements.

3. The safety-oriented rail transit interlocking system consistency testing method according to claim 2 is characterized in that: The analyzing the unsafe control action to obtain a refined unsafe control action and a refined software safety requirement specifically includes: Analyze the accidents, hazards and corresponding system-level safety constraints of the rail transit interlocking system; Analyze the refined unsafe control behaviors when enlisting, canceling, and revoking paths, and convert them into refined software safety requirements; Analyze the refined unsafe control behaviors when requisitioning, canceling and revoking paths and track segments and convert them into refined software safety requirements; Analyze the refined unsafe control behaviors when switching, locking, and unlocking switches, and convert them into refined software safety requirements; Analyze the refined unsafe control behaviors with respect to signals and convert them into refined software safety requirements.

4. The safety-oriented rail transit interlocking system consistency testing method according to claim 2 is characterized in that: The step of converting the refined software safety requirements into linear temporal logic attributes and further converting them into atomic propositions to form an atomic proposition set specifically includes: The refined software safety requirements are converted into linear temporal logic properties according to the following rules: When sending the key combination Cs b The software controller should always provide no control action CA b , b∈{1,…,B}, the conversion formula is: LTL b =G(Cs b →! (controlAction==CA b )), where Cs b =∪(P1=v1,…,P B =v B ); In the key combination Cs b Before this happens, the software controller should not provide control actions too early. b , the conversion formula is: LTL b =G(((controlAction==CA b )→! Cs b )&! ((controlAction==CA b )∪Cs b )); In the key combination Cs b After the occurrence, the software controller should not provide control actions too late CA b , the conversion formula is: LTL b =G((Cs b →! (controlAction==CA b ))&! (Cs b ∪(controlAction==CA b ))); The occurrence of a critical combination means that the software controller must provide a control action immediately before the next time node CA b Without delay, the conversion formula is: LTL b =G(Cs b →X(controlAction==CA b )); The linear temporal logic property formula η is given by the following grammar: Here, the linear temporal logic property formula η is taken as an atomic proposition, denoted as η∈AP, where AP represents the set of atomic propositions, and is written as a quantifier-free first-order expression for symbols from Var: and represents any linear temporal logic property formula, π is a proposition trace, and the expression π t The trace suffix π(t).π(t+1).π(t+2)... represents the trace suffix π(t).π(t+1).π(t+2)..., and π 1 =π, for a finite prefix π' of a propositional trace of infinite length: {1, ..., k} → 2 AP ,writing π'(t) = π(t), to specify that π' is a finite prefix of π; The semantics of the path operators F, G, and W are defined by the following grammatical abbreviations: ≡ means definition, ∨ means or, It means negation; A refined software safety requirement is a set P of propositional traces that satisfies: π' and The valuation function is mapped to the set of atomic propositions it satisfies to obtain propositional abstraction, and the propositional abstraction is extended to the assignment sequence and the specific trace through recursive definition, which specifically includes: For D Var Assign a valuation function σ, and the propositional abstraction ω(σ) is the set of atomic propositions satisfied by the valuation function σ, denoted as: Represents the corresponding mapping relationship. Through recursive definition, the propositional abstraction ω is extended to the assignment sequence and the specific trace: oh:(D Vat )*→(2 AP ) * ,ω(ε)=ε and σ(σ,κ)=ω(σ).ω(κ), where σ∈D Var ,κ∈(D Var) *; For linear temporal logic property formula η and finite prefix π'∈(2 AP ) * , if and only if π' is a bad prefix of η, use the symbol If and only if any specific trace of the reference model M is not abstracted to π' by the propositional abstraction ω, then the reference model M is the model corresponding to the linear temporal logic attribute, that is, 5. The safety-oriented rail transit interlocking system consistency testing method according to claim 1 is characterized in that: Deviations of the mutant from the reference model include: incorrect or swapped input conditions, incorrect or swapped output expressions, transmission failures, added or lost states, transmission failures including additional transformation relations, lost transformation relations or misleading transformation relations, and requiring that the incorrect input conditions are also included in the input alphabet ∑ I In the output alphabet ∑ O In, but not anywhere in the reference model, multiple mutants constitute the fault domain.

6. A rail transit interlocking system consistency test device oriented to safety requirements, characterized in that: include: An analysis module is configured to analyze the rail transit interlocking system using STPA technology to obtain refined unsafe control actions and refined software safety requirements, convert the refined software safety requirements into linear temporal logic attributes, and further convert them into atomic propositions to form an atomic proposition set; A modeling module is configured to use a symbolic finite state machine to model the rail transit interlocking system to obtain a reference model; A mutation module is configured to construct a plurality of mutants based on the reference model, obtain a fault domain, calculate all valuation functions in the rail transit interlocking system, and generate a symbol trace and a corresponding specific trace in the reference model according to the valuation function; An improvement module is configured to improve the reference model based on a first-order expression to obtain an improved reference model, wherein the improved reference model and the reference model are in the same fault domain, and the valuation function is mapped to a set of atomic propositions satisfied by the valuation function to obtain a propositional abstraction, and the propositional abstraction is extended to an assignment sequence and a specific trace through a recursive definition; The test module is configured to generate test cases based on the symbolic trace and propositional abstraction of the reference model, execute the test cases on the improved reference model, and detect whether the improved reference model meets the refined software safety requirements. If so, it is determined that the test case meets the refined software safety requirements. If not, the fault domain is reconstructed and the above two modules are repeated until the test case meets the refined software safety requirements; the reference model is represented by a tuple M=(S, s0, R, I, O, D, ∑ I ,∑ O ), where the finite set S represents the state space, s0∈S is the initial state, the finite set I contains the input variable symbols, the finite set O contains the output variable symbols, the variable set Var represents the set I∪O, the set D represents the union of all variables on the type domain, R represents the conversion relationship, ∑ I represents the input alphabet, i.e., the set of input events consisting of a finite number of input conditions, each of which is a quantifier-free first-order expression on the input variables, ∑ O represents the output alphabet, i.e., the set of output events consisting of output expressions, wherein the valuation function σ maps each variable symbol v to its corresponding type value σ(v), and for an input event φ whose variable symbol v comes from the variable set Var, σ|=φ is represented as the valuation function σ is the model of the input event φ, i.e., the Boolean expression obtained by replacing each variable symbol v in the input event φ with the type value σ(v) evaluates to true. For the conjunction φ∧ψ of the input event and the output event, there exists at least one model. ∧ means and; for any set X, use X * Denote the set of finite sequences, and use X λ represents a set of infinite sequences. The symbolic path ζ of the reference model M is an infinite sequence, which can be expressed as: ζ=(s0,φ1,ψ1,s1).(s1,φ2,ψ2,s2).(s2,φ3,ψ3,s3)…∈(S×∑ I ×∑ O ×S) λ ; Among them, "".,, represents the sequence concatenation symbol, S0∈S is the initial state of the reference model M, for all i≥1, (s i-1 ,φ i , ψ i , S i )∈R; The symbol trace τ of the reference model M is a finite sequence, expressed as: τ=(φ1 / ψ1)...(φ n / ψ n )∈(∑ I ×∑ O ) * ,satisfy: So that (s i-1 ,φ i , ψ i ,s i )∈R, where Indicates existence, The set of symbol traces representing any reference model M is denoted by T(M); The specific transformation path of the reference model M is an infinite sequence, expressed as: (s0,σ1,s1).(s1,σ2,s2)···∈(S×D Var ×S) λ ; Among them, σ i ∈D Var , D Var Denote the set of functions that map from Var to D such that there exists a symbolic path to M: (s0, φ1, ψ1, s1). (s1, φ2, ψ2, s2)... satisfies σ i |=φ i ∧ψ i , where i≥1; The specific trace κ of the reference model M is a finite sequence of estimation functions, expressed as: κ = σ 1 ... d ∈(D Var ) * ; So that the reference model M has a symbol trace τ=(φ1 / ψ1)...(φ n / ψ n ),satisfy If it satisfies, then the specific trace κ is called the witness of the symbolic trace τ, which is symbolically represented as The set of specific traces is represented by L(M), where Provide a finite set Q of quantifier-free first-order expressions with respect to free variables from I∪O, and divide it into two parts: a subset Q g contains only input expressions from I, and another subset Q h Contains at least one output expression from O, creating a modified reference model M'=Q(M)=(S,s0,Q(R),I,O,D,Q(∑ I ), Q(∑ O ), for any subset and Define a Boolean expression: Among them, ≡ represents the definition, represents negation, \ represents complement, ∧ represents and; Define the input alphabet and output alphabet of Q(M) as shown below: Define the transfer relationship of Q(M) as shown below: The fault domain is represented as Z(I,O,D,∑ I ,∑ O ,AP,n,m), has the following properties: Each modified reference model M′ has at most m states, m ≥ n, represented in observable form; Each modified reference model M' references input and output variables from I and O and is typed by D; Each improved reference model M' uses Q(∑ I ) and Q(∑ O ) in the output expression; Linear temporal logic properties use atomic propositions in the atomic proposition set AP, where the free variables are in I∪O; The alphabet of the fault domain Z is the union of all input conditions, output expressions, and atomic propositions of the formula to be verified ∑ = Q (∑ I )∪Q(∑ O )∪AP; For a pair of symbol traces α, β∈T(M), if there exists a symbol input / output sequence γ∈T(M), the state s corresponding to the symbol traces α and β α 、s β If we distinguish them, then α and β are considered distinguishable, and Δ(α, β) is used to represent the set of all distinguishing sequences: The distinguishing set of propositional abstractions ω(α) and ω(β) is defined as: A test case set TS is a set of symbolic input / output sequences, i.e. Each test case in the test case set TS meets the following requirements: (1) TS contains the minimum state cover set V of the reference model M, where ε∈V; (2) For any different test cases α∈V, β∈V, there exists a symbolic input / output sequence γ∈Δ(α, β) such that α.γ∈TS, β.γ∈TS; (3)TS contains the following sets: (4) For satisfaction For any α∈V and β∈T∩T(M), there exists γ∈Δ(α,β) such that α.γ∈TS, β.γ∈TS, represents the empty set; (5) For the case where α∈Pref(β) and For any α∈T∩T(M), β∈T∩T(M), there exists γ∈Δ(α, β) such that α.γ∈TS, β.γ∈TS, and Pref() represents a prefix.

7. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.

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

9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Software test case generation method, electronic equipment and readable storage medium

    CN114706755A

  • Black box fuzz testing method and system based on linear temporal logic guidance on limited trajectory

    CN118193375A

  • STPA method and apparatus for accurately identifying loss scenario

    WO2022037430A1