An artificial intelligence planning method, executed by an artificial intelligence planning device comprising a processor, comprising:
- obtaining, by an artificial intelligence planner executed by the processor, a problem file and a domain file associated with a specific application run on a target server, wherein the domain file comprises N description segments corresponding to N planning layers of the specific application, N is a positive integer greater than 1, and the problem file indicates a first initial state and a target state of each of the planning layers;
- constructing, by the artificial intelligence planner executed by the processor, N planning trees corresponding to the planning layers based on the description segments, wherein each of the planning trees has a plurality of state nodes and corresponds to one of the planning layers, wherein each of the planning layers has a planning node set, the planning node set of each of the planning layers comprises a plurality of planning nodes, the planning nodes of an ith planning layer among the planning layers comprise a first planning node, the planning nodes of an i+1th planning layer among the planning layers comprise a plurality of second planning nodes corresponding to the first planning node, the first planning node satisfies a plurality of first preset conditions corresponding to the ith planning layer, and all of the planning nodes of a second planning tree satisfy a plurality of second preset conditions of the i+1th layer, wherein i is a positive integer and N>i≥1;
- determining, by the artificial intelligence planner executed by the processor, a first planning path in the state nodes of each of the planning trees based on a deep learning model, wherein the first planning path of each of the planning trees guides the corresponding planning layer from the corresponding first initial state to the corresponding target state;
- and
- generating, by the artificial intelligence planner executed by the processor, a first scheduling plan according to the first planning path of a specific planning tree among the planning trees, wherein the first scheduling plan comprises a plurality of action commands assigned with corresponding execution time point;
- sequentially issuing, by the artificial intelligence planner executed by the processor, the plurality of action commands to the specific application run on the target server according to the first scheduling plan, wherein the plurality of the action commands controls the target server to add a piece of program code to a program code of the specific application or remove a piece of program code from the program code of the specific application at the corresponding execution time point;
- wherein the description segments comprise an Nth description segment corresponding to an Nth planning layer among the planning layers, the Nth description segment comprises a plurality of description sentences corresponding to the Nth planning layer, and each of the description sentences is expressed as follows:
- precond_N->action N->effect_N
- wherein precond_N is a pre-state, action_N is a specific action command, and effect_N is a result state which is achievable by executing the specific action command in the pre-state,
- wherein action_N comprises adding a node to the planning nodes of the Nth planning layer or removing a node from the planning nodes of the Nth planning layer, and effect_N is the planning node set formed by the planning nodes of the Nth planning layer after the specific action command is executed in the pre-state, the Nth planning layer corresponds to a code layer of the specific application, and action_N comprises adding the piece of program code to the program code of the specific application or removing the piece of program code from the program code of the specific application,
- wherein the description segments comprise an ith description segment corresponding to the ith planning layer, the ith description segment comprises a plurality of first description sentences corresponding to the ith planning layer, and each of the first description sentences is expressed as follows:
- precond_i->action_i->effect_i,
- wherein precond_i is a pre-state, action_i is a specific action command, and effect_i is a result state which may be achieved by executing the specific action command in the pre-state;
- wherein the first planning node corresponds to one of the first description sentences, and the method further comprises:
- determining whether all of the second planning nodes satisfy the second preset conditions corresponding to the i+1th layer before executing action_i corresponding to the first planning node;
- and
- executing action_i corresponding to the first planning node in response to determining that all of the second planning nodes satisfy the second preset conditions corresponding to the i+1th layer, otherwise, not executing action_i corresponding to the first planning node;
- wherein the first preset conditions met by the first planning node comprise achieving a metric of the ith planning layer, and the method further comprises the following steps:
- obtaining input data of the specific application, determining a plurality of reference patterns among a plurality of patterns corresponding to the ith planning layer in response to the input data by executing an input attention function, determining a plurality of feature values corresponding to the plurality of reference patterns by executing conscious attention function and estimating a fitness score corresponding to the ith planning layer according to the plurality of feature values;
- and
- determining that the first planning node achieves the metric of the ith planning layer in response to determining that the fitness score corresponding to the ith planning layer is greater than a score threshold of the ith planning layer,
- wherein the step of estimating the fitness score corresponding to the ith planning layer according to the input data further comprises:
- executing an input attention function to find a plurality of reference patterns among a plurality of patterns corresponding to the ith planning layer in response to the input data;
- executing a conscious attention function to find a plurality of feature values corresponding to the reference patterns;
- and
- determining the fitness score corresponding to the ith planning layer based on the feature values.