Keywords

1 Introduction

The state process of the simulation and training system is to describe the simulation and training process through abstracting the operation sequence or the operation rules of the weapon equipment and modeling the realistic and manageable state transition set based on the operation time and the logic. From the view of data flow, the state process transition is the process from one steady state to another steady state. There are two factors to decide the system state transition: one is the current system state, and the other is the event which causes the change of the system state.

The weapon equipment is more complex, the description of the system state transition is more difficult. The concrete manifestation is that: (1) The large system has the complex time, the logic relation and many keys; (2) One key has different meanings on different cases; (3) In order to accomplish one subject operation, some keys need to be combined input. So it is a difficult question to adopt an appropriate method to describe the system state transition in the field of the simulation and training system.

Now, the “if … then” method is adopted more for the system state transition. The method is simple, but has more shortcomings: (1) The program code is complex and lengthy; (2) The coupling phenomenon of the logic relation is serious; (3) It has bad module and hard debugging; (4) It is fit for the system state transition in the simple logic. So the system state process transition method is put forward based on the finite state machine. This method could describe the system transition process simply and clearly.

2 The Basic Concept of the FSM

The Finite State Machine is engineering application of the finite automatic machine and has been widely used in computer science, information coding theory and so on. It mainly describes the process behavior that one system or one object is transited from different states. Its mathematics concept is as follows:

The FSM M is an ordered set including five objects: \( M = \left\{ {S,I,O,f,g} \right\} \)

\( S = \left\{ {S_{1} ,S_{2} , \ldots ,S_{\text{n}} } \right\} \) :

is the state set;

\( O = \left\{ {O_{1} ,O_{2} , \ldots ,O_{\text{n}} } \right\} \) :

is the output set;

\( I = \left\{ {I_{1} ,I_{2} , \ldots ,I_{\text{n}} } \right\} \) :

is the input set;

\( f \) :

is the function from \( I \times S \) to \( S_{k} \);

\( g \) :

is the function from \( I \times S \) to \( O_{k} \);

From the view of the complex time and the logic relation, it could be expressed as follows:

$$ S_{i + 1} = f(I_{i} ,S_{i} ),\quad O_{i} = g(I_{i} ,S_{i} ) $$

The working principle is that: the state set \( S \) and the input set \( I \) is known. Once the current input \( I_{i} \) and the current state \( S_{i} \) are confirmed, the next state \( S_{i + 1} \) and the output \( O_{i} \) are confirmed on the effect of \( f \) and \( g \).

The core of the finite state machine is one object has one certain state at one certain moment. The transition between two states needs certain condition. When receiving one input (event), one output is confirmed and the transition happens.

So the finite state machine has distinct relation. The system which could apply the finite state machine also needs several conditions: (1) the system has several states which are finite; (2) the current state of the system is confirmed only by the last state and the input; (3) the system states are relatively stable and can keep invariable when no input. Above all, the finite state machine could describe the simulation and training system state process on operation-oriented effectively.

3 The System State Process Transition Method Based on the FSM

3.1 The Description of the System State Process

The object of study for the simulation and training system on operation-oriented is the weapon equipment. It emphasizes the operation sequence and the operation flow rather than the description of the electric, dynamic or machinery. In general the state process transition is shown in Fig. 1.

Fig. 1
figure 1

The system state process transition flow diagram

  1. (1)

    In certain stable state, the trainers press some buttons or switches at the simulating panel;

  2. (2)

    The system acquires the state change of the buttons or switches and saves it;

  3. (3)

    The system analyses the state change, judges the logic and output the result;

  4. (4)

    The output displays at the simulating panel (For example, some indicator light is on or off, or the instrument panels changes, or the display changes), then the system is at relatively stable state.

  5. (5)

    The trainers operate continuously. The system state process operates according to the 1–4 until the end of the operation.

3.2 The Realization of the System State Process Transition Based on the FSM

  1. 1.

    The system process transition model

    Taking example by the structure of the AI expert system, the system process transition model is designed based on the FSM which is shown in Fig. 2. The model is comprised of state database, inference machine, knowledge database and the human–machine interactive interface.

    Fig. 2
    figure 2

    The structure of the state process transition model

    1. (1)

      The human–machine interactive interface

      The human–machine interactive interface is the interface that the system exchanges with the outside. The interface has two tasks: getting the input (event) and outputting the next state.

      From the view of design, there are two channels to getting the output: one is the change of the buttons or keys when the trainers operate at the simulating panel, the other is to receive the training interactive information from other subsystem. The output displays the conclusion (system state) from the inference machine.

    2. (2)

      The state database

      The state database saves the finite state of the simulation and training process. According to the operation sequence of the weapon equipment, the system state process can be divided into several states. Every state has several basic elements: the state name, the time logical sequence and the state phenomenon. The state phenomenon which describes the states of the lights, keys or switches at some certain state is the core of the state database.

    3. (3)

      The knowledge database

      The knowledge database saves the elements which are to drive the system state process transition. Its elements includes: the last system state, the current system state, the next system state, the event and so on. When the inference machine gets the current system state and input (event), read the content of the knowledge database, and then the next system state could be confirmed. The knowledge database derives the content from the operation sequence of the weapon equipment and the logic, and saves it according to the structure of the knowledge database.

      The knowledge database adopts the mode of the state transition table. The state transition table shows the state transition logically. The basic pattern is shown that the current state (B) and the event (Y) confirm the next state (D). It is shown in Table 1. The state transition table focuses on the event, the current and the next state. This pattern has more feasibility and operability in software design.

      Table 1 The state transition table
    4. (4)

      The inference machine

      The inference machine implement. Through receiving the input (event) or the information from Ethernet, its main task is to search the state database and the knowledge database, choose the matching rule in the knowledge database, execute the rule to transmit the system state and output the result.

  2. 2.

    Design thoughts

    1. (1)

      The description of the operation sequence

      Detail the operation flow of the weapon equipment and fill in the corresponding the operation flow table. The operation flow table is used to describe the operation logic of the weapon equipment in overall processes. It should be detailed that could describe the logical relationship between the keys and the lights clearly.

    2. (2)

      The confirmation of the system state division and the event

      The system state is divided and confirmed according to the operation flow table. Obtain the input event and make the event as the system state division sign. The system state should be complete which includes all the states of the keys, switches, lights and so on.

    3. (3)

      Design the state database and the knowledge database

      Design the structure of the state database and the knowledge database. Fill in the system state and the input event into the corresponding database according to the definition of the database.

The state process transition flow design is shown in Fig. 3.

Fig. 3
figure 3

The state process transition flow diagram

4 The Application of the Simulation and Training System State Transition Method of Air-Defense Missile Based on the FSM

4.1 The Basic Structure of the Simulation and Training System

The simulation and training system for an air-defense missile is composed of the control unit, S vehicle simulation subsystem and the F vehicle simulation subsystem. The system is established adopting by semi-physical mode. “Industrial control computer + data acquisition card + signal conditioning circuit + operation panel” is adopted in hardware design. VC++ is adopted to realize the control, communication and transition in software design. Vega is adopted to simulate the radar display. MS Access is adopted to structure the database. Winsock is adopted to communicate with each subsystem.

4.2 Design and Realization

  1. 1.

    The operation and training module flow design

    The operation and training module is the core module of the software. Its task is to acquire the hardware state, judge the state transition and display the state. The UML use case diagram is shown in Fig. 4.

    Fig. 4
    figure 4

    The operation training module based on the UML use case diagram

  2. 2.

    The design of the hardware acquisition and control mode

    S vehicle simulation subsystem and the F vehicle simulation subsystem have hundreds of keys, switches, and the lights. If adopting the interrupt mode, there will be so many interrupt that would effect the normal operation of the training process. The inquiry mode is adopted because of its easiness of the exploitation debugging and dispense with the state protection.

    When setting the inquiring cycle, one of the core targets is to make sure that every change of the hardware should be acquired timely and accurately. If the inquiring mode is too short, the invalid time of CPU is too much; The CPU work efficiency would be slow down, even the system works abnormally. If the inquiring mode is too long, there will be several operation times in one inquiring time. That case would lead to the inaccuracy of state acquisition result. Tests have shown that 100 ms is rational as the inquiring cycle which could fulfill the CPU work ability and ensure the accuracy of the inquiring state.

  3. 3.

    The establishment of the state database

    1. (1)

      Classify and describe the state of all the keys, switches, and the lights. BOOL type is adopted to describe the keys and the lights. Enumeration type is adopted to describe the band switches. Float type is adopted to describe the change of the instrument hand.

    2. (2)

      Design the structure which includes the entire variable. This structure could describe all the state of the hardware in the operation panel in any case.

    3. (3)

      Divide the simulation and training process state. Confirm the finite states. Every system state is filled in one system state table. The state database is composed of the entire system state Table 

  4. 4.

    The establishment of the knowledge database

    According to the operation sequence and the system finite state, confirm the event which leads to the state transition, and then fill the system finite states and state transition event in the state transition table which composes the knowledge database.

  5. 5.

    System implementation

    The system state transition method based on the FSM is applied to the software design of the simulation and training system of air-defense missile based on the FSM. The equipment cabinet of the F vehicle subsystem is as follows (Fig. 5).

    Fig. 5
    figure 5

    The equipment cabinet of the F vehicle subsystem

5 Conclusion

  1. (1)

    The task interface between the equipment engineer and the software engineer is very distinct. It is the pipelined software designing mode which has high designing efficiency.

  2. (2)

    The software code has good reusable which could apply to the any software design of the simulation and training system. Maintain the software easily and design it efficiently.

  3. (3)

    This method is suitable for the system which has finite states. If the system has too many states, the state database would be expanded rapidly. It needs to be researched intensively how to solve this question.