CN112685102B - Gateway plug-in hot loading method, device, equipment and medium - Google Patents

Gateway plug-in hot loading method, device, equipment and medium Download PDF

Info

Publication number
CN112685102B
CN112685102B CN202110003881.2A CN202110003881A CN112685102B CN 112685102 B CN112685102 B CN 112685102B CN 202110003881 A CN202110003881 A CN 202110003881A CN 112685102 B CN112685102 B CN 112685102B
Authority
CN
China
Prior art keywords
plug
instruction
configuration information
code
gateway
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110003881.2A
Other languages
Chinese (zh)
Other versions
CN112685102A (en
Inventor
段凤
吴家证
朱宇峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Nuonuo Network Technology Co ltd
Original Assignee
Zhejiang Nuonuo Network Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Nuonuo Network Technology Co ltd filed Critical Zhejiang Nuonuo Network Technology Co ltd
Priority to CN202110003881.2A priority Critical patent/CN112685102B/en
Publication of CN112685102A publication Critical patent/CN112685102A/en
Application granted granted Critical
Publication of CN112685102B publication Critical patent/CN112685102B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The application discloses a gateway plug-in hot loading method, device, equipment and medium. The method comprises the following steps: uploading a plug-in jar package to a file service, and acquiring an MD5 code which is fed back by the file service and corresponds to the plug-in jar package; analyzing the plug-in jar package, and determining plug-in configuration information from an analysis result of the plug-in jar package; and sending a corresponding operation instruction to a gateway system according to the plug-in configuration information and the MD5 code, so that the gateway system can use the plug-in configuration information, the MD5 code and the plug-in jar package to instantiate a corresponding plug-in object according to the operation instruction after receiving the operation instruction, and the operation instruction is completed. Therefore, after receiving the instruction, the gateway system reads the jar packet in the file service and instantiates the plug-in object by combining the plug-in configuration information to complete the operation corresponding to the instruction, the gateway system does not need to be restarted in the whole operation process, and the operation efficiency of the gateway system and the expandability of the gateway plug-in are improved.

Description

Gateway plug-in hot loading method, device, equipment and medium
Technical Field
The invention relates to the field of plug-in application, in particular to a gateway plug-in hot loading method, device, equipment and medium.
Background
At present, the application scenarios of the plug-ins are very wide, and the application of the plug-ins greatly facilitates the use of services, for example, the filtering rules can be adjusted conveniently through the API gateway plug-ins, but the installation and update processes of the plug-ins can affect the operation of the services, and the system operation efficiency is reduced. The plug-in design of the existing API gateway plug-in is not flexible enough, the interface request of each service line needs to be configured according to the plug-in rule preset by the gateway, the expansion of the plug-in is difficult to realize, if the filtering rule of each service line interface is met, the design of the plug-in is too bloated, and the understanding difficulty and the use difficulty of developers on the plug-in rule are increased. In addition, in the prior art, for the deployment of a new plug-in, it is often necessary to implement a processing procedure of the new plug-in a gateway project and then reissue the new plug-in, that is, restart the service, but the procedure of restarting the service may cause response timeout of other service requests, which affects the operation of other services.
Disclosure of Invention
In view of this, an object of the present invention is to provide a method, an apparatus, a device and a medium for hot loading of a gateway plug-in, which can implement new plug-in deployment and plug-in update without restarting a gateway system. The specific scheme is as follows:
in a first aspect, the present application discloses a gateway plug-in hot loading method, applied to a management platform, including:
uploading a plug-in jar package to a file service, and acquiring an MD5 code which is fed back by the file service and corresponds to the plug-in jar package;
analyzing the plug-in jar package, and determining plug-in configuration information from an analysis result of the plug-in jar package;
and sending a corresponding operation instruction to a gateway system according to the plug-in configuration information and the MD5 code, so that the gateway system can use the plug-in configuration information, the MD5 code and the plug-in jar package to instantiate a corresponding plug-in object according to the operation instruction after receiving the operation instruction, and the operation instruction is completed.
Optionally, the analyzing the plug-in jar package, and screening out plug-in configuration information from the analyzed plug-in jar package, includes:
analyzing the plug-in jar packet, and screening out class path information and target parameter information from the analyzed plug-in jar packet to obtain the plug-in configuration information.
Optionally, the sending a corresponding operation instruction to a gateway system according to the plug-in configuration information and the MD5 code includes:
querying a database, and judging whether the MD5 code exists in the database;
if the MD5 code does not exist in the database, checking whether the database has the class path information in the configuration information, and storing the plug-in configuration information and the MD5 code in the database;
if the initialization instruction and the corresponding plug-in ID do not exist, sending an initialization instruction and the corresponding plug-in ID to kafka so that the gateway system can receive the initialization instruction and the plug-in ID pushed by the kafka;
and if so, sending an update instruction and a corresponding plug-in ID to kafka so that the gateway system receives the update instruction and the plug-in ID pushed by the kafka.
Optionally, after receiving the operation instruction, the gateway system instantiates a corresponding plug-in object according to the operation instruction by using the plug-in configuration information, the MD5 code, and the plug-in jar package, so as to complete the operation instruction, where the method includes:
if the operation instruction is an initialization instruction, reading a corresponding MD5 code and plug-in configuration information from the database according to the plug-in ID;
determining a corresponding plug-in jar package from the file service according to the MD5 code;
and performing instantiation operation and parameter configuration based on the plug-in jar packet and the plug-in configuration information, instantiating a corresponding plug-in object, and putting the plug-in object into a plug-in set.
Optionally, after receiving the operation instruction, the gateway system instantiates a corresponding plug-in object according to the operation instruction by using the plug-in configuration information, the MD5 code, and the plug-in jar package, so as to complete the operation instruction, where the method includes:
if the operation instruction is an updating instruction, removing a corresponding plug-in object in a plug-in set according to the plug-in ID;
reading a corresponding MD5 code and plug-in configuration information from the database according to the plug-in ID;
determining a corresponding plug-in jar package from the file service according to the MD5 code;
and performing instantiation operation and parameter configuration on the basis of the plug-in jar packet and the plug-in configuration information, instantiating a corresponding plug-in object, and putting the plug-in object into the plug-in set.
Optionally, the gateway plug-in hot loading method further includes:
and acquiring a removal instruction of a target plug-in through a preset communication interface, and sending the removal instruction and the corresponding plug-in ID to the gateway system, so that the gateway system can remove the corresponding plug-in object in the plug-in set according to the removal instruction and the plug-in ID.
In a second aspect, the present application discloses a gateway plug-in hot loading apparatus, including:
the uploading module is used for uploading the plug-in jar package to file service and acquiring the MD5 code which is fed back by the file service and corresponds to the plug-in jar package;
the analysis module is used for analyzing the plug-in jar package and determining plug-in configuration information from the analysis result of the plug-in jar package;
and the instruction sending module is used for sending a corresponding operation instruction to a gateway system according to the plug-in configuration information and the MD5 code, so that the gateway system can use the plug-in configuration information, the MD5 code and the plug-in jar package to instantiate a corresponding plug-in object according to the operation instruction after receiving the operation instruction, and the operation instruction is completed.
Optionally, the gateway plug-in hot loading apparatus further includes:
and the removing instruction sending module is used for acquiring a removing instruction of a target plug-in unit through a preset communication interface and sending the removing instruction and the corresponding plug-in unit ID to the gateway system so that the gateway system can remove the corresponding plug-in unit object in the plug-in unit set according to the removing instruction and the corresponding plug-in unit ID.
In a third aspect, the present application discloses an electronic device, comprising:
a memory for storing a computer program;
and the processor is used for executing the computer program to realize the gateway plug-in hot loading method.
In a fourth aspect, the present application discloses a computer readable storage medium for storing a computer program; wherein the computer program when executed by the processor implements the gateway plug-in hot-loading method described above.
In the application, a management platform uploads a plug-in jar package to a file service and obtains an MD5 code which is fed back by the file service and corresponds to the plug-in jar package; analyzing the plug-in jar package, and determining plug-in configuration information from an analysis result of the plug-in jar package; and sending a corresponding operation instruction to a gateway system according to the plug-in configuration information and the MD5 code, so that the gateway system can use the plug-in configuration information, the MD5 code and the plug-in jar package to instantiate a corresponding plug-in object according to the operation instruction after receiving the operation instruction, and the operation instruction is completed. Therefore, after the management platform uploads the plug-in jar package and sends a corresponding operation instruction to the gateway system according to the plug-in configuration information and the MD5 code corresponding to the plug-in jar package, the gateway system reads the jar package in the file service and instantiates a plug-in object by combining the plug-in configuration information to complete the operation corresponding to the instruction, the gateway system does not need to be restarted in the whole operation process, and the operation efficiency of the gateway system and the expandability of the gateway plug-in are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a gateway plug-in hot loading method provided in the present application;
fig. 2 is a flowchart of a specific gateway plug-in hot loading method provided in the present application;
fig. 3 is a flowchart illustrating an operation executed by a gateway system according to the present application;
fig. 4 is a flowchart of a specific gateway plug-in hot loading method provided in the present application;
fig. 5 is a schematic structural diagram of a gateway plug-in hot loading apparatus provided in the present application;
fig. 6 is a block diagram of an electronic device provided in the present application.
Detailed Description
In the prior art, for the deployment of a new plug-in, it is often necessary to implement a processing procedure of the new plug-in a gateway project and then reissue the new plug-in, that is, restart a service, but the procedure of restarting the service may cause response timeout of other service requests, which affects the operation of other services. In order to overcome the technical problems, the application provides a gateway plug-in hot loading method based on MD5 code identification, which can implement new plug-in deployment and plug-in update without restarting a gateway system.
The embodiment of the application discloses a gateway plug-in hot loading method, which is applied to a management platform and can comprise the following steps as shown in figure 1:
step S11: uploading the plug-in jar package to a file service, and acquiring the MD5 code fed back by the file service and corresponding to the plug-in jar package.
In this embodiment, after obtaining the plug-in jar package sent by the user, the management platform uploads the plug-in jar package to a designated directory of a file service, and obtains the MD5 code corresponding to the plug-in jar package and determined by the file service by using an information digest algorithm.
Step S12: and analyzing the plug-in jar package, and determining plug-in configuration information from the analysis result of the plug-in jar package.
In this embodiment, after obtaining the plug-in jar package sent by the user, the management platform analyzes the plug-in jar package, and determines plug-in configuration information from an analysis result of the plug-in jar package, where the plug-in configuration information includes, but is not limited to, class path information and target parameter information.
Step S13: and sending a corresponding operation instruction to a gateway system according to the plug-in configuration information and the MD5 code, so that the gateway system can use the plug-in configuration information, the MD5 code and the plug-in jar package to instantiate a corresponding plug-in object according to the operation instruction after receiving the operation instruction, and the operation instruction is completed.
In this embodiment, after the MD5 code and the plug-in configuration information of the plug-in jar package are obtained, an operation instruction corresponding to the plug-in jar package is determined according to the MD5 code and the plug-in configuration information, that is, it is determined whether the plug-in corresponding to the plug-in jar package is to be updated or deployed as a new plug-in, where the operation instruction includes an initialization instruction and an update instruction, and after the operation instruction is determined, the operation instruction is sent to the gateway system, so that the gateway system instantiates a corresponding plug-in object based on the corresponding plug-in configuration information, the MD5 code, and the plug-in jar package according to the operation instruction after receiving the operation instruction, so as to complete the operation instruction. Specifically, the corresponding plug-in jar package may be determined from the file service through the MD5 code, and a corresponding plug-in object may be instantiated by using the plug-in configuration information corresponding to the plug-in jar package, so as to complete the operation instruction.
In this embodiment, the gateway plug-in hot loading method may further include: and acquiring a removal instruction of a target plug-in through a preset communication interface, and sending the removal instruction and the corresponding plug-in ID to the gateway system, so that the gateway system can remove the corresponding plug-in object in the plug-in set according to the removal instruction and the plug-in ID. It can be understood that, for the plug-in needing to be deleted, the user can send a removal instruction to the management background through the preset communication interface, and after the management background acquires the removal instruction of the target plug-in through the preset communication interface, the removal instruction and the corresponding plug-in ID are sent to the gateway system, so that the gateway system can remove the corresponding plug-in object in the plug-in set according to the removal instruction and the plug-in ID. It will be appreciated that the gateway internally uses a set to manage all plug-in objects, and that each plug-in has a corresponding unique plug-in ID.
As can be seen from the above, in this embodiment, the management platform uploads a plug-in jar package to a file service, and obtains an MD5 code corresponding to the plug-in jar package and fed back by the file service; analyzing the plug-in jar package, and determining plug-in configuration information from an analysis result of the plug-in jar package; and sending a corresponding operation instruction to a gateway system according to the plug-in configuration information and the MD5 code, so that the gateway system can use the plug-in configuration information, the MD5 code and the plug-in jar package to instantiate a corresponding plug-in object according to the operation instruction after receiving the operation instruction, and the operation instruction is completed. Therefore, after the management platform uploads the plug-in jar package and sends a corresponding operation instruction to the gateway system according to the plug-in configuration information and the MD5 code corresponding to the plug-in jar package, the gateway system reads the jar package in the file service and instantiates a plug-in object by combining the plug-in configuration information to complete the operation corresponding to the instruction, the gateway system does not need to be restarted in the whole operation process, and the operation efficiency of the gateway system and the expandability of the gateway plug-in are improved.
The embodiment of the application discloses a specific gateway plug-in hot loading method, which is applied to a management platform, and as shown in fig. 2, the method can include the following steps:
step S21: uploading the plug-in jar package to a file service, and acquiring the MD5 code fed back by the file service and corresponding to the plug-in jar package.
Step S22: analyzing the plug-in jar packet, and screening out class path information and target parameter information from the analyzed plug-in jar packet to obtain the plug-in configuration information.
In this embodiment, after the plug-in jar package is analyzed, class path information and target parameter information are screened out from the analyzed jar package to obtain plug-in configuration information; it is understood that the above class path information is a rule for instantiation of plug-ins, and a plug-in has only one class path; the target parameter information includes configuration parameters of the corresponding plug-in.
Step S23: and querying a database, and judging whether the MD5 code exists in the database.
In this embodiment, after the MD5 code and the plug-in configuration information are obtained, whether the MD5 code exists in a preset database is queried; it is understood that a file corresponds to a unique MD5 code, and if the MD5 code exists in the database, it indicates that the corresponding plug-in jar package is not updated, and the plug-in jar package is uploaded, so that the corresponding plug-in does not need to be updated.
Step S24: if the MD5 code does not exist in the database, checking whether the database has the class path information in the configuration information, and storing the plug-in configuration information and the MD5 code in the database.
In this embodiment, if the MD5 code does not exist in the database, it is checked whether the class path information in the configuration information exists in the database, and the plug-in configuration information and the MD5 code are stored in the database. It will be appreciated that the above database is used to store plug-in configuration information and MD5 code for subsequent reading by the gateway system.
Step S25: if the initialization command does not exist, an initialization command and a corresponding plug-in ID are sent to kafka, so that the gateway system receives the initialization command and the plug-in ID pushed by the kafka.
In this embodiment, if the class path information in the configuration information does not exist in the database, it may be indicated that the plug-in jar packet of the corresponding plug-in is not uploaded, that is, the gateway system does not exist a plug-in corresponding to the plug-in jar packet, so that it may be determined that this operation is to deploy a new plug-in into the gateway system, and then send the initialization instruction and the corresponding plug-in ID to the kafka platform, and then push the initialization instruction and the corresponding plug-in ID to the gateway system by the kafka platform.
Step S26: after receiving the initialization instruction, the gateway system reads a corresponding MD5 code and plug-in configuration information from the database according to the plug-in ID; and determining a corresponding plug-in jar package from the file service according to the MD5 code.
In this embodiment, for example, as shown in fig. 3, after receiving the initialization instruction and the plug-in ID, the gateway system determines, according to the plug-in ID, a corresponding MD5 code and plug-in configuration information from the database, and then determines, according to the determined MD5 code, a corresponding plug-in jar package from the file service, so that the plug-in jar package of the target deployment plug-in may be obtained.
Step S27: and performing instantiation operation and parameter configuration on the basis of the plug-in jar packet and the plug-in configuration information, instantiating a corresponding plug-in object, and putting the plug-in object into a plug-in set.
In this embodiment, after the plug-in jar package and the plug-in configuration information are obtained, a plug-in instantiation operation is performed based on class path information in the plug-in jar package and the plug-in configuration information to generate an instantiation object, then a parameter configuration initialization process is performed on the instantiation object according to target parameter information in the plug-in configuration information, and the finally obtained plug-in object is placed in a plug-in set.
For the specific process of the step S21, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
As can be seen from the above, in this embodiment, by analyzing the plug-in jar package, class path information and target parameter information are screened from the analyzed plug-in jar package to obtain plug-in configuration information; and then querying the database, judging whether the MD5 codes exist in the database, if not, checking whether the class path information in the configuration information exists in the database, and storing the plug-in configuration information and the MD5 codes in the database. If the plug-in object does not exist, sending an initialization instruction and a corresponding plug-in ID to the gateway system through kafka, so that the gateway system reads a corresponding MD5 code and plug-in configuration information from the database according to the plug-in ID after receiving the initialization instruction, then determines a corresponding plug-in jar package from the file service by using an MD5 code, finally performs instantiation operation and parameter configuration based on the plug-in jar package and the plug-in configuration information, instantiates a corresponding plug-in object, and puts the plug-in object into a plug-in assembly. Therefore, an administrator can automatically deploy the new plug-in of the gateway system only by sending the plug-in jar packet to the management platform, the convenience of deploying the gateway plug-in is improved, the plug-in rule suitable for the business is designed for each business line, the maintenance work of the gateway system on the specific plug-in is reduced, the gateway system does not need to stop service in the updating process, and the business service capacity of the gateway system is improved.
The embodiment of the application discloses a specific gateway plug-in hot loading method, which is applied to a management platform, and as shown in fig. 4, the method may include the following steps:
step S31: uploading the plug-in jar package to a file service, and acquiring the MD5 code fed back by the file service and corresponding to the plug-in jar package.
Step S32: analyzing the plug-in jar packet, and screening out class path information and target parameter information from the analyzed plug-in jar packet to obtain the plug-in configuration information.
Step S33: and querying a database, and judging whether the MD5 code exists in the database.
Step S34: if the MD5 code does not exist in the database, checking whether the database has the class path information in the configuration information, and storing the plug-in configuration information and the MD5 code in the database.
Step S35: and if so, sending an update instruction and a corresponding plug-in ID to kafka so that the gateway system receives the update instruction and the plug-in ID pushed by the kafka.
In this embodiment, if the class path information in the configuration information exists in the database, it may be indicated that the plug-in jar package of the corresponding plug-in has been uploaded, that is, the plug-in corresponding to the plug-in jar package exists in the gateway system, and since the MD5 code of the plug-in jar package uploaded this time is the new MD5 code, it may be determined that the operation is to update the existing plug-in the gateway system, and then the update instruction and the corresponding plug-in ID are sent to the kafka platform, and then pushed to the gateway system by the kafka platform, it may be understood that one plug-in corresponds to one unique plug-in ID, so as to synchronously manage the database and the corresponding plug-in information in the gateway system.
Step S36: and after receiving the updating instruction, the gateway system removes the corresponding plug-in object in the plug-in set according to the plug-in ID.
In this embodiment, for example, as shown in fig. 3, after receiving the update instruction and the plug-in ID, the gateway system removes the corresponding plug-in object in the plug-in set according to the plug-in ID.
Step S37: reading a corresponding MD5 code and plug-in configuration information from the database according to the plug-in ID; and determining a corresponding plug-in jar package from the file service according to the MD5 code.
In this embodiment, for example, as shown in fig. 3, after removing a corresponding plug-in object in a plug-in set, a corresponding MD5 code and plug-in configuration information are determined from the database according to the plug-in ID, and then a corresponding plug-in jar package is determined from the specified directory of the file service according to the determined MD5 code, so that the plug-in jar package of the target update plug-in can be obtained.
Step S38: and performing instantiation operation and parameter configuration on the basis of the plug-in jar packet and the plug-in configuration information, instantiating a corresponding plug-in object, and putting the plug-in object into the plug-in set.
In this embodiment, after the plug-in jar package and the plug-in configuration information are obtained, a plug-in instantiation operation is performed based on class path information in the plug-in jar package and the plug-in configuration information to generate an instantiation object, then a parameter configuration initialization process is performed on the instantiation object according to target parameter information in the plug-in configuration information, and the finally obtained plug-in object is placed in a plug-in set.
For the specific processes from step S31 to step S34, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
As can be seen from the above, in this embodiment, after receiving the update instruction, the gateway system removes the corresponding plug-in object in the plug-in set according to the plug-in ID, reads the corresponding MD5 code and the plug-in configuration information from the database according to the plug-in ID, determines the corresponding plug-in jar package from the file service by using the MD5 code, performs instantiation operation and parameter configuration based on the plug-in jar package and the plug-in configuration information, instantiates the corresponding plug-in object, and places the plug-in object in the plug-in set. Therefore, an administrator can automatically update the gateway system plug-in only by sending the plug-in jar packet to the management platform, the convenience of updating the gateway plug-in is improved, and the gateway system does not need to stop service in the updating process, so that the service capability of the gateway system is improved.
Correspondingly, the embodiment of the present application further discloses a gateway plug-in hot loading device, as shown in fig. 5, the device includes:
the uploading module 11 is used for uploading a plug-in jar package to a file service and acquiring an MD5 code which is fed back by the file service and corresponds to the plug-in jar package;
the analysis module 12 is used for analyzing the plug-in jar package and determining plug-in configuration information from an analysis result of the plug-in jar package;
the instruction sending module 13 is configured to send a corresponding operation instruction to a gateway system according to the plug-in configuration information and the MD5 code, so that the gateway system instantiates a corresponding plug-in object according to the operation instruction by using the plug-in configuration information, the MD5 code, and the plug-in jar package after receiving the operation instruction, so as to complete the operation instruction.
As can be seen from the above, in this embodiment, the management platform uploads a plug-in jar package to a file service, and obtains an MD5 code corresponding to the plug-in jar package and fed back by the file service; analyzing the plug-in jar package, and determining plug-in configuration information from the analysis result of the plug-in jar package; and sending a corresponding operation instruction to a gateway system according to the plug-in configuration information and the MD5 code, so that the gateway system can use the plug-in configuration information, the MD5 code and the plug-in jar package to instantiate a corresponding plug-in object according to the operation instruction after receiving the operation instruction, and the operation instruction is completed. Therefore, after the management platform uploads the plug-in jar package and sends a corresponding operation instruction to the gateway system according to the plug-in configuration information and the MD5 code corresponding to the plug-in jar package, the gateway system reads the jar package in the file service and instantiates a plug-in object by combining the plug-in configuration information to complete the operation corresponding to the instruction, the gateway system does not need to be restarted in the whole operation process, and the operation efficiency of the gateway system and the expandability of the gateway plug-in are improved.
In some specific embodiments, the parsing module 12 may specifically include:
and the plug-in configuration information determining unit is used for analyzing the plug-in jar packet, and screening out class path information and target parameter information from the analyzed plug-in jar packet to acquire the plug-in configuration information.
In some specific embodiments, the instruction sending module 13 may specifically include:
an MD5 code query unit, configured to query a database, and determine whether the MD5 code exists in the database;
a class path information query unit, configured to check whether class path information in the configuration information exists in the database if the MD5 code does not exist in the database, and store the plug-in configuration information and the MD5 code in the database;
an initialization instruction sending unit, configured to send an initialization instruction and a corresponding plug-in ID to kafka if a query result of the class path information querying unit is present, so that the gateway system receives the initialization instruction and the plug-in ID pushed by the kafka;
and the updating instruction sending unit is used for sending an updating instruction and a corresponding plug-in ID to kafka if the query result of the class path information query unit is not existed, so that the gateway system can receive the updating instruction and the plug-in ID pushed by the kafka.
In some specific embodiments, the gateway plug-in hot loading apparatus may specifically include:
and the removing instruction sending module is used for acquiring a removing instruction of the target plug-in through a preset communication interface and sending the removing instruction and the corresponding plug-in ID to the gateway system so that the gateway system can remove the corresponding plug-in object in the plug-in set according to the removing instruction and the plug-in ID.
Further, the embodiment of the present application also discloses an electronic device, which is shown in fig. 6, and the content in the drawing cannot be considered as any limitation to the application scope.
Fig. 6 is a schematic structural diagram of an electronic device 20 according to an embodiment of the present disclosure. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input output interface 25, and a communication bus 26. Wherein, the memory 22 is used for storing a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the gateway plug-in hot loading method disclosed in any of the foregoing embodiments.
In this embodiment, the power supply 23 is configured to provide a working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and a communication protocol followed by the communication interface is any communication protocol applicable to the technical solution of the present application, and is not specifically limited herein; the input/output interface 25 is configured to obtain external input data or output data to the outside, and a specific interface type thereof may be selected according to specific application requirements, which is not specifically limited herein.
In addition, the storage 22 is used as a carrier for storing resources, and may be a read-only memory, a random access memory, a magnetic disk, an optical disk, or the like, where the stored resources include an operating system 221, a computer program 222, data 223 including a plug-in jar package, and the like, and the storage mode may be a transient storage mode or a permanent storage mode.
The operating system 221 is used for managing and controlling each hardware device and the computer program 222 on the electronic device 20, so as to realize the operation and processing of the mass data 223 in the memory 22 by the processor 21, and may be Windows Server, Netware, Unix, Linux, and the like. The computer program 222 may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the gateway plug-in hot-loading method performed by the electronic device 20 disclosed in any of the foregoing embodiments. The data 223 may include plug-in jar packages captured by the electronic device 20.
Further, an embodiment of the present application further discloses a computer storage medium, where computer-executable instructions are stored in the computer storage medium, and when the computer-executable instructions are loaded and executed by a processor, the steps of the gateway plug-in hot loading method disclosed in any of the foregoing embodiments are implemented.
In the present specification, the embodiments are described in a progressive manner, and each embodiment focuses on differences from other embodiments, and the same or similar parts between the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
The gateway plug-in hot loading method, device, equipment and medium provided by the invention are described in detail, a specific example is applied in the text to explain the principle and the implementation of the invention, and the description of the above embodiment is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (8)

1. A gateway plug-in hot loading method is applied to a management platform and comprises the following steps:
uploading a plug-in jar package to a file service, and acquiring an MD5 code which is fed back by the file service and corresponds to the plug-in jar package;
analyzing the plug-in jar package, and determining plug-in configuration information from an analysis result of the plug-in jar package;
sending a corresponding operation instruction to a gateway system according to the plug-in configuration information and the MD5 code, so that the gateway system can use the plug-in configuration information, the MD5 code and the plug-in jar package to instantiate a corresponding plug-in object according to the operation instruction after receiving the operation instruction, and the operation instruction is completed;
analyzing the plug-in jar package and determining plug-in configuration information from an analysis result of the plug-in jar package, wherein the analyzing the plug-in jar package comprises the following steps:
analyzing the plug-in jar packet, and screening out class path information and target parameter information from the analyzed plug-in jar packet to obtain the plug-in configuration information;
wherein, the sending a corresponding operation instruction to a gateway system according to the plug-in configuration information and the MD5 code includes:
querying a database, and judging whether the MD5 code exists in the database;
if the MD5 code does not exist in the database, checking whether the database has the class path information in the configuration information, and storing the plug-in configuration information and the MD5 code in the database;
if the initialization instruction and the corresponding plug-in ID do not exist, sending an initialization instruction and the corresponding plug-in ID to kafka so that the gateway system can receive the initialization instruction and the plug-in ID pushed by the kafka;
and if so, sending an update instruction and a corresponding plug-in ID to kafka so that the gateway system receives the update instruction and the plug-in ID pushed by the kafka.
2. The gateway plug-in hot loading method according to claim 1, wherein after receiving the operation instruction, the gateway system instantiates a corresponding plug-in object according to the operation instruction by using the plug-in configuration information, the MD5 code, and the plug-in jar package to complete the operation instruction, including:
if the operation instruction is an initialization instruction, reading a corresponding MD5 code and plug-in configuration information from the database according to the plug-in ID;
determining a corresponding plug-in jar package from the file service according to the MD5 code;
and performing instantiation operation and parameter configuration based on the plug-in jar packet and the plug-in configuration information, instantiating a corresponding plug-in object, and putting the plug-in object into a plug-in set.
3. The gateway plug-in hot loading method according to claim 2, wherein after receiving the operation instruction, the gateway system instantiates a corresponding plug-in object according to the operation instruction by using the plug-in configuration information, the MD5 code, and the plug-in jar package to complete the operation instruction, and the method comprises:
if the operation instruction is an updating instruction, removing a corresponding plug-in object in a plug-in set according to the plug-in ID;
reading a corresponding MD5 code and plug-in configuration information from the database according to the plug-in ID;
determining a corresponding plug-in jar package from the file service according to the MD5 code;
and performing instantiation operation and parameter configuration based on the plug-in jar packet and the plug-in configuration information, instantiating a corresponding plug-in object, and putting the plug-in object into the plug-in set.
4. The gateway plug-in hot-loading method according to any one of claims 1 to 3, further comprising:
and acquiring a removal instruction of a target plug-in through a preset communication interface, and sending the removal instruction and the corresponding plug-in ID to the gateway system, so that the gateway system can remove the corresponding plug-in object in the plug-in set according to the removal instruction and the plug-in ID.
5. A gateway plug-in hot loading device is characterized in that the gateway plug-in hot loading device is applied to a management platform and comprises:
the uploading module is used for uploading the plug-in jar package to file service and acquiring the MD5 code which is fed back by the file service and corresponds to the plug-in jar package;
the analysis module is used for analyzing the plug-in jar package and determining plug-in configuration information from the analysis result of the plug-in jar package;
the instruction sending module is used for sending a corresponding operation instruction to a gateway system according to the plug-in configuration information and the MD5 code, so that the gateway system can use the plug-in configuration information, the MD5 code and the plug-in jar package to instantiate a corresponding plug-in object according to the operation instruction after receiving the operation instruction, and the operation instruction is completed;
the analysis module is further used for analyzing the plug-in jar packet and screening class path information and target parameter information from the analyzed plug-in jar packet to obtain the plug-in configuration information;
the instruction sending module is further configured to query a database, and determine whether the MD5 code exists in the database; if the MD5 code does not exist in the database, checking whether the database has the class path information in the configuration information, and storing the plug-in configuration information and the MD5 code in the database; if the initialization instruction and the corresponding plug-in ID do not exist, sending an initialization instruction and the corresponding plug-in ID to kafka so that the gateway system can receive the initialization instruction and the plug-in ID pushed by the kafka; and if so, sending an update instruction and a corresponding plug-in ID to kafka so that the gateway system receives the update instruction and the plug-in ID pushed by the kafka.
6. The gateway plug-in thermal loading device of claim 5, further comprising:
and the removing instruction sending module is used for acquiring a removing instruction of the target plug-in through a preset communication interface and sending the removing instruction and the corresponding plug-in ID to the gateway system so that the gateway system can remove the corresponding plug-in object in the plug-in set according to the removing instruction and the plug-in ID.
7. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the gateway plug-in hot-loading method of any one of claims 1 to 4.
8. A computer-readable storage medium for storing a computer program; wherein the computer program when executed by the processor implements the gateway plug-in hot-loading method of any one of claims 1 to 4.
CN202110003881.2A 2021-01-04 2021-01-04 Gateway plug-in hot loading method, device, equipment and medium Active CN112685102B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110003881.2A CN112685102B (en) 2021-01-04 2021-01-04 Gateway plug-in hot loading method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110003881.2A CN112685102B (en) 2021-01-04 2021-01-04 Gateway plug-in hot loading method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN112685102A CN112685102A (en) 2021-04-20
CN112685102B true CN112685102B (en) 2022-06-03

Family

ID=75457109

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110003881.2A Active CN112685102B (en) 2021-01-04 2021-01-04 Gateway plug-in hot loading method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN112685102B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113595788A (en) * 2021-07-28 2021-11-02 上海华兴数字科技有限公司 API gateway management method and device based on plug-in

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101895851A (en) * 2010-06-30 2010-11-24 卓望数码技术(深圳)有限公司 Plug-in wireless value-added service platform and management method thereof
CN108512747A (en) * 2017-02-23 2018-09-07 中兴通讯股份有限公司 The plug-in management method and home gateway of home gateway, communication system
CN109597623A (en) * 2018-12-05 2019-04-09 上海中商网络股份有限公司 A kind of plug-in management method, device, equipment and storage medium
WO2019143412A1 (en) * 2018-01-19 2019-07-25 Umajin Inc. Configurable server kit
CN110297671A (en) * 2019-05-22 2019-10-01 深圳壹账通智能科技有限公司 Client plug-in implementation method, device, computer equipment and storage medium
CN110311935A (en) * 2018-03-27 2019-10-08 阿里健康信息技术有限公司 A kind of sharing method shares deployment system and client
CN112068862A (en) * 2020-08-27 2020-12-11 新华智云科技有限公司 Dynamic updating method and system for Elasticissearch plug-in

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101895851A (en) * 2010-06-30 2010-11-24 卓望数码技术(深圳)有限公司 Plug-in wireless value-added service platform and management method thereof
CN108512747A (en) * 2017-02-23 2018-09-07 中兴通讯股份有限公司 The plug-in management method and home gateway of home gateway, communication system
WO2019143412A1 (en) * 2018-01-19 2019-07-25 Umajin Inc. Configurable server kit
CN110311935A (en) * 2018-03-27 2019-10-08 阿里健康信息技术有限公司 A kind of sharing method shares deployment system and client
CN109597623A (en) * 2018-12-05 2019-04-09 上海中商网络股份有限公司 A kind of plug-in management method, device, equipment and storage medium
CN110297671A (en) * 2019-05-22 2019-10-01 深圳壹账通智能科技有限公司 Client plug-in implementation method, device, computer equipment and storage medium
CN112068862A (en) * 2020-08-27 2020-12-11 新华智云科技有限公司 Dynamic updating method and system for Elasticissearch plug-in

Also Published As

Publication number Publication date
CN112685102A (en) 2021-04-20

Similar Documents

Publication Publication Date Title
CN106302632B (en) Downloading method of basic mirror image and management node
CN110187912B (en) Node selection method and device
CN110557433B (en) Resource management method, platform, cloud gateway, system and storage medium
CN112860282B (en) Cluster plug-in upgrading method, device and server
CN111198709A (en) RPM software package management method, system, device and readable storage medium
CN112799688A (en) Method and device for installing software package in container application, computer equipment and medium
CN113835911A (en) Intranet penetration agent method, system, host and computer readable storage medium
CN112685102B (en) Gateway plug-in hot loading method, device, equipment and medium
CN111683114A (en) Method and device for upgrading equipment program, terminal equipment and storage medium
CN111176706A (en) Terminal upgrading method and device, electronic equipment and storage medium
CN114546588A (en) Task deployment method and device, storage medium and electronic device
CN115129574A (en) Code testing method and device
CN104104701A (en) Online service configuration updating method and system
CN115357198B (en) Mounting method and device of storage volume, storage medium and electronic equipment
CN111580948A (en) Task scheduling method and device and computer equipment
CN115543429A (en) Project environment building method, electronic equipment and computer readable storage medium
CN115729590A (en) Service deployment method, device, equipment and computer readable storage medium
CN115390944A (en) Algorithm service calling method and device, electronic equipment and storage medium
CN115421764A (en) Method, device, equipment and storage medium for identifying module to be upgraded
CN113986423A (en) Bullet frame display method and system, storage medium and terminal equipment
CN114610446A (en) Method, device and system for automatically injecting probe
CN110336693B (en) Method, device, equipment and storage medium for managing network block equipment
CN113918423A (en) Cloud platform monitoring method and device and application thereof
CN110943968B (en) Equipment access control method and equipment access assembly
KR100456978B1 (en) Method for File Downloading in Agent

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant