The embodiment of the invention relates to the technical field of
artificial intelligence, and discloses a method and related equipment for generating codes based on a multi-semantic-domain domain-specific language, the method comprises the following steps: receiving a formalized protocol file describing a financial
system, the protocol file is written based on the multi-semantic-domain domain-specific language, and the formalized protocol file is written based on the multi-semantic-domain domain-specific language; the semantic domain at least comprises an entity domain, a transaction domain, a strategy domain and an
attribute domain; operating a
protocol processing engine to analyze the protocol file, extracting
system-level attributes, and generating a structured
code generation instruction through a multi-layer prompt template; calling an
artificial intelligence code generation model to generate a
source code; and abstracting behaviors of the
source code into a
finite state model, performing exhaustive
verification on the
finite state model based on
system-level attributes, and outputting the
source code as a qualified source code after the
verification is passed. By means of the mode, the reliability, safety and compliance of
code generation in the financial field can be improved.