Train operation control system software fault diagnosis method
By adopting a model-driven fault detection method in the train operation control system and combining with convolutional neural network for fault location, the problem of low software fault diagnosis efficiency in the prior art is solved, and efficient and accurate fault diagnosis is achieved.
Patent Information
- Application Number
- CN202411731556.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-21
AI Technical Summary
The existing technology lacks effective software fault diagnosis methods in train operation control systems, resulting in high software fault cost, and the existing methods have problems such as matching conflicts and low inference efficiency.
The fault detection method based on model and data is adopted to model the train control system through formal methods, design the I/O interface channel observer, perform fault injection and test cases, and combine it with convolutional neural network for fault location.
It realizes accurate and rapid diagnosis of software failures of the train control system, improves the completeness and accuracy of diagnosis, and reduces the workload of development and maintenance personnel.
Smart Images

Figure CN119669067A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of railway signals, computer software and fault diagnosis, and in particular to a method for diagnosing software faults of a train operation control system. Background Art
[0002] The train control system (hereinafter referred to as the "train control system") is a technical equipment to ensure the safety and efficient operation of trains. It monitors, controls and adjusts the train speed, braking and other states according to the line operation conditions. As a key equipment of the train, the train control system is crucial to ensure the safety of rail transit. The train control system is a typical safety-critical system, and the control logic of its core functions is implemented by software. Software defects cannot be ignored, and timely discovery and correction of software errors are particularly important for safety-critical systems. Fault diagnosis technology is an important technical means to improve system functional safety and reduce equipment risks. However, the current research on fault diagnosis technology in train control systems mainly focuses on hardware, and software fault diagnosis has not received enough attention. Therefore, the failure cost in the software delivery stage is relatively high. Exploring fast and accurate fault diagnosis methods from the software development stage is an important means to achieve high reliability and meet the SIL4 safety integrity level requirements of the train control system software, which is of great significance for ensuring the safe and efficient operation of the train control system.
[0003] Among the existing software fault diagnosis methods, they can be mainly divided into program slicing-based, model-based, program spectrum-based and data-driven methods. Among them, the data-driven method represented by neural networks is more flexible, does not require the establishment of an accurate model, only needs to rely on expert knowledge and historical data, has strong self-learning and knowledge reasoning capabilities, and has its inherent advantages in model-unknown fault diagnosis applications. However, there are also problems such as matching conflicts and low reasoning efficiency, which make the reasoning speed slow and inefficient. The model-based fault diagnosis method predicts the system behavior according to the system mathematical principles, behavior or functional structure model and compares the consistency with the observable values of the system. This method has good adaptability to faults with characteristics such as randomness, masking, and delay. It can use the consistency difference between the system and the model to search for possible behavior trajectories and state assumptions, and finally realize the in-depth analysis of the fault. Its disadvantage is that it relies on the designer to provide a model that describes the correct behavior of the system, so the engineering workload is relatively complicated.
[0004] The inventor conducted a prior art search based on the keyword "software fault diagnosis", and the search results are as follows:
[0005] Comparative Document 1: Chinese Patent Publication No. CN111198817A proposes a convolutional neural network to perform fault diagnosis on SaaS (Software as a Service) software, and performs diagnostic analysis based on the software log data.
[0006] Comparative Document 2: Chinese Patent Publication No. CN108536123B proposes a method for diagnosing faults of on-board equipment of a train control system using a long short-term memory neural network, and performs diagnostic analysis starting from the log files of the on-board equipment.
[0007] The differences between the above two comparative patents and the present invention are:
[0008] 1) Research object: The research object of CN111198817A is SaaS software, while the train control system is a safety-critical system with higher requirements for software security. In addition, the research object of CN108536123B is the on-board equipment of the train control system, which has obvious differences at the software level;
[0009] 2) Data source: The data in the above patents are all from log data. The failure analysis and summary based on single log data has certain limitations.
[0010] Based on the above background, the present invention proposes a train operation control system software fault diagnosis method. The data of this fault diagnosis method comes from program statements, and it adopts a model-based and data-driven fault detection method, which can overcome the limitations of a single method and make the diagnosis effect more accurate and efficient. Summary of the invention
[0011] The purpose of the present invention is to provide a train operation control system software fault diagnosis method, which adopts a model-based and data-driven fault detection method to overcome the limitations of a single method and make the diagnosis effect more accurate and efficient.
[0012] To achieve the above object, the present invention provides the following technical solution: a method for diagnosing software faults in a train operation control system, comprising the steps of:
[0013] S1: According to the train control system requirements, the train control system and environment are modeled using formal methods. The model state space is searched according to the system mathematical principles, behavior or functional structure model, the system behavior is predicted and the consistency is compared with the observable values of the system. The system can be defined as a six-tuple A = (S, S0, ∏, X, I, E), where S represents the system state, S0 represents the system initial state, ∏ represents a symbol, X represents a clock variable, I is the mapping between the state S and the clock constraint, and E represents the system state migration.
[0014] S2: Design an I / O interface channel observer and use the consistency observation theory to detect whether the software behavior is legal in real time. The details are as follows: represents the output observed by the system under action a, J represents the current state space, and the state set is expressed as Updates are performed after a certain delay or when the system input occurs. When it is displayed, it means that an illegal situation has occurred and the output cannot be made. At this time, the software is faulty.
[0015] S3: Inject faults into the model and use typical mutation operators to generate defective codes. After executing these codes, detect and generate faulty versions and environmental parameters to form a test case set.
[0016] S4: Execute the test case, obtain the execution path of the program body through program instrumentation technology, extract coverage data using coverage analysis algorithm (0 means no coverage, 1 means successful coverage), and construct the coverage matrix based on the execution result (0 means successful execution, 1 means failure) As the training input data set; in addition, a virtual coverage information matrix {v1,v2,...,v i}, as the test data set for training;
[0017] S5: Construct a convolutional neural network and determine the model parameters through training. The specific steps include:
[0018] S501: Determine the neural network structure and design modules including input layer, convolution layer, pooling layer, activation function, etc.
[0019] S502: Initialize the neural network, input the learning rate η, the termination threshold accuracy ε, and the maximum number of iterations N max , and randomly initialize the model parameters in the range of [-1,1];
[0020] S503: Start iterative training, randomly select a training sample from the training set C(X,T), and calculate its actual output Y=f(W n×j X+b), where the sample input is X=[x1,x2,...,x n ] T , Represents the weight in the neural network, and the actual output is Y=[y1,y2,...,y m ] T ;
[0021] S504: The expected output is Z = [z1, z2, ..., z m ] T Calculate the output error And perform error back propagation;
[0022] S505: Update model parameters W n×j , and recalculate the output Y for all samples and update the global error E;
[0023] S506: Determine the termination condition, when the termination threshold accuracy ε or the maximum number of iterations N is reached max The algorithm is terminated when , otherwise it returns to step S503;
[0024] S6: Use the trained convolutional neural network to locate the faults of the program under test and output a list of suspicious error signatures r vi (i=1,2,...,m)∈[0,1], represents the corresponding execution statement s i (i=1,2,...,m) has the probability of defects, so according to r vi The size of the value finds the corresponding execution statement s i , thus achieving real-time fault location.
[0025] Preferably, the step of determining the convolutional neural network structure in S501 is specifically as follows:
[0026] S501.1: Input layer neuron calculation: The size of the training data set is d×n, where d represents the width and n represents the number of test cases. The number of input layer neurons num=d×j=(n δ +n func )×j, where j represents the selection of j inputs from n test cases, n δ Represents the total number of constraints in the program branch, n func Indicates the number of functions that do not contain branches;
[0027] S501.2: Convolution layer: The convolution layer extracts local features of the data through the convolution kernel, using a 3-layer convolution structure and a 10×10 convolution kernel;
[0028] S501.3: Pooling layer: The pooling layer can reduce the complexity of the model, prevent the model from overfitting, and adopt the maximum subsampling method;
[0029] S501.4: Activation function selection: ReLU activation function is used, which can be expressed as
[0030] Preferably, the setting of the learning rate in step S502 uses a dynamically adjusted learning rate to accelerate the convergence speed of the model. The initial value is set to 0.01, and the update is performed according to the following formula during the training process: η = η·R (epoch+1) / epochrate, where R represents the learning rate modification amplitude, which is set to 0.96, epoch represents the number of training times, and epochrate represents the frequency of changing the learning rate, which is set according to the size of the test case.
[0031] Preferably, in step S504, the error is back-propagated to dynamically adjust the weights so that the weights decrease in the direction of the negative gradient, as follows:
[0032] Output layer and hidden layer weight correction In j and Out j Respectively represent the jth neuron input and output in the hidden layer; the weight correction of the input layer and the hidden layer
[0033] Compared with the prior art, the present invention has the following beneficial effects:
[0034] 1. The present invention realizes accurate and rapid diagnosis of train control system software faults based on the advantages of both model methods and data-driven methods.
[0035] 2. The fault detection method based on formalized model proposed in the present invention can track the system behavior trajectory in real time, detect faults by using model constraints and state space search, and can also conduct targeted case analysis of various faults through variation analysis, thus greatly improving the completeness of diagnosis.
[0036] 3. The present invention improves the accuracy of fault location by establishing a mapping relationship between code statements and fault modes so as to make them conform to the operating mechanism of the train control system software as much as possible.
[0037] 4. The intelligent deep learning-based fault location method proposed in the present invention will improve the efficiency and automation level of positioning and reduce the workload of development and maintenance personnel. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 The present invention is a flow chart of the model-based and data-driven train control system software fault diagnosis;
[0039] Figure 2 A flowchart of the convolutional neural network training of the present invention;
[0040] Figure 3 Schematic diagram of the convolutional neural network structure of the present invention;
[0041] Figure 4 Schematic diagram of comparison results between the present invention and the existing algorithm. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments 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.
[0043] See also Figure 1 , Figure 2 The present invention provides a technical solution: a software fault diagnosis method for a train control system. The software fault diagnosis method is based on the advantages of both a model method and a data-driven method to achieve accurate and rapid diagnosis of software faults in a train control system. The specific steps of the software fault diagnosis method include:
[0044] S1: According to the train control system requirements, the train control system and environment are modeled using formal methods. The model state space is searched according to the system mathematical principles, behavior or functional structure model, the system behavior is predicted and the consistency is compared with the observable values of the system. The system can be defined as a six-tuple A = (S, S0, ∏, X, I, E), where S represents the system state, S0 represents the system initial state, ∏ represents a symbol, X represents a clock variable, I is the mapping between the state S and the clock constraint, and E represents the system state migration.
[0045] S2: Design an I / O interface channel observer and use the consistency observation theory to detect whether the software behavior is legal in real time. The details are as follows: represents the output observed by the system under action a, J represents the current state space, and the state set is expressed as Updates are performed after a certain delay or when the system input occurs. When it is displayed, it means that an illegal situation has occurred and the output cannot be made. At this time, the software is faulty.
[0046] S3: Inject faults into the model and use typical mutation operators to generate defective codes. After executing these codes, detect and generate faulty versions and environmental parameters to form a test case set.
[0047] S4: Execute the test case, obtain the execution path of the program body through program instrumentation technology, extract coverage data using coverage analysis algorithm (0 means no coverage, 1 means successful coverage), and construct the coverage matrix based on the execution result (0 means successful execution, 1 means failure) As the training input data set; in addition, a virtual coverage information matrix {v1,v2,...,v i}, as the test data set for training;
[0048] S5: Construct a convolutional neural network and determine the model parameters through training. The specific steps include:
[0049] S501: Determine the neural network structure and design modules including input layer, convolution layer, pooling layer, activation function, etc.
[0050] S502: Initialize the neural network, input the learning rate η, the termination threshold accuracy ε, and the maximum number of iterations N max , and randomly initialize the model parameters in the range of [-1,1];
[0051] S503: Start iterative training, randomly select a training sample from the training set C(X,T), and calculate its actual output Y=f(W n×j X+b), where the sample input is X=[x1,x2,...,x n ] T , Represents the weight in the neural network, and the actual output is Y=[y1,y2,...,y m ] T ;
[0052] S504: The expected output is Z = [z1, z2, ..., z m ] T Calculate the output error And perform error back propagation;
[0053] S505: Update model parameters W n×j , and recalculate the output Y for all samples and update the global error E;
[0054] S506: Determine the termination condition, when the termination threshold accuracy ε or the maximum number of iterations N is reached max The algorithm is terminated when , otherwise it returns to step S503;
[0055] S6: Use the trained convolutional neural network to locate the faults of the program under test and output a list of suspicious error signatures r vi (i=1,2,...,m)∈[0,1], represents the corresponding execution statement s i (i=1,2,...,m) has the probability of defects, so according to r vi The size of the value finds the corresponding execution statement s i , thus achieving real-time fault location.
[0056] See also Figure 3 In this embodiment, the step of determining the convolutional neural network structure in S501 is as follows:
[0057] S501.1: Input layer neuron calculation: The size of the training data set is d×n, where d represents the width and n represents the number of test cases. The number of input layer neurons num=d×j=(n δ +n func )×j, where j represents the selection of j inputs from n test cases, n δ Represents the total number of constraints in the program branch, n func Indicates the number of functions that do not contain branches;
[0058] S501.2: Convolution layer: The convolution layer extracts local features of the data through the convolution kernel, using a 3-layer convolution structure and a 10×10 convolution kernel;
[0059] S501.3: Pooling layer: The pooling layer can reduce the complexity of the model, prevent the model from overfitting, and adopt the maximum subsampling method;
[0060] S501.4: Activation function selection: ReLU activation function is used, which can be expressed as
[0061] In this embodiment, the setting of the learning rate in step S502 adopts a dynamically adjusted learning rate to accelerate the convergence speed of the model. The initial value is set to 0.01, and the update is performed according to the following formula during the training process: η=η·R (epoch+1) / epochrate , where R represents the learning rate modification amplitude, which is set to 0.96, epoch represents the number of training times, and epochrate represents the frequency of changing the learning rate, which is set according to the size of the test case.
[0062] In this embodiment, the error is back-propagated in step S504, and the weight is dynamically adjusted so that the weight decreases in the direction of the negative gradient, as follows:
[0063] Output layer and hidden layer weight correction In j and Out j Respectively represent the jth neuron input and output in the hidden layer; the weight correction of the input layer and the hidden layer
[0064] Validation: The effectiveness of the proposed method was verified using the Siemens test suite, a software fault location benchmark program, as an example, and compared with the currently commonly used program spectrum-based methods Ochiai and Jaccard. The test suite contains 7 subroutines and a total of 132 fault program versions. The evaluation criteria are calculated using the following formula: Where N total Represents the number of executable statements in the program, N testIndicates the number of check statements required to find an error. The lower the indicator value, the higher the fault location accuracy.
[0065] See also Figure 4 The positioning method proposed in this invention is compared with the traditional Ochiai and Jaccard methods. The experimental results show that detecting about 30% of the program code can locate about 90% of the faults, and the convolutional neural network positioning method proposed in this invention has better positioning effect than other methods, saving the code inspection work.
[0066] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0067] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0068] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0069] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only one, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0070] The units described as separate components may or may not be physically separated, and the components shown as units 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 units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0071] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0072] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.
[0073] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0074] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
[0075] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for diagnosing software faults in a train operation control system, characterized in that: Includes steps: S1: Formal modeling of the train control system and environment according to the train control system requirements; search the model state space according to the system mathematical principles, behavior or functional structure model, predict the system behavior and compare the consistency with the observable values of the system; S2: Design an I / O interface channel observer and use the consistency observation theory to detect whether the software behavior is legal in real time; defined as represents the output observed by the system under action a, J represents the current state space, and the state set is expressed as Updates are performed after a certain delay or when the system input occurs. When it is displayed, it means that an illegal situation has occurred and the output cannot be made. At this time, the software is faulty. S3: Inject faults into the model and use typical mutation operators to generate defective codes. After executing these codes, detect and generate faulty versions and environmental parameters to form a test case set. S4: Execute the test case, obtain the execution path of the program body through program instrumentation technology, and extract coverage data using coverage analysis algorithm; S5: Construct a convolutional neural network and determine the model parameters through training; S6: Use the trained convolutional neural network to locate the faults of the program under test and output a list of suspicious error signatures r vi (i=1,2,...,m)∈[0,1], represents the corresponding execution statement s i (i=1,2,...,m) has the probability of defects, so according to r vi The size of the value finds the corresponding execution statement s i , thus achieving real-time fault location.
2. A method for diagnosing software faults in a train operation control system according to claim 1, characterized in that: Specifically, S1 is described in the form of a timed automaton as follows: the system can be defined as a sextuple A = (S, S0, ∏, X, I, E), where S represents the system state, S0 represents the system initial state, ∏ represents a symbol, X represents a clock variable, I is a mapping between state S and clock constraints, and E represents system state migration.
3. A method for diagnosing software faults in a train operation control system according to claim 1, characterized in that: The specific steps in S5 include: S501: Determine the neural network structure, including the input layer, convolution layer, pooling layer, and activation function; S502: Initialize the neural network, input the learning rate η, the termination threshold accuracy ε, and the maximum number of iterations N max , and randomly initialize the model parameters in the range of [-1,1]; S503: Start iterative training, randomly select a training sample from the training set C(X,T), and calculate its actual output Y=f(W n×j X+b), where the sample input is X=[x1,x2,...,x n ] T , Represents the weight in the neural network, and the actual output is Y=[y1,y2,...,y m ] T ; S504: The expected output is Z = [z1, z2, ..., z m ] T Calculate the output error And perform error back propagation; S505: Update model parameters W n×j , and recalculate the output Y for all samples and update the global error E; S506: Determine the termination condition, when the termination threshold accuracy ε or the maximum number of iterations N is reached max The algorithm is terminated when , otherwise it returns to step S503.
4. A method for diagnosing software faults in a train operation control system according to claim 3, characterized in that: The step of determining the convolutional neural network structure in S501 is specifically as follows: S501.1: Input layer neuron calculation: The size of the training data set is d×n, where d represents the width and n represents the number of test cases. The number of input layer neurons num=d×j=(n δ +n func )×j, where j represents the selection of j inputs from n test cases, n δ Represents the total number of constraints in the program branch, n func Indicates the number of functions that do not contain branches; S501.2: Convolution layer: The convolution layer extracts local features of the data through the convolution kernel, using a 3-layer convolution structure and a 10×10 convolution kernel; S501.3: Pooling layer: The pooling layer can reduce the complexity of the model, prevent the model from overfitting, and adopt the maximum subsampling method; S501.4: Activation function selection: ReLU activation function is used, which can be expressed as 5. A method for diagnosing software faults in a train operation control system according to claim 3, characterized in that: The setting of the learning rate in step S502 adopts a dynamically adjusted learning rate to accelerate the convergence speed of the model. The initial value is set to 0.01, and it is updated during the training process according to the following formula: η=η·R (epoch+1) / epochrate , where R represents the learning rate modification amplitude, which is set to 0.96, epoch represents the number of training times, and epochrate represents the frequency of changing the learning rate, which is set according to the size of the test case.
6. A method for diagnosing software faults in a train operation control system according to claim 3, characterized in that: In step S504, the error is back-propagated to dynamically adjust the weights so that the weights decrease in the direction of the negative gradient, as follows: Output layer and hidden layer weight correction In j and Out j Respectively represent the jth neuron input and output in the hidden layer; the weight correction of the input layer and the hidden layer
Citation Information
Patent Citations
Fault Diagnosis Method for Train Control Onboard Equipment Based on Long Short-Term Memory Neural Network
CN108536123B
SaaS software fault diagnosis method and device based on convolutional neural network
CN111198817A