The invention discloses a
code translation method and device based on a large
language model, and the method comprises the steps: firstly executing an architecture understanding
workflow, and forming an architecture design document O1 of a code
library; according to the architecture design document O1 of the code
library, in combination with the demand document P1,
code translation task
decomposition workflow is executed, and a task planning
list O2 is formed; elements in the task planning
list O2 are sequentially extracted, and the code debugging
workflow is executed to complete
code translation and debugging work. A warehouse-level code architecture understanding workflow, a code translation task planning workflow and a code debugging workflow are constructed based on a large
language model (LLM), and the workflows are organically combined to realize
automatic translation of warehouse-level codes. According to the method, the limitation of function level translation in the prior art can be broken through,
automatic translation of warehouse level codes is realized, the development cost is greatly reduced, and the translation efficiency is improved.