A Python plugin loading method for EDA software

By optimizing the plugin loading process of EDA software through a centralized plugin registry, lazy loading, and multi-process loading framework, the problem of excessive plugin loading time was solved, software performance and user experience were improved, and rapid exception handling was achieved.

CN119883432BActive Publication Date: 2025-10-28SANWEI ELECTRONIC TECH (SUZHOU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510120469.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-25
Publication Date
2025-10-28
Estimated Expiration
2045-01-25

AI Technical Summary

Technical Problem

The excessively long plugin loading time in EDA software affects program startup speed and overall performance, and it lacks an effective exception handling mechanism.

Method used

A centralized plugin registry is used to manage plugin dependencies. A lazy loading strategy and a multi-process loading framework are employed, along with an exception monitoring and feedback mechanism, to optimize the plugin loading process.

Benefits of technology

It improves plugin loading efficiency, reduces EDA software startup time, enhances performance and user experience, and enables quick identification and resolution of plugin anomalies, while also supporting feature expansion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883432B_ABST
    Figure CN119883432B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of plugin loading technology, specifically disclosing a Python plugin loading method based on EDA software. The method includes: creating a plugin registry, reading basic plugin information, parsing plugin dependencies, registering the current plugin in the plugin registry, declaring plugin dependencies, and determining the loading order of plugins with dependencies. The EDA software employs a lazy loading strategy upon startup; when a plugin needs to be loaded and has dependencies on other plugins, it loads the plugins according to the loading order. When multiple plugins need to be loaded, they are assigned to different processes for loading. Loaded plugins and their status information are cached in local storage, and the plugins and their status information are read directly from local storage upon the next startup. This invention optimizes the plugin loading process, improves plugin loading efficiency, reduces application software startup time, and enhances user experience. This invention is applicable to plugin loading.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of plugin loading technology, specifically a Python plugin loading method based on EDA software. Background Technology

[0002] With the widespread application of EDA tools in integrated circuit and electronic system design, user demands for software functionality are constantly increasing. However, some modules of EDA software may have defects or incomplete functions. To compensate for these shortcomings, functionality can be extended by integrating plug-ins. A plug-in refers to a code segment with specific functions that cannot execute independently and must rely on a framework to execute. Plug-in technology typically involves a main framework that loads and executes plug-ins, along with many plug-ins with different functions to extend the program's functionality. The main framework provides basic functions such as plug-in loading, scheduling, and concurrency, while plug-ins provide specific functionalities, each responsible for a small number of different functions. As the required functions of EDA software continue to increase, the number of plug-ins also increases, which may lead to excessively long plug-in loading times, thus affecting the startup speed of plug-in programs and overall performance. Summary of the Invention

[0003] The purpose of this invention is to provide a Python plugin loading method based on EDA software to optimize the plugin loading process, effectively improve plugin loading efficiency, reduce application software startup time, and enhance user experience.

[0004] To achieve the above objectives, the present invention employs the following technical methods:

[0005] A method for loading Python plugins based on EDA software includes the following steps:

[0006] S1. Create a centralized plugin registry. The plugin registry is used to record the basic information of plugins. When each plugin is installed, the basic information of the current plugin is automatically read, the dependency relationship between the current plugin and other plugins in the plugin registry is resolved, the current plugin is registered in the plugin registry, the dependency relationship between plugins is declared, and the loading order of plugins with dependencies is determined.

[0007] S2. When the EDA software starts, it adopts a lazy loading strategy and does not load plugins. The actual loading process of the associated plugins is triggered only when the user requests to use a specific function. When the plugin to be loaded has dependencies on other plugins, the plugin and other plugins with dependencies are loaded according to the loading order determined in step S1. When multiple plugins that do not have direct dependencies or whose dependencies are already satisfied need to be loaded, multiple plugins are assigned to different processes for loading through a multi-process loading framework.

[0008] S3. Cache the loaded plugins and their status information in local storage, and read the plugins and their status information directly from local storage on the next startup.

[0009] As a limitation: the specific method for parsing the dependency relationship between the current plugin and other plugins in the plugin registry in step S1 is as follows: the plugin file is a JSON file, the json library in Python is used as the parsing tool, a custom ActionPlugins class is used to store the basic information and dependency information of the plugin, a parsing function is written to extract the basic information and dependency information of the plugin, and the version compatibility between plugins with dependency relationships is verified to parse the dependency relationship between the current plugin and other plugins in the plugin registry.

[0010] As a limitation: the basic information of the plugin in step S1 includes the plugin name, plugin version and plugin installation path.

[0011] As a limitation: in step S1, the loading order of plugins with dependencies is determined by a topological sorting algorithm.

[0012] As a limitation, step S2 also includes: using the traceback library in Python to monitor the loading process of the plugin in real time, capturing any abnormal situations that occur, recording the abnormal situation log, displaying the details of the abnormal situation, and forming an abnormal handling and feedback mechanism.

[0013] As a limitation: the lazy loading strategy in step S2 is implemented through a hook mechanism, using a callback function as a hook. When it is actually necessary to load and use one or more plugins, the corresponding plugin loading logic is called through this callback function.

[0014] As a limitation: the multiprocessing loading framework in step S2 uses Python's multiprocessing library.

[0015] The beneficial effects achieved by this invention, due to the adoption of the above-described solution, compared with the prior art, are as follows:

[0016] This invention provides a Python plugin loading method for EDA software. It establishes a centralized plugin registry for unified management of plugins within the EDA software, loads plugins sequentially based on their dependencies, employs a lazy loading strategy during EDA software startup to reduce startup time, and designs a multi-process loading framework to load multiple plugins simultaneously, achieving parallel loading and improving loading efficiency. Furthermore, by caching loaded plugins and their status information in local storage, the method directly retrieves plugins and their status information from local storage upon subsequent startups, avoiding repeated parsing and loading processes. This optimizes the plugin loading process, significantly improving loading efficiency and enhancing the performance and user experience of the EDA software. The invention also includes an exception handling and feedback mechanism to monitor exceptions during plugin loading in real time, record exception information, and provide feedback, facilitating developers' rapid identification and resolution of plugin issues. This allows for more efficient problem-solving during plugin debugging, facilitating plugin development and maintenance, and providing reliable support for the functional expansion of EDA software.

[0017] This invention is applicable to loading Python plugins in EDA software. Attached Figure Description

[0018] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.

[0019] Figure 1 This is a flowchart illustrating a Python plugin loading method based on EDA software, as described in an embodiment of the present invention. Detailed Implementation

[0020] The present invention will be further described below with reference to the embodiments. However, those skilled in the art should understand that the present invention is not limited to the following embodiments. Any improvements and equivalent changes made based on the specific embodiments of the present invention are within the scope of protection of the claims of the present invention.

[0021] Example: A Python plugin loading method based on EDA software

[0022] A method for loading Python plugins based on EDA software, such as... Figure 1 As shown, it includes the following steps:

[0023] S1. Create a centralized plugin registry to record basic plugin information. Each plugin's basic information is automatically read upon installation. Plugin files are in JSON format, and the json library in Python is used as the parsing tool. A custom `ActionPlugins` class stores the plugin's basic and dependency information. A parsing function is written to extract the plugin's basic and dependency information, verify version compatibility between plugins with dependencies, parse the dependencies between the current plugin and other plugins in the registry, register the current plugin in the registry, and declare the dependencies between the current plugin and other plugins in the registry. A topological sorting algorithm is used to determine the loading order of plugins with dependencies. The basic plugin information includes the plugin name, plugin version, and plugin installation path.

[0024] S2. When the EDA software starts, it adopts a lazy loading strategy and does not load plugins. When the user requests to use a specific function, the actual loading process of the associated plugin is triggered. In this embodiment, the lazy loading strategy is implemented through a hook mechanism, using a callback function as a hook. When it is actually necessary to load and use one or more plugins, the corresponding plugin loading logic is called through this callback function, which reduces the startup time of the EDA software.

[0025] When a plugin that needs to be loaded has dependencies on other plugins, the plugin and other plugins that have dependencies on it are loaded according to the loading order determined in step S1.

[0026] When multiple plugins that have no direct dependencies or whose dependencies are already satisfied need to be loaded, a multi-process loading framework is used to distribute the plugins to different processes for loading, thereby achieving parallel loading of plugins and improving the loading efficiency of plugins; the multi-process loading framework in this embodiment uses Python's multiprocessing library.

[0027] By utilizing the traceback library in Python, the plugin loading process can be monitored in real time, capturing any exceptions and recording exception logs. The exception details are displayed, forming an exception handling and feedback mechanism. This enables developers to solve problems more efficiently during plugin debugging, facilitating plugin development and maintenance. Exception details include the exception type, exception message, and the line of source code in which the exception occurred.

[0028] S3. Cache the loaded plugins and their status information in local storage. The status information includes whether the plugin was successfully loaded, whether the plugin is running normally, and whether there are process failures during plugin operation. Read the plugins and their status information directly from local storage on the next startup to avoid repeated parsing and loading.

Claims

1. A method for loading Python plugins based on EDA software, characterized in that, The following steps are involved: S1. Create a centralized plugin registry. The plugin registry is used to record the basic information of plugins. When each plugin is installed, the basic information of the current plugin is automatically read, the dependency relationship between the current plugin and other plugins in the plugin registry is resolved, the current plugin is registered in the plugin registry, the dependency relationship between plugins is declared, and the loading order of plugins with dependencies is determined. S2 and EDA software use a lazy loading strategy when they start up, and do not load plugins. The actual loading process of the associated plugins is only triggered when the user requests to use a specific function. When a plugin that needs to be loaded has dependencies on other plugins, the plugin and other plugins that have dependencies on it are loaded according to the loading order determined in step S1; when multiple plugins that do not have direct dependencies or whose dependencies have been satisfied need to be loaded, the multiple plugins are assigned to different processes for loading through a multi-process loading framework. S3. Cache the loaded plugins and their status information in local storage, and read the plugins and their status information directly from local storage on the next startup; the status information includes whether the plugin was successfully loaded, whether the plugin is running normally, and whether there are any process failures during plugin operation.

2. The Python plugin loading method based on EDA software according to claim 1, characterized in that, The specific method for parsing the dependency relationship between the current plugin and other plugins in the plugin registry in step S1 is as follows: the plugin file is a JSON file, the json library in Python is used as the parsing tool, a custom ActionPlugins class is used to store the basic information and dependency information of the plugin, a parsing function is written to extract the basic information and dependency information of the plugin, and the version compatibility between plugins with dependency relationships is verified to parse the dependency relationship between the current plugin and other plugins in the plugin registry.

3. A Python plugin loading method based on EDA software according to claim 1 or 2, characterized in that, The basic information of the plugin in step S1 includes the plugin name, plugin version, and plugin installation path.

4. A Python plugin loading method based on EDA software according to claim 1 or 2, characterized in that, In step S1, the loading order of plugins with dependencies is determined by a topological sorting algorithm.

5. A Python plugin loading method based on EDA software according to claim 1 or 2, characterized in that, Step S2 also includes: using the traceback library in Python to monitor the loading process of the plugin in real time, capturing any abnormal situations that occur, recording the abnormal situation log, displaying the details of the abnormal situation, and forming an abnormal handling and feedback mechanism.

6. A Python plugin loading method based on EDA software according to claim 1 or 2, characterized in that, In step S2, the lazy loading strategy is implemented through a hook mechanism. A callback function is used as a hook. When it is actually necessary to load and use one or more plugins, the corresponding plugin loading logic is called through this callback function.

7. A Python plugin loading method based on EDA software according to claim 1 or 2, characterized in that, In step S2, the multiprocess loading framework uses Python's multiprocessing library.

Citation Information

Patent Citations

  • Micro kernel pluggable program application system and implementation method thereof

    CN102141922A

  • Method for optimizing logic performance of plug-in downloading verification, equipment and computer system

    CN107391177A