Kafka message-based plug-in installation method and device, and storage medium

CN117608603BActive Publication Date: 2026-10-09GUANGZHOU PINWEI SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311643647.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-30
Publication Date
2026-10-09
Estimated Expiration
2043-11-30

AI Technical Summary

Technical Problem

[0004]本申请的目的旨在至少能解决上述的技术缺陷之一,特别是现有技术中在应用重启时,由于应用所对应的插件在应用关闭时会被卸载,因此,定时轮询的方式会导致不能及时发现应用未安装插件的情况,插件安装的效率较低的技术缺陷

Benefits of technology

[0046] This application provides a plugin installation method, apparatus, and storage medium based on Kafka messages. The method includes: when a Kafka message sent by a target application is detected, determining whether the application has started successfully based on the Kafka message; if the target application has started successfully, initiating the installation of the target plugin. The Kafka message is startup information sent by the target application to a topic subscribed to by the server during startup. Therefore, the target plugin can be installed immediately upon application startup, thereby improving plugin installation efficiency. Furthermore, when the target application already has the target plugin installed, compared to periodic polling, repeated polling checks are avoided, thus saving service resources and reducing plugin installation costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117608603B_ABST
    Figure CN117608603B_ABST
Patent Text Reader

Abstract

The application provides a Kafka message-based plug-in installation method and device and a storage medium. The method comprises the following steps: when a Kafka message sent by a target application is monitored, it is determined whether the application is successfully started according to the Kafka message; if the target application is successfully started, the installation of a target plug-in is started. The Kafka message is start information sent by the corresponding target application to a topic subscribed by a server when the target application is started. Therefore, the target plug-in can be installed at the first time when the application is started, so that the efficiency of plug-in installation is improved. Moreover, in the case where the target application has installed the target plug-in, compared with the timing polling mode, repeated polling and checking can be avoided, so that the service resources are saved, and the cost of plug-in installation is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of plugin detection technology, and in particular to a plugin installation method, apparatus and storage medium based on Kafka messages. Background Technology

[0002] With the development of cloud computing, more and more enterprises and individuals are choosing to migrate their applications and data to the cloud. To facilitate user management and use of these applications, many cloud service providers offer plugins or extensions to enhance the functionality and performance of their cloud platforms. Therefore, detecting whether plugins are installed and installing them promptly when not is crucial for the proper functioning of applications in cloud services.

[0003] Currently, the main method used is to check whether each application in the application list has its corresponding plugin installed by periodic polling. However, when an application restarts, the plugins corresponding to the application are uninstalled when the application is closed. Therefore, the periodic polling method may not be able to detect applications without plugins in a timely manner, resulting in low plugin installation efficiency. Summary of the Invention

[0004] The purpose of this application is to at least solve one of the aforementioned technical defects, particularly the technical defect in the prior art where, when an application restarts, the plugins corresponding to the application are uninstalled when the application is closed. Therefore, the timed polling method cannot detect situations where the application does not have plugins installed in time, resulting in low plugin installation efficiency.

[0005] Firstly, this application provides a plugin installation method based on Kafka messages, the method comprising:

[0006] When a Kafka message sent by the target application is detected, the deployment status and resource directory contained in the Kafka message are obtained, and the target plugin is determined based on the Kafka message; wherein, the Kafka message is the startup information sent by the corresponding target application to a topic that has been subscribed to by the server when it starts up.

[0007] Based on the deployment status, determine whether the target application has started successfully;

[0008] If the target application starts successfully, the application connection information corresponding to the target application is extracted from the Kafka message;

[0009] Based on the application connection information, establish a connection with the target application;

[0010] When it is determined that the target plugin has been installed in the target application, the installation directory of the target application corresponding to the target plugin is matched with the resource directory;

[0011] When it is determined that each plugin package in the resource directory exists in the target application, check whether the plugin packages in the target application corresponding to each record in the resource directory have been successfully injected.

[0012] If the plugin package corresponding to each record in the resource directory in the target application is successfully injected, a notification message indicating that the target plugin has been successfully installed is generated and the notification message is returned to the client.

[0013] In one embodiment, determining that the target plugin is installed in the target application includes:

[0014] Determine whether installation information corresponding to the target plugin exists in the target application;

[0015] If the target application contains installation information corresponding to the target plugin, then it is determined that the target plugin has been installed in the target application.

[0016] If the target application does not have installation information corresponding to the target plugin, the installation package of the target plugin is copied from a preset public server to the target application, and it is determined that the target plugin has been installed in the target application.

[0017] In one embodiment, determining that each plugin package corresponding to the resource directory exists in the target application includes:

[0018] Determine whether each record in the resource directory exists in the installation directory corresponding to the target plugin;

[0019] If each record in the resource directory exists in the installation directory, then it is determined that each corresponding plugin package in the resource directory exists in the target application.

[0020] If there is a record in the resource directory that does not exist in the installation directory, then the record in the resource directory that does not exist in the installation directory is identified as the target record;

[0021] Copy the plugin package corresponding to the target record from the preset public server to the target application, and confirm that each plugin package corresponding to the resource directory exists in the target application.

[0022] In one embodiment, establishing a connection with the target application based on the application connection information includes:

[0023] Obtain the IP address, port number, username, and password from the application connection information;

[0024] The target address is determined based on the IP address and the port number;

[0025] Using the account and password, log in to the target address to complete the connection with the target application.

[0026] In one embodiment, the method further includes:

[0027] If a plugin package corresponding to the resource directory in the target application fails to be injected, then the plugin package in the target application that fails to be injected corresponding to the resource directory is identified as the target package.

[0028] Load the target function package into the target application;

[0029] Generate a notification message indicating that the target plugin has been successfully installed, and return the notification message to the client.

[0030] In one embodiment, the method further includes:

[0031] If the target application fails to start, an alarm message is generated and sent to the client.

[0032] In one embodiment, the method further includes:

[0033] When the target application is closed, the target plugin is uninstalled.

[0034] Secondly, this application provides a plugin installation device based on Kafka messages, the device comprising:

[0035] The message listening module is used to obtain the deployment status and resource directory contained in the Kafka message when it listens for a Kafka message sent by the target application, and to determine the target plugin based on the Kafka message; wherein, the Kafka message is the startup information sent by the corresponding target application to a topic that has been subscribed to by the server when it starts up;

[0036] The application startup determination module is used to determine whether the target application has started successfully based on the deployment status.

[0037] The information extraction module is used to extract the application connection information corresponding to the target application from the Kafka message if the target application starts successfully.

[0038] A connection establishment module is used to establish a connection with the target application based on the application connection information.

[0039] The directory matching module is used to match the installation directory of the target plugin in the target application with the resource directory when it is determined that the target plugin has been installed in the target application.

[0040] The injection detection module is used to detect whether the plugin function packages corresponding to each record in the resource directory in the target application have been successfully injected when it is determined that each plugin function package in the resource directory exists in the target application.

[0041] The notification information sending module is used to generate a notification information indicating that the target plugin has been successfully installed if the plugin function package corresponding to each record in the resource directory in the target application is successfully injected, and then return the notification information to the client.

[0042] Thirdly, this application provides a storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the plug-in installation method based on Kafka messages as described in any of the above embodiments.

[0043] Fourthly, this application provides a computer device, including: one or more processors, and a memory;

[0044] The memory stores computer-readable instructions, and when the one or more processors execute the computer-readable instructions, they perform the steps of the plug-in installation method based on Kafka messages as described in any of the above embodiments.

[0045] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:

[0046] This application provides a plugin installation method, apparatus, and storage medium based on Kafka messages. The method includes: when a Kafka message sent by a target application is detected, determining whether the application has started successfully based on the Kafka message; if the target application has started successfully, initiating the installation of the target plugin. The Kafka message is startup information sent by the target application to a topic subscribed to by the server during startup. Therefore, the target plugin can be installed immediately upon application startup, thereby improving plugin installation efficiency. Furthermore, when the target application already has the target plugin installed, compared to periodic polling, repeated polling checks are avoided, thus saving service resources and reducing plugin installation costs. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in the embodiments of this application 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 this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 A flowchart illustrating a plugin installation method based on Kafka messages, provided for an embodiment of this application;

[0049] Figure 2 A flowchart illustrating the steps for determining that a target plugin has been installed in a target application, as provided in an embodiment of this application;

[0050] Figure 3 A flowchart illustrating the steps for determining that each plugin function package in the resource directory exists in the target application, as provided in this application embodiment;

[0051] Figure 4 A schematic diagram of a plug-in installation device based on Kafka messages provided in an embodiment of this application;

[0052] Figure 5 This is an internal structural diagram of a computer device provided in an embodiment of this application. Detailed Implementation

[0053] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0054] In one embodiment, this application provides a plugin installation method based on Kafka messages. The following embodiments illustrate the application of this method to a server. It is understood that the plugin installation method based on Kafka messages can be performed on a single server or on a server cluster consisting of multiple servers, and this application does not impose any specific limitations on this.

[0055] like Figure 1 As shown, this application provides a plugin installation method based on Kafka messages, the method comprising:

[0056] Step S101: When a Kafka message sent by the target application is detected, obtain the deployment status and resource directory contained in the Kafka message, and determine the target plugin based on the Kafka message.

[0057] In this context, a Kafka message is startup information sent by the target application to a topic subscribed to by the server upon startup. The target application refers to the application deployed on a remote server. A target plugin is an extensible software component that can interact with the target application and provide additional functionality.

[0058] Specifically, you can create a topic in the Kafka cluster and have the server subscribe to that topic. When the target application sends Kafka messages to that topic, the server will listen for the Kafka messages sent by the target application.

[0059] In this step, when the target application starts, a Kafka message is generated based on startup information such as application connection information, deployment time, deployment status, and resource directory. This Kafka message is then sent to topics subscribed to by the server, ensuring that the server can immediately receive the Kafka message from the target application upon startup. When the server receives the Kafka message, it retrieves the deployment status and resource directory from the message and determines the target plugin based on the application connection information within the message.

[0060] It is understandable that a resource directory refers to the directory of functional packages required by the target application.

[0061] Step S102: Determine whether the target application has started successfully based on the deployment status.

[0062] Deployment status refers to the state of software or system during runtime.

[0063] In this step, when the deployment status is obtained from the Kafka message, it is possible to determine whether the target application has started successfully based on the deployment status. If the target application has started successfully, a connection with the target application can be established.

[0064] Step S103: If the target application starts successfully, extract the application connection information corresponding to the target application from the Kafka message.

[0065] Application connectivity information refers to the relevant information required by a target application to communicate and interact with other systems, services, or components.

[0066] In this step, once the target application is confirmed to have started successfully, the application connection information is extracted from the Kafka message so that the server can log in to the target application in the remote service based on the extracted application connection information.

[0067] Step S104: Establish a connection with the target application based on the application connection information.

[0068] Understandably, the server logs into the target application in the remote service based on the application connection information. When the login is successful, it means that the connection between the server and the target application has been successfully established.

[0069] Step S105: When it is determined that the target plugin has been installed in the target application, match the installation directory and resource directory corresponding to the target plugin in the target application.

[0070] In this step, upon successful login to the target application, it is determined whether the target plugin has been installed in the target application. If it is determined that the target plugin has been installed in the target application, the server will match the installation directory of the target plugin in the target application with the resource directory. That is, it checks whether the installation directory of the target plugin in the target application contains every record in the resource directory, to ensure that all the functional packages required by the target application exist in the target application.

[0071] Step S106: When it is determined that each plugin package in the resource directory exists in the target application, check whether the plugin packages corresponding to each record in the resource directory in the target application have been successfully injected.

[0072] In this context, a plugin package refers to a third-party library that the target plugin depends on, or a Java class library provided by the target plugin itself. A target plugin may contain multiple plugin packages. Essentially, integrating plugins (plugin packages) responsible for specific functions into a single plugin (the target plugin) allows for the provision of multiple functionalities through a single plugin when multiple functions are needed, thus avoiding plugin conflicts.

[0073] In this step, when the installation directory corresponding to the target plugin in the target application is matched with the resource directory, and it is determined that each plugin package in the resource directory exists in the target application, the server will determine whether the plugin package corresponding to each record in the resource directory in the target application has been successfully injected.

[0074] Furthermore, whether the plugin packages corresponding to each record in the resource directory in the target application have been successfully injected can be detected by checking the log output for information about plugin loading and startup. This application does not impose specific restrictions on methods such as monitoring the target application's status or calling specific APIs.

[0075] Step S107: If the plugin package corresponding to each record in the resource directory in the target application is successfully injected, a notification message is generated to indicate that the target plugin is successfully installed, and the notification message is returned to the client.

[0076] Understandably, when the plugin packages corresponding to each record in the resource directory are successfully injected into the target application, it means that the target application can normally load and use the plugin packages corresponding to each record in the resource directory. At this point, a notification message indicating that the target plugin has been successfully installed can be generated and returned to the client, allowing the client to notify staff and provide feedback on the plugin installation result.

[0077] This application provides a plugin installation method, apparatus, and storage medium based on Kafka messages. The method includes: when a Kafka message sent by a target application is detected, determining whether the application has started successfully based on the Kafka message; if the target application has started successfully, initiating the installation of the target plugin. The Kafka message is startup information sent by the target application to a topic subscribed to by the server during startup. Therefore, the target plugin can be installed immediately upon application startup, thereby improving plugin installation efficiency. Furthermore, compared to timed polling, when the target plugin is already installed on the target application, repeated polling checks are avoided, thus saving service resources and reducing plugin installation costs. When using timed polling, if the application restarts between two polls, the corresponding plugin may have been uninstalled, but the next poll has not yet arrived, causing the application to malfunction and fail to provide services, thus affecting plugin installation efficiency. This application, by triggering plugin installation based on Kafka messages, can install the target plugin immediately, thereby improving plugin installation efficiency.

[0078] like Figure 1 As shown, in one embodiment, the plugin installation method based on Kafka messages further includes:

[0079] Step S108: If there is a plugin package in the target application that has not been successfully injected into the resource directory, then the plugin package in the target application that has not been successfully injected into the resource directory is identified as the target package.

[0080] In this step, if any plugin package corresponding to the resource directory in the target application fails to be injected, it indicates that there is a plugin package corresponding to the resource directory that the target application cannot load and use normally. In this case, the plugin package in the target application that failed to be injected is marked as the target package.

[0081] Step S109: Load the target function package into the target application.

[0082] In this step, the names of each target package can be obtained, and commands to inject or activate these target packages can be executed based on their names to load the target packages into the target application.

[0083] Step S110: Generate a notification message to indicate that the target plugin has been successfully installed, and return the notification message to the client.

[0084] For an explanation of this step, please refer to step S107.

[0085] Understandably, checking whether the plugin installation package has been successfully injected is necessary to ensure that the target plugin is installed as soon as the application starts, thereby improving the efficiency of plugin installation.

[0086] like Figure 1 As shown, in one embodiment, the plugin installation method based on Kafka messages further includes:

[0087] Step S111: If the target application fails to start, generate an alarm message and send the alarm message to the client.

[0088] In this step, based on the deployment status, if the target application fails to start, a corresponding alarm message can be generated based on the application connection information in the Kafka message, and this alarm message can be sent to the client. This allows staff to take appropriate measures based on the alarm message.

[0089] like Figure 2 As shown, in one embodiment, determining that the target plugin is installed in the target application includes:

[0090] Step S201: Determine whether the target application contains installation information corresponding to the target plugin.

[0091] The installation information includes the installation directory of the corresponding plugin.

[0092] In this step, the presence of installation information for the target plugin in the target application can be determined by checking if an installation directory corresponding to the target plugin exists within the target application. It's understandable that upon successful launch of the target application, it's necessary to check for the existence of installation information for the target plugin within the target application; if it does exist, there's no need to copy the target plugin's installation package into the target application.

[0093] Step S202: If the target application contains installation information corresponding to the target plugin, then it is determined that the target plugin has been installed in the target application.

[0094] If the target application contains installation information corresponding to the target plugin, it means that the target application contains an installation directory corresponding to the target plugin. At this point, it can be confirmed that the target plugin is installed in the target application.

[0095] Step S203: If the target application does not have installation information corresponding to the target plugin, copy the installation package of the target plugin from the preset public server to the target application, and confirm that the target plugin has been installed in the target application.

[0096] A public server refers to one or more servers that can be shared by multiple users.

[0097] If the target application does not contain installation information corresponding to the target plugin, it means that the target application does not have an installation directory for the target plugin. In this case, the installation package corresponding to the target plugin needs to be copied from the public server to the target application. It's understood that the installation package of the target plugin copied to the target application will be in compressed form, and this package needs to be decompressed after copying. Then, confirm that the target plugin is installed in the target application.

[0098] like Figure 3 As shown, in one embodiment, determining that each plugin package corresponding to the resource directory exists in the target application includes:

[0099] Step S301: Determine whether each record in the resource directory exists in the installation directory corresponding to the target plugin.

[0100] Each record in the resource directory and installation directory represents a plugin package.

[0101] In this step, we determine whether each plugin function in the resource directory exists in the target application by checking whether each record in the resource directory exists in the installation directory corresponding to the target plugin.

[0102] Step S302: If each record in the resource directory exists in the installation directory, then it is determined that each corresponding plugin package in the resource directory exists in the target application.

[0103] If every record in the resource directory exists in the installation directory, then it can be determined that every plugin package corresponding to the resource target exists in the target application.

[0104] Step S303: If there is a record in the resource directory that does not exist in the installation directory, then the record in the resource directory that does not exist in the installation directory is determined as the target record.

[0105] If a record in the resource directory does not exist in the installation directory, it indicates that the plugin installation package corresponding to the resource directory is not present in the target application. In this case, the record in the resource directory that does not exist in the installation directory needs to be marked as the target record.

[0106] Step S304: Copy the plugin package corresponding to the target record from the preset public server to the target application, and ensure that each plugin package in the resource directory exists in the target application.

[0107] In this step, after identifying the target record in the resource directory, the plugin package corresponding to the target record is copied from the public server to the target application. At this point, it can be confirmed that each plugin package corresponding to the resource directory exists in the target application.

[0108] For example, suppose resource directory A contains records a1, a2, and a3, and installation directory B contains records a1 and a3. We determine whether each record in resource directory A exists in the installation directory B corresponding to the target plugin. In this case, there is a record (record a2) in the resource directory that does not exist in the installation directory. Therefore, record a2 is identified as the target record, and the plugin package corresponding to the target record (record a2) is copied from the shared server to the target application. At this point, it can be determined that each plugin package corresponding to resource target A exists in the target application.

[0109] In one embodiment, establishing a connection with the target application based on application connection information includes:

[0110] Obtain the IP address, port number, username, and password from the application's connection information;

[0111] Determine the target address based on the IP address and port number;

[0112] Use your username and password to log in to the target address to complete the connection with the target application.

[0113] The application connection information includes, but is not limited to, IP address, port number, username, and password.

[0114] In this embodiment, the IP address, port number, username, and password of the target application can be obtained from the application connection information. Based on the IP address and port number, the address to be connected (target address) can be determined. Then, using the username and password, the target application in the remote service can be logged in. This enables the server to establish a connection with the target application, thereby enabling the installation and detection of the target plugin.

[0115] In one embodiment, the plugin installation method based on Kafka messages further includes:

[0116] Uninstall the target plugin when the target application is closed.

[0117] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0118] The plugin installation apparatus based on Kafka messages provided in the embodiments of this application will be described below. The plugin installation apparatus based on Kafka messages described below can be referred to in correspondence with the plugin installation method based on Kafka messages described above.

[0119] like Figure 4 As shown, this application provides a plugin installation device 400 based on Kafka messages, the device comprising:

[0120] The message listening module 401 is used to obtain the deployment status and resource directory contained in the Kafka message when it listens for a Kafka message sent by the target application, and to determine the target plugin based on the Kafka message; wherein, the Kafka message is the startup information sent by the corresponding target application to the topic that has been subscribed to by the server when it starts up.

[0121] The application startup judgment module 402 is used to determine whether the target application has started successfully based on the deployment status.

[0122] The information extraction module 403 is used to extract the application connection information corresponding to the target application from the Kafka message if the target application starts successfully.

[0123] The connection establishment module 404 is used to establish a connection with the target application based on the application connection information.

[0124] The directory matching module 405 is used to match the installation directory and resource directory of the target plugin in the target application when it is determined that the target plugin is installed in the target application.

[0125] The injection detection module 406 is used to detect whether the plugin function packages corresponding to each record in the resource directory in the target application have been successfully injected when it is determined that each plugin function package in the resource directory exists in the target application.

[0126] The notification message sending module 407 is used to generate a notification message indicating that the target plugin has been successfully installed if the plugin function package corresponding to each record in the resource directory in the target application is successfully injected, and then return the notification message to the client.

[0127] In one embodiment, the directory matching module includes:

[0128] The first judgment submodule is used to determine whether there is installation information corresponding to the target plugin in the target application;

[0129] The first determining submodule is used to determine that the target plugin has been installed in the target application if the target application contains installation information corresponding to the target plugin.

[0130] The installation package copying submodule is used to copy the installation package of the target plugin from a preset public server to the target application if the installation information corresponding to the target plugin does not exist in the target application, and to confirm that the target plugin has been installed in the target application.

[0131] In one embodiment, the injection detection module includes:

[0132] The second judgment submodule is used to determine whether each record in the resource directory exists in the installation directory corresponding to the target plugin;

[0133] The second determination submodule is used to determine that if each record in the resource directory exists in the installation directory, then each corresponding plugin function package in the resource directory exists in the target application.

[0134] The target record determination submodule is used to determine the records in the resource directory that do not exist in the installation directory as target records if there are records in the resource directory that do not exist in the installation directory.

[0135] The plugin package copying submodule is used to copy the plugin package corresponding to the target record from the preset public server to the target application, and to ensure that each plugin package in the resource directory exists in the target application.

[0136] In one embodiment, the connection establishment module includes:

[0137] The information acquisition submodule is used to obtain the IP address, port number, username, and password from the application connection information;

[0138] The target address determination submodule is used to determine the target address based on the IP address and port number;

[0139] The login submodule is used to log in to the target address using an account and password to complete the connection with the target application.

[0140] In one embodiment, the plug-in installation apparatus based on Kafka messages further includes:

[0141] The function package determination module is used to determine the un-injected plugin function package corresponding to the resource directory in the target application as the target function package if there is a plugin function package in the target application that has not been successfully injected.

[0142] The package loading module is used to load target packages into the target application;

[0143] The notification information generation module is used to generate notification information indicating that the target plugin has been successfully installed and return the notification information to the client.

[0144] In one embodiment, the plug-in installation apparatus based on Kafka messages further includes:

[0145] The alarm module is used to generate alarm information and send it to the client if the target application fails to start.

[0146] In one embodiment, the plug-in installation apparatus based on Kafka messages further includes:

[0147] The uninstall module is used to uninstall the target plugin when the target application is closed.

[0148] The module division in the above-described Kafka message-based plug-in installation device is merely illustrative. In other embodiments, the Kafka message-based plug-in installation device can be divided into different modules as needed to complete all or part of its functions. Each module in the above-described Kafka message-based plug-in installation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0149] In one embodiment, this application also provides a storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the plug-in installation method based on Kafka messages as described in any of the above embodiments.

[0150] In one embodiment, this application also provides a computer device storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the plug-in installation method based on Kafka messages as described in any of the above embodiments.

[0151] Indicatively, such as Figure 5 As shown, Figure 5 This is a schematic diagram of the internal structure of a computer device 500 provided in an embodiment of this application. The computer device 500 can be provided as a server. (Refer to...) Figure 5 The computer device 500 includes a processing component 502, which further includes one or more processors, and memory resources represented by memory 501 for storing instructions, such as applications, that can be executed by the processing component 502. The applications stored in memory 501 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 502 is configured to execute instructions to perform the Kafka message-based plug-in installation method of any of the above embodiments.

[0152] The computer device 500 may also include a power supply component 503 configured to perform power management of the computer device 500, a wired or wireless network interface 504 configured to connect the computer device 500 to a network, and an input / output (I / O) interface 505. The computer device 500 may operate on an operating system stored in memory 501, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or similar.

[0153] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0154] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising a…" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. In this document, the singular forms "a," "an," and "the" may also include the plural forms unless the context clearly indicates otherwise. It should also be understood that the terms “comprising / including” or “having” specify the presence of the stated features, wholes, steps, operations, components, parts or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts or combinations thereof. Meanwhile, the term “and / or” as used in this specification includes any and all combinations of the associated listed items.

[0155] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.

[0156] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily 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 this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A plugin installation method based on Kafka messages, characterized in that, The method includes: When a Kafka message sent by the target application is detected, the deployment status and resource directory contained in the Kafka message are obtained, and the target plugin is determined based on the Kafka message; wherein, the Kafka message is the startup information sent by the corresponding target application to a topic that has been subscribed to by the server when it starts up. Based on the deployment status, determine whether the target application has started successfully; If the target application starts successfully, the application connection information corresponding to the target application is extracted from the Kafka message; Based on the application connection information, establish a connection with the target application; When it is determined that the target plugin has been installed in the target application, the installation directory of the target application corresponding to the target plugin is matched with the resource directory; When it is determined that each plugin package in the resource directory exists in the target application, check whether the plugin packages in the target application corresponding to each record in the resource directory have been successfully injected. If the plugin package corresponding to each record in the resource directory in the target application is successfully injected, a notification message indicating that the target plugin has been successfully installed is generated and the notification message is returned to the client.

2. The plugin installation method based on Kafka messages according to claim 1, characterized in that, The step of determining that the target plugin has been installed in the target application includes: Determine whether installation information corresponding to the target plugin exists in the target application; If the target application contains installation information corresponding to the target plugin, then it is determined that the target plugin has been installed in the target application. If the target application does not have installation information corresponding to the target plugin, the installation package of the target plugin is copied from a preset public server to the target application, and it is determined that the target plugin has been installed in the target application.

3. The plugin installation method based on Kafka messages according to claim 1, characterized in that, The step of determining that each plugin package corresponding to the resource directory exists in the target application includes: Determine whether each record in the resource directory exists in the installation directory corresponding to the target plugin; If each record in the resource directory exists in the installation directory, then it is determined that each corresponding plugin package in the resource directory exists in the target application. If there is a record in the resource directory that does not exist in the installation directory, then the record in the resource directory that does not exist in the installation directory is identified as the target record; Copy the plugin package corresponding to the target record from the preset public server to the target application, and confirm that each plugin package corresponding to the resource directory exists in the target application.

4. The plugin installation method based on Kafka messages according to claim 1, characterized in that, The step of establishing a connection with the target application based on the application connection information includes: Obtain the IP address, port number, username, and password from the application connection information; The target address is determined based on the IP address and the port number; Using the account and password, log in to the target address to complete the connection with the target application.

5. The plugin installation method based on Kafka messages according to any one of claims 1 to 4, characterized in that, The method further includes: If a plugin package corresponding to the resource directory in the target application fails to be injected, then the plugin package in the target application that fails to be injected corresponding to the resource directory is identified as the target package. Load the target function package into the target application; Generate a notification message indicating that the target plugin has been successfully installed, and return the notification message to the client.

6. The plugin installation method based on Kafka messages according to claim 1, characterized in that, The method further includes: If the target application fails to start, an alarm message is generated and sent to the client.

7. The plugin installation method based on Kafka messages according to claim 1, characterized in that, The method further includes: When the target application is closed, the target plugin is uninstalled.

8. A plugin installation device based on Kafka messages, characterized in that, The device includes: The message listening module is used to obtain the deployment status and resource directory contained in the Kafka message when it listens for a Kafka message sent by the target application, and to determine the target plugin based on the Kafka message; wherein, the Kafka message is the startup information sent by the corresponding target application to a topic that has been subscribed to by the server when it starts up; The application startup determination module is used to determine whether the target application has started successfully based on the deployment status. The information extraction module is used to extract the application connection information corresponding to the target application from the Kafka message if the target application starts successfully. A connection establishment module is used to establish a connection with the target application based on the application connection information. The directory matching module is used to match the installation directory of the target plugin in the target application with the resource directory when it is determined that the target plugin has been installed in the target application. The injection detection module is used to detect whether the plugin function packages corresponding to each record in the resource directory in the target application have been successfully injected when it is determined that each plugin function package in the resource directory exists in the target application. The notification information sending module is used to generate a notification information indicating that the target plugin has been successfully installed if the plugin function package corresponding to each record in the resource directory in the target application is successfully injected, and then return the notification information to the client.

9. A storage medium, characterized in that: The storage medium stores computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the plug-in installation method based on Kafka messages as described in any one of claims 1 to 7.

10. A computer device, characterized in that, include: One or more processors, and memory; The memory stores computer-readable instructions that, when executed by the one or more processors, perform the steps of the plug-in installation method based on Kafka messages as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for loading application program plugins

    CN102662703A

  • Expansion method and device for drive under OpenStack and electronic equipment

    CN109918147A