DOI QR코드

DOI QR Code

X-tree Diff: An Efficient Change Detection Algorithm for Tree-structured Data

X-tree Diff: 트리 기반 데이터를 위한 효율적인 변화 탐지 알고리즘

  • Published : 2003.10.01

Abstract

We present X-tree Diff, a change detection algorithm for tree-structured data. Our work is motivated by need to monitor massive volume of web documents and detect suspicious changes, called defacement attack on web sites. From this context, our algorithm should be very efficient in speed and use of memory space. X-tree Diff uses a special ordered labeled tree, X-tree, to represent XML/HTML documents. X-tree nodes have a special field, tMD, which stores a 128-bit hash value representing the structure and data of subtrees, so match identical subtrees form the old and new versions. During this process, X-tree Diff uses the Rule of Delaying Ambiguous Matchings, implying that it perform exact matching where a node in the old version has one-to one corrspondence with the corresponding node in the new, by delaying all the others. It drastically reduces the possibility of wrong matchings. X-tree Diff propagates such exact matchings upwards in Step 2, and obtain more matchings downwsards from roots in Step 3. In step 4, nodes to ve inserted or deleted are decided, We aldo show thst X-tree Diff runs on O(n), woere n is the number of noses in X-trees, in worst case as well as in average case, This result is even better than that of BULD Diff algorithm, which is O(n log(n)) in worst case, We experimented X-tree Diff on reat data, which are about 11,000 home pages from about 20 wev sites, instead of synthetic documets manipulated for experimented for ex[erimentation. Currently, X-treeDiff algorithm is being used in a commeercial hacking detection system, called the WIDS(Web-Document Intrusion Detection System), which is to find changes occured in registered websites, and report suspicious changes to users.

인터넷 사용이 급속도로 증가함에 따라 XML/HTML 문서와 같이 트리 구조로 표현되는 데이터의 변화 탐지가 중요한 연구 분야로 등장하고 있다. 본 논문에서는 효율적인 변화 탐지를 위한 데이터 구조로 X-tree와 이에 기초한 휴리스틱 변화 탐지 알고리즘 X-tree Diff 를 제안한다. X-tree Diff 는 X-tree 의 변화 내용에 대한 최소 비용 편집 스크립트를 찾는 알고리즘과는 달리 휴리스틱 트리 대응 알고리즘을 통해 병화 내용을 확인하는 알고리즘으로, X-tree 에 속한 모든 노드에 대해 각각의 노드를 루트로 하는 서브트리의 구조와 서브트리속에 속한 노드들의 데이터들을 128비트 해시값으로 표현한 값인 트리 MD를 각 노드에 저장하고, 이를 변화 탐지 과정에서 활용하여 신-구 버전의 X-tree들에 속한 서브트리들의 비교을 효율적으로 처리한다. X-tree Diff 는 4단계로 구성되며 1)신-구버넌의 X-tree노드들에 대해, 우선 1:1 대응이 가능한 모든 동등한 서브트리 쌍을 찾고, 2) 이들 서브트리 쌍의 루트로부터 신-구 버전의 X-tree의 루트까지의 경로 상에 존재하는 노드들에 대한 대응관계를 결정한다. 3) 그 후 신-구 버전의 X-tree의 루트들로부터 깊이 우선 탐색으로 노드를 방문하며 대응이 결정되지 않은 노드들에 대한 대응여부를 결정해 나간다. 4) 마지막까지 대응여부가 결정되지 않은 도드들은 삭제나 삽입된 것으로 간주한다. X-tree Diff XML 문서들에 대한 버저닝(Versioning) 을 목적으로 설계된 BUILD Diff 알고리즘과 달리 XML/HTML 에 공통적으로 사용할 수 있을 뿐 아니라, 알고리즘이 명확하고 간결하여 다양한 형태의 확장이 가능하다. 알고리즘의 성능도 개선되어 신-구 X-tree의 노드의 수를 n이라 할 때, O(n)의 시간 복잡도를 갖는다. 제안된 알고리즘은 현재 보안 관련 상용 시스템인 WIDS(Web-Document Instrusion Detection System) 에서 사용되고 있으며, 본 논문에서는 WIDS를 이용하여 20여개 신문-방송 사이트에서 변화가 탐지된 11,000 개 페이지에 대한 성능평가를 보이고 있다.

Keywords

References

  1. A. Haake, 'CoVer : A Contextual Version Server for Hypertext Applications,' In Proc. of 4th ACM Conf., Hypertext, Milan. Italy, pp.43-52, Nov., 1992 https://doi.org/10.1145/168466.168488
  2. K. Osterbye, 'Structural and Cognitive Problems in Providing Version Control for Hypertext,' In Proc. of 4th ACM Conf., Hypertext, Milan. Italy, pp33-42, Nov., 1992 https://doi.org/10.1145/168466.168484
  3. W. Labio and H. G. Molina, 'Efficient snapshot differential algorithms for data warehousing,' In Proc. of 20th Conf., VLDB, Bombay. India, pp.63-74, Sep., 1996
  4. J. Widom and S. Ceri, Active Database System: Triggers and Rules for Advanced Database Processing, Morgan Kaufmann, 1996
  5. E. W. Myers, 'An O(ND) Difference Algorithm and Its Variations,' Algorithmica, 1(2), pp.251-266, 1986 https://doi.org/10.1007/BF01840446
  6. 'Concurrent Versions System(CVS),' Free Software Foundation, http://www.gnu.org/manual/cvs-1.9
  7. S. Chawathe, A. Rajaraman, H. G. Molina and J. Widom, 'Change Detection in Hierarchically Structured Information,' In Proc. of ACM SIGMOD Int'l Conf. on Management of Data, Montreal, June, 1996 https://doi.org/10.1145/233269.233366
  8. S. M. Selkow, 'The tree-to-tree editing problem,' Information Proc. Letters, 6, pp.184-186, 1977 https://doi.org/10.1016/0020-0190(77)90064-3
  9. K. Tai, 'The tree-to-tree correction problem,' Journal of the ACM, 26(3), pp.422-433, July, 1979 https://doi.org/10.1145/322139.322143
  10. S. Lu, 'A tree-to-tree distance and its application to cluster analysis,' IEEE TPAMI, 1(2), pp.219-224, 1979
  11. J. T. Wang and K. Zhang, 'A System for Approximate Tree Matching,' IEEE TKDE, 6(4), pp.559-571, August, 1994 https://doi.org/10.1109/69.298173
  12. S. Chawathe and H. G. Molina, 'Meaningful Change Detection in Structured Data,' In Proc. of ACM SIGMOD '97, pp.26-37, 1997 https://doi.org/10.1145/253260.253266
  13. S. Chawathe, 'Comparing Hierarchical Data in External Memory,' In Proc. of the 25th VLDB Conf., pp.90-101, 1999
  14. S. J. Lim and Y. K. Ng, 'An Automated Change-Detection Algorithm for HTML Documents Based on Semantic Hierarchies,' The 17th ICDE, pp.303-312, 2001 https://doi.org/10.1109/ICDE.2001.914842
  15. Curbera and D. A. Epstein, 'Fast Difference and Update of XML Documents,' XTech '99, San Jose, March, 1999
  16. G. Cobena, S. Abiteboul and A. Marian, 'Detecting Changes in XML Documents,' The 18th ICDE, 2002 https://doi.org/10.1109/ICDE.2002.994696
  17. Y. Wang, D. J DeWitt, J. Y. Cai, 'X-Diff: An Effective Change Detection Algorithm for XML Documents,' To appear in the 19th ICDE, 2003
  18. K. Zhang and D. Shasha, 'Simple fast algorithms for the editing distance between trees and related problems,' SIAM journal of Computing, 18(6), pp.1245-1262, 1989 https://doi.org/10.1137/0218082
  19. H. Maruyama, K. Tamura and N. Uramoto, 'Digest values for DOM(DOMHash) Proposal,' IBM Tokyo Research laboratory, 1998
  20. R. Rivest, 'The MD4 Message-Digest Algorithm,' MIT and RSA Data Security, Inc., April, 1992
  21. N. Doraswamy and D. Harkins, IPSec : The New Security Standard for the Internet, Intranets, and Virtual Private Networks, Prentice Hall PTR, 1999
  22. Document Object Model (DOM) http://www.w3.org/DOM/
  23. R. Wagner and M. Fischer, 'The string-to string correction problem,' Journal of the ACM, 21, pp.168-173, 1974 https://doi.org/10.1145/321796.321811