Deep Learning Framework Error Mapping for Third-Party API Failures
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Deep learning frameworks face challenges in providing detailed error information when calling third-party library APIs fail, leading to increased development costs and reduced efficiency for developers.
Innovation Solution
A computer-implemented method and apparatus that acquire error codes and corresponding information, generate an error file, and package it into the deep learning framework, allowing for extraction and generation of richer error reporting content, including error cause and solution details.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of information
If only error codes are displayed when API calling fails, then the error reporting is simple and quick to generate, but the developer cannot obtain detailed error information, increasing development cost and reducing development efficiency
Solution Approach 1:
The patent introduces an intermediary error information processing system that sits between the third-party library API and the developer. When an API call fails, the system captures the error code, queries a local error information database using the error code as a key, retrieves the corresponding detailed error information (including error cause, solution, and other contextual data), and presents this enriched information to the developer. This intermediary mechanism resolves the contradiction by providing comprehensive error information without requiring direct complex integration with the third-party library's internal error handling systems.
Solution Approach 2:
The patent implements preliminary action by pre-building and maintaining a local error information database that maps error codes to detailed error information before runtime errors occur. The database is constructed by collecting error codes and their corresponding detailed information (error causes, solutions, descriptions) from the third-party library's documentation and error handling mechanisms in advance. When an error occurs during API calling, the system simply queries this pre-prepared database using the error code, enabling rapid retrieval of detailed error information without complex real-time analysis, thus resolving the contradiction between information completeness and system complexity.
2Productivity
If detailed error information is provided for every error code, then developer efficiency improves, but the error reporting system becomes more complex and resource-intensive
Solution Approach 1:
The patent applies the copying principle by creating a local copy of the third-party library's error information in the form of a database that mirrors the structure and content of the library's error handling system. Instead of directly accessing or integrating with the complex third-party library's internal error mechanisms, the system copies the essential error code to information mappings into a local database that can be queried efficiently. This copying approach enables comprehensive error information retrieval that improves developer efficiency while keeping the error handling mechanism relatively simple and independent of the third-party library's internal complexity.
3Reliability
If the deep learning framework integrates comprehensive error handling for all third-party APIs, then error information completeness improves, but the framework complexity and maintenance burden increase
Solution Approach 1:
The patent applies the extraction principle by separating the error information storage and retrieval functionality from the core deep learning framework codebase. The error information database is extracted as an independent, modular component that can be maintained and updated separately from the framework's core functionality. When an API calling error occurs, the framework's error handling module extracts the error code, queries the independent database, and retrieves the corresponding detailed information without requiring changes to the framework's core structure. This extraction approach improves error handling reliability by providing comprehensive error information while minimizing the increase in framework structural complexity and maintenance burden.
Data Source
Figure 1
Figure 2~3
AI summary
The present application discloses a method and apparatus for generating error reporting content of a deep learning framework, an electronic device, a readable storage medium, and a computer program product, which relates to the field of deep learning technologies. An implementation solution adopted by the present application to generate error reporting content of a deep learning framework is: acquiring an error code and error information corresponding to the error code; generating an error file according to the error code and the error information corresponding thereto, and packaging the error file into the deep learning framework; running the deep learning framework, and in response to the deep learning framework receiving an error code returned by a third-party library when an error occurs in calling of a third-party library application programming interface (API), extracting, from the error file, error information corresponding to the received error code; and generating error reporting content according to the error information. The present application can automatically generate error reporting content including richer information.