Dynamic programming is an important algorithmic idea with widespread applications in computer science and other disciplines. With the continuous improvement of computing power and the increasing complexity of practical problems, dynamic programming algorithms have also received more and more attention. However, due to the limitations of the dynamic programming algorithm itself, it also brings challenges to the optimization of the algorithm and its application in different fields. This paper uses the methods of literature review and case analysis to systematically summarize and sort out the basic principles, complexity analysis, classic problems, and applications of dynamic programming algorithms. First of all, this paper discusses the basic concepts of splitting and optimal substructure characteristics of related problems in dynamic programming; secondly, it discusses the time complexity and space complexity of dynamic programming algorithms in detail; then, in the classic dynamic programming The case part focuses on the knapsack problem, including the 0-1 knapsack problem and multiple knapsack problems; finally, this paper discusses the wide application and optimization of dynamic programming algorithms in practice, covering natural language processing, bioinformatics and How to optimize the dynamic programming algorithm to improve the efficiency of problem solving and reduce resource consumption. To sum up, this paper fully demonstrates the basic principles and applications of dynamic programming algorithms, as well as optimization methods and development trends, and provides guidance and references for their academic and practical applications.