A solution for package dependencies in a custom image

By traversing and downloading missing dependency packages during the custom image process, the problem of inaccurate identification of missing dependencies in existing technologies is solved, and the complete installation of packages and resource optimization in the custom image are achieved.

CN113885936BActive Publication Date: 2025-10-31UNIONTECH SOFTWARE TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111215741.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-16
Publication Date
2025-10-31
Estimated Expiration
2041-08-16

AI Technical Summary

Technical Problem

During the custom image process, existing technologies cannot accurately identify and install the missing dependency packages of the pre-installed software packages, causing the pre-installed software packages to malfunction.

Method used

By communicating with the storage device in the computing device, the dependencies of the target software package are traversed to determine whether they exist in the original operating system. If they do not exist, the missing dependent software packages are downloaded from the second storage device and stored. The depth-first algorithm is used to traverse the dependency tree structure to ensure a complete installation.

Benefits of technology

It enables accurate identification and installation of missing dependency packages during the custom image process, improving identification accuracy, avoiding duplicate downloads, and increasing resource utilization and resolution speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113885936B_ABST
    Figure CN113885936B_ABST
Patent Text Reader

Abstract

This invention discloses a solution for software package dependencies in a customized image, relating to the computer field. The method includes: determining all dependent software packages of a target software package as first software packages; traversing any first software package during the image customization process; if data of the currently traversed first software package is found in a first storage device, then the data of the currently traversed first software package is obtained from the first storage device; if data of the currently traversed first software package is not found in the first storage device, then the currently traversed first software package is downloaded. As can be seen from the above, this invention achieves the ability to rely on software packages already installed in the original operating system during the image customization process, and traverse the missing dependencies of the target pre-installed software package. Since the missing dependencies are determined based on the software packages already installed in the original operating system, the missing dependencies of the target pre-installed software package can be accurately identified during the image customization process.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of invention patent application 2021109342042, filed on August 16, 2021. Technical Field

[0002] This invention relates to the field of computers, and in particular to a solution for software package dependencies in a customized image, a computing device, and a storage medium. Background Technology

[0003] A software package is a program or a group of programs that has specific functions and is used to accomplish a specific task. The software package dependencies in the Linux operating system are complex. For example, software package A depends on software packages B1, B2, B3, etc., while software package B1 depends on software packages C1, C2, C3, etc. In other words, a software package and its dependent software packages can actually be understood as a multi-branch tree structure.

[0004] Pre-installed software packages are those that are pre-installed on the computing device at the factory. During image customization (i.e., copying an operating system onto the original operating system), for a pre-installed software package to be integrated into the image operating system and function correctly, all its dependent software packages need to be installed on the image operating system. Currently, this is mainly done by analyzing the software packages already downloaded on the working computing device (i.e., the computing device used in the image customization process) and downloading the missing dependent software packages for the pre-installed package. However, the software package installation on the original operating system often differs from that on the working computing device, easily leading to missing dependent software packages. Therefore, after customizing the image using the above method, the pre-installed software package cannot function correctly due to missing dependent software packages. In other words, existing methods for resolving the dependencies of pre-installed software packages cannot accurately identify the missing dependent software packages, preventing the pre-installed software package from functioning correctly on the image operating system. Summary of the Invention

[0005] Therefore, the present invention provides a solution to package dependencies in a customized image, in an attempt to solve or at least alleviate the problems mentioned above.

[0006] According to one aspect of the present invention, a solution for software package dependencies in a customized image is provided, executed in a computing device communicatively connected to a first storage device, wherein the first storage device stores data of all software packages installed on the original operating system of the customized image. The method includes: determining all dependent software packages of a target software package as first software packages, wherein the target software package is any pre-installed software package; traversing any first software package during the customized image process; if data of the currently traversed first software package is found in the first storage device, then the data of the currently traversed first software package is obtained from the first storage device; if data of the currently traversed first software package is not found in the first storage device, then the currently traversed first software package is downloaded.

[0007] Optionally, the computing device is also communicatively connected to a second storage device, and the method further includes the step of storing the downloaded first software package data to the second storage device.

[0008] Optionally, the step of downloading the first package currently being traversed includes: determining whether the second storage device stores the data of the first package currently being traversed; if so, retrieving the data of the first package currently being traversed from the second storage device; if not, downloading the first package currently being traversed.

[0009] Optionally, the method further includes the steps of: determining all dependent packages of the first package being traversed using the data of the first package that has been acquired or the data of the first package that has been downloaded; and traversing any dependent package of the first package.

[0010] Optionally, the method further includes the steps of: obtaining a first predetermined file of the original operating system; reading data of all software packages installed on the original operating system from the first predetermined file; and storing the data of all the read software packages into a first storage device.

[0011] Optionally, any first software package can be traversed using a depth-first search algorithm.

[0012] Optionally, the data of any installed software package stored in the first storage device includes: the name of the installed software package, the version number of the installed software package, and information on dependent software packages. The information on dependent software packages includes: the name, version number, and version number type of the dependent software packages, as well as the version number, name, and version number type of alternative dependent software packages.

[0013] Optionally, the data of any downloaded software package stored in the second storage device includes: the name, version number, version number type of the downloaded software package, and the path to the second predetermined file. The second predetermined file includes the name, version number, and version number type of all dependencies of the downloaded software package, as well as the name, version number, and version number type of alternative dependency software packages.

[0014] Optionally, any first package includes any dependent package of the target package and any alternative dependent package of the dependent package.

[0015] According to one aspect of the present invention, a computing device is provided, comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions including instructions for performing the methods described above.

[0016] According to one aspect of the present invention, a readable storage medium storing program instructions is provided, which, when read and executed by a computing device, causes the computing device to perform the method described above.

[0017] According to the technical solution of the present invention, a solution for software package dependencies in a customized image is provided. The method first determines all dependencies of the target software package. During the customization process, any dependency is traversed, and it is determined whether the data of the currently traversed dependency is found in the first storage device (including data of software packages already installed in the original operating system). If so, the data of the currently traversed dependency is obtained from the first storage device. If the data of the currently traversed dependency is not found in the first storage device, the currently traversed dependency is downloaded, and the downloaded dependency data is stored in the second storage device.

[0018] As can be seen from the above, this invention enables the customization of the image by relying on the software packages already installed in the original operating system and traversing the missing dependencies of the target pre-installed software packages. Since the missing dependencies are determined based on the software packages already installed in the original operating system, the missing dependencies of the target pre-installed software packages can be accurately identified during the customization of the image, thereby improving the accuracy of missing dependency identification.

[0019] In addition, the present invention also stores downloaded dependencies, and only downloads missing dependencies when they are not stored, thereby avoiding repeated downloads, improving the speed of resolving package dependencies, avoiding resource waste, and improving resource utilization.

[0020] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0021] To achieve the foregoing and related objectives, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings. These aspects indicate various ways in which the principles disclosed herein may be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The foregoing and other objectives, features, and advantages of this disclosure will become more apparent from the following detailed description, taken in conjunction with the accompanying drawings. Throughout this disclosure, the same reference numerals generally refer to the same parts or elements.

[0022] Figure 1 A schematic diagram of a tree structure of package dependencies according to an embodiment of the present invention is shown;

[0023] Figure 2 A schematic diagram of a software package dependency resolution system 100 in a customized image according to an embodiment of the present invention is shown;

[0024] Figure 3 A schematic diagram of a computing device 200 according to an embodiment of the present invention is shown; and

[0025] Figure 4 A flowchart is shown for a solution 300 to package dependencies in a custom image according to an embodiment of the present invention. Detailed Implementation

[0026] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0027] In the Linux operating system, software package dependencies are complex. For example, package A depends on packages B1, B2, B3, etc., while package B1 depends on packages C1, C2, C3, etc. In other words, a software package and its dependent packages can be understood as a multi-branch tree structure, such as... Figure 1 As shown, Figure 1 A schematic diagram of a tree structure of package dependencies according to an embodiment of the present invention is shown.

[0028] During image customization, to ensure a pre-installed software package runs correctly within the image operating system, all its dependent packages must be installed on the image operating system. Currently, this is primarily done by analyzing the software packages already downloaded on the working computing device and downloading any missing dependencies. However, the software package installation on the original operating system often differs from that on the working computing device. For example, if the working computing device has package C2 installed, it shouldn't be downloaded during the process of downloading the dependencies of the pre-installed package, even though package C2 is not actually installed on the original operating system. Therefore, existing solutions for pre-installed package dependencies cannot accurately identify missing dependencies, preventing the pre-installed package from running correctly on the image operating system.

[0029] To address the aforementioned problems, this invention provides a system for resolving software package dependencies in customized images. Figure 2 A schematic diagram of a software package dependency resolution system 100 in a customized image according to an embodiment of the present invention is shown. Figure 2 As shown, the software package dependency resolution system 100 in the customized image includes a computing device 200, a first storage device 110, and a second storage device 120. The computing device 200 is communicatively connected to the first storage device 110 and the second storage device 120, respectively, for example, through a wired or wireless network connection.

[0030] The first storage device 110 stores data on all software packages installed on the original operating system of the customized image. Data for any installed software package includes: the installed package name, the installed package version number, and dependent package information. Dependency package information includes: the dependent package name, the dependent package version number, the dependent package version number type, the alternative dependency (i.e., the alternative dependent package) version number, the alternative dependency name, and the alternative dependency version number type. It is worth noting that in the following description, dependent packages will be simply referred to as dependencies.

[0031] The version number type indicates the version requirement for the dependency, including NA, >=, =, and =<. NA indicates no version requirement for the dependency; >= indicates the dependency version number is the current version or higher; = indicates the dependency version number is the current version; and =< indicates the dependency version number is the current version or lower. For example, version number 1.0 with version number type >= indicates a dependency version number of 1.0 or higher is required; version number type <= indicates a dependency version number of 1.0 or lower is required; and version number type = indicates a dependency version number of 1.0 is required. Alternative dependencies represent alternative dependencies. Each dependency can have one or more alternative dependencies, or none. If the original operating system does not have any dependency of the target package installed, but any alternative dependency of that dependency is installed, the dependency is considered satisfied, meaning the original operating system is considered to have installed that dependency of the target package. All dependencies of each installed package can be determined based on the dependency package information of each installed package. Partial contents of the first storage device are shown in Table 1:

[0032] Table 1

[0033]

[0034]

[0035] As shown in the first row of Table 1, the installed package zlib1g-dev has a version number of 1:1.2.12.2-1+dde, which includes two dependencies: zlib1g and libc6-dev. The zlib1g dependency has a version number of 1:1.2.12.2-1+dde, no alternative dependencies, and a version number type of =, meaning the version number of the zlib1g dependency is equal to 1:1.2.12.2-1+dde. The libc6-dev dependency has a version number that is empty, an alternative dependency that is libc-dev, and a version number type of NA, meaning there are no requirements regarding the version of the libc6-dev dependency. The version number of the alternative dependency libc-dev is empty, and the version number type is NA, meaning there are no requirements regarding the version of the alternative dependency libc-dev. The other data in Table 1 are analyzed in the same way, and will not be detailed here.

[0036] The second storage device 120 stores data on dependencies downloaded during the image customization process. Data for any downloaded dependency includes: the name of the downloaded dependency, the version number of the downloaded dependency, the version type of the downloaded dependency, and the path to the second predefined file (the storage path of the second predefined file for the downloaded dependency). The second predefined file includes the name, version number, and version type of all downloaded dependencies, as well as the name, version number, and version type of alternative dependencies. That is, all sub-dependencies of the current dependency and the alternative dependencies of each sub-dependency can be determined through the second predefined file. For example, the second predefined file can be the control file of the software package. Partial contents of the second storage device 120 are shown in Table 2.

[0037] Table 2

[0038]

[0039]

[0040] As shown in the first row of Table 2, the downloaded dependency libdrm-radeon1 version number is 2.4.39, and the version number type is >=, meaning that the downloaded dependency libdrm-radeon1 version number is 2.4.39 or higher. The path to the second predefined file for the downloaded dependency libdrm-radeon1 is / var / cache / apt / libdrm-radeon1_2.4.3_amd64.deb. By accessing the path / var / cache / apt / libdrm-radeon1_2.4.3_amd64.deb, all sub-dependencies of the currently downloaded dependency can be obtained from the second predefined file, thus determining all sub-dependencies of the currently downloaded dependency. The other data in Table 2 are analyzed in the same way, and will not be detailed here.

[0041] In one embodiment, the first storage device 110 and the second storage device 120 can be databases. Further, the databases can be relational databases, such as MySQL, SQL Server, and Access. The databases of the first storage device 110 and the second storage device 120 can be local databases residing in the computing device 200, or they can be distributed databases, such as HBase, located in multiple geographical locations. The first storage device 110 and the second storage device 120 can also be caches, such as Redis caches. In short, the first storage device 110 and the second storage device 120 are respectively used to store data of all software packages installed on the original operating system of the customized image and data of software packages downloaded during the customized image process. This invention does not limit the specific deployment and configuration of the first storage device 110 and the second storage device 120.

[0042] In one embodiment, the computing device 200 can be implemented as a server, such as an application server, a web server, etc.; it can also be implemented as a desktop computer, a laptop computer, a processor chip, a tablet computer, etc., but is not limited thereto. The computing device 200 can be connected to the first storage device 110 and the second storage device 120, storing all software packages installed on the original operating system of the customized image to the first storage device 110 and reading data of all installed software packages from it, and also storing downloaded software packages to the second storage device 120 and reading data of downloaded software packages from it.

[0043] For example, computing device 200 can directly read data from the first storage device 110 and the second storage device 120, and write data to the first storage device 110 and the second storage device 120 (when the first storage device 110 and the second storage device 120 are local databases of computing device 200). It can also access the Internet via wired or wireless means, and read data from the first storage device 110 and the second storage device 120 and write data to the first storage device 110 and the second storage device 120 through the data interface.

[0044] The present invention provides a solution for package dependencies in a customized image, which can be implemented in a computing device 200. Figure 3 A structural diagram of a computing device 200 according to an embodiment of the present invention is shown. Figure 3 As shown, in basic configuration 202, computing device 200 typically includes system memory 206 and one or more processors 204. Memory bus 208 can be used for communication between processor 204 and system memory 206.

[0045] Depending on the desired configuration, processor 204 can be any type of processor, including but not limited to: microprocessor (μP), microcontroller (μC), digital information processor (DSP), or any combination thereof. Processor 204 may include one or more levels of cache such as L1 cache 210 and L2 cache 212, processor core 214, and registers 216. Example processor core 214 may include an arithmetic logic unit (ALU), floating-point unit (FPU), digital signal processing core (DSP core), or any combination thereof. Example memory controller 218 may be used with processor 204, or in some implementations, memory controller 218 may be an internal part of processor 204.

[0046] Depending on the desired configuration, system memory 206 can be any type of memory, including but not limited to volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. System memory 206 may include operating system 220, one or more applications 222, and program data 224. In some embodiments, applications 222 may be arranged to operate on the operating system using program data 224. Program data 224 includes instructions, which, in the computing device 200 according to the invention, contain instructions for performing data storage method 300.

[0047] The computing device 200 also includes a storage device 232, which includes a removable memory 236 and a non-removable memory 238, both of which are connected to a storage interface bus 234. In this invention, relevant data of events occurring during program execution and time information indicating the occurrence of each event can be stored in the storage device 232, and the operating system 220 is adapted to manage the storage device 232. The storage device 232 can be a disk.

[0048] The computing device 200 may also include an interface bus 240 that facilitates communication from various interface devices (e.g., output devices 242, peripheral interfaces 244, and communication devices 246) to the basic configuration 202 via a bus / interface controller 230. Example output devices 242 include an image processing unit 248 and an audio processing unit 250. They may be configured to facilitate communication with various external devices such as displays or speakers via one or more A / V ports 252. Example peripheral interfaces 244 may include a serial interface controller 254 and a parallel interface controller 256, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboards, mice, pens, voice input devices, touch input devices) or other peripherals (e.g., printers, scanners, etc.) via one or more I / O ports 258. Example communication devices 246 may include a network controller 260, which may be arranged to facilitate communication with one or more other computing devices 262 via a network communication link through one or more communication ports 264.

[0049] A network communication link can be an example of a communication medium. A communication medium can typically be embodied in a modulated data signal, such as a carrier wave or other transmission mechanism, and can include any information delivery medium. A “modulated data signal” can be a signal whose data set, or whose modifications, can be encoded with information within the signal. As a non-limiting example, a communication medium can include wired media such as wired networks or leased lines, and various wireless media including sound, radio frequency (RF), microwave, infrared (IR), or other wireless media. The term “computer-readable medium” as used herein can include both storage media and communication media.

[0050] The computing device 200 can be implemented as a server, such as a file server, database server, application server, and web server, or as part of a small portable (or mobile) electronic device, such as a cellular phone, personal digital assistant (PDA), personal media player device, wireless network browsing device, personal headset, application-specific device, or a hybrid device that may include any of the above functions. The computing device 200 can also be implemented as a personal computer, including desktop and laptop computer configurations. In some embodiments, the computing device 200 is configured to execute a solution 300 for package dependencies in a customized image according to the present invention.

[0051] Figure 4 A flowchart of a solution 300 for package dependencies in a customized image according to an embodiment of the present invention is shown. Method 300 is adapted to be executed in a computing device 200 (the computing device described above), and the solution 300 for package dependencies in a customized image includes steps S301 to S310. In step S301, the data of all packages installed in the original operating system is stored in a first storage device. The data of any installed package is as described above and will not be repeated here.

[0052] In one embodiment, step S301 specifically includes: First, obtaining a first predetermined file of the original operating system. The first predetermined file stores data of all software packages installed in the original operating system. For example, the first predetermined file can be the / var / lib / dpkg / status file. Next, reading the data of all software packages installed on the original operating system from the first predetermined file, and storing the data of all the read software packages in the first storage device 110. Some of the data stored in the first storage device 110 is shown in Table 1, and will not be described again here.

[0053] Next, in step S302, all dependencies of the target software package are determined. The target software package is any pre-installed software package in the custom image process. Specifically, the name, version number, version type of all dependencies, as well as the name, version number, and version type of each dependency's alternative dependencies, are extracted from the second predefined file of the target software package, thereby determining all dependencies of the target software package and the alternative dependencies of each dependency (the all dependencies of the target software package and the alternative dependencies of each dependency determined here can be understood as the direct dependencies of the target software package).

[0054] During the process of customizing the image, step S303 is executed, which involves traversing any dependency. In one implementation, any dependency and its alternative dependencies are traversed using a depth-first search algorithm. The method of traversing using a depth-first search algorithm is an existing technology and is within the scope of protection of this invention, so it will not be discussed here.

[0055] Continue executing step S304, search for the currently traversed dependent data in the first storage device, and determine whether the currently traversed dependent data is found in the first storage device 110. In one embodiment, step S304 includes: searching for the currently traversed dependent data in the first storage device 110, or searching for the currently traversed dependent alternative dependent data in the first storage device 110. As long as the currently traversed dependent data or the currently traversed dependent alternative dependent data is found in the first storage device 110, it can be determined that the currently traversed dependent data is found in the first storage device 110. If neither the currently traversed dependent data nor the alternative dependent data is found in the first storage device 110, it can be determined that the currently traversed dependent data is not found in the first storage device 110.

[0056] If the data for the current traversal dependency is found in the first storage device 110, step S305 is executed to retrieve the data for the current traversal dependency from the first storage device. Specifically, the dependency information for the current traversal dependency is retrieved from the first storage device 110, including one or more fields. Each field includes the dependency name, version number, version number type, and the name, version number, and version number type of the alternative dependency corresponding to the dependency. If the data for the current traversal dependency is not found in the first storage device 110, step S306 is executed to determine whether the data for the current traversal dependency is stored in the second storage device.

[0057] If the second storage device contains the data currently being traversed and dependent on, to avoid repeated downloads, step S307 is executed to retrieve the data from the second storage device; specifically, the path to the second predetermined file currently being traversed and dependent on is retrieved from the second storage device. If the second storage device does not contain the data currently being traversed and dependent on, step S308 is executed to download the currently traversed dependencies.

[0058] Next, in step S309, the downloaded dependency data is stored in the second storage device. During the image customization process, the data for any downloaded dependency is as described above, and some data stored in the second storage device 120 is shown in Table 2; these will not be repeated here. Next, in step S310, all sub-dependencies of the currently traversed dependency and alternative dependencies for each sub-dependency are determined based on the acquired dependency data or the downloaded dependency data.

[0059] In one implementation, if the dependency package information of the currently traversed dependency is obtained from the first storage device 110, then all sub-dependencies of the currently traversed dependency package and the alternative dependencies of each sub-dependency are determined using the dependency package information. If the path of the second predetermined file of the currently traversed dependency is obtained from the second storage device 120, then the second predetermined file is accessed through the path of the second predetermined file, thereby determining all sub-dependencies of the currently traversed dependency and the alternative dependencies of each sub-dependency. If the currently traversed dependency is downloaded, then the second predetermined file is accessed through the path of the downloaded dependency, thereby determining all sub-dependencies of the currently traversed dependency and the alternative dependencies of each sub-dependency.

[0060] It should be noted that in the implementation of this invention, the tree structure corresponding to the target software package and its dependencies is dynamically generated. Only after downloading or obtaining any direct dependency of the target software package can the sub-dependencies of the current direct dependency be determined, and steps S303 to S311 are executed to traverse any sub-dependency of the current direct dependency and obtain or download the sub-dependency from the first storage device 110, until all sub-dependencies of the current direct dependency no longer include dependencies, at which point the traversal of the tree structure branch of the current direct dependency is completed. Steps S303 to S311 are then executed to traverse any other direct dependency branch of the tree structure of the target software package, and so on, until all dependencies of the tree structure are traversed.

[0061] by Figure 1 The tree structure shown is an example ( Figure 1 (Alternative dependencies are not shown). A detailed explanation of the dependency traversal process is provided (excluding alternative dependencies). Figure 1It is known that the target software package is A, and the direct dependencies of target software package A include B1, B2, and B3. Dependency B1, in turn, depends on software packages C1, C2, and C3. Therefore, in this solution, firstly, dependency B1 is traversed, and steps S303 to S311 are executed to determine that dependency B1 depends on software packages C1, C2, and C3. Next, steps S303 to S311 are executed for dependency C1. If dependency C1 has no dependencies, then steps S303 to S311 are executed for dependency C2. If dependency C2 has no dependencies, then steps S303 to S311 are executed for dependency C3. If dependency C3 has no dependencies, then steps S303 to S311 are executed for dependency B2, and so on, until all dependencies of the target software package have been traversed. The following is a key code example of this invention:

[0062]

[0063]

[0064]

[0065]

[0066]

[0067]

[0068]

[0069]

[0070] Based on the above, the solution for package dependencies in customized images provided by this invention achieves the following: during the image customization process, it relies on packages already installed on the original operating system and iterates through the missing dependencies of the target pre-installed packages. Since missing dependencies are determined based on packages already installed on the original operating system, the missing dependencies of the target pre-installed packages can be accurately identified during the image customization process. Furthermore, this invention also stores downloaded dependencies; missing dependencies are only downloaded if they are not stored, thus avoiding duplicate downloads, improving the speed of package dependency resolution, preventing resource waste, and improving resource utilization.

[0071] The various techniques described herein can be implemented in combination with hardware or software, or a combination thereof. Thus, the methods and apparatus of the present invention, or certain aspects or portions thereof, can take the form of program code (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, USB flash drive, floppy disk, CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into and executed by a machine such as a computer, the machine becomes an apparatus for practicing the present invention.

[0072] When the program code is executed on a programmable computer, the computing device generally includes a processor, a processor-readable storage medium (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store program code; the processor is configured to execute the solution for software package dependencies in the customized image of the present invention according to instructions in the program code stored in the memory.

[0073] By way of example, and not limitation, readable media include readable storage media and communication media. Readable storage media stores information such as computer-readable instructions, data structures, program modules, or other data. Communication media generally embodies computer-readable instructions, data structures, program modules, or other data in the form of modulated data signals such as carrier waves or other transmission mechanisms, and includes any information delivery medium. Any combination of the above is also included within the scope of readable media.

[0074] In the specification provided herein, the algorithms and displays are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used with the examples of this invention. The required structure for constructing such systems is apparent from the above description. Furthermore, this invention is not directed to any particular programming language. It should be understood that the contents of the invention described herein can be implemented using various programming languages, and the above description of specific languages ​​is for the purpose of disclosing the best mode of implementation of the invention.

[0075] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0076] Similarly, it should be understood that, in order to streamline this disclosure and aid in understanding one or more of the various aspects of the invention, in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof. However, this method of disclosure should not be interpreted as reflecting an intention that the claimed invention requires more features than expressly recited in each claim. Rather, as reflected in the claims, inventive aspects lie in fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of the invention.

[0077] Those skilled in the art will understand that modules, units, or components of the devices disclosed in the examples herein can be arranged in the devices described in this embodiment, or alternatively, can be located in one or more devices different from the devices in this example. The modules in the foregoing examples can be combined into a single module or, in addition, can be divided into multiple sub-modules.

[0078] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.

[0079] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features but not others included in other embodiments, combinations of features from different embodiments are intended to be within the scope of the invention and form different embodiments. For example, in the claims, any of the claimed embodiments can be used in any combination.

[0080] Furthermore, some of the embodiments described herein are methods or combinations of method elements that can be implemented by a processor of a computer system or by other means of performing the functions. Therefore, a processor having the necessary instructions for implementing the methods or method elements forms means for implementing the methods or method elements. Furthermore, the elements described herein in the apparatus embodiments are examples of means for implementing the functions performed by elements for the purposes of carrying out the invention.

[0081] As used herein, unless otherwise specified, the use of ordinal numbers such as “first,” “second,” “third,” etc., to describe ordinary objects merely indicates different instances of similar objects and is not intended to imply that the objects being described must have a given order in time, space, ordering, or any other manner.

[0082] Although the invention has been described with reference to a limited number of embodiments, those skilled in the art will understand from the foregoing description that other embodiments are conceivable within the scope of the invention described herein. Furthermore, it should be noted that the language used in this specification has been chosen primarily for readability and instructional purposes, and not for the purpose of interpreting or limiting the subject matter of the invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the invention is illustrative and not restrictive, and the scope of the invention is defined by the appended claims.

Claims

1. A solution for package dependencies in a customized image, executed in a computing device, the computing device being communicatively connected to a first storage device and a second storage device, wherein, The first storage device stores data on all software packages installed on the original operating system of the customized image. The data on the installed software packages stored in the first storage device includes: the name of the installed software package, the version number of the installed software package, and information on dependent software packages. The method includes: Identify all dependent packages of the target package as the first package, wherein the target package is any pre-installed package; During the image customization process, traverse any of the first software packages; If the data of the first software package currently being traversed is found in the first storage device, then the data of the first software package currently being traversed is retrieved from the first storage device. If the data of the first software package being traversed is not found in the first storage device, then the first software package being traversed is downloaded. Specifically, this includes determining whether the data of the first software package being traversed is stored in the second storage device. If yes, the data of the first software package being traversed is obtained from the second storage device. If no, the first software package being traversed is downloaded. The downloaded first software package data is stored in the second storage device. The data of any downloaded first software package includes: the downloaded dependency name, the downloaded dependency version number, the downloaded dependency version number type, and the storage path of the second predetermined file of the downloaded dependency. The dependent packages of the first package being traversed are determined by the data of the first package that has been acquired or downloaded.

2. The method of claim 1, further comprising the step of: Iterate through any dependent packages of the first package.

3. The method according to any one of claims 1 to 2, further comprising the step of: Obtain the first predefined file of the original operating system; Read data of all software packages installed on the original operating system from the first predefined file; All read software packages are stored in the first storage device.

4. The method of claim 3, wherein, Traverse any of the first software packages using a depth-first search algorithm.

5. The method of claim 1, wherein, The data of any installed software package stored in the first storage device includes: the name of the installed software package, the version number of the installed software package, and information on dependent software packages. The information on dependent software packages includes: the name, version number, and version number type of the dependent software packages, as well as the version number, name, and version number type of alternative dependent software packages.

6. The method of claim 1, wherein, The second predefined file includes the names, version numbers, and version type of all dependencies of the downloaded package, as well as the names, version numbers, and version type of alternative dependency packages. Each of the first packages includes any dependency package of the target package and any alternative dependency package of any dependency package.

7. A computing device, comprising: At least one processor; as well as A memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions including instructions for performing the method as described in any one of claims 1-6.

8. A readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Software installation method, user equipment, storage medium and device

    CN109634617A

  • Picture loading method, picture loading device and electronic equipment

    CN112615911A

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

    CN112748949A