Software package installation sequence generation method and device, equipment and product

By establishing a virtual environment in the target system and combining and homologous software package groups, the problem of low reliability of large-scale software package installation sequence generation in the prior art is solved, and efficient and reliable installation sorting is achieved without modifying the actual environment.

CN120353477AActive Publication Date: 2025-07-22KYLIN CORP
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510804360.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-17
Publication Date
2025-07-22
Estimated Expiration
2045-06-17

AI Technical Summary

Technical Problem

In the prior art, when installing large-scale software packages, it is impossible to generate the software package installation sequence without modifying the actual installation environment, and the dependency checking takes a long time and is low in reliability.

Method used

Establish the virtual environment of the target system, group the same source code package groups according to the same source code package, traverse and merge them into the virtual environment, generate the software package group installation sort, and use the virtual environment to perform dependency checks.

Benefits of technology

Without modifying the actual system environment, the software package installation sequence is generated, which shortens the installation time and improves reliability, ensuring the security and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120353477A_ABST
    Figure CN120353477A_ABST
Patent Text Reader

Abstract

The invention discloses a method, a device, equipment and a product for generating a software package installation sequence. The method comprises the following steps: establishing a virtual environment of a target system for installing a software package; grouping the to-be-installed software package sequence according to the same source code package to obtain a homologous software package group sequence; and traversing the homologous software package groups in the homologous software package group sequence, merging the homologous software package groups into the virtual environment, and obtaining a software package group installation sequence. The invention discloses a method, a device, equipment and a product for generating a software package installation sequence, and the method comprises the steps: carrying out the grouping according to the same source code package, traversing the homologous software package group, merging the homologous software package group into a virtual environment, generating a software package group installation sequence, and carrying out the installation of the software package group. The software package installation sequence can be generated on the premise that the actual system installation environment is not modified, and the method has the advantages of being short in consumed time and high in reliability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of system management, and particularly relates to a method, device, equipment and product for generating the installation sequence of software packages. Background Art

[0002] With the rapid development of information technology, a large number of software packages are commonly used in operating system updates, cloud computing environment construction, and distributed system operation and maintenance. Under the existing technical conditions, when installing a large number of software packages, due to the relatively complex dependency relationships between software packages, the existing software package installation methods cannot generate the installation sequence of software packages without modifying the actual installation environment, and when performing a chronological dependency relationship check on the installed software packages, there are problems such as long checking time consumption and low reliability of the check results. Summary of the Invention

[0003] In view of this, the present invention aims to overcome the defects in the prior art and proposes a method, device, equipment and product for generating the installation sequence of software packages.

[0004] To achieve the above object, the technical solution of the present invention is realized as follows: In a first aspect, the present invention discloses a method for generating the installation sequence of software packages, including: Establish a virtual environment for the target system of the software packages to be installed, where the virtual environment includes: the names of all the installed software packages in the target system and the corresponding constraint conditions; Group the sequence of software packages to be installed according to the same source code package to obtain a sequence of homologous software package groups; Traverse the homologous software package groups in the sequence of homologous software package groups, merge them into the virtual environment, and obtain the installation sorting of the software package groups, including: starting from the first homologous software package group in the sequence of homologous software package groups, merge the software packages in the homologous software package group into the virtual environment. If all the software packages in the merged virtual environment are self-consistent in relationships, add the currently merged homologous software package group to the installation sorting of the software package groups, and save the current virtual environment as the target virtual environment for the next homologous software package group to merge; if there are software packages in the merged virtual environment with inconsistent relationships, re-arrange the currently merged homologous software package group to the end of the sequence of homologous software package groups, and restore the current virtual environment as the target virtual environment for the next homologous software package group to merge.

[0005] In an embodiment of the present invention, merging the software packages in the homologous software package group into the virtual environment includes: adding the name of the software package and the corresponding constraint conditions to the virtual environment.

[0006] In one embodiment of the present invention, merging packages within a group of homologous software packages into a virtual environment includes: if the same package already exists in the virtual environment, it is overwritten according to the method of full replacement or only upgrading while retaining the old version, and the corresponding version number and constraints are updated.

[0007] In one embodiment of the present invention, all packages within the virtual environment are self-consistent in relationships, including: the current virtual environment satisfies the constraints of any package within the current virtual environment; There is a package within the virtual environment with inconsistent relationships, including: the current virtual environment does not satisfy the constraints of at least one package within the current virtual environment.

[0008] In one embodiment of the present invention, traversing the groups of homologous software packages in the sequence of groups of homologous software packages and merging them into the virtual environment further includes: if the groups of homologous software packages reach a continuous preset number of times and are rearranged to the end of the sequence of groups of homologous software packages, then the packages in all the remaining groups of homologous software packages in the sequence of groups of homologous software packages are uniformly merged into the virtual environment; if all packages within the merged virtual environment are self-consistent in relationships, then all the packages merged this time form a circularly dependent package group, and the circularly dependent package group is added to the installation sorting of package groups; if there is a package within the merged virtual environment with inconsistent relationships, then all the packages merged this time are recorded in the list of packages that cannot be installed.

[0009] In one embodiment of the present invention, within the installation sorting of package groups, the packages within the package group are sorted according to the topological relationship.

[0010] In one embodiment of the present invention, before restoring the current virtual environment, it further includes: creating an image layer of the virtual environment for recording the virtual environment state and supporting transactional rollback.

[0011] In a second aspect, the present invention discloses a device for generating the installation order of software packages. The device includes: A virtual environment establishment module for establishing a virtual environment of the target system for installing software packages, where the virtual environment includes: the names of all installed software packages in the target system and the corresponding constraints; A grouping module for grouping the sequence of software packages to be installed according to the same source code package to obtain a sequence of groups of homologous software packages; Generate a software package group installation order module, which is used to traverse the homologous software package groups in the homologous software package group sequence, merge them into a virtual environment, and obtain the software package group installation sorting, including: starting from the first homologous software package group in the homologous software package group sequence, merging the software packages in the homologous software package group into the virtual environment. If all the software packages in the merged virtual environment are self-consistent in terms of relationships, add the currently merged homologous software package group to the software package group installation sorting, and save the current virtual environment as the target virtual environment for merging the next homologous software package group. If there are software packages in the merged virtual environment with inconsistent relationships, re-arrange the currently merged homologous software package group to the end of the homologous software package group sequence, and restore the current virtual environment as the target virtual environment for merging the next homologous software package group.

[0012] In a third aspect, the present invention discloses an electronic device, including: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors are caused to execute the above method.

[0013] In a fourth aspect, the present invention discloses a computer program product, including a computer program which, when executed by a processor, implements the above method.

[0014] Compared with the prior art, the present invention has the following advantages: The present invention discloses a method, apparatus, device, and product for generating a software package installation order, including: establishing a virtual environment for the target system of the software package to be installed; grouping the sequence of software packages to be installed according to the same source code package to obtain a homologous software package group sequence; traversing the homologous software package groups in the homologous software package group sequence, merging them into the virtual environment, and obtaining the software package group installation sorting. The present invention discloses a method, apparatus, device, and product for generating a software package installation order. By establishing a virtual environment for the target system of the software package to be installed, grouping according to the same source code package, and traversing the homologous software package groups and merging them into the virtual environment to generate the software package group installation sorting, it realizes generating the software package installation order without modifying the actual system environment of the installation, and has the characteristics of short time consumption and high reliability. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation to the present invention.

[0016] In the drawings: Figure 1 It is a schematic diagram of the application scenario of a method for generating a software package installation order according to an embodiment of the present invention; Figure 2Schematic diagram of a method for generating the installation order of software packages according to an embodiment of the present invention; Figure 3 Schematic diagram of a cyclic dependency software package group for a method for generating the installation order of software packages according to an embodiment of the present invention; Figure 4 Schematic diagram of a device for generating the installation order of software packages according to an embodiment of the present invention; Figure 5 Schematic diagram of an electronic device for generating the installation order of software packages according to an embodiment of the present invention. Detailed implementation manners

[0017] It should be noted that, without conflict, the embodiments in the present invention and the features in the embodiments may be combined with each other.

[0018] In the description of the present invention, it should be noted that, unless otherwise clearly defined and limited, the terms "install", "connect", and "couple" should be understood in a broad sense. For example, it may be a fixed connection, a detachable connection, or an integral connection; it may be a mechanical connection or an electrical connection; it may be a direct connection or an indirect connection through an intermediate medium, and it may be the communication inside two components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention may be understood according to specific situations.

[0019] In the description of the present invention, it should be further noted that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first", "second", etc. may explicitly or implicitly include one or more of such features. In the description of the present invention, unless otherwise stated, the meaning of "a plurality" is two or more.

[0020] The application scenarios of a method, a device, a device, and a product for generating the installation order of software packages disclosed by the present invention are as Figure 1 shown. Under the existing technical conditions, for the existing software package installation method, when determining the installation order of software packages, it is impossible to generate the software package installation order without modifying the actual installation environment, and when performing a chronological dependency check on the installed software packages, there are problems of long time consumption and low reliability. A method, a device, a device, and a product for generating the installation order of software packages disclosed by the present invention utilize establishing a virtual environment of the target system for installing software packages, grouping according to the same source code packages, and traversing the software package groups of the same origin, and merging them into the virtual environment to generate the installation sorting of the software package groups, realizing that the software package installation order can be generated without modifying the actual system environment of the installation, and having the characteristics of short time consumption and high reliability.

[0021] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0022] In one embodiment of the present invention, as Figure 2 shown, a method for generating an installation sequence of software packages includes: Step S201, establish a virtual environment for the target system of the software packages to be installed, where the virtual environment includes: the names of all the software packages already installed in the target system and the corresponding constraint conditions; In this embodiment, information for establishing the virtual environment is obtained by scanning the software package database of the target system, for example: / var / lib / dpkg / status of the Debian system.

[0023] Step S202, group the sequence of software packages to be installed according to the same source package to obtain a sequence of source package groups; Exemplarily, a source package group is a set of binary packages generated from the same source package, and is used to select a set of binary packages generated from the same source package each time and merge them into the target virtual environment.

[0024] Step S203, traverse the source package groups in the sequence of source package groups, merge them into the virtual environment, and obtain an installation sorting of the package groups, including: starting from the first source package group in the sequence of source package groups, merge the packages in the source package group into the virtual environment. If all the packages in the merged virtual environment are self-consistent in relationship, add the currently merged source package group to the installation sorting of the package groups, and save the current virtual environment as the target virtual environment for the next source package group to be merged; if there are packages in the merged virtual environment that are not self-consistent in relationship, re-arrange the currently merged source package group to the end of the sequence of source package groups, and restore the current virtual environment as the target virtual environment for the next source package group to be merged.

[0025] In this embodiment, merging the packages in the source package group into the virtual environment includes: adding the name of the package and the corresponding constraint conditions to the virtual environment.

[0026] Exemplarily, the virtual environment includes: A mapping table from package name to metadata, which records the package name, version number, dependency description, and conflict declaration; A virtual provides relationship table, which records the virtual package name declared by the package through the Provides field and its version constraint; A mapping of source package groups, which records the storage of binary package sets grouped by source package name; Exemplarily, the constraint conditions include the dependency description, conflict declaration, virtual package name and its version constraint of the package; In this embodiment, before restoring the current virtual environment, it further includes: creating an image layer of the virtual environment for recording the virtual environment state and supporting transactional rollback.

[0027] In this embodiment, in the installation sorting of software package groups, the software packages within a software package group are sorted according to the topological relationship.

[0028] In this embodiment, what is recorded in the installation sorting of software package groups is the sorting of software package groups, and the software packages are installed in groups.

[0029] This embodiment can create a virtual environment of the target system, predict the dependency integrity of software packages in the system after installation, and obtain the installation sorting of software package groups, without modifying the environment of the actual system, improving the security of the system and ensuring the reliability of the system for large-scale software package deployment; further, based on the homologous software package groups, the installation sorting of software package groups is performed to achieve batch installation of software packages, effectively shortening the total installation time of software packages and reducing the failure risk.

[0030] In another embodiment of the present invention, merging the software packages within a homologous software package group into the virtual environment includes: if the same software package already exists in the virtual environment, it is overwritten according to the method of full replacement or only upgrading and retaining the old version, and the corresponding version number and constraint conditions are updated.

[0031] Exemplarily, using the assemble_virtual_environment method, all Provides declarations of the old version software package in the virtual environment are removed, and the Provides bindings of the new version software package are added.

[0032] Based on the previous embodiment, in another embodiment of the present invention, all software packages within the virtual environment are self-consistent in relationship, including: the current virtual environment satisfies the constraint conditions of any software package in the current virtual environment; There is a software package in the virtual environment with an inconsistent relationship, including: the current virtual environment does not satisfy the constraint conditions of at least one software package in the current virtual environment.

[0033] In this embodiment, exemplarily, whether the software package relationship is self-consistent includes: forward dependency check and reverse conflict check; The forward dependency check includes: traversing the forward dependencies (Depends / Pre-Depends) of all software packages in the virtual environment and verifying whether their constraints are satisfied by the software package versions or virtual providing relationships in the current virtual environment; The reverse conflict check includes: traversing whether there is a version intersection between the conflict declarations (Conflicts / Breaks) of all software packages in the virtual environment and all software packages in the virtual environment.

[0034] In this embodiment, by way of example, dependency checking adopts a recursive relaxation matching strategy based on version range resolution. For example, for the dependency libc (>= 2.24), all libc versions in the virtual environment are retrieved. If there is at least one version that satisfies version >= 2.24, it is considered satisfied; conflict checking adopts two-way version cross-verification. If package A has a conflict statement: B < 1.0 and there is a package B with version 0.9 in the virtual environment, it is marked as having a conflict.

[0035] In this embodiment, using the recursive relaxation matching strategy, recursive version matching is performed on the virtual package declaration (Provides), allowing dependency constraints to be satisfied through indirect provision relationships.

[0036] In another embodiment of the present invention, as Figure 3 shown, traverse the homologous software package groups in the homologous software package group sequence and merge them into the virtual environment. It further includes: if the homologous software package groups reach the continuous preset number of times and are rearranged to the end of the homologous software package group sequence, then the packages in all the remaining homologous software package groups in the homologous software package group sequence are uniformly merged into the virtual environment; if all the packages in the merged virtual environment have self-consistent relationships, then all the packages merged this time form a cyclic dependency software package group, and the cyclic dependency software package group is added to the software package group installation sorting; if there are packages in the merged virtual environment with inconsistent relationships, then record all the packages merged this time into the list of packages that cannot be installed.

[0037] In this embodiment, a threshold trigger mechanism for the continuous preset number of times is established. When continuously iterating but not reducing the software package groups to be processed in the homologous software package group sequence, trigger the unified merging mechanism for the remaining packages.

[0038] In this embodiment, by way of example, the list of packages that cannot be installed includes: the abnormal package list _list_skip_package and the error code mapping table _hash_pdata2error, which record the packages that cannot be installed and the reasons for not being able to install. This embodiment can process a set of software packages that form a cyclic dependency relationship. For example: a set of software packages where package A depends on package B, package B depends on package C, and package C depends on package A, which improves the applicability of this method and solves the installation of a set of software packages with a cyclic dependency relationship.

[0039] As Figure 4 shown, the present invention also discloses a device for generating the installation order of software packages, including: A virtual environment creation module 401 is used to create a virtual environment for the target system where the software package is installed. The virtual environment includes the names of all installed software packages in the target system and the corresponding constraint conditions. A grouping module 402 is used to group the sequence of software packages to be installed according to the same source code package to obtain a sequence of homologous software package groups. A software package group installation order generation module 403 is used to traverse the homologous software package groups in the sequence of homologous software package groups, merge them into the virtual environment, and obtain the installation sorting of software package groups, including: starting from the first homologous software package group in the sequence of homologous software package groups, merging the software packages in the homologous software package group into the virtual environment. If all the software packages in the merged virtual environment are self-consistent in relationship, add the currently merged homologous software package group to the installation sorting of software package groups, and save the current virtual environment as the target virtual environment for the next homologous software package group to merge. If there are software packages in the merged virtual environment with inconsistent relationships, re-arrange the currently merged homologous software package group to the end of the sequence of homologous software package groups, and restore the current virtual environment as the target virtual environment for the next homologous software package group to merge.

[0040] The present invention also discloses an electronic device, as Figure 5 shown, discloses an embodiment, which is a block diagram of an electronic device applicable to the generation of the above software package installation order.

[0041] The electronic device 50 in this embodiment includes a processor 501, which can perform various appropriate actions and processes according to the program stored in the ROM 502 or the program loaded from the storage section 508 into the RAM 503. The processor 501 can include, for example, a general microprocessor, an instruction set processor, and / or a related chipset and / or a dedicated microprocessor, etc. The processor 501 can also include on-board memory for caching purposes. The processor 501 can include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiments of the present invention.

[0042] In the RAM 503, various programs and data required for the operation of the electronic device 50 are stored. The processor 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. The processor 501 performs various operations of the method flow according to the embodiments of the present invention by executing the programs in the ROM 502 and / or the RAM 503. It should be noted that the program can also be stored in one or more memories other than the ROM 502 and the RAM 503, and the processor 501 can also perform various operations of the method flow according to the embodiments of the present invention by executing the programs stored in one or more memories.

[0043] According to an embodiment of the present invention, the electronic device 50 may further include an I / O interface 505, and the I / O interface 505 is also connected to the bus 504. The electronic device 50 may further include one or more of the following components connected to the I / O interface 505: an input portion 506 including a keyboard, a mouse, etc.; an output portion 507 including a cathode ray tube, a liquid crystal display, a speaker, etc.; a storage portion 508 including a hard disk, etc.; and a communication portion 509 including a network interface card such as a LAN card, a modem, etc. The communication portion 509 performs communication processing via a network such as the Internet. The drive 5010 is also connected to the I / O interface 505 as needed. A removable medium 5011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on the drive 5010 as needed, so that a computer program read therefrom is installed into the storage portion 508 as needed.

[0044] The present invention also provides a computer-readable storage medium.

[0045] The computer-readable storage medium may be included in the electronic device / apparatus system described in the above embodiments; or may exist separately without being assembled into the electronic device / apparatus. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiments of the present invention is implemented.

[0046] According to an embodiment of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory RAM, a read-only memory ROM, an erasable programmable read-only memory EPROM or a flash memory, a portable compact disk read-only memory CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program can be used by or combined with an instruction execution system, device, or apparatus.

[0047] An embodiment of the present invention further includes a computer program product.

[0048] The computer program product includes a computer program, and the computer program includes program codes for executing the method provided by the embodiments of the present invention. When the computer program product runs on an electronic device, the program codes are used to cause the electronic device to implement the method provided by the embodiments of the present invention.

[0049] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium. The program code included in the computer program may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0050] According to an embodiment of the present invention, the program code for executing the computer program provided by the embodiments of the present invention may be written in any combination of one or more programming languages. Specifically, these computing programs may be implemented using high-level procedures and / or object-oriented programming languages. Programming languages include but are not limited to, for example, Java, C++, Python, C language, or similar programming languages. The program code may be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user's computing device through any type of network, including a local area network or a wide area network, or may be connected to an external computing device.

[0051] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions. Those skilled in the art can understand that the features described in the various embodiments and / or claims of the present invention can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present invention. In particular, without departing from the spirit and teachings of the present invention, the features described in the various embodiments and / or claims of the present invention can be combined and / or combined in various ways. All such combinations and / or combinations fall within the scope of the present invention.

[0052] The embodiments of the present invention have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present invention. Although the embodiments have been described separately above, this does not mean that the measures in each embodiment cannot be used advantageously in combination. The scope of the present invention is defined by the appended claims and their equivalents, and without departing from the scope of the present invention, those skilled in the art can make various substitutions and modifications, and all such substitutions and modifications should fall within the scope of the present invention.

Claims

1. A method for generating the installation sequence of software packages, characterized in that, Including: Create a virtual environment for the target system for installing software packages, where the virtual environment includes: the names of all installed software packages in the target system and the corresponding constraint conditions; Group the sequence of software packages to be installed by the same source code package to obtain a sequence of homologous software package groups; Traverse the homologous software package groups in the sequence of homologous software package groups, merge them into the virtual environment, and obtain the installation sorting of the software package groups, including: starting from the first homologous software package group in the sequence of homologous software package groups, merge the software packages in the homologous software package group into the virtual environment. If all the software packages in the merged virtual environment are self-consistent in relationships, add the currently merged homologous software package group to the installation sorting of the software package groups, and save the current virtual environment as the target virtual environment for the next homologous software package group to merge into; if there are software packages in the merged virtual environment with inconsistent relationships, re-arrange the currently merged homologous software package group to the end of the sequence of homologous software package groups, and restore the current virtual environment as the target virtual environment for the next homologous software package group to merge into.

2. The method for generating the installation sequence of a software package according to claim 1, wherein The step of merging the software packages in the homologous software package group into the virtual environment includes: adding the name of the software package and the corresponding constraint conditions to the virtual environment.

3. The method for generating the installation sequence of a software package according to claim 2, wherein The step of merging the software packages in the homologous software package group into the virtual environment includes: if the same software package already exists in the virtual environment, overwrite it according to the method of full replacement or only upgrade and retain the old version, and update the corresponding version number and constraint conditions.

4. The method for generating the installation sequence of a software package according to claim 1, characterized in that, All software packages in the virtual environment being self-consistent in relationships means: the current virtual environment satisfies the constraint conditions of any software package in the current virtual environment; There being software packages in the virtual environment with inconsistent relationships means: the current virtual environment does not satisfy the constraint conditions of at least one software package in the current virtual environment.

5. The method for generating the installation sequence of a software package according to claim 1, wherein The step of traversing the homologous software package groups in the sequence of homologous software package groups and merging them into the virtual environment further includes: if the homologous software package groups reach a continuous preset number of times and are re-arranged to the end of the sequence of homologous software package groups, then uniformly merge the software packages in all the remaining homologous software package groups in the sequence of homologous software package groups into the virtual environment; if all the software packages in the merged virtual environment are self-consistent in relationships, then all the software packages merged this time form a cyclic dependency software package group, and add the cyclic dependency software package group to the installation sorting of the software package groups; if there are software packages in the merged virtual environment with inconsistent relationships, record all the software packages merged this time in the list of packages that cannot be installed.

6. The method for generating the installation sequence of a software package according to claim 1, characterized in that, In the installation sorting of the software package groups, the software packages in the software package group are sorted according to the topological relationship.

7. A method for generating the installation sequence of a software package according to claim 1, characterized in that Before restoring the current virtual environment, it further includes: creating an image layer of the virtual environment for recording the state of the virtual environment and supporting transactional rollback.

8. An apparatus for generating an installation sequence of software packages, characterized in that: The device includes: A virtual environment creation module, configured to create a virtual environment for a target system where a software package is to be installed. The virtual environment includes the names of all installed software packages in the target system and corresponding constraint conditions. A grouping module, configured to group a sequence of software packages to be installed according to the same source code package, to obtain a sequence of homologous software package groups. A software package group installation order generation module, configured to traverse the homologous software package groups in the sequence of homologous software package groups, merge them into the virtual environment, and obtain the installation sorting of the software package groups, including: starting from the first homologous software package group in the sequence of homologous software package groups, merging the software packages within the homologous software package group into the virtual environment. If all the software packages in the merged virtual environment are self-consistent in terms of relationships, add the currently merged homologous software package group to the software package group installation sorting, and save the current virtual environment as the target virtual environment for merging the next homologous software package group. If there are software packages in the merged virtual environment with inconsistent relationships, re-arrange the currently merged homologous software package group to the end of the sequence of homologous software package groups, and restore the current virtual environment as the target virtual environment for merging the next homologous software package group.

9. An electronic device, characterized in that, Comprising: One or more processors; A storage device, configured to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors are caused to execute the method according to any one of claims 1 to 7.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Package management system and method for embedded system of digital television receiving terminal

    CN102419711A

  • Method and devicefor constructing Linux system

    CN112214221A

  • Complex system compiling sequence optimization method and device, equipment and medium

    CN115525289A

  • Display device and application software upgrading method

    CN118363618A

  • Method and test environent for automatic testing a software product comprising a plurality of software packages

    GB201405999D0