The invention discloses an ST
code generation method based on graph alignment coding
large model and multi-agent
collaboration, and the method comprises the steps: receiving an ST code
programming demand inputted by a user through a
demand analysis module, refining and analyzing the demand based on multiple rounds of interactive conversations of the user and insight agents, and generating a standardized ST code
programming demand; the retrieval module receives a standardized ST code
programming requirement, and retrieves and obtains related knowledge through a retrieval agent in combination with an ST code
knowledge base; and the double-agent collaborative self-
correction code generation module receives standardized ST code programming requirements and retrieved related knowledge, a graph alignment coding
large model constructed based on a graph neural network and a cross-
modal alignment technology serves as a coding agent to cooperatively work with a review agent, ST code structure information is injected into the
large model, and a final ST code is generated. According to the method, high-accuracy and high-reliability ST code automatic generation can be realized, and the development efficiency of a PLC program in the industrial control field is improved.