Plug-in management and control method and device, electronic equipment and computer readable storage medium

By determining the exclusive Spring application context of the target plug-in in the Spring framework, retrieving and saving shared beans, registering front-end controllers and its own beans, the problem of low adaptability between the plug-in and the Spring framework is solved, and automatic loading and efficient management are achieved.

CN119512650APending Publication Date: 2025-02-25CETC CYBERSPACE SECURITY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411598376.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

In the Spring framework, the adaptability of plug-ins to the framework is low, resulting in plug-ins not being able to load automatically, requiring manual assistance, flexibility and inefficiency.

Method used

By determining the exclusive Spring application context of the target plug-in in the Spring framework, retrieving and saving shared beans, registering the front-end controller and its own beans into the exclusive Spring application context, the automatic adaptation of the plug-in and the Spring framework is achieved.

Benefits of technology

It improves the flexibility and efficiency of plug-in loading, realizes automatic adaptation of plug-ins and Spring framework, without manual assistance, ensuring the normal operation of plug-ins and the global unification of request mapping.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512650A_ABST
    Figure CN119512650A_ABST
Patent Text Reader

Abstract

The invention provides a plug-in management and control method and device, electronic equipment and a computer readable storage medium, relates to the technical field of general-purpose computer software and application frameworks, is applied to a plug-in manager in a Spring framework, and determines an exclusive Spring application context of a target plug-in in the Spring framework; a shared Bean is retrieved from the context of the exclusive Spring application; the shared Bean is stored in the Spring application context of the target plug-in unit; acquiring a front-end controller of the target plug-in, registering the front-end controller into the exclusive Spring application context, and representing and processing the HTTP request by the front-end controller; and the Bean of the target plug-in is obtained, and the Bean of the target plug-in is registered in the exclusive Spring context. According to the technical scheme, it can be guaranteed that the target plug-in is matched with the Spring frame, normal work of the target plug-in is guaranteed, in addition, the whole process is automatically completed, flexibility is good, and efficiency is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of general computer software and application frameworks, and more specifically, to a plug-in management method, device, electronic device, and computer-readable storage medium. Background Art

[0002] With the development of the Internet and software technology, the requirements for flexibility and scalability of management platforms or application systems have increased accordingly. In order to meet this requirement, functions can be expanded through plug-ins. A plug-in is a program written in accordance with a certain specification of the application program interface.

[0003] However, in some frameworks, such as the Spring framework, there are cases where the plug-in has low compatibility with the Spring framework or cannot be adapted to the Spring framework, resulting in the plug-in being unable to be loaded into the Spring framework. Manual assistance is required to complete the plug-in loading process, which has poor flexibility and low efficiency.

[0004] In summary, how to improve the flexibility and efficiency of loading plug-ins in the Spring framework is a problem that needs to be solved urgently by those skilled in the art. Summary of the invention

[0005] The purpose of the present disclosure is to provide a plug-in management method, which can solve the technical problem of how to improve the flexibility and efficiency of loading plug-ins in the Spring framework to a certain extent. The present disclosure also provides a plug-in management device, an electronic device and a computer-readable storage medium.

[0006] According to a first aspect of an embodiment of the present disclosure, a plug-in management method is provided, which is applied to a plug-in manager in a Spring framework, including:

[0007] Determine a dedicated Spring application context for the target plug-in in the Spring framework;

[0008] Retrieve the shared Bean from the dedicated Spring application context;

[0009] Save the shared bean to the target plug-in's own Spring application context;

[0010] Obtain the front-end controller of the target plug-in, and register the front-end controller with the dedicated Spring application context, wherein the front-end controller represents and processes HTTP requests;

[0011] Get the own bean of the target plug-in, and register the own bean in the dedicated Spring context.

[0012] Preferably, the step of determining a dedicated Spring application context of the target plug-in in the Spring framework includes:

[0013] Obtain and inherit the plug-in management class of the target plug-in;

[0014] An exclusive Spring application context of the target plug-in in the Spring framework is created based on the plug-in management class.

[0015] Preferably, retrieving the shared Bean in the dedicated Spring application context includes:

[0016] Retrieving the shared configuration in the dedicated Spring application context;

[0017] Retrieving shared services in the dedicated Spring application context;

[0018] Retrieving shared tools in the dedicated Spring application context;

[0019] The shared configuration, the shared service and the shared tool are used as the shared Bean.

[0020] Preferably, obtaining the front-end controller of the target plug-in and registering the front-end controller in the dedicated Spring application context includes:

[0021] Receive a registration request from the target plug-in to the front-end controller;

[0022] In response to the registration request, determining an interface request path corresponding to the front-end controller;

[0023] The mapping relationship between the front-end controller and the interface request path is stored in the request mapping mechanism of the dedicated Spring application context.

[0024] Preferably, after obtaining the target plug-in's own bean and registering the own bean in the dedicated Spring context, the method further includes:

[0025] The target plug-in is exposed to other programs and / or other plug-ins in the Spring framework through the plug-in management class of the target plug-in.

[0026] Preferably, the target plug-in comprises a PF4J plug-in.

[0027] Preferably, the plug-in manager comprises a Spring Boot plug-in manager.

[0028] According to a second aspect of an embodiment of the present disclosure, a plug-in management and control device is provided, which is applied to a plug-in manager in a Spring framework, including:

[0029] A determination module, used to determine a dedicated Spring application context of a target plug-in in the Spring framework;

[0030] A retrieval module, used to retrieve the shared Bean in the dedicated Spring application context;

[0031] A saving module, used to save the shared bean into the Spring application context of the target plug-in;

[0032] A first registration module is used to obtain the front-end controller of the target plug-in and register the front-end controller with the dedicated Spring application context, wherein the front-end controller represents and processes HTTP requests;

[0033] The second registration module is used to obtain the own Bean of the target plug-in and register the own Bean in the dedicated Spring context.

[0034] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0035] Memory for storing computer programs;

[0036] A processor is used to execute the computer program in the memory to implement the steps of any of the methods described above.

[0037] According to a fourth aspect of an embodiment of the present disclosure, there is provided a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0038] The present disclosure provides a plug-in management method, which is applied to the plug-in manager in the Spring framework, determines the exclusive Spring application context of the target plug-in in the Spring framework; retrieves the shared bean in the exclusive Spring application context; saves the shared bean in the Spring application context of the target plug-in; obtains the front-end controller of the target plug-in, and registers the front-end controller in the exclusive Spring application context, the front-end controller represents the processing of HTTP requests; obtains the own bean of the target plug-in, and registers the own bean in the exclusive Spring context. In the present disclosure, the plug-in manager saves the shared bean in the exclusive Spring application context to the own Spring application context of the target plug-in, and registers the own bean of the target plug-in to the exclusive Spring application context. Since the exclusive Spring application context is the application context of the target plug-in in the Spring framework, after exchanging the bean between the exclusive Spring application context and the own Spring application context, the target plug-in can be guaranteed to be compatible with the Spring framework; and the front-end controller of the target plug-in is registered in the exclusive Spring application context, which can ensure that the request mapping of the target plug-in is globally unified, so that the Spring framework can normally apply the target plug-in; in addition, the whole process is completed automatically without manual assistance, with good flexibility and high efficiency. The plug-in management device, electronic device and computer-readable storage medium provided by the present disclosure also solve the corresponding technical problems.

[0039] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0041] Figure 1 The present invention is a flowchart of a plug-in management method according to an exemplary embodiment;

[0042] Figure 2 Diagram for starting plugins for the Spring Boot plugin manager;

[0043] Figure 3 Diagram of injecting Spring application context into the plugin;

[0044] Figure 4It is a structural schematic diagram of a plug-in management and control device according to an exemplary embodiment;

[0045] Figure 5 It is a block diagram of an electronic device 900 according to an exemplary embodiment. DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.

[0047] See also Figure 1 , Figure 1 The figure is a flow chart of a plug-in management method according to an exemplary embodiment.

[0048] The present disclosure relates to a plug-in management method, which is applied to a plug-in manager in a Spring framework and may include the following steps:

[0049] Step S101: Determine the exclusive Spring application context of the target plug-in in the Spring framework.

[0050] It is understandable that the plugin manager in the Spring framework refers to the controller that manages plugins in the Spring framework, and its type can be determined according to the application scenario, for example, the plugin manager can be a Spring Boot plugin manager, etc. In addition, the function of the plugin manager can also be determined according to the application scenario, for example, the plugin manager can start, load, stop, etc. the plugin.

[0051] It should be noted that in the process of loading a plug-in in the Spring framework, a Spring application context associated with the plug-in will be created in the Spring framework. This disclosure refers to the exclusive Spring application context of the plug-in in the Spring framework. Since the exclusive Spring application context carries information about the Spring framework managing the plug-in, this information will affect the adaptation between the Spring framework and the plug-in. Therefore, when managing the target plug-in, the plug-in manager must first determine the exclusive Spring application context of the target plug-in in the Spring framework. Among them, the function and type of the target plug-in can be determined according to the application scenario. For example, the target plug-in can be a plug-in with encryption function, a plug-in with signature function, a plug-in with information collection function, etc. For example, the target plug-in can be a PF4J plug-in, etc.

[0052] It is understandable that when loading plug-ins, the Spring framework will load class paths, resource files, etc. through the plug-in management class. During this process, the plug-in management class will set the exclusive Spring application context of the plug-in. Therefore, when the plug-in manager determines the exclusive Spring application context of the target plug-in in the Spring framework, it can obtain and inherit the plug-in management class of the target plug-in; based on the plug-in management class, it creates an exclusive Spring application context of the target plug-in in the Spring framework to quickly determine the exclusive Spring application context of the target plug-in.

[0053] Step S102: Retrieve the shared Bean from the dedicated Spring application context.

[0054] Step S103: Save the shared Bean to the Spring application context of the target plug-in.

[0055] It is understandable that in the dedicated Spring application context, the shared bean is used to synchronize the Spring framework with the plug-in, so after the plug-in management controller determines the dedicated Spring application context of the target plug-in in the Spring framework, it is necessary to retrieve the shared bean from the dedicated Spring application context and save the shared bean to the target plug-in's own Spring application context to preliminarily complete the synchronization between the Spring framework and the target plug-in. Among them, the target plug-in's own Spring application context refers to the application context created when the target plug-in is loaded into the Spring framework to adapt to the management and control of the Spring framework.

[0056] It should be noted that the Bean in the Spring framework is one of the core building blocks of the application, and is an object that is created, assembled, and managed by the Spring container. A Bean can be any Java object with specific functions, such as an entity class, a service class, a data access object, etc. Among them, the type of shared Bean in the exclusive Spring application context can be determined according to the application scenario. For example, shared Beans can include configurations, services, common tools, etc. Correspondingly, when the plug-in manager retrieves shared Beans in the exclusive Spring application context, it can retrieve shared configurations in the exclusive Spring application context; retrieve shared services in the exclusive Spring application context; retrieve shared tools in the exclusive Spring application context; and use shared configurations, shared services, and shared tools as shared Beans.

[0057] It should also be noted that, in the process of saving the shared bean into the target plug-in's own Spring application context, the plug-in manager can transfer the shared bean to the target plug-in through the Bean factory interface provided by the Spring framework, so that the target plug-in can save the shared bean into its own Spring application context.

[0058] Step S104: Obtain the front-end controller of the target plug-in, and register the front-end controller in the dedicated Spring application context. The front-end controller represents and processes HTTP requests.

[0059] It is understandable that after the Spring framework loads the target plug-in, it may need to interact with the outside world during the application of the target plug-in. At this time, it needs to rely on the target plug-in's ability to process HTTP requests, and the target plug-in's ability to process HTTP requests is reflected through the front-end controller. Therefore, in order to ensure the global uniformity of the target plug-in's HTTP request mapping so that the Spring framework can accurately apply the target plug-in, the plug-in manager needs to obtain the front-end controller of the target plug-in and register the front-end controller with the dedicated Spring application context. In this way, when the Spring framework receives an external request, it can forward the external request to the plug-in's front-end controller for processing through the request mapping in the dedicated Spring application context, completing the Spring framework's call to the plug-in.

[0060] It should be noted that the type of the front-end controller of the plug-in can be determined according to the application scenario. For example, the front-end controller can be a class with annotations such as @Controller or @RestController. In the process of registering the front-end controller with the dedicated Spring application context, the plug-in can detect whether its code has a class with annotations such as @Controller or @RestController through the scanning mechanism of Spring Boot. If so, it is determined that the front-end controller is detected and the detected front-end controller is registered with the dedicated Spring application context.

[0061] It should also be noted that the plug-in can register the front-end controller with the request mapping mechanism of the dedicated Spring application context, and this request mapping mechanism is used to store the mapping between the front-end controller and the interface request path. Accordingly, in the process of the plug-in manager obtaining the front-end controller of the target plug-in and registering the front-end controller with the dedicated Spring application context, it can receive the registration request of the target plug-in for the front-end controller; in response to the registration request, determine the interface request path corresponding to the front-end controller; and store the mapping relationship between the front-end controller and the interface request path in the request mapping mechanism of the dedicated Spring application context.

[0062] Step S105: Get the target plug-in's own bean, and register the own bean in a dedicated Spring context.

[0063] It is understandable that in order to further enhance the adaptation between the Spring framework and the plug-in, the plug-in manager also needs to obtain the target plug-in's own bean and register its own bean in the dedicated Spring context to complete the adaptation of the target plug-in to the Spring framework. Among them, the target plug-in's own bean refers to the bean in the target plug-in that is responsible for providing plug-in services, and its type and content can be determined according to the application scenario.

[0064] It should be noted that in order to enable other programs or other plug-ins in the Spring framework to interact with the target plug-in, the plug-in manager obtains the target plug-in's own bean and registers its own bean in the dedicated Spring context. It can also expose the target plug-in to other programs and / or other plug-ins in the Spring framework through the plug-in management class of the target plug-in.

[0065] The present disclosure provides a plug-in management method, which is applied to the plug-in manager in the Spring framework, determines the exclusive Spring application context of the target plug-in in the Spring framework; retrieves the shared bean in the exclusive Spring application context; saves the shared bean in the Spring application context of the target plug-in; obtains the front-end controller of the target plug-in, and registers the front-end controller in the exclusive Spring application context, the front-end controller represents the processing of HTTP requests; obtains the own bean of the target plug-in, and registers the own bean in the exclusive Spring context. In the present disclosure, the plug-in manager saves the shared bean in the exclusive Spring application context to the Spring application context of the target plug-in, and registers the own bean of the target plug-in in the exclusive Spring application context. Since the exclusive Spring application context is the application context of the target plug-in in the Spring framework, after exchanging the beans between the exclusive Spring application context and the own Spring application context, the target plug-in can be guaranteed to be compatible with the Spring framework; and the front-end controller of the target plug-in is registered in the exclusive Spring application context, which can ensure that the request mapping of the target plug-in is globally unified, so that the Spring framework can normally apply the target plug-in; in addition, the whole process is completed automatically without manual assistance, with good flexibility and high efficiency.

[0066] In order to facilitate the understanding of the disclosed solution, the startup process of the plug-in in the Spring framework is described in conjunction with the Spring Boot plug-in manager. This process can be referred to in Figure 2, including the following steps:

[0067] The main program in the Spring framework starts, initializes the Spring Boot framework, and loads the Spring Boot plug-in autoassembly class;

[0068] Create and configure a Spring Boot plugin manager;

[0069] Trigger plug-in startup; get plug-in path; load plug-in;

[0070] Create a plugin class loader; load the Spring Boot boot program;

[0071] Plugin Bean is injected into Spring context; Plugin front controller mapping;

[0072] The plugin is ready to interact.

[0073] The process of injecting the plug-in into the Spring application context is as follows Figure 3 As shown, the following steps are included:

[0074] When the main program issues a plug-in startup instruction, it inherits the plug-in management class and implements the improvement of the Spring framework life cycle. The plug-in management class creates a dedicated Spring application context for the plug-in, which is also the main program application context.

[0075] During the startup of the plug-in, the shared beans are directly retrieved from the Spring application context of the main application through the Bean factory interface provided by the Spring framework, and the shared beans are saved in the plug-in's own Spring application context, that is, the plug-in application context;

[0076] When the plugin detects classes whose code is annotated with @Controller or @RestController through Spring Boot's scanning mechanism, the plugin registers these identified front controllers with the request mapping mechanism of the main program Spring application context;

[0077] The plug-in continues to register its own beans in the dedicated Spring application context, and exposes plug-in resources and information to the main program, other programs, and other plug-ins through the plug-in management class.

[0078] Through the disclosed solution, the plug-in is adapted to the life cycle of the Spring framework, making it compatible and easy to use in Spring applications. The plug-in can be directly loaded into the application of the Spring framework, and the automatic configuration function of Spring Boot can be brought into play, so that the single Spring Boot application supports plug-inization and realizes efficient plug-in management.

[0079] See also Figure 4 , Figure 4 The figure is a schematic diagram of the structure of a plug-in management and control device according to an exemplary embodiment.

[0080] The present disclosure relates to a plug-in management and control device 400, which is applied to a plug-in manager in a Spring framework and may include:

[0081] A determination module 410 is used to determine a dedicated Spring application context of a target plug-in in a Spring framework;

[0082] A retrieval module 420 is used to retrieve a shared bean in a dedicated Spring application context;

[0083] A saving module 430 is used to save the shared bean into the Spring application context of the target plug-in;

[0084] The first registration module 440 is used to obtain the front-end controller of the target plug-in and register the front-end controller to the dedicated Spring application context, where the front-end controller represents the processing of HTTP requests;

[0085] The second registration module 450 is used to obtain the target plug-in's own bean and register the own bean in a dedicated Spring context.

[0086] The present disclosure relates to a plug-in management and control device, which is applied to a plug-in manager in a Spring framework. The determination module may include:

[0087] A first acquisition unit, used to acquire and inherit the plug-in management class of the target plug-in;

[0088] The first creation unit is used to create a dedicated Spring application context of the target plug-in in the Spring framework based on the plug-in management class.

[0089] The present disclosure relates to a plug-in management and control device, which is applied to a plug-in manager in a Spring framework. The retrieval module may include:

[0090] A first retrieval unit is used to retrieve the shared configuration in the dedicated Spring application context;

[0091] The second retrieval unit is used to retrieve the shared service in the dedicated Spring application context;

[0092] A third retrieval unit is used to retrieve the shared tool in the dedicated Spring application context;

[0093] The first setting unit is used to use the shared configuration, shared service and shared tool as shared beans.

[0094] The present disclosure relates to a plug-in management and control device, which is applied to a plug-in manager in a Spring framework. The first registration module may include:

[0095] A first receiving unit, configured to receive a registration request from a target plug-in to a front-end controller;

[0096] A first determining unit, configured to determine, in response to a registration request, an interface request path corresponding to the front-end controller;

[0097] The first storage unit is used to store the mapping relationship between the front-end controller and the interface request path in the request mapping mechanism of the exclusive Spring application context.

[0098] The present disclosure relates to a plug-in management and control device, which is applied to a plug-in manager in a Spring framework and may further include:

[0099] The exposure module is used for the second registration module to obtain the target plug-in's own bean, and after registering the own bean in the exclusive Spring context, the target plug-in is exposed to other programs and / or other plug-ins in the Spring framework through the plug-in management class of the target plug-in.

[0100] The present disclosure relates to a plug-in management and control device, which is applied to a plug-in manager in a Spring framework, and a target plug-in may include a PF4J plug-in.

[0101] The present disclosure relates to a plug-in management and control device, which is applied to a plug-in manager in a Spring framework. The plug-in manager may include a Spring Boot plug-in manager.

[0102] Figure 5 FIG. 9 is a block diagram of an electronic device 900 according to an exemplary embodiment. Figure 5 As shown, the electronic device 900 may include: a processor 901 , a memory 902 . The electronic device 900 may also include one or more of a multimedia component 903 , an input / output (I / O) interface 904 , and a communication component 905 .

[0103] Among them, the processor 901 is used to control the overall operation of the electronic device 900 to complete all or part of the steps in the above-mentioned plug-in management method. The memory 902 is used to store various types of data to support the operation of the electronic device 900, and these data may include, for example, instructions for any application or method used to operate on the electronic device 900, and application-related data, such as contact data, messages sent and received, pictures, audio, video, etc. The memory 902 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, referred to as EPROM), programmable read-only memory (Programmable Read-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, disk or optical disk. The multimedia component 903 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may be further stored in the memory 902 or sent through the communication component 905. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 904 provides an interface between the processor 901 and other interface modules, and the above-mentioned other interface modules may be a keyboard, a mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 905 is used for wired or wireless communication between the electronic device 900 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so the corresponding communication component 905 may include: Wi-Fi module, Bluetooth module, NFC module.

[0104] In an exemplary embodiment, the electronic device 900 can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned plug-in management and control method.

[0105] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the above-mentioned plug-in management method are implemented. For example, the computer-readable storage medium can be the above-mentioned memory 902 including program instructions, and the above-mentioned program instructions can be executed by the processor 901 of the electronic device 900 to complete the above-mentioned plug-in management method.

[0106] For the description of the relevant parts of the plug-in control device, electronic device, and computer-readable storage medium provided in the embodiments of the present disclosure, please refer to the detailed description of the corresponding parts in the plug-in control method provided in the embodiments of the present disclosure, which will not be repeated here. In addition, the parts of the above technical solutions provided in the embodiments of the present disclosure that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail to avoid excessive elaboration.

[0107] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0108] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A plug-in management method, characterized in that: Plugin managers used in the Spring framework include: Determine a dedicated Spring application context for the target plug-in in the Spring framework; Retrieve the shared Bean from the dedicated Spring application context; Save the shared bean to the target plug-in's own Spring application context; Obtain the front-end controller of the target plug-in, and register the front-end controller with the dedicated Spring application context, wherein the front-end controller represents and processes HTTP requests; Get the own bean of the target plug-in, and register the own bean in the dedicated Spring context.

2. The method according to claim 1, characterized in that The determination of the exclusive Spring application context of the target plug-in in the Spring framework includes: Obtain and inherit the plug-in management class of the target plug-in; An exclusive Spring application context of the target plug-in in the Spring framework is created based on the plug-in management class.

3. The method according to claim 1, characterized in that The retrieving the shared Bean in the dedicated Spring application context includes: Retrieving the shared configuration in the dedicated Spring application context; Retrieving shared services in the dedicated Spring application context; Retrieving shared tools in the dedicated Spring application context; The shared configuration, the shared service and the shared tool are used as the shared Bean.

4. The method according to claim 1, characterized in that: The obtaining of the front-end controller of the target plug-in and registering the front-end controller with the dedicated Spring application context includes: Receive a registration request from the target plug-in to the front-end controller; In response to the registration request, determining an interface request path corresponding to the front-end controller; The mapping relationship between the front-end controller and the interface request path is stored in the request mapping mechanism of the dedicated Spring application context.

5. The method according to any one of claims 1 to 4, characterized in that: After obtaining the target plug-in's own bean and registering the own bean in the dedicated Spring context, it also includes: The target plug-in is exposed to other programs and / or other plug-ins in the Spring framework through the plug-in management class of the target plug-in.

6. The method according to claim 5, characterized in that The target plug-in includes a PF4J plug-in.

7. The method according to claim 5, characterized in that The plugin manager includes a Spring Boot plugin manager.

8. A plug-in management and control device, characterized in that: Plugin managers used in the Spring framework include: A determination module, used to determine a dedicated Spring application context of a target plug-in in the Spring framework; A retrieval module, used to retrieve the shared Bean in the dedicated Spring application context; A saving module, used to save the shared bean into the Spring application context of the target plug-in; A first registration module is used to obtain the front-end controller of the target plug-in and register the front-end controller with the dedicated Spring application context, wherein the front-end controller represents and processes HTTP requests; The second registration module is used to obtain the own Bean of the target plug-in and register the own Bean in the dedicated Spring context.

9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.