Method and device for dynamically integrating third-party plug-ins
By performing dependency analysis and packaging of third-party plugins, and utilizing class loaders to achieve hot loading and environment isolation of plugins, the problems of dependency package conflicts and business interruptions in enterprise-level systems are solved, improving the efficiency and security of plugin integration management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- IND BANK CO
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-24
AI Technical Summary
Existing technologies lack a method to securely and smoothly integrate multiple third-party plugins dynamically while ensuring stable system operation. Especially in enterprise-level systems, dependency conflicts of third-party toolkits can lead to system instability and frequent restarts that affect business continuity.
By performing dependency analysis and packaging third-party software development kits into plugin packages, deploying them to a shared directory and updating system configurations, and using a class loader to load class files from the plugin packages, registering call numbers and binding them to business scenarios, hot reloading and environment isolation are achieved, ensuring secure calls to plugin functions.
It enables hot loading, environment isolation, and secure invocation of third-party plugins, improving the efficiency of system plugin integration management and the accuracy of function invocation, resolving dependency conflicts and business interruption issues, and ensuring system stability and security.
Smart Images

Figure CN121918897A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer software technology, and in particular to a method and apparatus for dynamically integrating third-party plugins. Background Technology
[0002] In the development and operation of enterprise-level open platforms and internal mainline architecture systems, it is often necessary to integrate functional plugins or software development kits provided by numerous third-party systems. These third-party components often have specific requirements such as personalized network protocol adaptation, data verification and signature, and encryption / decryption. More challenging is that different third-party toolkits may depend on different or even conflicting versions of basic libraries. When they are directly introduced into the main system, dependency conflicts are highly likely to occur, leading to system instability. Furthermore, for enterprise-level systems requiring high availability, frequent restarts to update or load new features are unacceptable, severely impacting business continuity. Current technologies lack a method that can securely and smoothly integrate multiple third-party plugins dynamically while ensuring system stability. Summary of the Invention
[0003] This invention provides a method for dynamically integrating third-party plugins, enabling hot loading, environment isolation, and secure invocation of third-party plugins, thereby improving the efficiency of system plugin integration management and the accuracy of function invocation. The method includes:
[0004] By performing dependency analysis on third-party software development kits and packaging them, a plugin package for the target plugin is formed.
[0005] Deploy the plugin package to a specified directory that is shared with multiple instances of the target system, and update the configuration information of the target system;
[0006] The target system integrates the target plugin in the following manner:
[0007] In response to the update of the configuration information, the plugin package is read from the specified directory and decompressed; a corresponding class loader is created for the plugin package; the class files in the plugin package are loaded using the class loader; a call number is registered for the loaded plugin, and the call number is bound to the corresponding business scenario;
[0008] When the target system needs to call the target plugin function in the corresponding business scenario, the call number corresponding to the business scenario is verified; after verification, the context class loader of the current execution thread of the target system is switched to the class loader of the target plugin and the function of the target plugin is executed; after the call is completed, the context class loader is switched back.
[0009] This invention also provides a device for dynamically integrating third-party plugins, enabling hot loading, environment isolation, and secure invocation of third-party plugins, thereby improving the efficiency of system plugin integration management and the accuracy of function invocation. The device includes:
[0010] The plugin package packaging module is used to perform dependency analysis on third-party software development kits and package them into a plugin package for the target plugin.
[0011] The plugin package deployment module is used to deploy the plugin package to a specified directory that is shared and accessed by multiple instances of the target system, and to update the configuration information of the target system;
[0012] The target system integrates the target plugin in the following manner:
[0013] In response to the update of the configuration information, the plugin package is read from the specified directory and decompressed; a corresponding class loader is created for the plugin package; the class files in the plugin package are loaded using the class loader; a call number is registered for the loaded plugin, and the call number is bound to the corresponding business scenario;
[0014] When the target system needs to call the target plugin function in the corresponding business scenario, the call number corresponding to the business scenario is verified; after verification, the context class loader of the current execution thread of the target system is switched to the class loader of the target plugin and the function of the target plugin is executed; after the call is completed, the context class loader is switched back.
[0015] This invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described method for dynamically integrating third-party plugins.
[0016] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for dynamically integrating third-party plugins.
[0017] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described method for dynamically integrating third-party plugins.
[0018] In this embodiment of the invention, a plugin package for the target plugin is formed by performing dependency analysis and packaging a third-party software development kit; the plugin package is deployed to a designated directory shared with multiple instances of the target system, and the configuration information of the target system is updated; the target system integrates the target plugin in the following manner: in response to the update of the configuration information, the plugin package is read from the designated directory and decompressed; a corresponding class loader is created for the plugin package; the class files in the plugin package are loaded using the class loader; a call number is registered for the loaded plugin, and the call number is bound to the corresponding business scenario; when the target system needs to call the function of the target plugin in the corresponding business scenario, the call number corresponding to the business scenario is verified; after verification, the context class loader of the current execution thread of the target system is switched to the class loader of the target plugin and the function of the target plugin is executed; after the call is completed, the context class loader is switched back. This invention provides a solution for dependency analysis and packaging of third-party software development kits into self-contained plugin packages. These packages are then deployed to a shared directory, and system configurations are updated. Each instance of the target system responds to configuration changes by automatically reading and decompressing the plugin package and creating an independent class loader for each plugin to load class files, thus achieving complete runtime environment isolation. The target system then registers plugin call numbers and binds them to specific business scenarios, constructing a refined access control layer. When a plugin function needs to be called in a corresponding scenario, the call number is used for verification, and the context class loader of the execution thread is dynamically switched before and after execution. This ensures normal function calls while resolving dependency conflicts, business interruptions, and interface abuse issues faced by enterprise systems when integrating third-party components. It achieves hot loading, environment isolation, and secure calling of third-party plugins, improving the efficiency of system plugin integration management and the accuracy of function calls. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:
[0020] Figure 1 This is a flowchart illustrating a method for dynamically integrating third-party plugins according to an embodiment of the present invention.
[0021] Figure 2 This is a specific example diagram of the calling process of an access control module in an embodiment of the present invention;
[0022] Figure 3This is a specific example diagram illustrating the module structure of a dynamically integrated third-party plugin system in an embodiment of the present invention;
[0023] Figure 4 This is a schematic diagram of the structure of a device for dynamically integrating third-party plugins according to an embodiment of the present invention;
[0024] Figure 5 This is a schematic diagram of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0026] In this document, the term "and / or" merely describes a relationship, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.
[0027] In the description of this specification, the terms "comprising," "including," "having," and "containing" are open-ended terms, meaning that they include but are not limited to. The terms "an embodiment," "a specific embodiment," "some embodiments," and "for example," etc., refer to specific features, structures, or characteristics described in connection with that embodiment or example that are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, or characteristics described can be combined in any suitable manner in one or more embodiments or examples. The order of steps involved in the various embodiments is used to illustrate the implementation of this application, and the order of steps is not limited and can be adjusted appropriately as needed.
[0028] The acquisition, storage, use, and processing of data in this application comply with relevant regulations. The information collected in this application is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure, and application of related data all comply with relevant standards, necessary confidentiality measures have been taken, and they do not violate public order and good morals. Corresponding operation interfaces are provided for users to choose to authorize or refuse.
[0029] It should be noted that in the embodiments of this application, certain existing solutions in the industry, such as software, components, and models, may be mentioned. For example, some existing software tools, components, algorithm models, or solutions well-known in other technical fields may be cited. These should be considered exemplary, and their purpose is only to illustrate the feasibility of implementing the technical solution of this application. These mentions should be understood as typical examples, and their core purpose is to illustrate and verify the rationality and feasibility of implementing the technical solution proposed in this application. However, this does not mean that the applicant has already used or necessarily used the solution. Such citations do not imply that the applicant has actually adopted these existing solutions, or that it will necessarily adopt these methods in its technical implementation process in the future. In other words, these mentions are only illustrative in nature, helping to understand the connection and transcendence of the innovation points of this application with the prior art, and do not constitute an endorsement or reliance statement on a specific prior art product.
[0030] The following terms are used in the embodiments of this invention and are explained below:
[0031] SDK (Software Development Kit): refers to a set of tools that help developers create applications, including libraries, documentation, and code examples.
[0032] NAS (Network Attached Storage): A device or system that provides data storage services over a network, allowing multiple users or instances to share access.
[0033] Classloader (Class Loader): A component in the Java Virtual Machine responsible for loading class files, used to load class definitions into the runtime environment.
[0034] ContentClassLoader (Content Class Loader): In a context, this may refer to the thread's context class loader, which manages the class loading behavior of a specific thread.
[0035] Token: A credential used for authentication or authorization, similar to an access token, to ensure the security of operations.
[0036] To address the aforementioned issues, this invention provides a method for dynamically integrating third-party plugins. This method enables hot loading, environment isolation, and secure invocation of third-party plugins, improving the efficiency of system plugin integration management and the accuracy of function calls. (See also...) Figure 1 , Figure 1 This is a flowchart illustrating a method for dynamically integrating third-party plugins according to an embodiment of the present invention. The method may include:
[0037] Step 101: Perform dependency analysis on the third-party software development kit and package it to form a plugin package for the target plugin;
[0038] Step 102: Deploy the plugin package to a specified directory that is shared with multiple instances of the target system, and update the configuration information of the target system;
[0039] The target system integrates the target plugin in the following manner:
[0040] In response to the update of the configuration information, the plugin package is read from the specified directory and decompressed; a corresponding class loader is created for the plugin package; the class files in the plugin package are loaded using the class loader; a call number is registered for the loaded plugin, and the call number is bound to the corresponding business scenario;
[0041] When the target system needs to call the target plugin function in the corresponding business scenario, the call number corresponding to the business scenario is verified; after verification, the context class loader of the current execution thread of the target system is switched to the class loader of the target plugin and the function of the target plugin is executed; after the call is completed, the context class loader is switched back.
[0042] In this embodiment of the invention, a plugin package for the target plugin is formed by performing dependency analysis and packaging a third-party software development kit; the plugin package is deployed to a designated directory shared with multiple instances of the target system, and the configuration information of the target system is updated; the target system integrates the target plugin in the following manner: in response to the update of the configuration information, the plugin package is read from the designated directory and decompressed; a corresponding class loader is created for the plugin package; the class files in the plugin package are loaded using the class loader; a call number is registered for the loaded plugin, and the call number is bound to the corresponding business scenario; when the target system needs to call the function of the target plugin in the corresponding business scenario, the call number corresponding to the business scenario is verified; after verification, the context class loader of the current execution thread of the target system is switched to the class loader of the target plugin and the function of the target plugin is executed; after the call is completed, the context class loader is switched back. This invention provides a solution for dependency analysis and packaging of third-party software development kits into self-contained plugin packages. These packages are then deployed to a shared directory, and system configurations are updated. Each instance of the target system responds to configuration changes by automatically reading and decompressing the plugin package and creating an independent class loader for each plugin to load class files, thus achieving complete runtime environment isolation. The target system then registers plugin call numbers and binds them to specific business scenarios, constructing a refined access control layer. When a plugin function needs to be called in a corresponding scenario, the call number is used for verification, and the context class loader of the execution thread is dynamically switched before and after execution. This ensures normal function calls while resolving dependency conflicts, business interruptions, and interface abuse issues faced by enterprise systems when integrating third-party components. It achieves hot loading, environment isolation, and secure calling of third-party plugins, improving the efficiency of system plugin integration management and the accuracy of function calls.
[0043] In practice, the first step is to perform a dependency analysis on the software development kit provided by the third party and package it to form a plugin package for the target plugin.
[0044] In this embodiment, a plugin package for the target plugin is formed by performing dependency analysis and packaging a third-party software development kit, including:
[0045] Perform dependency analysis on third-party software development kits to obtain the relevant dependencies of the software development kits;
[0046] Perform security checks on the software development kit and related dependencies;
[0047] Based on a preset fixed file format, the software development kit, related dependencies, and configuration files are compressed and packaged together to form a deployable plugin package.
[0048] In the above embodiment, a thorough dependency analysis is first performed on the third-party software development kit (SDK), automatically identifying and acquiring all relevant dependencies. Specifically, when the SDK includes Maven dependencies, the project environment automatically parses and downloads these dependencies, ensuring all necessary components are fully collected. Subsequently, a comprehensive security check is performed on the SDK and all its dependencies to eliminate potential security risks. After the check is completed, the SDK, all dependencies, and related configuration files are organized and compressed into a single file package according to a pre-defined fixed file format, ultimately forming a deployable plugin package. This process ensures the plugin package's self-containment and consistency, laying the foundation for subsequent dynamic loading.
[0049] In specific implementation, after performing step 101: performing dependency analysis and packaging the software development kit provided by the third party to form a plugin package for the target plugin, step 102: deploying the plugin package to a designated directory that is shared and accessed by multiple instances of the target system, and updating the configuration information of the target system.
[0050] In this embodiment, the process of deploying the plugin package to a designated directory shared by multiple instances of the target system and updating its configuration information is implemented as follows. First, the designated directory needs to be set as a shared file path based on the characteristics of the system deployment environment. For example, a corresponding directory can be created on network-attached storage or object storage services. This setting ensures that all instances of the main system can access a unified resource location in a cloud-native or distributed deployment environment. Then, the fully generated plugin package is uploaded to this designated directory via the dynamic deployment module, completing the file distribution of the plugin package. After the file upload is complete, the dynamic deployment module reads the configuration file information contained in the plugin package and updates the global configuration information of the main system accordingly. This module further triggers the workflow of the configuration management module, which then uniformly notifies every running instance of the target system of the updated configuration information, ensuring that all instances can synchronously perceive the changes in the deployment status of the plugin package.
[0051] In one embodiment, the plugin package is deployed to a designated directory shared with multiple instances of the target system, and the configuration information of the target system is updated, including:
[0052] Set the specified directory as a shared file path for network attached storage or object storage services;
[0053] Deploy the plugin package to the specified directory;
[0054] The configuration is changed using the configuration file in the corresponding plugin package, the configuration information of the target system is updated, and the changes are notified to each instance of the target system.
[0055] In the above embodiments, firstly, a designated directory is set as a shared file path for network-attached storage or object storage services based on the system architecture characteristics. This ensures that all instances can reliably access this unified path when the main system is cloud-native or distributed. Then, the generated plugin package is uploaded to this designated directory via the dynamic deployment module. After the upload is complete, the dynamic deployment module automatically reads the configuration file contained in the plugin package and modifies the main system's configuration information accordingly. This module further triggers the configuration management module, which then notifies every running instance of the target system of the updated configuration information. This ensures that all instances can synchronously perceive the changes in the plugin package's deployment status, preparing for the subsequent plugin loading process.
[0056] In specific implementation, the target system integrates the target plugin in the following manner:
[0057] In response to the update of the configuration information, the plugin package is read from the specified directory and decompressed; a corresponding class loader is created for the plugin package; the class files in the plugin package are loaded using the class loader; a call number is registered for the loaded plugin, and the call number is bound to the corresponding business scenario;
[0058] When the target system needs to call the target plugin function in the corresponding business scenario, the call number corresponding to the business scenario is verified; after verification, the context class loader of the current execution thread of the target system is switched to the class loader of the target plugin and the function of the target plugin is executed; after the call is completed, the context class loader is switched back.
[0059] In this embodiment, when the configuration management module of the main system issues a configuration update notification, the plugin loading module in each system instance will respond immediately, automatically reading the newly deployed plugin package file from the specified shared directory and decompressing it to the local working directory to obtain the class files and configuration files within it. Subsequently, the plugin loading module will create a brand new, independent class loader instance for the current plugin package. This dedicated class loader will be responsible for loading all class files within the plugin package. During this process, it will first unload the existing old version of the same plugin in the system, then load the new plugin, and update the plugin registration information of the main system. This achieves effective isolation between the plugin and the main system and other plugins through an independent class loading space.
[0060] After plugin loading is complete, the access control module registers a unique call number for each successfully loaded plugin and strictly binds this number to the corresponding business scenario in the main system, establishing an access control policy based on the business scenario. When the main system needs to call the plugin's function under a specific business scenario, it must first verify through the access control module whether the current request carries the correct call number matching the scenario. If the verification fails, access is denied. If the verification passes, the access control module temporarily switches the context class loader of the currently executing thread to the plugin's dedicated class loader, enabling the thread to execute the plugin's internal business logic normally.
[0061] After the plugin function completes its execution, the access control module restores the context class loader of the currently executing thread to its original state before the call, ensuring that subsequent operations of the main system are not interfered with by the plugin class loading environment. This entire process, through the combination of environment isolation by the plugin loading module and the secure invocation mechanism of the access control module, achieves hot loading, secure invocation, and resource cleanup of plugins, ensuring the stability and continuity of the system when dynamically integrating new features.
[0062] In one embodiment, the class loader is used to load all class files contained in the plugin package and to isolate the plugin from the class loading environment used by the target system and other plugins during plugin runtime.
[0063] In the above embodiments, the class loader is specifically a custom class loader instance implemented in Java, dedicated to loading all class files and related resources contained in the plugin package. This custom class loader creates an independent class loading space for each plugin at runtime, ensuring through an isolation mechanism that the class files loaded by the plugin are completely separated from the target system's main class loader and the class loading environment used by other plugins. This isolation design effectively prevents conflicts between different plugins or between a plugin and the main system caused by inconsistent dependency package versions, thereby ensuring the independence and integrity of each plugin's code implementation and its dependencies, enabling multiple third-party plugins to coexist safely and stably in the same system environment.
[0064] In one embodiment, registering a call number for the loaded plugin and binding the call number to the corresponding business scenario includes:
[0065] After registering call numbers for the loaded plugins, the call number of each plugin is bound to one or more corresponding business scenarios in the target system, forming a binding relationship between the call number and the corresponding business scenario.
[0066] In the above embodiment, after a plugin is successfully loaded and registered with the system, the access control module assigns a unique call number to each plugin. This number functions similarly to an access token, uniquely identifying and distinguishing different plugin instances. Subsequently, the access control module precisely binds each plugin's call number to one or more corresponding business scenarios in the target system according to a predefined configuration policy. For example, it may allow only specific project interfaces or business processes to use the plugin, thereby establishing a strict correspondence between call numbers and business scenarios.
[0067] This binding relationship forms a virtual plugin project-level access control mechanism based on business scenarios. Through this mechanism, the system can achieve fine-grained control over plugin invocation permissions, ensuring that only requests carrying the correct invocation number and conforming to the predetermined business scenario are allowed to access the corresponding plugin functionality. This design effectively prevents the risk of unauthorized calls or abuse of technical interfaces, improving the security and controllability of the entire system from the access entry point, and strictly limiting the use of plugins to the authorized business scope.
[0068] In one embodiment, when the target system needs to call the target plugin function in the corresponding business scenario, the call number corresponding to the business scenario is verified, including:
[0069] When the target system needs to call the target plugin function in the corresponding business scenario, verify whether the call number provided by the current business scenario matches the call number of the plugin;
[0070] If a match cannot be found, the plugin's invocation process will be terminated.
[0071] If the call number matches successfully and the plugin has been successfully registered, the context class loader of the current execution thread of the target system will be switched to the class loader that loads the target plugin.
[0072] In the above embodiments, when the target system needs to call the target plugin's function in a specific business scenario, the access control module first verifies whether the call number submitted in the current business scenario completely matches the unique call number assigned when the plugin was registered. If the comparison reveals that the call number does not match, the access control module will immediately terminate the plugin's call process, preventing the execution of subsequent operations, thus forming the first security barrier. If the call number verification is successful and the target plugin is in a normal registration state, the access control module will perform a context switching operation, binding the context class loader of the target system's current execution thread to the dedicated class loader used when loading the target plugin. This switching action allows the execution thread to enter the plugin's isolated environment and normally access and execute the classes and methods in the plugin.
[0073] After the plugin functionality is completed, the access control module restores the current execution thread's context class loader to its original state, ensuring that the main system's class loading environment is not polluted. The entire verification and switching process, centrally managed by the access control module, ensures that plugin calls undergo strict authorization checks and strictly limits the plugin's impact to a specific thread context, thus providing functional flexibility while guaranteeing the stability and security of the main system.
[0074] The following is a specific embodiment to illustrate the specific application of the method of the present invention.
[0075] This embodiment discloses a method and system based on dynamically integrating third-party plugins, applicable to enterprise-level open platforms and internal mainline architecture systems. It primarily addresses the need to meet the personalized requirements of third-party systems, such as network protocol adaptation, data verification, and encryption / decryption, during interaction between the open platform and external third-party systems. Based on a custom Java Classloader, this invention can directly integrate multiple third-party SDK toolkits, avoiding conflicts between various external toolkits and the main system's dependencies. The main innovative points of this invention are as follows:
[0076] 1. This invention enables plug-and-play integration of third-party SDK toolkits through a dynamic hot-loading mechanism. It supports real-time loading / updating of SDK plugins and expansion of system functions without requiring a system restart, ensuring that business service continuity is not affected.
[0077] 2. This invention supports a virtual plugin project isolation mechanism. By using different ClassLoaders to isolate loaded class files, it effectively solves the dependency conflicts between plugins and between plugins and the main system in scenarios with many integrated plugins. This ensures the independence and integrity of all plugin code implementations and their dependencies.
[0078] 3. This invention supports an access control mechanism at the virtual plugin project level. This access control mechanism effectively controls plugin invocation restrictions, allowing only the corresponding business scenario to invoke the target plugin, thus preventing the abuse of certain technical interfaces and improving system security.
[0079] Specifically, this embodiment provides a method and system for dynamically integrating third-party plugins, such as... Figure 3 As shown, it mainly consists of a plugin packaging module, a dynamic deployment module, a configuration management module, a plugin loading module, and an access control module, which are explained in detail below:
[0080] 1. Plugin Packaging Module: This module is responsible for performing dependency analysis and security checks on third-party SDK packages and utility classes, and then packaging all dependencies into a plugin package according to a fixed file format. This module itself does not need to be deployed in production; it is a tool for creating plugin packages that runs in the development and testing environment.
[0081] 2. Dynamic Deployment Module: This module is a small utility attached to the main system. It is responsible for uploading plugin packages to a specified directory, updating relevant configurations, and triggering the plugin loading module of all system instances to dynamically load the plugins. For cloud-native and distributed systems, it is necessary to set a file path that can be accessed by multiple instances, which can be a NAS disk or object storage service.
[0082] 3. Configuration Management Module: This module primarily manages the configuration information of the entire system. It can dynamically modify and notify each instance of the system, achieving centralized and unified management of system configuration.
[0083] 4. Plugin Loading Module: This module runs alongside the main system instance and is responsible for reading plugins from a specified directory and dynamically loading them. The process mainly involves reading the plugin package, decompressing it, reading the configuration, uninstalling existing plugins, loading new plugins, and updating registration information. Each plugin uses a separate Classloader, ensuring isolation between plugins and between plugins and the main system, preventing direct access between them.
[0084] 5. Access Control Module: This module acts as a "bridge" for the main system to use plugin functionality; plugins can only be used through this module. For example... Figure 2 The access control module registers all plugins and assigns each plugin a unique call number (similar to an access token). If the number doesn't match, the plugin call cannot proceed. If the number is correct and the plugin is successfully registered, the access control module binds the ContentClassLoader of the calling thread to the ClassLoader that loads the plugin, allowing the plugin to be called. Upon returning from the plugin, the access control module restores the ContentClassLoader for that thread.
[0085] Figure 3This diagram illustrates the modular structure of the dynamic integration third-party plugin system of this invention, showcasing the architecture and data flow of the entire technical solution. The diagram clearly marks five core components and their interrelationships: the plugin packaging module, dynamic deployment module, configuration management module, plugin loading module, and access control module. The plugin packaging module receives input from third-party SDKs, performs dependency analysis and security checks, and outputs standardized plugin packages. The dynamic deployment module receives these plugin packages and uploads them to a designated directory to ensure resource distribution. The configuration management module connects to the main system, notifying users of configuration changes and enabling centralized management. The plugin loading module is integrated within the main system, reading plugins from a designated directory and performing dynamic loading operations. The access control module, also located in the main system, acts as the sole bridge for calling plugins, managing all access requests. These modules work collaboratively through the processes indicated by arrows, forming a complete closed-loop system from plugin preparation, deployment, configuration synchronization, loading to secure invocation, demonstrating the system's efficiency and reliability.
[0086] Figure 2 This diagram illustrates the call flow of the access control module in this invention, showcasing the security verification and execution mechanism for plugin calls. The diagram highlights the core design of the access control module: registering all plugins and assigning them specific call numbers (similar to access tokens). When the main system initiates a plugin call request, it first verifies the call number. If the number doesn't match, the call flow is immediately terminated to ensure unauthorized access is blocked. If the number verification is successful and the plugin has been successfully registered, the access control module dynamically binds the current thread's ContentClassLoader to the Classloader that loads the plugin, allowing the thread to safely execute the plugin's internal functions. After the plugin's functions are completed, the module promptly restores the thread's ContentClassLoader to its original state, ensuring the stability of the main system environment.
[0087] In the above embodiments, the dynamic deployment module, as an auxiliary tool of the main system, uploads the plugin package to a designated directory, which is set as a shared path such as NAS or object storage in the cloud-native environment. After the upload is complete, the system configuration is automatically updated and all instances are notified. The configuration management module centrally manages all system configuration information, supports dynamic modification and real-time synchronization to each system instance, ensuring configuration consistency. The plugin loading module coexists with the main system instance, responsible for reading and decompressing the plugin package, and then creating an independent class loader to load the plugin class files. Its loading process includes steps such as uninstalling old plugins and registering new plugins, achieving complete runtime isolation by using an independent class loader for each plugin. The access control module, as the sole bridge between the system and the plugin, registers a specific call number for each plugin and binds it to the business scenario. Upon call, after verifying the number match, the thread context class loader is temporarily switched to the plugin class loader, and immediately restored after execution.
[0088] Specifically, the plugin packaging and hot deployment steps in this embodiment are as follows:
[0089] Step 1: Place the third-party system's SDK package into the plugin packaging module project. If the SDK package has Maven dependencies, the project itself will automatically obtain the relevant dependencies and include them as part of the SDK during the packaging process.
[0090] Step 2: Configure the SDK's entry point and access control. This specifies the plugin's entry point and which project's interface it should call.
[0091] Step 3: Run the packaging script. The project will automatically put the SDK package and related configuration files together and compress them into one file.
[0092] Step 4: Through the operation and maintenance process, upload the plugin package to the designated directory via the dynamic deployment module. The dynamic deployment module will automatically trigger the configuration management module to notify all instances in the system.
[0093] Step 5: After receiving the configuration notification, the system instance automatically reads the plugin package in the specified directory, completes the following steps: decompression, reading configuration, uninstalling the original plugin, loading the new plugin, and updating registration information, and loads the plugin package.
[0094] Step 6: The main system calls the plugin function based on the registration information to complete the dynamic loading of the plugin.
[0095] In step 1, after importing the third-party SDK package into the plugin packaging module project, the system automatically parses its Maven dependencies, fully obtains all related dependencies, and integrates them into the plugin resources.
[0096] Step 2 establishes the foundation for access control policies by configuring the plugin's call entry point and binding the target business interface.
[0097] Step 3 uses a packaging script to compress the SDK, dependencies, and configuration files into a standardized plugin package in a fixed format, forming a deployable self-contained unit.
[0098] Step 4 triggers the dynamic deployment module through the operation and maintenance process, uploads the plugin package to the shared directory (such as NAS or object storage), and links the configuration management module to send update notifications to all instances.
[0099] In step 5, after the system instance's plugin loading module responds to the notification, it automatically performs operations such as decompression, configuration reading, old plugin uninstallation, new plugin loading, and registration information update. Its core lies in achieving isolation between plugins through an independent Classloader, ensuring the continuity of system business during hot loading.
[0100] Step 6 verifies the matching relationship between the business scenario and the plugin call number through the access control module. After successful verification, the thread context class loader is dynamically switched to the plugin-specific Classloader, and the original environment is restored immediately after execution. This mechanism ensures that the plugin function can be securely called by the main system, while preventing interface abuse through strict access control.
[0101] The entire process achieves full lifecycle management of plugins through modular collaboration: the packaging module ensures resource integrity, the deployment module enables resource synchronization in a distributed environment, the loading module resolves dependency conflicts through isolation mechanisms, and the control module ensures call security. Ultimately, dynamic integration and stable operation of plugin functionality are achieved without restarting the system.
[0102] Of course, it is understood that there may be other variations of the above detailed process, and all such variations should fall within the protection scope of this invention.
[0103] In this embodiment of the invention, a plugin package for the target plugin is formed by performing dependency analysis and packaging a third-party software development kit; the plugin package is deployed to a designated directory shared with multiple instances of the target system, and the configuration information of the target system is updated; the target system integrates the target plugin in the following manner: in response to the update of the configuration information, the plugin package is read from the designated directory and decompressed; a corresponding class loader is created for the plugin package; the class files in the plugin package are loaded using the class loader; a call number is registered for the loaded plugin, and the call number is bound to the corresponding business scenario; when the target system needs to call the function of the target plugin in the corresponding business scenario, the call number corresponding to the business scenario is verified; after verification, the context class loader of the current execution thread of the target system is switched to the class loader of the target plugin and the function of the target plugin is executed; after the call is completed, the context class loader is switched back. This invention provides a solution for dependency analysis and packaging of third-party software development kits into self-contained plugin packages. These packages are then deployed to a shared directory, and system configurations are updated. Each instance of the target system responds to configuration changes by automatically reading and decompressing the plugin package and creating an independent class loader for each plugin to load class files, thus achieving complete runtime environment isolation. The target system then registers plugin call numbers and binds them to specific business scenarios, constructing a refined access control layer. When a plugin function needs to be called in a corresponding scenario, the call number is used for verification, and the context class loader of the execution thread is dynamically switched before and after execution. This ensures normal function calls while resolving dependency conflicts, business interruptions, and interface abuse issues faced by enterprise systems when integrating third-party components. It achieves hot loading, environment isolation, and secure calling of third-party plugins, improving the efficiency of system plugin integration management and the accuracy of function calls.
[0104] As described above, this invention relates to a method for dynamically integrating third-party plugins. Through a complete process, it achieves secure and efficient integration of third-party plugins. The method first performs dependency analysis on the third-party software development kit (SDK) and packages it into a self-contained plugin package. Then, it deploys the package to a designated directory shared by multiple instances of the target system and updates its configuration information. Upon receiving the configuration update, the target system automatically reads and decompresses the plugin package. An independent class loader is created for each plugin to load class files, achieving runtime environment isolation. The loaded plugins are registered with call numbers and bound to specific business scenarios. When a plugin function needs to be invoked, the call number corresponding to the business scenario is verified. If verification is successful, the context class loader of the currently executing thread is temporarily switched to execute the plugin function, and the original state is restored upon completion. This method effectively solves the system instability caused by dependency package conflicts, the business continuity impact caused by system restarts required for function updates, and the security issues of interface abuse caused by the lack of control mechanisms in existing technologies. It ensures seamless business expansion through a hot-loading mechanism, ensures system stability through class loader isolation, and achieves fine-grained access control through call number binding, thereby significantly improving the reliability, continuity, and security of enterprise-level systems.
[0105] This invention also provides an apparatus for dynamically integrating third-party plugins, as described in the following embodiments. Since the principle by which this apparatus solves the problem is similar to the method for dynamically integrating third-party plugins, the implementation of this apparatus can be found in the implementation of the method for dynamically integrating third-party plugins, and will not be repeated here.
[0106] This invention also provides a device for dynamically integrating third-party plugins, enabling hot loading, environment isolation, and secure invocation of third-party plugins, thereby improving the efficiency of system plugin integration management and the accuracy of function invocation. Figure 4 This is a schematic diagram of the structure of a device for dynamically integrating third-party plugins according to an embodiment of the present invention, as shown below. Figure 4 As shown, the device includes:
[0107] The plugin package packaging module 401 is used to perform dependency analysis on third-party software development kits and package them to form a plugin package for the target plugin.
[0108] The plugin package deployment module 402 is used to deploy the plugin package to a specified directory that is shared and accessed by multiple instances of the target system, and to update the configuration information of the target system;
[0109] The target system integrates the target plugin in the following manner:
[0110] In response to the update of the configuration information, the plugin package is read from the specified directory and decompressed; a corresponding class loader is created for the plugin package; the class files in the plugin package are loaded using the class loader; a call number is registered for the loaded plugin, and the call number is bound to the corresponding business scenario;
[0111] When the target system needs to call the target plugin function in the corresponding business scenario, the call number corresponding to the business scenario is verified; after verification, the context class loader of the current execution thread of the target system is switched to the class loader of the target plugin and the function of the target plugin is executed; after the call is completed, the context class loader is switched back.
[0112] In one embodiment, a plugin package for the target plugin is formed by performing dependency analysis and packaging a third-party software development kit, including:
[0113] Perform dependency analysis on third-party software development kits to obtain the relevant dependencies of the software development kits;
[0114] Perform security checks on the software development kit and related dependencies;
[0115] Based on a preset fixed file format, the software development kit, related dependencies, and configuration files are compressed and packaged together to form a deployable plugin package.
[0116] In one embodiment, the plugin package is deployed to a designated directory shared with multiple instances of the target system, and the configuration information of the target system is updated, including:
[0117] Set the specified directory as a shared file path for network attached storage or object storage services;
[0118] Deploy the plugin package to the specified directory;
[0119] The configuration is changed using the configuration file in the corresponding plugin package, the configuration information of the target system is updated, and the changes are notified to each instance of the target system.
[0120] In one embodiment, the class loader is used to load all class files contained in the plugin package and to isolate the plugin from the class loading environment used by the target system and other plugins during plugin runtime.
[0121] In one embodiment, registering a call number for the loaded plugin and binding the call number to the corresponding business scenario includes:
[0122] After registering call numbers for the loaded plugins, the call number of each plugin is bound to one or more corresponding business scenarios in the target system, forming a binding relationship between the call number and the corresponding business scenario.
[0123] In one embodiment, when the target system needs to call the target plugin function in the corresponding business scenario, the call number corresponding to the business scenario is verified, including:
[0124] When the target system needs to call the target plugin function in the corresponding business scenario, verify whether the call number provided by the current business scenario matches the call number of the plugin;
[0125] If a match cannot be found, the plugin's invocation process will be terminated.
[0126] If the call number matches successfully and the plugin has been successfully registered, the context class loader of the current execution thread of the target system will be switched to the class loader that loads the target plugin.
[0127] This invention provides an embodiment of a computer device for implementing all or part of the above-described method for dynamically integrating third-party plugins. The computer device specifically includes the following components:
[0128] The computer device comprises a processor, memory, a communications interface, and a bus; wherein the processor, memory, and communications interface communicate with each other via the bus; the communications interface is used to realize information transmission between related devices; the computer device can be a desktop computer, tablet computer, or mobile terminal, etc., and this embodiment is not limited to these. In this embodiment, the computer device can be implemented with reference to the embodiments of the method for dynamically integrating third-party plugins and the embodiments of the apparatus for dynamically integrating third-party plugins, the contents of which are incorporated herein by reference, and repeated details will not be described again.
[0129] Figure 5 This is a schematic diagram of a computer device provided in an embodiment of the present invention, which discloses a schematic block diagram of the system configuration of a computer device 1000 according to an embodiment of this application. Figure 5 As shown, the computer device 1000 may include a central processing unit 1001 and a memory 1002; the memory 1002 is coupled to the central processing unit 1001. It is worth noting that... Figure 5 This is an example; other types of structures can also be used to supplement or replace this structure to achieve telecommunications functions or other functions.
[0130] In one embodiment, the functionality of dynamically integrating third-party plugins can be integrated into the central processing unit 1001. The central processing unit 1001 can be configured to perform the following controls:
[0131] By performing dependency analysis on third-party software development kits and packaging them, a plugin package for the target plugin is formed.
[0132] Deploy the plugin package to a specified directory that is shared with multiple instances of the target system, and update the configuration information of the target system;
[0133] The target system integrates the target plugin in the following manner:
[0134] In response to the update of the configuration information, the plugin package is read from the specified directory and decompressed; a corresponding class loader is created for the plugin package; the class files in the plugin package are loaded using the class loader; a call number is registered for the loaded plugin, and the call number is bound to the corresponding business scenario;
[0135] When the target system needs to call the target plugin function in the corresponding business scenario, the call number corresponding to the business scenario is verified; after verification, the context class loader of the current execution thread of the target system is switched to the class loader of the target plugin and the function of the target plugin is executed; after the call is completed, the context class loader is switched back.
[0136] In another embodiment, the device for dynamically integrating third-party plugins can be configured separately from the central processing unit 1001. For example, the device for dynamically integrating third-party plugins can be configured as a chip connected to the central processing unit 1001, and the function of dynamically integrating third-party plugins can be realized through the control of the central processing unit.
[0137] like Figure 5 As shown, the computer device 1000 may further include: a communication module 1003, an input unit 1004, an audio processor 1005, a display 1006, and a power supply 1007. It is worth noting that the computer device 1000 does not necessarily need to include... Figure 5 All components shown; in addition, the computer device 1000 may also include Figure 5 For components not shown, please refer to existing technologies.
[0138] like Figure 5 As shown, the central processing unit 1001, sometimes also referred to as a controller or operation control, may include a microprocessor or other processor device and / or logic device. The central processing unit 1001 receives input and controls the operation of various components of the computer device 1000.
[0139] The memory 1002 may be, for example, one or more of a cache, flash memory, hard drive, removable medium, volatile memory, non-volatile memory, or other suitable device. It can store the aforementioned device-related information, and may also store programs for executing that information. The central processing unit 1001 can execute the program stored in the memory 1002 to perform information storage or processing, etc.
[0140] Input unit 1004 provides input to central processing unit 1001. Input unit 1004 may be, for example, a keypad or touch input device. Power supply 1007 provides power to computer device 1000. Display 1006 displays images and text. Display may be, for example, an LCD display, but is not limited thereto.
[0141] The memory 1002 can be a solid-state memory, such as a read-only memory (ROM), random access memory (RAM), a SIM card, etc. It can also be a memory that retains information even when power is off, can be selectively erased, and contains more data; examples of this type of memory are sometimes referred to as EPROMs. The memory 1002 can also be some other type of device. The memory 1002 includes a buffer memory 1021 (sometimes referred to as a buffer). The memory 1002 may include an application / function storage unit 1022 for storing application programs and function programs or processes for executing operations of the computer device 1000 via the central processing unit 1001.
[0142] The memory 1002 may also include a data storage unit 1023 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the computer device. The driver storage unit 1024 of the memory 1002 may include various drivers for the computer device for communication functions and / or for performing other functions of the computer device (such as messaging applications, address book applications, etc.).
[0143] The communication module 1003 is a transmitter / receiver that transmits and receives signals via the antenna 1008. The communication module (transmitter / receiver) 1003 is coupled to the central processing unit 1001 to provide input signals and receive output signals, which is the same as in a conventional mobile communication terminal.
[0144] Based on different communication technologies, multiple communication modules 1003 can be configured in the same computer device, such as cellular network modules, Bluetooth modules, and / or wireless LAN modules. The communication module (transmitter / receiver) 1003 is also coupled to a speaker 1009 and a microphone 1010 via an audio processor 1005 to provide audio output via the speaker 1009 and receive audio input from the microphone 1010, thereby realizing typical telecommunications functions. The audio processor 1005 may include any suitable buffer, decoder, amplifier, etc. Additionally, the audio processor 1005 is also coupled to a central processing unit 1001, enabling on-device recording via the microphone 1010 and on-device playback of stored sound via the speaker 1009.
[0145] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for dynamically integrating third-party plugins.
[0146] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described method for dynamically integrating third-party plugins.
[0147] In this embodiment of the invention, a plugin package for the target plugin is formed by performing dependency analysis and packaging a third-party software development kit; the plugin package is deployed to a designated directory shared with multiple instances of the target system, and the configuration information of the target system is updated; the target system integrates the target plugin in the following manner: in response to the update of the configuration information, the plugin package is read from the designated directory and decompressed; a corresponding class loader is created for the plugin package; the class files in the plugin package are loaded using the class loader; a call number is registered for the loaded plugin, and the call number is bound to the corresponding business scenario; when the target system needs to call the function of the target plugin in the corresponding business scenario, the call number corresponding to the business scenario is verified; after verification, the context class loader of the current execution thread of the target system is switched to the class loader of the target plugin and the function of the target plugin is executed; after the call is completed, the context class loader is switched back. This invention provides a solution for dependency analysis and packaging of third-party software development kits into self-contained plugin packages. These packages are then deployed to a shared directory, and system configurations are updated. Each instance of the target system responds to configuration changes by automatically reading and decompressing the plugin package and creating an independent class loader for each plugin to load class files, thus achieving complete runtime environment isolation. The target system then registers plugin call numbers and binds them to specific business scenarios, constructing a refined access control layer. When a plugin function needs to be called in a corresponding scenario, the call number is used for verification, and the context class loader of the execution thread is dynamically switched before and after execution. This ensures normal function calls while resolving dependency conflicts, business interruptions, and interface abuse issues faced by enterprise systems when integrating third-party components. It achieves hot loading, environment isolation, and secure calling of third-party plugins, improving the efficiency of system plugin integration management and the accuracy of function calls.
[0148] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0149] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0150] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0151] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0152] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for dynamically integrating third-party plugins, characterized in that, include: By performing dependency analysis on third-party software development kits and packaging them, a plugin package for the target plugin is formed. Deploy the plugin package to a specified directory that is shared with multiple instances of the target system, and update the configuration information of the target system; The target system integrates the target plugin in the following manner: In response to the update of the configuration information, the plugin package is read from the specified directory and decompressed; a corresponding class loader is created for the plugin package; the class files in the plugin package are loaded using the class loader; a call number is registered for the loaded plugin, and the call number is bound to the corresponding business scenario; When the target system needs to call the target plugin function in the corresponding business scenario, the call number corresponding to the business scenario is verified; after verification, the context class loader of the current execution thread of the target system is switched to the class loader of the target plugin and the function of the target plugin is executed; after the call is completed, the context class loader is switched back.
2. The method as described in claim 1, characterized in that, By performing dependency analysis on third-party software development kits and packaging them, a plugin package for the target plugin is formed, including: Perform dependency analysis on third-party software development kits to obtain the relevant dependencies of the software development kits; Perform security checks on the software development kit and related dependencies; Based on a preset fixed file format, the software development kit, related dependencies, and configuration files are compressed and packaged together to form a deployable plugin package.
3. The method as described in claim 1, characterized in that, Deploy the plugin package to a specified directory that is shared with multiple instances of the target system, and update the configuration information of the target system, including: Set the specified directory as a shared file path for network attached storage or object storage services; Deploy the plugin package to the specified directory; The configuration is changed using the configuration file in the corresponding plugin package, the configuration information of the target system is updated, and the changes are notified to each instance of the target system.
4. The method as described in claim 1, characterized in that, The class loader is used to load all class files contained in the plugin package and to isolate the plugin from the class loading environment used by the target system and other plugins during plugin runtime.
5. The method as described in claim 1, characterized in that, Register call numbers for loaded plugins and bind these call numbers to corresponding business scenarios, including: After registering call numbers for the loaded plugins, the call number of each plugin is bound to one or more corresponding business scenarios in the target system, forming a binding relationship between the call number and the corresponding business scenario.
6. The method as described in claim 1, characterized in that, When the target system needs to call the target plugin function in the corresponding business scenario, verify the call number corresponding to the business scenario, including: When the target system needs to call the target plugin function in the corresponding business scenario, verify whether the call number provided by the current business scenario matches the call number of the plugin; If a match cannot be found, the plugin's invocation process will be terminated. If the call number matches successfully and the plugin has been successfully registered, the context class loader of the current execution thread of the target system will be switched to the class loader that loads the target plugin.
7. A device for dynamically integrating third-party plugins, characterized in that, include: The plugin package packaging module is used to perform dependency analysis on third-party software development kits and package them into a plugin package for the target plugin. The plugin package deployment module is used to deploy the plugin package to a specified directory that is shared and accessed by multiple instances of the target system, and to update the configuration information of the target system; The target system integrates the target plugin in the following manner: In response to the update of the configuration information, the plugin package is read from the specified directory and decompressed; a corresponding class loader is created for the plugin package; the class files in the plugin package are loaded using the class loader; a call number is registered for the loaded plugin, and the call number is bound to the corresponding business scenario; When the target system needs to call the target plugin function in the corresponding business scenario, the call number corresponding to the business scenario is verified; after verification, the context class loader of the current execution thread of the target system is switched to the class loader of the target plugin and the function of the target plugin is executed; after the call is completed, the context class loader is switched back.
8. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method of any one of claims 1 to 6.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method of any one of claims 1 to 6.