Software package dependency processing method, computing device, and readable storage medium
By converting the metadata packets of the operating system into dependency data in the graph database, the problem of the inability to query software package dependencies across the operating system in the prior art is solved, and the efficiency and flexibility of cross-version software package dependency query is achieved.
Patent Information
- Application Number
- CN202210459295.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-27
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2042-04-27
AI Technical Summary
The prior art cannot query software package dependencies for different operating system versions independently of the operating system, and can only query the dependencies of the current operating system.
By obtaining the metadata packets of the operating system, parsing and converting them into dependency data in the graph database, establishing software package dependencies for multiple operating system versions of the graph database instances to manage software package dependencies, and using the graph database to query software package dependencies.
It realizes the clear and intuitive query of software package dependencies of multiple operating system versions in the graph database, without executing commands on the operating system, improving query efficiency and flexibility.
Smart Images

Figure CN114879978B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method for processing software package dependencies of an operating system, a computing device, and a readable storage medium. Background Art
[0002] When installing software packages in an operating system, you often encounter dependency issues with the software packages, which can cause the software to fail to install successfully.
[0003] On the existing Debian platform, the default package management tool does not support querying dependencies between packages. Currently, one method for querying package dependencies is to use the debtree tool to resolve package dependencies using the command line. However, this method is tightly coupled with the operating system on which the command is executed. That is, the command must be executed on the operating system to resolve package dependencies, and it cannot query package dependencies independently of the operating system. Furthermore, it can only query package dependencies for the current operating system version on which the command is executed; it cannot query dependencies for other operating systems or other operating system versions.
[0004] Therefore, a method for processing software package dependencies of an operating system is needed to solve the problems existing in the existing technical solutions. Summary of the Invention
[0005] To this end, the present invention provides a method for processing software package dependencies of an operating system, a computing device, and a readable storage medium to solve or at least alleviate the above problems.
[0006] According to a first aspect of the present invention, a method for processing software package dependencies in an operating system is provided. The method comprises: obtaining metadata packages for software packages corresponding to one or more versions of the operating system; parsing the metadata packages to obtain dependency data between all software packages in the operating system; converting the dependency data into statements for creating software package dependencies, and writing the statements into a graph database, so that the dependencies of the software packages to be queried can be queried in the graph database.
[0007] Optionally, in the method for processing software package dependencies of an operating system according to the present invention, the method further includes: creating an instance for each version of the operating system in a graph database so as to manage dependencies between software packages in one or more versions of the operating system through the graph database.
[0008] Optionally, in the method for processing software package dependencies of an operating system according to the present invention, the step of parsing a metadata package to obtain dependency data between all software packages in the operating system includes: parsing the key-value pairs included in the metadata package to obtain an information list, the information list including information of all software packages in the operating system; and converting the information list into dependency data between all software packages in the operating system.
[0009] Optionally, in the method for processing software package dependencies of an operating system according to the present invention, the step of converting dependency data into a statement for creating software package dependencies includes: intercepting and splicing a character string included in the dependency data to obtain a statement for creating software package dependencies, where the character string includes the name of the software package.
[0010] Optionally, in the method for processing software package dependencies of an operating system according to the present invention, the step of querying the dependencies of the software packages to be queried in the graph database includes: querying the dependencies of the software packages to be queried in the graph database using a query statement.
[0011] Optionally, in the method for processing software package dependencies of an operating system according to the present invention, the step of querying the dependency relationships of the software package to be queried in the graph database through a query statement includes: inserting the name of the software package to be queried into the query statement; inputting the query statement into the command input window of the graph database, querying the dependency relationships of the software package to be queried in the graph database, and obtaining a graph including all the dependency relationships of the software package to be queried.
[0012] Optionally, in the method for processing software package dependencies of an operating system according to the present invention, before the step of obtaining metadata packages of software packages corresponding to one or more versions of the operating system, it also includes: obtaining a warehouse source of one or more versions of the operating system; and extracting metadata packages of software packages corresponding to one or more versions of the operating system from the warehouse source.
[0013] Optionally, in the method for processing software package dependencies of an operating system according to the present invention, character strings are intercepted and concatenated using an echo command of a shell language.
[0014] Optionally, in the method for processing software package dependencies of an operating system according to the present invention, the graph database is a neo4j database.
[0015] According to a second aspect of the present invention, there is provided a computing device comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be suitable for execution by the at least one processor, and the program instructions include instructions for executing the method described above.
[0016] According to a third aspect of the present invention, a readable storage medium storing program instructions is provided. When the program instructions are read and executed by a computing device, the computing device executes the method described above.
[0017] According to the technical solution of the present invention, by obtaining and parsing metadata packages corresponding to one or more versions of operating systems, dependency data between all software packages corresponding to each operating system version is obtained. These dependencies are then written to a graph database, facilitating the graph database's centralized processing of the package dependencies for each operating system version. After establishing a graph database storing the dependencies of all software packages for each operating system version, querying the dependencies of any software package in the operating system using the graph data provides a clear and intuitive method, without requiring commands to be executed on the operating system. Querying the package dependencies of each operating system version in the graph database is simple and efficient.
[0018] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] To achieve the above and related purposes, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings, which 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 above and other objects, features, and advantages of the present disclosure will become more apparent by reading the following detailed description in conjunction with the accompanying drawings. Throughout this disclosure, the same reference numerals generally refer to the same parts or elements.
[0020] Figure 1 A schematic diagram of a computing device 100 according to one embodiment of the present invention is shown;
[0021] Figure 2 A flowchart showing a method 200 for processing software package dependencies of an operating system according to an embodiment of the present invention; and
[0022] Figure 3 A schematic diagram showing a graph output by a graph database according to an embodiment of the present invention, including a dependency relationship of a software package to be queried. DETAILED DESCRIPTION
[0023] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0024] The method for processing software package dependencies in an operating system of the present invention is executed in a computing device. The computing device can be any device with storage and computing capabilities, and can be implemented as, for example, a server, a workstation, or a personal computer such as a desktop computer or a laptop computer, or as a terminal device such as a mobile phone, a tablet computer, a smart wearable device, or an Internet of Things device, but is not limited thereto.
[0025] Figure 1 FIG1 shows a schematic diagram of a computing device 100 according to an embodiment of the present invention. It should be noted that, Figure 1 The computing device 100 shown is only an example. In practice, the computing device used to implement the method for processing software package dependencies of the operating system of the present invention can be any type of device, and its hardware configuration can be different from the above. Figure 1 The computing device 100 shown is the same as Figure 1 The computing device 100 shown is different. In practice, the computing device used to implement the method for processing software package dependencies of the operating system of the present invention can be Figure 1 The hardware components of the computing device 100 shown may be added or deleted, and the present invention does not limit the specific hardware configuration of the computing device.
[0026] like Figure 1 As shown, in a basic configuration 102, computing device 100 typically includes system memory 106 and one or more processors 104. A memory bus 108 may be used for communication between processor 104 and system memory 106.
[0027] Depending on the desired configuration, the processor 104 can be any type of processor, including, but not limited to, a microprocessor (μP), a microcontroller (μC), a digital signal processing unit (DSP), or any combination thereof. The processor 104 can include one or more levels of cache, such as a level 1 cache 110 and a level 2 cache 112, a processor core 114, and registers 116. An example processor core 114 can include an arithmetic logic unit (ALU), a floating point unit (FPU), a digital signal processing core (DSP core), or any combination thereof. An example memory controller 118 can be used with the processor 104, or in some implementations, the memory controller 118 can be an internal part of the processor 104.
[0028] Depending on the desired configuration, system memory 106 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. Physical memory in a computing device typically refers to volatile RAM. Data from a disk must be loaded into physical memory before it can be read by processor 104. System memory 106 may include an operating system 120, one or more applications 122, and program data 124. In some embodiments, applications 122 may be arranged so that one or more processors 104 execute instructions on the operating system using program data 124. Operating system 120 may be, for example, Linux or Windows, and includes program instructions for handling basic system services and performing hardware-dependent tasks. Applications 122 include program instructions for implementing various user-desired functions. Applications 122 may include, but are not limited to, browsers, instant messaging software, software development tools (such as integrated development environments (IDEs) and compilers). When applications 122 are installed in computing device 100, driver modules may be added to operating system 120.
[0029] When the computing device 100 is started, the processor 104 reads and executes the program instructions of the operating system 120 from the memory 106. Applications 122 run on top of the operating system 120, utilizing the interfaces provided by the operating system 120 and the underlying hardware to implement various user-desired functions. When a user launches an application 122, the application 122 is loaded into the memory 106, and the processor 104 reads and executes the program instructions of the application 122 from the memory 106.
[0030] Computing device 100 also includes a storage device 132 including removable storage 136 and non-removable storage 138 , both of which are connected to storage interface bus 134 .
[0031] The computing device 100 may also include an interface bus 140 that facilitates communication from various interface devices (e.g., output devices 142, peripheral interfaces 144, and communication devices 146) to the basic configuration 102 via the bus / interface controller 130. Example output devices 142 include a graphics processing unit 148 and an audio processing unit 150. These can be configured to facilitate communication with various external devices such as a display or speakers via one or more A / V ports 152. Example peripheral interfaces 144 may include a serial interface controller 154 and a parallel interface controller 156, which can be configured to facilitate communication with external devices such as input devices (e.g., a keyboard, mouse, pen, voice input device, touch input device) or other peripherals (e.g., a printer, scanner, etc.) via one or more I / O ports 158. Example communication devices 146 may include a network controller 160, which can be arranged to facilitate communication with one or more other computing devices 162 via a network communication link via one or more communication ports 164.
[0032] A network communication link can be an example of a communication medium. Communication media can generally be embodied as computer-readable instructions, data structures, program modules 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 in which one or more of its data sets or changes thereto can be performed in a manner that encodes information in the signal. As non-limiting examples, communication media can include wired media such as a wired network or a dedicated line network, and various wireless media such as 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.
[0033] In the computing device 100 according to the present invention, the program data 124 includes instructions for executing the method for processing software package dependencies of the operating system according to the present invention. The instructions can instruct the processor 104 to execute the method for processing software package dependencies of the operating system according to the present invention.
[0034] Figure 2 FIG2 is a flowchart of a method 200 for processing software package dependencies of an operating system according to an embodiment of the present invention. The method 200 is suitable for execution in a computing device (such as the aforementioned computing device 100). Figure 2 As shown, the method 200 begins at step S210 .
[0035] In step S210, metadata packages of software packages corresponding to one or more versions of operating systems are obtained.
[0036] Among them, the metadata of the software package corresponding to the operating system, that is, the metadata package, records the relevant information of the software package of the operating system, including but not limited to: software package name, version number, dependent software packages and version numbers, conflicting software packages and version numbers, software function description, software classification, software upstream website, software size, software architecture, software maintainer, etc. The dependency relationship in the present invention refers to the relationship between dependencies and conflicts between operating system software packages. Among them, dependency relationships, for example, the prerequisite for installing software package A is that software package B must be installed first. Conflict relationships, for example, the prerequisite for installing software package C is that software package D must be uninstalled first. It should be noted that the dependency relationships referred to in the present invention include not only the dependency relationships between software packages, but also the conflict relationships between software packages, collectively referred to as dependency relationships.
[0037] According to one embodiment of the present invention, metadata packages of one or more versions of an operating system can be obtained from the warehouse source of each operating system. Specifically, each version of the operating system has a corresponding warehouse source, and there is a metadata package in each warehouse source, which is usually stored in the / var / lib / apt / lists directory, including metadata information of all software packages of the operating system version corresponding to the warehouse source. By obtaining the warehouse source of one or more versions of the operating system, metadata packages of one or more versions of the operating system can be extracted from the warehouse source. The metadata package includes multiple key-value pairs, and each line stores a key-value pair. The key-value pairs are separated by a colon, the metadata name is on the left side of the colon, and the value corresponding to the metadata name is on the right side of the colon. The dependency data between all software packages can be obtained by parsing the key-value pairs of the metadata package.
[0038] The operating system may be, for example, Linux, Debian, Deepin, or UOS, but is not limited thereto. Other operating systems are also possible, and the present invention does not impose any restrictions thereon. Each operating system may have multiple versions. For example, the Debian operating system has at least three release versions: a stable version, a testing version, and an unstable version.
[0039] Then, in step S220, the metadata packages of the software packages corresponding to the obtained one or more versions of the operating system are parsed to obtain dependency relationship data between all software packages in the operating system.
[0040] The step of parsing the metadata package is performed for each of the one or more versions of the operating system obtained. Optionally, since each operating system has one or more versions, if only one version of an operating system is obtained, the step of parsing the metadata package is performed only for that version of the operating system. If multiple versions of an operating system are obtained, the step of parsing the metadata package is performed for each version of the operating system.
[0041] Optionally, a graph database instance is created for each operating system version, that is, for each version of each operating system, so that the graph database can manage the dependencies between all software packages in one or more operating system versions. In this way, the graph database can simultaneously manage multiple operating systems, multiple operating systems with different architectures, and different versions of each operating system. Preferably, the graph database is a neo4j database. Other graph databases can also be used, and the present invention does not impose any particular restrictions on the specific graph database used.
[0042] Parse the key-value pairs included in the metadata package to obtain an information list, wherein the information list includes information about all software packages in the operating system. The following is an exemplary information list:
[0043] Package:tpm2-abrmd
[0044] Version:2.1.0-1
[0045] Depends:libc6(>=2.14),libglib2.0-0(>=2.37.3),libtss2-esys0
[0046] From this exemplary information list, we can know that the software package name is tpm2-abrmd, the version number is 2.1.0-1, and the dependency list includes libc6 (version 2.14 and above), libglib2.0-0 (version 2.37.3 and above), and libtss2-esys0 (any version).
[0047] Convert this information list into dependency data among all software packages in the operating system.
[0048] According to the conventions of apt package management, the value corresponding to Depends describes the dependencies of the package. If a package has multiple dependencies, the multiple other packages that the package depends on (hereinafter referred to as dependent packages) are separated by commas. If the dependent packages have version requirements, they are described in brackets. By converting the above exemplary information list, the following exemplary dependency data can be parsed:
[0049] tpm2-abrmd (2.1.0-1) depends on libc6 (>= 2.14)
[0050] tpm2-abrmd (2.1.0-1) depends on libglib2.0-0 (>=2.37.3)
[0051] tpm2-abrmd (2.1.0-1) depends on libtss2-esys0
[0052] From this exemplary dependency data, we can see that the tpm2-abrmd software package version 2.1.0-1 depends on the libc6 software package version 2.14 or later, the tpm2-abrmd software package version 2.1.0-1 depends on the libglib2.0-0 software package version 2.37.3 or later, and the tpm2-abrmd software package version 2.1.0-1 depends on any version of the libtss2-esys0 software package.
[0053] Subsequently, in step S230 , the dependency data is converted into statements for creating software package dependencies and written into a graph database, so that the dependency of the software package to be queried can be queried in the graph database.
[0054] According to an embodiment of the present invention, a statement for creating a software package dependency is obtained by intercepting and concatenating strings included in dependency data, where the strings include the names of the software packages. For example, intercepting the strings included in the exemplary dependency data above yields "tpm2-abrmd," "2.1.0-1," "libc6," "2.14," "libglib2.0-0," "2.37.3," and "libtss2-esys0," and then concatenating the strings into corresponding positions in a create statement for creating the software package dependency. Alternatively, intercepting and concatenating the strings can be accomplished using the echo command in a shell language.
[0055] The following is an example of the converted statement used to create package dependencies:
[0056] create(tpm2abrmd:pkg{name:"tpm2-abrmd",version:"2.1.0-1"});
[0057] create(libc6:pkg{name:"libc6",version:"2.28.12-1+eagle"});
[0058] create(libglib200:pkg{name:"libglib2.0-0",version:"2.58.3.5-1+eagle"});
[0059] create(libtss2esys0:pkg{name:"libtss2-esys0",version:"2.1.0-4"});
[0060] create(tpm2abrmd)-[:DEPENDS{version:"2.14",num:"1"}]->(libc6),
[0061] (tpm2abrmd)-[:DEPENDS{version:"2.37.3",num:"1"}]->(libglib200),
[0062] (tpm2abrmd)-[:DEPENDS]->(libtss2esys0);
[0063] First, four new nodes were created: tpm2abrmd (with the corresponding software package tpm2-abrmd), libc6 (with the corresponding software package libc6), libglib200 (with the corresponding software package libglib2.0-0), and libtss2esys0 (with the corresponding software package libtss2-esys0). Their versions were 2.1.0-1, 2.28.12-1+eagle, 2.58.3.5-1+eagle, and 2.1.0-4, respectively. Then, relationships between the nodes were established using statements for creating package dependencies. Specifically, the tpm2-abrmd package depended on version 2.14 of the libc6 package, the tpm2-abrmd package depended on version 2.37.3 of the libglib2.0-0 package, and the tpm2-abrmd package depended on the libtss2-esys0 package.
[0064] The dependency data is converted into statements for creating software package dependencies. The dependencies between software packages can be written into a graph database through the statements for creating software package dependencies. In this way, the dependencies of the software packages to be queried can be queried through the graph database, without having to parse the dependencies of the software packages by executing commands on the operating system, thus achieving the query of the dependencies of the software packages independent of the operating system. Users can query the dependencies of the required software packages to be queried in the graph database, and can query not only the dependencies of any software packages in the operating system used by the computing device itself, but also the dependencies of any software packages in other operating systems. Through the method for processing software package dependencies of the operating system of the present invention, the graph database can manage the dependencies of software packages in multiple versions of multiple operating systems through multiple database instances. Users can query the dependencies of any software packages in multiple versions of multiple operating systems in the graph database without logging in to the server for query. The present invention provides a more convenient, fast, safer and more efficient way to process operating system software package dependencies.
[0065] The following describes a method for querying the dependency relationships of software packages to be queried in a graph database.
[0066] According to an embodiment of the present invention, the dependency relationship of the software package to be queried in the graph database is queried through a query statement. The name of the software package to be queried is inserted into the query statement. Optionally, the dependency relationship of the software package to be queried can be queried through the MATCH(n)-[:DEPENDS]->(p)RETURN(n) statement, replacing n with the name of the software package to be queried, for example: match(tpm2abrmd)-[:DEPENDS]->(p)return tpm2abrmd. Then, the query statement is input into the command input window of the graph database to query the dependency relationship of the software package to be queried in the graph database, and the graph database will output a picture including all the dependency relationships of the software package to be queried. Optionally, the query statement may be MATCH(n)-[:DEPENDS]->(p)RETURN(n), p limit 10, where n is replaced with the name of the software package to be queried. For example, match(tpm2abrmd)-[:DEPENDS]->(p)return tpm2abrmd, p limit 10. After adding plimit 10, this query statement is used to query the dependencies of the tpm2-abrmd software package, limiting the output dependencies to within 10 items. Here, the number 10 after limit may also be replaced with another number to limit the output dependencies to a specific number. Figure 3The following diagram shows a diagram of a graph database output including the dependency relationship of a software package to be queried according to an embodiment of the present invention. The query statement match(tpm2abrmd)-[:DEPENDS]->(p)return tpm2abrmd, p limit 10 is entered into the command input window of the graph database, and the graph database outputs the following: Figure 3 The image shows the dependencies of the tpm2-abrmd package. The image shows that the tpm2-abrmd package depends on three packages: libglib2.0-0, libc6, and libtss2-esys0. The libtss2-esys0 package also depends on the libtss2-udev and libgcrypt20 packages.
[0067] The graph database outputs the dependency relationships of the software packages being queried. Software packages are represented by nodes, and dependency relationships are represented by arrows. The direction of the arrows clearly and intuitively displays the dependencies between packages. The graph database output shows which packages (dependent packages) a package depends on, as well as the different dependency relationships between dependent packages. Querying the dependency relationships of queried software packages using a graph database is not only clear and intuitive, but also allows querying different versions of software packages stored in the database for multiple operating systems, independent of the specific operating system of the computing device. This makes the query and query result feedback process simple and efficient.
[0068] According to the technical solution of the present invention, by obtaining and parsing metadata packages corresponding to one or more versions of operating systems, dependency data between all software packages corresponding to each operating system version is obtained. These dependencies are then written to a graph database, facilitating the graph database's centralized processing of the package dependencies for each operating system version. After establishing a graph database storing the dependencies of all software packages for each operating system version, querying the dependencies of any software package in the operating system using the graph data provides a clear and intuitive method, without requiring commands to be executed on the operating system. Querying the package dependencies of each operating system version in the graph database is simple and efficient.
[0069] Furthermore, the technical solution of the present invention creates an instance in the graph database for each version of the operating system, so that the graph database can simultaneously manage the dependencies of all software packages in multiple versions of the operating system, and can realize centralized management of the dependencies of all software packages in each operating system and its various versions, providing users with a unified and convenient way to query the dependencies of each operating system and its version software packages in the graph database, greatly improving the storage and query efficiency of software package dependencies.
[0070] The various techniques described herein may be implemented in conjunction with hardware or software, or a combination thereof. Thus, the methods and apparatus of the present invention, or certain aspects or portions of the methods and apparatus of the present invention, may be implemented in the form of program codes (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, a USB flash drive, a floppy disk, a CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into a machine such as a computer and executed by the machine, the machine becomes an apparatus for practicing the present invention.
[0071] When the program code is executed on a programmable computer, the mobile terminal generally includes a processor, a storage medium readable by the processor (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 the program code, and the processor is configured to execute the method for processing software package dependencies in an operating system according to the instructions in the program code stored in the memory.
[0072] By way of example and not limitation, readable media include readable storage media and communication media. Readable storage media store information such as computer-readable instructions, data structures, program modules, or other data. Communication media typically embody computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and include any information delivery medium. Combinations of any of the above are also included within the scope of readable media.
[0073] In the description provided herein, the algorithms and displays are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems may also be used in conjunction with the examples of the present invention. Based on the above description, it is apparent that the structure required for constructing such systems is well understood. In addition, the present invention is not directed to any specific programming language. It should be understood that various programming languages may be utilized to implement the present invention described herein, and the description of specific languages above is provided for the purpose of disclosing the preferred embodiment of the present invention.
[0074] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of this description.
[0075] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Accordingly, the claims that follow the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of the invention.
[0076] Those skilled in the art will appreciate that the modules, units, or components of the devices in the examples disclosed herein may be arranged in the device described in the embodiment, or alternatively may be located in one or more devices different from the devices in the examples. The modules in the foregoing examples may be combined into one module or further divided into multiple submodules.
[0077] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition may be divided into multiple submodules or subunits or subcomponents. All features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed herein may be combined in any combination, except that at least some of such features and / or processes or units are mutually exclusive. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0078] Furthermore, those skilled in the art will appreciate that although some embodiments described herein include certain features included in other embodiments but not other features, combinations of features from different embodiments are intended to be within the scope of the present invention and to form different embodiments. For example, in the claims below, any of the claimed embodiments may be used in any combination.
[0079] In addition, some of the embodiments are described herein as methods or combinations of method elements that can be implemented by a processor of a computer system or by other devices that perform the functions described. Thus, a processor having the necessary instructions for implementing the method or method element forms a device for implementing the method or method element. Furthermore, the elements described herein of the device embodiments are examples of devices for implementing the functions performed by the elements for the purpose of implementing the invention.
[0080] As used herein, unless otherwise specified, the use of ordinal numbers "first," "second," "third," etc. to describe common objects merely indicates that different instances of similar objects are involved and are not intended to imply that the objects so described must have a given order in time, space, ranking, or in any other manner.
[0081] Although the present invention has been described with respect to a limited number of embodiments, it will be apparent to those skilled in the art, having benefit of the foregoing description, that other embodiments are contemplated within the scope of the invention thus described. Furthermore, it should be noted that the language used in this specification has been selected primarily for readability and didactic purposes, rather than for the purpose of explaining or limiting the subject matter of the present invention. Consequently, 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 present invention is intended to be illustrative and not restrictive of the scope of the invention, which is defined by the appended claims.
Claims
1. A method for processing software package dependencies of an operating system, the method comprising: Obtain metadata packages for software packages corresponding to one or more versions of an operating system; Parsing the metadata package to obtain dependency relationship data among all software packages in the operating system, specifically including: parsing key-value pairs included in the metadata package to obtain an information list, the information list including information of all software packages in the operating system, and converting the information list into dependency relationship data among all software packages in the operating system; Converting the dependency data into a statement for creating a software package dependency and writing the statement into a graph database so as to query the dependency of the software package to be queried in the graph database, wherein converting the dependency data into the statement for creating the software package dependency includes intercepting and concatenating character strings included in the dependency data to obtain the statement for creating the software package dependency, wherein the character strings include the names of the software packages; In the graph database, an instance is created for each version of the operating system, so that the dependency relationship between software packages in one or more versions of the operating system is managed through the graph database.
2. The method according to claim 1, wherein The step of querying the dependency relationship of the software package to be queried in the graph database includes: Insert the name of the software package to be queried into the query statement; The query statement is input into the command input window of the graph database, the dependency relationship of the software package to be queried in the graph database is queried, and a graph including all the dependency relationships of the software package to be queried is obtained.
3. The method according to claim 1, wherein Before the step of obtaining metadata packages of software packages corresponding to one or more versions of the operating system, the method further includes: Get the repository source of one or more versions of the operating system; Extract metadata packages of software packages corresponding to one or more versions of the operating system from the warehouse source.
4. The method according to claim 1, wherein The character strings are intercepted and spliced through the echo command of the shell language.
5. The method according to claim 1, wherein The graph database is a neo4j database.
6. 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, and the program instructions include instructions for executing the method according to any one of claims 1 to 5.
7. A readable storage medium storing program instructions, wherein when the program instructions are read and executed by a computing device, the computing device is caused to execute the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Software package dependency relationship modeling method
CN102109991A
C language project dependency information management and visualization method and system
CN113448553A