Modern cognitive psychologists divided into two broad categories of knowledge: declarative knowledge and procedural knowledge, according to the psychological characteristics of learners in learning knowledge. Using the theory of knowledge classification to guide the teaching activities of informatics in primary and secondary schools, formulate teaching methods and strategies to meet the cognitive psychological characteristics of primary and middle school students, promote the better grasp of knowledge points, improve the programming ability of primary and middle school students, learning the effectiveness of learning, and then cultivate the innovative spirit of primary and secondary school students. In this study, we use knowledge classification theory to make some in-depth discussion on classroom teaching of different knowledge types of informatics in primary and secondary schools.