A method for supporting multi-client deployment plug-in framework based on Felix

Through the deployment method of plug-in function layered deployment and multi-customer support, the problem of inefficient deployment of multi-customer plug-ins in the Felix framework is solved, and efficient management and maintenance of plug-ins are achieved.

CN113590233BActive Publication Date: 2024-11-05XINHE SEMICON TECH (WUXI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110975071.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-24
Publication Date
2024-11-05
Estimated Expiration
2041-08-24

AI Technical Summary

Technical Problem

The existing Felix framework fails to effectively support multi-customer plug-in deployment, resulting in inefficient code maintenance and efficiency, and requires the development of multiple plug-in codes with the same functions for different manufacturers.

Method used

The plug-in functions are deployed in layers, and the plug-ins are classified into system plug-ins, custom plug-ins and third-party plug-ins. Multi-customer support is achieved through a unified manufacturer name and Maven configuration file, separating common and customized code and resources.

Benefits of technology

It realizes layered management and multi-customer support for plug-ins, reduces code development and maintenance costs, and improves plug-ins installation and management efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113590233B_ABST
    Figure CN113590233B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of plug-in management, and specifically discloses a method for deploying a plug-in framework supporting multiple clients based on Felix, which includes two parts: hierarchical deployment of plug-in functions and deployment of plug-ins to support multiple clients; the plug-ins are hierarchically deployed according to their functions as system plug-ins, custom plug-ins, and third-party plug-ins, which are easy to manage and expand; based on the Maven build system, the plug-in functions are reused and customized to support the needs of multiple clients. The present invention supports hierarchical management of Java plug-ins, which is convenient for management; when loading plug-ins, only need to copy them to the corresponding directory to achieve installation and management, which is easy to expand; supports a multi-client plug-in deployment method based on Maven to reduce the development cost of the code and improve the plug-in maintenance efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of hierarchical management of plug-ins, and in particular to a method for supporting a multi-client deployment plug-in framework based on Felix. Background Art

[0002] The Felix framework has its own Java plug-in management configuration, but it does not manage these plug-ins in layers according to actual business needs.

[0003] Maven is a Java project construction system, which can be used to deploy the framework of Felix. According to the code construction of the Maven project, classes of different paths need to create class files of different paths, and the naming of the class path in the regular project needs to include the manufacturer's name. So for the same functional plug-in, if different customers are to be supported, that is, when multiple manufacturer names need to be supported, the developed project needs to deploy multiple copies of code, which is not very convenient for code maintenance and efficiency. Therefore, the present invention provides a plug-in deployment method supporting multiple customers to improve code development and maintenance efficiency. Summary of the invention

[0004] The object of the present invention is to provide a method for supporting a multi-client deployment plug-in framework based on Felix, so as to solve the problems raised in the above background technology.

[0005] To achieve the above object, the present invention provides the following technical solutions:

[0006] A method for deploying a plug-in framework supporting multiple clients based on Felix includes two parts: one part is layered deployment of plug-in functions; the other part is deployment of plug-ins to support multiple clients.

[0007] Layered deployment of plug-in functions: Plug-ins are classified into three categories, and the startup order and startup settings of each category of plug-ins are different.

[0008] The first category is system plugins, which are stored in the system plugin directory. System plugins refer to the basic plugins that make up the Felix framework and OSGi architecture, such as org.apache.felix.framework-6.0.0.jar, etc. The plugin resources are downloaded from the Felix or Maven official website. The startup level of this type of plugin is 1. After the framework is started, the plugin is started by default and cannot be stopped or deleted. Because if the plugin is stopped or deleted due to an incorrect operation, the entire framework will fail to start. Unless there are special circumstances, system plugins are generally not upgraded.

[0009] The second category is custom plug-ins, which are stored in the custom plug-in directory. Custom plug-in resources are developed by ourselves. The startup levels of such plug-ins are 2 and 3. When the level is 2, the plug-in is started by default after the framework is started, and it will resume startup even if it is stopped, deleted, and restarted. When the level is 3, the plug-in is started by default after the framework is started, and it can be stopped and deleted. The code of custom plug-ins is developed and maintained by ourselves.

[0010] The third category is third-party plug-ins, which are stored in the third-party plug-in directory; third-party plug-ins refer to plug-ins developed and provided by other manufacturers, and the resources are provided by other manufacturers; the startup level of this type of plug-in is 4, and the plug-in is not started by default when the framework starts. Other management plug-ins start and manage the plug-in, and it can be stopped and deleted; generally, different customers choose the same first and second category plug-ins, and then choose different third-party plug-ins in the third category plug-in.

[0011] The plugin enables deployment of multiple clients:

[0012] 1. We first unify the names of vendors into a common name called vendor, and define vendor as a directory to store Java class codes.

[0013] 2. Then divide our function implementation class into two types: one is the common class that all manufacturers need to support; the other is the customized class that only a certain manufacturer has.

[0014] 3. Resources such as web pages and configuration files are also divided into two types: one is the resource file that all manufacturers need to support; the other is the customized resource file that only a certain manufacturer has.

[0015] The above deployment of multiple customer support is only applicable to plug-ins with the same functions or only a few different plug-ins, which can save code development costs and later maintenance costs. It is not applicable to plug-ins with large functional differences.

[0016] Compared with the prior art, the advantages of the present invention are:

[0017] 1. Support hierarchical management of Java plug-ins, dividing plug-ins into system plug-ins, custom plug-ins and third-party plug-ins for easy management; when loading plug-ins in the future, you only need to copy them to the corresponding directory to achieve installation and management, which is easy to expand.

[0018] 2. Support Maven-based multi-client plug-in deployment method to reduce code development costs and improve plug-in maintenance efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 This is a schematic diagram of the structure of hierarchical deployment of plug-in functions in the method of the present invention.

[0020] Figure 2A schematic diagram of the deployment structure of the plug-in for implementing multi-client support for the method of the present invention. DETAILED DESCRIPTION

[0021] The technical solution of this patent is further described in detail below in conjunction with specific implementation methods.

[0022] See also Figure 1 , 2 A method for supporting multi-client deployment plug-in framework based on Felix includes two parts: layered deployment of plug-in functions and deployment of plug-ins to support multi-clients.

[0023] (I) Layered deployment of plug-in functions:

[0024] (1) First, three directories are constructed to store plug-ins of different levels. When downloading or updating a plug-in, the plug-in can be automatically classified as long as it is stored in the corresponding directory.

[0025] (2) The configuration files in the Felix framework can be used to implement the startup order of the three plug-ins. Different customers only need to maintain different configuration files.

[0026] (3) Develop a management plug-in to manage the third-category plug-ins, determine the startup order of the third-category plug-ins, and implement operations such as installation and uninstallation.

[0027] Plug-ins are classified into three categories, and the startup order and startup settings of each category are different:

[0028] 1) The first category is system plug-ins, which are stored in the system plug-in directory; system plug-ins refer to the basic plug-ins that make up the Felix framework and OSGi architecture, such as org.apache.felix.framework-6.0.0.jar, etc. The plug-in resources are downloaded from the Felix or Maven official website. The startup level of this type of plug-in is 1. After the framework is started, the plug-in is started by default and cannot be stopped or deleted. Because if the plug-in is stopped or deleted due to an incorrect operation, it will cause the entire framework to fail to start; unless there are special circumstances, system plug-ins are generally not upgraded.

[0029] 2) The second category is custom plug-ins, which are stored in the custom plug-in directory. Custom plug-in resources are developed by ourselves, and the startup levels of such plug-ins are 2 and 3. When the level is 2, the plug-in is started by default after the framework is started, and it will resume startup even if the framework is stopped, deleted, and restarted. When the level is 3, the plug-in is started by default after the framework is started, and it can be stopped and deleted. The code of the custom plug-in is developed and maintained by R&D personnel.

[0030] 3) The third category is third-party plug-ins, which are stored in the third-party plug-in directory; third-party plug-ins are plug-ins developed and provided by other manufacturers, and the resources are provided by other manufacturers; the startup level of this type of plug-in is 4, and the plug-in is not started by default when the framework starts. Other management plug-ins start and manage the plug-in, and can stop and delete it. Generally, different customers choose the same first and second category plug-ins, and then choose different third-party plug-ins in the third category plug-in.

[0031] (II) Plugins to implement multi-client support deployment:

[0032] (1) First, unify the names of manufacturers into a common name called vendor.

[0033] (2) Before compiling the entire project, replace the vendor directory with the actual manufacturer name as the new code compilation directory.

[0034] (3) In the Maven configuration file, create different profiles. The profiles are defined according to the manufacturer and include the required classes or exclude the Java class files that do not belong to the manufacturer.

[0035] (4) In the Maven configuration file, select the required resources, or exclude unnecessary resources.

[0036] (5) In code implementation, if different vendors need to execute different logics, this can be achieved by defining vendor variables in the configuration file within the Felix framework; in the code, the corresponding logical actions are executed according to the actual value of the vendor. Different vendors only need to maintain configuration files with different variables.

[0037] The above describes in detail the preferred implementation of this patent, but this patent is not limited to the above implementation. Various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of this patent.

Claims

1. A method for supporting multi-client deployment plug-in framework based on Felix, It is characterized in that It includes two parts: hierarchical deployment of plug-in functions and deployment of plug-ins to support multiple customers. Plug-ins are deployed hierarchically according to their functions: system plug-ins, custom plug-ins, and third-party plug-ins. Based on the system built by Maven, plug-in functions can be reused and customized to support the needs of multiple customers. The plug-in functions are deployed in layers, as follows: (1) First, build three directories to store different types of plug-ins; (2) Use the configuration files in the Felix framework to implement the startup sequence of the three types of plug-ins. Different customers maintain different configuration files. (3) Develop a management plug-in to manage the third-category plug-ins, determine the startup order of the third-category plug-ins, and implement installation and uninstallation operations; Plug-ins are classified into three categories, and the startup order and startup settings of each category are different: 1) The first category is system plug-ins, which are stored in the system plug-in directory. System plug-ins refer to the basic plug-ins that make up the Felix framework and OSGi architecture. The startup level of this type of plug-in is 1. After the framework is started, the plug-in is started by default and cannot be stopped or deleted. 2) The second category is custom plug-ins, which are stored in the custom plug-in directory; the startup levels of this type of plug-in are 2 and 3; When the level is 2, the plugin is started by default after the framework is started, and it will be restarted even if the framework is stopped, deleted, or restarted; When the level is 3, the plug-in is started by default after the framework is started, and can be stopped and deleted; the code of the custom plug-in is developed and maintained by R&D personnel; 3) The third category is third-party plug-ins, which are stored in the third-party plug-in directory; Third-party plug-ins are plug-ins developed and provided by other manufacturers; The startup level of this type of plug-in is 4. When the framework starts, the plug-in is not started by default. Other management plug-ins start and manage the plug-in, and it can be stopped and deleted. The plugin implements deployment of multiple client support, as follows: a. First, unify the names of manufacturers into a common name called vendor; b. Before compiling the entire project, replace the vendor directory with the actual manufacturer name as the new code compilation directory; c. Create different profiles in the Maven configuration file. The profiles are defined according to the vendor, including the required classes, or excluding the Java class files that do not belong to the vendor; d. In the Maven configuration file, select the required resource, or Exclude unnecessary resources; e. For code implementation, if different vendors need to execute different logics, this can be achieved by defining vendor variables in the configuration file within the Felix framework.

2. A method for supporting a multi-client deployment plug-in framework based on Felix according to claim 1, It is characterized in that Multi-client deployment is supported only for plugins that have the same functionality or only have a few differences.

3. A method for supporting a multi-client deployment plug-in framework based on Felix according to claim 1, It is characterized in that In the code, the corresponding logical actions are executed according to the actual value of the vendor; different vendors maintain different configuration files for variables.