The invention provides a hot-update
abstract syntax tree
memory mapping dynamic
correction method and device, and the method comprises the steps: obtaining an
abstract syntax tree of a target program, generating the identification information of each node, determining the node associated with a
local variable in the
abstract syntax tree as an associated node, and storing the associated node in the target program; establishing mapping between identification information of the
abstract syntax tree and memory offset to obtain a
memory mapping table, when the
abstract syntax tree is changed due to hot update, identifying change nodes and types, and if the change is attribute change, keeping the memory offset and only updating the version identification; and if the change is the structure change, calculating the
structural similarity of the nodes before and after the change, and if the similarity is greater than or equal to a preset threshold,
multiplexing the original offset, otherwise, redistributing the offset and updating the mapping table. Therefore, incremental efficient correction of
memory mapping is realized by dynamically evaluating the
structural similarity of the
abstract syntax tree nodes and intelligently
multiplexing or redistributing the memory offset during hot update, so that the hot update speed is increased, and the memory overhead is reduced.