构建结果子树是XML关键字查询得以完成的关键步骤之一.针对已有方法求解子树效率低的问题,文中提出一种自顶向下的子树构建算法——TDTMS.TDTMS以自顶向下、深度优先的方式求解满足条件的子树根结点,避免了已有方法求解SLCA结点时存在的公共祖先重复处理问题.对于给定的子树根结点,TDTMS以自顶向下、广度优先的方式构建子树,可以在建树过程中快速裁剪无用结点,从而获得了最小的时间和空间复杂度.最后通过实验验证了TDTMS在时间和空间两方面的性能优势.
Constructing subtree results is one of the key operations to XML Keywords query processing.Considering that existing methods are inefficient in constructing subtree results,we propose an efficient algorithm,i.e.,TDTMS,which processes a given keyword query in a top-down way to get all qualified subtree results.For computing qualified root nodes,TDTMS processes nodes of the given XML document in a top-down,depth-first way,thus can avoid the common-ancestor-repetition problem.For a given root node,TDTMS constructs its subtree in a top-down,breadth-first way to quickly prune useless nodes,thus achieves the best time and space complexity.We conduct rich experiments,and the experimental results verified the performance benefits of our method in terms of time and space.