XML Document Diffing via Edit Graph Hashing and Streaming Patch

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current methods for differencing and patching XML documents are inefficient, as they consume excessive resources and are slow due to their inability to effectively handle the tree structure of XML documents, leading to non-minimal edit scripts and high computational costs.

Innovation Solution

The implementation of global and local diff techniques, along with DOMHASHING, to generate edit scripts by comparing XML documents using edit graphs and distance matrices, and applying these scripts through a streaming patch process to efficiently transform one document into another, reducing resource usage and improving speed.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If current diffing approaches are used on XML documents, then the documents can be compared, but the resource consumption is excessive and the process is slow

Engineering Contradiction:
Improvediffing speedVSAvoidresource consumption
Core Design Contradiction:
ProductivityVSUse of energy by moving object

Solution Approach 1:

The patent divides the XML document comparison into hierarchical segments (root element, child elements, text content) and processes them in a structured sequence. By segmenting the diffing process according to XML's tree structure, the system avoids comparing entire documents as single units, thereby reducing computational resources and improving processing speed.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies different comparison strategies to different parts of the XML document based on their local characteristics. For example, element nodes are compared using tag-name matching while text nodes use content comparison. This localized approach optimizes resource usage by applying the most efficient comparison method to each specific portion of the document.

Inventive Principle:
Principle #3Local quality

2Productivity

If current diffing approaches are used on XML documents, then the documents can be compared, but the process is slow

Engineering Contradiction:
Improvediffing speedVSAvoidcomputational time
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent performs preliminary actions by first parsing the XML documents into tree structures and identifying all element nodes, child elements, and text content before the actual comparison begins. This pre-processing organizes the data in a manner that enables faster subsequent comparison operations, reducing overall computational time.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent maintains continuous useful action by implementing an iterative diffing process that systematically traverses through all elements and text content without redundant backtracking. The method continuously progresses through the document hierarchy, ensuring that each comparison operation contributes directly to generating the final edit script without wasting time on repetitive computations.

Inventive Principle:
Principle #20Continuity of useful action

3Manufacturing precision

If traditional diff tools like UNIX diff are used, then text documents can be diffed, but they cannot find a minimal and correct edit script for XML documents

Engineering Contradiction:
Improveedit script accuracyVSAvoidXML structure understanding
Core Design Contradiction:
Manufacturing precisionVSAdaptability or versatility

Solution Approach 1:

The patent introduces an intermediary layer that translates XML's hierarchical structure into a format suitable for diffing operations. By creating an intermediate representation that captures the tree structure, element relationships, and text content positions, the system enables traditional diff algorithms to work correctly on XML while maintaining accuracy in generating minimal edit scripts.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent changes the parameters of comparison by adapting the diffing criteria to XML-specific characteristics. Instead of treating XML as plain text, the method uses parameters such as element tag names, hierarchical positions, and text node associations to guide the comparison process, ensuring that the resulting edit script is both minimal and correct for XML document transformation.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS8429526B2Efficient evaluation for diff of XML documents
Publication Date: 2013.04.23 ORACLE INT CORP
  • US8429526B2 patent drawing
  • US8429526B2 patent drawing
  • US8429526B2 patent drawing

AI summary

A technique for differencing XML documents is provided. An edit graph is generated for computing the cost of possible edits that may be applied to a first XML document in order to generate a second XML document. A hash value is assigned to nodes included in the axes of the edit graph, where one axis includes nodes in the first XML document and the other axis includes nodes in the second XML document. The hash value may be generated based on a particular node's name and attributes, and the hash value of the name and attributes of each child node of the particular node. A technique for patching an XML document is also provided. Events are generated for each node in the input document and for at least one operation specified in the edit script. The edit script is applied to the input document by performing one or more operations specified in the operation events on one or more node events.