In recent years, small, medium and micro enterprises have gradually shown an increasingly important position in my country's economic development. However, in reality, due to their relatively small scale and lack of mortgage assets, the establishment of a credit risk evaluation system for small, medium and micro enterprises has become a bank. Urgent problems. This paper first establishes a credit risk model and a bank's profit maximization model, uses the TOPSIS method to score 123 small, medium and micro enterprises with credit records in a bank, and then introduces the RAROC model loan pricing model to construct the bank's profit maximization model, using xgboost. The classification model predicts the credit rating of the 302 small, medium and micro enterprises that the bank has no credit history, and solves the optimal credit strategy. Finally, taking the COVID-19 as an example, the impact of the epidemic on each industry is quantified, and then it is put into the credit risk model as a sudden risk factor multiplier to measure the impact of sudden risk on the full sample, and then calculate and adjust the new credit strategy. This article deeply analyzes the credit decision-making mechanism of small, medium and micro enterprises, and has corresponding reference value.