Software package processing method and device, computer equipment and storage medium
By obtaining and querying the dependency symbol table of the target software package until the stop condition is met, visual dependency data is generated, and the problem of inefficient determination of dependency relationships of RPM software packages is solved, and efficient dependency data query and intuitive data viewing are achieved.
Patent Information
- Application Number
- CN202410011605.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-02
- Publication Date
- 2025-07-04
AI Technical Summary
In the prior art, it is inefficient to determine the dependency relationship of RPM software packages, and it is necessary to manually call yum and dnf repeatedly to obtain the dependency data, resulting in low efficiency.
By responding to the query request, the dependency symbol table of the target software package is obtained, and the dependency software package with dependency relationship with the target software package is queried according to the dependency symbol table until the stop condition is met, and visual dependency data is generated.
It improves the efficiency of querying dependent data, can understand the dependencies of software packages more intuitively, reduces the number of manual calls, and improves the convenience of viewing dependent data.
Smart Images

Figure CN120256460A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technologies, and in particular, to a method, apparatus, computer device, storage medium, and computer program product for processing software packages. Background Art
[0002] An RPM (Red Hat Package Manager) software package is a software package in RPM format. There are complex dependency relationships among various RPM software packages in the system. In scenarios of application changes such as version release and software upgrade of an application, it is necessary to determine the RPM software packages affected by the application change and perform batch changes.
[0003] In related technologies, usually, a hierarchical dependency data is obtained through yum and dnf. Both yum and dnf are RPM software package managers. Then, by repeatedly calling manually, the complete dependency data can be obtained, and further all affected RPM software packages can be determined, resulting in low efficiency in determining dependency data. Summary of the Invention
[0004] Based on this, to address the above technical problems, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium, and computer program product for processing software packages, which can improve the efficiency of querying dependency data.
[0005] In a first aspect, this application provides a method for processing software packages. The method includes:
[0006] In response to a query request, obtain a target software package corresponding to the software package information in the query request; find the dependency symbol table of the target software package according to the query type carried in the query request; query the dependent software packages having a dependency relationship with the target software package according to the dependencies included in the dependency symbol table; when the dependency level between the dependent software package and the target software package does not meet the stop condition, continue to query the dependent software packages having a dependency relationship with the target software package based on the dependent software package until the dependency level between the currently queried dependent software package and the target software package meets the stop condition, so as to obtain the dependent software packages at different dependency levels; generate the visual dependency data of the target software package based on the target software package and the dependent software packages at different dependency levels.
[0007] In a second aspect, this application further provides an apparatus for processing software packages. The apparatus includes:
[0008] A target software package obtaining module, configured to obtain a target software package corresponding to the software package information in the query request in response to the query request;
[0009] A dependency symbol table lookup module, configured to look up the dependency symbol table of a target software package according to the query type carried in a query request;
[0010] A first dependent software package query module, configured to query, according to dependencies included in the dependency symbol table, dependent software packages having a dependency relationship with the target software package;
[0011] A second dependent software package query module, configured to, when the dependency level between a dependent software package and the target software package does not meet a stop condition, continue to query, based on the dependent software package, for dependent software packages having a dependency relationship with the target software package until the dependency level between the currently queried dependent software package and the target software package meets the stop condition, so as to obtain dependent software packages at different dependency levels;
[0012] A dependency data generation module, configured to generate visualization dependency data of the target software package based on the target software package and the dependent software packages at different dependency levels.
[0013] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the following steps are implemented:
[0014] In response to a query request, obtain a target software package corresponding to the software package information in the query request; look up the dependency symbol table of the target software package according to the query type carried in the query request; query, according to dependencies included in the dependency symbol table, for dependent software packages having a dependency relationship with the target software package; when the dependency level between a dependent software package and the target software package does not meet a stop condition, continue to query, based on the dependent software package, for dependent software packages having a dependency relationship with the target software package until the dependency level between the currently queried dependent software package and the target software package meets the stop condition, so as to obtain dependent software packages at different dependency levels; generate visualization dependency data of the target software package based on the target software package and the dependent software packages at different dependency levels.
[0015] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon. When the computer program is executed by a processor, the following steps are implemented:
[0016] In response to a query request, obtain a target software package corresponding to the software package information in the query request; find the dependency symbol table of the target software package according to the query type carried in the query request; query for dependent software packages that have a dependency relationship with the target software package according to the dependencies included in the dependency symbol table; when the dependency level between the dependent software package and the target software package does not meet the stop condition, continue to query for dependent software packages that have a dependency relationship with the target software package based on the dependent software package until the dependency level between the currently queried dependent software package and the target software package meets the stop condition, obtaining dependent software packages at different dependency levels; generate visual dependency data for the target software package based on the target software package and the dependent software packages at different dependency levels.
[0017] In a fifth aspect, the present application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the following steps:
[0018] In response to a query request, obtain a target software package corresponding to the software package information in the query request; find the dependency symbol table of the target software package according to the query type carried in the query request; query for dependent software packages that have a dependency relationship with the target software package according to the dependencies included in the dependency symbol table; when the dependency level between the dependent software package and the target software package does not meet the stop condition, continue to query for dependent software packages that have a dependency relationship with the target software package based on the dependent software package until the dependency level between the currently queried dependent software package and the target software package meets the stop condition, obtaining dependent software packages at different dependency levels; generate visual dependency data for the target software package based on the target software package and the dependent software packages at different dependency levels.
[0019] The above method, apparatus, computer device, storage medium, and computer program product for processing software packages obtain a target software package through the software package information in the query request, find the dependency symbol table of the target software package according to the query type, and then query for dependent software packages that have a dependency relationship with the target software package according to the dependencies included in the dependency symbol table. When the dependency level corresponding to the dependent software package does not meet the stop condition, continue to query for dependent software packages that have a dependency relationship with the target software package based on the dependent software package until the dependency level of the queried dependent software package meets the stop condition. In this way, dependent software packages at different dependency levels can be queried. Thus, when it is necessary to make changes to the software package, it is not necessary to manually call repeatedly to query for the dependent software packages at each dependency level that have a dependency relationship with the target software package, improving the efficiency of querying dependency data. In addition, generating visual dependency data based on the target software package and the dependent software packages at different dependency levels can more intuitively understand the dependent software packages at each dependency level that have a dependency relationship with the target software package, improving the convenience of viewing dependency data. Description of the Drawings
[0020] Figure 1 It is an application environment diagram of the processing method of the software package in an embodiment;
[0021] Figure 2 It is a schematic flowchart of the processing method of the software package in an embodiment;
[0022] Figure 3 It is a schematic diagram of the dependency tree in an embodiment;
[0023] Figure 4 It is a schematic diagram of the dependency tree in another embodiment;
[0024] Figure 5 It is a schematic flowchart of the process for implementing the dependency storage service in an embodiment;
[0025] Figure 6 It is a schematic flowchart of the process for finding dependent software packages of different query types in an embodiment;
[0026] Figure 7 It is a schematic diagram of the same dependent software package corresponding to different dependency levels in an embodiment;
[0027] Figure 8 It is a schematic flowchart of the process for finding dependent software packages at each dependency level when the query type is different in an embodiment;
[0028] Figure 9 It is a schematic flowchart of the process for generating visual dependency data when the query request is a dependency priority query request in an embodiment;
[0029] Figure 10 It is a reference schematic diagram for determining whether the software package to be processed meets the priority processing conditions in an embodiment;
[0030] Figure 11 It is a schematic diagram of three processing stages included in the processing method of the software package in an embodiment;
[0031] Figure 12 It is a schematic diagram of the software package processing system in an embodiment;
[0032] Figure 13 It is a schematic flowchart of the processing method of the software package in another embodiment;
[0033] Figure 14 It is a structural block diagram of the software package processing device in an embodiment;
[0034] Figure 15 It is an internal structure diagram of a computer device in an embodiment. Detailed implementation manners
[0035] To make the objectives, technical solutions and advantages of this application more clear and understandable, the following further elaborates on this application in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely for explaining this application and are not used to limit this application.
[0036] The method for processing software packages provided in the embodiments of this application can be applied to an application environment as Figure 1 shown. Among them, the terminal 102 communicates with the server 104 through a network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or can be placed in the cloud or on other network servers; the method for processing software packages can be executed by the terminal 102 or the server 104, or can be executed collaboratively by the terminal 102 and the server 104.
[0037] Taking the method for processing software packages being executed by the terminal 102 as an example, the terminal 102, in response to a query request, obtains a target software package corresponding to the software package information in the query request; the terminal 102 searches for the dependency symbol table of the target software package according to the query type carried in the query request; the terminal 102 queries for dependent software packages that have a dependency relationship with the target software package according to the dependencies included in the dependency symbol table; when the dependency level between the dependent software package and the target software package does not meet the stop condition, the terminal 102 continues to query for dependent software packages that have a dependency relationship with the target software package based on the dependent software package until the dependency level between the currently queried dependent software package and the target software package meets the stop condition, obtaining dependent software packages at different dependency levels; the terminal 102 generates visual dependency data for the target software package based on the target software package and the dependent software packages at different dependency levels.
[0038] Among them, the terminal 102 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, an Internet of Things device, and a portable wearable device. The Internet of Things device can be a smart speaker, a smart TV, a smart air conditioner, a smart in-vehicle device, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc.
[0039] The server 104 can be an independent physical server or a service node in a blockchain system, and a peer-to-peer network is formed among the service nodes in the blockchain system.
[0040] In addition, the server 104 can also be a server cluster composed of multiple physical servers, and can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), as well as big data and artificial intelligence platforms.
[0041] The terminal 102 and the server 104 can be connected through communication connection methods such as Bluetooth, USB (Universal Serial Bus), or network, and this application does not limit this here.
[0042] In some embodiments, as Figure 2 shown, a method for processing software packages is provided, and this method is executed by Figure 1 the server or the terminal in Figure 1 or is executed collaboratively by the server and the terminal in Figure 1 Taking the execution by the terminal in
[0043] as an example, the method includes the following steps:
[0044] Step 202, in response to a query request, obtain a target software package corresponding to the software package information in the query request.
[0045] Among them, the query request is used to query the dependency data of a certain software package. The software package is a software package in RPM format, also known as an RPM software package; the query request can be initiated by a user through the software package processing interaction interface of the terminal.
[0046] The dependency data is used to reflect the dependency relationship between this software package and other software packages, that is, the query request is used to query the dependency relationship between a certain software package and other software packages; the dependency relationship between software packages can be at least one of the installation process or the compilation process of the software package, depending on another software package.
[0047] The software package information can be the package name, and the package name of the target software package is the package name included in the query request.
[0048] In some embodiments, the user can input software package information through the software package processing interaction interface of the terminal and initiate a query request based on the software package information, so that the query request includes the software package information; the terminal responds to the query request, obtains the package name (software package information) included in the query request, obtains the package names of all software packages in the software repository, and takes the software package whose package name is the same as the package name included in the query request as the target software package.
[0049] Step 204: Search for the dependency symbol table of the target software package according to the query type carried in the query request.
[0050] Among them, the query type is used to represent the type of dependency relationship of the software package. The type of dependency relationship can be the dependency type or the depended type. The dependency type is the type of dependency relationship where a software package depends on other software packages, and the depended type is the type of dependency relationship where a software package is depended on by other software packages.
[0051] Exemplarily, during the installation of software package A1, library file k1 needs to be called, and library file k1 is provided by software package A2. Then software package A1 depends on software package A2, and software package A2 is depended on by software package A1. When the target software package is software package A1 and the query type is the dependency type, it means that software package A2 on which software package A1 depends needs to be queried. When the target software package is software package A2 and the query type is the depended type, it means that it needs to be queried that software package A2 is depended on by software package A1.
[0052] The dependency symbol table of the target software package includes the dependency symbols of the target software package belonging to the query type, and the number of dependency symbols is at least one.
[0053] In some embodiments, when the user inputs software package information through the software package processing interaction interface of the terminal, the query type is also input, and a query request is generated according to the software package information and the query type. The terminal responds to the query request, and the terminal obtains the initial dependency symbol table of the target software package according to the software package information, and in the initial dependency symbol table of the target software package, the dependency symbol table corresponding to the query type is obtained.
[0054] In some embodiments, step 204 includes: when the query type carried in the query request is the dependency type, search for the first dependency symbol table including the dependencies required by the target software package in the total dependency symbol table; when the query type carried in the query request is the depended type, search for the second dependency symbol table including the dependencies provided by the target software package in the total dependency symbol table.
[0055] Among them, the total dependency symbol table includes all software packages in the software repository and dependency symbols belonging to different query types. Exemplarily, the software repository includes software packages A1, A2, A3, and A4. Software package A1 has dependency symbols belonging to the dependency type and dependency symbols belonging to the depended type. Similarly, software packages A2, A3, and A4 also have dependency symbols belonging to the dependency type and dependency symbols belonging to the depended type. The total dependency symbol table includes: the dependency symbols belonging to the dependency type and the dependency symbols belonging to the depended type of software packages A1, A2, A3, and A4 respectively.
[0056] Dependencies can be library files or other resources, and can also be specific functions, interfaces, or methods in library files.
[0057] The dependencies required by the target package are the dependencies that the target package needs to call from other packages. In other words, the dependencies required by the target package are the dependencies that need to be provided by other packages; the first dependency symbol table includes the dependency symbols corresponding to the dependencies that the target package needs to call from other packages.
[0058] The dependencies provided by the target package are relied on by other packages. In other words, the dependencies provided by the target package are the dependencies provided by the target package for other packages to call; the second symbol table includes the dependency symbols corresponding to the dependencies provided by the target package for other packages to call.
[0059] In some embodiments, the total dependency symbol table is stored in the local memory of the terminal. The terminal can directly access the total dependency symbol table and query the initial dependency symbol table belonging to the target package through the total dependency symbol table. The initial dependency symbol table includes all the dependency symbols related to the target package, specifically including the dependency symbols of the target package belonging to the dependency type and the dependency symbols of the target package belonging to the depended-on type; the terminal searches for the corresponding first symbol table or second symbol table in the initial dependency symbol table according to the query type; when the query type is the dependency type, it searches for the dependency symbols of the target package belonging to the dependency type in the initial dependency symbol table and determines the first dependency symbol table according to the dependency symbols of the target package belonging to the dependency type; when the query type is the depended-on type, it searches for the dependency symbols of the target package belonging to the depended-on type in the initial dependency symbol table and determines the second dependency symbol table according to the dependency symbols of the target package belonging to the depended-on type.
[0060] Exemplarily, when the query type is the dependency type, it searches for the Requires symbol (the dependency symbol belonging to the dependency type) of the target package in the total dependency symbol table and determines the first dependency symbol table according to the Requires symbol of the target package; Requires represents requirement, so the dependency symbol of the dependencies required by the target package is represented by Requires.
[0061] When the query type is the depended-on type, it searches for the Provides symbol (the dependency symbol belonging to the dependency type) of the target package in the total dependency symbol table and determines the first dependency symbol table according to the Provides symbol of the target package; Provides represents provide, so the dependency symbol of the dependencies provided by the target package is represented by Provides.
[0062] In some embodiments, the dependency symbol table is maintained by the server. The terminal can send a dependency symbol query request to the server. The dependency symbol query request carries the package name of the target software package and the query type. When the query type is the dependency type, the server responds to the dependency symbol query request and looks up the first dependency symbol table of the target software package in the dependency symbol table. The terminal obtains the first dependency symbol table returned by the server. When the query type is the depended-on type, the server responds to the dependency symbol query request and looks up the second dependency symbol table of the target software package in the dependency symbol table. The terminal obtains the second dependency symbol table returned by the server.
[0063] In the above embodiments, for the target software package, the first dependency symbol table corresponding to its dependency type can be looked up, or the second dependency symbol table of its depended-on type can be queried, meeting the requirements of various application scenarios for dependency relationship lookup and improving the adaptability of the software package processing method.
[0064] Step 206: Query the dependent software packages that have a dependency relationship with the target software package according to the dependencies included in the dependency symbol table.
[0065] Among them, the dependency symbol table further includes the dependencies corresponding to the dependency symbols. The dependency symbol is the identification symbol of the dependency, that is, there is a corresponding relationship between the dependency symbol and the dependency, and the number of dependencies is at least one.
[0066] Specifically, the terminal traverses the dependencies in the dependency symbol table. For the currently traversed dependency, it obtains the dependency in the dependency symbol tables of other software packages. If the dependency is obtained in the dependency symbol table of a certain other software package, then the certain other software package is used as the dependent software package that has a dependency relationship with the target software package.
[0067] Since the number of dependencies is at least one, the number of dependent software packages queried based on the dependency symbol table is at least one.
[0068] It should be noted that according to different query types, the dependency relationships between the queried dependent software packages and the target software package are different. For example, when the query type is the dependency type, the dependency relationship between the queried dependent software package and the target software package is used to indicate that the target software package depends on the dependent software package (the target software package needs to call the dependencies provided by the dependent software package). When the query type is the depended-on type, the dependency relationship between the queried dependent software package and the target software package is used to indicate that the target software package is depended on by the dependent software package (the target software package provides the dependencies required by the dependent software package).
[0069] In some embodiments, querying for dependent packages that have a dependency relationship with a target package according to the dependencies included in the dependency symbol table includes: when the dependency symbol table includes the dependencies required by the target package, traversing in the dependencies required by the target package to obtain a first target dependency; obtaining a first reference dependency symbol table for each package; the first reference dependency symbol table is used to represent the dependencies provided by the package; based on the first reference dependency symbol tables of each package, querying in each package for the dependent package that provides the first target dependency.
[0070] Among them, when the dependency symbol table includes the dependencies required by the target package, it means that the query type is the dependency type; the first target dependency is a dependency traversed in the dependency symbol table corresponding to the dependency type. Each package is a package in all packages of the software repository except the target package; the first reference dependency symbol table is the reference dependency symbol table of the package belonging to the dependent type.
[0071] Specifically, when the query type is the dependency type, the dependency symbol table includes the dependencies required by the target package, and the terminal traverses in the dependency symbol table to obtain a first target dependency; for each package, the terminal obtains the first reference dependency symbol table of the package belonging to the dependent type, and searches for the first target dependency in the first reference dependency symbol table. If the first target dependency is not found in the first reference dependency symbol table, then the package is skipped until the first target dependency is found in the first reference dependency symbol table of a certain package, and then that package is the dependent package that provides the first target dependency; after the terminal completes traversing each dependency in the dependency symbol table, it obtains the dependent packages that provide each dependency respectively.
[0072] It should be noted that the same dependent package can provide the dependencies required by at least one target package. Therefore, the number of dependent packages found may be less than the number of dependencies required by the target package.
[0073] Exemplarily, the software repository includes target software packages A1, A2, A3, and A4. According to the dependency symbol table, the dependencies required by target software package A1 include: dependency R1 and dependency R2. For the traversed dependency R1 (the first target dependency), search for dependency R1 in the first reference dependency symbol table of software package A2 that belongs to the dependent type. If the first reference dependency symbol table of software package A2 includes dependency R1, then software package A2 is the dependent software package that provides dependency R1. For the traversed dependency R2 (the first target dependency), search for dependency R2 in the first reference dependency symbol table of software package A2 that belongs to the dependent type. If the first reference dependency symbol table of software package A2 does not include dependency R2, then skip software package A2 and continue to search for dependency R2 in the first reference dependency symbol table of software package A3 that belongs to the dependent type. If the first reference dependency symbol table of software package A3 includes dependency R2, then software package A3 is the dependent software package that provides dependency R2. In this way, it can be determined that the dependent software packages that have a dependency relationship with the target software package are software package A2 and software package A3.
[0074] In the above embodiment, when the dependency symbol table includes the dependencies required by the target software package, according to the first reference dependency symbol tables of each software package, search for the dependent software packages that provide the dependencies required by the target software package. Through the correspondence between the dependency symbol table of the target software package and the first reference dependency symbol tables of the software packages, the dependent software packages that have a dependency relationship with the target software package can be quickly queried, improving the efficiency of querying dependent software packages.
[0075] In some embodiments, querying the dependent software packages that have a dependency relationship with the target software package according to the dependencies included in the dependency symbol table includes: when the dependency symbol table includes the dependencies provided by the target software package, traverse to obtain the second target dependency among the dependencies provided by the target software package; obtain the second reference dependency symbol tables of each software package; the second reference dependency symbol table is used to represent the dependencies required by the software package; based on the second reference dependency symbol tables of each software package, query the dependent software packages that require the second target dependency in each software package.
[0076] Among them, when the dependency symbol table includes the dependencies provided by the target software package, it indicates that the query type is the dependent type; the second target dependency is a dependency traversed in the dependency symbol table corresponding to the dependent type. The second reference dependency symbol table is the reference dependency symbol table of the software package that belongs to the dependency type.
[0077] Specifically, when the query type is a dependent type, the dependency symbol table includes the dependencies provided by the target software package, and the terminal traverses the dependency symbol table to obtain the second target dependency; for each software package, the terminal obtains the second reference dependency symbol table of the software package that belongs to the dependent type, and searches for the second target dependency in the second reference dependency symbol table. If the second target dependency is not found in the second reference dependency symbol table, the software package is skipped until the operation of searching for the second target dependency in the second reference dependency symbol table of each software package is completed. The software package that includes the second target dependency in the second reference dependency is used as the dependent software package that requires the second target dependency; after the terminal completes traversing each dependency in the dependency symbol table, it obtains the respective dependent software packages that require each dependency.
[0078] It should be noted that the same dependency can be required by multiple software packages. Therefore, the number of the found dependent software packages may be greater than the number of dependencies provided by the target software package.
[0079] Exemplarily, the software repository includes the target software package A1, software package A2, software package A3, and software package A4. It is determined according to the dependency symbol table that the dependencies provided by the target software package A1 include: dependency P1 and dependency P2. For the traversed dependency P1 (the second target dependency), search for dependency P1 in the second reference dependency symbol table of software package A2 that belongs to the dependent type. If the second reference dependency symbol table of software package A2 includes dependency P1, then software package A2 is the dependent software package that requires dependency P1. Continue to search for dependency P1 in the second reference dependency symbol tables of software package A3 and software package A4 respectively to obtain the respective dependent software packages that require dependency P1; for the traversed dependency P2 (the second target dependency), search for the respective dependent software packages that require dependency P2 in the same manner as searching for the respective dependent software packages that require dependency P1 above.
[0080] In the above embodiment, when the dependency symbol table includes the dependencies provided by the target software package, according to the second reference dependency symbol tables of each software package, search for the dependent software packages that require the dependencies provided by the target software package. Through the correspondence between the dependency symbol table of the target software package and the second reference dependency symbol tables of the software packages, the dependent software packages that have a dependency relationship with the target software package can be quickly queried, improving the efficiency of querying dependent software packages.
[0081] Step 208, when the dependency level between the dependent software package and the target software package does not meet the stop condition, continue to query the dependent software packages that have a dependency relationship with the target software package based on the dependent software package until the dependency level between the currently queried dependent software package and the target software package meets the stop condition, and obtain the dependent software packages at different dependency levels.
[0082] Among them, the dependency level can reflect the complexity of the dependency relationship between the dependent package and the target package; the more dependency levels there are between the dependent package and the target package, the higher the complexity of the dependency relationship between the dependent package and the target package.
[0083] In other words, the dependency level can reflect the number of intermediate dependent packages required to form the dependency relationship between the target package and the dependent package; the higher the number of intermediate dependent packages required, the higher the dependency level; it should be understood that there is also a dependency relationship between the required intermediate dependent packages and the target package, and the dependency level corresponding to the intermediate dependent package is lower than the dependency level corresponding to the dependent package.
[0084] Specifically, when the dependency relationship between the target package and the dependent package can be directly formed based on the target package and the dependent package, that is, the dependencies required by the target package are provided by the dependent package, or the dependencies required by the dependent package are provided by the target package, the dependency level is relatively low, and the dependency relationship between the target package and the dependent package is relatively simple; when the dependency relationship between the target package and the dependent package requires at least one intermediate dependent package to form, for example, the dependency relationship between the target package and the dependent package is that the dependencies required by the target package are provided by the intermediate dependent package, and the dependencies required by the intermediate dependent package are provided by the dependent package, in this way, the dependency level between the target package and the dependent package is relatively high, and the dependency relationship between the target package and the dependent package is relatively complex.
[0085] It should be noted that when the dependency relationship between the target package and the dependent package requires at least one intermediate dependent package to form, the dependency relationship between the target package and the dependent package includes the dependency relationship between the target package and the intermediate dependent package, and the dependency relationship between the intermediate dependent package and the dependent package. Therefore, it can be considered that the dependency relationship between the target package and the dependent package is relatively complex.
[0086] Exemplarily, the dependency relationship is: B1 - B2 - B3, indicating that the target package B1 depends on the package B2 (intermediate dependent package), and the package B2 depends on the dependent package B3. That is, the dependency relationship between the target package B1 and the dependent package B3 includes the dependency relationship between the target package B1 and the package B2, and the dependency relationship between the package B2 and the dependent package B3.
[0087] In practical applications, when the dependencies required by the target package are provided by the dependent package, or the dependencies required by the dependent package are provided by the target package, the dependency level between the target package and the dependent package can be set to 1.
[0088] It should be noted that the dependency level between the target software package and the dependent software packages can be understood as the dependency level corresponding to the dependent software packages. For example, if the dependency level between the target software package and the dependent software packages is 1, it can indicate that the dependency level corresponding to the dependent software packages is 1.
[0089] Among them, the stop condition can be that the dependency level is equal to the query level. The query level can be set by the user according to the query requirements or can be a default preset level. When the query level is set by the user, it can be that when the user inputs the software package information through the software package processing interaction interface of the terminal, the user inputs the query type and the query level, generates a query request based on the software package information, the query type, and the query level, and the terminal can obtain the query level in the query request.
[0090] Specifically, in response to the query request, the terminal searches for the dependency symbol table of the target software package according to the dependency level, the software package information, and the query type included in the query request. After querying the dependent software packages that have a dependency relationship with the target software package, it determines the dependency level between the dependent software packages and the target software package, obtains the query level included in the query request, and when the dependency level is less than the query level, it determines that the dependency level does not meet the stop condition.
[0091] When the dependency level does not meet the stop condition, it means that the currently queried dependent software packages are dependent software packages with a lower dependency level, and it is still necessary to continue querying dependent software packages with a higher dependency level, and then continue to query the dependent software packages that have a dependency relationship with the target software package based on the dependent software packages.
[0092] It should be noted that steps 204 and 206 are executed based on the dependent software packages queried from the dependency symbol table of the target software package, that is, queried based on the target software package. And continuing to query the dependent software packages that have a dependency relationship with the target software package based on the dependent software packages means querying the dependent software packages based on the dependency symbol table of the dependent software packages.
[0093] Specifically, the terminal searches for the reference dependency symbol table of the dependent software packages according to the query type carried in the query request, queries other dependent software packages that have a dependency relationship with the dependent software packages according to the dependencies included in the reference dependency symbol table, and the other dependent software packages queried also have a dependency relationship with the target software package, that is, the other dependent software packages queried are the currently queried dependent software packages. The terminal determines the dependency level between the other dependent software packages and the target software package according to the dependency level between the dependent software packages and the target software package. For example, the dependency level between the other dependent software packages (the currently queried dependent software packages) and the target software package is equal to the dependency level between the dependent software packages and the target software package plus 1. When the dependency level of the currently queried dependent software packages meets the stop condition, dependent software packages with different dependency levels are obtained.
[0094] It should be noted that the reference dependency symbol table can be the first reference dependency symbol table corresponding to the dependency type, or the second reference dependency symbol table corresponding to the dependent type.
[0095] Exemplarily, the query level is 3. By executing step 204 and step 206, the dependent software package C1 is obtained. The dependency level between the dependent software package C1 and the target software package is 1. It can be determined that the dependency level corresponding to the dependent software package C1 does not meet the stop condition. The terminal obtains the reference dependency symbol table C1 of the query type belonging to the dependent software package C1. For the dependencies in the reference dependency symbol table C1, the terminal obtains this dependency in the reference dependency symbol tables of other software packages, and takes the other software package C2 corresponding to the reference dependency symbol table including this dependency as the currently queried dependent software package C2. It can be determined that the dependency level between the dependent software package C2 and the target software package is 2, and the dependency level corresponding to the dependent software package C2 is not equal to the query level. Therefore, the dependency level corresponding to the dependent software package C2 does not meet the stop condition, and the terminal continues to query the dependent software package C3 that has a dependency relationship with the target software package based on the dependent software package C2. The specific process of querying the dependent software package C3 based on the dependent software package C2 is the same as the process of querying the dependent software package C2 based on the dependent software package C1. It can be determined that the dependency level between the dependent software package C3 and the target software package is 3, and the dependency level corresponding to the dependent software package C3 meets the stop condition. The dependent software package C1 corresponding to the dependency level of 1, the dependent software package C2 corresponding to the dependency level of 2, and the dependent software package C3 corresponding to the dependency level of 3 can be obtained.
[0096] It can be understood that step 208 is a process of gradually querying dependent software packages at higher dependency levels according to whether the stop condition is met.
[0097] Step 210: Generate visual dependency data of the target software package based on the target software package and the dependent software packages at different dependency levels.
[0098] Among them, the visual dependency data can be dependency data in text form, image form, or text-image form; the visual dependency data can reflect the dependent software packages that have a dependency relationship with the target software package, and the corresponding dependency levels of each dependent software package.
[0099] Specifically, the terminal can generate visual dependency data in text form based on the target software package and the dependent software packages at different dependency levels, can also generate visual dependency data in image form based on the target software package and the dependent software packages at different dependency levels, and can also obtain visual dependency data in text-image form based on the generated visual dependency data in text form and visual dependency data in image form.
[0100] In some embodiments, the query request is a dependency level query request; based on the target software package and the dependent software packages at different dependency levels, visual dependency data of the target software package is generated, including: generating a dependency relationship tree of the target software package according to the target software package and the dependent software packages at different dependency levels; converting the dependency relationship tree into visual dependency data of a multimedia type.
[0101] Among them, the dependency level query request is used to query the dependent software packages having a dependency relationship with the target software package and the dependency level between the dependent software packages and the target software package.
[0102] The dependency relationship tree can reflect the dependency relationship between the target software package and each dependent software package, as well as the corresponding dependency level of each dependent software package.
[0103] Specifically, the terminal takes the target software package and each dependent software package as nodes, determines the parent-child relationship between the nodes corresponding to the target software package and each dependent software package according to the dependency relationship between the target software package and each dependent software package and the corresponding dependency level of each dependent software package, takes the node corresponding to the target software package as the root node, and generates a dependency relationship tree according to the parent-child relationship between the root node and each node; the terminal performs visual processing on the dependency relationship tree to obtain visual dependency data; in practical applications, performing visual processing on the dependency relationship tree can be to convert the dependency relationship tree into visual dependency data in json format, which is easy to read.
[0104] Exemplarily, if the dependency level corresponding to the dependent software package D2 having a dependency relationship with the target software package D1 is 1, then there is a parent-child relationship between the root node d1 corresponding to the target software package D1 and the node d2 corresponding to the dependent software package D2, and the node d2 is a child node of the root node d1; if the corresponding dependency level of the dependent software package D3 is 1, it can also be determined that the node d3 corresponding to the dependent software package D3 is a child node of the root node d1; if the corresponding dependency level of the dependent software package D4 is 2, and the dependency relationship between the target software package D1 and the dependent software package D4 includes the dependency relationship between the target software package D1 and the dependent software package D2 and the dependency relationship between the dependent software package D2 and the dependent software package D4, then there is a parent-child relationship between the node d4 corresponding to the dependent software package D4 and the node d2 corresponding to the dependent software package D2, and a dependency relationship tree as shown in Figure 3 can be generated.
[0105] In practical applications, the number of dependent software packages at each dependency level may be greater than 1. For example, there are 2 dependent software packages corresponding to the dependency level of 1. Based on these 2 dependent software packages, 5 dependent software packages corresponding to the dependency level of 2 can be queried. Based on these 5 dependent software packages, 2 dependent software packages corresponding to the dependency level of 3 can be queried. In this way, the dependency relationship trees corresponding to the dependent software packages at 3 different dependency levels are as shown inFigure 4 as shown
[0106] In some embodiments, a dependency relationship tree of a target software package is generated based on the target software package and dependency software packages at different dependency levels, including: generating a node connection diagram based on the target software package, dependency software packages at different dependency levels, and the dependency relationships between the target software package and each dependency software package, obtaining a circular path in the node connection diagram, determining a target graph node based on the dependency times of graph nodes in the circular path, obtaining two reference graph nodes connected to the target graph node, selecting a target reference graph node from the two reference graph nodes, disconnecting the edge between the target reference graph node and the target graph node, and obtaining an updated node connection diagram, and generating a dependency relationship tree according to the updated node connection diagram.
[0107] Among them, the node connection diagram includes graph nodes and edges between graph nodes; the target software package and each dependency software package are used as graph nodes, and the edges between graph nodes are determined according to the dependency relationships between the target software package and each dependency software package and the dependency relationships between each dependency software package, so as to generate a node connection diagram.
[0108] The node connection diagram can be traversed in depth first to obtain a circular path in the node connection diagram, and a de - looping operation is performed on each circular path. The de - looping operation is specifically: determining a target graph node in the circular path according to the dependency times, selecting a target reference graph node from the two reference graph nodes connected to the target graph node, and disconnecting the edge between the target graph node and the target reference graph node.
[0109] Specifically, determining the target graph node according to the dependency times of graph nodes in the circular path may be to obtain the dependency times of each graph node in the circular path, and use the graph node with the least dependency times as the target graph node. Among them, the dependency times of a graph node may be the number of times the graph node appears in each obtained circular path, or the number of times the dependency software package corresponding to the graph node is referenced by all software packages; the number of times the dependency software package corresponding to the graph node is referenced by all software packages can be determined based on the metadata file (repodata).
[0110] Selecting a target reference graph node from the two reference graph nodes may be to obtain the dependency times of the reference graph nodes, and use the reference graph node with the smaller dependency times as the target reference graph node; for example, the two reference graph nodes include reference graph node u1 and reference graph node u2, when the dependency times of reference graph node u1 are less than the dependency times of reference graph node u2, reference graph node u1 is used as the target reference graph node.
[0111] Select a target reference graph node from two reference graph nodes. It can also be taking the reference graph node with a higher corresponding dependency level among the two reference graph nodes as the target reference graph node. It can also be randomly selecting a reference graph node from the two reference graph nodes as the target reference graph node.
[0112] It should be noted that the fewer the dependency times of a graph node, the weaker the dependency relationship of the dependency software package corresponding to the graph node. Therefore, when processing software packages, the impact of this dependency software package on other dependency software packages is smaller. Thus, breaking the circular path at the target graph node with the fewest dependency times in the circular path has the least impact on other dependency software packages.
[0113] Disconnect the edge between the target reference graph node and the target graph node to obtain an updated node connection graph and generate a dependency tree. Generating a dependency tree based on the updated node connection graph can be taking each graph node in the updated node connection graph as each node, where the graph node corresponding to the target software package is used as the root node, and determining the connections between the nodes according to the edges between the graph nodes to obtain a dependency tree.
[0114] It should be noted that disconnecting the edge between the target reference graph node and the target graph node is equivalent to disconnecting the dependency relationship between the software package corresponding to the target reference graph node and the software package corresponding to the target graph node, simplifying the dependency relationship between the target software package and each dependency software package and the dependency relationship between each dependency software package. Furthermore, it also reduces the complexity of the dependency tree generated based on the updated node connection graph. When processing software packages, the efficiency of processing software packages can be improved based on this dependency tree.
[0115] In the above embodiment, based on the target software package and dependency software packages at different dependency levels, a dependency tree of the target software package is generated, and then the dependency tree is converted into visual dependency data. Through the visual dependency data corresponding to the dependency tree, the dependency relationship between the target software package and the dependency software packages can be more intuitively understood.
[0116] In the method for processing the above software package, the target software package is obtained by querying the software package information in the query request, the dependency symbol table of the target software package is found according to the query type, and then the dependent software packages that have a dependency relationship with the target software package are queried according to the dependencies included in the dependency symbol table. When the dependency level corresponding to the dependent software package does not meet the stop condition, the dependent software packages that have a dependency relationship with the target software package are continuously queried based on the dependent software package until the dependency level of the queried dependent software package meets the stop condition. In this way, dependent software packages with different dependency levels can be queried. Thus, when it is necessary to make changes to the software package, the dependent software packages at each dependency level that have a dependency relationship with the target software package can be queried without manual repeated calls, improving the efficiency of querying dependency data. In addition, visual dependency data is generated based on the target software package and the dependent software packages at different dependency levels, which can more intuitively understand the dependent software packages at each dependency level that have a dependency relationship with the target software package, improving the convenience of viewing dependency data.
[0117] In some embodiments, before obtaining the target software package corresponding to the software package information in the query request in response to the query request, it further includes: sending a data acquisition request to the server; receiving the metadata file returned by the server in response to the data acquisition request; and parsing the metadata file to obtain a total dependency symbol table including the dependency symbols of each software package.
[0118] Among them, the data acquisition request includes a Uniform Resource Locator (URL), and the URL is used to locate the metadata file; the metadata file is the database file (repodata) of the software package repository.
[0119] Specifically, the terminal obtains the URL of the metadata file, generates a data acquisition request according to the URL, sends the data acquisition request to the server. The server, in response to the data acquisition request, determines the repodata according to the URL included in the data acquisition request, and returns the repodata to the terminal. The terminal receives the repodata and parses the repodata to obtain the dependency symbols of all software packages in the software repository, and can generate a total dependency symbol table according to the correspondence between the package names of the software packages and the dependency symbols.
[0120] After obtaining the total dependency symbol table, the total dependency symbol table can be saved in the form of Redis to improve the efficiency of querying the dependency symbol table of the target software package, as well as the first reference dependency symbol table or the second reference dependency symbol table of each software package; Redis (Remote Dictionary Server) is a key-value pair database.
[0121] In possible application scenarios, such as Figure 5As shown, after the terminal obtains the metadata file (repodata) from the server, it parses the repodata to obtain the dependency symbols of all software packages in the software repository. A total dependency symbol table can be generated according to the correspondence between the package names of the software packages and the dependency symbols, and the total dependency symbol table can be saved in the form of redis to implement the dependency relationship storage service. When querying dependency data, a query request can be sent to the dependency relationship storage service, and the dependency symbol table of the target software package can be returned through the dependency relationship storage service. In addition, the first reference dependency symbol table or the second reference dependency symbol table of each software package can be obtained through the dependency relationship storage service to facilitate the subsequent determination of the dependent software packages.
[0122] In the above embodiment, the metadata file is obtained from the server in advance and parsed to obtain the total dependency symbol table, so that the terminal locally has the total dependency symbol table. In this way, when querying dependency data, there is no need to obtain the dependency symbol table of the query target software package, as well as the first reference dependency symbol table or the second reference dependency symbol table of each software package through the online metadata file, avoiding the network overhead required for querying the dependency symbol table and the problem that the network status affects the online query efficiency, and improving the efficiency of querying the dependency symbol table, the first reference dependency symbol table and the second reference dependency symbol table.
[0123] In some embodiments, the first dependency symbol table includes a first compilation dependency symbol table or a first installation dependency symbol table. When the query type carried in the query request is a dependency type, searching for the first dependency symbol table including the dependencies required by the target software package in the total dependency symbol table includes: when the query type carried in the query request is a compilation dependency type, querying the first compilation dependency symbol table including the dependencies required for compiling the target software package in the total dependency symbol table; when the query type carried in the query request is an installation dependency type, querying the first installation dependency symbol table including the dependencies required for installing the target software package in the total dependency symbol table.
[0124] Among them, the dependency type can be a compilation dependency type or an installation dependency type. The compilation dependency type is the dependency relationship type in which the target software package depends on other software packages during the compilation process, and the installation dependency type is the dependency relationship type in which the target software package depends on other software packages during the installation process.
[0125] Exemplarily, during the installation of software package A1, it is necessary to call the library file k1, and the library file k1 is provided by software package A2. Then, the dependency relationship type between software package A1 and software package A2 is an installation dependency type.
[0126] The first compilation dependency symbol table includes the dependencies required by the target software package when compiling the target software package; the first installation dependency symbol table includes the dependencies required by the target software package when installing the target software package, and the dependencies required by the target software package are provided by other software packages.
[0127] Specifically, when the query type is the compilation dependency type, the terminal obtains all the dependency symbols of the target software package in the total dependency symbol table, queries the dependency symbols belonging to the compilation dependency type among all the dependency symbols of the target software package, and determines the first compilation dependency symbol table according to the dependency symbols belonging to the compilation dependency type.
[0128] Exemplarily, when the query type is the compilation dependency type, look up the src Requires symbol (a dependency symbol belonging to the compilation dependency type) of the target software package in the total dependency symbol table, and determine the first compilation dependency symbol table according to the src Requires symbol of the target software package; the src file is a file that can be compiled, so the dependency symbol of the compilation dependency type is represented by src Requires.
[0129] When the query type is the installation dependency type, the terminal obtains all the dependency symbols of the target software package in the total dependency symbol table, queries the dependency symbols belonging to the installation dependency type among all the dependency symbols of the target software package, and determines the first installation dependency symbol table according to the dependency symbols belonging to the installation dependency type.
[0130] Exemplarily, when the query type is the installation dependency type, look up the bin Requires symbol (a dependency symbol belonging to the installation dependency type) of the target software package in the total dependency symbol table, and determine the first installation dependency symbol table according to the bin Requires symbol of the target software package; the bin file is a binary file that can be directly installed, so the dependency symbol of the installation dependency type is represented by bin Requires.
[0131] In a possible scenario, the dependency type may include the compilation dependency type and the installation dependency type. The first dependency symbol table includes the first compilation dependency symbol table and the first installation dependency symbol table. Furthermore, it is possible to query the dependency data of the target software package in the scenario of compiling the target software package, and it is also possible to query the dependency data of the target software package in the scenario of installing the target software package.
[0132] In the above embodiment, it is possible to obtain the first compilation dependency symbol table corresponding to the dependencies required when compiling the target software package, and it is also possible to obtain the first installation dependency symbol table corresponding to the dependencies required when installing the target software package, so that the dependency data in the scenario of compiling the target software package or in the scenario of installing the target software package can be queried subsequently, which can meet the query requirements of various dependency data and improve the applicability of the software package processing method.
[0133] In some embodiments, the dependency type may be a compilation dependency type or an installation dependency type; when the dependency type is a compilation dependency type, the dependency symbol table is the first compilation dependency symbol table, and querying for dependent packages having a dependency relationship with the target package according to the dependencies included in the dependency symbol table includes: traversing to obtain a first target compilation dependency among the dependencies required by the first compilation dependency symbol table, and obtaining the first reference dependency symbol tables of the respective packages; based on the first reference dependency symbol tables of the respective packages, querying in the respective packages for the dependent packages that provide the first target compilation dependency.
[0134] When the dependency type is an installation dependency type, the dependency symbol table is the first installation dependency symbol table, and querying for dependent packages having a dependency relationship with the target package according to the dependencies included in the dependency symbol table includes: traversing to obtain a first target installation dependency among the dependencies required by the first installation dependency symbol table, and obtaining the first reference dependency symbol tables of the respective packages; based on the first reference dependency symbol tables of the respective packages, querying in the respective packages for the dependent packages that provide the first target installation dependency.
[0135] In some embodiments, the depended-upon type may be a compilation depended-upon type or an installation depended-upon type; querying for dependent packages having a dependency relationship with the target package according to the dependencies included in the dependency symbol table includes: traversing to obtain a second target dependency among the dependencies provided by the second dependency symbol table, and obtaining the second reference compilation dependency symbol tables of the respective packages; based on the second reference compilation dependency symbol tables of the respective packages, querying in the respective packages for the dependent packages that depend on the second target compilation depended-upon item.
[0136] When the depended-upon type is an installation depended-upon type, querying for dependent packages having a dependency relationship with the target package according to the dependencies included in the dependency symbol table includes: traversing to obtain a second target dependency among the dependencies provided by the second dependency symbol table, and obtaining the second reference installation dependency symbol tables of the respective packages; based on the second reference installation dependency symbol tables of the respective packages, querying in the respective packages for the dependent packages that depend on the second target installation depended-upon item.
[0137] Exemplarily, as Figure 6 shown, when the query type is a compilation dependency type, in the total dependency symbol table, look up the src Requires symbol of the target package, determine the first compilation dependency symbol table according to the src Requires symbol of the target package, obtain the Provides symbols of the respective packages to obtain the first reference dependency symbol tables of the respective packages, and determine the dependent packages of the target package based on the first compilation dependency symbol table and the first reference dependency symbol tables of the respective packages, and the dependent packages can provide the dependencies required by the target package during compilation.
[0138] When the query type is the installation dependency type, in the total dependency symbol table, look up the binRequires symbol of the target package. According to the binRequires symbol of the target package, determine the first installation dependency symbol table, obtain the Provides symbols of each package, and get the first reference dependency symbol table of each package. Based on the first installation dependency symbol table and the first reference dependency symbol table of each package, determine the dependent packages of the target package, and these dependent packages can provide the dependencies required by the target package during installation.
[0139] When the query type is the compilation dependency type, in the total dependency symbol table, look up the Provides symbol of the target package. According to the Provides symbol of the target package, determine the second dependency symbol table, obtain the srcRequires symbols of each package, and get the second reference compilation dependency symbol table of each package. Based on the second dependency symbol table and the second reference compilation dependency symbol table of each package, determine the dependent packages of the target package, and the target package can provide the dependencies required by these dependent packages during compilation.
[0140] When the query type is the installation dependent type, in the total dependency symbol table, look up the Provides symbol of the target package. According to the Provides symbol of the target package, determine the second dependency symbol table, obtain the binRequires symbols of each package, and get the second reference installation dependency symbol table of each package. Based on the second dependency symbol table and the second reference installation dependency symbol table of each package, determine the dependent packages of the target package, and the target package can provide the dependencies required by these dependent packages during installation.
[0141] In the above embodiments, it is possible to find the dependent packages that provide the dependencies required by the target package during compilation or installation, and it is also possible to find the dependent packages that require the target package to provide their required dependencies during compilation or installation, which meets the query requirements for various dependency data and improves the applicability of the software package processing method.
[0142] In some embodiments, the dependency relationship between the dependent package and the target package is a direct dependency relationship or an indirect dependency relationship; after querying the dependent packages that have a dependency relationship with the target package according to the dependencies included in the dependency symbol table, it further includes: when the dependency relationship between the dependent package and the target package is a direct dependency relationship, use the preset dependency level as the dependency level between the dependent package and the target package; when the dependency relationship between the dependent package and the target package is an indirect dependency relationship, obtain the number of at least one intermediate dependent package that constitutes the indirect dependency relationship; based on the number of at least one intermediate dependent package and the preset dependency level, determine the dependency level between the dependent package and the target package.
[0143] Taking the query type as the dependency type as an example for illustration, the direct dependency relationship between the dependent package and the target package can reflect that the target package can directly call the dependencies provided by the dependent package; the indirect dependency relationship between the dependent package and the target package can reflect that the target package needs to first call the dependencies of the intermediate dependent package, and then the intermediate dependent package calls the dependencies provided by the dependent package. That is, when there is an indirect dependency relationship between the dependent package and the target package, the dependency relationship between the dependent package and the target package needs to be constituted by at least one intermediate dependent package; it should be noted that the intermediate dependent package with a direct dependency relationship with the target package is also a dependent package.
[0144] Exemplarily, if the target package E1 depends on the dependent package E2, and the dependent package E2 depends on the dependent package E3, then the dependency relationship between the target package E1 and the dependent package E2 is a direct dependency relationship, and the dependency relationship between the target package E1 and the dependent package E3 is an indirect dependency relationship.
[0145] In practical applications, the preset dependency level can be 1, that is, when the dependency relationship between the dependent package and the target package is a direct dependency relationship, the dependency level corresponding to the dependent package is 1; for example, in the above example, the dependency relationship between the target package E1 and the dependent package E2 is a direct dependency relationship, then the dependency level of the dependent package is 1.
[0146] When the dependency relationship between the dependent package and the target package is an indirect dependency relationship, obtain the number of at least one intermediate dependent package that constitutes the indirect dependency relationship, and perform a summation process on the preset dependency level and the number of at least one intermediate dependent package to obtain the dependency level between the dependent package and the target package; for example, in the above example, the intermediate dependent package that constitutes the dependency relationship between the target package E1 and the dependent package E3 is the dependent package E2, that is, the number of intermediate dependent packages is 1. When the preset dependency level is 1, the dependency level corresponding to the dependent package E3 is 2.
[0147] In practical applications, the process of obtaining the dependent packages with different dependency levels in step 208 is a process of gradually querying the dependent packages with higher dependency levels according to whether the stop condition is satisfied. When each dependent package is queried, the dependency level corresponding to the queried dependent package can be determined according to the preset dependency level or the dependency level corresponding to the previously queried dependent package.
[0148] The dependent packages obtained by querying the dependency symbol table of the target package have corresponding dependency levels that are preset dependency levels; for each currently queried dependent package, the dependency level corresponding to the currently queried dependent package can be determined based on the dependency levels corresponding to the previously queried dependent packages that have a direct dependency relationship with the currently queried dependent package; the dependency level corresponding to the currently queried dependent package is 1 level higher than the dependency level corresponding to the previously queried dependent package.
[0149] For example, by querying the dependency symbol table of the target package E1, the dependent package E2 is obtained. The dependency level corresponding to the dependent package E2 is 1. By querying the dependency symbol of the dependent package E2, the dependent package E3 is obtained. The dependency level of the dependent package E3 is equal to the dependency level corresponding to the dependent package E2 plus 1, that is, the dependency level of the dependent package E3 is 2.
[0150] It should be noted that since there can be multiple dependencies related to the target package, there may be the same dependent package corresponding to different dependency levels. For example, the dependencies related to the target package E1 include: dependency f1 and dependency f2. Dependency f1 is provided by the dependent package E2, and dependency f2 is provided by the dependent package E3. Thus, the dependent packages corresponding to the dependency level 1 include the dependent package E2 and the dependent package E3; the dependencies related to the target package E2 include dependency f3 and dependency f4. Dependency f3 is provided by the dependent package E3, and dependency f4 is provided by the dependent package E4. Thus, the dependent packages corresponding to the dependency level 2 include the dependent package E3 and the dependent package E4; the dependency levels of the target package E1, the dependent package E2, the dependent package E3, and the dependent package E4 are as Figure 7 shown. It can be seen that the dependent package E3 corresponds to both the dependency level 1 and the dependency level 2.
[0151] In the above embodiments, the dependency levels corresponding to each dependent package are determined through the direct or indirect dependency relationships between the dependent packages and the target package, so as to facilitate subsequent judgment of whether the stop condition is met. The dependency levels can also more clearly reflect the dependency relationships between each dependent package and the target package.
[0152] In some embodiments, continue to query for dependent packages that have a dependency relationship with the target package based on the dependent packages until the dependency level between the currently queried dependent package and the target package meets the stop condition, and obtain the dependent packages at different dependency levels, including: determining the dependency status of the dependent package; when the dependency status does not meet the circular dependency condition, continue to query for dependent packages that have a dependency relationship with the target package based on the dependent package until the dependency level between the currently queried dependent package and the target package meets the stop condition, or when the dependency status between the currently queried dependent package and the target package meets the circular dependency condition, obtain the dependent packages at different dependency levels.
[0153] Wherein, the dependency status includes a circular dependency status or a non-circular dependency status; the circular dependency status of a dependent package refers to that the target package and the previously queried dependent package need to call the dependencies provided by the dependent package, and the dependent package in turn needs to call the dependencies provided by the target package or the previously queried dependent package.
[0154] Specifically, when the queried dependent package is the target package, or a previously queried dependent package of the target package, it is determined that the dependency status of the queried dependent package is a circular dependency status, and when the dependency status between the dependent package and the target package is a circular dependency status, the circular dependency condition is met; when the queried dependent package is not the target package, nor a previously queried dependent package of the target package, it is determined that the dependency status of the queried dependent package is a non-circular dependency status, and the circular dependency condition is not met.
[0155] Exemplarily, for the target package B1, the previously queried dependent packages include: dependent package B2, dependent package B3, and dependent package B1. The dependency relationship between the target package B1 and the previously queried dependent packages can be expressed as: B1 - B2 - B3 - B4. If the currently queried dependent package is B1, B2, or B3, it is determined that the circular dependency condition is met. For example, if the currently queried dependent package is B2, the dependency relationship can be expressed as: B1 - B2 - B3 - B4 - B2, then there is a circular dependency relationship in B2 - B3 - B4 - B2.
[0156] Exemplarily, such as Figure 8As shown, when the query type is a dependency type, look up the Requires symbol of the target package in the dependency symbol summary table, and determine the dependent packages based on the Requires symbol of the target package and the Provides symbols of each package. Then, determine whether the level of the dependent package is equal to the query level, and determine whether the dependency status of the dependent package meets the circular dependency condition. When neither of them is satisfied, determine the dependent packages at a higher dependency level based on the Requires symbol of the dependent package and the Provides symbols of each package.
[0157] When the query type is a depended-on type, look up the Provides symbol of the target package in the dependency symbol summary table, and determine the dependent packages based on the Provides symbol of the target package and the Requires symbols of each package. Then, determine whether the level of the dependent package is equal to the query level, and determine whether the dependency status of the dependent package meets the circular dependency condition. When neither of them is satisfied, determine the dependent packages at a higher dependency level based on the Provides symbol of the dependent package and the Requires symbols of each package.
[0158] When the level of the queried dependent package is equal to the query level, or the dependency status of the dependent package meets the circular dependency condition, obtain the dependent packages at each different dependency level; specifically, the currently queried dependent package can be discarded, and the dependent packages at each dependency level previously queried are used as the dependent packages at each different dependency level.
[0159] It should be noted that in the case of meeting the circular dependency condition, if the dependent packages are continuously queried, multiple duplicate circular dependency relationships will occur, resulting in a complex dependency relationship among the dependent packages at each dependency level and making it difficult to accurately analyze the output dependency data.
[0160] In the above embodiment, determining whether the circular dependency condition is met based on the dependency status of the dependent package avoids the occurrence of multiple duplicate circular dependency relationships, makes the dependency relationship among the dependent packages at each dependency level clearer, and thus improves the quality of the output dependency data.
[0161] In some embodiments, the query request is a dependency priority query request; for example Figure 9As shown, based on the target software package and the dependent software packages at different dependency levels, generate the visual dependency data of the target software package, including: Step 901, generate a dependency relationship tree of the target software package based on the target software package and the dependent software packages at different dependency levels; the dependency relationship tree includes nodes corresponding to the target software package and each dependent software package respectively; Step 902, traverse the nodes of the dependency levels in the dependency relationship tree to obtain the nodes to be processed; Step 903, when the software package to be processed corresponding to the node to be processed meets the priority processing condition, determine the priority of the software package to be processed; Step 904, generate the visual dependency data of the target software package according to the priorities of the software packages to be processed corresponding to each traversed node to be processed.
[0162] Among them, the dependency priority query request is used to query the dependent software packages that have a dependency relationship with the target software package, the dependency levels between the dependent software packages and the target software package, and the priorities of the dependent software packages; the priority refers to the priority of the change order. The higher the priority of the dependent software package, the earlier the change order of the dependent software package.
[0163] Specifically, the process of generating the dependency relationship tree of the target software package can refer to the description of the specific process of generating the dependency relationship tree in the above embodiment; after obtaining the dependency relationship tree, the terminal traverses the nodes in the dependency relationship tree. For the nodes to be processed traversed, according to the software packages corresponding to the other nodes in the dependency relationship tree with levels lower than the node to be processed, determine whether the software package to be processed corresponding to the node to be processed meets the priority processing condition. When it meets the priority processing condition, determine the priority of the software package to be processed.
[0164] To determine the priority of the software package to be processed, it can be that when the priority of the software package to be processed traversed earlier has been determined and the software package to be processed traversed earlier and the software package to be processed currently traversed correspond to different dependency levels, according to the priority of the software package to be processed traversed earlier, determine the priority of the software package to be processed currently traversed. The priority of the software package to be processed traversed earlier can be 1 level higher than the priority of the software package to be processed currently traversed; that is to say, the priority of the software package to be processed obtained by traversing at a higher dependency level may be lower than the priority of the software package to be processed obtained by traversing at a lower dependency level.
[0165] When the priority of the software package to be processed traversed earlier has not been determined, use the preset priority as the priority of the software package to be processed currently traversed, and the preset priority represents the highest priority.
[0166] When there is a priority for the to-be-processed software package that has been traversed first, and the to-be-processed software package that has been traversed first and the to-be-processed software package currently being traversed correspond to the same dependency level, the priority of the to-be-processed software package that has been traversed first is used as the priority when the to-be-processed software package currently being traversed corresponds to the same dependency level; that is to say, for each to-be-processed software package corresponding to the same dependency level, if the to-be-processed software packages traversed at this dependency level all meet the priority processing conditions, the priorities of the to-be-processed software packages traversed at this dependency level are the same.
[0167] When the to-be-processed software package meets the priority processing conditions, it means that the to-be-processed software package is preferentially processed, which will not affect other software packages with a lower priority than this to-be-processed software package; for example, in a compilation scenario, this to-be-processed software package is preferentially compiled, which will not affect other software packages with a lower priority than this to-be-processed software package.
[0168] For each dependent software package at the same dependency level, it is possible that some dependent software packages meet the priority processing conditions, while some other dependent software packages do not meet the priority processing conditions. As a result, for each dependent software package at the same dependency level, there may be different change orders during software package processing.
[0169] In the above embodiments, by performing node traversal on the dependency levels in the dependency relationship tree to obtain to-be-processed nodes, and determining their priorities when the to-be-processed software packages corresponding to the to-be-processed nodes meet the priority processing conditions, when changing software packages, the change order of each software package can be determined according to the priorities, and the software packages with higher priorities can be preferentially processed, avoiding problems such as errors in the software package change process caused by unclear change order and the unavailability of the software packages after processing, and also avoiding full-scale processing of all dependent software packages, saving the hardware resources occupied by software package processing and improving the accuracy of software package processing.
[0170] In some embodiments, performing node traversal on the dependency levels in the dependency relationship tree to obtain to-be-processed nodes includes: performing level traversal on each dependency level in the dependency relationship tree to obtain to-be-processed dependency levels; performing node traversal on each node in the to-be-processed dependency levels to obtain to-be-processed nodes; after obtaining the to-be-processed nodes, it further includes: when the to-be-processed software package does not meet the priority processing conditions, skipping the to-be-processed nodes until the node traversal of each node in the to-be-processed dependency level is completed, to obtain the priorities of each to-be-processed software package that meets the priority processing conditions; in the case where the level traversal of each dependency level is completed, the priorities of the to-be-processed software packages corresponding to each traversed to-be-processed node are obtained.
[0171] Among them, the to-be-processed dependency level is one of the dependency levels; the to-be-processed node is one of the nodes in the to-be-processed dependency level.
[0172] Specifically, the terminal can perform a hierarchical traversal of each dependency level in ascending order of the dependency level. Therefore, the first dependency level to be processed during traversal can be Dependency Level 1.
[0173] For a to-be-processed node traversed in the to-be-processed dependency level, when the to-be-processed software package corresponding to the to-be-processed node does not meet the priority processing condition, skip the to-be-processed node and continue to traverse the to-be-processed nodes in the to-be-processed dependency level. When the to-be-processed software package corresponding to the to-be-processed node meets the priority processing condition, determine the priority of the to-be-processed software. After completing the node traversal of each node in the to-be-processed dependency level, obtain the priorities of each to-be-processed software package in the to-be-processed dependency level; continue to perform a hierarchical traversal of each dependency level in ascending order of the dependency level to obtain the next to-be-processed dependency level, and in the same manner as obtaining the priorities of each to-be-processed software package in the to-be-processed dependency level above, determine the priorities of the to-be-processed software packages that meet the priority processing condition in the next to-be-processed dependency level traversed until the hierarchical traversal of each dependency level is completed, and obtain the priorities of the to-be-processed software packages corresponding to each traversed to-be-processed node.
[0174] It should be noted that the to-be-processed software packages that meet the priority processing condition in the first to-be-processed dependency level traversed are different from the to-be-processed software packages that meet the priority processing condition in the second to-be-processed dependency level traversed; since there may be the same dependent software package corresponding to different dependency levels, the to-be-processed software packages that do not meet the priority processing condition in the first to-be-processed dependency level traversed may meet the priority processing condition in the second to-be-processed dependency level; in accordance with the method of this embodiment, ultimately all to-be-processed software packages can meet the priority processing condition in different dependency levels, and the priority of each dependent software package can be determined.
[0175] In the above embodiment, by performing a node traversal of each node in each to-be-processed dependency level and determining whether the to-be-processed software packages of each to-be-processed node in the to-be-processed dependency level meet the priority processing condition, if they meet, determine the priority of the to-be-processed software package, and if they do not meet, skip the to-be-processed node, the priority sorting of each to-be-processed software package in the same dependency level is achieved. Furthermore, when changing software packages, the change order of each software package can be determined according to the priority, and the software package with a higher priority can be processed preferentially, avoiding problems such as errors in the software package change process and the inavailability of the processed software package due to an unclear change order, and also avoiding processing all dependent software packages in full, saving the hardware resources occupied by software package processing and improving the accuracy of software package processing.
[0176] In some embodiments, after obtaining the node to be processed, the method further includes: obtaining an associated node in the dependency tree according to the software package to be processed corresponding to the node to be processed; the software package corresponding to the associated node is the software package to be processed; when the dependency level of the associated node is lower than the dependency level of the node to be processed, it is determined that the software package to be processed meets the priority processing condition; when no associated node is obtained, or the dependency level of the obtained associated node is higher than the dependency level of the node to be processed, it is determined that the software package to be processed does not meet the priority processing condition.
[0177] Wherein, the software packages corresponding to the associated node and the node to be processed are the same.
[0178] Specifically, for the node to be processed traversed in the dependency level to be processed, obtain the software package to be processed corresponding to the node to be processed. If the software package to be processed does not belong to other dependency levels, or the software package to be processed also belongs to other dependency levels, and the other dependency levels are lower than the dependency level to be processed, then the software package to be processed meets the priority processing condition. If the software package to be processed also belongs to other dependency levels, and the other dependency levels are higher than the dependency level to be processed, then the software package to be processed does not meet the priority processing condition.
[0179] Exemplarily, as Figure 10 shown; in the case where the dependency level to be processed is 1, when the node to be processed traversed is x1, the software package to be processed corresponding to the node to be processed x1 is B, and the associated node corresponding to the node to be processed x1 is not included in the dependency tree, then the software package to be processed B corresponding to the node to be processed x1 meets the priority processing condition; when the node to be processed traversed is x2, the software package to be processed corresponding to the node to be processed x2 is C, and the associated node x3 corresponding to the node to be processed x2 is included in the dependency tree, and the associated node x3 corresponds to the dependency level 2, and the dependency level 2 is higher than the dependency level 1, so the software package to be processed C does not meet the priority processing condition.
[0180] In the case where the dependency level to be processed is 2, when the node to be processed traversed is x3, the dependency level of the associated node x1 corresponding to the node to be processed x3 is lower than the dependency level of the node to be processed x3, then the software package to be processed C corresponding to the node to be processed x3 meets the priority processing condition; when the node to be processed traversed is x4, the software package to be processed corresponding to the node to be processed x4 is D, and the associated node x6 corresponding to the node to be processed x4 is included in the dependency tree, and the associated node x6 corresponds to the dependency level 3, and the dependency level 3 is higher than the dependency level 2, so the software package to be processed D does not meet the priority processing condition; when the node to be processed traversed is x5, the software package to be processed corresponding to the node to be processed x5 is E, and the associated node x7 corresponding to the node to be processed x5 is included in the dependency tree, and the associated node x7 corresponds to the dependency level 3, and the dependency level 3 is higher than the dependency level 2, so the software package to be processed E does not meet the priority processing condition.
[0181] When the dependency level to be processed is 3, when traversing to the node x6 to be processed, if the dependency level of the associated node x4 corresponding to the node x6 to be processed is lower than the dependency level of the node x6 to be processed, then the package D to be processed corresponding to the node x6 to be processed meets the priority processing condition; when traversing to the node x7 to be processed, if the dependency level of the associated node x5 corresponding to the node x7 to be processed is lower than the dependency level of the node x7 to be processed, then the package E to be processed corresponding to the node x7 to be processed meets the priority processing condition.
[0182] Exemplarily, as Figure 11 shown, the processing method of the package includes three processing stages. The first stage is to cache the dependency symbol table locally. The second stage is to find the dependent packages at each dependency level. The third stage is to generate a dependency relationship tree based on the dependent packages at each dependency level, determine the priority of each dependent package, and generate visual dependency data according to the priority of each dependent package.
[0183] In the above embodiment, according to the dependency level of the package to be processed in the dependency relationship tree, it is determined whether the package to be processed currently traversed meets the priority processing condition, which improves the accuracy of determining the priority of the package to be processed.
[0184] In some embodiments, the processing method of the package can be applied to finding the dependency data when compiling the target package, finding the dependency data when installing the target package, finding the dependency data of the compiled dependencies of the target package, and finding the dependency data of the installed dependencies of the target package; as Figure 12 shown, the processing method of the package can be applied to the package processing system. The package processing system includes a dependency relationship storage service, a dependency relationship parsing service, and a priority sorting service.
[0185] The terminal pre-generates a data acquisition request according to the URL and sends the data acquisition request to the server. The server responds to the data acquisition request, determines the repodata (metadata file) according to the URL included in the data acquisition request, and returns the repodata to the terminal. The terminal receives the repodata and parses the repodata to obtain the dependency symbols of all packages in the software repository, and can generate a total dependency symbol table according to the correspondence between the package names of the packages and the dependency symbols, and implement the dependency relationship storage service based on the total dependency symbol table.
[0186] Taking the example of querying the dependency data when compiling the target software package, the terminal generates a query request based on the compilation dependency type, query level, and package name. The query level is 2. The terminal queries the target software package Y0 corresponding to the package name through the dependency relationship storage service, searches for the src Requires symbol of the target software package Y0 to obtain the first compilation dependency symbol table, and searches for the Provides symbol of each software package to obtain the first reference dependency symbol table of each software package. Then, it sends the first compilation dependency symbol table and the first reference dependency symbol table to the dependency relationship parsing service. Through the dependency relationship parsing service, it determines each dependent software package of the target software package Y0 (dependent software package Y1 and dependent software package Y2), and the dependency level of each dependent software package is 1.
[0187] Since the query level is 2, continue to search for dependent software packages based on the dependent software packages with a dependency level of 1. For the dependent software package Y1, the terminal searches for the src Requires symbol of the dependent software package Y1 through the dependency relationship storage service, and searches for the Provides symbol of each software package. It sends the src Requires symbol of the dependent software package Y1 and the Provides symbol of each software package to the dependency relationship parsing service. Through the dependency relationship parsing service, it finds the dependent software packages Y3 and Y4 with a dependency level of 2. Similarly, based on the dependent software package Y2, it finds the dependent software package Y5 with a dependency level of 2, which meets the stop condition, and obtains the dependent software packages with dependency levels 1 and 2.
[0188] The terminal generates a dependency relationship tree through the dependency relationship parsing service according to the target software package Y0, the dependent software packages with dependency levels 1 and 2, and the dependency relationships between the target software package Y0 and each dependent software package. It sends the dependency relationship tree to the priority sorting service. Through the priority sorting service, it processes the dependency relationship tree to obtain the priorities of each dependent software package, and outputs and generates the visual dependency data of the target software package according to the priorities of each dependent software package.
[0189] In some embodiments, as Figure 13 shown, the processing method of the software package includes:
[0190] Step 1301, send a data acquisition request to the server; receive the metadata file returned by the server in response to the data acquisition request; parse the metadata file to obtain the total dependency symbol table including the dependency symbols of each software package.
[0191] Step 1302, in response to the query request, obtain the target software package corresponding to the software package information in the query request.
[0192] Step 1303, when the query type carried in the query request is the compilation dependency type, query in the total dependency symbol table for the first compilation dependency symbol table that includes the dependencies required for the compilation target software package; when the query type carried in the query request is the installation dependency type, query in the total dependency symbol table for the first installation dependency symbol table that includes the dependencies required for the installation target software package; when the query type carried in the query request is the depended type, search in the total dependency symbol table for the second dependency symbol table that includes the dependencies provided by the target software package; the dependency symbol table includes the first compilation dependency symbol table, or the first installation dependency symbol table, or the second dependency symbol table.
[0193] Step 1304A, when the dependency symbol table includes the dependencies required for the target software package, traverse the dependencies required for the target software package to obtain the first target dependency; obtain the first reference dependency symbol table for each software package; the first reference dependency symbol table is used to represent the dependencies provided by the software package; based on the first reference dependency symbol table for each software package, query in each software package for the dependent software package that provides the first target dependency.
[0194] Step 1304B, when the dependency symbol table includes the dependencies provided by the target software package, traverse the dependencies provided by the target software package to obtain the second target dependency; obtain the second reference dependency symbol table for each software package; the second reference dependency symbol table is used to represent the dependencies required by the software package; based on the second reference dependency symbol table for each software package, query in each software package for the dependent software package that requires the second target dependency.
[0195] Step 1305, when the dependency relationship between the dependent software package and the target software package is a direct dependency relationship, use the preset dependency level as the dependency level between the dependent software package and the target software package; when the dependency relationship between the dependent software package and the target software package is an indirect dependency relationship, obtain the number of at least one intermediate dependent software package that constitutes the indirect dependency relationship; based on the number of at least one intermediate dependent software package and the preset dependency level, determine the dependency level between the dependent software package and the target software package.
[0196] Step 1306, when the dependency level between the dependent software package and the target software package does not meet the stop condition, determine the dependency status of the dependent software package; when the dependency status does not meet the cyclic dependency condition, continue to query for the dependent software package that has a dependency relationship with the target software package based on the dependent software package until the dependency level between the currently queried dependent software package and the target software package meets the stop condition, or the dependency status between the currently queried dependent software package and the target software package meets the cyclic dependency condition, to obtain the dependent software packages at different dependency levels.
[0197] Step 1307A: When the query request is a dependency hierarchy query request, generate a dependency relationship tree of the target software package based on the target software package and the dependent software packages at different dependency levels; convert the dependency relationship tree into visual dependency data of a multimedia type; generate visual dependency data of the target software package based on the target software package and the dependent software packages at different dependency levels.
[0198] Step 1307B1: When the query request is a dependency priority query request, generate a dependency relationship tree of the target software package based on the target software package and the dependent software packages at different dependency levels; the dependency relationship tree includes nodes corresponding to the target software package and each dependent software package; perform a hierarchical traversal of each dependency level in the dependency relationship tree to obtain the to-be-processed dependency level; perform a node traversal of each node in the to-be-processed dependency level to obtain the to-be-processed node.
[0199] Step 1307B2: Obtain associated nodes in the dependency relationship tree according to the to-be-processed software package corresponding to the to-be-processed node; the software package corresponding to the associated node is the to-be-processed software package; when the dependency level of the associated node is lower than the dependency level of the to-be-processed node, determine that the to-be-processed software package meets the priority processing condition; when no associated node is obtained, or the dependency level of the obtained associated node is higher than the dependency level of the to-be-processed node, determine that the to-be-processed software package does not meet the priority processing condition; when the to-be-processed software package corresponding to the to-be-processed node meets the priority processing condition, determine the priority of the to-be-processed software package; when the to-be-processed software package does not meet the priority processing condition, skip the to-be-processed node until the node traversal of each node in the to-be-processed dependency level is completed to obtain the priorities of the to-be-processed software packages that meet the priority processing condition.
[0200] Step 1307B3: When the hierarchical traversal of each dependency level is completed, obtain the priorities of the to-be-processed software packages corresponding to the traversed to-be-processed nodes; generate visual dependency data of the target software package based on the priorities of the to-be-processed software packages corresponding to the traversed to-be-processed nodes.
[0201] In the method for processing the above software package, the target software package is obtained by querying the software package information in the query request, the dependency symbol table of the target software package is found according to the query type, and then the dependent software packages having a dependency relationship with the target software package are queried according to the dependencies included in the dependency symbol table. When the dependency level corresponding to the dependent software package does not meet the stop condition, the dependent software packages having a dependency relationship with the target software package are continuously queried based on the dependent software package until the dependency level of the queried dependent software package meets the stop condition. In this way, the dependent software packages at different dependency levels can be queried. Thus, when it is necessary to change the software package, the dependent software packages at each dependency level having a dependency relationship with the target software package can be queried without manually calling repeatedly, which improves the efficiency of querying dependency data. In addition, visual dependency data is generated based on the target software package and the dependent software packages at different dependency levels, which can more intuitively understand the dependent software packages at each dependency level having a dependency relationship with the target software package and improves the convenience of viewing dependency data.
[0202] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are displayed in sequence according to the indications of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps does not have a strict order restriction, 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 moment, but can be executed at different moments. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or steps or stages in other steps.
[0203] Based on the same inventive concept, an embodiment of the present application further provides a software package processing device for implementing the above-mentioned software package processing method. The implementation solution provided by this device to solve the problem is similar to the implementation solution described in the above method. Therefore, the specific limitations in one or more embodiments of the software package processing device provided below can refer to the limitations on the software package processing method in the above text and will not be repeated here.
[0204] In some embodiments, as Figure 14 shown, a software package processing device is provided, including: a target software package obtaining module 1401, a dependency symbol table searching module 1402, a first dependent software package querying module 1403, a second dependent software package querying module 1404, and a dependency data generating module 1405, where:
[0205] The target software package obtaining module 1401 is configured to obtain a target software package corresponding to the software package information in the query request in response to the query request;
[0206] The dependency symbol table lookup module 1402 is used to look up the dependency symbol table of the target software package according to the query type carried in the query request;
[0207] The first dependent software package query module 1403 is used to query the dependent software packages that have a dependency relationship with the target software package according to the dependencies included in the dependency symbol table;
[0208] The second dependent software package query module 1404 is used to, when the dependency level between the dependent software package and the target software package does not meet the stop condition, continue to query the dependent software packages that have a dependency relationship with the target software package based on the dependent software package until the dependency level between the currently queried dependent software package and the target software package meets the stop condition, so as to obtain the dependent software packages at different dependency levels;
[0209] The dependency data generation module 1405 is used to generate the visual dependency data of the target software package based on the target software package and the dependent software packages at different dependency levels.
[0210] In some embodiments, the dependency symbol table lookup module 1402 is further used to, when the query type carried in the query request is the dependency type, look up the first dependency symbol table including the dependencies required by the target software package in the total dependency symbol table; when the query type carried in the query request is the depended type, look up the second dependency symbol table including the dependencies provided by the target software package in the total dependency symbol table.
[0211] In some embodiments, the first dependency symbol table includes a first compilation dependency symbol table or a first installation dependency symbol table; the dependency symbol table lookup module 1402 is further used to, when the query type carried in the query request is the compilation dependency type, query the first compilation dependency symbol table including the dependencies required for compiling the target software package in the total dependency symbol table; when the query type carried in the query request is the installation dependency type, query the first installation dependency symbol table including the dependencies required for installing the target software package in the total dependency symbol table.
[0212] In some embodiments, the processing device for software packages further includes a total dependency symbol table acquisition module, which is used to
[0213] send a data acquisition request to the server; receive the metadata file returned by the server in response to the data acquisition request; parse the metadata file to obtain the total dependency symbol table including the dependency symbols of each software package.
[0214] In some embodiments, the first dependent package query module 1403 is further configured to, when the dependency symbol table includes the dependencies required by the target package, traverse the dependencies required by the target package to obtain a first target dependency; obtain a first reference dependency symbol table for each package; the first reference dependency symbol table is used to represent the dependencies provided by the package; based on the first reference dependency symbol tables of the packages, query the dependent packages that provide the first target dependency among the packages.
[0215] In some embodiments, the first dependent package query module 1403 is further configured to, when the dependency symbol table includes the dependencies provided by the target package, traverse the dependencies provided by the target package to obtain a second target dependency; obtain a second reference dependency symbol table for each package; the second reference dependency symbol table is used to represent the dependencies required by the package; based on the second reference dependency symbol tables of the packages, query the dependent packages that require the second target dependency among the packages.
[0216] In some embodiments, the dependency relationship between the dependent package and the target package is a direct dependency relationship or an indirect dependency relationship; the processing device of the package further includes a dependency symbol total table acquisition module, a dependency level determination module, which is configured to, when the dependency relationship between the dependent package and the target package is a direct dependency relationship, use a preset dependency level as the dependency level between the dependent package and the target package; when the dependency relationship between the dependent package and the target package is an indirect dependency relationship, obtain the number of at least one intermediate dependent package that constitutes the indirect dependency relationship; based on the number of at least one intermediate dependent package and the preset dependency level, determine the dependency level between the dependent package and the target package.
[0217] In some embodiments, the second dependent package query module 1404 is further configured to determine the dependency status of the dependent package; when the dependency status does not meet the cyclic dependency condition, continue to query the dependent packages that have a dependency relationship with the target package based on the dependent package until the dependency level between the currently queried dependent package and the target package meets the stop condition, or the dependency status between the currently queried dependent package and the target package meets the cyclic dependency condition, and obtain the dependent packages at different dependency levels.
[0218] In some embodiments, the query request is a dependency level query request; the dependency data generation module 1405 is further configured to generate a dependency relationship tree of the target package according to the target package and the dependent packages at different dependency levels; convert the dependency relationship tree into visualization dependency data of a multimedia type.
[0219] In some embodiments, the query request is a dependency priority query request; the dependency data generation module 1405 is further configured to generate a dependency relationship tree of the target software package based on the target software package and the dependency software packages at different dependency levels; the dependency relationship tree includes nodes corresponding to the target software package and each dependency software package; traverse the nodes at the dependency levels in the dependency relationship tree to obtain the nodes to be processed; when the software package to be processed corresponding to the node to be processed meets the priority processing condition, determine the priority of the software package to be processed; generate visual dependency data of the target software package according to the priorities of the software packages to be processed corresponding to the traversed nodes to be processed.
[0220] In some embodiments, the dependency data generation module 1405 is further configured to traverse each dependency level in the dependency relationship tree to obtain the dependency levels to be processed; traverse the nodes in the dependency levels to be processed to obtain the nodes to be processed; when the software package to be processed does not meet the priority processing condition, skip the node to be processed until the traversal of all nodes in the dependency level to be processed is completed, and obtain the priorities of the software packages to be processed that meet the priority processing condition; when the traversal of all dependency levels is completed, obtain the priorities of the software packages to be processed corresponding to the traversed nodes to be processed.
[0221] In some embodiments, the dependency data generation module 1405 is further configured to obtain associated nodes in the dependency relationship tree according to the software package to be processed corresponding to the node to be processed; the software package corresponding to the associated node is the software package to be processed; when the dependency level to which the associated node belongs is lower than the dependency level to which the node to be processed belongs, determine that the software package to be processed meets the priority processing condition; when no associated node is obtained, or the dependency level to which the obtained associated node belongs is higher than the dependency level to which the node to be processed belongs, determine that the software package to be processed does not meet the priority processing condition.
[0222] Each module in the above software package processing device can be implemented in whole or in part by software packages, hardware, and their combinations. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory of the computer device in the form of software packages, so that the processor can call and execute the operations corresponding to the above modules.
[0223] In some embodiments, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as Figure 15As shown in the figure. 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 computer programs. The internal memory provides an environment for the operation of the operating system and computer programs 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 external terminals in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a processing method for a software package. 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 covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, touchpad, or mouse, etc.
[0224] Those skilled in the art can understand that Figure 15 the structure shown in the figure is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0225] In some embodiments, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented:
[0226] In response to a query request, obtain a target software package corresponding to the software package information in the query request; find the dependency symbol table of the target software package according to the query type carried in the query request; query the dependent software packages that have a dependency relationship with the target software package according to the dependencies included in the dependency symbol table; when the dependency level between the dependent software package and the target software package does not meet the stop condition, continue to query the dependent software packages that have a dependency relationship with the target software package based on the dependent software package until the dependency level between the currently queried dependent software package and the target software package meets the stop condition, and obtain the dependent software packages at different dependency levels; based on the target software package and the dependent software packages at different dependency levels, generate visual dependency data for the target software package.
[0227] In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0228] In response to a query request, obtain a target software package corresponding to the software package information in the query request; find the dependency symbol table of the target software package according to the query type carried in the query request; query for dependent software packages that have a dependency relationship with the target software package according to the dependencies included in the dependency symbol table; when the dependency level between the dependent software package and the target software package does not meet the stop condition, continue to query for dependent software packages that have a dependency relationship with the target software package based on the dependent software package until the dependency level between the currently queried dependent software package and the target software package meets the stop condition, to obtain dependent software packages at different dependency levels; generate visual dependency data of the target software package based on the target software package and the dependent software packages at different dependency levels.
[0229] In some embodiments, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the following steps are implemented:
[0230] In response to a query request, obtain a target software package corresponding to the software package information in the query request; find the dependency symbol table of the target software package according to the query type carried in the query request; query for dependent software packages that have a dependency relationship with the target software package according to the dependencies included in the dependency symbol table; when the dependency level between the dependent software package and the target software package does not meet the stop condition, continue to query for dependent software packages that have a dependency relationship with the target software package based on the dependent software package until the dependency level between the currently queried dependent software package and the target software package meets the stop condition, to obtain dependent software packages at different dependency levels; generate visual dependency data of the target software package based on the target software package and the dependent software packages at different dependency levels.
[0231] 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.
[0232] 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 and volatile memories. 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, etc., without limitation.
[0233] 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 described in this specification.
[0234] The above-described embodiments merely represent several implementation manners of the present application. The description 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 belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A method for processing a software package, characterized in that, The method includes: In response to a query request, obtaining a target software package corresponding to the software package information in the query request; Searching for a dependency symbol table of the target software package according to the query type carried in the query request; Querying for dependent software packages that have a dependency relationship with the target software package according to the dependencies included in the dependency symbol table; When the dependency level between the dependent software package and the target software package does not meet the stop condition, continuously querying for dependent software packages that have a dependency relationship with the target software package based on the dependent software package until the dependency level between the currently queried dependent software package and the target software package meets the stop condition, to obtain dependent software packages at different dependency levels; Generating visual dependency data of the target software package based on the target software package and the dependent software packages at different dependency levels.
2. The method according to claim 1, characterized in that, The searching for a dependency symbol table of the target software package according to the query type carried in the query request includes: When the query type carried in the query request is a dependency type, searching for a first dependency symbol table that includes the dependencies required by the target software package in the total dependency symbol table; When the query type carried in the query request is a depended-on type, searching for a second dependency symbol table that includes the dependencies provided by the target software package in the total dependency symbol table.
3. The method according to claim 2, wherein The first dependency symbol table includes a first compilation dependency symbol table or a first installation dependency symbol table; The searching for a first dependency symbol table that includes the dependencies required by the target software package in the total dependency symbol table when the query type carried in the query request is a dependency type includes: When the query type carried in the query request is a compilation dependency type, querying for a first compilation dependency symbol table that includes the dependencies required for compiling the target software package in the total dependency symbol table; When the query type carried in the query request is an installation dependency type, querying for a first installation dependency symbol table that includes the dependencies required for installing the target software package in the total dependency symbol table.
4. The method according to claim 3, wherein Before the obtaining a target software package corresponding to the software package information in the query request in response to the query request, it further includes: Sending a data acquisition request to the server; Receiving a metadata file returned by the server in response to the data acquisition request; Parsing the metadata file to obtain the total dependency symbol table including the dependency symbols of each software package.
5. The method according to claim 1, characterized in that The querying for dependent software packages that have a dependency relationship with the target software package according to the dependencies included in the dependency symbol table includes: When the dependency symbol table includes the dependencies required by the target software package, traversing to obtain a first target dependency item among the dependencies required by the target software package; Obtaining a first reference dependency symbol table of each software package; the first reference dependency symbol table is used to represent the dependencies provided by the software package; Based on the first reference dependency symbol tables of the software packages, querying for the dependent software packages that provide the first target dependency item among the software packages.
6. The method according to claim 1, wherein The querying for dependent software packages that have a dependency relationship with the target software package according to the dependencies included in the dependency symbol table includes: When the dependency symbol table includes the dependencies provided by the target software package, traverse the dependencies provided by the target software package to obtain a second target dependency; Obtain a second reference dependency symbol table for each software package; the second reference dependency symbol table is used to represent the dependencies required by the software package; Based on the second reference dependency symbol tables of the software packages, query the dependent software packages that require the second target dependency in the software packages.
7. The method according to claim 1, characterized in that The dependency relationship between the dependent software package and the target software package is a direct dependency relationship or an indirect dependency relationship; After querying the dependent software packages that have a dependency relationship with the target software package according to the dependencies included in the dependency symbol table, further include: When the dependency relationship between the dependent software package and the target software package is the direct dependency relationship, use the preset dependency level as the dependency level between the dependent software package and the target software package; When the dependency relationship between the dependent software package and the target software package is the indirect dependency relationship, obtain the number of at least one intermediate dependent software package that constitutes the indirect dependency relationship; Based on the number of the at least one intermediate dependent software package and the preset dependency level, determine the dependency level between the dependent software package and the target software package.
8. The method according to claim 1, characterized in that Continuing to query the dependent software packages that have a dependency relationship with the target software package based on the dependent software package until the dependency level between the currently queried dependent software package and the target software package meets the stop condition, to obtain the dependent software packages at different dependency levels, including: Determine the dependency status of the dependent software package; When the dependency status does not meet the circular dependency condition, continue to query the dependent software packages that have a dependency relationship with the target software package based on the dependent software package until the dependency level between the currently queried dependent software package and the target software package meets the stop condition, or the dependency status between the currently queried dependent software package and the target software package meets the circular dependency condition, to obtain the dependent software packages at different dependency levels.
9. The method according to any one of claims 1 to 8, characterized in that, The query request is a dependency level query request; generating the visual dependency data of the target software package based on the target software package and the dependent software packages at different dependency levels includes: Generate a dependency relationship tree of the target software package according to the target software package and the dependent software packages at different dependency levels; Convert the dependency relationship tree into visual dependency data of a multimedia type.
10. The method according to any one of claims 1 to 8, characterized in that, The query request is a dependency priority query request; Generating the visual dependency data of the target software package based on the target software package and the dependent software packages at different dependency levels includes: Generate a dependency relationship tree of the target software package based on the target software package and the dependent software packages at different dependency levels; the dependency relationship tree includes nodes corresponding to the target software package and each dependent software package; Perform node traversal on the dependency levels in the dependency relationship tree to obtain the nodes to be processed; When the software package to be processed corresponding to the node to be processed meets the priority processing condition, determine the priority of the software package to be processed; Generate the visual dependency data of the target software package according to the priorities of the software packages to be processed corresponding to the traversed nodes to be processed.
11. The method according to claim 10, wherein The traversing the nodes in the dependency level of the dependency relationship tree to obtain the nodes to be processed includes: Performing a hierarchical traversal on each dependency level in the dependency relationship tree to obtain the dependency levels to be processed; Performing a node traversal on each node in the dependency level to be processed to obtain the nodes to be processed; After obtaining the nodes to be processed, it further includes: When the software package to be processed does not meet the priority processing condition, skip the node to be processed until the node traversal of each node in the dependency level to be processed is completed, and obtain the priorities of the software packages to be processed that meet the priority processing condition; In the case where the hierarchical traversal of each dependency level is completed, obtain the priorities of the software packages to be processed corresponding to the traversed nodes to be processed.
12. The method according to claim 11, wherein After obtaining the nodes to be processed, it further includes: Obtain the associated node in the dependency relationship tree according to the software package to be processed corresponding to the node to be processed; the software package corresponding to the associated node is the software package to be processed; When the dependency level of the associated node is lower than the dependency level of the node to be processed, determine that the software package to be processed meets the priority processing condition; When the associated node is not obtained, or the dependency level of the obtained associated node is higher than the dependency level of the node to be processed, determine that the software package to be processed does not meet the priority processing condition.
13. A processing device for a software package, characterized in that, The device includes: A target software package acquisition module, configured to acquire a target software package corresponding to the software package information in the query request in response to the query request; A dependency symbol table lookup module, configured to look up the dependency symbol table of the target software package according to the query type carried in the query request; A first dependent software package query module, configured to query the dependent software packages having a dependency relationship with the target software package according to the dependencies included in the dependency symbol table; A second dependent software package query module, configured to, when the dependency level between the dependent software package and the target software package does not meet the stop condition, continue to query the dependent software packages having a dependency relationship with the target software package based on the dependent software package until the dependency level between the currently queried dependent software package and the target software package meets the stop condition, and obtain the dependent software packages of each different dependency level; A dependency data generation module, configured to generate the visual dependency data of the target software package based on the target software package and the dependent software packages of each different dependency level.
14. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 12.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 12.
16. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 12.
Citation Information
Cited By
Software package compiling method, system and device and medium
CN121116320A