Intention-based command optimization
AssigneeInternational Business Machines Corporation
InventorsRong Zhao, Ke Zhang, Li Quan Cui, Zhuo Zhao
Life of this patent
Estimating the term…
Abstract
This disclosure provides a method, a computing system and a computer program product for optimizing computer-readable commands. The method includes detecting an intention of a set of commands based on a semantic model. The semantic model represents the set of commands and contexts of execution of the set of commands. The method further includes obtaining a predetermined semantic sub-model associated with the intention and updating the semantic model with the predetermined semantic sub-model. The method further includes generating a script of commands based on the updated semantic model.
Claims13
A computer-implemented method for command optimization, comprising:
- detecting, by one or more processors, an intention of a set of commands based on a semantic model, wherein the semantic model represents the set of commands and contexts of execution of the set of commands, wherein the semantic model comprises a plurality of nodes and relationships between the nodes, the plurality of nodes comprising command nodes and context nodes, wherein:
- a command node corresponds to a command in the set of commands,
- a context node and its relationship with the command node represents a context of execution of the command corresponding to the command node, and
- a relationship between the command nodes represents a sequential dependency between the commands corresponding to the command nodes, and wherein detecting the intention of the set of commands comprises determining that at least part of the nodes and their relationships in the semantic model match a predetermined intention schema corresponding to the intention, wherein an intention schema library includes a plurality of intention schemas that correspond to a plurality of intentions;
- obtaining a predetermined semantic sub-model associated with the intention;
- updating, by the one or more processors, the semantic model with the predetermined semantic sub-model by replacing the matched nodes and their relationships in the semantic model with nodes and relationships in the predetermined semantic sub-model;
- iteratively performing the detecting and the updating until the updated semantic model does not match any intention schema in the intention schema library;
- and
- generating, by the one or more processors, a script of commands based on the updated semantic model.
A computing system for command optimization, comprising:
- one or more processors;
- a computer-readable memory unit coupled to the one or more processors, the memory unit comprising instructions that, when executed by the one or more processors, perform actions of:
- detecting, by one or more processors, an intention of a set of commands based on a semantic model, wherein the semantic model represents the set of commands and contexts of execution of the set of commands, wherein the semantic model comprises a plurality of nodes and relationships between the nodes, the plurality of nodes comprising command nodes and context nodes, wherein:
- a command node corresponds to a command in the set of commands,
- a context node and its relationship with the command node represents a context of execution of the command corresponding to the command node, and
- a relationship between the command nodes represents a sequential dependency between the commands corresponding to the command nodes, and wherein detecting the intention of the set of commands comprises determining that at least part of the nodes and their relationships in the semantic model match a predetermined intention schema corresponding to the intention, wherein an intention schema library includes a plurality of intention schemas that correspond to a plurality of intentions;
- obtaining a predetermined semantic sub-model associated with the intention;
- updating, by the one or more processors, the semantic model with the predetermined semantic sub-model by replacing the matched nodes and their relationships in the semantic model with nodes and relationships in the predetermined semantic sub-model;
- iteratively performing the detecting and the updating until the updated semantic model does not match any intention schema in the intention schema library;
- and
- generating, by the one or more processors, a script of commands based on the updated semantic model.
A computer program product for command optimization, comprising a computer readable storage medium having program instructions embodied therewith, the program instructions executable by one or more processors to cause the one or more processors to perform actions of:
- detecting, by one or more processors, an intention of a set of commands based on a semantic model, wherein the semantic model represents the set of commands and contexts of execution of the set of commands, wherein the semantic model comprises a plurality of nodes and relationships between the nodes, the plurality of nodes comprising command nodes and context nodes, wherein:
- a command node corresponds to a command in the set of commands,
- a context node and its relationship with the command node represents a context of execution of the command corresponding to the command node, and
- a relationship between the command nodes represents a sequential dependency between the commands corresponding to the command nodes, and wherein detecting the intention of the set of commands comprises determining that at least part of the nodes and their relationships in the semantic model match a predetermined intention schema corresponding to the intention, wherein an intention schema library includes a plurality of intention schemas that correspond to a plurality of intentions;
- obtaining a predetermined semantic sub-model associated with the intention;
- updating, by the one or more processors, the semantic model with the predetermined semantic sub-model by replacing the matched nodes and their relationships in the semantic model with nodes and relationships in the predetermined semantic sub-model;
- iteratively performing the detecting and the updating until the updated semantic model does not match any intention schema in the intention schema library;
- and
- generating, by the one or more processors, a script of commands based on the updated semantic model.
Dependencies are inferred from the claim text.