# An Intelligent Planning-Based Modeling Method for Diagnosis and Repair

Authors: Chuang Li; Dantong Ouyang; Xiaoyu Wang; Wei Wei
Journal: Wireless Communications and Mobile Computing
 (2020)

---

## Abstract

Planning and model-based diagnosis are both branches of artificial intelligence. In model-based diagnosis, multiresults may be gotten which lead to an uncertain diagnosis. We use the landmark method from planning to designing an event sequence to get a reaction. A method that uses planning to repair in local results of incremental diagnosis is proposed. Firstly, a model is established on model-based diagnosis and planning. Incremental diagnosis results are used as the initial state of planning, and the heuristic search method is used to find the solution to an unfaulty state. Two algorithms with different strategies are designed for diagnosis and repair: one is to repair all possible faults and use controllable events to repair them, and the other is to test through the feedback of controllable events and observable events to get the only solution and repair them. At the same time, the efficiency of the incremental diagnosis method is improved based on heuristics.


---

## Body

## 1. Introduction

AI planning and model-based diagnosis are developing at the forefront of AI research. Diagnostic problems originate from medicine and then extend to the detection of equipment failure or behavior deviation. As machinery equipment gradually replaces manual work, the significance of safety is gradually highlighted, so the broad diagnosis problems are also paid attention to in the field of control and artificial intelligence [1]. Model-based diagnosis is a diagnostic method of common reasoning based on the equipment model and behavior. Because of its low equipment dependence and high efficiency, it has developed rapidly in theory and application since it was put forward.The model-based diagnosis method was originally used in static systems [2]; then, the conflict-based method was used in other problems such as knowledge representing [3] and planning [4]. After the system shutdown, the fault of the current system was inferred based on the online observations. However, as the scale of equipment increases, the behavior becomes more and more complex and the loss caused by shutdown increases. The dynamic diagnosis that can be monitored online is put forward [5, 6] and has been extended to various industries.The goal of dynamic diagnosis is to discover the possible faults online and present the faults and their causes as the results; the results are useful to the industrial system [7, 8]. Furthermore, when the system failure is identified, we hope the system can be effectively intervened and repaired online [9]. Intelligent repair of the system is the follow-up work of fault diagnosis, which further improves the security of the system.Dynamic model-based diagnosis methods are usually based on discrete event system models, which decompose the behavior of the system into persistent states and abrupt events [10]. Faults are defined as special events. When running online, only part of the system’s behavior can be detected, which is called an observable event. The diagnostic system infers whether there is a fault in the current state of the system according to the discrete event system model and the sequence of observable events. If there is a fault in the system, the process of the system’s behavior given by the diagnostic results is a path in which states are triggered by events. Diagnosis usually assumes that the fault is a persistent fault, that is, when the fault occurs, without interference, the fault will not disappear by itself. Then, the fault is repaired from the fault state to the nonfault state through controllable events in the device.When the system failed, the diagnostic system tries to use controllable events to repair it [11], and we hope these faults can be attached. Path planning uses state and action to describe the current environment and system and accomplish the expected tasks. The path planning method is combined with the diagnosis model. The planning method is used to design a path from a faulty state to unfaulty, and by the landmark, incremental diagnosis is provided a heuristic value. On the result of the dynamic diagnosis, the fault is repaired by using path planning through controllable events and known models of the system. The merging strategy in the field of gesture recognition is used for reference; the gestures are collected by different equipment but used by the same framework [12–16].The article is organized as follows: Section2 defines the model framework; Section 3 gives the process of diagnosis and planning; Section 4 gives the corresponding algorithm; Section 5 is the experimental results.


## 2. Model

A discrete event system is used to model dynamic diagnosis and map from real world to logical system. Firstly, the basic model is established.Definition 1 (model).
Model is defined as a five-tupleG=Q,E,T,I,F, in which Q is a finite state set, E is a finite event set, T is a transition set, T⊆Q×E×Q, I is an initial state set, I⊆Q, and F is a final state set, F⊆Q.State is usually in the process of system stability. Event represents the behavior of the system, which is instantaneous relative to the state. Transfer represents the process in which the system is triggered by the behavior from one continuous state to another state. Event triggering may be passive or active.In classical diagnostic methods, event sets are usually divided into three subsets according to their properties: observable event setEo, normal unobservable event set En, and faulty event set Ef, and they satisfy E=Eo∪En∪Ef,Eo∪En=∅,Eo∪Ef=∅,En∪Ef=∅. If the system can directly change the state of the system by controlling some events, the event set also includes such special events.Definition 2 (controllable events).
Controllable events are events that can be controlled and executed by the diagnostic system, marked asEc, Ec⊆E.Through controllable events and models, the faults are repaired. A path is formed in the model.Definition 3 (trajectory).
Trajectorys is the transfer sequence of state triggered by events s=<q0,e0,q1⋯qn>, and ∀t,t=qi×ei+1×qi+1,t∈T, SG is defined as the set of all possible trajectories on model G.In actual operation, the system is carried out along a certain trajectory. Some of the events in the trajectory are visible, collected by the diagnostic system, and searched in the predefined model to obtain the determined trajectory. If there is a fault event in the trajectory, the system is considered to be in a fault state. The incremental search path planning is used to repair and restore the system to a normal state.Definition 4 (repair path).
Repair path is an extension of the model, defined as a three tupleR=Gp,Qstart,Qgoal, among which, Gp is a local system model, Gp=Qp,Ep,Tp, and Qp⊆Q,Ep⊆E,Tp⊆T; Qstart is the finite state set with fault label, Qstart⊆Q,∀q∈Qstart,q=q×ef0,ef1⋯efi; Qgoal is the finite state set with fault label, Qgoal⊆Q,∀q∈Qgoal,q=q×∅.The repair path is generated according to the diagnoses, and the initial state is obtained fromQstart. According to the model using the incremental method in reverse, the heuristic search is conducted. The path composed of controllable events is obtained, and the local system model is generated. Finally, the set Qgoal is obtained, the system is restarted, and the diagnosis is made.The system is event-driven, and the possible sequence of events is defined as the language of the system.Definition 5 (language).
Language on systemG is a sequence of possible events LG=<ei∗>,ei∗∈2E.
In practice, only part of the behavior in the system can be observed, which is a sequence of observable events corresponding to the model.Definition 6 (observable mapping).
Observable mapping is defined between event sets and observable event sets.(1)Poe=ee∈Eo,εe∈E\Eo.
Observable mappings are defined linguistically.(2)Pol=Pol′e=Pol′Poe.
And further, observable mappings are defined on trajectories.(3)Pos=Pos′eiqi=Pos′Poei.The sequence of observation events actually obtained during the system operation is recorded asObs. The same mapping can also be defined between the event set and the fault event set. Conversely, the inverse mapping of an observable mapping is defined as a set of languages.Definition 7 (observable inverse mapping).
Po−1l′=l∣Pol=l′.
The relationship between observable mapping and inverse mapping is not a one-to-one correspondence, and there may be more than one path to repair faults through controllable events, but a fault-free state can be reached, which is acceptable to the diagnosis system.Definition 8 (fault label).
Fault label is a set of fault events,l=ei∣ei∈Ef.
The state carries one or more fault labels, which are normal if and only if all fault labels are empty sets. Otherwise, it will be a failure state. When the diagnosis system gets the conclusion of the fault, the fault path will be given, which is actually the state-event sequence with the fault label.Controllable events confirm repair by modifying the fault label in the state, so adding and deleting effects are set for controllable events. In the stateq, if triggered by controllable events, the adding effect of controllable events is set to reduce or increase the fault label of the state and transfer the state. The deletion effect of controllable events is set to withdraw from the target state to the current state and add or subtract the fault label of the current state.Definition 9 (diagnosis).
Diagnosis is defined as a compatible path between model and observationΔG,Obs=s∣s∈SG,Pos=Obs.The diagnosis is definitive, but in the actual system, sensors are limited, leading to more than one diagnosis. If only one result is needed, the most probable diagnoses will be chosen from the candidate set. But when the choice is wrong, the diagnosis will backtrack and choose another. The backtrack will depress the efficiency, so we use a landmark as a heuristic function to improve the chosen procedure.Definition 10 (landmark).
A landmarkqm in diagnosis is a state with a value, qm=q×n,q∈Q,n∈ℕ+.
The landmark is used to mark the state which leads to more than one trajectories; the value in the state expresses how many times the state is passed.A path is obtained by the diagnosis. When the paths contains a fault event, the subsequent fault status label must contain the event. Searching forward from path s, when there is a path that can get a nonfault state through controllable events, the fault is considered to be repaired. The repair behavior is defined as in the model. An example is given to explain the definitions.The digraph in Figure1 is a model with Q=q0⋯q7, E=e0⋯e5, T=q0×e0×q2,⋯q5×e5×q6, I=q0, and F=q6,q7. The controllable events can be some special events that can change some states. In the example, it can be e3. s=q0e0q2e2q7 is a trajectory. If q5 is a faulty state, q1 is a normal state; a trajectory which contains t=q5e4q1 may be a repair path. Events in a trajectory can be a language, e1e3e5 is a language, but a prefix e1e3 is a language. In event set E, if e3 is observable, the observable map of language e1e3e5 is e3, and the observable inverse mapping of e3 is e1e3e5 and e1e2e4e3. If the event e5 is faulty, the state q6 has a label of fault e5, q6e5. The diagnoses of Obs=<e3> will be q0q1q4q6 and q0q1q3q5q1. Some of the states at the key position is defined as a benchmark, such as q1.Figure 1
An example of a model.


## 3. Method

Discuss the diagnosis and repair of the system using the planning method according to the situation. The incremental method is used to diagnose the system. With the arrival of the observation, one or more diagnostic results may be produced at a time, and the diagnostic results may or may not contain faults. There are four situations as follows:(1)
There is only one diagnosis result, which does not include fault. Keep the current path and wait for the next observation(2)
There is only one diagnosis result, which includes the fault. Path planning based on the heuristic search is carried out from the final state of diagnosis results until a repair path is found(3)
There are many diagnostic results, which do not include faults. The heuristic method is used to select a path as the diagnosis result and continue to wait for the next observation(4)
There are many diagnostic results, including faults. Combined with the multiobjective programming method, the paths that may cover the most diagnostic results are tested. After determining the only fault path, it is repairedThe first case and the third case have been solved in incremental diagnosis, so they are not considered in this paper. Next, we will discuss the situation (2) and (4). They both occur one or some faults that should be repaired, so a planning path should be deduced. The controllable events will carry other behaviors to change the path. So when the planning path is found, the system can be repaired or done some different behaviors.


### 3.1. Single Candidate Trajectory

When the diagnosis only obtains one trajectory and there is a fault event in the trajectory, go backward from the current model and search for possible repair trajectories. The heuristic search method for multiple target paths is used.The initial stateQstart of the repair path is determined. Only one path in the single candidate path is compatible with the observation. Then, the final state q of the current diagnosis trajectory is selected into the set Qstart. The goal is to obtain the local model Gp=Qp,Ep,Tp, to make the repair path R=Gp,Qstart,Qgoal, and q∈Qstart.With elements in the setQstart as the initial state, the controllable events are searched for an extension. The controllable event defines its heuristic value according to the difficulty of its control, adds or deletes the fault label of the state according to the adding or deleting effect of controllable events, and generates the trajectory. In the process of searching, the model G is regarded as the global environment, and the local model Gp that has been obtained is regarded as the local environment. Control events may change the local environment and transfer the state to a specific follow-up state. Incremental methods are used to deal with the search problem in a variable environment.The search begins in the open table. Controllable events are added according to heuristic values, and the impact on current status fault labels is judged. When a state without a faulty label is obtained, it is added toQgoal. As a final state, all controllable event sequences from Qstart to Qgoal constitute a path, which is a repair sequence.


### 3.2. Multiple Candidate Trajectories

Multiple candidate trajectories have the same observation sequence, but they contain different faults. Therefore, before repairing, a test is carried out as far as possible through controllable events, and the set of candidate trajectories is reduced. A unified or compatible repair path can be obtained by multiobjective programming on the reduced set of paths.If the current set of candidate diagnostic trajectories isSi and the observation sequence is Obsi, then ∀si∈Si,Posi=Obsi. The initial states of the trajectories are the same and the fault labels of the states are different. The repair path Ri=Gp,Qstart,Qgoal. The final states of all diagnostic trajectories are added to the initial state set Qstart of the repair path. Controllable events are used to test the trajectories, and the candidate diagnostic trajectories are further distinguished according to the observations returned again. There may be more than one state in Qstart and more controllable events that can be selected. The controllable events where adding effects can reduce the maximum number of failure events are selected.That is, inQstart, there are multiple states and their fault labels q0×l00,l01,⋯qn×ln0,ln1. Among all controllable event sets that can trigger states, the controllable events that can delete the most faults should be selected. At this time, two kinds of methods are considered for the properties of the system: (1) All repairs are made directly through controllable events until they are fully restored to a normal state. (2) Candidate diagnostic sets are tested by controllable events, and the candidate diagnostic sets are reduced according to the observations obtained from the interaction. The problem is reduced to the repair problem of a single candidate trajectory. Next, we will discuss the situation further.


#### 3.2.1. Multiple Candidate Repair

If the current set of candidate diagnostic paths isSi and the observation sequence is Obsi, the initial state set Qstart of repair is the final state set of all paths, and it has a fault label. For ∀q∈Qstart, all controllable events and adding effects are generated, and events that can produce maximum additive effects are selected. The corresponding state in Qstart is replaced, and the replacement process is added to model Gp. The above process is repeated until all the states in Qstart are normal. The relationship between each candidate diagnostic trajectories is “and.” The final state set generates Qgoal.


#### 3.2.2. Test and Repair

In the current final state of candidate trajectories, all controllable events and adding effects are generated. If∃ec∈Ec enables at least two paths to produce different observable events, then the event is controlled. In the effective time, if the determined observation events are obtained, the corresponding paths are retained and other paths are deleted. The process is repeated until the only diagnosis result can be selected, and then, the repair of a single candidate path is dealt with.


### 3.3. Landmark and Heuristic Incremental Diagnosis

When the model becomes more complex, diagnosis based on an overall model will be more difficult. Then, the incremental method was proposed by [17]; the diagnosis is gotten incrementally. Incremental diagnosis is gotten from a part of the model and corresponding observations and expresses as the newest result, when another new observations are gotten, the diagnosis will be updated upon the last diagnosis.But when the multiple trajectories appear, some periodical diagnoses are wrongly chosen, some incremental method backtrack to initial state, and some method backtrack to a former state. If we want to improve the efficiency, we need to reduce the number of backtracks.To any paths, if there is a set SG, such that ∀s∈SG,SG=s∣Pos=Posi, it gives the basic heuristic value a to the end states in paths, and the heuristic value of the set is a2. When the diagnostic system runs, the heuristic value a is changed by the chosen times and backtrack times.We use the heuristic value to get a more possible trajectory: at the beginning of diagnosing, the value depends on the number of the trajectories with the same observations, and when the diagnostic system begins to run, the value depends on the number of trajectories was passed. Once backtrack happened in one chosen trajectory, the value will be reduced, and when the recovery planning passes the trajectory, the value will be increased.The heuristic value is used in diagnosis and planning, which accelerates the diagnostic process. The experiments will be given in part 5.


## 3.1. Single Candidate Trajectory

When the diagnosis only obtains one trajectory and there is a fault event in the trajectory, go backward from the current model and search for possible repair trajectories. The heuristic search method for multiple target paths is used.The initial stateQstart of the repair path is determined. Only one path in the single candidate path is compatible with the observation. Then, the final state q of the current diagnosis trajectory is selected into the set Qstart. The goal is to obtain the local model Gp=Qp,Ep,Tp, to make the repair path R=Gp,Qstart,Qgoal, and q∈Qstart.With elements in the setQstart as the initial state, the controllable events are searched for an extension. The controllable event defines its heuristic value according to the difficulty of its control, adds or deletes the fault label of the state according to the adding or deleting effect of controllable events, and generates the trajectory. In the process of searching, the model G is regarded as the global environment, and the local model Gp that has been obtained is regarded as the local environment. Control events may change the local environment and transfer the state to a specific follow-up state. Incremental methods are used to deal with the search problem in a variable environment.The search begins in the open table. Controllable events are added according to heuristic values, and the impact on current status fault labels is judged. When a state without a faulty label is obtained, it is added toQgoal. As a final state, all controllable event sequences from Qstart to Qgoal constitute a path, which is a repair sequence.


## 3.2. Multiple Candidate Trajectories

Multiple candidate trajectories have the same observation sequence, but they contain different faults. Therefore, before repairing, a test is carried out as far as possible through controllable events, and the set of candidate trajectories is reduced. A unified or compatible repair path can be obtained by multiobjective programming on the reduced set of paths.If the current set of candidate diagnostic trajectories isSi and the observation sequence is Obsi, then ∀si∈Si,Posi=Obsi. The initial states of the trajectories are the same and the fault labels of the states are different. The repair path Ri=Gp,Qstart,Qgoal. The final states of all diagnostic trajectories are added to the initial state set Qstart of the repair path. Controllable events are used to test the trajectories, and the candidate diagnostic trajectories are further distinguished according to the observations returned again. There may be more than one state in Qstart and more controllable events that can be selected. The controllable events where adding effects can reduce the maximum number of failure events are selected.That is, inQstart, there are multiple states and their fault labels q0×l00,l01,⋯qn×ln0,ln1. Among all controllable event sets that can trigger states, the controllable events that can delete the most faults should be selected. At this time, two kinds of methods are considered for the properties of the system: (1) All repairs are made directly through controllable events until they are fully restored to a normal state. (2) Candidate diagnostic sets are tested by controllable events, and the candidate diagnostic sets are reduced according to the observations obtained from the interaction. The problem is reduced to the repair problem of a single candidate trajectory. Next, we will discuss the situation further.


### 3.2.1. Multiple Candidate Repair

If the current set of candidate diagnostic paths isSi and the observation sequence is Obsi, the initial state set Qstart of repair is the final state set of all paths, and it has a fault label. For ∀q∈Qstart, all controllable events and adding effects are generated, and events that can produce maximum additive effects are selected. The corresponding state in Qstart is replaced, and the replacement process is added to model Gp. The above process is repeated until all the states in Qstart are normal. The relationship between each candidate diagnostic trajectories is “and.” The final state set generates Qgoal.


### 3.2.2. Test and Repair

In the current final state of candidate trajectories, all controllable events and adding effects are generated. If∃ec∈Ec enables at least two paths to produce different observable events, then the event is controlled. In the effective time, if the determined observation events are obtained, the corresponding paths are retained and other paths are deleted. The process is repeated until the only diagnosis result can be selected, and then, the repair of a single candidate path is dealt with.


## 3.2.1. Multiple Candidate Repair

If the current set of candidate diagnostic paths isSi and the observation sequence is Obsi, the initial state set Qstart of repair is the final state set of all paths, and it has a fault label. For ∀q∈Qstart, all controllable events and adding effects are generated, and events that can produce maximum additive effects are selected. The corresponding state in Qstart is replaced, and the replacement process is added to model Gp. The above process is repeated until all the states in Qstart are normal. The relationship between each candidate diagnostic trajectories is “and.” The final state set generates Qgoal.


## 3.2.2. Test and Repair

In the current final state of candidate trajectories, all controllable events and adding effects are generated. If∃ec∈Ec enables at least two paths to produce different observable events, then the event is controlled. In the effective time, if the determined observation events are obtained, the corresponding paths are retained and other paths are deleted. The process is repeated until the only diagnosis result can be selected, and then, the repair of a single candidate path is dealt with.


## 3.3. Landmark and Heuristic Incremental Diagnosis

When the model becomes more complex, diagnosis based on an overall model will be more difficult. Then, the incremental method was proposed by [17]; the diagnosis is gotten incrementally. Incremental diagnosis is gotten from a part of the model and corresponding observations and expresses as the newest result, when another new observations are gotten, the diagnosis will be updated upon the last diagnosis.But when the multiple trajectories appear, some periodical diagnoses are wrongly chosen, some incremental method backtrack to initial state, and some method backtrack to a former state. If we want to improve the efficiency, we need to reduce the number of backtracks.To any paths, if there is a set SG, such that ∀s∈SG,SG=s∣Pos=Posi, it gives the basic heuristic value a to the end states in paths, and the heuristic value of the set is a2. When the diagnostic system runs, the heuristic value a is changed by the chosen times and backtrack times.We use the heuristic value to get a more possible trajectory: at the beginning of diagnosing, the value depends on the number of the trajectories with the same observations, and when the diagnostic system begins to run, the value depends on the number of trajectories was passed. Once backtrack happened in one chosen trajectory, the value will be reduced, and when the recovery planning passes the trajectory, the value will be increased.The heuristic value is used in diagnosis and planning, which accelerates the diagnostic process. The experiments will be given in part 5.


## 4. Algorithm and Explanation

Online diagnosis and repair mainly include three parts: compilation of offline models, diagnosis based on online observation, and repair based on the diagnosis. Offline model compilation generates fault labels based on models. Online diagnosis uses incremental methods. Diagnosis and repair include two strategies: repair all possible paths and verify the repair of a single path by testing. The relationship of the following methods is described in Figure2.Figure 2
The relationship of the methods.Firstly, the whole algorithm is given.Algorithm 1: Dia and Rec.
Input: System modelG=Q,E,T,I,F, Observation sequence Obs=<obs0,obs1⋯.>.Output: Diagnostic resultsΔ0,Δ11.Gf=CompG    //Add fault labels to the model2. whileObs≠∅3.Δi=DiaGf,obsi    //Diagnose the model4.if∃ef∈Δi5.RecGf,Δi    //If there is a fault, repair it6.ReturnΔ=Δ0Δ1⋯    //Return all diagnostic resultsNext, the key algorithms are described in detail. Firstly, offline compilation is carried out according to the model to generate fault labels. Based on the computational diagnosability method, the fault label is generated. On the basis of the computation diagnosability method, fault labels are generated.Algorithm 2: Comp.
Input: System modelG=Q,E,T,I,FOutput: Model with fault labelGf=Q×L,E,T,I,F×L1. Initialization:BI=I,Qf=q∣q=q×l×v,l=∅,v=02.WhileBI≠∅BI⊈F3.∀q∈BI,∃t=q×e×q′4.ife∈Ef5.ifv′==06.l′=l′∪e7.else8.l′=l′×e9.BI=BI−q∪q′10. Return GfThe algorithm Comp generates a model with fault label in the offline state. In the online process, if the state with fault label is obtained from the observation, the current system is in a fault condition. The algorithm of online incremental diagnosis is as follows:Algorithm 3: Dia.
Input: Model with fault labelGf=Q×L,E,T,I,F×L Real-time observation sequence Obs=<obs0,obs1⋯obsi⋯>Output: Candidate diagnostic resultsΔi1. Initialization:QI=I,QF=∅,S=∅2.∀q∈Q,s=<q,e0,⋯q′>3.ifPos==obsi4.S=S∪s5.s′=ChooseS    //choose the most possible path6.QF=qn′7.QIi+1=q0′8.Δi=SIn fact, multiple candidate diagnostic trajectories may be obtained for each diagnosis. According to heuristics or other principles, the only path is selected as the result of this diagnosis. The initial state of the next diagnosis result is set to the final state of this diagnosis result. When there is a fault state in the diagnosis result, it is repaired. The repair algorithm Rec is given. According to the strategy of repairing all possible faults or the unique path obtained by a test, two algorithms are given: Rec1 (repair all possible faults) and Rec2 (repair the unique path obtained by a test).Algorithm 4: Rec1.
Input: Model with fault labelGf=Q×L,E,T,I,F×LReal-time observation sequenceObs=<obs0,obs1⋯obsi⋯>Current diagnostic resultsΔiOutput: Repair pathSc1. Initialization:Sc=∅,Nq=∅2.ifΔi>13.∀s∈Δi,Nq=q∣s=<q0e0q1⋯q>    //Get the final state of the trajectory4.while∀q∈Nq,lq≠∅5.ec=Chooseq    //Select the control event with maximum adding effect6.Gc=ChangeNq,ec    //Update status and delete faults7.Sc=Scec     //Record a sequence of controllable events8.ifDeadNq     //If it cannot be expanded9.BackNq,ec     //Backtrack and recover failures10.Sc=Sc−ec11.if∄Sc       //If there is no path to full recovery12.Sc=maxΔi,break       //Choose the diagnosis with the greatest heuristic value and quit multi-fault repair13. else14.s=<q0⋯q>,Nq=q      //Get the final state of the path15.whilelq≠∅16.Sc=FindNq,ec      //Get the repair status of the path17.if∄Sc18.    Return Fail       //If the repair path cannot be found, fail to exitIf it is a single candidate fault trajectory, a trajectory composed of control events is returned. If the control system triggers controllable events in turn, the fault can be repaired. If the control system triggers controllable events in turn, the fault can be repaired. If there are multiple candidate fault paths, multiple paths may cross or be independent are returned. If the control system triggers controllable events in turn, all possible faults can be repaired. If no control event can be found to repair all candidate diagnostic trajectories, the trajectory with the highest heuristic value is selected and the single candidate fault path is processed instead.Another method uses heuristic values to select candidate diagnostic trajectories and reduces the set of candidate diagnosis according to the feedback observations until the only diagnostic result is obtained. On this result, the fault is repaired.Algorithm 5: Rec2.
Input: Model with fault labelGf=Q×L,E,T,I,F×LReal-time observation sequenceObs=<obs0,obs1⋯obsi⋯>Current diagnostic resultsΔiOutput: Repair resultsSc1. Initialization:Sc=null,Nq=∅,w=∅,Δ′=∅2.whileΔi>13.∀s∈Δi,Nq=q∣s=<q0e0q1⋯q>4.ec=Chooseq     //Choose the path with the most different observations5.Doec6.w=Nextobsi7.Δ′=DiaΔi,w      //New diagnosis is obtained according to new observations8.Δi=DeleteΔi      //Update candidate diagnostic results9.whilelq≠∅10.Sc=FindNq,ec      //Get the repair status of the path11.if∄Sc12.    Return FailAccording to the continuous feedback observation, the candidate diagnosis set is reduced, and the only diagnosis trajectory is finally obtained, and then, the repair is carried out. Compared with the algorithm Rec1, Rec2 takes a long time to interact continuously, and controlling controllable events for testing may consume more time or system workload. However, when Rec2 has more candidate diagnostic paths, the size of the path set is reduced by testing, and the amount of computation is less. Rec1 is prone to generate more branches, which eventually leads to calculation failure.Rec1 and Rec2 select in the current set of candidate diagnostic trajectories and select controllable events for the next step. The heuristic method is chosen to evaluate the current trajectory. In Rec1, the principle of choosing controllable events is to cover as many paths as possible and repair more faults. In Rec2, the principle of choosing controllable events is to generate as many different observations as possible, so as to distinguish candidate diagnosis trajectories and reduce the set of candidate diagnosis trajectories.Next, the above methods are tested to get the time and space complexity of the algorithm. The efficiency of repair results of the Rec1 method and the Rec2 method under different conditions (such as the controllable number of events and controllable event efficiency) is compared.


## 5. Experimental Results and Analysis

In this paper, the experimental machine configuration is as follows: processor: Inter i7-6700, 3.4 GHz, memory: 8 GB RAM, Window7 Home 64-bit operating system.


### 5.1. Test Problem Description

The frameworks of three tanks were used in the data set, but the behavior set was expanded, and the controllable event set was added. Using the simulation model to test, the current system hasM states and N events, among which the number of normal events, observable events, and fault events is N1, N2, and N3, respectively, the number of controllable events is Nc, the execution time is tc, and the time of generating and acquiring observable events is to. Generating model G is complete and diagnosable, real-time observation timing is normal, and controllable event control is normal.In the process of running, the model randomly chooses the trajectory to advance and generates the corresponding observation as output. After receiving the observation, the diagnosis system diagnoses the model. After obtaining the fault, it is repaired according to algorithm Rec1 and Rec2, respectively. The efficiency of the Rec1 algorithm is divided into two parts: calculating the time and space efficiency of repairing path, the time efficiency of control event execution, and heuristic selection of controllable events with the most repair states. The efficiency of the Rec2 algorithm includes the overall test path, the time and space efficiency of the calculation and repair, and heuristic selection of controllable events that cause the most different observations.


### 5.2. Analysis of Experimental Results

The test is divided into two parts. Table1 shows the efficiency of using algorithms Rec1 and Rec2, respectively, when M:N1:N2:N3:Nc=10:5:3:2:3,tc=1s,to=0.2s. The time efficiency of Rec1 is divided into two parts. The generated models may be different, so the time is the average value of multiple models.Table 1
Time efficiency of diagnosis and planning methods.
Time (s)Rec1Rec2CalculationControlM=10<0.0011.061.24M=500.023.313.68M=1000.496.117.02M=10001.9813.7615.99M=50004.3939.2044.11M=100009.8372.15108.65The time of Rec1 is mainly spent on controllable events. If the time of controllable events is small, the choosing Rec1 is more reasonable. The time of Rec2 is mainly spent on controllable events and in waiting for further observation events. If the critical valuen of system diagnosability is small, the choice of Rec2 is more reasonable.Table2 shows the ratio of state to event when M=1000 and the time efficiency of diagnosis and repair under the same scale model when controllable events and observation time change. The former value is the time efficiency of using Rec1, and the latter value is the time efficiency of using Rec2.Table 2
Time efficiency with different percentages of different kinds of events.
M:N1:N2:N3:Nctc=1to=0.2tc=1to=0.5tc=1to=1tc=0.2to=0.2tc=0.5to=0.210 : 5 : 3 : 2 : 315.74/15.9915.74/26.4515.74/28.236.56/9.628.28/10.1310 : 10 : 3 : 1 : 316.01/16.6316.01/20.0616.01/21.547.01/8.968.83/11.0410 : 10 : 5 : 2 : 112.06/12.3412.06/22.3512.06/24.916.89/8.777.96/9.29Similarly, under the same proportion of event states, the time complexity of using Rec1 and Rec2 remains unchanged. When the ratio ofM:N1+N2+N3 is larger, the path branches are usually less and the diagnosis efficiency is higher. When the proportion of observable events is higher, the diagnostic efficiency is relatively high because there is relatively little backtracking. When the proportion of controllable events is higher, there are more candidate events. And there is less backtracking when using the Rec1 method, and the efficiency is higher. When the ratio of M:N1+N2+N3 is small, there are more branches and the same diagnosis efficiency is relatively low.


### 5.3. Contrast of Heuristic Diagnosis and Incremental Diagnosis

We contrast the heuristic diagnosis with the landmark and the normal incremental diagnosis; three kinds of model are used: the normal model, the long chain with short local model, and the short chain with long local model. The results are shown in Figures3–5. The blue line is the normal incremental method, and the red dotted line is the landmark method.Figure 3
Contrast of basic model.Figure 4
Contrast of long chain with short model.Figure 5
Contrast of short chain with long model.It can be seen from the comparison of Figures3–5, the heuristic algorithm of using landmark improves the efficiency of diagnosis in different types of models. In incremental diagnosis, the new diagnoses begin from the former result. But when the former result was wrong, the real faults will not be obtained and backtrack will occur. The landmark is used to define the heuristic value to the diagnostic trajectories and reduce the time complexity.Since the landmark is used to choose a trajectory, the backtrack caused by misdiagnosis is reduced. In the model according to Figure4, more backtrack is avoided, so the method of the landmark is more efficient.


## 5.1. Test Problem Description

The frameworks of three tanks were used in the data set, but the behavior set was expanded, and the controllable event set was added. Using the simulation model to test, the current system hasM states and N events, among which the number of normal events, observable events, and fault events is N1, N2, and N3, respectively, the number of controllable events is Nc, the execution time is tc, and the time of generating and acquiring observable events is to. Generating model G is complete and diagnosable, real-time observation timing is normal, and controllable event control is normal.In the process of running, the model randomly chooses the trajectory to advance and generates the corresponding observation as output. After receiving the observation, the diagnosis system diagnoses the model. After obtaining the fault, it is repaired according to algorithm Rec1 and Rec2, respectively. The efficiency of the Rec1 algorithm is divided into two parts: calculating the time and space efficiency of repairing path, the time efficiency of control event execution, and heuristic selection of controllable events with the most repair states. The efficiency of the Rec2 algorithm includes the overall test path, the time and space efficiency of the calculation and repair, and heuristic selection of controllable events that cause the most different observations.


## 5.2. Analysis of Experimental Results

The test is divided into two parts. Table1 shows the efficiency of using algorithms Rec1 and Rec2, respectively, when M:N1:N2:N3:Nc=10:5:3:2:3,tc=1s,to=0.2s. The time efficiency of Rec1 is divided into two parts. The generated models may be different, so the time is the average value of multiple models.Table 1
Time efficiency of diagnosis and planning methods.
Time (s)Rec1Rec2CalculationControlM=10<0.0011.061.24M=500.023.313.68M=1000.496.117.02M=10001.9813.7615.99M=50004.3939.2044.11M=100009.8372.15108.65The time of Rec1 is mainly spent on controllable events. If the time of controllable events is small, the choosing Rec1 is more reasonable. The time of Rec2 is mainly spent on controllable events and in waiting for further observation events. If the critical valuen of system diagnosability is small, the choice of Rec2 is more reasonable.Table2 shows the ratio of state to event when M=1000 and the time efficiency of diagnosis and repair under the same scale model when controllable events and observation time change. The former value is the time efficiency of using Rec1, and the latter value is the time efficiency of using Rec2.Table 2
Time efficiency with different percentages of different kinds of events.
M:N1:N2:N3:Nctc=1to=0.2tc=1to=0.5tc=1to=1tc=0.2to=0.2tc=0.5to=0.210 : 5 : 3 : 2 : 315.74/15.9915.74/26.4515.74/28.236.56/9.628.28/10.1310 : 10 : 3 : 1 : 316.01/16.6316.01/20.0616.01/21.547.01/8.968.83/11.0410 : 10 : 5 : 2 : 112.06/12.3412.06/22.3512.06/24.916.89/8.777.96/9.29Similarly, under the same proportion of event states, the time complexity of using Rec1 and Rec2 remains unchanged. When the ratio ofM:N1+N2+N3 is larger, the path branches are usually less and the diagnosis efficiency is higher. When the proportion of observable events is higher, the diagnostic efficiency is relatively high because there is relatively little backtracking. When the proportion of controllable events is higher, there are more candidate events. And there is less backtracking when using the Rec1 method, and the efficiency is higher. When the ratio of M:N1+N2+N3 is small, there are more branches and the same diagnosis efficiency is relatively low.


## 5.3. Contrast of Heuristic Diagnosis and Incremental Diagnosis

We contrast the heuristic diagnosis with the landmark and the normal incremental diagnosis; three kinds of model are used: the normal model, the long chain with short local model, and the short chain with long local model. The results are shown in Figures3–5. The blue line is the normal incremental method, and the red dotted line is the landmark method.Figure 3
Contrast of basic model.Figure 4
Contrast of long chain with short model.Figure 5
Contrast of short chain with long model.It can be seen from the comparison of Figures3–5, the heuristic algorithm of using landmark improves the efficiency of diagnosis in different types of models. In incremental diagnosis, the new diagnoses begin from the former result. But when the former result was wrong, the real faults will not be obtained and backtrack will occur. The landmark is used to define the heuristic value to the diagnostic trajectories and reduce the time complexity.Since the landmark is used to choose a trajectory, the backtrack caused by misdiagnosis is reduced. In the model according to Figure4, more backtrack is avoided, so the method of the landmark is more efficient.


## 6. Conclusion

Planning and model diagnosis are both symbolic branches of artificial intelligence. A method is proposed to merge the planning model and diagnosis model which is used to solve the fault testing and diagnosis acceleration. Based on the merged model, when an uncertain fault occurs, the landmark is used to generate a heuristic which leads to a better choice, and the controllable events are used to judge whether an event occurs or not. Two kinds of testing methods using controllable events are proposed to cater different cases. If the system has more expensive observation and less expensive controllable events, that means the system is easy to control and hard to observe; then, we use a controllable event to get a reaction. And another method is used to opposite case. A concept of a landmark in planning is used to generate a heuristic value, which accelerates diagnosis. When multiple diagnoses occur, the value will guide a better choice. If the testing method cannot get more observations or controllable events, the landmark can find a more precise result.In the process of online diagnosis, the most possible path is marked with landmarks to improve diagnosis efficiency. After obtaining the diagnosis results, the landmarks are used to control the planning process and select the possible repair path or test points. A diagnosis-repair framework is proposed. However, if there are few controllable events, even there are no controllable events, the planning will not be able to backtrack, repair, and detect. This method cannot be implemented, which is a disadvantage.



---

*Source: 8887933-2020-07-24.xml*