Program Statement Similarity Through Heterogeneous Diagram Matching

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing technologies for determining similarity between program statements fail to utilize structural and hierarchical information, lacking the capability to capture internal execution logic and data calculation processes, leading to inaccurate and inefficient similarity calculations.

Innovation Solution

Convert program statements into heterogeneous diagrams to calculate similarity through heterogeneous diagram matching, considering syntactic and structural features, thereby capturing internal logic and data processing flows.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If program statement similarity is determined using existing technologies, then the process is simple, but the accuracy is low because structural and hierarchical information is not utilized

Engineering Contradiction:
Improvesimilarity calculation accuracyVSAvoidmethod complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent segments program statements into heterogeneous diagrams by dividing them into statement tokens and their relationships. This segmentation allows the system to analyze structural and hierarchical information at a granular level, improving similarity calculation accuracy by comparing individual components and their connections rather than treating statements as monolithic units.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent transforms one-dimensional program statements into two-dimensional heterogeneous diagrams with nodes and edges representing statement tokens and their relationships. This dimensional transformation enables the capture of structural and hierarchical information that cannot be represented in linear text, thereby improving similarity measurement by considering both syntactic and semantic dimensions.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

2Measurement precision

If program statements are converted into heterogeneous diagrams for similarity calculation, then the accuracy improves by capturing internal logic, but the computational efficiency decreases

Engineering Contradiction:
Improvesimilarity calculation accuracyVSAvoidcalculation efficiency
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent applies preliminary action by pre-processing program statements into heterogeneous diagrams with standardized node and edge representations before similarity calculation. This pre-structuring organizes the data in a way that facilitates efficient comparison operations, allowing the system to leverage the organized structure during the actual similarity computation rather than processing raw text from scratch.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent creates simplified copies of program statements in the form of heterogeneous diagrams that preserve essential structural and hierarchical information while discarding redundant details. These diagrammatic copies serve as efficient representations for comparison, capturing the core logical structure needed for similarity assessment without the full complexity of the original statements.

Inventive Principle:
Principle #26Copying

3Adaptability or versatility

If existing similarity determination methods are used, then the processing speed is fast, but the capability to understand user intention and handle diverse expressions is limited

Engineering Contradiction:
Improvecapability to handle diverse expressionsVSAvoidprocessing time
Core Design Contradiction:
Adaptability or versatilityVSLoss of time

Solution Approach 1:

The patent segments program statements into heterogeneous diagrams by dividing them into statement tokens and their relationships. This segmentation allows the system to analyze structural and hierarchical information at a granular level, improving similarity calculation accuracy by comparing individual components and their connections rather than treating statements as monolithic units.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent transforms one-dimensional program statements into two-dimensional heterogeneous diagrams with nodes and edges representing statement tokens and their relationships. This dimensional transformation enables the capture of structural and hierarchical information that cannot be represented in linear text, thereby improving similarity measurement by considering both syntactic and semantic dimensions.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

Data Source

PatentUS20250252100A1Method, apparatus, electronic device and computer program product for determining similarity
Publication Date: 2025.08.07 BEIJING VOLCANO ENGINE TECH CO LTD
  • US20250252100A1 patent drawing
  • US20250252100A1 patent drawing
  • US20250252100A1 patent drawing

AI summary

Embodiments of the present disclosure relate to a method, an apparatus, an electronic device, and a computer program product for determining similarity. The method includes obtaining a first program statement and a second program statement. The method also includes generating a first heterogeneous diagram corresponding to the first program statement and a second heterogeneous diagram corresponding to the second program statement. In addition, the method also includes determining the similarity between the first program statement and the second program statement based on the first heterogeneous diagram and the second heterogeneous diagram. Therefore, with the solution proposed in the embodiments of the present disclosure, a program statement can be converted into a heterogeneous diagram to calculate similarity through heterogeneous diagram matching.