Dynamic Code Analysis Algorithm Generation for Service Scenarios

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing code clone analysis methods rely on fixed features and algorithms, which fail to meet the specific requirements of different service scenarios, leading to inaccurate and ineffective analysis results.

Innovation Solution

A code analysis method and system that generates a customized code analysis algorithm based on the specific service scenario, allowing users to select algorithm features and operators from a preset library to tailor the analysis to their needs.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If fixed features and methods are used for code clone analysis, then the analysis process is simple and fast, but the analysis result cannot meet actual service requirements

Engineering Contradiction:
Improveanalysis result accuracyVSAvoidalgorithm complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent implements dynamic algorithm generation by allowing the code analysis system to adaptively select and configure analysis algorithms based on different service scenarios. The system transitions from static fixed methods to dynamic scenario-based algorithm selection, where the analysis approach changes according to the specific requirements of each service scenario, thereby improving analysis accuracy without requiring a completely complex system architecture

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent applies parameter changes by adjusting algorithm configuration parameters based on service scenario characteristics. Different service scenarios have different parameter settings for code analysis, such as similarity thresholds, analysis depth, and feature weights. By dynamically changing these parameters according to the scenario, the system achieves accurate analysis results while maintaining reasonable algorithm complexity

Inventive Principle:
Principle #35Parameter changes

2Adaptability or versatility

If a common code analysis algorithm is used for all code, then the algorithm is simple to implement, but it cannot meet specific requirements of different service scenarios

Engineering Contradiction:
Improveservice scenario adaptabilityVSAvoidsystem complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent segments the code analysis system into multiple independent components: service scenario identification module, algorithm selection module, configuration parameter setting module, and analysis execution module. Each module handles a specific aspect of the analysis process, allowing the system to adapt to different service scenarios through modular configuration rather than requiring a completely different algorithm for each scenario, thus balancing adaptability with manageable system complexity

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent creates a universal code analysis system that can handle multiple service scenarios through a single unified platform. The system uses a scenario-based approach where the same underlying infrastructure supports diverse analysis requirements by dynamically configuring algorithms and parameters according to the identified service scenario, achieving multi-functionality without proportionally increasing system complexity

Inventive Principle:
Principle #6Universality (Multi-functionality)

3Productivity

If manual maintenance is performed on numerous code clone instances, then flexibility is high, but maintenance costs and time consumption increase significantly

Engineering Contradiction:
Improvecode analysis efficiencyVSAvoidclone instance tracking accuracy
Core Design Contradiction:
ProductivityVSLoss of information

Solution Approach 1:

The patent implements feedback mechanisms where the code analysis system continuously monitors analysis results and service scenario outcomes. Based on this feedback, the system automatically adjusts algorithm parameters and selection strategies to improve analysis efficiency. The feedback loop ensures that while automation increases productivity, the system maintains accurate tracking of code clone instances by learning from previous analysis results and correcting any information loss or inaccuracies

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS12204896B2Code analysis method and system, and computing device
Publication Date: 2025.01.21 HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
  • US12204896B2 patent drawing
  • US12204896B2 patent drawing
  • US12204896B2 patent drawing

AI summary

In a code analysis method, a code analysis system obtains information about a service scenario that represents an objective of code analysis. The code analysis system generates a code analysis algorithm for the service scenario based on the information about the service scenario. When code analysis needs to be performed, the code analysis system obtains information about source code and object code that are specified by a user, and analyzes similarity between the source code and the object code according to the code analysis algorithm to obtain an analysis result. The similarity between the source code and the object code is analyzed according to the code analysis algorithm generated based on the information about the service scenario, to obtain the analysis result that meets a requirement of the service scenario.