Based on the hierarchical model of SDI (Software-Defined Intelligence)
a system for action recognition during sleep is designed to deal with various changing factors in smart environment through rule-based reasoning. A time queue is designed to extract the characteristics of actions in real-time to train the model
and a rule extraction algorithm is proposed to extract the rules required by the system from the model. Depending on these rules
the proposed system can recognize nine types of sleep actions: The recognition precision of each type can exceed 96%; the total recognition accuracy can reach 98.9%. Importantly
it has more robust adaptability than other systems. Experimental results show that the system can update rules for quickly adapting to changes in node position