Peripheral adaptation system based on dynamic plug-in loading mechanism
By introducing dynamic plug-in loading mechanism, intelligent adapter and secure access module into the plug-in management system, problems such as plug-in compatibility, management and security are solved, and system flexibility, security and performance optimization are achieved.
Patent Information
- Application Number
- CN202411975997.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-02-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
There are problems such as compatibility, management and update, security and performance optimization in the prior art, especially in environments where the number of plug-ins increases and resources are limited, it is difficult to effectively manage and optimize the loading and operation of plug-ins.
A peripheral adaptation system based on the dynamic plug-in loading mechanism is adopted, including a dynamic plug-in loading management unit, a peripheral adaptation management unit and a front-end management unit. The dynamic plug-in loading management unit realizes the plug-in's instant loading and independent execution environment through a custom class loader. The peripheral adaptation management unit performs peripheral communication and adaptation through an intelligent adapter, and the front-end management unit performs permission control through a secure access module.
It significantly improves the flexibility and scalability of the system, realizes rapid loading and uninstallation of plug-ins, without restarting the system, reduces system maintenance complexity, ensures system security and stability, and optimizes the performance of plug-ins.
Smart Images

Figure CN119396496A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of plug-in management, and in particular relates to a peripheral device adaptation system based on a dynamic plug-in loading mechanism. Background Art
[0002] With the rapid development of information technology, software system development needs to add some new functions after the project development is completed and delivered for use. Without changing the original application code, the newly added functions are implanted into the system, and different users may require different specific implementations for the same functional module. The above problems can be solved using plug-in technology. Newly added functional modules, or customized functional modules, are called plug-ins. The benefits brought by plug-in technology are directly reflected in reducing the coupling between modules, facilitating the independent maintenance of each module, and facilitating and accelerating the maintenance and update of the entire project. There are still areas for improvement: (1) Compatibility issues: Since different plug-ins may be written by different developers, the compatibility between them may be affected, resulting in unstable system operation.
[0003] (2) Plug-in management and update issues: As the number of plug-ins increases, how to effectively manage and update these plug-ins becomes a challenge.
[0004] (3) Security issues: Although plug-in technology facilitates the expansion of functions, it may also introduce security vulnerabilities. Corresponding security mechanisms are needed to ensure the security of the system.
[0005] (4) Plug-in performance issues: The loading and running of plug-ins may affect system performance, especially in resource-limited environments. Traditional integration methods often face the problems of difficulty in updating peripherals and high maintenance costs. How to optimize the performance of plug-ins is an issue that needs to be considered. Summary of the invention
[0006] In order to solve the above problems existing in the prior art, the present invention provides a peripheral adaptation system based on a dynamic plug-in loading mechanism; The purpose of the present invention can be achieved through the following technical solutions: A peripheral device adaptation system based on a dynamic plug-in loading mechanism, comprising: a dynamic plug-in loading management unit, a peripheral device adaptation management unit, and a front-end management unit; The dynamic plug-in loading management unit loads the compiled file into the runtime environment in real time through a custom class loader. The custom class loader uses a Java class loader to convert bytecodes into Class objects, and creates an independent class loader for each plug-in to implement an independent execution environment; the runtime environment is a Java virtual machine; The peripheral device adaptation management unit is used to communicate with the peripheral device and parse and identify the special protocol and interface of the peripheral device through the intelligent adapter; The front-end management unit is used to design an API interface for front-end applications to call, and to perform permission control on sensitive operations through a security access module.
[0007] Specifically, the workflow of the dynamic plug-in loading management unit is as follows: the plug-in manager is initialized when the system starts, and a dynamic loading construction module is constructed according to the plug-in manager, wherein the dynamic loading construction module includes a deployment submodule, a version control submodule, a reuse submodule, and a range control submodule; the deployment submodule is used to identify the plug-in to be loaded, download the plug-in module file from the remote server and load it into the local system, and parse and relocate the plug-in module file; the version control submodule is used to manage the version information of the plug-in, ensure that the system loads the latest version of the plug-in, and support the compatibility of the old version of the plug-in to avoid system instability caused by version update; the reuse submodule stores the loaded plug-in through a cache mechanism; the range control submodule ensures that the plug-in runs within the authorized scope; the plug-in loading operation is performed on the plug-in interface of the plug-in manager through the dynamic loading construction module, the plug-in manager stores the plug-in information in a hash table, and completes the registration of the plug-in to obtain a plug-in list according to the plug-in interface. When the system needs to use a specific function, the plug-in manager selects a suitable plug-in from the registered plug-in list for calling according to the functional requirements.
[0008] Specifically, the dynamic loading method is implemented based on a .NET assembly. After dynamically loading a given plug-in, the plug-in type is obtained, an interface list is obtained through a reflection mechanism, and it is detected whether the interface included in the interface list contains the agreed interface preset by the plug-in and the system. If the agreed interface is included, an instance is created according to the plug-in type.
[0009] Specifically, the peripheral adaptation management unit optimizes the compatibility of the kit center by performing single-product verification on the software and hardware, including the server, terminal, operating system, database, and middleware, and adopts integrated adaptation technology to combine and adapt the various components.
[0010] Specifically, the smart adapter has an adaptive mechanism that automatically adjusts its working mode and parameter settings according to different application scenarios and user needs; when the network environment changes, the smart adapter automatically selects the optimal communication protocol and data transmission rate; when a hardware device is connected, it can identify the device type and automatically configure the corresponding driver and interface according to the device characteristics.
[0011] Specifically, the security access module performs fine-grained control based on the API interface permissions of system resources. The fine-grained control stores peripheral IDs, service levels, and permission information by building a custom access list; the service levels correspond to a set of permissions for each security level, and the peripheral IDs and permission information are dynamically allocated through a dynamic security model.
[0012] Specifically, after receiving the system request, the dynamic security model assigns a service level to the loaded peripheral ID, and realizes role service allocation by presetting a trust threshold for the service level. The interaction trust is calculated according to the service resource occupancy rate, resource utilization rate, service request rate and rejection rate after the peripheral interaction. The calculation formula is: , Among them, DCI is the interaction trust, MQ is the maximum system resource, RQ is the peripheral request resource, ST is the actual processing time, SPT is the service request processing time, RR is the service request rate, AC is the number of service resource accesses, EC is the number of service anomalies, DoS is the number of denials of service, k1, k2, k3, k4 are weight factors; The interactive trust is used to determine whether it is within the trust threshold range. If it is within the trust threshold range, a corresponding request is made and authentication of the corresponding permission set is provided; if it is not within the trust threshold range, the service level corresponding to the peripheral ID is reset and the interactive trust is recalculated.
[0013] The beneficial effects of the present invention are: significantly improving the flexibility and scalability of the system. Through the dynamic plug-in loading mechanism, the system can dynamically load and unload functional modules according to actual needs without restarting the entire system, thereby achieving rapid response to external changes and user needs. In addition, the mechanism also reduces the complexity of system maintenance, because the addition of new functions and the update of old functions can be carried out without affecting the operation of the system. In terms of security, through the API interface and security access module designed by the front-end management unit, the system can strictly control the authority of external access to ensure the security of the system. The adaptive mechanism of the intelligent adapter further enhances the stability and reliability of the system, because it can automatically adjust the working mode and parameter settings according to different network environments and hardware devices, thereby ensuring the efficient compatibility of peripherals with the system. Through single product verification and integrated adaptation technology, the compatibility of software and hardware can be supported, which not only helps to promote the development of domestic technology, but also reduces the dependence on external technology. At the same time, the introduction of the dynamic security model ensures the reasonable allocation and efficient utilization of system resources by dynamically allocating service levels and calculating interactive trust, thereby improving the performance of the overall system. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to facilitate understanding by those skilled in the art, the present invention is further described below with reference to the accompanying drawings.
[0015] Figure 1 The present invention is a schematic diagram of the structure of a peripheral adaptation system based on a dynamic plug-in loading mechanism. DETAILED DESCRIPTION
[0016] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments.
[0017] See also Figure 1 , a peripheral adaptation system based on a dynamic plug-in loading mechanism, comprising: a dynamic plug-in loading management unit, a peripheral adaptation management unit, and a front-end management unit; The dynamic plug-in loading management unit loads the compiled file into the runtime environment in real time through a custom class loader. The custom class loader uses a Java class loader to convert bytecodes into Class objects, and creates an independent class loader for each plug-in to implement an independent execution environment; the runtime environment is a Java virtual machine; The peripheral device adaptation management unit is used to communicate with the peripheral device and parse and identify the special protocol and interface of the peripheral device through the intelligent adapter; The front-end management unit is used to design an API interface for front-end applications to call, and to perform permission control on sensitive operations through a security access module.
[0018] In this embodiment, the dynamic plug-in loading mechanism: uses the AssemblyLoadContext of .NET 6 to implement dynamic plug-in loading and hot-swap functions, allowing the system to load and unload plug-ins at runtime without restarting the system. By designing the peripheral adaptation layer, intelligent identification and adaptation of peripherals are achieved to ensure efficient compatibility between the system and hardware, and a plug-in life cycle management mechanism is designed, including the loading, initialization, running and unloading processes of the plug-in to ensure the consistency and controllability of the plug-in status. A rich set of JavaScript APIs is provided for front-end applications to call various functions of the suite center, realizing the separation of the front-end and back-end, facilitating integration and expansion, and processing asynchronous operations through Promise and callback functions, providing a flexible and easy-to-use interface for front-end applications to call.
[0019] Specifically, the workflow of the dynamic plug-in loading management unit is as follows: the plug-in manager is initialized when the system starts, and a dynamic loading construction module is constructed according to the plug-in manager, wherein the dynamic loading construction module includes a deployment submodule, a version control submodule, a reuse submodule, and a range control submodule; the deployment submodule is used to identify the plug-in to be loaded, download the plug-in module file from the remote server and load it into the local system, and parse and relocate the plug-in module file; the version control submodule is used to manage the version information of the plug-in, ensure that the system loads the latest version of the plug-in, and support the compatibility of the old version of the plug-in to avoid system instability caused by version update; the reuse submodule stores the loaded plug-in through a cache mechanism; the range control submodule ensures that the plug-in runs within the authorized scope; the plug-in loading operation is performed on the plug-in interface of the plug-in manager through the dynamic loading construction module, the plug-in manager stores the plug-in information in a hash table, and completes the registration of the plug-in to obtain a plug-in list according to the plug-in interface. When the system needs to use a specific function, the plug-in manager selects a suitable plug-in from the registered plug-in list for calling according to the functional requirements.
[0020] Specifically, the dynamic loading method is implemented based on a .NET assembly. After dynamically loading a given plug-in, the plug-in type is obtained, an interface list is obtained through a reflection mechanism, and it is detected whether the interface included in the interface list contains the agreed interface preset by the plug-in and the system. If the agreed interface is included, an instance is created according to the plug-in type.
[0021] Specifically, the peripheral adaptation management unit optimizes the compatibility of the kit center by performing single-product verification on the software and hardware, including the server, terminal, operating system, database, and middleware, and adopts integrated adaptation technology to combine and adapt the various components.
[0022] Specifically, the smart adapter has an adaptive mechanism that automatically adjusts its working mode and parameter settings according to different application scenarios and user needs; when the network environment changes, the smart adapter automatically selects the optimal communication protocol and data transmission rate; when a hardware device is connected, it can identify the device type and automatically configure the corresponding driver and interface according to the device characteristics.
[0023] Specifically, the security access module performs fine-grained control based on the API interface permissions of system resources. The fine-grained control stores peripheral IDs, service levels, and permission information by building a custom access list; the service levels correspond to a set of permissions for each security level, and the peripheral IDs and permission information are dynamically allocated through a dynamic security model.
[0024] Specifically, after receiving the system request, the dynamic security model assigns a service level to the loaded peripheral ID, and realizes role service allocation by presetting a trust threshold for the service level. The interaction trust is calculated according to the service resource occupancy rate, resource utilization rate, service request rate and rejection rate after the peripheral interaction. The calculation formula is: , Among them, DCI is the interaction trust, MQ is the maximum system resource, RQ is the peripheral request resource, ST is the actual processing time, SPT is the service request processing time, RR is the service request rate, AC is the number of service resource accesses, EC is the number of service anomalies, DoS is the number of denials of service, k1, k2, k3, k4 are weight factors; The interactive trust is used to determine whether it is within the trust threshold range. If it is within the trust threshold range, a corresponding request is made and authentication of the corresponding permission set is provided; if it is not within the trust threshold range, the service level corresponding to the peripheral ID is reset and the interactive trust is recalculated.
[0025] The computer storage medium of the embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device.
[0026] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0027] The program code included on the computer readable medium can be transmitted with any appropriate medium, including but not limited to wireless, electric wire, optical cable, RF, etc., or any suitable combination of the above. The computer program code for performing the operation of the present invention can be written in one or more programming languages or their combinations, and the programming language includes object-oriented programming languages-such as Java, Smalltalk, C++, and also includes conventional procedural programming languages-such as "C" language or similar programming languages. The program code can be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0028] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technical personnel in this field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still fall within the scope of the technical solution of the present invention.
Claims
1. A peripheral device adaptation system based on a dynamic plug-in loading mechanism, characterized in that: include: Dynamic plug-in loading management unit, peripheral adaptation management unit, front-end management unit; The dynamic plug-in loading management unit loads the compiled file into the runtime environment in real time through a custom class loader. The custom class loader uses a Java class loader to convert bytecodes into Class objects, and creates an independent class loader for each plug-in to implement an independent execution environment; the runtime environment is a Java virtual machine; The peripheral device adaptation management unit is used to communicate with the peripheral device and parse and identify the special protocol and interface of the peripheral device through the intelligent adapter; The front-end management unit is used to design an API interface for front-end applications to call, and to perform permission control on sensitive operations through a security access module.
2. The system according to claim 1, characterized in that The workflow of the dynamic plug-in loading management unit is as follows: the plug-in manager is initialized when the system starts, and a dynamic loading construction module is constructed according to the plug-in manager. The dynamic loading construction module includes a deployment submodule, a version control submodule, a reuse submodule, and a range control submodule; the deployment submodule is used to identify the plug-in that needs to be loaded, download the plug-in module file from the remote server and load it into the local system, and parse and relocate the plug-in module file; the version control submodule is used to manage the version information of the plug-in, ensure that the system loads the latest version of the plug-in, and support the compatibility of the old version of the plug-in to avoid system instability caused by version updates; the reuse submodule stores the loaded plug-ins through a cache mechanism; the range control submodule ensures that the plug-in runs within the authorized scope; the plug-in loading operation is performed on the plug-in interface of the plug-in manager through the dynamic loading construction module, the plug-in manager stores the plug-in information in a hash table, and creates an instance according to the plug-in interface to complete the registration of the plug-in to obtain a plug-in list. When the system needs to use a specific function, the plug-in manager selects a suitable plug-in from the registered plug-in list for calling according to the functional requirements.
3. The system according to claim 2, characterized in that The dynamic loading method is implemented based on .NET assemblies. After dynamically loading a given plug-in, the plug-in type is obtained, an interface list is obtained through a reflection mechanism, and it is detected whether the interface included in the interface list contains the agreed interface preset by the plug-in and the system. If the agreed interface is included, an instance is created according to the plug-in type.
4. The system according to claim 1, characterized in that The peripheral adaptation management unit optimizes the compatibility of the kit center by verifying the individual hardware and software, including the server, terminal, operating system, database, and middleware, and adopts integrated adaptation technology to combine and adapt the various components.
5. The system according to claim 1, characterized in that The smart adapter has an adaptive mechanism that automatically adjusts its working mode and parameter settings according to different application scenarios and user needs; when the network environment changes, the smart adapter automatically selects the optimal communication protocol and data transmission rate; when a hardware device is connected, it can identify the device type and automatically configure the corresponding driver and interface according to the device characteristics.
6. The system according to claim 1, characterized in that The security access module performs fine-grained control based on the API interface permissions of system resources. The fine-grained control stores peripheral IDs, service levels, and permission information by building a custom access list; the service levels correspond to a set of permissions for each security level, and the peripheral IDs and permission information are dynamically allocated through a dynamic security model.
7. The system according to claim 6, characterized in that After receiving the system request, the dynamic security model assigns a service level to the loaded peripheral ID, and realizes role service allocation by presetting a trust threshold for the service level. The interaction trust is calculated according to the service resource occupancy rate, resource utilization rate, service request rate and rejection rate after the peripheral interaction. The calculation formula is: , Among them, DCI is the interaction trust, MQ is the maximum system resource, RQ is the peripheral request resource, ST is the actual processing time, SPT is the service request processing time, RR is the service request rate, AC is the number of service resource accesses, EC is the number of service anomalies, DoS is the number of denials of service, k1, k2, k3, k4 are weight factors; The interactive trust is used to determine whether it is within the trust threshold range. If it is within the trust threshold range, a corresponding request is made and authentication of the corresponding permission set is provided; if it is not within the trust threshold range, the service level corresponding to the peripheral ID is reset and the interactive trust is recalculated.
8. An electronic 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 program, the peripheral adaptation system based on the dynamic plug-in loading mechanism as described in any one of claims 1-7 is implemented.
9. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are used to execute the peripheral device adaptation system based on the dynamic plug-in loading mechanism as described in any one of claims 1 to 7 when executed by a computer processor.
Citation Information
Patent Citations
Java-system business-unit plug-in type managing system and dynamic business-function changing method
CN102411506A
Fine-grained access control method for hybrid Android applications
CN106850545A
Zero-trust API gateway dynamic trust evaluation and access control method and system based on machine learning
CN114465807A
Intelligent gateway system
CN118612307A
Cited By
Domestic operating system USB equipment management method and device, equipment and medium
CN120316750A
Safety management system compatible adaptation method supporting domestic middleware environment
CN120631434A
A security management system compatible adaptation method supporting a domestic middleware environment
CN120631434B
Plug-in management method
CN121187670A
A multi-protocol adaptive parsing and double-factor binding rapid physical examination system and method
CN122679172A