Method, device, equipment and product for generating software package installation sequence

By establishing a virtual environment in the target system and combining software packages, the problem of inability to generate installation order and dependency checking during large-scale software package installation in the prior art is solved, and the reliability of high-efficiency software package installation is achieved.

CN120353477BActive Publication Date: 2025-09-02KYLIN CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510804360.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-17
Publication Date
2025-09-02
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

By establishing the virtual environment of the target system, grouping according to the same source code packages, traversing the same-original software package combinations and into the virtual environment, generating software package group installation sorting, and using the virtual environment for dependency checking.

Benefits of technology

It realizes that the software package installation sequence is generated without modifying the actual system environment, shortens the installation time and improves the reliability of dependency checking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120353477B_ABST
    Figure CN120353477B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, apparatus, device, and product for generating a software package installation sequence, comprising: establishing a virtual environment for a target system on which software packages are to be installed; grouping a sequence of software packages to be installed according to the same source code packages to obtain a sequence of homologous software package groups; traversing homologous software package groups in the sequence of homologous software package groups, merging them into the virtual environment, and obtaining a sequence of software package group installations. The present invention discloses a method, apparatus, device, and product for generating a software package installation sequence. By establishing a virtual environment for a target system on which software packages are to be installed, grouping them according to the same source code packages, traversing homologous software package groups, merging them into the virtual environment, and generating a sequence of software package group installations, the method achieves the ability to generate a software package installation sequence without modifying the actual system environment in which the software packages are to be installed, and has the characteristics of being time-saving and highly reliable.
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 in particular relates to a method, device, equipment and product for generating a software package installation sequence. Background Art

[0002] With the rapid development of information technology, large-scale software package installation is widely used in operating system updates, cloud computing environment construction, and distributed system operation and maintenance. Under existing technical conditions, when installing a large number of software packages, due to the relatively complex dependencies between the software packages, the existing software package installation methods cannot generate the software package installation order without modifying the actual installation environment when determining the software package installation order. In addition, when performing sequential dependency checks on the installed software packages, there are problems such as long inspection time and low reliability of the inspection 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, apparatus, device and product for generating a software package installation sequence.

[0004] To achieve the above object, the technical solution of the present invention is achieved as follows:

[0005] In a first aspect, the present invention discloses a method for generating a software package installation sequence, comprising:

[0006] Establishing a virtual environment of a target system for installing software packages, wherein the virtual environment includes: names of all installed software packages in the target system and corresponding constraints;

[0007] The software package sequence to be installed is grouped according to the same source code package to obtain a homologous software package group sequence;

[0008] Traversing homologous package groups in a homologous package group sequence, merging them into a virtual environment, and obtaining a package group installation order, including: starting from the first homologous package group in the homologous package group sequence, merging the packages in the homologous package group into the virtual environment; if all packages in the merged virtual environment are self-consistent, adding the currently merged homologous package group to the package group installation order, and saving the current virtual environment as the target virtual environment for the next homologous package group merger; if any packages in the merged virtual environment are not self-consistent, re-arranging the currently merged homologous package group to the end of the homologous package group sequence, and restoring the current virtual environment as the target virtual environment for the next homologous package group merger.

[0009] In one embodiment of the present invention, merging software packages in a homologous software package group into a virtual environment includes adding the names of the software packages and corresponding constraints to the virtual environment.

[0010] In one embodiment of the present invention, merging software packages in a homologous software package group into a virtual environment includes: if the same software package already exists in the virtual environment, overwriting it by completely replacing it or only upgrading and retaining the old version, and updating the corresponding version number and constraints.

[0011] In one embodiment of the present invention, all software packages in the virtual environment are self-consistent, including: the current virtual environment satisfies the constraints of any software package in the current virtual environment;

[0012] There are inconsistencies in the relationships between software packages in the virtual environment, including: the current virtual environment does not meet the constraints of at least one software package in the current virtual environment.

[0013] In one embodiment of the present invention, traversing homologous software package groups in a homologous software package group sequence and merging them into a virtual environment further includes: if a homologous software package group that has been used for a preset number of times is re-arranged at the end of the homologous software package group sequence, merging all remaining software packages in the homologous software package group sequence into the virtual environment; if all software packages in the merged virtual environment are self-consistent, then forming a circularly dependent software package group with all the merged software packages, and adding the circularly dependent software package group to the software package group installation order; and if any software packages in the merged virtual environment are not self-consistent, recording all the merged software packages in a list of packages that cannot be installed.

[0014] In one embodiment of the present invention, in the installation sorting of the software package group, the software packages in the software package group are sorted according to the topological relationship.

[0015] In one embodiment of the present invention, before restoring the current virtual environment, the process further includes: creating a mirror layer of the virtual environment for recording the state of the virtual environment and supporting transactional rollback.

[0016] In a second aspect, the present invention discloses a device for generating a software package installation sequence, the device comprising:

[0017] A virtual environment establishment module is used to establish a virtual environment of a target system for installing software packages, wherein the virtual environment includes: the names of all installed software packages in the target system and corresponding constraints;

[0018] A grouping module is used to group the software packages to be installed according to the same source code packages to obtain a sequence of homologous software packages;

[0019] A software package group installation sequence generation module is used to traverse homologous software package groups in a homologous software package group sequence, merge them into a virtual environment, and obtain a software package group installation order, 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 software packages in the merged virtual environment are self-consistent, then adding the currently merged homologous software package group to the software package group installation order, and saving the current virtual environment as the target virtual environment for the next homologous software package group merger; if there are software packages in the merged virtual environment that are not self-consistent, then re-arranging the currently merged homologous software package group to the end of the homologous software package group sequence, and restoring the current virtual environment as the target virtual environment for the next homologous software package group merger.

[0020] In a third aspect, the present invention discloses an electronic device comprising: 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 execute the above method.

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

[0022] Compared with the prior art, the present invention has the following advantages:

[0023] The present invention discloses a method, apparatus, device, and product for generating a software package installation sequence, comprising: establishing a virtual environment for a target system on which software packages are to be installed; grouping a sequence of software packages to be installed according to the same source code packages to obtain a sequence of homologous software package groups; traversing homologous software package groups in the sequence of homologous software package groups, merging them into the virtual environment, and obtaining a sequence of software package group installations. The present invention discloses a method, apparatus, device, and product for generating a software package installation sequence. By establishing a virtual environment for a target system on which software packages are to be installed, grouping them according to the same source code packages, traversing homologous software package groups, merging them into the virtual environment, and generating a sequence of software package group installations, the method achieves the ability to generate a software package installation sequence without modifying the actual system environment in which the software packages are to be installed, and has the characteristics of being time-saving and highly reliable. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0025] In the attached figure:

[0026] Figure 1 A schematic diagram of an application scenario of a method for generating a software package installation sequence according to an embodiment of the present invention;

[0027] Figure 2 A schematic diagram of a method for generating a software package installation sequence according to an embodiment of the present invention;

[0028] Figure 3 A schematic diagram of a circularly dependent software package group in a method for generating a software package installation sequence according to an embodiment of the present invention;

[0029] Figure 4 A schematic diagram of a device for generating a software package installation sequence according to an embodiment of the present invention;

[0030] Figure 5 A schematic diagram of an electronic device for generating a software package installation sequence according to an embodiment of the present invention. DETAILED DESCRIPTION

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

[0032] In the description of the present invention, it should be noted that, unless otherwise expressly specified or limited, the terms "mounted," "connected," and "connected" should be understood in a broad sense. For example, they may refer to fixed connections, detachable connections, or integral connections; mechanical connections or electrical connections; direct connections or indirect connections through an intermediate medium; and internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on specific circumstances.

[0033] In the description of the present invention, it should be further clarified that the terms "first," "second," etc. are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature specified as "first," "second," etc. may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "plurality" means two or more.

[0034] The application scenarios of the method, device, equipment and product for generating the software package installation sequence disclosed in the present invention are as follows: Figure 1As shown, under existing technical conditions, existing software package installation methods cannot generate the software package installation order without modifying the actual installation environment when determining the software package installation order. In addition, the time-consuming and low reliability problems exist when performing sequential dependency checks on the installed software packages. The present invention discloses a method, device, equipment, and product for generating a software package installation order. By establishing a virtual environment for the target system on which the software packages are installed, grouping them according to the same source code packages, traversing the same source software package groups, and merging them into the virtual environment, the method generates the software package group installation order. This method achieves the generation of the software package installation order without modifying the actual installation system environment, and has the characteristics of short time consumption and high reliability.

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

[0036] In one embodiment of the present invention, Figure 2 As shown, a method for generating a software package installation sequence includes:

[0037] Step S201: establishing a virtual environment of a target system for installing software packages, wherein the virtual environment includes: the names of all installed software packages in the target system and corresponding constraints;

[0038] In this embodiment, the 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.

[0039] Step S202: Group the software packages to be installed according to the same source code packages to obtain a homologous software package group sequence;

[0040] Exemplarily, the same-source software package group is a set of binary packages generated from the same source code package, and is used to select a set of binary packages generated from the same source code package each time and merge them into the target virtual environment.

[0041] Step S203 traverses the homologous package groups in the homologous package group sequence, merges them into the virtual environment, and obtains a package group installation order, including: starting from the first homologous package group in the homologous package group sequence, merging the packages in the homologous package group into the virtual environment; if all packages in the merged virtual environment are self-consistent, adding the currently merged homologous package group to the package group installation order, and saving the current virtual environment as the target virtual environment for the next homologous package group merger; if any packages in the merged virtual environment are not self-consistent, re-arranging the currently merged homologous package group to the end of the homologous package group sequence, and restoring the current virtual environment as the target virtual environment for the next homologous package group merger.

[0042] In this embodiment, merging software packages in a same-source software package group into a virtual environment includes: adding the names of the software packages and corresponding constraints to the virtual environment.

[0043] Exemplarily, the virtual environment includes:

[0044] A mapping table of package names to metadata, which records the package name, version number, dependency description, and conflict declarations;

[0045] The virtual provider relationship table records the virtual package name and version constraints declared by the software package through the Provides field;

[0046] Same-source package group mapping, which records the binary package collection grouped by source package name;

[0047] Exemplarily, the constraints include the software package's dependency description, conflict declaration, virtual package name, and its version constraint;

[0048] In this embodiment, before restoring the current virtual environment, the process further includes: creating a mirror layer of the virtual environment for recording the state of the virtual environment and supporting transactional rollback.

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

[0050] In this embodiment, the software package group installation sequence records the sequence of the software package groups, and the software packages are installed in groups.

[0051] This embodiment can establish a virtual environment for the target system, predict the dependency integrity of the software packages in the system after installation, and obtain the installation order of the software package groups without modifying the actual system environment, thereby improving system security and ensuring system reliability for large-scale deployment of software packages. Furthermore, the installation order of software packages is performed based on the same-source software package groups, enabling batch installation of software packages, effectively shortening the total installation time and reducing the risk of failure.

[0052] In another embodiment of the present invention, merging software packages in a homologous software package group into a virtual environment includes: if the same software package already exists in the virtual environment, overwriting it by completely replacing it or only upgrading and retaining the old version, and updating the corresponding version number and constraints.

[0053] Exemplarily, the assemble_virtual_environment method is used to remove all Provides declarations of the old version of the software package in the virtual environment, and to add Provides bindings of the new version of the software package.

[0054] Based on the previous embodiment, in another embodiment of the present invention, all software packages in the virtual environment are self-consistent, including: the current virtual environment satisfies the constraints of any software package in the current virtual environment;

[0055] There are inconsistencies in the relationships between software packages in the virtual environment, including: the current virtual environment does not meet the constraints of at least one software package in the current virtual environment.

[0056] In this embodiment, illustratively, whether the software package relationship is self-consistent includes: forward dependency check and reverse conflict check;

[0057] Forward dependency checking 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 package versions or virtual provision relationships in the current virtual environment;

[0058] The reverse conflict check includes: traversing the conflict declarations (Conflicts / Breaks) of all software packages in the virtual environment to see if there is any version intersection with all software packages in the virtual environment.

[0059] In this embodiment, the dependency check exemplarily adopts a recursive relaxed 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. The conflict check adopts a two-way version cross-validation. If the software package A has a conflict declaration: B<1.0, and the virtual environment contains software package B with version 0.9, it is marked as a conflict.

[0060] In this embodiment, a recursive relaxed matching strategy is used to perform recursive version matching on the virtual package declaration (Provides), allowing dependency constraints to be satisfied through indirect providing relationships.

[0061] In another embodiment of the present invention, Figure 3 As shown, traversing the homologous software package groups in the homologous software package group sequence and merging them into the virtual environment also includes: if the homologous software package groups that have reached a preset number of consecutive times are re-arranged at the end of the homologous software package group sequence, then merging all the remaining software packages in the homologous software package groups in the homologous software package group sequence into the virtual environment; if all the software packages in the merged virtual environment are self-consistent, then all the merged software packages form a circular dependency software package group, and the circular dependency software package group is added to the software package group installation sequence; if there are software packages in the merged virtual environment that are not self-consistent, then recording all the merged software packages in the list of packages that cannot be installed.

[0062] In this embodiment, a threshold trigger mechanism is established for a preset number of consecutive iterations. When the number of software packages to be processed in the sequence of homologous software packages is not reduced after consecutive iterations, a unified merging mechanism for the remaining software packages is triggered.

[0063] In this embodiment, the list of packages that cannot be installed includes, for example: an abnormal software package list_list_skip_package and an error code mapping table_hash_pdata2error, which records the software packages that cannot be installed and the reasons for the failure to install;

[0064] This embodiment can handle a set of software packages that form a circular dependency relationship, for example, a set of software packages where software package A depends on software package B, software package B depends on software package C, and software package C depends on software package A. This improves the applicability of the method and solves the installation problem of a set of software packages with a circular dependency relationship.

[0065] like Figure 4 As shown, the present invention also discloses a device for generating a software package installation sequence, comprising:

[0066] A virtual environment establishment module 401 is used to establish a virtual environment of a target system for installing software packages, wherein the virtual environment includes: names of all installed software packages in the target system and corresponding constraints;

[0067] A grouping module 402 is used to group the software packages to be installed according to the same source code packages to obtain a sequence of homologous software packages;

[0068] The software package group installation order generating module 403 is configured to traverse the homologous software package groups in the homologous software package group sequence, merge them into the virtual environment, and obtain the software package group installation order. The module includes: 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, adding the currently merged homologous software package group to the software package group installation order, and saving the current virtual environment as the target virtual environment for the next homologous software package group merger; if any software packages in the merged virtual environment are not self-consistent, re-arranging the currently merged homologous software package group to the end of the homologous software package group sequence, and restoring the current virtual environment as the target virtual environment for the next homologous software package group merger.

[0069] The present invention also discloses an electronic device, such as Figure 5 As shown, an embodiment is disclosed, which is a block diagram of an electronic device suitable for generating the above software package installation sequence.

[0070] The electronic device 50 of 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 part 508 into the RAM 503. The processor 501 may include, for example, a general-purpose microprocessor, an instruction set processor and / or a related chipset and / or a dedicated microprocessor, etc. The processor 501 may also include onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiment of the present invention.

[0071] RAM 503 stores various programs and data required for the operation of electronic device 50. Processor 501, ROM 502, and RAM 503 are interconnected via bus 504. Processor 501 executes the programs in ROM 502 and / or RAM 503 to perform various operations according to the method flow of the embodiment of the present invention. It should be noted that the programs may also be stored in one or more memories other than ROM 502 and RAM 503, and processor 501 may also execute the programs stored in one or more memories to perform various operations according to the method flow of the embodiment of the present invention.

[0072] According to an embodiment of the present invention, the electronic device 50 may further include an I / O interface 505, which 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, and a speaker; a storage portion 508 including a hard disk; and a communication portion 509 including a network interface card such as a LAN card or a modem. The communication portion 509 performs communication processing via a network such as the Internet. A 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 installed in the drive 5010 as needed, so that a computer program read therefrom can be installed into the storage portion 508 as needed.

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

[0074] The computer-readable storage medium may be included in the electronic device / device system described in the above embodiments, or may exist independently and not be incorporated into the electronic device / device. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of the present invention.

[0075] According to embodiments of the present invention, a computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples include, but are not limited to, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or flash memory, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0076] Embodiments of the present invention also include a computer program product.

[0077] The computer program product includes a computer program, which contains program code for executing the method provided by the embodiment of the present invention. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the method provided by the embodiment of the present invention.

[0078] In one embodiment, the computer program may be stored on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may be transmitted and distributed in the form of a signal over a network medium. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to wireless, wired, or any suitable combination thereof.

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

[0080] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of the systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram may represent a module, program segment, or portion of code, which 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 boxes may occur in an order different from that marked in the accompanying drawings. For example, two boxes shown in succession may actually be executed substantially in parallel, or they may sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, as well as the combination of boxes in the block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or may be implemented using a combination of dedicated hardware and computer instructions. It will be understood by those skilled in the art that the features described in the various embodiments and / or claims of the present invention may be combined and / or coupled in various ways, even if such combinations or couplings 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 may be combined and / or coupled in various ways, and all such combinations and / or couplings fall within the scope of the present invention.

[0081] 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 each embodiment has been described above separately, this does not mean that the measures in each embodiment cannot be advantageously used in combination. The scope of the present invention is defined by the appended claims and their equivalents. Without departing from the scope of the present invention, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present invention.

Claims

1. A method for generating a software package installation sequence, characterized in that: include: Establishing a virtual environment for a target system for installing software packages, wherein the virtual environment includes: the names of all installed software packages in the target system and corresponding constraints; grouping a sequence of software packages to be installed according to the same source code packages to obtain a sequence of homologous software package groups; traversing the homologous software package groups in the sequence of homologous software package groups, merging them into the virtual environment, and obtaining an installation order 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 in the homologous software package groups into the virtual environment; if all software packages in the merged virtual environment are self-consistent, adding the currently merged homologous software package group to the installation order of the software package groups, and saving the current virtual environment. The virtual environment is used as the target virtual environment for merging the next homologous software package group; if any software package in the merged virtual environment is inconsistent, the currently merged homologous software package group is re-arranged at the end of the homologous software package group sequence, and the current virtual environment is restored as the target virtual environment for merging the next homologous software package group; all software packages in the virtual environment are consistent, including: the current virtual environment satisfies the constraints of any software package in the current virtual environment; software packages in the virtual environment are inconsistent, including: the current virtual environment does not satisfy the constraints of at least one software package in the current virtual environment; the constraints include the dependency description, conflict declaration, virtual package name and version constraint of the software package.

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

3. The method for generating a software package installation sequence according to claim 2, wherein: Merging the software packages in the same source software package group into the virtual environment includes: if the same software package already exists in the virtual environment, overwriting it by completely replacing it or only upgrading and retaining the old version, and updating the corresponding version number and constraint conditions.

4. The method for generating a software package installation sequence according to claim 1, wherein: The traversing the homologous software package groups in the homologous software package group sequence and merging them into the virtual environment further includes: if the homologous software package groups are re-arranged at the end of the homologous software package group sequence after reaching a preset number of consecutive times, merging all remaining software packages in the homologous software package groups in the homologous software package group sequence into the virtual environment; if all software packages in the merged virtual environment are self-consistent, then all the merged software packages form a circular dependency software package group, and the circular dependency software package group is added to the software package group installation order; if any software packages in the merged virtual environment are not self-consistent, then recording all the merged software packages in a list of packages that cannot be installed.

5. The method for generating a software package installation sequence according to claim 1, wherein: In the software package group installation sorting, the software packages in the software package group are sorted according to topological relationships.

6. The method for generating a software package installation sequence according to claim 1, wherein: Before restoring the current virtual environment, the method further includes: creating a mirror layer of the virtual environment for recording the state of the virtual environment and supporting transactional rollback.

7. A device for generating a software package installation sequence, characterized in that: The device comprises: a virtual environment establishment module, for establishing a virtual environment of a target system for installing software packages, wherein the virtual environment comprises: the names of all installed software packages in the target system and corresponding constraints; a grouping module, for grouping a sequence of software packages to be installed according to the same source code packages to obtain a sequence of homologous software package groups; a module for generating a software package group installation order, for traversing the homologous software package groups in the homologous software package group sequence, merging them into the virtual environment, and obtaining an installation order of the software package groups, comprising: 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, then adding the currently merged homologous software package group to the software package group. The software package groups are installed in the order of sequence, and the current virtual environment is saved as the target virtual environment for the next homologous software package group to be merged. If there are software packages in the merged virtual environment that are inconsistent, the currently merged homologous software package group is re-arranged at the end of the homologous software package group sequence, and the current virtual environment is restored as the target virtual environment for the next homologous software package group to be merged. All software packages in the virtual environment are consistent, including: the current virtual environment satisfies the constraints of any software package in the current virtual environment. There are software packages in the virtual environment that are inconsistent, including: the current virtual environment does not satisfy the constraints of at least one software package in the current virtual environment. The constraints include dependency descriptions, conflict declarations, virtual package names, and version constraints of software packages.

8. An electronic device, characterized in that: include: 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 perform the method according to any one of claims 1 to 6.

9. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Method and devicefor constructing Linux system

    CN112214221A

  • Display device and application software upgrading method

    CN118363618A