The invention relates to a
power grid analysis
program code migration method and
system based on a
large model, and belongs to the technical field of
software development and intellectualization. The method comprises the steps that preprocessing of structuralization, semantization and
information density optimization is conducted on
MATLAB source codes, and standardized codes are generated; disambiguation
anchor point cue words are constructed based on a
power grid calculation scene, wherein the disambiguation
anchor point cue words comprise index, operation and return value mapping rules and examples; the standardized codes and the cue words are input into a
large model, four-layer
semantic alignment migration is conducted by the
large model according to the sequence of an
algorithm layer, a data layer, a
control layer and a calculation layer,
verification logic is executed after migration of each layer to ensure
semantic alignment, and Python codes are obtained; and finally, verifying the migration code and iteratively optimizing the cue word until the core index is consistent with the
MATLAB source code. According to the method, the problems of semantic
ambiguity and nesting overload existing when a large model migrates a
power grid program are solved through the
integrated design of preprocessing, migration and
verification, and high-precision and automatic
code migration is achieved.