Plug-in updating method, device, electronic device, system and storage medium
By designing the plug-in as a structure of shell module and core module, automatic update of the plug-in is realized, solving the problems of low update efficiency and high maintenance cost in the existing technology, improving the update efficiency and reducing maintenance costs.
Patent Information
- Application Number
- CN202110226815.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-01
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2041-03-01
AI Technical Summary
The existing technology lacks intelligence when the plug-in is updated, and the update efficiency is low. When the plug-in is deployed on a large scale, the maintenance cost is high and the update process is cumbersome.
By designing the plug-in as a structure of the shell module and the core module, use the shell module to check whether the core module needs to be updated, and automatically download and update the core module when needed to keep the shell module unchanged.
Automatic update of plug-ins is realized, avoiding manual operation by users, improving update efficiency, and reducing maintenance costs.
Smart Images

Figure CN115080077B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to computer technology, and in particular to a plug-in updating method, device, electronic equipment, system and storage medium. Background Art
[0002] Applications need to reference plug-ins to implement some functions. For example, Android applications need to reference Gradle plug-ins to add dependencies, analyze dependencies, resolve dependency conflicts, etc. When Android applications reference Gradle plug-ins, they need to manually add plug-in version information in the application directory.
[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems with current application reference plug-ins: 1. When the referenced plug-in needs to be updated, the user needs to be notified to manually modify the plug-in version information added to the application directory, which is not intelligent enough and has low update efficiency; 2. When the plug-in is exported on a large scale for private deployment, different teams have inconsistent requirements for the plug-in, and frequent communication with different teams is required when the plug-in is updated, resulting in high maintenance costs; 3. When the plug-in is exported for private deployment, the plug-in code needs to be modified according to user needs and the plug-in needs to be packaged and regenerated, which makes deployment cumbersome. Summary of the invention
[0004] The embodiments of the present invention provide a plug-in updating method, device, electronic device, system and storage medium, which can improve the plug-in updating efficiency.
[0005] In a first aspect, an embodiment of the present invention provides a plug-in updating method, the method comprising:
[0006] Determine whether the current core module of the target plug-in needs to be updated by using the shell module of the target plug-in referenced by the application program;
[0007] When it is determined that the current core module needs to be updated, downloading the target core module of the target plug-in;
[0008] The current core module is updated to the target core module, wherein the target plug-in may be a plug-in for external private deployment or a plug-in for non-privatized deployment (ie, internal deployment).
[0009] Optionally, the determining whether the current core module of the target plug-in needs to be updated by using the shell module of the target plug-in referenced by the application program includes:
[0010] Determining version information of the current core module using a shell module of the target plug-in;
[0011] Obtaining version information of the target core module from a version management server;
[0012] When the version indicated by the version information of the target core module is higher than the version indicated by the version information of the current core module, it is determined that the current core module needs to be updated.
[0013] When the target plug-in is a plug-in deployed externally and privately, the version management server may be an external Paas server; when the target plug-in is a plug-in deployed internally, the version management server is an internal Paas server.
[0014] Optionally, the acquiring the version information of the target core module from the version management server includes:
[0015] Obtaining a version management address from a configuration file of a shell module of the target plug-in;
[0016] The version information of the target core module is obtained from the version management server according to the version management address.
[0017] Optionally, when acquiring the version information of the target core module from the version management server, the method further includes:
[0018] Obtaining a plug-in storage address from the version management server;
[0019] The target core module for downloading the target plug-in includes:
[0020] The target core module is downloaded from the plug-in storage server according to the plug-in storage address.
[0021] When the target plug-in is a plug-in deployed externally and privately, the plug-in storage server may be an external Maven server; when the target plug-in is a plug-in deployed internally, the version management server may be an internal Maven server.
[0022] Optionally, when the target plug-in is a plug-in deployed externally and privately, the target plug-in is obtained in the following manner:
[0023] Obtain the configured version management address and plug-in storage address from the preset deployment interface;
[0024] The version management address and the plug-in storage address are written into the configuration file of the shell module of the original plug-in to obtain the target plug-in, that is, the target plug-in is a plug-in obtained by modifying the original plug-in developed by the developer.
[0025] In addition, when the target plug-in is an internally deployed plug-in, the target plug-in is an original plug-in developed by a developer.
[0026] Optionally, the method further comprises:
[0027] The target plug-in is uploaded to the plug-in storage server. That is, when the target plug-in is a plug-in deployed externally and privately, after the original plug-in is modified to obtain the target plug-in, the target plug-in can be published to an external Maven server for other external users to download and use.
[0028] Optionally, the application references the target plug-in in the following manner:
[0029] Adding version information of the shell module of the target plug-in to the root directory of the application according to user operation;
[0030] The shell module of the target plug-in is added under the root directory according to the version information of the shell module of the target plug-in, and the current core module is added under the subdirectory of the application.
[0031] Among them, when the target plug-in is a plug-in deployed externally and privately, the shell module and core module of the target plug-in can be directly obtained from the local storage. When the target plug-in is an internally deployed plug-in, the shell module and core module of the target plug-in can be downloaded from the internal Maven server.
[0032] In a second aspect, an embodiment of the present invention provides a plug-in updating device, including:
[0033] A determination module, configured to determine whether a current core module of a target plug-in needs to be updated by using a shell module of the target plug-in referenced by the application program;
[0034] A download module, used to download a target core module of the target plug-in when it is determined that the current core module needs to be updated;
[0035] An updating module is used to update the current core module to the target core module.
[0036] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a plug-in update method as described in any one of the embodiments of the present invention is implemented.
[0037] In a fourth aspect, an embodiment of the present invention further provides a plug-in update system, including a version management server, a plug-in storage server, and an electronic device for executing any plug-in update method described in any embodiment of the present invention.
[0038] In a fifth aspect, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the plug-in updating method as described in any one of the embodiments of the present invention is implemented.
[0039] In the embodiment of the present invention, the shell module of the target plug-in referenced by the application can be used to determine whether the current core module of the target plug-in needs to be updated. When it is determined that the current core module needs to be updated, the target core module of the target plug-in is downloaded, and the current core module is updated to the target core module. That is, in the embodiment of the present invention, the plug-in includes a shell module and a core module, and the shell module of the plug-in is used to check whether the core module needs to be updated. When it needs to be updated, the core module is automatically downloaded and updated, and the shell module remains unchanged, thereby realizing the automatic update of the plug-in, avoiding the need for manual operation by the user during the update process, and improving the update efficiency.
[0040] In addition, since the plug-in has a shell module + core module structure, plug-in updates only require updating the core module of the plug-in. When the plug-in is exported on a large scale for private deployment, it is only necessary to communicate with different teams about the update of the core module. There is no need to communicate with each team again to modify the plug-in code and notify different teams to modify the version information, which reduces maintenance costs.
[0041] Furthermore, the configured version management address and plug-in storage address can be obtained from the preset deployment interface, and the version management address and plug-in storage address can be written into the configuration file of the shell module of the original plug-in to obtain the target plug-in. That is, when the plug-in is privately deployed externally, the customized parameters are exposed to the user through the private deployment interface (that is, the preset deployment interface) for self-management, and the customized parameters are obtained through the private deployment interface, thereby realizing plug-in customization, avoiding the developer from re-modifying the plug-in code for different users, and reducing the operation and maintenance costs of plug-in deployment and upgrades. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 The figure is a flow chart of a plug-in updating method provided by an embodiment of the present invention.
[0043] Figure 2 This is another flowchart of the plug-in updating method provided by an embodiment of the present invention.
[0044] Figure 3 It is a schematic diagram of an interface for parameter configuration provided by an embodiment of the present invention.
[0045] Figure 4 It is an interactive schematic diagram of the plug-in updating system provided by an embodiment of the present invention.
[0046] Figure 5 This is another flowchart of the plug-in updating method provided by an embodiment of the present invention.
[0047] Figure 6 It is a structural schematic diagram of a plug-in updating device provided by an embodiment of the present invention.
[0048] Figure 7 It is a structural diagram of a plug-in updating system provided by an embodiment of the present invention.
[0049] Figure 8 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0050] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0051] Figure 1 The present invention provides a flowchart of a plug-in update method according to an embodiment of the present invention. The method can be executed by a plug-in update device according to an embodiment of the present invention. The device can be implemented in software and / or hardware. In a specific embodiment, the device can be integrated into an electronic device, such as a mobile phone, a personal computer (PC), a tablet computer, a laptop computer, a desktop computer, and the like. The following embodiments will be described by taking the device integrated into an electronic device as an example. Figure 1 , the method may specifically include the following steps:
[0052] Step 101: Determine whether the current core module of the target plug-in needs to be updated by using the shell module of the target plug-in referenced by the application.
[0053] For example, the application can be an Android (mobile operating system developed by Google) application or an IOS (mobile operating system developed by Apple) application, and the target plug-in can be a plug-in referenced by the application to implement related functions, such as a Gradle plug-in. Android applications can manage the construction of the application and solve dependency-related issues by referencing the Gradle plug-in.
[0054] In the embodiment of the present invention, the plug-in is designed as a shell module + core module structure, wherein the shell module is mainly used to implement functions such as version update of the core module and private deployment of the plug-in; the core module is mainly used to implement the real business logic, such as: dynamically adding dependencies, dynamically analyzing dependencies, dynamically resolving dependency conflicts, etc. The shell module can find the entry of the core module of the plug-in through reflection technology, thereby executing the latest core module and achieving the ability of automatic upgrade.
[0055] In the specific implementation, when the application needs to reference the target plug-in, the version information of the shell module of the target plug-in can be added to the root directory of the application through user operation. The version information, such as the version number, can be automatically downloaded from the plug-in storage server according to the added version number when the application is initialized. The shell module of the downloaded target plug-in is automatically added to the root directory of the application, and the current core module of the downloaded target plug-in is automatically added to the subdirectory of the application. When the application is running, the current core module in the subdirectory can be executed to implement related functions.
[0056] Specifically in the embodiment of the present invention, after the application references the target plug-in, the shell module of the target plug-in can determine in real time or periodically whether the current core module of the target plug-in needs to be updated. The specific method for determining whether the current core module of the target plug-in needs to be updated can be as follows:
[0057] (1) Use the shell module of the target plug-in to determine the version information of the current core module.
[0058] For example, the shell module of the target plug-in may be used to read the jar package file of the current core module in the subdirectory of the application program, and parse the file name to obtain the version information of the current core module.
[0059] (2) Obtain the version information of the target core module from the version management server.
[0060] For example, the version management address may be obtained from the configuration file of the shell module of the target plug-in, and the version information of the target core module may be obtained from the version management server according to the version management address. The configuration file may be, for example, a Manifest.MF file.
[0061] (3) When the version indicated by the version information of the target core module is higher than the version indicated by the version information of the current core module, it is determined that the current core module needs to be updated.
[0062] For example, if the target core module version information indicates that the core module version is 2.0, and the current core module version information indicates that the core module version is 1.0, it can be determined that the target core module version is higher than the current core module version and the current core module needs to be updated.
[0063] Step 102: When it is determined that the current core module needs to be updated, the target core module of the target plug-in is downloaded.
[0064] In a specific implementation, when obtaining the version information of the target core module from the version management server, the plug-in storage address can also be obtained. When it is determined that the current core module needs to be updated, the target core module can be downloaded from the plug-in storage server according to the plug-in storage address.
[0065] Step 103: Update the current core module to the target core module.
[0066] Specifically, after downloading the target core module, you can delete the current core module added to the subdirectory of the application, and add the target core module to the subdirectory of the application. When the application is running, first execute the shell module of the target plug-in added to the root directory of the application, and then find the entry of the target core module through the reflection mechanism, and execute the target core module, thereby realizing automatic update of the plug-in.
[0067] In the embodiment of the present invention, the shell module of the target plug-in referenced by the application can be used to determine whether the current core module of the target plug-in needs to be updated. When it is determined that the current core module needs to be updated, the target core module of the target plug-in is downloaded, and the current core module is updated to the target core module. That is, in the embodiment of the present invention, the plug-in includes a shell module and a core module, and the shell module of the plug-in is used to check whether the core module needs to be updated. When it needs to be updated, the core module is automatically downloaded and updated, and the shell module remains unchanged, thereby realizing the automatic update of the plug-in, avoiding the need for manual operation by the user during the update process, and improving the update efficiency.
[0068] In addition, since the plug-in has a shell module + core module structure, plug-in updates only require updating the core module of the plug-in. When the plug-in is exported on a large scale for private deployment, it is only necessary to communicate with different teams about the update of the core module. There is no need to communicate with each team again to modify the plug-in code and notify different teams to modify the version information, which reduces maintenance costs.
[0069] In the related art, when the plug-in is exported for external private deployment, for security reasons, the plug-in source code is not open to the outside world, and only the obfuscated plug-in jar package is provided. However, the user needs to customize certain parameters according to the private deployment environment, such as customizing the relevant information of the version management server for private deployment, the relevant information of the private plug-in storage server that stores binary dependencies, etc. The related solution is usually: re-modify the plug-in source code for different customers, and then repackage it to generate a new plug-in for external output. This method is not only cumbersome but also has high operation and maintenance costs, and requires frequent communication with external teams. In response to this problem, the embodiment of the present invention also provides a corresponding solution. The following is combined with Figure 2 Provide explanation.
[0070] like Figure 2 As shown, in a privatized deployment scenario, taking a Gradle plug-in as an example, another plug-in update method provided by an embodiment of the present invention includes the following steps:
[0071] Step 201, obtaining a configured version management address and plug-in storage address from a preset deployment interface.
[0072] In the specific implementation, developers can develop original Gradle plug-ins, which are composed of shell modules and core modules. The shell module has a corresponding shell module jar package, and the core module has a corresponding core module jar package. The jar package of the core module can be provided in the form of obfuscated code. When exporting private deployment to the outside world, in addition to providing users with the original Gradle plug-in (for example, through email, hard disk, etc.), users can also be provided with plug-in deployment tools, plug-in dependency files pom files, etc.
[0073] The user can install the plug-in deployment tool on the electronic device, and the electronic device can present a preset deployment interface. In a specific embodiment, the preset deployment interface can be as follows: Figure 3 As shown, it includes configurable items of the version management server (such as a Paas server) and the plug-in storage server (such as a Maven server), configurable items of the plug-in storage server such as the address of the plug-in storage server (i.e., the plug-in storage address), user name, and password, and configurable items of the version management server such as the address of the version management server (i.e., the version management address). Of course, the preset deployment interface may also include other information, such as the version number of the plug-in shell module, the version number of the core module, pom file information, etc.
[0074] The user can configure the relevant parameters in the preset deployment interface. After the configuration is completed, the electronic device obtains the configured version management address and plug-in storage address from the preset deployment interface, writes the version management address and plug-in storage address into the configuration file of the shell module of the original Gradle plug-in through the jar command line, and obtains the target Gradle plug-in. Among them, the configuration file of the shell module of the original Gradle plug-in can have information such as the version management address and plug-in storage address of the default configuration. When writing, the default configuration can be modified to the user configuration.
[0075] In a specific embodiment, the relevant implementation logic code of the user configuration may be as follows:
[0076]
[0077] Step 202: Write the version management address and the plug-in storage address into the configuration file of the shell module of the original plug-in to obtain the target plug-in.
[0078] In the specific implementation, the shell module of the target Gradle plugin is different from the shell module of the original Gradle plugin, but the core modules of the two are the same.
[0079] Step 203: Upload the target plug-in to the plug-in storage server.
[0080] For example, when a user clicks the publish button on the preset deployment interface to publish a plug-in, the electronic device can obtain the version number of the plug-in shell module, the version number of the core module, pom file information, etc. from the preset deployment interface, and publish the target Gradle plug-in to the plug-in storage server through Gradle's maven-publish for use by other users.
[0081] Step 204: Add the version information of the shell module of the target plug-in to the root directory of the application according to the user operation.
[0082] For example, when you need to reference a target Gradle plug-in in an application, you can add the version information of the shell module of the target Gradle plug-in in the root directory of the application (for example, in the build.gradle file in the root directory) through user operation, such as myplugin_shell:1.0.
[0083] Step 205: Add the shell module of the target plug-in to the root directory of the application program according to the version information of the shell module of the target plug-in, and add the current core module to the subdirectory of the application program.
[0084] When the application is initialized, for example Figure 4 As shown, the shell module (for example, the jar package of myplugin_shell:1.0) and the current core module (for example, the jar package of myplugin_core_1.0) of the target Gradle plug-in can be automatically downloaded from the plug-in storage server according to the added version information, and the shell module of the downloaded target Gradle plug-in can be automatically added to the root directory of the application (for example, the build.gradle file in the root directory), and the current core module of the downloaded target Gradle plug-in can be automatically added to the subdirectory of the application (for example, the .gradle directory). When the application is running, the current core module in the subdirectory can be executed to implement related functions.
[0085] Step 206: Determine the version information of the current core module using the shell module of the target plug-in.
[0086] For example, the shell module of the target Gradle plug-in can be used to read the jar package file of the current core module in the subdirectory of the application, and parse the file name to obtain the version information of the current core module.
[0087] Step 207: Obtain the version management address from the configuration file of the shell module of the target plug-in.
[0088] For example, the version management address may be obtained from the configuration file of the shell module of the target plug-in, and the version information of the target core module may be obtained from the version management server according to the version management address. The configuration file may be, for example, a Manifest.MF file.
[0089] Step 208: Obtain the version information and plug-in storage address of the target core module from the version management server according to the version management address.
[0090] In a specific embodiment, the data format of the data obtained from the version management server is as follows:
[0091] {
[0092] "version": "2.0", version information of the target kernel module
[0093] "url": "http: / / nexus.xxx.xom / content / repositories / snapshorts / com / test / myplugin_core / 2.0 / myplugin_core_2.0.jar" plugin storage address of the target core module
[0094] }
[0095] Step 209, determining whether the current core module needs to be updated based on the version information of the current core module and the version information of the target core module, if it needs to be updated, executing step 210, otherwise executing step 212 to end the processing.
[0096] For example, if the version information of the target core module is myplugin_core_2.0 and the version information of the current core module is myplugin_core_1.0, it can be determined that the version of the target core module is higher than the version of the current core module and the current core module needs to be updated.
[0097] Step 210: Download the target core module from the plug-in storage server according to the plug-in storage address.
[0098] Step 211: Update the current core module to the target core module.
[0099] Specifically, after downloading the target core module, you can delete the current core module added to the subdirectory of the application, and add the target core module to the subdirectory of the application. When the application is running, first execute the shell module of the target plug-in added to the root directory of the application, and then find the entry of the target core module through the reflection mechanism, and execute the target core module, thereby realizing automatic update of the plug-in.
[0100] Step 212, end.
[0101] It should be noted that when the plug-in is deployed privately, the target plug-in is the plug-in obtained by dynamically configuring the parameters of the original plug-in developed by the developer. Correspondingly, the user mentioned in this embodiment is equivalent to the client for the developer, and the version management server and the plug-in storage server are both the client's servers.
[0102] In the embodiment of the present invention, when the plug-in is privately deployed, the shell module of the target plug-in referenced by the application can be used to determine whether the current core module of the target plug-in needs to be updated. When it is determined that the current core module needs to be updated, the target core module of the target plug-in is downloaded, and the current core module is updated to the target core module. That is, in the embodiment of the present invention, the plug-in includes a shell module and a core module, and the shell module of the plug-in is used to check whether the core module needs to be updated. When it needs to be updated, the core module is automatically downloaded and updated, and the shell module remains unchanged, thereby realizing the automatic update of the plug-in, avoiding the need for manual operation by the user during the update process, and improving the update efficiency.
[0103] Furthermore, when the plug-in is privately deployed externally, the customized parameters are exposed to the user through the private deployment interface (i.e., the preset deployment interface) for self-management. The customized parameters are obtained through the private deployment interface to achieve plug-in customization, thereby reducing the operation and maintenance costs of plug-in deployment and upgrades. Plug-in updates only require updating the core module, and developers can focus on the design of the core module, reducing the development and operation and maintenance costs of the plug-in.
[0104] In a specific embodiment, in a non-privatized deployment scenario, taking the plug-in as a Gradle plug-in as an example, Figure 5 As shown, another plug-in updating method provided by an embodiment of the present invention includes the following steps:
[0105] Step 301: Add the version information of the shell module of the target plug-in to the root directory of the application according to the user operation.
[0106] For example, the Gradle plug-in of this embodiment is still composed of a shell module and a core module. The developer can upload the developed original Gradle plug-in (that is, the target Gradle plug-in) to the plug-in storage server. For example, when the target Gradle plug-in needs to be referenced in the application, the version information of the shell module of the target Gradle plug-in can be added to the root directory of the application (for example, in the build.gradle file in the root directory) through user operation, such as: myplugin_shell:1.0.
[0107] Step 302: Download the shell module and the current core module of the target plug-in from the plug-in storage server according to the version information of the shell module of the target plug-in.
[0108] Step 303: add the shell module of the target plug-in to the root directory of the application, and add the current core module to the subdirectory of the application.
[0109] For example, you can add the shell module of the downloaded target Gradle plug-in to the root directory of the application (for example, the build.gradle file in the root directory), and add the current core module of the downloaded target Gradle plug-in to the subdirectory of the application (for example, the .gradle directory). When the application is running, it can execute the current core module in the subdirectory to implement related functions.
[0110] Step 304: Determine the version information of the current core module using the shell module of the target plug-in.
[0111] For example, the shell module of the target Gradle plug-in can be used to read the jar package file of the current core module in the subdirectory of the application, and parse the file name to obtain the version information of the current core module.
[0112] Step 305: Obtain the version management address from the configuration file of the shell module of the target plug-in.
[0113] By way of example, the configuration file may be a Manifest.MF file.
[0114] Step 306: Obtain the version information and plug-in storage address of the target core module from the version management server according to the version management address.
[0115] Step 307, determining whether the current core module needs to be updated based on the version information of the current core module and the version information of the target core module, if it needs to be updated, executing step 308, otherwise executing step 310 to end the processing.
[0116] For example, if the version information of the target core module is myplugin_core_2.0 and the version information of the current core module is myplugin_core_1.0, it can be determined that the version of the target core module is higher than the version of the current core module and the current core module needs to be updated.
[0117] Step 308: Download the target core module from the plug-in storage server according to the plug-in storage address.
[0118] Step 309: Update the current core module to the target core module.
[0119] Specifically, after downloading the target core module, you can delete the current core module added to the subdirectory of the application, and add the target core module to the subdirectory of the application. When the application is running, first execute the shell module of the target plug-in added to the root directory of the application, and then find the entry of the target core module through the reflection mechanism, and execute the target core module, thereby realizing automatic update of the plug-in.
[0120] Step 310, end.
[0121] It should be noted that when the plug-in is deployed in a non-private manner, the target plug-in is the original plug-in developed by the developer. Correspondingly, the user mentioned in this embodiment is equivalent to an internal user for the developer, and the version management server and the plug-in storage server are both internal servers.
[0122] In the embodiment of the present invention, when the plug-in is deployed in a non-privatized manner, the shell module of the target plug-in referenced by the application can be used to determine whether the current core module of the target plug-in needs to be updated. When it is determined that the current core module needs to be updated, the target core module of the target plug-in is downloaded, and the current core module is updated to the target core module. That is, in the embodiment of the present invention, the plug-in includes a shell module and a core module, and the shell module of the plug-in is used to check whether the core module needs to be updated. When an update is required, the core module is automatically downloaded and updated, and the shell module remains unchanged, thereby realizing the automatic update of the plug-in, avoiding the need for manual operation by the user during the update process, and improving the update efficiency.
[0123] Furthermore, plug-in updates only require updating the core module, so developers can focus on the design of the core module, reducing the development and operation and maintenance costs of the plug-in.
[0124] It should be understood that although Figure 2 , 5 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 , 5 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0125] It should be noted that the interface diagram shown in the embodiment of the present disclosure is intended to illustrate the detection plug-in deployment method of sensitive functions, and the content presented in the specific interface (including but not limited to text, pictures, etc.) does not constitute a limitation on the solution.
[0126] Figure 6 FIG. 1 is a structural diagram of a plug-in updating device provided by an embodiment of the present invention, and the device is suitable for executing the plug-in updating method provided by an embodiment of the present invention. Figure 6 As shown, the device may specifically include:
[0127] A determination module 401 is used to determine whether a current core module of a target plug-in needs to be updated by using a shell module of the target plug-in referenced by the application program;
[0128] A download module 402, configured to download a target core module of the target plug-in when it is determined that the current core module needs to be updated;
[0129] The updating module 403 is used to update the current core module to the target core module.
[0130] In one embodiment, the determining module 401 determines whether the current core module of the target plug-in needs to be updated by using the shell module of the target plug-in referenced by the application program, including:
[0131] Determining version information of the current core module using a shell module of the target plug-in;
[0132] Obtaining version information of the target core module from a version management server;
[0133] When the version indicated by the version information of the target core module is higher than the version indicated by the version information of the current core module, it is determined that the current core module needs to be updated.
[0134] In one embodiment, the determining module 401 obtains the version information of the target core module from the version management server, including:
[0135] Obtaining a version management address from a configuration file of a shell module of the target plug-in;
[0136] The version information of the target core module is obtained from the version management server according to the version management address.
[0137] In one embodiment, when the determining module 401 obtains the version information of the target core module from the version management server, it is further configured to:
[0138] Obtaining a plug-in storage address from the version management server;
[0139] The download module 402 downloads the target core module of the target plug-in, including:
[0140] The target core module is downloaded from the plug-in storage server according to the plug-in storage address.
[0141] In one embodiment, the target plug-in is obtained by:
[0142] Obtain the configured version management address and plug-in storage address from the preset deployment interface;
[0143] The version management address and the plug-in storage address are written into the configuration file of the shell module of the original plug-in to obtain the target plug-in.
[0144] In one embodiment, the device further comprises:
[0145] The uploading module is used to upload the target plug-in to the plug-in storage server.
[0146] In one embodiment, the application references the target plug-in in the following manner:
[0147] Adding version information of the shell module of the target plug-in to the root directory of the application according to user operation;
[0148] The shell module of the target plug-in is added under the root directory according to the version information of the shell module of the target plug-in, and the current core module is added under the subdirectory of the application.
[0149] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the functional modules described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0150] The device of the embodiment of the present invention can use the shell module of the target plug-in referenced by the application to determine whether the current core module of the target plug-in needs to be updated. When it is determined that the current core module needs to be updated, the target core module of the target plug-in is downloaded, and the current core module is updated to the target core module. That is, in the embodiment of the present invention, the plug-in includes a shell module and a core module. The shell module of the plug-in is used to check whether the core module needs to be updated. When it needs to be updated, the core module is automatically downloaded and updated, and the shell module remains unchanged, thereby realizing automatic update of the plug-in, avoiding the need for manual operation by the user during the update process, and improving the update efficiency. The plug-in is designed in the form of a shell module and a core module. The plug-in update only needs to update the core module. The developers can focus on the design of the core module, reducing the development and operation and maintenance costs of the plug-in.
[0151] In addition, since the plug-in has a shell module + core module structure, plug-in updates only require updating the core module of the plug-in. When the plug-in is exported on a large scale for private deployment, it is only necessary to communicate with different teams about the update of the core module. There is no need to communicate with each team again to modify the plug-in code and notify different teams to modify the version information, which reduces maintenance costs.
[0152] Furthermore, when the plug-in is privately deployed externally, the customized parameters are exposed to the user through the private deployment interface (i.e., the preset deployment interface) for self-management. The customized parameters are obtained through the private deployment interface, thereby realizing plug-in customization, thereby reducing the operation and maintenance costs of plug-in deployment and upgrades.
[0153] An embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the plug-in update method provided in any of the above embodiments when executing the program.
[0154] An embodiment of the present invention further provides a computer-readable medium on which a computer program is stored. When the program is executed by a processor, the plug-in updating method provided in any of the above embodiments is implemented.
[0155] The embodiment of the present invention also provides a plug-in update system, such as Figure 7 As shown, it includes a version management server 501, a plug-in storage server 502 and an electronic device 503 for executing the plug-in update method as described in any of the embodiments of the present invention. The interaction between the devices can refer to the description of the previous embodiments and will not be repeated here.
[0156] Reference below Figure 8 , which shows a schematic diagram of the structure of a computer system 600 of an electronic device suitable for implementing an embodiment of the present invention. Figure 8 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0157] like Figure 8 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 to a random access memory (RAM 603). In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0158] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.
[0159] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present invention are executed.
[0160] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0161] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0162] The modules and / or units involved in the embodiments of the present invention may be implemented in software or hardware. The modules and / or units described may also be arranged in a processor, for example, it may be described as follows: a processor includes a determination module, a download module, and an update module. The names of these modules do not, in some cases, constitute limitations on the modules themselves.
[0163] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: using the shell module of the target plug-in referenced by the application to determine whether the current core module of the target plug-in needs to be updated; when it is determined that the current core module needs to be updated, downloading the target core module of the target plug-in; updating the current core module to the target core module.
[0164] According to the technical solution of the embodiment of the present invention, the shell module of the target plug-in referenced by the application can be used to determine whether the current core module of the target plug-in needs to be updated. When it is determined that the current core module needs to be updated, the target core module of the target plug-in is downloaded, and the current core module is updated to the target core module. That is, in the embodiment of the present invention, the plug-in includes a shell module and a core module. The shell module of the plug-in is used to check whether the core module needs to be updated. When it needs to be updated, the core module is automatically downloaded and updated, and the shell module remains unchanged, thereby realizing the automatic update of the plug-in, avoiding the need for manual operation by the user during the update process, and improving the update efficiency.
[0165] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A plug-in update method, characterized in that: include: Determining whether the current core module of the target plug-in needs to be updated by using the shell module of the target plug-in referenced by the application, including: determining the version information of the current core module by using the shell module of the target plug-in; acquiring the version information of the target core module of the target plug-in from a version management server; and determining that the current core module needs to be updated when the version information of the target core module indicates a version higher than the version information of the current core module indicates; When it is determined that the current core module needs to be updated, downloading the target core module of the target plug-in; Updating the current core module to the target core module; Among them, the target plug-in is designed to have a shell module + core module structure, the shell module is mainly used to implement the version update and plug-in private deployment functions of the core module, the core module is mainly used to implement the real business logic, and the application references the target plug-in in the following way: according to user operations, the version information of the shell module of the target plug-in is added to the root directory of the application; according to the version information of the shell module of the target plug-in, the shell module of the target plug-in is added to the root directory, and the current core module is added to the subdirectory of the application.
2. The plug-in updating method according to claim 1, characterized in that: The obtaining the version information of the target core module from the version management server includes: Obtaining a version management address from a configuration file of a shell module of the target plug-in; The version information of the target core module is obtained from the version management server according to the version management address.
3. The plug-in updating method according to claim 2, characterized in that: When obtaining the version information of the target core module from the version management server, it also includes: Obtaining a plug-in storage address from the version management server; The target core module for downloading the target plug-in includes: The target core module is downloaded from the plug-in storage server according to the plug-in storage address.
4. The plug-in updating method according to claim 3, characterized in that: The target plug-in is obtained in the following way: Obtain the configured version management address and plug-in storage address from the preset deployment interface; The version management address and the plug-in storage address are written into the configuration file of the shell module of the original plug-in to obtain the target plug-in.
5. The plug-in updating method according to claim 4, characterized in that: The method further comprises: The target plug-in is uploaded to the plug-in storage server.
6. A plug-in updating device, characterized in that: include: A determination module, used to determine whether the current core module of the target plug-in needs to be updated by using the shell module of the target plug-in referenced by the application, including: determining the version information of the current core module by using the shell module of the target plug-in; acquiring the version information of the target core module of the target plug-in from the version management server; and determining that the current core module needs to be updated when the version information of the target core module indicates a version higher than the version information of the current core module indicates; A download module, used to download a target core module of the target plug-in when it is determined that the current core module needs to be updated; An updating module, used for updating the current core module to the target core module; Among them, the target plug-in is designed to have a shell module + core module structure, the shell module is mainly used to implement the version update and plug-in private deployment functions of the core module, the core module is mainly used to implement the real business logic, and the application references the target plug-in in the following way: according to user operations, the version information of the shell module of the target plug-in is added to the root directory of the application; according to the version information of the shell module of the target plug-in, the shell module of the target plug-in is added to the root directory, and the current core module is added to the subdirectory of the application.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the plug-in updating method according to any one of claims 1 to 5 is implemented.
8. A plug-in update system, characterized in that: The invention comprises a version management server, a plug-in storage server and an electronic device for executing the plug-in updating method as claimed in any one of claims 1 to 5.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the plug-in updating method as claimed in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Updating method of application, terminal and computer readable storage medium
CN108304205A
Plug-in calling method and device, electronic equipment and storage medium
CN111506366A