A method and device for managing dependent packages

By matching the project configuration file with the project package list and the specified code file, generating dependency package matching results and visually displaying it, the cumbersome problem of dependency package management in the existing technology is solved, and efficient and low-cost dependency package management is achieved.

CN113342395BActive Publication Date: 2025-02-14INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110624864.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-04
Publication Date
2025-02-14
Estimated Expiration
2041-06-04

AI Technical Summary

Technical Problem

In the prior art, the management of dependency packages is too cumbersome and requires manual comparison and confirmation of the currently redundant dependency packages, resulting in low management efficiency and high cost.

Method used

By matching the project configuration file with the project package list and the specified code file, the dependency package matching results are generated, and the management interface is generated based on multiple dependency packages, and the executable operations are visually displayed to receive user input.

Benefits of technology

Visual management of dependent packages is realized, which reduces management costs and improves management efficiency, making it easier for users to monitor and optimize dependent packages in a unified manner.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113342395B_ABST
    Figure CN113342395B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a dependency package management method and device, which can be used in the field of big data technology. The method includes: matching a project configuration file with a project package list and a specified code file respectively to generate a dependency package matching result; generating a management interface corresponding to each dependency package according to multiple dependency packages under the project package list; visually displaying the management interface, the dependency package matching result and the configuration information of the dependency package to receive executable operations input by the user, wherein the configuration information is obtained from the project configuration file, so that the user can visually manage the dependency package, the management cost is low, and the management efficiency can be greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of file configuration technology, in particular to the field of big data technology, and more particularly to a dependency package management method and device. Background Art

[0002] The Node Package Manager (NPM) is a package management tool in the JavaScript world. It is also the default package management tool for the Node.js platform and the world's largest software registry, containing the structures of over 600,000 packages. Currently, enterprise application developers often use Vue to replace the original JSP to develop front-end projects. Various scaffolding tools are integrated with the webpack solution, and the demand for NPM package management in projects is increasing. In related technologies, the dependency packages of the current project are generally checked through configuration files (package.json) and package management lists (NPM lists). However, this method is too cumbersome and requires manual comparison to confirm the current redundant dependency packages, which is too time-consuming and costly, increasing the ineffective work of project development and maintenance, resulting in low management efficiency. Summary of the Invention

[0003] One object of the present invention is to provide a dependency package management method that facilitates user visual management of dependency packages, reduces management costs, and significantly improves management efficiency. Another object of the present invention is to provide a dependency package management device. Another object of the present invention is to provide a computer-readable medium. Yet another object of the present invention is to provide a computer device.

[0004] In order to achieve the above objectives, the present invention discloses a dependency package management method, comprising:

[0005] Match the project configuration file with the project package list and the specified code file to generate the dependency package matching result;

[0006] Generate the management interface corresponding to each dependency package based on the multiple dependency packages in the project package list;

[0007] The management interface, dependency package matching results, and dependency package configuration information are visually displayed to receive executable operations input by the user, where the configuration information is obtained from the project configuration file.

[0008] Preferably, according to the multiple dependent packages under the project package list, a management interface corresponding to each dependent package is generated, including:

[0009] Through the package management library interface, according to the multiple dependent packages under the project package list, generate the management interface corresponding to each dependent package.

[0010] Preferably, the project package list includes a dependency tree, which includes dependency relationships between multiple dependency packages; the project configuration file includes configuration information of each dependency package in the dependency tree;

[0011] Match the project configuration file with the project package list and the specified code file to generate dependency package matching results, including:

[0012] Match the dependency packages in the dependency tree with the configuration information of the dependency packages to generate the dependency package configuration results;

[0013] Match the configuration information of the dependency package with the dependency package called by the specified code file to generate the dependency package call result;

[0014] Generate dependency package matching results based on dependency package configuration results and dependency package call results.

[0015] Preferably, matching the dependency packages in the dependency tree with the configuration information of the dependency packages to generate dependency package configuration results includes:

[0016] Match the configuration information with the dependency package of the dependency tree. If the dependency package of the dependency tree is included in the configuration information, determine the dependency package configuration result corresponding to the dependency package of the dependency tree as configured;

[0017] If the dependency package of the dependency tree is not included in the configuration information, the dependency package configuration result corresponding to the dependency package of the dependency tree is determined to be unconfigured.

[0018] Preferably, the configuration information of the dependency package is matched with the dependency package called by the specified code file to generate a dependency package call result, including:

[0019] Match the dependent package called by the specified code file with the configuration information. If the dependent package called by the specified code file is included in the configuration information, determine the dependent package call result corresponding to the dependent package called by the specified code file as called;

[0020] If the dependent package called by the specified code file is not included in the configuration information, the dependent package calling result corresponding to the dependent package called by the specified code file is determined to be not called.

[0021] Preferably, before matching the project configuration file with the project package list and the specified code file to generate the dependency package matching result, the following steps are further included:

[0022] If a code path is received from the user, the code file corresponding to the code path is retrieved;

[0023] Searching for a code file in a specified format from the code file, and determining the searched code file in the specified format as the specified code file;

[0024] If the code path input by the user is not received, a code file of a specified format is retrieved from a preset default file, and the retrieved code file of the specified format is determined as the designated code file.

[0025] Preferably, the management interface includes one or any combination of an upgrade interface, a downgrade interface, and a delete interface;

[0026] Based on the multiple dependent packages in the project package list, generate the management interface corresponding to each dependent package, including:

[0027] Obtain the version information of the dependent package through the package management library interface, including the current version and the latest version;

[0028] If the current version of the dependent package is different from the latest version, generate the upgrade interface, downgrade interface, and deletion interface corresponding to the dependent package;

[0029] If the current version of the dependent package is the same as the latest version, generate the downgrade interface and deletion interface corresponding to the dependent package.

[0030] Preferably, after visually displaying the management interface, dependency package matching results, and dependency package configuration information to receive management operations input by the user, the method further includes:

[0031] Receive management operations input by users through the management interface;

[0032] If the management interface is an upgrade interface and the management operation is an upgrade operation, in response to the upgrade operation, an upgrade version list is displayed, the upgrade version list including at least one upgradeable version;

[0033] If the management interface is a downgrade interface and the management operation is a downgrade operation, in response to the downgrade operation, a downgrade version list is displayed, where the downgrade version list includes at least one downgradable version;

[0034] If the management interface is a deletion interface and the management operation is a deletion operation, in response to the deletion operation, a deletion prompt message is generated and the deletion prompt message is visually displayed;

[0035] Receive the deletion confirmation message input by the user;

[0036] In response to the deletion confirmation message, the dependent package corresponding to the deletion operation is deleted.

[0037] Preferably, before generating a deletion prompt message in response to the deletion operation and visually displaying the deletion prompt message, the method further includes:

[0038] Determine whether the dependent package name in the calling package list includes the dependent package name of the dependent package corresponding to the deletion operation, wherein the calling package list is obtained from the specified code file;

[0039] If the dependent package name in the calling package list includes the dependent package name of the dependent package corresponding to the deletion operation, a risk warning message is generated and the risk warning message is visually displayed for the user to confirm the risk warning message.

[0040] The present invention also discloses a dependency package management device, comprising:

[0041] The first generation module is used to match the project configuration file with the project package list and the specified code file respectively to generate a dependency package matching result;

[0042] The second generation module is used to generate a management interface corresponding to each dependency package according to the multiple dependency packages in the project package list;

[0043] The display module is used to visually display the management interface, dependency package matching results and dependency package configuration information to receive executable operations input by the user, wherein the configuration information is obtained from the project configuration file.

[0044] The present invention also discloses a computer-readable medium on which a computer program is stored. When the program is executed by a processor, the method described above is implemented.

[0045] The present invention also discloses a computer device, including a memory and a processor, wherein the memory is used to store information including program instructions, the processor is used to control the execution of program instructions, and the processor implements the above method when executing the program.

[0046] The present invention matches the project configuration file with the project package list and the specified code file respectively to generate a dependency package matching result; generates a management interface corresponding to each dependency package based on multiple dependency packages under the project package list; and visually displays the management interface, dependency package matching results and configuration information of the dependency package to receive executable operations input by the user. The configuration information is obtained from the project configuration file, which facilitates the user to visually manage the dependency packages, has low management costs, and can greatly improve management efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0048] Figure 1 A flowchart of a dependency package management method provided by an embodiment of the present invention;

[0049] Figure 2 A flowchart of another dependency package management method provided by an embodiment of the present invention;

[0050] Figure 3 A schematic diagram of an interface for visual display of dependency package management provided by an embodiment of the present invention;

[0051] Figure 4 A schematic diagram of the structure of a dependency package management device provided by an embodiment of the present invention;

[0052] Figure 5 A schematic structural diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0053] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0054] It should be noted that the dependency package management method and device disclosed in this application can be used in the field of big data technology, and can also be used in any field other than the field of big data technology. The application field of the dependency package management method and device disclosed in this application is not limited.

[0055] In order to facilitate understanding of the technical solution provided by the present application, the relevant contents of the technical solution of the present application are first described below. The package management library (Node Package Manager, abbreviated as: NPM) is a Node.js package management and distribution tool, which has become the standard for the unofficial release of Node modules (packages). In the related art, it is usually necessary to check the dependency packages of the current project through a configuration file (package.json) and a package management list (NPM list), and to determine whether there are redundant dependency packages by manually comparing the current dependency packages, but the above-mentioned management method of the dependency packages is too cumbersome, the labor cost and time cost consumed are high, the invalid work of project development and maintenance is increased, and the management efficiency of the dependency packages is low. The present invention is to visualize the dependency packages of the current project, the dependency package matching results, the configuration information of the dependency packages and the management interface of the dependency packages, so that users can manage the dependency packages, facilitate users to view the dependency situation of the current project dependency packages, facilitate users to uniformly monitor the dependency usage of the dependency packages of the project, and appropriately perform optimization work such as "slimming down" on the current project.

[0056] The following uses the dependency package management device as an example to illustrate the implementation process of the dependency package management method provided by the embodiment of the present invention. It is understandable that the execution subject of the dependency package management method provided by the embodiment of the present invention includes but is not limited to the dependency package management device.

[0057] Figure 1 A flowchart of a dependency package management method provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the method includes:

[0058] Step 101: Match the project configuration file with the project package list and the specified code file respectively to generate a dependency package matching result.

[0059] Step 102: Generate a management interface corresponding to each dependent package according to the multiple dependent packages in the project package list.

[0060] Step 103: Visually display the management interface, dependency package matching results, and configuration information of the dependency package to receive executable operations input by the user, wherein the configuration information is obtained from the project configuration file.

[0061] In the technical solution provided by the embodiment of the present invention, the project configuration file is matched with the project package list and the specified code file respectively to generate a dependency package matching result; based on the multiple dependency packages under the project package list, a management interface corresponding to each dependency package is generated; the management interface, the dependency package matching result and the configuration information of the dependency package are visually displayed to receive executable operations input by the user, wherein the configuration information is obtained from the project configuration file, which facilitates the user to visually manage the dependency package, has low management costs, and can greatly improve management efficiency.

[0062] Figure 2 A flowchart of another dependency package management method provided by an embodiment of the present invention is as follows: Figure 2 As shown, the method includes:

[0063] Step 201: Obtain a project package list and a project configuration file.

[0064] In the embodiment of the present invention, each step is executed by a dependent package management device.

[0065] In this embodiment of the present invention, the project package list is a list of all packages in the current project's package management library, namely: NPM list. The project package list includes a dependency tree and the paths of dependent packages, where the dependency tree includes the dependency relationships between multiple dependent packages. The project configuration file (package.json) is the configuration file of the current project. The project configuration file includes the configuration information of each dependent package in the dependency tree, where the capacity occupied by the dependent package configuration information package is shown.

[0066] Step 202: Match the dependency packages in the dependency tree with the configuration information of the dependency packages to generate a dependency package configuration result.

[0067] In the embodiment of the present invention, step 202 specifically includes:

[0068] Step 2021: Match the configuration information with the dependency package of the dependency tree. If the dependency package of the dependency tree is included in the configuration information, determine the dependency package configuration result corresponding to the dependency package of the dependency tree as configured.

[0069] In an embodiment of the present invention, a dependency tree includes a dependency package and sub-dependency packages that depend on the dependency package. The dependency tree can indicate the dependency relationship between the dependency package and its sub-dependency packages.

[0070] Specifically, the package name of the configuration information is matched with the package name of the dependency package in the dependency tree. If the package name of the dependency tree exists in the package name of the configuration information, it indicates that the dependency package has been configured, and the dependency package configuration result corresponding to the dependency package is determined to be configured.

[0071] It is understandable that not only the package name of the dependent package can be used as a matching basis for matching, but also other attributes of the dependent package can be used as a matching basis for matching, and the present invention is not limited to this.

[0072] Step 2022: If the dependency package of the dependency tree is not included in the configuration information, the dependency package configuration result corresponding to the dependency package of the dependency tree is determined to be unconfigured.

[0073] Specifically, the package name of the configuration information is matched with the package name of the dependency package in the dependency tree. If the package name of the dependency tree does not exist in the package name of the configuration information, it indicates that the dependency package is not configured, and the dependency package configuration result corresponding to the dependency package is determined to be not configured.

[0074] It is understandable that not only the package name of the dependent package can be used as a matching basis for matching, but also other attributes of the dependent package can be used as a matching basis for matching, and the present invention is not limited to this.

[0075] Step 203: Match the configuration information of the dependency package with the dependency package called by the specified code file to generate a dependency package calling result.

[0076] In the embodiment of the present invention, step 203 specifically includes:

[0077] Step 2031: Match the dependency package called by the specified code file with the configuration information. If the dependency package called by the specified code file is included in the configuration information, determine the dependency package call result corresponding to the dependency package called by the specified code file as called.

[0078] In an embodiment of the present invention, a calling package list of a specified code file is obtained, and the calling package list records all dependent packages called by the code file.

[0079] Specifically, the package name of the configuration information is matched with the package name of the dependent package called by the specified code file. If the package name of the dependent package called by the specified code file exists in the package name of the configuration information, it indicates that the dependent package is called, and the dependent package call result corresponding to the dependent package is determined to have been called.

[0080] It is understandable that not only the package name of the dependent package can be used as a matching basis for matching, but also other attributes of the dependent package can be used as a matching basis for matching, and the present invention is not limited to this.

[0081] Step 2032: If the dependent package called by the specified code file is not included in the configuration information, the dependent package calling result corresponding to the dependent package called by the specified code file is determined as not called.

[0082] Specifically, the package name of the configuration information is matched with the package name of the dependent package called by the specified code file. If the package name of the dependent package called by the specified code file does not exist in the package name of the configuration information, it indicates that the dependent package has not been called, and the dependent package call result corresponding to the dependent package is determined to be not called.

[0083] It is understandable that not only the package name of the dependent package can be used as a matching basis for matching, but also other attributes of the dependent package can be used as a matching basis for matching, and the present invention is not limited to this.

[0084] In the embodiment of the present invention, before step 2032, it is necessary to obtain a specified code file. Specifically, the method for obtaining the specified code file includes:

[0085] Step T11: Determine whether the code path input by the user is received. If so, execute step T12; if not, execute step T14.

[0086] In an embodiment of the present invention, if the code path input by the user is received, it indicates that the user needs to query the code file under the specified path, and step T12 is continued; if the code path input by the user is not received, it indicates that the user does not have the code file of the specified path that needs to be queried, and the code file under the default path is queried, and step T14 is continued.

[0087] Step T12: If the code path input by the user is received, the code file corresponding to the code path is searched.

[0088] In the embodiment of the present invention, the corresponding code file is queried according to the code path.

[0089] Step T13: Query a code file of a specified format from the code file, determine the queried code file of the specified format as the specified code file, and continue to execute step 2032.

[0090] In the embodiment of the present invention, the code files include multiple formats. A code file of a specified format is screened out from the code files of the multiple formats, and the code file of the specified format is determined as the specified code file, and step 2032 is continued.

[0091] In the embodiment of the present invention, the specified format includes but is not limited to the js format and the vue format.

[0092] Step T14: If the code path input by the user is not received, a code file of a specified format is searched from a preset default file, and the searched code file of the specified format is determined as the specified code file, and step 2032 is continued.

[0093] In an embodiment of the present invention, the preset default file is a code file in a default path. As an optional solution, the default path is the root directory path of the project. Specifically, the code file of the specified format is filtered out from the default file, and the code file of the specified format is determined as the designated code file, and step 2032 is continued.

[0094] In the embodiment of the present invention, the specified format includes but is not limited to the js format and the vue format.

[0095] Step 204: Generate a dependency package matching result based on the dependency package configuration result and the dependency package call result.

[0096] Specifically, the dependency package configuration result and the dependency package call result are determined as the dependency package matching result.

[0097] Step 205: Generate a management interface corresponding to each dependent package according to the multiple dependent packages in the project package list through the package management library interface.

[0098] In an embodiment of the present invention, the management interface includes one or any combination of an upgrade interface, a downgrade interface, and a delete interface. The upgrade interface is an interface for upgrading the dependency package, the downgrade interface is an interface for downgrading the dependency package, and the delete interface is an interface for deleting the dependency package.

[0099] In the embodiment of the present invention, step 205 specifically includes:

[0100] Step 2051: Obtain the version information of the dependent package through the package management library interface, where the version information includes the current version and the latest version.

[0101] In the embodiment of the present invention, the package management library records the version information of each dependent package, that is, the current version and the latest version of the dependent package, and the package management library provides a package management library interface (NPM API). Specifically, the version information of the dependent package is obtained through the package management library interface.

[0102] Step 2052: If the current version of the dependency package is different from the latest version, generate an upgrade interface, a downgrade interface, and a delete interface corresponding to the dependency package.

[0103] In an embodiment of the present invention, if the current version of the dependency package obtained is different from the latest version, it indicates that the current version of the dependency package is not the latest version. The dependency package can be upgraded to generate an upgrade interface, a downgrade interface, and a deletion interface corresponding to the dependency package.

[0104] Step 2053: If the current version of the dependent package is the same as the latest version, generate a downgrade interface and a deletion interface corresponding to the dependent package.

[0105] In an embodiment of the present invention, if the current version of the dependency package obtained is the same as the latest version, it indicates that the current version of the dependency package is already the latest version and the dependency package cannot be upgraded. Only the downgrade interface and deletion interface corresponding to the dependency package are generated.

[0106] Step 206: Visually display the management interface, dependency package matching results, and configuration information of the dependency package to receive management operations input by the user, wherein the configuration information is obtained from the project configuration file.

[0107] Figure 3 A schematic diagram of an interface for visual display of dependency package management provided by an embodiment of the present invention, such as Figure 3 As shown, the interface is visually displayed from left to right according to the package name, occupied capacity, dependent package configuration result, dependent package call result, management interface and dependent file path. There is also an expand button on the left side of each dependent package name. Clicking the expand button can display the package name of the dependent package corresponding to the dependent package name; there is an expand button on the right side of the management interface. Clicking the expand button can display the dependent file path of the dependent package corresponding to the dependent package name, wherein the dependent files include but are not limited to specified code files. It is understandable that the embodiment of the present invention only exemplarily displays the visual interface of the dependent package management. The visual interface of the dependent package management can also be other style interfaces, which are not limited by the embodiment of the present invention.

[0108] In the embodiment of the present invention, the configuration information includes a package name and an occupied capacity, and the package name and the occupied capacity are obtained from a project configuration file.

[0109] Step 207: Receive a management operation input by the user through the management interface. If the management interface is an upgrade interface, proceed to step 208; if the management interface is a downgrade interface, proceed to step 209; if the management interface is a delete interface, proceed to step 210.

[0110] Step 208: If the management interface is an upgrade interface and the management operation is an upgrade operation, in response to the upgrade operation, an upgrade version list is displayed. The upgrade version list includes at least one upgradeable version, and the process ends.

[0111] In an embodiment of the present invention, the user clicks on the upgrade interface through the visual interface to input the upgrade operation; the dependent package management device obtains at least one upgrade version through the package management library interface, generates an upgrade version list, and visually displays the upgrade version list for the user to select an upgradeable version from the upgrade version list.

[0112] Furthermore, in response to the user selecting an upgradeable version from the upgrade version list, the dependency package management device modifies the version information of the dependency package in the project configuration file according to the selected upgradeable version; and calls the installation package corresponding to the selected upgradeable version for installation to complete the upgrade of the dependency package.

[0113] Step 209: If the management interface is a downgrade interface and the management operation is a downgrade operation, in response to the downgrade operation, a downgrade version list is displayed. The downgrade version list includes at least one downgradable version, and the process ends.

[0114] In an embodiment of the present invention, a user clicks on a downgrade interface through a visual interface to input a downgrade operation; a dependent package management device obtains at least one downgraded version through a package management library interface, generates a downgraded version list, and visually displays the downgraded version list for the user to select a downgradeable version from the downgraded version list.

[0115] Furthermore, in response to the user selecting a downgradeable version from the downgrade version list, the dependency package management device modifies the version information of the dependency package in the project configuration file according to the selected downgradeable version; and calls the installation package corresponding to the selected downgradeable version for installation to complete the downgrade of the dependency package.

[0116] Step 210: If the management interface is a deletion interface and the management operation is a deletion operation, a deletion prompt message is generated in response to the deletion operation and the deletion prompt message is visually displayed.

[0117] In the embodiment of the present invention, the user clicks on the deletion interface through the visual interface to input the deletion operation; the dependency package management device generates a deletion prompt message for visual display. For example, the deletion prompt message is: Do you confirm the deletion?

[0118] Step 211: Receive a deletion confirmation message input by the user.

[0119] In the embodiment of the present invention, the user can click a confirmation or cancellation button to input a confirmation deletion message or a cancellation deletion message.

[0120] Step 212: In response to the deletion confirmation message, delete the dependent package corresponding to the deletion operation.

[0121] In an embodiment of the present invention, the dependency package management device deletes the corresponding dependency package in response to the confirmation deletion message, including deleting the dependency package body and deleting the configuration information of the dependency package from the project configuration file; in response to the cancellation deletion operation, the corresponding dependency package is canceled.

[0122] Before step 212, the method further includes:

[0123] Step S11, determine whether the dependent package name in the calling package list includes the dependent package name of the dependent package corresponding to the deletion operation, wherein the calling package list is obtained from the specified code file. If so, execute step S12; if not, execute step 212.

[0124] In an embodiment of the present invention, if the dependent package name in the calling package list includes the dependent package name of the dependent package corresponding to the deletion operation, it indicates that the dependent package has been called by the specified code file, and step S12 is executed; if the dependent package name in the calling package list does not include the dependent package name of the dependent package corresponding to the deletion operation, it indicates that the dependent package has not been called by the specified code file, and step 212 is executed.

[0125] Step S12: If the dependent package name in the calling package list includes the dependent package name of the dependent package corresponding to the deletion operation, a risk warning message is generated and the risk warning message is visually displayed for the user to confirm the risk warning message.

[0126] In an embodiment of the present invention, if the dependent package is called by a specified code file, a risk warning message is generated. For example, the risk warning message is: This dependent package is called by a specified code file. Deleting this dependent package may make the project file unusable. Do you still want to delete it?

[0127] If the user still chooses to delete, the dependent package will be deleted, including deleting the dependent package itself and deleting the configuration information of the dependent package from the project configuration file; if the user chooses to cancel the deletion, the dependent package will be cancelled.

[0128] In the technical solution provided by the embodiment of the present invention, the project configuration file is matched with the project package list and the specified code file respectively to generate a dependency package matching result; based on the multiple dependency packages under the project package list, a management interface corresponding to each dependency package is generated; the management interface, the dependency package matching result and the configuration information of the dependency package are visually displayed to receive executable operations input by the user, wherein the configuration information is obtained from the project configuration file, which facilitates the user to visually manage the dependency package, has low management costs, and can greatly improve management efficiency.

[0129] Figure 4 A schematic diagram of the structure of a dependency package management device provided by an embodiment of the present invention, wherein the device is used to execute the dependency package management method described above, such as Figure 4 As shown, the device includes: a first generating module 11, a second generating module 12 and a display module 13.

[0130] The first generating module 11 is used to match the project configuration file with the project package list and the specified code file respectively, and generate a dependency package matching result.

[0131] The second generating module 12 is used to generate a management interface corresponding to each dependent package according to the multiple dependent packages in the project package list.

[0132] The first display module 13 is used to visually display the management interface, dependency package matching results and configuration information of the dependency package to receive executable operations input by the user, wherein the configuration information is obtained from the project configuration file.

[0133] In the embodiment of the present invention, the second generating module 12 is specifically configured to generate a management interface corresponding to each dependent package according to multiple dependent packages in the project package list through the package management library interface.

[0134] In the embodiment of the present invention, the first generating module 11 specifically includes a first generating submodule 111 , a second generating submodule 112 and a third generating submodule 113 .

[0135] The first generating submodule 111 is used to match the dependency packages in the dependency tree with the configuration information of the dependency packages to generate a dependency package configuration result.

[0136] The second generating submodule 112 is used to match the configuration information of the dependency package with the dependency package called by the specified code file to generate a dependency package calling result.

[0137] The third generating submodule 113 is used to generate a dependency package matching result according to the dependency package configuration result and the dependency package calling result.

[0138] In an embodiment of the present invention, the first generation submodule 111 is specifically used to match the configuration information with the dependency package of the dependency tree. If the dependency package of the dependency tree is included in the configuration information, the dependency package configuration result corresponding to the dependency package of the dependency tree is determined to be configured; if the dependency package of the dependency tree is not included in the configuration information, the dependency package configuration result corresponding to the dependency package of the dependency tree is determined to be unconfigured.

[0139] In an embodiment of the present invention, the second generation module 112 is specifically used to match the dependency package called by the specified code file with the configuration information. If the dependency package called by the specified code file is included in the configuration information, the dependency package call result corresponding to the dependency package called by the specified code file is determined to be called; if the dependency package called by the specified code file is not included in the configuration information, the dependency package call result corresponding to the dependency package called by the specified code file is determined to be not called.

[0140] In the embodiment of the present invention, the device further includes a first query module 14 , a determination module 15 and a second query module 16 .

[0141] The first query module 14 is configured to query a code file corresponding to a code path upon receiving a code path input by a user.

[0142] The determination module 15 is configured to search for a code file of a specified format from the code file, and determine the searched code file of the specified format as the specified code file.

[0143] The second query module 16 is configured to query a code file of a specified format from a preset default file if the code path input by the user is not received, and determine the queryed code file of the specified format as the specified code file.

[0144] In an embodiment of the present invention, the second generation module 12 is specifically used to obtain the version information of the dependent package through the package management library interface, and the version information includes the current version and the latest version; if the current version of the dependent package is different from the latest version, the upgrade interface, downgrade interface and deletion interface corresponding to the dependent package are generated; if the current version of the dependent package is the same as the latest version, the downgrade interface and deletion interface corresponding to the dependent package are generated.

[0145] In the embodiment of the present invention, the device further includes a receiving module 17, a second display module 18, a third display module 19, a third generating module 20 and a deleting module 21

[0146] The receiving module 17 is used to receive a management operation input by a user through a management interface; and receive a deletion confirmation message input by a user.

[0147] The second display module 18 is configured to display an upgrade version list in response to the upgrade operation if the management interface is an upgrade interface and the management operation is an upgrade operation. The upgrade version list includes at least one upgradeable version.

[0148] The third display module 19 is configured to display a downgraded version list in response to the downgrade operation if the management interface is a downgraded interface and the management operation is a downgrade operation, the downgraded version list including at least one downgradable version.

[0149] The third generating module 20 is configured to generate a deletion prompt message and visually display the deletion prompt message in response to the deletion operation if the management interface is a deletion interface and the management operation is a deletion operation.

[0150] The deletion module 21 is configured to delete the dependent package corresponding to the deletion operation in response to the deletion confirmation message.

[0151] In the embodiment of the present invention, the device further includes: a judgment module 22 and a fourth generation module 23 .

[0152] The judging module 22 is used to judge whether the dependent package names in the calling package list include the dependent package name of the dependent package corresponding to the deletion operation, wherein the calling package list is obtained from the specified code file.

[0153] The fourth generating module 23 is used to generate a risk warning message if the dependent package name in the calling package list includes the dependent package name of the dependent package corresponding to the deletion operation, and visually display the risk warning message for the user to confirm the risk warning message.

[0154] In the solution of the embodiment of the present invention, the project configuration file is matched with the project package list and the specified code file respectively to generate a dependency package matching result; based on the multiple dependency packages under the project package list, a management interface corresponding to each dependency package is generated; the management interface, the dependency package matching result and the configuration information of the dependency package are visually displayed to receive executable operations input by the user, wherein the configuration information is obtained from the project configuration file, which facilitates the user to visually manage the dependency packages, has low management costs, and can greatly improve management efficiency.

[0155] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer device. Specifically, the computer device may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0156] An embodiment of the present invention provides a computer device including a memory and a processor, wherein the memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions. When the program instructions are loaded and executed by the processor, the steps of the embodiment of the above-mentioned dependency package management method are implemented. For a specific description, please refer to the embodiment of the above-mentioned dependency package management method.

[0157] Reference below Figure 5 , which shows a structural diagram of a computer device 600 suitable for implementing an embodiment of the present application.

[0158] like Figure 5 As shown, the computer device 600 includes a central processing unit (CPU) 601, which can perform various appropriate tasks and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage portion 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the computer device 600 are also stored in the RAM 603. The CPU 601, ROM 602, and 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.

[0159] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, and the like; an output section 607 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 608 including devices such as a hard disk; and a communication section 609 including a network interface card such as a LAN card or a modem. 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 606 as needed. Removable media 611, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 610 as needed, so that computer programs read therefrom can be installed in the storage section 608 as needed.

[0160] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program including program code for executing the methods illustrated in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication portion 609 and / or installed from removable media 611.

[0161] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0162] For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing this application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0163] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0164] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0165] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0166] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0167] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0168] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0169] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.

[0170] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.

Claims

1. A dependency package management method, characterized in that: The method comprises: Match the project configuration file with the project package list and the specified code file respectively to generate the dependency package matching result; Generate a management interface corresponding to each dependent package according to the multiple dependent packages under the project package list; Visually displaying the management interface, the dependency package matching result, and the configuration information of the dependency package to receive management operations input by a user, wherein the configuration information is obtained from the project configuration file; The project package list includes a dependency tree, and the dependency tree includes dependency relationships between multiple dependency packages; the project configuration file includes configuration information of each dependency package in the dependency tree, and the configuration information of the dependency package includes the occupied capacity. The dependency tree includes a dependency package and a sub-dependency package that depends on the dependency package, and the dependency tree indicates the dependency relationship between the dependency package and its sub-dependency package; The project configuration file is matched with the project package list and the specified code file respectively to generate a dependency package matching result, including: Matching the dependency packages in the dependency tree with the configuration information of the dependency packages to generate a dependency package configuration result; Matching the configuration information of the dependency package with the dependency package called by the specified code file to generate a dependency package calling result; The dependency package matching result is generated according to the dependency package configuration result and the dependency package calling result.

2. The dependency package management method according to claim 1, characterized in that: The step of generating a management interface corresponding to each dependent package according to the multiple dependent packages in the project package list includes: Through the package management library interface, a management interface corresponding to each dependent package is generated according to the multiple dependent packages under the project package list.

3. The dependency package management method according to claim 1, characterized in that: The step of matching the dependency package in the dependency tree with the configuration information of the dependency package to generate a dependency package configuration result includes: Matching the configuration information with the dependency package of the dependency tree, and if the dependency package of the dependency tree is included in the configuration information, determining the dependency package configuration result corresponding to the dependency package of the dependency tree as configured; If the dependency package of the dependency tree is not included in the configuration information, the dependency package configuration result corresponding to the dependency package of the dependency tree is determined to be unconfigured.

4. The dependency package management method according to claim 1, characterized in that: The step of matching the configuration information of the dependency package with the dependency package called by the specified code file to generate a dependency package calling result includes: Matching the dependent package called by the specified code file with the configuration information, and if the dependent package called by the specified code file is included in the configuration information, determining the dependent package calling result corresponding to the dependent package called by the specified code file as having been called; If the dependent package called by the designated code file is not included in the configuration information, the dependent package calling result corresponding to the dependent package called by the designated code file is determined as not called.

5. The dependency package management method according to claim 1, characterized in that: Before matching the project configuration file with the project package list and the specified code file to generate the dependency package matching result, the process further includes: If a code path input by the user is received, the code file corresponding to the code path is queried; Querying a code file of a specified format from the code file, and determining the queried code file of the specified format as the specified code file; If the code path input by the user is not received, a code file of a specified format is queried from a preset default file, and the queried code file of the specified format is determined as the specified code file.

6. The dependency package management method according to claim 2, characterized in that: The management interface includes one of an upgrade interface, a downgrade interface and a delete interface or any combination thereof; The package management library interface generates a management interface corresponding to each dependent package according to the multiple dependent packages under the project package list, including: Obtaining version information of the dependent package through the package management library interface, wherein the version information includes the current version and the latest version; If the current version of the dependent package is different from the latest version, generate an upgrade interface, a downgrade interface, and a deletion interface corresponding to the dependent package; If the current version of the dependent package is the same as the latest version, a downgrade interface and a deletion interface corresponding to the dependent package are generated.

7. The dependency package management method according to claim 1, characterized in that: After visually displaying the management interface, the dependency package matching result, and the configuration information of the dependency package to receive a management operation input by a user, the method further includes: Receiving a management operation input by a user through the management interface; If the management interface is an upgrade interface and the management operation is an upgrade operation, in response to the upgrade operation, an upgrade version list is displayed, and the upgrade version list includes at least one upgradeable version; If the management interface is a downgrade interface and the management operation is a downgrade operation, in response to the downgrade operation, a downgrade version list is displayed, wherein the downgrade version list includes at least one downgradable version; If the management interface is a deletion interface and the management operation is a deletion operation, in response to the deletion operation, a deletion prompt message is generated and the deletion prompt message is visually displayed; Receive the deletion confirmation message input by the user; In response to the deletion confirmation message, the dependent package corresponding to the deletion operation is deleted.

8. The dependency package management method according to claim 7, characterized in that: Before generating a deletion prompt message in response to the deletion operation and visually displaying the deletion prompt message, the method further includes: Determine whether the dependent package name in the calling package list includes the dependent package name of the dependent package corresponding to the deletion operation, wherein the calling package list is obtained from the specified code file; If the dependent package name of the calling package list includes the dependent package name of the dependent package corresponding to the deletion operation, a risk warning message is generated and the risk warning message is visually displayed for the user to confirm the risk warning message.

9. A dependency package management device, characterized in that: The device comprises: The first generation module is used to match the project configuration file with the project package list and the specified code file respectively to generate a dependency package matching result; A second generating module is used to generate a management interface corresponding to each dependent package according to the multiple dependent packages under the project package list; A display module, used to visually display the management interface, the dependency package matching result and the configuration information of the dependency package to receive management operations input by a user, wherein the configuration information is obtained from the project configuration file; The project package list includes a dependency tree, and the dependency tree includes dependency relationships between multiple dependency packages; the project configuration file includes configuration information of each dependency package in the dependency tree, and the configuration information of the dependency package includes the occupied capacity. The dependency tree includes a dependency package and a sub-dependency package that depends on the dependency package, and the dependency tree indicates the dependency relationship between the dependency package and its sub-dependency package; The first generation module is specifically used to match the dependency package in the dependency tree with the configuration information of the dependency package to generate a dependency package configuration result; match the configuration information of the dependency package with the dependency package called by the specified code file to generate a dependency package calling result; and generate the dependency package matching result based on the dependency package configuration result and the dependency package calling result.

10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the dependent package management method as described in any one of claims 1 to 8 is implemented.

11. A computer device comprising a memory and a processor, wherein the memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions, characterized in that: When the program instructions are loaded and executed by the processor, the dependent package management method described in any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Dependent package version management method and device, equipment and storage medium

    CN111522577A