Software Code Merge Conflict Resolution via Semantic Intent Analysis

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current software code merging methods, such as Git, rely on text-based approaches that fail to accurately perform semantic analysis, resulting in a high number of conflict blocks and poor accuracy in merging multiple software code change versions.

Innovation Solution

A method and apparatus that analyze change intents of code areas in conflicting blocks using a conflict elimination rule set and a prediction model to accurately eliminate conflict blocks, identifying both explicit and implicit conflicts by examining association relationships between code changes.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If text-based merging manner (Git) is used to merge software code change versions, then the merging process can be implemented, but the accuracy of merging is poor and produces a large quantity of conflict blocks

Engineering Contradiction:
Improvemerging accuracyVSAvoidconflict block quantity
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent replaces the text-based mechanical merging mechanism with a semantic analysis mechanism. Instead of merging based on text similarity alone, the system uses abstract syntax trees (AST) to represent code structure and semantic difference detection to identify meaningful changes, thereby improving merging accuracy and reducing conflict blocks.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Solution Approach 2:

The patent changes the parameter of code representation from raw text to abstract syntax trees. This transformation allows the system to operate at a semantic level rather than textual level, enabling more accurate detection of code changes and their relationships, which directly addresses the merging accuracy problem.

Inventive Principle:
Principle #35Parameter changes

2Measurement precision

If text-based merging is used, then the merging process is simple to implement, but semantic analysis cannot be accurately performed on changed code

Engineering Contradiction:
Improvesemantic analysis accuracyVSAvoidmerging system complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent substitutes the simple text-based merging mechanism with a more complex but accurate semantic analysis system. By using abstract syntax trees and semantic difference detection, the system achieves accurate semantic analysis of code changes, justifying the increased complexity through significant improvements in merging quality.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Solution Approach 2:

The patent segments the code merging process into distinct stages: parsing code into abstract syntax trees, detecting semantic differences between versions, and generating merged code. This segmentation allows each stage to be optimized independently, managing overall system complexity while improving semantic analysis accuracy.

Inventive Principle:
Principle #1Segmentation

3Productivity

If conventional Git merging is used, then code changes can be merged, but the output contains a large quantity of conflict blocks requiring manual resolution

Engineering Contradiction:
Improvemerging efficiencyVSAvoidmanual conflict resolution time
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent replaces Git's text-based merging with a semantic-aware merging system that automatically resolves conflicts by understanding code semantics. The system uses abstract syntax trees to identify compatible changes and generates conflict-free merged code, dramatically reducing manual resolution time and improving overall merging efficiency.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Solution Approach 2:

The patent performs preliminary semantic analysis and conflict detection before final code generation. By analyzing abstract syntax trees and identifying semantic differences in advance, the system can pre-resolve conflicts and generate cleaner merged code, reducing the need for manual intervention and saving time.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentEP4075267B1Combination method and apparatus for multiple change versions of software codes
Publication Date: 2025.01.01 HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
  • EP4075267B1 patent drawingFigure 1
  • EP4075267B1 patent drawingFigure 2
  • EP4075267B1 patent drawingFigure 3A

AI summary

This application provides a method and an apparatus for merging a plurality of software code change versions. The merging apparatus may first analyze code change areas in a software code preliminarily merged version and two different software code change versions. After change intents of the two code change areas are determined, the merging apparatus eliminates, based on a conflict elimination rule set and the change intents of the two code change areas, a conflict block in the software code preliminarily merged version. Compared with a manner of eliminating, based on a text, a conflict block in a software code preliminarily merged version, a manner of eliminating the conflict block by analyzing change intents of different code change areas can improve accuracy of eliminating the conflict block, and further implement efficient merging of a plurality of software code change versions.