Controller Model Generation from Binary Code Using ASTs

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods for generating controller models from binary code lack interpretability for subject matter experts, are not scalable for larger or more complex binaries, and are sensitive to noisy data, failing to provide SME-interpretable formats.

Innovation Solution

The approach involves decompiling binary code to isolate mathematical primitives, generating abstract syntax trees (ASTs), and constructing interpretable models using Modelica language, which are then tested and validated through the Functional Mockup Interface (FMI) standard to produce working C or C++ code.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of information

If existing methods are used to generate controller models from binary code, then model generation is possible, but the models lack interpretability for subject matter experts

Engineering Contradiction:
ImproveinterpretabilityVSAvoidmodel accuracy
Core Design Contradiction:
Loss of informationVSReliability

Solution Approach 1:

The patent segments the binary code analysis into distinct components: mathematical primitives extraction, AST generation, and Modelica model construction. This segmentation allows each component to be optimized independently, preserving interpretability while maintaining accuracy through systematic processing of control flow graphs and mathematical operations.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces abstract syntax trees (ASTs) as an intermediary representation between binary code and final models. This intermediary layer preserves the mathematical structure and control logic in a human-readable format, enabling subject matter experts to interpret the models while maintaining fidelity to the original binary code behavior.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Productivity

If existing methods are used to generate controller models, then models can be produced, but they are not scalable for larger or more complex binaries

Engineering Contradiction:
Improvemodel generation speedVSAvoidbinary complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent implements dynamic adaptation of the analysis process based on binary complexity. The system automatically adjusts the level of abstraction and detail in AST generation and model construction, allowing efficient processing of both simple and complex binaries by dynamically selecting appropriate analysis depths and optimization strategies.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent changes key parameters in the model generation process, including the granularity of mathematical primitive extraction, the depth of control flow analysis, and the level of Modelica model detail. These parameter adjustments enable scalable processing across different binary complexities while maintaining generation speed through optimized compilation and caching mechanisms.

Inventive Principle:
Principle #35Parameter changes

3Measurement precision

If existing methods are used to generate controller models, then models can be created, but they are sensitive to noisy data

Engineering Contradiction:
Improvemodel precisionVSAvoidnoise sensitivity
Core Design Contradiction:
Measurement precisionVSObject-affected harmful factors

Solution Approach 1:

The patent implements feedback mechanisms where the generated models are validated against the original binary code behavior through automated testing and verification. This feedback loop identifies and corrects deviations caused by noisy or ambiguous binary data, ensuring high precision by iteratively refining the Modelica models to match the actual control logic.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The patent applies preprocessing filters and validation rules before model generation to cushion against noisy data. By detecting and handling ambiguous instructions, invalid operations, or corrupted binary segments beforehand, the system prevents noise propagation into the final models, maintaining measurement precision through proactive data cleaning and error handling.

Inventive Principle:
Principle #11Beforehand cushioning (Prior cushioning)

Data Source

PatentUS11977868B2Search based approach for generating controller models
Publication Date: 2024.05.07 GENESEE VALLEY INNOVATIONS LLC
  • US11977868B2 patent drawing
  • US11977868B2 patent drawing
  • US11977868B2 patent drawing

AI summary

A method includes obtaining a binary code of a controller. The method also includes decompiling the binary code of the controller to generate a source code. The method further includes generating one or more abstract syntax trees based on the source code. The method further includes generating an interpretable model based on the one or more abstract syntax trees. The interpretable model is interpretable by subject matter experts.