Software package construction method, software installation method and computing equipment
By building multi-architecture software packages, including installation files for multiple central processing machines, the problem of installing software packages in multi-architecture environments is solved, and resource conservation and convenient installation is achieved.
Patent Information
- Application Number
- CN202411035858.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-12-06
AI Technical Summary
In a multi-architecture environment, when the same software is installed on different central processor architectures, it is difficult to find or cannot find the software package corresponding to other instruction sets, resulting in waste of resources and difficulty in maintaining them.
By obtaining multiple installation files of the same software, encapsulate them, forming a multi-architecture software package, including the installation files corresponding to multiple central processing units, ensuring that only one software package is found in a multi-architecture environment can be installed, reducing storage Space occupancy.
It solves the problem that the software package corresponding to certain architectures or instruction sets cannot be found or difficult to find, saves resources and maintenance costs, and improves the convenience and efficiency of software installation.
Smart Images

Figure CN119088431A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software development technology, and in particular to a software package construction method, a software installation method and a computing device. Background Art
[0002] In the development of computers, the Von Neumann Architecture is the basic architectural model of modern computers. The Von Neumann Architecture is the basis of modern computer composition. Based on the Von Neumann Architecture, the Central Processing Unit (CPU) is the core component of the computer. The CPU is the brain of the computer and is responsible for executing the instruction set stored in the computer's memory. These instructions constitute the computer program.
[0003] With the development of science and technology, the application of multi-architecture (Multi-Arch or Multiarch) environment is becoming more and more widespread. In a multi-architecture environment, there are multiple CPU architectures, and different CPU architectures correspond to different instruction sets.
[0004] In order for software to run in a central processing unit, it needs to be compiled into installation files corresponding to the instruction set by a compiler, and the installation files are packaged into a software package. When the same software needs to run on central processing units of different architectures, the software package construction method in the current technology requires that the same software be compiled into installation files corresponding to different instruction sets according to the instruction sets corresponding to different central processing unit architectures, and the installation files corresponding to different instruction sets are packaged into software packages.
[0005] Therefore, it can be seen that in the current technology, when there are multiple CPU architectures in a multi-architecture environment, if multiple CPUs want to install the same software, it is necessary to find software packages of the software corresponding to multiple architectures (or instruction sets), but only software packages corresponding to one instruction set can be found, while software packages corresponding to other instruction sets cannot be found or it is difficult to find software packages corresponding to other instruction sets. Summary of the invention
[0006] The present application provides a software package construction method, a software installation method and a computing device, wherein the software package directly includes installation files corresponding to multiple central processing unit architectures. In a multi-architecture environment, if multiple central processing units want to install the same software, they only need to find the software package corresponding to the software, which to a certain extent solves the problem of not being able to find or having difficulty finding the software package corresponding to certain architectures (or instruction sets).
[0007] In order to achieve the above objectives, this application adopts the following technical solutions:
[0008] In a first aspect, the present application provides a method for building a software package, which is applied to a first computing device, including: obtaining multiple installation files obtained by compiling the source code of the same software, wherein the multiple installation files correspond one-to-one to multiple central processing architectures; encapsulating the multiple installation files to obtain a multi-architecture software package, wherein the multi-architecture software package includes the multiple installation files. The multi-architecture software package obtained in the present application includes installation files corresponding to multiple central processing unit architectures (or instruction sets). In a multi-architecture environment, if multiple central processing units want to install the same software, they only need to find the software package corresponding to the software, which solves the problem of not being able to find or having difficulty finding the software package corresponding to certain architectures (or instruction sets) to a certain extent.
[0009] In one possible implementation, a directory of a multi-architecture software package is created; under the directory of the multi-architecture software package, subdirectories corresponding to multiple central processing unit architectures are created according to multiple central processing unit architectures corresponding to multiple installation files; and multiple installation files are respectively encapsulated into subdirectories corresponding to multiple central processing unit architectures to obtain a multi-architecture software package.
[0010] In a possible implementation, multiple installation files are compared to obtain common parts corresponding to the multiple installation files, where the common parts are the same parts among the multiple installation files; the common parts and non-common parts in the multiple installation files are encapsulated, where the non-common parts are the parts other than the first part in the security file. This reduces the number of multi-architecture software packages to a certain extent, thereby saving the storage space occupied by storing the multi-architecture software packages.
[0011] In one possible implementation, a directory of a multi-architecture software package is created; under the directory of the multi-architecture software package, a public subdirectory is created, and subdirectories corresponding to multiple CPU architectures are created according to the CPU architectures corresponding to the multiple installation files; the public part is encapsulated into the public subdirectory, and the non-public parts of the multiple installation files are encapsulated into the subdirectories corresponding to the multiple CPU architectures, so as to obtain the multi-architecture software package.
[0012] In a possible implementation, all sub-files included in the multiple installation files are compared in sequence to determine the same sub-files in the multiple installation files, which are the common parts corresponding to the multiple installation files. The common parts are determined by traversal to ensure the accuracy of the determination of the common parts.
[0013] In a possible implementation, the compilation method of the multiple installation files includes: a local compilation method, a cross compilation method, or a combination of local compilation and cross compilation method.
[0014] In a second aspect, the present application provides a software installation method, which is applied to a second computing device, including: based on the software to be installed, obtaining a multi-architecture software package corresponding to the software to be installed; determining whether there is an installation file corresponding to the second central processor architecture in the multi-architecture software package; the second central processor architecture is the central processor architecture of the second computing device; when it is determined that there is an installation file corresponding to the second central processor architecture in the multi-architecture software package, based on the installation file corresponding to the second central processor architecture, implementing the installation of the software to be installed.
[0015] In a possible implementation, the second central processing unit architecture is obtained in the following manner: the second central processing unit architecture is obtained through an architecture arch instruction. In the present application, the hardware architecture type of the second computing device is obtained through an architecture instruction, and the hardware architecture type includes a central processing unit type, thereby obtaining the second central processing unit architecture.
[0016] In a possible implementation, when it is determined that the installation file corresponding to the second central processing unit architecture does not exist in the multi-architecture software package, an installation failure message is displayed to prompt the user that the installation of the software to be installed has failed. The installation failure message prompts the user that the installation of the software to be installed has failed and that the installation file corresponding to the second central processing unit architecture needs to be added to the multi-architecture software package of the software to be installed.
[0017] In a third aspect, the present application provides a computing device, comprising a processor and a memory; the processor and the memory are coupled; the memory is used to store computer program instructions; the processor is used to execute the computer program instructions stored in the memory to implement the software package construction method described in the first aspect and the software installation method described in the second aspect.
[0018] In a fourth aspect, the present application provides a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed on a computing device, the computing device executes the software package construction method described in the first aspect and the software installation method described in the second aspect.
[0019] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on a computing device, enables the computing device to execute the software package construction method described in the first aspect and the software installation method described in the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A schematic diagram of a process for constructing a software package provided in an embodiment of the present application;
[0021] Figure 2 A schematic diagram of the software structure of a multi-architecture software package provided in an embodiment of the present application;
[0022] Figure 3 A schematic diagram of the software structure of another multi-architecture software package provided in an embodiment of the present application;
[0023] Figure 4 A schematic diagram of the software structure of another multi-architecture software package provided in an embodiment of the present application;
[0024] Figure 5 A simplified schematic diagram of the process of a software package construction method provided in an embodiment of the present application;
[0025] Figure 6 A flowchart of a software installation method provided in an embodiment of the present application;
[0026] Figure 7 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The terms "first", "second", "third", etc. in the specification, claims and drawings of this application are used to distinguish different objects rather than to limit a specific order.
[0028] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0029] In order to make the description of the following embodiments clear and concise, a brief introduction to the related technology is first given:
[0030] The von Neumann architecture is a general computer architecture that combines program instruction memory and data memory. In the von Neumann architecture, the central processing unit (CPU) is the control center and execution core of the entire computer system, responsible for interpreting and executing instructions in computer programs. The CPU is mainly composed of two parts, namely the control unit (CU) and the arithmetic logic unit (ALU). The control unit is responsible for reading, decoding and scheduling the execution of instructions; the arithmetic logic unit is responsible for performing actual data processing and logical operations.
[0031] Multi-Architecture mainly involves compatibility, flexibility and support for diversity at the software and hardware levels. At the software level, especially for cross-platform development, a multi-architecture environment means that the software or library can be compiled or recompiled to adapt to different CPU architectures (for example: x86, ARM, MIPS, etc.). At the hardware level, a multi-architecture environment refers to supporting and running CPUs of multiple architectures in a single system or network, such as a server platform that supports both x86 and ARM architecture CPUs.
[0032] Software Package is a way to package a software. Specifically, it integrates one or more software components related to a software (including installation files, library files, configuration files, documentation, etc.) and packages or packages them according to a certain format and structure to facilitate installation, upgrading, configuration and uninstallation. Furthermore, common software package formats include DEB (Debian Package) format, which is mainly used for software package formats of distributions such as Debian and Ubuntu; RPM (Red Hat Package Manager) format, which is used for software package formats of distributions such as Red Hat, CentralOS and Fedora; MSI (Microsoft Installer) is the application installation package format used to install, configure and uninstall software in the Windows operating system, etc.
[0033] The advantages of a software package construction method provided in an embodiment of the present application are explained below by comparing with the software package construction method in the current technology.
[0034] In a multi-architecture environment, there are multiple CPU architectures, and different CPU architectures correspond to different instruction sets. Among them, the instruction set is a set of computing device language commands recognized and executed by the CPU, which defines the basic operations that the CPU can understand and execute. Each CPU architecture is designed with a specific instruction set, which directly affects the way software is written, compiled, and ultimately runs on the CPU.
[0035] In the software package construction method of current technology, when the same software is to be run on central processing units of different architectures, the software needs to be compiled into installation files corresponding to different instruction sets through a compiler, and the installation files of different instruction sets need to be packaged into software packages respectively. That is, the software package for constructing the software in the current technology only includes installation files corresponding to one instruction set.
[0036] It can be seen that in the current technology, when there are multiple CPUs of multiple architectures in a multi-architecture environment, and the CPUs of multiple architectures need to install the same software, it is necessary to find the software packages of the software corresponding to multiple CPU architectures (or instruction sets). However, due to some reasons, generally only the software package of the software corresponding to one CPU architecture (or instruction set) can be found, and the software packages of the software corresponding to other CPU architectures (or instruction sets) cannot be found or it is difficult to find the software packages of the software corresponding to other CPU architectures (or instruction sets). That is, in the current technology, for the same software, only the software package corresponding to a certain CPU architecture (or instruction set) can be found, and the software packages corresponding to other CPU architectures (or instruction sets) cannot or are difficult to find. Some of the reasons for the above problems are exemplary: one reason is that building and maintaining software packages corresponding to multiple CPU architectures (or instruction sets) requires more resources, including development time, testing and maintenance costs, etc. For example, for a software, it is necessary to build and maintain multiple software packages corresponding to multiple important processor architectures (or instruction sets), so for development teams or independent developers with limited resources, there are great challenges. Another reason is that the user base of a certain CPU architecture (or instruction set) is very small, that is, there are few scenarios (small application scope) for applying a certain CPU architecture (or instruction set). Software developers may choose not to build corresponding software packages for it because it is not cost-effective to do so. They are more inclined to focus on platforms with the largest number of users to maximize the software's influence and potential benefits.
[0037] In summary, in a software package construction method in current technology, for the same software, the basic reason why only the software package corresponding to one central processing unit architecture (or instruction set) can be found, and the software packages corresponding to other central processing unit architectures (or instruction sets) cannot be found or are difficult to find is that the installation files of different central processing unit architectures (or instruction sets) are packaged into software packages separately, that is, one software package only includes the installation files of one central processing unit architecture (or instruction set).
[0038] A software package construction method provided in an embodiment of the present application includes: obtaining multiple installation files obtained by compiling the same software, wherein the multiple installation files correspond one-to-one to multiple central processing unit architectures; and encapsulating the multiple installation files to obtain a multi-architecture software package. That is, the multi-architecture software package in the embodiment of the present application includes installation files corresponding to multiple central processing unit architectures (or instruction sets). In a multi-architecture environment, if multiple central processing units want to install the same software, they only need to find the multi-architecture software package corresponding to the software, which solves the problem of not being able to find or having difficulty finding the software package corresponding to certain architectures (or instruction sets) to a certain extent.
[0039] Embodiment 1:
[0040] Combine the following Figure 1-Figure 5 , a software package construction method provided by an embodiment of the present application is introduced in detail. A software package construction method provided by an embodiment of the present application is applied to a software package construction device, and the software package construction device can be a first computing device.
[0041] like Figure 1 As shown, a method for constructing a software package provided in an embodiment of the present application includes the following steps:
[0042] S101, obtaining multiple installation files compiled from source files of the same software.
[0043] Among them, multiple installation files correspond one-to-one to multiple CPU architectures, which can also be called one-to-one correspondence between multiple installation files and multiple instruction sets, that is, installation files corresponding to multiple CPU architectures (or instruction sets) compiled from the same software are obtained.
[0044] The installation file is compiled from the source code of the software, which refers to the program package generated after the source code of the software is compiled, linked, etc., and can be directly installed and run on the CPU of the target architecture. Exemplarily, the installation file includes but is not limited to the following types: executable files, installers, archive files, container images, etc.
[0045] Specifically, in the embodiment of the present application, the compilation method for multiple installation files includes the following possible implementation methods:
[0046] In one possible implementation, multiple installation files are obtained by native compilation (Native Compilation, also known as non-cross compilation). Native compilation is a compilation process performed on the same platform where the target code will run. It can be understood that the compiler and library used are designed for the current central processing unit architecture, and the generated program can be executed directly on the platform without conversion. In the embodiment of the present application, the installation files corresponding to each central processing unit architecture are compiled on a computing device of the central processing unit architecture. Exemplarily, the installation files corresponding to architecture A are compiled on a computing device whose central processing unit architecture is architecture A.
[0047] In another possible implementation, multiple installation files are obtained by cross compilation. Cross compilation is to compile code on one platform, and the generated installation files are designed for another platform. In an embodiment of the present application, the installation files corresponding to multiple central processing unit architectures are compiled on computing devices of other central processing unit architectures. Exemplarily, the installation files corresponding to architecture A and architecture B are compiled on a computing device whose central processing unit architecture is architecture C.
[0048] In another possible implementation, multiple installation files are obtained by combining local compilation and cross compilation. In an embodiment of the present application, the installation files corresponding to multiple central processing unit architectures are compiled on a computing device of one of the multiple central processing unit architectures. Exemplarily, the installation files corresponding to architecture A and architecture B are compiled on a computing device whose central processing unit architecture is architecture B. When the installation files of architecture A are compiled on a computing device whose central processing unit architecture is architecture B, the installation files of architecture A are cross-compiled; when the installation files of architecture B are compiled on a computing device whose central processing unit architecture is architecture B, the installation files of architecture B are locally compiled.
[0049] Specifically, in the embodiment of the present application, the method for obtaining multiple installation files includes the following possible implementation methods:
[0050] In one possible implementation, multiple installation files can be manually copied to the software package building device through an external storage device (for example, a USB flash drive, a mobile hard disk, etc.), that is, multiple installation files are manually copied to the external storage device, and the external storage device is connected to the software package building device, so that the software package building device obtains the multiple installation packages stored in the external storage device from the external storage device.
[0051] In another possible implementation, a specific script or instruction can be used to enable the software package construction device to log in to a computing device that compiles multiple installation files to obtain multiple installation files. Exemplarily, multiple installation files are obtained by local compilation, that is, corresponding installation files are obtained by local compilation of multiple computing devices, and the software package construction device logs in to the multiple computing devices in turn through a specific script or instruction to obtain the corresponding installation files obtained by local compilation of the multiple computing devices.
[0052] S102, encapsulating multiple installation files to obtain a multi-architecture software package.
[0053] Specifically, multiple installation files are packaged into one software package to obtain a multi-architecture software package, that is, a multi-architecture software package including installation files corresponding to multiple CPU architectures (or instruction sets).
[0054] It should be noted that a multi-architecture software package is a name used to describe a software package that includes installation files corresponding to multiple CPU architectures, and is distinguished from the software package in the current technology in name. In addition, the software package that includes installation files corresponding to multiple CPU architectures can also be called a first software package, a software package, etc. This application does not make specific limitations, but only for the convenience of explanation, takes the multi-architecture software package as an example.
[0055] In one possible implementation, a directory of a multi-architecture software package is created; under the directory of the multi-architecture software package, subdirectories corresponding to each central processing unit architecture are created according to the central processing unit architectures corresponding to the multiple installation files; the installation files corresponding to each central processing unit architecture are respectively encapsulated into the subdirectories corresponding to the respective central processing unit architectures, that is, according to the central processing unit architecture, the multiple installation files are respectively encapsulated into the corresponding subdirectories to obtain the multi-architecture software package.
[0056] For ease of understanding, the following Figure 2 , the structure of a multi-architecture software package provided by the embodiment of the present application is introduced by way of example. Among them, the central processing unit architecture includes four examples: x86 architecture, ARM architecture, Loongson architecture and Phytium architecture. Among them, the x86 architecture is one of the most common central processing unit architectures in the field of personal computers and servers. The x86 architecture is a central processing unit architecture based on the principle of complex instruction set computer (CISC). Its instruction set contains a large number of multi-function instructions, and each instruction can complete relatively complex operations; the ARM (Advanced RISC Machines) architecture is a central processing unit architecture based on the principle of reduced instruction set computer (RISC). The ARM architecture has the characteristics of low power consumption, high efficiency and high customizability; the Loongson architecture is a central processing unit architecture based on the principle of reduced instruction set computer (RISC). Specifically, the Loongson architecture adopts the MIPS instruction set. The Loongson architecture provides general computing capabilities and emphasizes autonomous control and information security; the Phytium architecture is a central processing unit architecture based on the principle of reduced instruction set computer (RISC). The Phytium architecture meets the needs of high-performance computing and data centers, providing powerful computing capabilities while maintaining low energy consumption.
[0057] like Figure 2As shown, under the directory of the multi-architecture software package, create subdirectories for the x86 architecture, subdirectories for the ARM architecture, subdirectories for the Loongson architecture, and subdirectories for the Feiteng architecture; encapsulate the installation files of the x86 architecture into the subdirectory of the x86 architecture, encapsulate the installation files of the ARM architecture into the subdirectory of the ARM architecture, encapsulate the installation files of the Loongson architecture into the subdirectory of the Loongson architecture, and encapsulate the installation files of the Feiteng architecture into the subdirectory of the Feiteng architecture, to obtain a multi-architecture software package.
[0058] In one possible implementation, multiple installation files are compared to obtain a common part; a directory of a multi-architecture software package is created; under the directory of the multi-architecture software package, a common subdirectory is created, and subdirectories corresponding to each central processing unit architecture are created according to the central processing unit architectures corresponding to the multiple installation files; the common parts of the multiple installation files are encapsulated into the common subdirectory, and the non-common parts of the installation files corresponding to each central processing unit architecture (i.e., the parts of the installation files corresponding to each central processing unit architecture excluding the first part) are respectively encapsulated into the subdirectories corresponding to each central processing unit architecture, to obtain a multi-architecture software package.
[0059] Specifically, the subfiles included in the multiple installation files, that is, all the subfiles required to install the software, are compared in sequence to determine the same subfiles in the multiple installation files, which are the common parts. Exemplarily, the comparison between all the subfiles included in the multiple installation files can be achieved through a preset script or preset instruction.
[0060] For ease of understanding, the following example illustrates the comparison process of multiple installation files, taking the comparison between the installation files of two CPU architectures as an example.
[0061] Among them, the installation files of the two central processing unit architectures are respectively: the installation file of architecture A and the installation file of architecture B. Among them, the installation file of architecture A includes sub-file a1, sub-file a2, sub-file a3 and sub-file a4; the installation file of architecture B includes sub-file b1, sub-file b2, sub-file b3 and sub-file b4. The sub-files in the installation file of architecture A are compared with the sub-files in the installation file of architecture B in turn to determine the common parts. Specifically, the sub-file a1 in the installation file of architecture A is compared with the installation file of architecture B including sub-file b1, sub-file b2, sub-file b3 and sub-file b4 in turn, and no identical sub-files exist; the sub-file a2 in the installation file of architecture A is compared with the installation file of architecture B including sub-file b1, sub-file b2, sub-file b3 and sub-file b4 in turn, and it is determined that it is the same as sub-file b2 in the installation file of architecture B; the sub-file a3 in the installation file of architecture A is compared with the installation file of architecture B including sub-file b1, sub-file b2, sub-file b3 and subfile b4 to determine that it is the same as subfile b4 in the installation file of architecture B; subfile a4 in the installation file of architecture A is compared with the installation file of architecture B, including subfile b1, subfile b2, subfile b3 and subfile b4, to determine that there are no identical subfiles; and the common parts between the installation file of architecture A and the installation file of architecture B are determined to be subfile a2 in the installation file of architecture A (i.e. subfile b2 in the installation file of architecture B) and subfile a3 in the installation file of architecture A (i.e. subfile b4 in the installation file of architecture B).
[0062] For ease of understanding, the following Figure 3 , the structure of another multi-architecture software package provided by the embodiment of the present application is introduced as an example. Among them, the central processing unit architecture includes four examples: x86 architecture, ARM architecture, Loongson architecture and Feiteng architecture. And the common parts between the installation files of the above four central processing unit architectures have also been determined.
[0063] like Figure 3As shown, under the directory of the multi-architecture software package, a public subdirectory, a subdirectory of the x86 architecture, a subdirectory of the ARM architecture, a subdirectory of the Loongson architecture, and a subdirectory of the Feiteng architecture are created; the public part is encapsulated into the public subdirectory, the non-public part of the installation file of the x86 architecture (i.e., the part other than the first part of the installation file of the x86 architecture) is encapsulated into the subdirectory of the x86 architecture, the non-public part of the installation file of the ARM architecture (i.e., the part other than the first part of the installation file of the ARM architecture) is encapsulated into the subdirectory of the ARM architecture, the non-public part of the installation file of the Loongson architecture (i.e., the part other than the first part of the installation file of the Loongson architecture) is encapsulated into the subdirectory of the Loongson architecture, and the non-public part of the installation file of the Feiteng architecture (i.e., the part other than the first part of the installation file of the Feiteng architecture) is encapsulated into the subdirectory of the Feiteng architecture, so as to obtain the multi-architecture software package.
[0064] Compared with directly packaging the installation files of each CPU architecture into corresponding subdirectories, this can reduce the size of the multi-architecture software package to a certain extent, thereby saving the storage space occupied by storing the multi-architecture software package.
[0065] Furthermore, in another possible implementation, according to a preset rule, multiple installation files are grouped according to the central processing unit architectures corresponding to the multiple installation files, and each group includes at least two installation files; the multiple installation files in each group are compared to obtain a common part corresponding to each group; a first-level directory of the multi-architecture software is created, and under the first-level directory of the multi-architecture software, a second-level directory corresponding to each group is created; under the second-level directory corresponding to each group, a corresponding third-level directory is created, including a public subdirectory corresponding to the group and a subdirectory corresponding to the central processing unit architecture included in the group; according to the grouping results, the public part corresponding to each group and the non-public part of the installation files corresponding to the central processing unit architecture included in each group are respectively encapsulated into the corresponding third-level directories to obtain a multi-architecture software package.
[0066] Among them, the pre-set rules can be set manually. For example, the instruction set of the Feiteng architecture is actually the evolution of the instruction set of the ARM architecture. There are more common parts between the installation files of the Feiteng architecture and the installation files of the ARM architecture. The pre-set rules can stipulate that the installation files of the Feiteng architecture and the ARM architecture are grouped together.
[0067] For ease of understanding, the following Figure 4, the structure of another multi-architecture software package provided by the embodiment of the present application is introduced by way of example. Among them, the central processing unit architecture includes four types: x86 architecture, ARM architecture, Loongson architecture and Feiteng architecture, and the installation files of x86 architecture and Loongson architecture are divided into a first group, and the installation files of ARM architecture and Feiteng architecture are divided into a second group, and the common part between the installation files of x86 architecture and Loongson architecture (i.e., the first part corresponding to the first group) and the common part between the installation files of ARM architecture and Feiteng architecture (i.e., the first part corresponding to the second group) are further determined.
[0068] like Figure 4 As shown, under the first-level directory of the multi-architecture software package; create a second-level directory corresponding to the first group and a second-level directory corresponding to the second group; under the second-level directory corresponding to the first group, create a third-level directory including: a public subdirectory corresponding to the first group, a subdirectory of the x86 architecture, and a subdirectory of the Loongson architecture; under the second-level directory corresponding to the second group, create a third-level directory including: a public subdirectory corresponding to the second group, a subdirectory of the ARM architecture, and a subdirectory of the Feiteng architecture; encapsulate the first part corresponding to the first group into the public subdirectory corresponding to the first group, encapsulate the part other than the first part corresponding to the first group in the installation file of the x86 architecture into the subdirectory of the x86 architecture, and encapsulate the part other than the first part corresponding to the first group in the installation file of the Loongson architecture into the subdirectory of the Loongson architecture; encapsulate the first part corresponding to the second group into the public subdirectory corresponding to the second group, encapsulate the part other than the first part corresponding to the second group in the installation file of the ARM architecture into the subdirectory of the ARM architecture, and encapsulate the part other than the first part corresponding to the second group in the installation file of the Feiteng architecture into the subdirectory of the Feiteng architecture, to obtain the multi-architecture software package.
[0069] In a possible implementation, the multi-architecture software package is named based on the CPU architectures corresponding to the multiple installation files. Exemplarily, the CPU architectures corresponding to the multiple installation files include x86 architecture, ARM architecture, and Loongson architecture, and the multi-architecture software package is named "x86-ARM-Loongson". So that when the software is subsequently installed, it can be directly determined whether the multi-architecture software package includes the installation files corresponding to the required CPU architecture based on the naming of the multi-architecture software package.
[0070] like Figure 5As shown, a method for building a software package provided by an embodiment of the present application includes: obtaining multiple installation files obtained by compiling the same software, and the multiple installation files correspond one-to-one to multiple central processing unit architectures; encapsulating the multiple installation files to obtain a multi-architecture software package. That is, the multi-architecture software package in the embodiment of the present application includes installation files corresponding to multiple central processing unit architectures (or instruction sets). In a multi-architecture environment, if multiple central processing units want to install the same software, they only need to find the software package corresponding to the software, which solves the problem of not being able to find or having difficulty finding the software package corresponding to certain architectures (or instruction sets) to a certain extent.
[0071] Furthermore, the common parts among the installation files of the multiple CPU architectures are separately encapsulated into the multi-architecture software package, and the parts other than the first part of the multiple installation files are respectively encapsulated into the software package to obtain the multi-architecture software package. This reduces the volume of the multi-architecture software package to a certain extent, thereby saving the storage space occupied by storing the multi-architecture software package.
[0072] The above is combined with Example 1 to introduce a method for building a software package provided in an embodiment of the present application. The following is combined with Example 2 to introduce in detail how to install the software based on the multi-architecture software package obtained in Example 1 of the present application.
[0073] Embodiment 2:
[0074] Combine the following Figure 6 , a software installation method provided in an embodiment of the present application is introduced in detail, which is applied to a second computing device.
[0075] like Figure 6 As shown, a software installation method provided in an embodiment of the present application includes the following steps:
[0076] S601: Based on the software to be installed, obtain a multi-architecture software package corresponding to the software to be installed.
[0077] In one possible implementation, the first computing device and the second computing device may be one computing device, that is, when the computing device that constructs the multi-architecture software package corresponding to the software to be installed and the computing device that is intended to install the software to be installed are one computing device, the multi-architecture software package may be directly obtained from the memory.
[0078] In another possible implementation, the second computing device downloads the multi-architecture software package of the software to be installed from the Internet and installs it locally.
[0079] It should be noted that in the embodiment of the present application, a multi-architecture software package of the software to be installed has been built by default.
[0080] S602: Determine whether there is an installation file corresponding to the second CPU architecture in the multi-architecture software package.
[0081] The second central processing unit architecture is the central processing unit architecture of the second computing device.
[0082] Specifically, the second central processing unit architecture is obtained through the architecture instruction.
[0083] The architecture instruction (arch instruction, architecture instruction) is a command line tool for displaying the hardware architecture type of the current computing device. That is, the hardware architecture type of the second computing device is obtained through the architecture instruction, and the hardware architecture type includes the central processing unit type, thereby obtaining the second central processing unit architecture.
[0084] In a possible implementation, it is determined, based on a directory in the multi-architecture software package, whether there is an installation file corresponding to the second central processor architecture in the multi-architecture software package.
[0085] In another possible implementation, based on the name of the multi-architecture software package, it is determined whether there is an installation file corresponding to the second central processor architecture in the multi-architecture software package.
[0086] When it is determined that the multi-architecture software package contains an installation file corresponding to the second CPU architecture, proceed to S603.
[0087] When it is determined that the installation file corresponding to the second CPU architecture does not exist in the multi-architecture software package, proceed to S604.
[0088] S603: Install the software to be installed based on the installation file corresponding to the second central processing unit architecture.
[0089] In a possible implementation, when the multi-architecture software package directly encapsulates multiple installation files into corresponding subdirectories, the installation files corresponding to the second central processing unit architecture are: the installation files under the subdirectory corresponding to the second central processing unit architecture in the multi-architecture software package.
[0090] In another possible implementation, when a multi-architecture software package includes a common subdirectory, the installation file corresponding to the second central processing unit architecture is composed of: a common part under the common subdirectory in the multi-architecture software package and a non-common part under the subdirectory corresponding to the second central processing unit architecture.
[0091] S604: Display installation failure information.
[0092] When it is determined that the installation file corresponding to the second CPU architecture does not exist in the multi-architecture software package, the installation of the software to be installed cannot be achieved, and an installation failure message is displayed to prompt the user that the installation of the software to be installed has failed.
[0093] The embodiment of the present application provides a software installation method, including: based on the software to be installed, obtaining a multi-architecture software package corresponding to the software to be installed; judging whether there is an installation file corresponding to the second central processing unit architecture in the multi-architecture software package; when there is an installation file corresponding to the second central processing unit architecture in the multi-architecture software package, the installation of the software to be installed is realized based on the installation file corresponding to the second central processing unit architecture; when there is no installation file corresponding to the second central processing unit architecture in the multi-architecture software package, an installation failure message is displayed. When the software to be installed needs to be installed, it is only necessary to obtain the multi-architecture software package corresponding to the software to be installed, and it is not necessary to find the software package of the software to be installed corresponding to the second central processing unit architecture, which solves the problem of being unable to find or having difficulty finding the software package corresponding to certain architectures (or instruction sets) to a certain extent; and when the multi-architecture software package does not include the installation file corresponding to the second central processing unit architecture, an installation failure message is displayed to prompt the user that the installation of the software to be installed has failed, that is, prompting the user to add the installation file corresponding to the second central processing unit architecture to the multi-architecture software package of the software to be installed.
[0094] In addition, Figure 7 As shown, the embodiment of the present application further provides a computing device 700 , which includes a processor 710 and a memory 720 .
[0095] Among them, the processor 710 may include one or more processing cores. The processor 710 uses various interfaces and lines to connect various parts in the computing device 700, and executes the method provided by any one or more of the above embodiments by running or executing instructions, programs, code sets or instruction sets stored in the memory 720, and calling data stored in the memory 720. Optionally, the processor 710 can be implemented in at least one hardware form of digital signal processing (digital signal processing, DSP), field-programmable gate array (field-programmable gate array, FPGA), and programmable logic array (programmable logic array, PLA). The processor 710 can integrate one or a combination of a central processing unit (central processing unit, CPU), a graphics processing unit (graphics processing unit, GPU) and a modem. It is understandable that the above-mentioned modem may not be integrated into the processor 710, but implemented separately through a communication chip.
[0096] The memory 720 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 720 includes a non-transitory computer-readable storage medium. The memory 720 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 720 may include a program storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), and instructions for implementing the method of the embodiment of the present application.
[0097] The processor 710 and the memory 720 are connected to each other through a bus in the computing device 700, which may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc.
[0098] An embodiment of the present application also provides a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed on a computing device, the computing device executes the software package construction method and software installation method in the above-mentioned embodiment.
[0099] For the explanation of the relevant contents in the computer-readable storage medium provided above and the description of the beneficial effects, reference may be made to the corresponding effects of the software package construction method and the software installation method in the above embodiments, which will not be repeated here.
[0100] The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computing device, enables the computing device to execute any one of the software package construction methods and software installation methods in the above embodiments.
[0101] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other changes to the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.
[0102] Although the present application has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for constructing a software package, characterized in that: Applied to a first computing device, the method includes: Obtain multiple installation files compiled from source code of the same software; wherein the multiple installation files correspond one-to-one to multiple central processing unit architectures; The multiple installation files are packaged to obtain a multi-architecture software package; wherein the multi-architecture software package includes the multiple installation files.
2. The method according to claim 1, characterized in that The encapsulating the multiple installation files to obtain a multi-architecture software package includes: Create directories for multi-arch packages; Under the directory of the multi-architecture software package, creating subdirectories corresponding to the multiple CPU architectures according to the multiple CPU architectures corresponding to the multiple installation files respectively; The multiple installation files are respectively packaged into subdirectories corresponding to the multiple central processing architectures to obtain a multi-architecture software package.
3. The method according to claim 1, characterized in that Before packaging the multiple installation files to obtain a multi-architecture software package, the method further includes: Compare the multiple installation files to obtain common parts corresponding to the multiple installation files; wherein the common parts are the same parts among the multiple installation files; The encapsulating the multiple installation files to obtain a multi-architecture software package includes: The public part and the non-public parts in the multiple installation files are packaged to obtain a multi-architecture software package; wherein the non-public part is a part other than the first part in the installation file.
4. The method according to claim 3, characterized in that The encapsulating the common part and the non-common parts in the multiple installation files to obtain a multi-architecture software package includes: Create directories for multi-arch packages; Under the directory of the multi-architecture software package, create a common subdirectory, and according to the multiple CPU architectures corresponding to the multiple installation files, create subdirectories corresponding to the multiple CPU architectures; The common part is encapsulated into the common subdirectory, and the non-common parts of the multiple installation files are encapsulated into the subdirectories corresponding to the multiple central processing architectures to obtain a multi-architecture software package.
5. The method according to claim 3 or 4, characterized in that: The step of comparing the multiple installation files to obtain the common parts corresponding to the multiple installation files includes: All sub-files included in the multiple installation files are compared in sequence to determine the same sub-files in the multiple installation files; the same sub-files are the common parts corresponding to the multiple installation files.
6. The method according to claim 1, characterized in that The compilation methods of the multiple installation files include: a local compilation method, a cross compilation method, or a combination of local compilation and cross compilation method.
7. A software installation method, characterized in that: Applied to a second computing device, the method includes: Based on the software to be installed, obtaining a multi-architecture software package corresponding to the software to be installed; Determine whether there is an installation file corresponding to a second central processing unit architecture in the multi-architecture software package; the second central processing unit architecture is a central processing unit architecture of the second computing device; When it is determined that the multi-architecture software package contains an installation file corresponding to the second central processing unit architecture, the software to be installed is installed based on the installation file corresponding to the second central processing unit architecture.
8. The method according to claim 7, characterized in that The second CPU architecture is obtained by: The second central processing unit architecture is obtained through the architecture arch instruction.
9. The method according to claim 7, characterized in that: The method further comprises: When it is determined that the installation file corresponding to the second CPU architecture does not exist in the multi-architecture software package, an installation failure message is displayed to prompt the user that the installation of the software to be installed has failed.
10. A computing device, characterized in that comprising a processor and a memory; the processor and the memory are coupled; The memory is used to store computer program instructions; The processor is used to execute the computer program instructions stored in the memory to implement the software package construction method according to any one of claims 1 to 6 and the software installation method according to any one of claims 7 to 9.
