Macro-Service Generation via Graph-Based Code Segmentation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Data scientists face inefficiencies in analytics tasks due to repetitive and non-reusable code, requiring manual copying and tweaking of code segments, which is time-consuming and error-prone when adapting to similar tasks.

Innovation Solution

A method and system for automatically generating macro-services by converting source code into a graph representation, performing queries on this representation to determine a subset, and generating code for the macro-service based on the subset, thereby improving code reusability and reducing human labor in data analytics workflows.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If data scientists write ad-hoc code for each analytics task, then task-specific flexibility is improved, but code reusability deteriorates

Engineering Contradiction:
Improvetask-specific flexibilityVSAvoidcode development time
Core Design Contradiction:
Adaptability or versatilityVSLoss of time

Solution Approach 1:

The system segments analytics code into reusable macro-services that can be independently defined, stored, and executed. By breaking down ad-hoc code into modular components with specific functions, the system enables both task-specific flexibility through custom macro creation and time savings through reuse of existing macros across similar analytics tasks.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system allows parameters of macro-services to be changed and configured for different tasks while maintaining the core functionality. This enables the same macro-service to adapt to various analytics requirements by modifying input parameters, data sources, and output configurations rather than writing entirely new code for each task.

Inventive Principle:
Principle #35Parameter changes

2Adaptability or versatility

If data scientists manually copy and tweak code for similar tasks, then task adaptation is improved, but error rate increases

Engineering Contradiction:
Improvetask adaptation capabilityVSAvoidcode accuracy
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

Instead of manual copying and tweaking, the system provides automated copying of validated macro-services through the graph representation. The system can automatically replicate proven analytics workflows and apply them to new tasks with minimal modification, eliminating manual errors while preserving the ability to adapt to different requirements through parameter adjustments.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The system incorporates feedback mechanisms where the performance and accuracy of macro-services are tracked and evaluated. This feedback loop allows the system to learn from successful analytics tasks and automatically improve future code generation, reducing errors while maintaining adaptability through continuous optimization based on actual task outcomes.

Inventive Principle:
Principle #23Feedback

3Productivity

If repetitive code is written for each analytics task, then task completion is achieved, but productivity decreases

Engineering Contradiction:
Improveanalytics task throughputVSAvoidtime spent on code writing
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The system performs preliminary actions by pre-defining and storing macro-services that contain common analytics operations. Before tackling new analytics tasks, users can leverage these pre-prepared macros, eliminating the need to write repetitive code from scratch. The graph representation allows the system to automatically identify and apply appropriate pre-defined macros, significantly reducing code writing time and increasing productivity.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system creates universal macro-services that can serve multiple analytics tasks across different domains. A single macro-service can be applied to various tasks by changing parameters and data sources, making the codebase highly reusable. This multi-functionality eliminates repetitive coding while maintaining the ability to complete diverse analytics tasks efficiently.

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

Data Source

PatentUS10423416B2Automatic creation of macro-services
Publication Date: 2019.09.24 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US10423416B2 patent drawing
  • US10423416B2 patent drawing
  • US10423416B2 patent drawing

AI summary

This disclosure provides a computer-implemented method for automatically creating a macro-service. The method includes: converting source code of an analytic program that includes a set of operation units into a graph representation. Each of the set of operation units performs at least an operation to a data object, and the method further includes performing a query associated with the macro-service on the graph representation to determine a subset of the graph representation. The method further includes generating code for the macro-service based on the determined subset of the graph representation.