Fault injection method based on data acquisition unitTechnical Field
The invention belongs to the technical field of ship control, and particularly relates to a fault injection method based on a data acquisition unit.
Background
The ship control system is a safe and demanding system, and the safe navigation of the ship is only important to ensure that the equipment stably and reliably operates. However, since the offshore environment is complex, and the internal failure of the equipment has a long latency, the conventional safety testing method needs a long time, and cannot completely and accurately simulate all failures in the actual working environment, so that the safety of the system is greatly threatened, and the equipment which passes the test and is put into operation under the test condition is very likely to have serious accidents.
The fault injection technology is mainly used for consciously and directly injecting various faults possibly occurring in the system into target equipment needing to be verified by a manual means, so that the failure process of the system is accelerated, the fault latency is shortened, and the faults difficult to occur in the conventional test are effectively discovered.
However, the existing ship control system cannot effectively monitor system leaks, locate fault positions and analyze reasons of fault generation, so that the reliability and fault tolerance of the system are poor.
Disclosure of Invention
Aiming at the defects or the improvement requirements of the prior art, the invention provides a fault injection method based on a data acquisition unit, which aims to flexibly, quickly and effectively monitor system bugs, locate fault positions and analyze the reasons of fault generation, thereby solving the technical problem of poor reliability and fault tolerance of a ship control system.
To achieve the above object, according to an aspect of the present invention, there is provided a fault injection method based on a data acquisition unit, including:
s1: carrying out fault parameter configuration on the specified type signal of the board card, wherein the fault parameters at least comprise: fault channel, fault type, fault start time and fault duration; the integrated circuit board includes: the device comprises an analog quantity signal fault injection board card, a switching quantity signal fault injection board card, a CAN signal fault injection board card and an Ethernet signal fault injection board card;
s2: acquiring and summarizing fault state information by using the data acquisition unit and the ADC acquisition board card, and transmitting the summarized fault state information to an industrial personal computer through the Ethernet so as to display the fault state information on a data monitoring interface; the fault status information includes: analog quantity signals, switching value signals, CAN signals and Ethernet signals;
s3: and controlling the industrial personal computer to store the summarized fault state information so that the summarized fault state information can be used for inquiring.
In one embodiment, the step S1 includes:
s11: configuring network parameters of the selected board card, wherein the network parameters comprise an IP address and a port number;
s12: configuring fault parameters of each selected board card, wherein the fault parameters comprise: fault channel, fault type, fault start time and fault duration;
s13: storing the fault parameters corresponding to the board cards, generating fault injection instructions, and sending the fault injection instructions corresponding to the board cards to the corresponding board cards;
s14: each board card performs fault injection on the specified channel according to the corresponding fault injection instruction;
s15: and after the fault duration is reached, the corresponding channel is recovered to be in a fault-free injection state.
In one embodiment, each of the failure types includes:
the analog quantity signal fault types comprise: sine wave, square wave, sawtooth wave and direct current noise signals with amplitude of +/-1V and frequency of 0-100 kHz;
the fault types of the switching value signal include: forced high level, forced low level, open circuit and short circuit;
the CAN signal fault types comprise: level mismatch, impedance mismatch, open circuit and short circuit;
the Ethernet signal fault types include: impedance mismatch, network storm, and open circuit.
In one embodiment, the step S2 includes:
s21: starting the data monitoring interface to provide channel data check corresponding to each board card;
s22: dotting and displaying analog quantity signals acquired by the data acquisition unit and the ADC acquisition board card in a graphical mode;
s23: and displaying the switching value signal, the CAN signal and the Ethernet signal uploaded by the data acquisition unit according to a data form.
In one embodiment, the step S2 further includes:
s24: the analog quantity signals transmitted by different channels are distinguished by different colors.
In one embodiment, the step S3 includes:
s31: creating a QT database in a QT upper computer;
s32: when the fault state information is inserted into the QT database, converting the fault state information to be stored into a corresponding data type, and then storing the fault information into the QT database;
s33: the fault status information is queried in the QT database.
In one embodiment, the step S33 includes:
when fault state information is queried in the QT database, after search keywords are detected, query is carried out in the QT database line by line until search results meeting conditions are queried;
and after the search result is converted into the corresponding readable data type, displaying the search result on a search interface.
In general, compared with the prior art, the above technical solution contemplated by the present invention can achieve the following beneficial effects:
1. the fault testing method capable of achieving system reliability and fault tolerance is provided based on a data acquisition unit in a ship control system, the data acquisition unit and an ADC acquisition board card are used for acquiring fault state information, fault injection of different types and modes is conducted according to signal types, and upper computer software is developed to provide functions of basic configuration, channel data monitoring, historical data storage and query of fault types, channels, time and the like. The fault injection method can flexibly, quickly and effectively monitor system leaks, locate fault positions and analyze reasons of fault generation, and therefore the technical problem that a ship control system is poor in reliability and fault tolerance is solved.
2. Different faults are injected into signals of specified types and channels, problems possibly occurring on the site are simulated, the failure process of the system is accelerated, data uploaded by the data acquisition unit and the ADC acquisition board card are monitored and stored, comparison analysis of the data is carried out, and therefore the reliability and fault tolerance of the data acquisition unit are tested.
Drawings
FIG. 1 is a block diagram of the overall design of a fault injection system in an embodiment of the present application;
FIG. 2 is a block diagram of the hardware components of the fault injection system in an embodiment of the present application;
fig. 3 is a flowchart illustrating the operation of the fault injection system according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
The fault injection system disclosed by the invention is shown in figure 1, and comprises 50 node board cards, 2 switches and 1 industrial personal computer. Wherein the node integrated circuit board includes: the device comprises an analog quantity signal fault injection board card, a switching quantity signal fault injection board card, a CAN signal fault injection board card, an Ethernet signal fault injection board card and an ADC acquisition board card. The four types of fault injection board cards can respectively carry out fault injection on four signals acquired by the data acquisition unit, and the ADC acquisition board card is mainly used for the recovery of part of analog quantity signals; each node board card is connected with the industrial personal computer through two switches, information interaction is achieved through the Ethernet, and an external power supply supplies power to all the node board cards.
The hardware composition block diagram of the fault injection system is shown in fig. 2, and the main control chip is connected with the ethernet communication module, communicates with the upper computer system, receives a configuration instruction sent by the upper computer, controls the operation of the specified fault injection module, and performs fault injection of a specified channel and type; and meanwhile, analog quantity signals acquired by the ADC acquisition board card are packaged and uploaded to an upper computer.
After the hardware connection of the fault injection system is completed, the working process of the fault injection system is as shown in fig. 3, and the fault injection method includes the following steps:
s1: carrying out fault parameter configuration on the specified type signal of the board card, wherein the fault parameters at least comprise: fault channel, fault type, fault start time and fault duration; the integrated circuit board includes: the device comprises an analog quantity signal fault injection board card, a switching quantity signal fault injection board card, a CAN signal fault injection board card and an Ethernet signal fault injection board card;
specifically, an operator opens a configuration management interface to configure the fault parameters of the signals of the specified type.
S2: acquiring and summarizing fault state information by using the data acquisition unit and the ADC acquisition board card, and transmitting the summarized fault state information to an industrial personal computer through the Ethernet so as to display the fault state information on a data monitoring interface; the fault status information includes: analog quantity signals, switching quantity signals, CAN signals and Ethernet signals.
Specifically, the data acquisition unit and the ADC acquisition board card pack and gather information, transmit the information to the industrial personal computer through the Ethernet, and display the information on the data monitoring interface.
S3: and controlling the industrial personal computer to store the summarized fault state information so that the summarized fault state information can be used for inquiring.
Specifically, the interface display information is stored by using a database, and the stored information can be queried.
In one embodiment, the configuring management operation in step S1 includes the following steps:
s11, configuring the network parameters of the selected board card, including IP address and port number, and also using the default parameters of the system.
S12, configuring fault parameters of the selected board card, wherein the fault parameters comprise a fault channel, fault types (the analog quantity signal fault types comprise sine wave, square wave, sawtooth wave and direct current quantity noise signals with amplitude of +/-1V and frequency of 0-100kHz, the switching quantity signal fault types comprise forced high level, forced low level, open circuit and short circuit, the CAN signal fault types comprise level mismatch, impedance mismatch, open circuit and short circuit, the Ethernet signal fault types comprise impedance mismatch, network storm and open circuit), fault starting time and fault duration, and the fault channel and the fault type are defaulted to be fault-free transmission.
And S13, the operator clicks the storage button, and the fault injection instruction is sent to the specified board card.
S14, the operator clicks the confirmation button on the interface, and the corresponding fault injection is carried out on the appointed channel.
And S15, after the fault duration time is up, the corresponding channel is recovered to be in a fault-free injection state, and the channel signal is transmitted normally.
In one embodiment, the step S2 data monitoring is performed as follows:
and S21, opening a data monitoring interface by an operator, and selecting a corresponding board card to check the channel data.
And S22, dotting and displaying the analog quantity signals uploaded by the data acquisition unit and the ADC acquisition board card according to a graphical mode, and distinguishing different channels by adopting different colors.
And S23, displaying the switching value signal, the CAN signal and the Ethernet signal uploaded by the data acquisition unit according to a data form.
In one embodiment, the history data storage and query operation in step S3 includes the following steps:
and S31, creating a database in the interface program of the QT upper computer, and completing the connection between the QT and the database.
And S32, when the information is inserted into the database, converting the content to be stored into the corresponding data type to be stored, and using the database statement to finish the storage of the information in the database.
And S33, when inquiring the database information, the administrator searches according to the keywords.
Specifically, the database is queried line by line until the content meeting the conditions is queried. After the results of the database query are converted into corresponding data types which can be read, the queried contents can be displayed in the interface.
It will be understood by those skilled in the art that the foregoing is only a preferred embodiment of the present invention, and is not intended to limit the invention, and that any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the present invention.