In order to facilitate banks to assess the credit risk of small and medium-sized enterprises, and formulate the optimal credit strategy, an indicator system composed of four primary risk assessment indicators, namely, business income ability, profitability, customer stability, and transaction vitality, is constructed by using the bank flow information of enterprises with upstream and downstream partners. The enterprise credit risk is predicted based on Logistic regression, and compares it with error back-propagation neural network. Combining the probability of default and the retention rate under different interest rates, taking the maximum expected return of banks on small and medium-sized enterprises as the objective function, the credit strategy optimization model is established. In order to verify the effectiveness of the model, the credit risk assessment and credit strategy optimization models are empirically analyzed. The results indicate that Logistic regression has high accuracy and recall, and the area under the curve of receiver operating characteristic reaches 0.964, which is suitable for credit risk prediction and assessment of small and medium-sized enterprises. The credit strategy optimization model can determine the loan amount and loan interest rate of each lending enterprise, and maximize the expected return of the bank.