Research Article

A Self-Learning Sensor Fault Detection Framework for Industry Monitoring IoT

Algorithm 1

A group-based fault detection Algorithm.
(1) let be the statistics sliding windows size;
(2) let be the outlier detection threshold for sensor S and let P be the
  global list to keep all of the ;
(3) let U and V be the global arrays to keep the last 10 gaussian
  distribution characteristics for each sensor;
(4) let be the status transform windows size and be the trend
  vector merging threshold for group , all the rational trend vectors
  of are stored in ;
(5) procedure GFD  ()
(6)  init P, loading from Appilcation DB;
(7)  init U and V, loading the last 10 distribution characteristics from
  Application DB;
(8)  create C DetectionThread threads, ;
(9)  start SelfLearningThread();
(10)  do
(11)  get a value set for sensors in a group ;
(12)  find a idle DetectionThread;
(13)  DetectionThread( );
(14) while not end;
(15) return;
(16) procedure DetectionThread( )
(17)   if (IsStuck( ) or IsSpikes( ))
(18)     return;
(19)   if (IsOutlier( ) and not IsRatStatChange( ))
(20)     return;
(21)   IsRatStatChange( );
(22) return;
(23) procedure IsStuck( )
(24)  get for sensor j by ;
(25)  if ( )
(26)    mark as a Stuck;
(27) return;
(28) procedure IsSpikes( )
(29)  get and for sensor j by ;
(30)  if ( and )
(31)    mark as a Spikes;
(32) return;
(33) procedure IsOutlier( )
(34)  use U and V to caculate ;
(35)  if ( ) mark as an Outlier;
(36) return;
(37) procedure IsRatStatChange( )
(38)  use the last values of to fit the trend vector ;
(39)  for each rational trend in
(40)     if ( )
(41)      mark as a rational status change; ;
(42)  mark the max unstable sensor as a sensor falut;
(43) return;
(44) procudure SelfLearningThread()
(45)  while (true) do:
(46)  load the user feedback;
(47)  for each miss alart
(48)     if missed Outlier then ;
(49)     if missed irrational status change then ;
(50)   IncClustering( , null);
(51)  for each false alart
(52)     if false Outlier then ;
(53)     if false irrational status change then ;
(54)   IncClustering( );
(55)  sleep( ); continues;
(56) return;
(57) procedure IncClustering( , )
(58)   if is not null then for each in ;
(59)   if there is then ;
(60)   else add   into ;
(61)  for each two , in ;
(62)     if (
(63)     ( , ); remove ;
(64) return;