In order to reduce the time complexity of situation element acquisition and to cope with the low detection accuracy of small class samples caused by imbalanced class distribution of attack samples in wireless sensor networks, a situation element extraction mechanism based on deep auto-encoder network is proposed. In this mechanism, the deep auto-encoder network is introduced as basic classifier to identify data type. In hierarchical training of the auto-encoder, a training method based on cross-entropy loss function and back-propagation algorithm is proposed to overcome the problem of weights updating too slow by the traditional variance cost function, and the momentum factors are added to improve the convergence performance. Meanwhile, in the stage of fine-tuning and classification of the deep network, an active online sampling algorithm is proposed to select the sample online for updating the network weights, so as to eliminate redundancy of the total samples, balance the amounts of all sample types, and improve the classification accuracy of small sample. Through the simulation and analysis of the instance data, the scheme has a good accuracy of situation factors extraction.