The invention discloses a training method of an AI4DB (
artificial intelligence of a
database) model, which comprises the following steps: receiving a
query statement which comprises a target UDMF (user-defined
machine learning function); and determining that the target UDMF function is a function adopting a first
programming language, and determining that the
function type of the target UDMF function is UDMF. Wherein the first
programming language is a
programming language supported by an AI4DB model, is a function of a UDMF type, and is used for realizing training of the AI4DB model. And calling the target UDMF to
train a target model, wherein the target model is an AI4DB model. Therefore, by means of the scheme, the
database can call the target UDMF function, training of the AI4DB model is achieved, the AI4DB technology is integrated into the
database architecture instead of enabling an AI4DB technology framework to be independent of the database architecture, and the database performance is correspondingly improved.