Software package installation method and software package installation device

By building a software package index tree and dependency database, quickly querying and parsing software package dependencies, the problem of low package installation efficiency in the existing technology is solved, and a more efficient software package installation process is achieved.

CN120215967AActive Publication Date: 2025-06-27CHINA TELECOM CLOUD TECH CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202510375922.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-27
Publication Date
2025-06-27
Estimated Expiration
2045-03-27

AI Technical Summary

Technical Problem

In the prior art, there is a large amount of software package attribute information in the software warehouse, resulting in low software package installation efficiency.

Method used

By building a software package index tree and dependency relation database, the software package attribute information and dependency relation data are stored using key-value storage characteristics, and the attribute information of the software package to be installed quickly and determine its dependency package list, thereby performing the software package installation steps.

Benefits of technology

Improves the efficiency of software package installation, reduces duplicate queries to the database, and improves the speed and flexibility of dependency parsing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120215967A_ABST
    Figure CN120215967A_ABST
Patent Text Reader

Abstract

The invention relates to a software package installation method and a software package installation device. The method comprises the steps of obtaining attribute information of a to-be-installed software package based on a software package installation request input in a software package management tool, and then querying the attribute information of the to-be-installed software package in a software package index tree; then, under the condition that the attribute information of the to-be-installed software package exists in the software package index tree, determining a dependency software package list of the to-be-installed software package from the dependency relationship database; and finally, based on the dependent software package list, executing the installation step of the to-be-installed software. Wherein leaf nodes of the software package index tree are attribute information of a plurality of software packages; key value pairs based on the software packages are stored in the dependency database; the key value pair of each software package comprises attribute information of the software package and a dependent data package list. By adopting the method, the software package installation efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of software management, and particularly to a software package installation method and a software package installation device. Background Art

[0002] With the rapid development of technology, the types of software are becoming increasingly rich. In this context, software package management tools are usually used to implement management such as software package installation, upgrade, deletion, and uninstallation on terminals.

[0003] In the related art, the attribute information of software packages supported by a terminal is pre-obtained through a software package management tool, and a software repository is built based on the obtained attribute information of these software packages. When a software package installation request is detected in the software package management tool, the attribute information of the software to be installed is queried from the software repository, and the software package installation package corresponding to the software to be installed is downloaded from the source database, and the software package installation package is parsed to complete the software package installation.

[0004] However, there is a large amount of attribute information of software packages in the software repository in the related art, resulting in low software package installation efficiency. Summary of the Invention

[0005] Based on this, it is necessary to provide a software package installation method and a software package installation device that can reduce the cache burden of the local database and thus improve the software package installation efficiency for the above technical problems.

[0006] In a first aspect, this application provides a software package installation method, which is applied to a terminal device. The terminal device is deployed with a software package management tool. The method includes:

[0007] In response to a software package installation request input in the software package management tool, obtain the attribute information of the software package to be installed;

[0008] Query the attribute information of the software package to be installed in the software package index tree; the leaf nodes of the software package index tree are the attribute information of multiple software packages;

[0009] When the attribute information of the software package to be installed exists in the software package index tree, determine the list of dependent software packages of the software package to be installed from the dependency database; the dependency database stores key-value pairs based on each software package; the key-value pair of each software package includes the attribute information of the software package and the list of dependent data packets;

[0010] Based on the list of dependent software packages, execute the installation steps of the software to be installed.

[0011] In one of the embodiments, obtaining the attribute information of the software package to be installed based on a software package installation request input in the software package management tool includes:

[0012] Based on the software package installation request input in the software package management tool, obtain the installation information of the software package to be installed; the installation information includes the name of the software package to be installed and / or the software package identifier;

[0013] Based on the installation information, determine the identifier of the software package to be installed and the version number of the software package to be installed from the preset mapping table; the preset mapping table includes the correspondence between the name, identifier, and version number of each software package;

[0014] Combine the identifier of the software package to be installed and the version number of the software package to be installed to obtain the attribute information of the software package to be installed.

[0015] In one embodiment, based on the list of dependent software packages, perform the installation steps of the software to be installed, including:

[0016] Obtain the set of downloaded software packages of the terminal device;

[0017] If the set of downloaded software packages includes each dependent software package in the list of dependent software packages, pull the software package to be installed from the source database and download the software package to be installed;

[0018] Otherwise, compare the set of downloaded software packages with the list of dependent software packages to determine the missing dependent software packages in the set of downloaded software packages, and display the installation information of each dependent software package; the installation information is used to indicate the installation of each dependent software package to complete the software package installation.

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

[0020] For any dependent software package, in response to the dependent package installation request for the dependent software package, parse the dependent package installation request;

[0021] In the case where the identifier of the dependent software package exists in the dependent package installation request and the version number of the dependent software package does not exist, determine multiple candidate dependent software packages that match the identifier of the dependent software package from the source database;

[0022] Determine the dependent software package with the latest version or the highest usage frequency among the multiple candidate dependent software packages as the dependent software package corresponding to the dependent package installation request.

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

[0024] In response to the trigger request for the software package management tool, obtain the identifier, version number, and list of dependent data packages of each software package;

[0025] Combine the identifier and version number corresponding to the same software package to obtain the key of each software package; and use the dependent data package of each software package as the value of each software package;

[0026] Construct a software package index tree according to the keys of each software package; and construct a dependency database according to the keys and values of each software package.

[0027] In one embodiment, constructing a software package index tree according to the keys of each software package includes:

[0028] Determine the keys of each software package as the attribute information of each software package;

[0029] Use the attribute information of each software package as leaf nodes, and create a software package index tree based on preset index node creation conditions.

[0030] In one embodiment, constructing a dependency database according to the keys and values of each software package includes:

[0031] Combine the keys and values corresponding to the same software package to obtain key-value pairs of each software package;

[0032] Store the key-value pairs of each software package into a preset hash table to obtain a dependency database.

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

[0034] In response to an update request for the dependency database, obtain the software package update timestamp of the source database;

[0035] Judge whether the dependency database needs to be updated by comparing the software package update timestamp and the software package acquisition timestamp of the dependency database;

[0036] If an update is needed, compare the content in the dependency database with the content in the source database to obtain the update content, and update the dependency database according to the update content.

[0037] In one embodiment, updating the dependency database according to the update content includes:

[0038] During the update process of the dependency database, obtain the storage capacity and the number of storage entries of the dependency database;

[0039] If the storage capacity reaches the preset capacity threshold, and / or the number of storage entries reaches the preset quantity threshold, delete the key-value pairs determined to be the farthest from the current moment one by one from the dependency database according to the information pulling time of each key-value pair in the dependency database until the preset capacity threshold and / or the preset quantity threshold are met.

[0040] In a second aspect, the present application also provides a software package installation device, including:

[0041] An acquisition module, configured to acquire attribute information of a software package to be installed in response to a software package installation request input in a software package management tool;

[0042] A query module, configured to query the attribute information of the software package to be installed in a software package index tree; the leaf nodes of the software package index tree are the attribute information of multiple software packages;

[0043] A determination module, configured to determine a list of dependent software packages of the software package to be installed from a dependency database when the attribute information of the software package to be installed exists in the software package index tree; the dependency database stores key-value pairs based on each software package; the key-value pair of each software package includes the attribute information of the software package and a list of dependent data packages;

[0044] An installation module, configured to execute the installation steps of the software to be installed based on the list of dependent software packages.

[0045] In a third aspect, the present application further provides a computer device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the steps of the method in any one of the embodiments in the first aspect are implemented.

[0046] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method in any one of the embodiments in the first aspect are implemented.

[0047] In a fifth aspect, the present application further provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of the method in any one of the embodiments in the first aspect are implemented.

[0048] The above software package installation method and software package installation device obtain the attribute information of the software package to be installed based on the software package installation request input into the software package management tool, and then query the attribute information of the software package to be installed in the software package index tree; then, in the case where the attribute information of the software package to be installed exists in the software package index tree, determine the list of dependent software packages of the software package to be installed from the dependency database; finally, based on the list of dependent software packages, execute the installation steps of the software to be installed. Among them, the leaf nodes of the software package index tree are the attribute information of multiple software packages; the dependency database stores key-value pairs based on each software package; the key-value pair of each software package includes the attribute information of the software package and the list of dependent data packages. In this method, the software package index tree constructed based on the attribute information of each software package hierarchically stores the attribute information of each software package to support querying the index tree of the software package to be installed layer by layer from top to bottom in the software package index tree, avoiding repeated retrieval, improving the retrieval efficiency of the software package to be installed, and thus quickly and accurately obtaining the query result. Further, in the case where the query result is that the attribute information of the software package to be installed exists in the software package index tree, according to the attribute information of the software package to be installed, determine the list of dependent software packages of the software package to be installed from the dependency database. Since the attribute information of each software package and the list of dependent data packages in the dependency database are stored in the data structure of key-value pairs, the attribute information of the software package to be installed is equivalent to the key of the software package to be installed. In this case, the list of dependent software packages of the software package to be installed can be quickly determined from the dependency database based on the key of the software package to be installed, and the software package can be installed according to the list of dependent software packages of the software package to be installed, improving the software package installation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments of the present application or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.

[0050] Figure 1 It is an application environment diagram of the software package installation method in an embodiment;

[0051] Figure 2 It is a flowchart of the software package installation method in an embodiment;

[0052] Figure 3 It is a flowchart of the software package installation information acquisition step in an embodiment;

[0053] Figure 4 It is a flowchart of the software package installation method in another embodiment;

[0054] Figure 5 It is a schematic flowchart of the software package acquisition step in an embodiment;

[0055] Figure 6 It is a schematic flowchart of the database construction step in an embodiment;

[0056] Figure 7 It is a schematic flowchart of the database update step in an embodiment;

[0057] Figure 8 It is a structural block diagram of the software package installation device in an embodiment;

[0058] Figure 9 It is an internal structure diagram of a computer device in an embodiment. Specific embodiments

[0059] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0060] The software package installation method provided by the embodiments of the present application can be applied to an application environment as Figure 1 shown. Among them, the terminal device 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process, such as a large number of software packages supported by the operating system corresponding to the terminal device 102. The data storage system can be integrated on the server 104, or placed in the cloud or other network servers. Among them, the terminal device 102 can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, projection devices, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The server 104 can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0061] In the field of Internet technology, a software package is a collection that packages software and its dependencies, configuration files, and other related files together, enabling the software to be easily distributed and installed. In this context, software package management tools are usually used to implement management such as software package installation, upgrade, deletion, and uninstallation.

[0062] Software package management tools in the related art usually rely on a centralized software repository to retrieve the metadata and dependencies of software packages to be processed. Among them, software package dependency resolution is a key step in software package management. This step usually requires checking all relevant software packages in the software repository to determine all dependent packages required to install or update a software package to ensure that all dependencies are satisfied.

[0063] However, there is a vast amount of attribute information of software packages in the software repositories in the related art, resulting in low software package installation efficiency. In addition, the following problems may exist in the prior art: (1) Performance bottleneck. When dealing with a large number of software packages or complex dependencies, performance bottlenecks may be encountered, resulting in slow dependency resolution speed. (2) Insufficient concurrent processing ability: Many existing systems perform poorly in a concurrent environment, especially when multiple users or multiple processes perform software package management operations simultaneously. (3) Repeated parsing: Without an effective caching mechanism, software package management tools may repeatedly parse the same dependency relationships, wasting computing resources. (4) Data consistency problems: In concurrent operations, data inconsistencies may occur, leading to repeated execution of transactions, especially when dependency relationships are updated. (5) Low resource utilization efficiency. Existing dependency resolution methods may not fully utilize the multi-core and high-speed storage characteristics of modern computer hardware.

[0064] Based on the above problems, the present application provides a software package installation method. By using the key-value storage feature to store the attribute information of software packages and the dependency package relationship data, a composite index is constructed for the software package name and version number to improve the retrieval efficiency of dependency data; a dependency relationship cache index tree is designed to store the attribute information of each software package to reduce repeated queries to the database and improve the efficiency of dependency resolution; according to the actual installation and update conditions of software packages, the dependency resolution strategy is dynamically adjusted to improve the flexibility and adaptability of dependency resolution, cope with the dynamic changes of software package dependency relationships, further optimize the resolution speed, and reduce unnecessary computing and storage overhead.

[0065] The technical solution of the present application and how the technical solution of the present application solves the above technical problems will be described in detail below with specific embodiments. These specific embodiments below can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.

[0066] In an exemplary embodiment, as Figure 2 shown, a software package installation method is provided, which is applied to a terminal device. The terminal device is deployed with a software package management tool, and the method includes:

[0067] S201, in response to a software package installation request input in the software package management tool, obtain the attribute information of the software package to be installed.

[0068] Among them, the software package management tool refers to a tool for installing, updating, deleting, and managing software packages. In actual application scenarios, the software package management tool is deployed on the terminal device, and by displaying a command-line interface on the terminal device interface, it provides detailed package management functions.

[0069] Enter the installation information of the software package in the command-line interface corresponding to the software package management tool to trigger a software package installation request. Based on the software package installation request, determine the attribute information of the software package to be installed. The attribute information refers to the index information required to describe the installation of the software package, which is used to uniquely identify the software package to be installed. For example, it is a composite index obtained by combining the identification ID and version number of the software package to be installed.

[0070] Taking the combined information of the identification ID and version number as the attribute information as an example, the software package installation request can carry the identification ID of the software package to be installed. In this case, determine the latest version number of the software package to be installed according to the identification ID, and combine the identification ID and the latest version number to obtain the attribute information of the software package to be installed.

[0071] In another implementation scenario, the software package installation request carries the attribute information of the software package to be installed. In this case, the software package installation request can be directly parsed to obtain the attribute information of the software package to be installed.

[0072] S202, query the attribute information of the software package to be installed in the software package index tree; the leaf nodes of the software package index tree are the attribute information of multiple software packages.

[0073] Among them, the software package index tree refers to a tree-like structure with multiple branches, including at least one non-leaf node (root node and intermediate node) and one leaf node layer from top to bottom, such as a B+ tree, a binary tree, etc. The multiple software packages refer to the set of software packages supported by the operating system of the terminal device. In the embodiments of the present application, the number of leaf nodes in the software package index tree is the same as the number of software packages, and each leaf node stores the attribute information of a software package. The root node and intermediate nodes both store the child node pointers corresponding to their own nodes for indexing the lower-level nodes.

[0074] Based on the tree-like structure of the software package index tree, search from top to bottom until reaching the bottom layer of the software package index tree, that is, the leaf node layer, and determine whether there is a leaf node corresponding to the attribute information of the software package to be installed.

[0075] S203. When there is attribute information of the software package to be installed in the software package index tree, determine the list of dependent software packages of the software package to be installed from the dependency database; the dependency database stores key-value pairs based on each software package; the key-value pair of each software package includes the attribute information of the software package and the list of dependent data packages.

[0076] Among them, the dependency database refers to a cached database stored locally, which stores key-value pairs constructed based on the attribute information of each software package and the list of dependent data packages. Each group of key-value pairs includes the key (attribute information) of the software package and the value (list of dependent software packages) of the software package. The list of dependent software packages is a combination of the identification IDs of multiple dependent software packages.

[0077] The attribute information of the software package to be installed is used to uniquely identify the software package to be installed, and the attribute information of the software package to be installed is in the same format as the attribute information of the software packages represented by each leaf node in the software package index tree. For example, if the leaf node stores a combination of the identification ID and version number of the software package, then the attribute information of the software package to be installed includes a combination of the identification ID and version number of the software package to be installed.

[0078] If there is attribute information of the software package to be installed in the software package index tree, it means that the current environment meets the conditions for downloading and installing the software. Then, retrieve the key-value pair that matches the attribute information of the software package to be installed from the dependency database, and then use the list of dependent data packages in the key-value pair as the list of dependent software packages of the software package to be installed.

[0079] If there is no attribute information of the software package to be installed in the software package index tree, it means that the current environment does not meet the conditions for downloading and installing the software. Then, generate an indication information that the current environment does not support the software package to be installed.

[0080] S204. Based on the list of dependent software packages, execute the installation steps of the software package to be installed.

[0081] Obtaining the list of dependent software packages usually includes multiple dependent software packages. Query the attribute information of each dependent software package from the software package index tree. If the software package index tree includes the attribute information of each dependent software package and it is determined that the current environment supports the download and installation of the software package to be installed, then pull and download the software package to be installed and each dependent software package from the source database; otherwise, if there is no attribute information of at least one dependent software package in the software package index tree, then generate an indication information that the current environment does not support the software package to be installed.

[0082] In the embodiment of the present application, based on the software package installation request input in the software package management tool, the attribute information of the software package to be installed is obtained, and then the attribute information of the software package to be installed is queried in the software package index tree; then, in the case where the attribute information of the software package to be installed exists in the software package index tree, the list of dependent software packages of the software package to be installed is determined from the dependency database; finally, based on the list of dependent software packages, the installation steps of the software package to be installed are executed. Among them, the leaf nodes of the software package index tree are the attribute information of multiple software packages; the dependency database stores key-value pairs based on each software package; the key-value pair of each software package includes the attribute information of the software package and the list of dependent data packages. In this method, the software package index tree constructed based on the attribute information of each software package hierarchically stores the attribute information of each software package to support querying the index tree of the software package to be installed layer by layer from top to bottom in the software package index tree, avoiding repeated retrieval, improving the retrieval efficiency of the software package to be installed, and thus quickly and accurately obtaining the query result. Further, in the case where the query result is that the attribute information of the software package to be installed exists in the software package index tree, according to the attribute information of the software package to be installed, the list of dependent software packages of the software package to be installed is determined from the dependency database. Since the attribute information of each software package and the list of dependent data packages in the dependency database are stored in the data structure of key-value pairs, the attribute information of the software package to be installed is equivalent to the key of the software package to be installed. In this case, the list of dependent software packages of the software package to be installed can be quickly determined from the dependency database based on the key of the software package to be installed, and the software package is installed according to the list of dependent software packages of the software package to be installed, improving the software package installation efficiency.

[0083] In an exemplary embodiment, a realizable method for the foregoing step S201, "Based on the software package installation request input in the software package management tool, obtain the attribute information of the software package to be installed", is provided, as Figure 3 shown, including the following steps:

[0084] S301, based on the software package installation request input in the software package management tool, obtain the installation information of the software package to be installed; the installation information includes the name of the software package to be installed, and / or, the software package identifier.

[0085] Among them, the software package installation request carries the name of the software package to be installed, and / or, the software package identifier. Parse the software package installation request to extract the name of the installed software package of the software package to be installed, and / or, the software package identifier.

[0086] In an actual application scenario, the software package installation request may also carry other description information of the software package to be installed, such as the version number. For example, the software package installation request carries the software name and version number, or carries the software package identifier and version number, or carries the name, identifier and version number to be installed.

[0087] S302. Determine the identifier of the software package to be installed and the version number of the software package to be installed from a preset mapping table based on the installation information; the preset mapping table includes the correspondence between the name, identifier, and version number of each software package.

[0088] The preset mapping table is cached locally. The preset mapping table includes multiple mapping entries, and each mapping entry includes the software package name, identifier, and version number. Then, in the case of determining the name of the software to be installed and / or the software package identifier, the mapping relationship matching the installation information can be directly determined from the preset mapping table, and then the identifier of the software package to be installed and the version number of the software package to be installed can be obtained.

[0089] S303. Combine the identifier of the software package to be installed and the version number of the software package to be installed to obtain the attribute information of the software package to be installed.

[0090] Combine the identifier of the software package to be installed and the version number of the software package to be installed to obtain the composite index key of the software package to be installed, that is, the attribute information of the software package to be installed.

[0091] In the embodiments of the present application, the correspondence between the name, identifier, and version number of each software package is used as a mapping relationship, and multiple mapping relationships corresponding to each software package are pre-stored in the mapping table, so as to quickly query the mapping relationship of the software package to be installed from the mapping table according to the name or identifier of the software package to be installed, obtain the identifier and version number of the software package to be installed, and combine the two to obtain the attribute information of the software package to be installed, ensuring the uniqueness and accuracy of the attribute information of the software package to be installed.

[0092] In an exemplary embodiment, a realizable manner of the foregoing step S204 "Execute the installation step of the software to be installed based on the list of dependent software packages" is provided, as Figure 4 shown, including the following steps:

[0093] S401. Obtain the set of downloaded software packages of the terminal device.

[0094] The set of downloaded software packages includes the attribute information of the software packages already installed on the terminal device. The terminal device can dynamically maintain a set of downloaded software packages, and for each downloaded software package, store the attribute information of the downloaded software package in the set of downloaded software packages.

[0095] Optionally, it is also possible to obtain the downloaded software packages that have been installed on the terminal device from the local cache database, and summarize the attribute information of each downloaded software package to obtain the set of downloaded software packages.

[0096] S402, if all the dependent packages in the dependent package list are included in the downloaded package set, pull the package to be installed from the source database and download the package to be installed.

[0097] Compare the downloaded package set with the dependent package list to determine whether the packages in the downloaded package set completely cover all the dependent packages in the dependent package list. If so, pull the metadata of the package to be installed from the source database, and download and install the pulled package locally.

[0098] S403, otherwise, compare the downloaded package set with the dependent package list to determine the missing dependent packages in the downloaded package set, and display the installation information of each dependent package; the installation information is used to indicate the installation of each dependent package to complete the package installation.

[0099] If the packages in the downloaded package set do not completely cover all the dependent packages in the dependent package list, determine the dependent packages that are in the dependent package list but not in the downloaded package set as the missing dependent packages, and display the installation information of the missing dependent packages on the visual editing interface of the terminal device. Further, if a continue installation instruction for the installation information of each missing dependent package is received, pull each dependent package and the package to be installed from the source database, and download the pulled missing dependent packages and the package to be installed to the local of the terminal device in sequence. On the contrary, if a stop installation instruction for the installation information of the missing dependent package is received, abort the package installation process, and there is no need to pull the dependent package from the source database.

[0100] Optionally, display the installation information of each missing dependent package in batches, which is used to indicate the batch installation of each dependent software to complete the package installation, or display the installation information of each dependent package one by one, which is used to indicate the individual installation of each dependent software to complete the package installation.

[0101] In the embodiment of the present application, the downloaded package set is compared with the dependent package list. When the downloaded package set does not cover all the dependent packages of the package to be installed, determine the missing dependent packages required for installing the package, so as to indicate the installation of each missing dependent package to complete the package installation. This is equivalent to showing the underlying installation management logic of the package installation to the user of the terminal device, providing a choice space for whether to install the package, and improving the package installation experience.

[0102] Next, a feasible implementation method for pulling the missing dependent packages in the case where the dependent packages in the dependent package list are not covered by the downloaded package set will be described. In an exemplary embodiment, as Figure 5 shown, the method includes the following steps:

[0103] S501. For any dependent software package, in response to a dependent package installation request for the dependent software package, parse the dependent package installation request.

[0104] It should be emphasized that the dependent package installation request carries the identifier of the dependent software package. However, for a dependent software package with the same identifier, there can be multiple versions, which means that only based on the identifier of the dependent software package, the specific dependent software package cannot be determined. Based on this, in the embodiments of the present application, the dependent package installation request is parsed to determine the version field in the dependent package installation request, and then the field content corresponding to the version field, that is, the version number of the dependent software package, is determined.

[0105] S502. In the case where the identifier of the dependent software package exists in the dependent package installation request and the version number of the dependent software package does not exist, determine multiple candidate dependent software packages that match the identifier of the dependent software package from the source database.

[0106] If the version number of the dependent software package does not exist in the dependent package installation request, then according to the identifier of the dependent software package, determine multiple candidate dependent software packages that match the identifier from the source database, and then according to the preset pulling strategy, determine the dependent software package corresponding to the dependent package installation request from the multiple candidate dependent software packages.

[0107] S503. Determine the dependent software package with the latest version or the highest usage frequency among the multiple candidate dependent software packages as the dependent software package corresponding to the dependent package installation request.

[0108] Optionally, if the determination strategy of the dependent software package is the latest version, then compare the version numbers of each candidate dependent software package to determine the candidate dependent software package with the latest version as the dependent software package corresponding to the dependent package installation request.

[0109] Optionally, if the determination strategy of the dependent software package is the highest usage frequency, then compare the usage frequencies of each candidate dependent software package to determine the candidate dependent software package with the highest usage frequency as the dependent software package corresponding to the dependent package installation request.

[0110] In the case where the identifier and version number of the dependent software package exist in the dependent package installation request, directly determine the dependent software package from the source database according to the identifier and version package of the dependent software package.

[0111] In the embodiments of the present application, in the case where there is an identifier of a dependent software package in the dependent package installation request and there is no version number of the dependent software package, first, a determination range of the dependent software package is preliminarily screened according to the identifier of the dependent software package, and then, according to a preset determination strategy, the dependent software package corresponding to the dependent package installation request is accurately determined from the determination range. The determination basis is clear and reliable, which can improve the rationality of the finally determined dependent software package to a certain extent.

[0112] It should be noted that the installation process of the software package is carried out on the basis of having a software package index tree and a dependency database cached locally. The foregoing embodiments have described the installation process of the software package. Next, the construction processes of the software package index tree and the dependency database used when installing the software package will be described.

[0113] In an exemplary embodiment, as Figure 6 shown, the method further includes the following steps:

[0114] S601, in response to a trigger request for the software package management tool, obtain the identifier, version number, and dependent data packet list of each software package.

[0115] The source database includes each software package supported by the operating system corresponding to the terminal device, and the software packages are upgraded irregularly. In response to a trigger request for the software package management tool, pull the identifier, version number, and dependent data packet list of each software package from the source database.

[0116] S602, combine the identifier and version number corresponding to the same software package to obtain the key of each software package; and use the dependent data packets of each software package as the value of each software package.

[0117] For any software package, combine the identifier and version number corresponding to the software package to obtain the key of the software package, and combine the identifier IDs of the dependent software packages of the software package to obtain the value of the software package.

[0118] S603, construct a software package index tree according to the keys of each software package; and construct a dependency database according to the keys and values of each software package.

[0119] For any software package, the key of the software package includes the software package identifier and the software package version number, and the expression form is in digital form. The value of the software package includes the identifier of the dependent software package of the software package, and the expression form is also in digital form.

[0120] When constructing a software package index tree, it is possible to select the keys of each software package as leaf nodes, group the software packages of different versions corresponding to the same software package identifier into a group, group each leaf node, determine the upper-level nodes corresponding to each leaf node, and then construct a software package index tree based on the reference relationship between the upper-level nodes and the leaf nodes.

[0121] Exemplarily, constructing a software package index tree according to the keys of each software package includes: determining the keys of each software package as the attribute information of each software package; using the attribute information of each software package as leaf nodes, and creating a software package index tree based on a preset index node creation condition.

[0122] The index node creation condition refers to the generation condition of the upper-level node (index node) corresponding to the leaf node, such as the number of child nodes corresponding to an index node. Based on the index node creation condition, group each leaf node to obtain the upper-level nodes corresponding to each leaf node. Then, when the upper-level nodes meet the index node creation condition, further group the upper-level nodes to determine the upper-level nodes corresponding to each upper-level node until the top-level node does not meet the index node creation condition, thus obtaining a software package index tree.

[0123] Taking the number of child nodes corresponding to an index node being 8 as an example, if the number of leaf nodes is 80, then divide the 80 leaf nodes into 10 groups with a maximum of 8 leaf nodes in each group. Each group of leaf nodes corresponds to an upper-level node, that is, there are 10 upper-level nodes for the leaf nodes. At this time, since the number of upper-level nodes also meets the index node creation condition, the upper-level nodes need to be divided again. For example, divide the 10 upper-level nodes into 2 groups and construct the upper-level index nodes corresponding to each group of upper-level nodes. In this way, the software package index tree is divided into three layers. The first layer is the root node layer, including 2 root nodes (upper-level index nodes), each root node corresponding to 5 intermediate nodes. The second layer is the intermediate node layer, including 10 intermediate nodes (upper-level nodes), each intermediate node corresponding to 10 leaf nodes. The third layer is the leaf node layer, including 80 leaf nodes.

[0124] In the embodiments of the present application, using the attribute information of each software package as leaf nodes and creating a software package index tree based on a preset index node creation condition hierarchically represents the attribute information of each software package, improving the efficiency of querying the attribute information of software packages according to the software package index tree.

[0125] Exemplarily, constructing a dependency relationship database according to the keys and values of each software package includes: combining the keys and values corresponding to the same software package to obtain the key-value pairs of each software package; storing the key-value pairs of each software package into a preset hash table to obtain a dependency relationship database.

[0126] Combine the keys and values corresponding to the same software package to obtain the key-value pairs of the software package. Use the key-value pairs of the software package as a set of cache entries and store them in a preset hash table. For different software packages in the source database, loop through the above steps to obtain the dependency database.

[0127] It should be emphasized that the dependency database is constructed once when the software package management tool is triggered for the first time, and the created dependency database can be continuously updated subsequently.

[0128] In the embodiments of the present application, according to the identifier and version number corresponding to the software package, obtain the keys of each software package and construct a software package index tree to support the query of the software package to be installed; and, according to the identifier, version number, and dependent software package corresponding to the software package, construct a dependency database, so that when the software package to be installed is queried in the software package index tree, the dependent software package of the software package to be installed can be quickly obtained.

[0129] As can be seen from the foregoing embodiments, the information of the software packages stored in the source database is the basis for constructing the software package index tree and the dependency database. In practical applications, the information in the source database may be updated. In this case, it is necessary to update the synchronization of the dependency database. Then in an exemplary embodiment, as Figure 7 shown, the method further includes the following steps:

[0130] S701, in response to an update request for the dependency database, obtain the software package update timestamp of the source database.

[0131] Among them, the source database stores information of multiple software packages supported by the operating system corresponding to the terminal device. Developers of the operating system can perform update operations in the source database, such as adding software packages, deleting software packages, deleting software packages, etc. Each time the software packages in the source database are updated, record the update time and determine it as the software package update timestamp. It should be emphasized that in the embodiments of the present application, the software package update timestamp represents the update situation of the entire source database, that is, the source database corresponds to a software package update timestamp.

[0132] The update request for the dependency database can be generated by triggering the software package management tool again after the dependency database is created by triggering the software package management tool for the first time. In response to the update request for the dependency database, obtain the time when the source database updated the software packages last time to obtain the software package update timestamp.

[0133] S702, by comparing the software package update timestamp and the information acquisition timestamp of the dependency database, determine whether the dependency database needs to be updated.

[0134] The information acquisition timestamp of the dependency database refers to the time when the content of the dependency database was last changed, and the dependency database corresponds to an information acquisition timestamp.

[0135] Compare the software package update timestamp with the information acquisition timestamp of the dependency database to determine whether the software package update timestamp of the source database is later than the information acquisition timestamp of the dependency database. If so, it indicates that the source database has changed after the creation or update of the dependency database. At this time, it is determined that the dependency database needs to be updated. Otherwise, there is no need to update the dependency database.

[0136] S703, if an update is required, compare the content in the dependency database with the content in the source database to obtain the updated content, and update the dependency database according to the updated content.

[0137] Optionally, the changed content is a newly added software package in the source database, that is, the information of the newly added software package is in the source database and not in the dependency database. Obtain the attribute information and the list of dependent software packages of the newly added software package, construct key-value pairs of the newly added software package, add the key-value pairs of the newly added software package to the dependency database, update the content in the dependency database, and at the same time, use the key of the newly added software package as a leaf node and add it to the software package index tree to synchronously update the software package index tree.

[0138] Optionally, the changed content is a software package deleted from the dependency database, that is, the information of the deleted software package is not in the source database but in the dependency database. Remove the deleted software package from the dependency database, update the content in the dependency database, and at the same time, delete the leaf node corresponding to the deleted software package in the software package index tree to synchronously update the software package index tree.

[0139] In the embodiments of the present application, in response to an update request for the dependency database, when the software package update timestamp of the source database is later than the software package acquisition timestamp of the dependency database, the software package information in the dependency database is updated in a timely manner according to the changed content to ensure the consistency between the source database and the dependency database.

[0140] The dependency database is cached locally on the terminal device, and the memory space of the dependency database is usually set in advance. In this case, there may be a problem that the dependency database is full. Based on this, it is necessary to adjust the stored content in the dependency database. Then, in an exemplary embodiment, updating the dependency database according to the updated content includes:

[0141] During the update process of the dependency database, obtain the storage capacity and the number of storage entries of the dependency database; if the storage capacity reaches the preset capacity threshold, and / or the number of storage entries reaches the preset number threshold, then according to the information pulling time of each key-value pair in the dependency database, delete the key-value pairs determined to be the farthest from the current time one by one from the dependency database until the preset capacity threshold and / or the preset number threshold are met.

[0142] Among them, the dependency database includes key-value pairs corresponding to multiple software packages, and the information pulling time of each key-value pair, which represents the time when the attribute information and the list of dependent software packages of the software package are pulled from the source database. The preset capacity threshold refers to the maximum storage capacity preset for the dependency database; the preset number threshold refers to the maximum number preset for the dependency database.

[0143] During the process of storing new key-value pairs in the dependency database, real-time monitor the storage capacity and the number of storage entries of the dependency database. If the storage capacity reaches the preset capacity threshold, it means that the dependency database can no longer store new key-value pairs, then delete the key-value pairs determined to be the farthest from the current time one by one from the dependency database until the preset capacity threshold is met; if the number of storage entries reaches the preset number threshold, it means that the dependency database can no longer store new key-value pairs, then delete the key-value pairs determined to be the farthest from the current time one by one from the dependency database until the preset number threshold is met.

[0144] In the embodiments of the present application, from the two dimensions of storage capacity and storage quantity, quantitatively evaluate the storage capacity of the dependency database, and when the storage capacity reaches the preset capacity threshold, and / or the number of storage entries reaches the preset number threshold, delete the key-value pairs determined to be the farthest from the current time one by one from the dependency database until the preset capacity threshold and / or the preset number threshold are met, while ensuring the storage space of the dependency database and ensuring the validity of the stored content in the dependency database.

[0145] In an exemplary embodiment, a software package installation method is provided, including the following steps:

[0146] (1) In response to a trigger request for a software package management tool, obtain the identifiers, version numbers, and lists of dependent data packages of each software package.

[0147] (2) Combine the identifiers and version numbers corresponding to the same software package to obtain the keys of each software package; and use the dependent data packages of each software package as the values of each software package.

[0148] (3) Determine the keys of each software package as the attribute information of each software package; use the attribute information of each software package as leaf nodes, and create a software package index tree based on the preset index node creation conditions.

[0149] (4) Combine the keys and values corresponding to the same software package to obtain the key-value pairs of each software package.

[0150] (5) Store the key-value pairs of each software package into a preset hash table to obtain a dependency relationship database.

[0151] (6) In response to a software package installation request input in the software package management tool, obtain the installation information of the software package to be installed; the installation information includes the name of the software package to be installed and / or the software package identifier.

[0152] (7) Based on the installation information, determine the identifier and version number of the software package to be installed from a preset mapping table.

[0153] Among them, the preset mapping table includes the corresponding relationships between the names, identifiers, and version numbers of each software package.

[0154] (8) Combine the identifier and version number of the software package to be installed to obtain the attribute information of the software package to be installed.

[0155] (9) Query the attribute information of the software package to be installed in the software package index tree; the leaf nodes of the software package index tree are the attribute information of multiple software packages.

[0156] (10) When the attribute information of the software package to be installed exists in the software package index tree, determine the list of dependent software packages of the software package to be installed from the dependency relationship database.

[0157] (11) Obtain the set of downloaded software packages of the terminal device.

[0158] (12) If the set of downloaded software packages includes each dependent software package in the list of dependent software packages, pull the software package to be installed from the source database and download the software package to be installed.

[0159] (13) Otherwise, compare the set of downloaded software packages with the list of dependent software packages, determine the missing dependent software packages in the set of downloaded software packages, and display the installation information of each dependent software package; the installation information is used to indicate the installation of each dependent software package to complete the software package installation.

[0160] (14) For any missing dependent software package in the set of downloaded software packages, in response to a dependent package installation request for the dependent software package, parse the dependent package installation request.

[0161] (15) In the case where there is an identifier of a dependent package in the dependent package installation request and there is no version number of the dependent package, determine multiple candidate dependent packages that match the identifier of the dependent package from the source database; determine the dependent package with the latest version or the highest usage frequency among the multiple candidate dependent packages as the dependent package corresponding to the dependent package installation request.

[0162] (16) In response to an update request for the dependency database, obtain the software package update timestamp of the source database.

[0163] (17) By comparing the software package update timestamp and the information acquisition timestamp of the dependency database, determine whether the dependency database needs to be updated.

[0164] (18) If an update is needed, compare the content in the dependency database with the content in the source database to obtain the update content, and update the dependency database according to the update content.

[0165] (19) During the update process of the dependency database, obtain the storage capacity and the number of storage entries of the dependency database.

[0166] (20) If the storage capacity reaches the preset capacity threshold, and / or the number of storage entries reaches the preset number threshold, then delete the key-value pairs determined to be the farthest from the current moment one by one from the dependency database according to the information pull time of each key-value pair in the dependency database until the preset capacity threshold and / or the preset number threshold are met.

[0167] In the embodiments of the present application, the software package index tree constructed based on the attribute information of each software package hierarchically stores the attribute information of each software package to support querying the index tree of the software package to be installed layer by layer from top to bottom in the software package index tree, avoiding repeated retrieval, improving the retrieval efficiency of the software package to be installed, and then quickly and accurately obtaining the query result. Further, in the case where the query result is that there is attribute information of the software package to be installed in the software package index tree, according to the attribute information of the software package to be installed, determine the list of dependent packages of the software package to be installed from the dependency database. Since the attribute information of each software package and the list of dependent data packages in the dependency database are stored in the data structure of key-value pairs, the attribute information of the software package to be installed is equivalent to the key of the software package to be installed. In this case, the list of dependent packages of the software package to be installed can be quickly determined from the dependency database based on the key of the software package to be installed, and the software package can be installed according to the list of dependent packages of the software package to be installed, improving the software package installation efficiency.

[0168] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are sequentially shown according to the indications of the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.

[0169] Based on the same inventive concept, an embodiment of the present application further provides a software package installation device for implementing the software package installation method described above. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the software package installation device provided below can refer to the limitations on the software package installation method in the above text, and will not be repeated here.

[0170] In an exemplary embodiment, as Figure 8 shown, a software package installation device is provided, including: an acquisition module 801, a query module 802, a determination module 803, and an installation module 804, where:

[0171] The acquisition module 801 is configured to acquire the attribute information of the software package to be installed in response to a software package installation request input in the software package management tool;

[0172] The query module 802 is configured to query the attribute information of the software package to be installed in the software package index tree; the leaf nodes of the software package index tree are the attribute information of multiple software packages;

[0173] The determination module 803 is configured to determine a list of dependent software packages of the software package to be installed from the dependency database when the attribute information of the software package to be installed exists in the software package index tree; the dependency database stores key-value pairs based on each software package; the key-value pair of each software package includes the attribute information of the software package and a list of dependent data packages;

[0174] The installation module 804 is configured to execute the installation steps of the software package to be installed based on the list of dependent software packages.

[0175] In an exemplary embodiment, the acquisition module 801 includes: an installation information acquisition unit, a table query unit, and an identification version number combination unit, where:

[0176] An installation information acquisition unit, configured to acquire installation information of a software package to be installed in response to a software package installation request input in a software package management tool; the installation information includes the name of the software package to be installed, and / or, a software package identifier;

[0177] A table query unit, configured to determine the identifier of the software package to be installed and the version number of the software package to be installed from a preset mapping table based on the installation information; the preset mapping table includes the correspondence between the name, identifier, and version number of each software package;

[0178] An identifier version number combination unit, configured to combine the identifier of the software package to be installed and the version number of the software package to be installed to obtain the attribute information of the software package to be installed.

[0179] In an exemplary embodiment, the installation module 804 includes: a set acquisition unit, a software package pulling unit, and a software package comparison unit, where:

[0180] The set acquisition unit is configured to acquire a set of downloaded software packages of a terminal device;

[0181] The software package pulling unit is configured to pull the software package to be installed from a source database and download the software package to be installed when each dependent software package in the list of dependent software packages is included in the set of downloaded software packages;

[0182] The software package comparison unit is configured to compare the set of downloaded software packages with the list of dependent software packages when each dependent software package in the list of dependent software packages is not included in the set of downloaded software packages, determine the missing dependent software packages in the set of downloaded software packages, and display the installation information of each dependent software package; the installation information is used to indicate the installation of each dependent software package to complete the software package installation.

[0183] In an exemplary embodiment, the installation module 804 is further configured to: for any dependent software package, in response to a dependent package installation request for the dependent software package, parse the dependent package installation request; when there is an identifier of the dependent software package in the dependent package installation request and there is no version number of the dependent software package, determine multiple candidate dependent software packages that match the identifier of the dependent software package from a source database; and determine the dependent software package with the latest version or the highest usage frequency among the multiple candidate dependent software packages as the dependent software package corresponding to the dependent package installation request.

[0184] In an exemplary embodiment, the software package installation device further includes: a trigger request response module, a key-value pair acquisition module, and a database creation module, where:

[0185] The trigger request response module is configured to acquire the identifier, version number, and list of dependent data packages of each software package in response to a trigger request for the software package management tool;

[0186] A key-value pair acquisition module, configured to combine the identifiers and version numbers corresponding to the same software package to obtain the keys of each software package; and use the dependent data packages of each software package as the values of each software package.

[0187] A database creation module, configured to construct a software package index tree according to the keys of each software package; and construct a dependency database according to the keys and values of each software package.

[0188] In an exemplary embodiment, the database creation module is further configured to determine the keys of each software package as the attribute information of each software package; use the attribute information of each software package as leaf nodes, and create a software package index tree based on a preset index node creation condition.

[0189] In an exemplary embodiment, the database creation module is further configured to combine the keys and values corresponding to the same software package to obtain the key-value pairs of each software package; store the key-value pairs of each software package in a preset hash table to obtain a dependency database.

[0190] In an exemplary embodiment, the software package installation device further includes: a timestamp acquisition module, a timestamp comparison module, and a database update module, where:

[0191] The timestamp acquisition module is configured to acquire the software package update timestamp of the source database in response to an update request for the dependency database.

[0192] The timestamp comparison module is configured to determine whether the dependency database needs to be updated by comparing the software package update timestamp with the information acquisition timestamp of the dependency database.

[0193] The database update module is configured to, when the dependency database needs to be updated, compare the content in the dependency database with the content of the source database to obtain the updated content, and update the dependency database according to the updated content.

[0194] In an exemplary embodiment, the database update module includes: a storage information determination unit and a key-value pair deletion unit, where:

[0195] The storage information determination unit is configured to acquire the storage capacity and the number of storage entries of the dependency database during the update process of the dependency database.

[0196] The key-value pair deletion unit is configured to, when the storage capacity reaches a preset capacity threshold and / or the number of storage entries reaches a preset number threshold, delete the key-value pairs determined to be the farthest from the current moment one by one from the dependency database until the preset capacity threshold and / or the preset number threshold are met.

[0197] Each module in the above software package installation device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above modules can be embedded in or independent of a processor in a computer device in hardware form, or stored in a memory in the computer device in software form, so that the processor can call and execute the operations corresponding to each of the above modules.

[0198] In an exemplary embodiment, a computer device is provided. The computer device can be a terminal device, and its internal structure diagram can be as Figure 9 shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner. The wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC), or other technologies. The computer program, when executed by the processor, implements a software package installation method. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, a trackball, or a touchpad provided on the computer device housing, or an external keyboard, touchpad, or mouse, etc.

[0199] Those skilled in the art can understand that Figure 9 the structure shown in

[0200] is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different component layout.

[0201] In an exemplary embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the foregoing method embodiments are implemented.

[0202] In an exemplary embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the foregoing method embodiments are implemented.

[0203] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data that have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.

[0204] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, artificial intelligence (AI) processors, etc., without limitation.

[0205] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in the present application.

[0206] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims

1. A method for installing a software package, characterized in that: Applied to a terminal device, the terminal device is deployed with a software package management tool, and the method includes: In response to a software package installation request input in the software package management tool, acquiring attribute information of the software package to be installed; Querying the attribute information of the software package to be installed in the software package index tree; the leaf nodes of the software package index tree are the attribute information of multiple software packages; In the case that the software package index tree contains the attribute information of the software package to be installed, determining a list of dependent software packages of the software package to be installed from a dependency database; the dependency database stores key-value pairs based on each of the software packages; the key-value pair of each software package includes the attribute information of the software package and a list of dependent data packages; Based on the dependent software package list, the installation steps of the software to be installed are executed.

2. The method according to claim 1, characterized in that The step of obtaining the attribute information of the software package to be installed in response to the software package installation request inputted into the software package management tool includes: In response to a software package installation request inputted into the software package management tool, obtaining installation information of the software package to be installed; the installation information includes a name of the software to be installed and / or a software package identifier; Based on the installation information, determining the identifier of the software package to be installed and the version number of the software package to be installed from a preset mapping table; the preset mapping table includes a correspondence between the name, identifier and version number of each software package; The identifier of the software package to be installed and the version number of the software package to be installed are combined to obtain attribute information of the software package to be installed.

3. The method according to claim 1, characterized in that: The step of performing the installation of the software to be installed based on the list of dependent software packages includes: Obtain a download software package set of the terminal device; If the download software package set includes each dependent software package in the dependent software package list, then pulling the software package to be installed from the source database and downloading the software package to be installed; Otherwise, the download package set is compared with the dependent package list to determine the dependent packages missing from the download package set, and installation information of each dependent package is displayed; the installation information is used to instruct the installation of each dependent package to complete the package installation.

4. The method according to claim 3, characterized in that The method further comprises: For any dependent software package, in response to a dependent package installation request for the dependent software package, parsing the dependent package installation request; When the dependent package installation request contains an identifier of the dependent software package but does not contain a version number of the dependent software package, determining a plurality of candidate dependent software packages that match the identifier of the dependent software package from the source database; The dependent software package with the latest version or the most frequently used one among the multiple candidate dependent software packages is determined as the dependent software package corresponding to the dependent package installation request.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: In response to a trigger request for the software package management tool, obtaining an identifier, a version number, and a list of dependent data packages of each software package; Combining the identifier and version number corresponding to the same software package to obtain the key of each software package; and using the dependent data package of each software package as the value of each software package; The software package index tree is constructed according to the key of each software package; and the dependency database is constructed according to the key of each software package and the value of each software package.

6. The method according to claim 5, characterized in that The step of constructing the software package index tree according to the key of each software package includes: Determining the key of each software package as the attribute information of each software package; The attribute information of each software package is used as a leaf node, and based on a preset index node creation condition, the software package index tree is created.

7. The method according to claim 5, characterized in that The step of constructing the dependency database according to the key of each software package and the value of each software package includes: Combining the keys and values ​​corresponding to the same software package to obtain key-value pairs of each software package; The key-value pairs of each software package are stored in a preset hash table to obtain the dependency database.

8. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: In response to an update request for the dependency database, obtaining a software package update timestamp of a source database; By comparing the software package update timestamp with the information acquisition timestamp of the dependency database, determining whether the dependency database needs to be updated; If an update is required, the content in the dependency database is compared with the content in the source database to obtain updated content, and the dependency database is updated according to the updated content.

9. The method according to claim 8, characterized in that The updating of the dependency database according to the update content includes: During the updating process of the dependency database, obtaining the storage capacity and the number of storage entries of the dependency database; If the storage capacity reaches a preset capacity threshold, and / or the number of storage entries reaches a preset number threshold, then based on the information pulling time of each key-value pair in the dependency database, the key-value pairs farthest from the current time will be deleted one by one from the dependency database until the preset capacity threshold and / or the preset number threshold are met.

10. A software package installation device, characterized in that: The device comprises: An acquisition module, configured to acquire attribute information of a software package to be installed in response to a software package installation request input into a software package management tool; A query module, used to query the attribute information of the software package to be installed in the software package index tree; the leaf nodes of the software package index tree are the attribute information of multiple software packages; a determination module, configured to determine a list of dependent packages of the software package to be installed from a dependency database when the software package index tree contains the property information of the software package to be installed; the dependency database stores key-value pairs based on each of the software packages; the key-value pair of each software package includes the property information of the software package and the list of dependent data packages; The installation module is used to execute the installation steps of the software to be installed based on the dependent software package list.

Citation Information

Patent Citations

  • Data base indexing process

    CN101286160A

  • Data retrieval method and device

    CN111061680A

  • Software package management method and device of operating system, equipment and storage medium

    CN112748949A

  • Address book information searching method and device, equipment and storage medium

    CN115510058A

  • Dependent packet synchronization method and device, computer equipment and storage medium

    CN117971297A