This application discloses a
code generation method, apparatus, device, medium, and product, relating to the field of application development. The method includes converting front-end application
design data into a structured dataset containing page element information, initial interaction topology, and visual design specifications, addressing the problem of insufficient interaction logic description capabilities. It then converts this data into an attributed state
transition diagram, describing the complete interaction attributes of the front-end application's page-to-page interaction from pre-interaction preparation to the completion of the interaction's effect, replacing vague
natural language descriptions and achieving
machine-analyzable interaction logic, bridging the
information gap between design and implementation. Finally, it combines a pre-trained
language model to directly generate front-end development code, achieving automated and standardized output from design to code, addressing the lack of
machine-analyzable
formal representation of front-end interaction logic, thereby improving front-end development efficiency and code quality, and reducing communication and maintenance costs.