Data mining (DM), as a new technology in the information age, is applied to modern audit work, which is more effective than traditional audit methods. In view of the problems existing in traditional tax audit methods, such as the huge amount of audit data, limited knowledge and experience of auditors, and difficult tracking of audit data, this paper uses computer-aided audit technology to collect, clean up, convert, and analyze data, comprehensively uses data warehouse technology, pattern recognition method, data analysis method, and anomaly detection theory as research methods, and makes a comprehensive study on tax affairs. Then, a random forest (RF) algorithm is used to establish the classification and identification model of audit risk. Second, based on the RF algorithm, the audit early warning framework of accounts receivable and payable in enterprise financial sharing mode is constructed, and the financial data and business data in enterprise financial sharing mode are extracted by using big data technology. The comparison of the results shows that the RF model has higher prediction accuracy and better robustness, which can better improve the antirisk ability of listed companies in China.