Adversarial Code Language Identification via Pattern Mapping

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing automated code review tools face challenges in accurately determining the programming language of code, as conventional methods are susceptible to deception and require manual input or file extensions, which can be misleading.

Innovation Solution

A code scanning tool that generates a pattern map of string patterns from the code and compares them against a master voting map to identify the programming language, using weights associated with learned patterns to determine the language used.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If conventional methods are used to determine programming language based on manual input or file extensions, then the process is simple to implement, but the accuracy is low and susceptible to deception

Engineering Contradiction:
Improveprogramming language identification accuracyVSAvoidanalysis system complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent replaces manual inspection and file extension checking with automated pattern recognition. The code scanning tool automatically generates pattern maps from code and compares them against learned programming language patterns, substituting human judgment and simple heuristics with systematic automated analysis that is both accurate and scalable.

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

Solution Approach 2:

The code scanning tool performs self-service by automatically determining programming language without requiring manual input from users. The system autonomously generates pattern maps, compares them against the master voting map, and identifies the programming language based on weighted pattern matching, eliminating the need for user intervention in the language detection process.

Inventive Principle:
Principle #25Self-service

2Measurement precision

If automated pattern recognition is used to determine programming language, then the accuracy is improved, but the processing time increases

Engineering Contradiction:
Improveprogramming language identification accuracyVSAvoidcode analysis time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The system performs preliminary action by pre-computing and storing learned programming language patterns in a master voting map during an offline training phase. This allows the online code analysis to directly compare generated pattern maps against pre-established patterns without performing complex learning computations, significantly reducing processing time while maintaining high accuracy.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent segments the code analysis process into distinct phases: generating a pattern map from the code, comparing it against the master voting map, and determining the programming language based on weighted pattern matching. This segmentation allows each phase to be optimized independently, improving overall efficiency while maintaining accuracy.

Inventive Principle:
Principle #1Segmentation

3Reliability

If comprehensive pattern analysis is performed on all code, then the reliability is improved, but the computational resources required increase

Engineering Contradiction:
Improveprogramming language identification reliabilityVSAvoidcomputational resource consumption
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

The system applies partial action by using a weighted pattern matching approach where not all patterns contribute equally to the language determination. The master voting map assigns weights to different patterns based on their discriminative power, allowing the system to focus computational resources on the most informative patterns while maintaining high reliability in language identification.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS11360764B2Adversarial language analysis for code scanning
Publication Date: 2022.06.14 ORACLE INT CORP
  • US11360764B2 patent drawing
  • US11360764B2 patent drawing
  • US11360764B2 patent drawing

AI summary

Techniques to determine a programming language of a set of code based on learned programming language patterns. One technique includes receiving a set of code, generating a pattern map of discovered string patterns from the set of code, comparing the string patterns included within the pattern map against learned programming language patterns included with a master voting map to identify one or more profiled programming languages that utilize the learned programming, language patterns that match the string patterns, generating a score card for the set of code by tallying scores for the one or more profiled programming languages based on the comparing, and determining one or more programming languages used to write the set of code based on the score card.