# US 12,118,336 B2 · Method for presenting associated conflict block and device

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 12,118,336 B2
- Document ID: US12118336B2
- Status: Granted
- Kind: B2
- Application number: 17/852,721
- Filed: 2022-06-29
- Published: 2022-10-20
- Granted: 2024-10-15
- Earliest claimed: 2019-12-31
- Assignees: Huawei Cloud Computing Technologies Co., Ltd.
- Applicants: Huawei Cloud Computing Technologies Co., Ltd.
- Inventors: Zhao Wei; Guangtai Liang; Shanbin Cheng; Qianxiang Wang
- Web page: https://patentgrep.com/patent/US12118336B2

## CPC

- G06F 8/433: {Dependency analysis; Data or control flow analysis}
- G06F 8/71: Version control (security arrangements therefor G06F21/57); Configuration management
- G06F 8/33: Intelligent editors
- G06F 8/75: Structural analysis for program understanding
- G06F 8/77: Software metrics
- G06F 11/3604: Analysis of software for verifying properties of programs (testing of software G06F11/3668)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method for presenting an associated conflict block comprises obtaining a first conflict file comprising a plurality of first code blocks, wherein a second code block of the first code blocks comprises a first code snippet of a current version of the second code block, a second code snippet of a basic version of the second code block, and a third code snippet of a to-be-merged version of the second code block. A first instruction triggered on a user interface for activating a to-be-processed code block is received, wherein a first type of the to-be-processed code block is of an unresolved conflict block or a single-side change block. A fourth code snippet comprised in the to-be-processed code block and indexes of N associated code blocks of the to-be-processed code block is presented on the user interface.

## Claims

### Claim 1

A method for presenting an associated conflict block and comprising:
obtaining a first conflict file comprising a plurality of first code blocks, wherein a second code block of the first code blocks comprises a first code snippet of a current version of the second code block, a second code snippet of a basic version of the second code block, and a third code snippet of a to-be-merged version of the second code block;
receiving, from a user interface, a first instruction for activating a to-be-processed code block, wherein a first type of the to-be-processed code block is an unresolved conflict block or a single-side change block;
presenting, on the user interface in response to the first instruction, a fourth code snippet comprised in the to-be-processed code block and indexes of N associated code blocks of the to-be-processed code block, wherein a second type of each of the N associated code blocks is one of the unresolved conflict block, the single-side change block, or a resolved conflict block, wherein an association relationship between each of the N associated code blocks and the to-be-processed code block is one of a dependency relationship, a depended relationship, or a similarity relationship, and wherein N is greater than or equal to 1;
receiving, from the user interface, a second instruction for activating one of the N associated code blocks by clicking an index of the N associated code blocks; and
switching the user interface from presenting the fourth code snippet to presenting a fifth code snippet comprised in the one of the N associated code blocks.

### Claim 2 (depends on 1)

The method of claim 1, wherein the user interface has a dependency group, a depended group, and a similarity group, and wherein the method further comprises further presenting the index in the dependency group based on the association relationship.

### Claim 3 (depends on 1)

The method of claim 1, wherein before presenting the indexes, the method further comprises determining at least one associated code block of the to-be-processed code block from the first conflict file.

### Claim 4 (depends on 1)

The method of claim 1, wherein before presenting the indexes, the method further comprises:
obtaining a second conflict file; and
determining at least one associated code block of the to-be-processed code block from the second conflict file.

### Claim 5 (depends on 3)

The method of claim 3, further comprising:
determining, from the first conflict file based on usage of a variable and a function in the to-be-processed code block in a third code block of the first conflict file, a first associated code block comprising the dependency relationship with the to-be-processed code block and a second associated code block comprising the depended relationship with the to-be-processed code block; and
determining, from the first conflict file based on a token string and an abstract syntax subtree that are corresponding to each code snippet comprised in the to-be-processed code block, a third associated code block comprising the similarity relationship with the to-be-processed code block.

### Claim 6 (depends on 1)

The method of claim 1, wherein the user interface has a dependency group, a depended group, and a similarity group, and wherein the method further comprises further presenting the index in the depended group based on an association relationship between each of the N associated code blocks and the to-be-processed code block.

### Claim 7 (depends on 1)

The method of claim 1, wherein the user interface has a dependency group, a depended group, and a similarity group, and wherein the method further comprises further presenting the index in the similarity group based on an association relationship between each of the N associated code blocks and the to-be-processed code block.

### Claim 8 (depends on 3)

The method of claim 3, further comprising determining, from the first conflict file based on usage of a variable and a function in the to-be-processed code block in a third code block of the first conflict file, a first associated code block comprising the dependency relationship with the to-be-processed code block and a second associated code block comprising the depended relationship with the to-be-processed code block.

### Claim 9 (depends on 3)

The method of claim 3, further comprising determining, from the first conflict file based on usage of a variable in the to-be-processed code block in a third code block of the first conflict file, a first associated code block comprising the dependency relationship with the to-be-processed code block and a second associated code block comprising the depended relationship with the to-be-processed code block.

### Claim 10 (depends on 3)

The method of claim 3, further comprising determining, from the first conflict file based on usage of a function in the to-be-processed code block in a third code block of the first conflict file, a first associated code block comprising the dependency relationship with the to-be-processed code block and a second associated code block comprising the depended relationship with the to-be-processed code block.

### Claim 11 (depends on 3)

The method of claim 3, further comprising determining, from the first conflict file based on a token string and an abstract syntax subtree that are corresponding to each code snippet comprised in the to-be-processed code block, an associated code block comprising the similarity relationship with the to-be-processed code block.

### Claim 12

A terminal device comprising:
a memory configured to store program instructions; and
a processor coupled to the memory and configured to execute the program instructions to cause the terminal device to:
obtain a first conflict file comprising a plurality of first code blocks, wherein a second code block of the first code blocks comprises a first code snippet of a current version of the second code block, a second code snippet of a basic version of the second code block, and a third code snippet of a to-be-merged version of the second code block;
receive, from a user interface, a first instruction for activating a to-be-processed code block, wherein a first type of the to-be-processed code block is of an unresolved conflict block or a single-side change block;
present, on the user interface in response to the first instruction, a fourth code snippet comprised in the to-be-processed code block and indexes of N associated code blocks of the to-be-processed code block, wherein a second type of each of the N associated code blocks is one of the unresolved conflict block, the single-side change block, or a resolved conflict block, wherein an association relationship between each of the N associated code blocks and the to-be-processed code block is one of a dependency relationship, a depended relationship, or a similarity relationship, and wherein N is greater than or equal to 1;
receive, from the user interface, a second instruction for activating one of the N associated code blocks by clicking an index of the N associated code blocks; and
switch the user interface from presenting the fourth code snippet to presenting a fifth code snippet comprised in the one of the N associated code blocks.

### Claim 13 (depends on 12)

The terminal device of claim 12, wherein the user interface has a dependency group, a depended group, and a similarity group, and wherein the processor is further configured to execute the program instructions to cause the terminal device to further present the index in the dependency group based on the association relationship.

### Claim 14 (depends on 12)

The terminal device of claim 12, wherein before presenting the indexes, the processor is further configured to execute the program instructions to cause the terminal device to determine at least one associated code block of the to-be-processed code block from the first conflict file.

### Claim 15 (depends on 13)

The terminal device of claim 13, wherein the processor is further configured to execute the program instructions to cause the terminal device to:
determine, from the first conflict file based on usage of a variable or a function in the to-be-processed code block in a third code block of the first conflict file, a first associated code block comprising the dependency relationship with the to-be-processed code block and a second associated code block comprising the depended relationship with the to-be-processed code block; or
determine, from the first conflict file based on a token string and an abstract syntax subtree that are corresponding to each code snippet comprised in the to-be-processed code block, a third associated code block comprising the similarity relationship with the to-be-processed code block.

### Claim 16 (depends on 12)

The terminal device of claim 12, wherein the user interface has a dependency group, a depended group, and a similarity group, and wherein the processor is further configured to execute the program instructions to cause the terminal device to further present the index in the depended group based on the association relationship.

### Claim 17 (depends on 12)

The terminal device of claim 12, wherein the user interface has a dependency group, a depended group, and a similarity group, and wherein the processor is further configured to execute the program instructions to cause the terminal device to further present the index in the similarity group based on the association relationship.

### Claim 18

A computer program product comprising computer-executable instructions that are stored on a non-transitory computer-readable medium and that, when executed by a processor, cause an apparatus to:
obtain a first conflict file comprising a plurality of first code blocks, wherein a second code block of the first code blocks comprises a first code snippet of a current version of the second code block, a second code snippet of a basic version of the second code block, and a third code snippet of a to-be-merged version of the second code block;
receive, from a user interface, a first instruction for activating a to-be-processed code block, wherein a first type of the to-be-processed code block is of an unresolved conflict block or a single-side change block;
present, on the user interface and in response to the first instruction, a fourth code snippet comprised in the to-be-processed code block and indexes of N associated code blocks of the to-be-processed code block, wherein a second type of each of the N associated code blocks is one of the unresolved conflict block, the single-side change block, or a resolved conflict block, wherein an association relationship between each of the N associated code blocks and the to-be-processed code block is one of a dependency relationship, a depended relationship, or a similarity relationship, and wherein N is greater than or equal to 1;
receive, from the user interface, a second instruction for activating one of the N associated code blocks by clicking an index of the N associated code blocks; and
switch the user interface from presenting the fourth code snippet to presenting a fifth code snippet comprised in the one of the N associated code blocks.

### Claim 19 (depends on 18)

The computer program product of claim 18, wherein the user interface has a dependency group, a depended group, and a similarity group.

### Claim 20 (depends on 19)

The computer program product of claim 19, wherein the instructions, when executed by the processor, cause the apparatus to further present the index in the dependency group based on the association relationship.
