The aims are to explore the construction of the knowledge management model for engineering cost consulting enterprises, and to expand the application of data mining techniques and machine learning methods in constructing knowledge management model. Through a questionnaire survey, the construction of the knowledge management model of construction-related enterprises and engineering cost consulting enterprises is discussed. First, through the analysis and discussion of ontology-based data mining (OBDM) algorithm and association analysis (Apriori) algorithm, a data mining algorithm (ML-AR algorithm) on account of ontology-based multilayer association and machine learning is proposed. The performance of the various algorithms is compared and analyzed. Second, based on the knowledge management level, analysis and statistics are conducted on the levels of knowledge acquisition, sharing, storage, and innovation. Finally, according to the foregoing, the knowledge management model based on engineering cost consulting enterprises is built and analyzed. The results show that the reliability coefficient of this questionnaire is above 0.8, and the average extracted value is above 0.7, verifying excellent reliability and validity. The efficiency of the ML-AR algorithm at both the number of transactions and the support level is better than the other two algorithms, which is expected to be applied to the enterprise knowledge management model. There is a positive correlation between each level of knowledge management; among them, the positive correlation between knowledge acquisition and knowledge sharing is the strongest. The enterprise knowledge management model has a positive impact on promoting organizational innovation capability and industrial development. The research work provides a direction for the development of enterprise knowledge management and the improvement of innovation ability.