Data mining is a broad term used to describe various methods for discovering patterns in data. A kind of pattern often considered is association rules, probabilistic rules stating that objects satisfying description A also satisfy description B with certain support and confidence. In this study, we first make use of the first-order predicate logic to represent knowledge derived from celestial spectra data. Next, we propose a concept of constrained frequent pattern trees (CFP) along with an algorithm used to construct CFPs, aiming to improve the efficiency and pertinence of association rule mining. The running results show that it is feasible and valuable to apply this method to mining the association rule and the improved algorithm can decrease related computation quantity in large scale and improve the efficiency of the algorithm. Finally, the simulation results of knowledge acquisition for fault diagnosis also show the validity of CFP algorithm.