Software installation method and device
By identifying all instruction sets supported by the target host and customizing the adapted executable program, the problem that the software cannot effectively utilize all instruction sets of the host is solved, and the software performance and user experience are improved.
Patent Information
- Application Number
- CN202411837585.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-03-21
AI Technical Summary
After the existing software is installed on the host, it cannot effectively utilize all the instruction sets in the host, resulting in poor performance and affecting the user experience.
By identifying all instruction sets supported by the target host and customizing the adapted executable program based on these instruction sets, ensuring that the entire instruction set of the host can be utilized after the software is installed.
Improves the performance of the software, enhances the user experience, and avoids performance losses caused by incompatibility of the instruction set.
Smart Images

Figure CN119668636A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of software installation, and in particular to a software installation method and device. Background Art
[0002] After the software is installed on the host, it usually uses the instruction set in the host to implement specified functions or solve specified problems in the host. However, there are many types of instruction sets, and hosts on the market usually only deploy instruction sets that meet their own business needs, which leads to differences in the instruction sets deployed by different hosts. Based on this, in order to make the software compatible with hosts on the market, software manufacturers usually only release executable programs for software that are compatible with wildcard instruction sets such as basic instruction sets on the market. After the software is installed on the host based on the executable program, the software can only use the wildcard instruction sets in the host, but cannot use other instruction sets in the host, resulting in poor software performance and affecting the user experience of the software. Summary of the invention
[0003] The present application proposes a software installation method and device, the main purpose of which is to customize an executable program of the software adapted to the instruction set supported by the host to install the software on the host, so that the software can utilize the instruction set of the host after installation to improve the performance of the software.
[0004] In order to achieve the above objectives, this application mainly provides the following technical solutions:
[0005] In a first aspect, the present application provides a software installation method. The software installation method provided in this embodiment may include the following steps: identifying all instruction sets supported by the target host on which the target software needs to be installed; based on the identified all instruction sets supported by the target host, customizing an executable program of the target software adapted to the target host; based on the executable program, installing the target software on the target host.
[0006] In some embodiments of the present application, the target host includes a file system, and the file system records a target string for representing an instruction set supported by the target host. Then, identifying all instruction sets supported by the target host on which the target software needs to be installed includes: reading the target string recorded by the file system; and determining the instruction set represented by the read target string as the instruction set supported by the target host.
[0007] In some embodiments of the present application, identifying all instruction sets supported by a target host on which target software needs to be installed includes: obtaining all currently known known instruction sets, wherein the known instruction sets include at least one instruction; and executing for each of the known instruction sets separately: executing each instruction of the known instruction set in the operating system of the target host separately through a preset instruction test program, and if after each instruction is executed, the operating system does not feedback a signal to prompt that the target host does not support the instruction, then the known instruction set is determined to be an instruction set supported by the target host.
[0008] In some embodiments of the present application, the kernel space of the operating system of the target host is provided with an instruction set record table and a target interface, the instruction set record table is used to record instruction set information of the instruction sets supported by the target host, and the target interface is used to call the instruction set record table. Then, all instruction sets supported by the target host on which the target software needs to be installed are identified, including: calling the instruction set record table from the kernel space through the target interface; and determining the instruction set corresponding to the instruction set information recorded in the called instruction set record table as the instruction set supported by the target host.
[0009] In some embodiments of the present application, the instruction set supported by the target host is hard-coded in the logic circuit within the CPU of the target host, and the target host includes a hardware detection interface for detecting the instruction set corresponding to the logic circuit. Then, identifying all instruction sets supported by the target host on which the target software needs to be installed includes: calling the hardware detection interface to perform instruction set detection on the logic circuit within the CPU of the target host; and determining the detected instruction set as the instruction set supported by the target host.
[0010] In some embodiments of the present application, a first code group corresponding to multiple software functions is stored in a first storage location; the first code group includes first sample codes corresponding to multiple first instruction set combinations, each first sample code is used to implement the software function corresponding to the corresponding code group, and is adapted to the corresponding first instruction set combination; the multiple software functions are obtained by splitting the target software; then, based on the identified all instruction sets supported by the target host, the executable program of the target software adapted to the target host is customized, including: extracting first sample codes from the first code group corresponding to each software function of the target software, respectively, the instruction set included in the first instruction set combination corresponding to the first sample code is the same as all instruction sets supported by the target host; integrating the extracted first sample codes corresponding to each software function to obtain the executable program of the target software adapted to the target host.
[0011] In some embodiments of the present application, the software installation method provided in this embodiment may also include: if some software functions in the target software cannot extract from the corresponding first code group the first sample code whose instruction set included in the corresponding first instruction set combination is completely identical to all instruction sets supported by the target host, then performing any of the following operations: issuing a prompt for informing that the customization of the executable program has failed; or issuing a prompt for informing that the first code group of the some software functions lacks the first sample code adapted to the instruction set supported by the target host.
[0012] In some embodiments of the present application, based on the identified total instruction sets supported by the target host, an executable program of the target software adapted to the target host is customized, including: inputting the identified total instruction sets supported by the target host into an executable program generation model corresponding to the target software, so that the executable program generation model generates an executable program, wherein the executable program generation model is trained based on multiple sets of data, each set of data including a sample executable program of the target software and at least one instruction set adapted to the sample executable program; and determining the executable program generated by the executable program generation model as the executable program of the target software adapted to the target host.
[0013] In some embodiments of the present application, a second code group corresponding to multiple extensible software functions of the target software is stored in a third storage location, the second code group includes second sample codes corresponding to multiple second instruction set combinations, each second sample code is used to implement the extensible software function corresponding to the corresponding second code group, and is adapted to the corresponding second instruction set combination; then, after customizing the executable program of the target software adapted to the target host, the software installation method provided in this embodiment may also include: determining whether it is necessary to expand the software function of the target software; if necessary, determining the target software function that needs to be expanded of the target software, and extracting the second sample code from the second code group corresponding to the target software function, the instruction set included in the second instruction set combination corresponding to the second sample code is the same as the instruction set supported by the target host; and incrementally integrating the extracted second target sample code into the executable program.
[0014] In some embodiments of the present application, a historical executable program that has been customized for the target software is stored in a second storage location, and the historical executable program has a corresponding instruction set based on which the customization was based. Then, the software installation method provided in this embodiment may also include: detecting whether the second storage location stores a historical executable program whose instruction set based on which the customization was based is exactly the same as all instruction sets supported by the target host; if so, determining the corresponding historical executable program as the executable program of the target software that is adapted to the target host; if not, executing the step of customizing the executable program of the target software that is adapted to the target host based on the identified instruction set supported by the target host.
[0015] In some embodiments of the present application, the target software has a software package installer for booting the installation. Then, the software installation method provided in this embodiment may also include: monitoring whether the target host has run the software package installer, and if so, determining that the target host needs to install the target software.
[0016] In some embodiments of the present application, the software installation method provided in this embodiment may also include: detecting whether there is a request to customize the executable program of the target software based on some instruction sets among all instruction sets supported by the target host; if so, displaying the instruction set name corresponding to each instruction set supported by the target host, and customizing the executable program of the target software adapted to the target host based on the instruction set corresponding to the selected instruction set name; if not, executing the step of customizing the executable program of the target software adapted to the target host based on all the instruction sets supported by the identified target host.
[0017] In a second aspect, the present application provides a software installation device. The software installation device provided in this embodiment may include:
[0018] An identification module, used to identify all instruction sets supported by the target host on which the target software needs to be installed;
[0019] A customization module, used for customizing the executable program of the target software adapted to the target host based on all the instruction sets supported by the identified target host;
[0020] An installation module is used to install the target software on the target host based on the executable program.
[0021] In a third aspect, the present application provides a computer-readable storage medium, wherein the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the software installation method described in the first aspect.
[0022] In a fourth aspect, the present application provides an electronic device, comprising: a memory for storing a program; and a processor, coupled to the memory, for running the program to execute the software installation method described in the first aspect.
[0023] The software installation method and device provided by the present application, when the target host needs to install the target software, firstly identifies all the instruction sets supported by the target host, then customizes the executable program of the target software adapted to the target host based on the identified all the instruction sets supported by the target host, and finally installs the target software on the target host based on the executable program. It can be seen that the solution provided by the present application identifies all the instruction sets supported by the host before installing the software on the host, and customizes the executable program of the software adapted to the host based on the identified all the instruction sets, then after the software is installed on the host based on the customized executable program, the software can use all the instruction sets in the host to implement the corresponding functions or solve the problems, so that the software will not suffer performance loss due to the inability to use some instruction sets in the host, and the software can have better performance, thereby improving the user's experience of using the software.
[0024] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, 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 application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0026] Figure 1 A flowchart of a software installation method provided by an embodiment of the present application is shown;
[0027] Figure 2 A schematic diagram showing a flow chart of a software installation method provided by an embodiment of the present application is shown;
[0028] Figure 3 A schematic diagram of the structure of a software installation device provided by an embodiment of the present application is shown;
[0029] Figure 4 A schematic structural diagram of a software installation device provided in another embodiment of the present application is shown. DETAILED DESCRIPTION
[0030] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the 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. On the contrary, these embodiments are provided in order 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.
[0031] At present, in order to make the software compatible with the hosts on the market, software manufacturers usually only release executable programs for the software that are compatible with the wildcard instruction sets of the hosts on the market, such as basic instruction sets (for example, RV32I, RV32E, RV64I, RV64E, RV128I and other basic instruction sets). After the software is installed on the host based on the executable program, the software can only use the wildcard instruction sets in the host, but cannot use other instruction sets in the host, resulting in poor software performance.
[0032] After research, it was found that if before installing the software on the host, all the instruction sets supported by the host are identified, and based on all the identified instruction sets, the software's executable program adapted to the host is customized, then after the software is installed on the host based on the customized executable program, the software will be able to use all the instruction sets in the host to implement corresponding functions or solve problems. In this way, the software will not suffer performance loss due to the inability to use some instruction sets in the host. The software can have better performance, thereby improving the user experience of the software.
[0033] Based on the above findings, the embodiment of the present application specifically provides a technical solution for software installation, which is specifically: identifying all instruction sets supported by the target host where the target software needs to be installed; based on the identified all instruction sets supported by the target host, customizing the executable program of the target software adapted to the target host; based on the executable program, installing the target software on the target host. In this way, it is possible to customize the executable program of the software adapted to all instruction sets supported by the host to install the software on the host, so that the software can utilize all instruction sets of the host after installation, thereby improving the performance of the software.
[0034] The technical solution for software installation provided in this embodiment can realize the installation of any software on any host, and this embodiment does not limit the types of hosts and software. For example, the host may include but is not limited to a physical host with a Linux system deployed, and the software may include but is not limited to RISC-V software.
[0035] Based on the above-mentioned technical solution for software installation, this embodiment specifically provides a software installation method and device. The software installation method and device provided in this embodiment are specifically described below.
[0036] like Figure 1 As shown, the embodiment of the present application provides a software installation method, and the software installation method provided by this embodiment may at least include the following steps 101 to 103:
[0037] 101. Identify all instruction sets supported by the target host on which the target software needs to be installed.
[0038] When any host needs to install any software, the host can be determined as the target host and the software can be determined as the target software. For example, when the RISC-V software needs to be installed in the user's physical host, the user's physical host is determined as the target host and the RISC-V software is determined as the target software.
[0039] After determining the target host and the target software, it is necessary to identify all instruction sets supported by the target host, so as to customize the executable program of the target software adapted to the target host based on all instruction sets supported by the target host, so that after the target software is installed on the target host based on the customized executable program, the target software can utilize all instruction sets in the target host, thereby improving the performance of the target software. It should be noted that the instruction set supported by the target host is an instruction set hard-coded in the logic circuit of the CPU of the target host.
[0040] Methods for identifying all instruction sets supported by the target host on which the target software needs to be installed may include at least the following four methods:
[0041] The first one is that the target host includes a file system, and the file system records a target character string for representing the instruction set supported by the target host. Then, the specific process of identifying all instruction sets supported by the target host where the target software needs to be installed may include the following steps: reading the target character string recorded in the file system; determining the instruction set represented by the read target character string as the instruction set supported by the target host.
[0042] The target host is deployed with an operating system, and the operating system has a corresponding file system. The target string used to represent the instruction set supported by the target host is recorded in the file system. Therefore, when determining all the instruction sets supported by the target host, the target string recorded in the file system can be read and parsed, and the instruction set represented by the read target string can be determined as the instruction set supported by the target host.
[0043] Exemplarily, if the operating system deployed on the target host is a Linux system, the target character string recorded in the file system is read through the file path " / proc / cpuinfo", and the instruction set represented by the read target character string is determined as the instruction set supported by the target host.
[0044] The second type, the specific process of identifying all instruction sets supported by the target host where the target software needs to be installed may include the following steps: obtaining all currently known known instruction sets, where the known instruction sets include at least one instruction; executing for each known instruction set separately: through a preset instruction test program, executing each instruction of the known instruction set in the operating system of the target host separately, if after each instruction is executed, the operating system does not feedback a signal to prompt that the target host does not support the instruction, then the known instruction set is determined to be the instruction set supported by the target host.
[0045] Although all instruction sets supported by the target host cannot be known in advance, the instruction sets currently in circulation on the market are currently known, so all instruction sets supported by the target host can be identified through all currently known instruction sets. In order to accurately and comprehensively identify all instruction sets supported by the target host, it is necessary to obtain all currently known instruction sets as known instruction sets as comprehensively as possible. Known instruction sets may include but are not limited to the following instruction sets: basic instruction sets such as RV32I, RV32E, RV64I, RV64E, RV128I, standard extended instruction sets in extended instruction sets such as M, A, F, D, Q, C, B, P, V, Zifencei, Zicsr, and non-standard extended instruction sets in extended instruction sets such as Xthead, Xventanacondops, etc.
[0046] After obtaining all the currently known instruction sets, the following steps are performed for each known instruction set: through a preset instruction test program, each instruction of the currently known instruction set is executed in the operating system of the target host; if after each instruction is executed, the operating system does not feedback a signal to prompt that the target host does not support the instruction, then the currently known instruction set is determined to be the instruction set supported by the target host.
[0047] For an instruction in the currently known instruction set, if the target host can execute the instruction, it means that the target host has most likely deployed the instruction and supports the instruction. If the target host cannot execute the instruction, it means that the target host has most likely not deployed the instruction and does not support the instruction. Because, by using a preset instruction test program, each instruction of the currently known instruction set can be executed separately in the target host's operating system to determine whether each instruction of the currently known instruction set is deployed in the target host.
[0048] If the operating system does not feedback a signal after each instruction is executed to prompt that the target host does not support the instruction, it means that all instructions of the currently known instruction set are deployed in the target host and the target host supports the currently known instruction set. Therefore, the currently known instruction set is determined as the instruction set supported by the target host.
[0049] Furthermore, if after at least some instructions are executed, the operating system feeds back a signal to prompt that the target host does not support the instructions, it means that this part of the instructions of the currently known instruction set is most likely not deployed in the target host, and the target host does not support the currently known instruction set. Therefore, the currently known instruction set is not determined as the instruction set supported by the target host.
[0050] It should be noted that the specific form of the signal used to prompt the target host that the command is not supported can be determined based on business needs, and this embodiment does not limit this. Exemplarily, the signal used to prompt the target host that the command is not supported may include but is not limited to: an illegal command SIGILL signal.
[0051] The third type is that the kernel space of the target host's operating system is provided with an instruction set record table and a target interface, the instruction set record table is used to record the instruction set information of the instruction sets supported by the target host, and the target interface is used to call the instruction set record table. Then, the specific process of identifying all instruction sets supported by the target host on which the target software needs to be installed may include the following steps: calling the instruction set record table from the kernel space through the target interface; determining the instruction set corresponding to the instruction set information recorded in the called instruction set record table as the instruction set supported by the target host.
[0052] The kernel space of the target host's operating system is provided with an instruction set record table and a target interface to provide hardware information of the target host through the target interface and the instruction set record table. The hardware information here is the instruction set information of the instruction set supported by the target host recorded in the instruction set record table. The kernel space of the target host's operating system is provided with an instruction set record table and a target interface, which are both related to the type of the target host's operating system. For example, if the target host's operating system is a Linux system, the instruction set record table and the target interface are implemented based on the HWCAP mechanism.
[0053] When it is necessary to identify the instruction set supported by the target host, the instruction set record table is called from the kernel space through the target interface, and the instruction set information is searched in the called instruction set record table. The instruction set corresponding to the found instruction set information must be the instruction set deployed by the target host, so the instruction set corresponding to the instruction set information is determined as the instruction set supported by the target host.
[0054] Fourthly, the instruction set supported by the target host is hard-coded in the logic circuit within the CPU of the target host, and the target host includes a hardware detection interface for detecting the instruction set corresponding to the logic circuit. Then, the specific process of identifying all instruction sets supported by the target host where the target software needs to be installed may include the following steps: calling the hardware detection interface to perform instruction set detection on the logic circuit within the CPU of the target host; and determining the detected instruction set as the instruction set supported by the target host.
[0055] The target host's operating system usually provides a hardware detection interface, which can be used to detect the instruction set corresponding to the logic circuit. Therefore, when it is necessary to identify the instruction set supported by the target host, the hardware detection interface is called to perform instruction set detection on the logic circuit in the CPU of the target host. The detected instruction set must be the instruction set deployed by the target host, so the detected instruction set is determined as the instruction set supported by the target host.
[0056] The above four methods for identifying all instruction sets supported by the target host that needs to install the target software can flexibly select at least one for use based on business needs, and this embodiment does not limit this. Exemplarily, four methods are selected at the same time, so that the identification results of the four methods can complement and verify each other to improve the accuracy of identifying all instruction sets supported by the target host.
[0057] 102. Customize the executable program of the target software adapted to the target host based on the identified entire instruction set supported by the target host.
[0058] After identifying all instruction sets supported by the target host, the executable program of the target software adapted to the target host can be customized based on the identified all instruction sets supported by the target host, so that the installed target software can use all instruction sets supported by the target host to improve the performance of the target software in the target host.
[0059] Based on the identified instruction sets supported by the target host, the method of customizing the executable program of the target software adapted to the target host may include at least the following two methods:
[0060] One is that in order to improve the customization efficiency of the executable program, the existing code can be used to customize the executable program. Therefore, the software installation method provided in this embodiment can also store the first code group corresponding to multiple software functions through the first storage location, and the first code group includes multiple first instruction set combinations corresponding to the first sample code, each first sample code is used to implement the software function corresponding to the corresponding code group, and is adapted to the corresponding first instruction set combination. Among them, multiple software functions are obtained by splitting the target software. Based on this, based on the identified all instruction sets supported by the target host, the specific process of customizing the executable program adapted to the target host of the target software can include the following steps: extracting the first sample code from the first code group corresponding to each software function of the target software, respectively, the instruction set included in the first instruction set combination corresponding to the first sample code is the same as all instruction sets supported by the target host; integrating the extracted first sample code corresponding to each software function to obtain the executable program adapted to the target host of the target software.
[0061] In order to realize the rapid customization of the executable program of the target software and improve the installation efficiency of the target software on the target host, the first code group corresponding to multiple software functions is pre-stored in the first storage location, and the multiple software functions here are obtained by splitting the target software. In this way, when customizing the executable program, the first sample code can be extracted from the first code group corresponding to each software function of the target software. The first sample code extracted here can not only realize the corresponding software function, but also adapt to all instruction sets supported by the target host.
[0062] After extracting the first sample code corresponding to each software function of the target software, the extracted first sample code is integrated, and then the integrated code is compiled. When the compilation is successful, the code can be packaged into an executable program of the target software adapted to the target host.
[0063] In some embodiments, further, if some software functions in the target software cannot extract the first sample code from the corresponding first code group, and the instruction set included in the first instruction set combination corresponding to the first sample code is exactly the same as all the instruction sets supported by the target host, then in order to be able to deal with this situation, the software installation method provided in this embodiment can also perform any of the following operations: one is to issue a prompt for notifying that the customization of the executable program has failed. If some software functions do not extract the first sample code that is suitable, it is bound to cause the construction of the executable program to lack some codes, thereby causing the executable program to be unable to be built. Therefore, a prompt for notifying that the customization of the executable program has failed is issued to clarify the fact that the executable program adapted to the target host of the target software cannot be customized. Another is to issue a prompt for notifying that the first sample code adapted to all the instruction sets supported by the target host is missing in the first code group of some software functions, so that the developer can develop the corresponding sample code for this part of the software function in time based on the prompt for the customized executable program.
[0064] Another is that, based on the identified total instruction sets supported by the target host, the specific process of customizing the target software's executable program adapted to the target host may include the following steps: inputting the identified total instruction sets supported by the target host into the corresponding executable program generation model of the target software, so that the executable program generation model generates the executable program; and determining the executable program generated by the executable program generation model as the target software's executable program adapted to the target host.
[0065] In order to achieve rapid customization of executable programs, this embodiment uses an executable program generation model to customize the executable program of the target software adapted to the target host. The executable program generation model is trained based on multiple sets of data, each set of data includes a sample executable program of the target software and at least one instruction set adapted to the sample executable program. When customizing the executable program, all the instruction sets supported by the identified target host are input into the executable program generation model corresponding to the target software, so that the executable program generation model can generate the executable program of the target software adapted to the target host based on all the instruction sets supported by the target host.
[0066] The above two methods of customizing the executable program of the target software adapted to the target host based on all the instruction sets supported by the identified target host can be flexibly selected based on business needs. When selecting two methods, one method is first used to customize the executable program. When this method fails to successfully customize the executable program, the other method is used to continue to customize the executable program.
[0067] In some embodiments, further, in order to ensure that the target software can be successfully installed on the target host, after customizing the executable program of the target software adapted to the target host, it is necessary to pre-evaluate whether the executable program can be successfully installed in the target host, and whether the target software can use all instruction sets supported by the target host. If it is evaluated that it can be successfully installed and all instruction sets supported by the target host can be used, step 103 is executed. If it is evaluated that it cannot be successfully installed or it is evaluated that it can be successfully installed and all instruction sets supported by the target host cannot be used normally, step 103 is not executed. At this time, the step of issuing a prompt that the executable program needs to be troubleshooted can be executed, so that the troubleshooter can perform corresponding troubleshooting based on the prompt. It should be noted that the evaluation here can be performed in a test machine that matches the target host, and the test machine needs to be able to support all instruction sets supported by the target host.
[0068] 103. Based on the executable program, install the target software on the target host.
[0069] The target software's executable program adapted to the target host can realize the installation of the target software in the target host that can use all the instruction sets supported by the target host. Therefore, after the executable program is customized, the executable program is copied to the target host, and the installation operation is performed on the executable program to complete the installation of the target software in the target host. The installed target software can use all the instruction sets in the host to implement the corresponding functions or solve the problems, so that the software will not suffer performance loss due to the inability to use some instruction sets in the host, and the software can have better performance.
[0070] The software installation method provided by the embodiment of the present application, when the target host needs to install the target software, first identifies all the instruction sets supported by the target host, then customizes the executable program of the target software adapted to the target host based on the identified all the instruction sets supported by the target host, and finally installs the target software on the target host based on the executable program. It can be seen that the solution provided by the embodiment of the present application identifies all the instruction sets supported by the host before installing the software on the host, and customizes the executable program of the software adapted to the host based on the identified all the instruction sets, then after the software is installed on the host based on the customized executable program, the software can use all the instruction sets in the host to implement the corresponding functions or solve the problems, so that the software will not suffer performance loss due to the inability to use some instruction sets in the host, and the software can have better performance, thereby improving the user's experience of using the software.
[0071] In some embodiments of the present application, the target software has a software package installer for booting the installation. The software package installer is a pre-installation program for installing the target software. Once the software package installer is run on the target host, it means that the target host needs to install the target software. Therefore, it is possible to determine whether the target host needs to install the target software by monitoring whether the target host has run the software package installer. Based on this, the software installation method provided in this embodiment may further include the following steps before the above step 101: monitoring whether the target host has run the software package installer, and if so, determining that the target host needs to install the target software.
[0072] If the target host is monitored to have run the software package installation program, it means that the target host has a need to install the target software, so it is determined that the target host needs to install the target software, and step 101 is executed. If the target host is not monitored to have run the software package installation program, it means that the target host does not have a need to install the target software, so this step can be continued.
[0073] In some embodiments of the present application, considering that the more instruction sets the executable program is adapted to, the longer and more complicated the executable program customization is, and the user may not need the target software to use all the instruction sets of the target host, based on this, the software installation method provided in this embodiment may also include the following steps: detecting whether there is a request to customize the executable program of the target software based on some instruction sets of all instruction sets supported by the target host; if so, displaying the instruction set name corresponding to each instruction set supported by the target host, and customizing the executable program of the target software adapted to the target host based on the instruction set corresponding to the selected instruction set name; if not, executing step 102 to customize the executable program of the target software adapted to the target host based on all the instruction sets supported by the identified target host.
[0074] If a request to customize the executable program of the target software based on some of the instruction sets among all the instruction sets supported by the target host is detected, it means that the user does not need to customize the executable program based on all the instruction sets supported by the target host. Therefore, the authority to customize the instruction set required for the executable program is given to the user, and the instruction set name corresponding to each instruction set supported by the target host is displayed, so that the user can flexibly select the instruction set required for the customized executable program. Then, when there is a selected instruction set name, based on the instruction set corresponding to the selected instruction set name, the executable program of the target software adapted to the target host is customized, so that the customized executable program can meet the user's personalized customization needs.
[0075] If a request to customize the executable program of the target software based on a partial instruction set among all instruction sets supported by the target host is detected, it means that the user needs to customize the executable program based on all instruction sets supported by the target host, so the above step 102 is executed.
[0076] In some embodiments of the present application, if the customized historical executable program is reused, the customization process can be skipped to improve the efficiency of software installation. Based on this, the present embodiment can also store the customized historical executable program for the target software in the second storage location, and the historical executable program has the corresponding instruction set based on the customization. Based on this, the software installation method provided by the present embodiment can also include the following steps: detecting whether the second storage location stores a historical executable program whose instruction set based on the customization is exactly the same as all the instruction sets supported by the target host; if it is stored, determining the corresponding historical executable program as the executable program of the target software adapted to the target host; if it does not exist, executing the above step 102 to customize the executable program of the target software adapted to the target host based on the identified instruction set supported by the target host.
[0077] If it is detected that the second storage location stores a historical executable program whose instruction set during customization is exactly the same as all instruction sets supported by the target host, it indicates that there is a reusable historical executable program. Therefore, the historical executable program is determined as the executable program of the target software adapted to the target host, thereby skipping the customization step of the executable program and directly proceeding to the installation step to improve the installation efficiency of the target software.
[0078] If it is detected that the second storage location does not store a historical executable program whose instruction set is completely identical to all instruction sets supported by the target host when customized, it indicates that there is no reusable historical executable program, and thus the above step 102 is executed. It should be noted that in order to continuously expand and improve the historical executable programs stored in the second storage location, after the executable program customized in step 102 is used to successfully install the target software on the target host, the customized executable program can be incrementally added to the second storage location for reuse.
[0079] In some embodiments of the present application, considering that the user may propose new software function requirements based on the existing functions of the target software, in order to meet this requirement, the present embodiment can also store the second code group corresponding to multiple extensible software functions of the target software through the third storage location, the second code group includes multiple second instruction set combinations corresponding to the second sample code, each second sample code is used to implement the extensible software function corresponding to the corresponding second code group, and is adapted to the corresponding second instruction set combination, so that the function of the target software can be flexibly expanded based on user needs through the data stored in the third storage location. Based on this, the software installation method provided by the present embodiment can also include the following steps after the above step 102 customizes the executable program adapted to the target host of the target software and before the above step 103: determine whether it is necessary to expand the software function of the target software; if necessary, determine the target software function that needs to be expanded for the target software, and extract the second sample code from the second code group corresponding to the target software function, the instruction set included in the second instruction set combination corresponding to the second sample code is the same as the instruction set supported by the target host; and incrementally integrate the extracted second target sample code into the executable program.
[0080] If it is determined that the target software needs to be expanded in software functions, it means that the user has put forward new software function requirements for the target software. Therefore, in order to meet this requirement, it is necessary to determine the target software functions that need to be expanded based on the user's expansion requirements, and then extract the second sample code from the second code group corresponding to the target software function. The instruction set included in the second instruction set combination corresponding to the second sample code is exactly the same as the instruction set supported by the target host. The extracted second target sample code is incrementally integrated into the executable program to enable the target software after installation based on the executable program to have expanded software functions.
[0081] The first storage location, second storage location, and third storage location involved in the software installation method provided in the above-mentioned embodiment of the present application can be the same storage location or different storage locations. The specific situation can be flexibly set based on business needs, and this embodiment does not limit this.
[0082] In some embodiments of the present application, the software installation method provided in this embodiment can be implemented by relying on the target host and the software server. Figure 2 As an example, the software installation method provided in this embodiment is specifically described by taking the interaction between these two entities.
[0083] The target software has a package installer for booting and installing, and the package installer has the ability to identify all instruction sets supported by the host after running. Therefore, after determining that the target host needs to install the target software, the package installer of the target software is run on the target host, and after the package installer runs, all instruction sets supported by the target host are identified.
[0084] After identifying all the instruction sets supported by the target host, a customization request carrying the instruction set information of all the instruction sets supported by the target host is sent to the software server. After receiving the customization request, the software server determines all the instruction sets supported by the target host based on the instruction set information carried in the customization request, and customizes the executable program of the target software adapted to the target host based on all the instruction sets supported by the target host. After customizing the executable program, the software server sends the executable program to the target host. After receiving the executable program, the target host executes the executable program to install the target software on the target host. At this point, after the target software is installed, it can use all the instruction sets in the host to implement the corresponding functions or solve the problems, and the software can have better performance, thereby improving the user's experience of using the software. It can be seen that by installing the software through the software installation method provided in this embodiment, for any host, it can be guaranteed that the host is installed with software with better performance.
[0085] Furthermore, an embodiment of the present application also provides a software installation device, such as Figure 3 As shown, the software installation device provided in this embodiment may include:
[0086] An identification module 21 is used to identify all instruction sets supported by the target host on which the target software needs to be installed;
[0087] A customization module 22, configured to customize the executable program of the target software adapted to the target host based on all the instruction sets supported by the identified target host;
[0088] The installation module 23 is used to install the target software on the target host based on the executable program.
[0089] The software installation device provided by the embodiment of the present application, when the target host needs to install the target software, first identifies all the instruction sets supported by the target host, then customizes the executable program of the target software adapted to the target host based on the identified all the instruction sets supported by the target host, and finally installs the target software on the target host based on the executable program. It can be seen that the solution provided by the embodiment of the present application identifies all the instruction sets supported by the host before installing the software on the host, and customizes the executable program of the software adapted to the host based on the identified all the instruction sets, then after the software is installed on the host based on the customized executable program, the software can use all the instruction sets in the host to implement the corresponding functions or solve the problems, so that the software will not suffer performance loss due to the inability to use some instruction sets in the host, and the software can have better performance, thereby improving the user's experience of using the software.
[0090] In some embodiments of the present application, Figure 4 As shown, the target host includes a file system, and the file system records a target character string for representing the instruction set supported by the target host. Then, the identification module 21 may include: a first identification unit 211, used to identify the instruction set supported by the target host on which the target software needs to be installed, including: reading the target character string recorded by the file system; determining the instruction set represented by the read target character string as the instruction set supported by the target host.
[0091] In some embodiments of the present application, Figure 4 As shown, the identification module 21 may include: a second identification unit 212, used to obtain all currently known known instruction sets, wherein the known instruction sets include at least one instruction; for each of the known instruction sets, respectively executing: through a preset instruction test program, each instruction of the known instruction set is respectively executed in the operating system of the target host, if after the execution of each instruction, the operating system does not feedback a signal for prompting that the target host does not support the instruction, then the known instruction set is determined to be an instruction set supported by the target host.
[0092] In some embodiments of the present application, Figure 4 As shown, the kernel space of the operating system of the target host is provided with an instruction set record table and a target interface, the instruction set record table is used to record the instruction set information of the instruction set supported by the target host, and the target interface is used to call the instruction set record table. Then, the identification module 21 may include: a third identification unit 213, used to identify the instruction set supported by the target host on which the target software needs to be installed, including: calling the instruction set record table from the kernel space through the target interface; determining the instruction set corresponding to the instruction set information recorded in the called instruction set record table as the instruction set supported by the target host.
[0093] In some embodiments of the present application, Figure 4 As shown, the instruction set supported by the target host is hard-coded in the logic circuit of the CPU of the target host, and the target host includes a hardware detection interface for detecting the instruction set corresponding to the logic circuit. Then, the identification module 21 may include: a fourth identification unit 214, used to call the hardware detection interface to perform instruction set detection on the logic circuit in the CPU of the target host; and determine the detected instruction set as the instruction set supported by the target host.
[0094] In some embodiments of the present application, Figure 4 As shown, a first code group corresponding to a plurality of software functions is stored in a first storage location; the first code group includes a plurality of first instruction set combinations corresponding to first sample codes, each first sample code is used to implement the software function corresponding to the corresponding code group, and is adapted to the corresponding first instruction set combination; the plurality of software functions are obtained by splitting the target software; then, the customization module 22 may include: a first customization unit 221, for extracting first sample codes from the first code group corresponding to each software function of the target software, respectively, the instruction set included in the first instruction set combination corresponding to the first sample code is the same as all instruction sets supported by the target host; the extracted first sample codes corresponding to each software function are integrated to obtain an executable program of the target software adapted to the target host.
[0095] In some embodiments of the present application, Figure 4 As shown, the first customization unit 221 can also be used to trigger the prompt module 24 further included in the software installation device to perform any of the following operations if some software functions in the target software cannot extract the first sample code whose instruction set included in the corresponding first instruction set combination is completely identical to all instruction sets supported by the target host from the corresponding first code group: issuing a prompt for notifying that the customization of the executable program has failed; or issuing a prompt for notifying that the first sample code adapted to the instruction set supported by the target host is missing in the first code group of the some software functions.
[0096] In some embodiments of the present application, Figure 4 As shown, the customization module 22 may include: a second customization unit 222, used to input all the instruction sets supported by the identified target host into the executable program generation model corresponding to the target software, so that the executable program generation model can generate an executable program, wherein the executable program generation model is trained based on multiple groups of data, each group of data includes a sample executable program of the target software and at least one instruction set adapted to the sample executable program; the executable program generated by the executable program generation model is determined as an executable program of the target software adapted to the target host.
[0097] In some embodiments of the present application, Figure 4 As shown, the second code group corresponding to the multiple extensible software functions of the target software is stored in the third storage location, the second code group includes second sample codes corresponding to multiple second instruction set combinations, each second sample code is used to implement the extensible software function corresponding to the corresponding second code group, and is adapted to the corresponding second instruction set combination; then, the software installation device provided by this embodiment may also include:
[0098] The expansion module 25 is used to determine whether it is necessary to expand the software function of the target software after the customization module 22 customizes the executable program of the target software adapted to the target host; if necessary, determine the target software function that needs to be expanded of the target software, and extract the second sample code from the second code group corresponding to the target software function, the instruction set included in the second instruction set combination corresponding to the second sample code is the same as the instruction set supported by the target host; and incrementally integrate the extracted second target sample code into the executable program.
[0099] In some embodiments of the present application, Figure 4 As shown, the historical executable program customized for the target software is stored in the second storage location, and the historical executable program has a corresponding instruction set based on the customization. Then, the software installation device provided by this embodiment may also include:
[0100] The first detection module 26 is used to detect whether the second storage location stores a historical executable program whose instruction set is based on customization and is completely the same as the instruction set supported by the target host; if so, the corresponding historical executable program is determined as the executable program of the target software adapted to the target host; if not, the customization module 22 is triggered to execute the step of customizing the executable program of the target software adapted to the target host based on all the instruction sets supported by the target host identified.
[0101] In some embodiments of the present application, Figure 4 As shown, the target software has a software package installation program for booting the installation. Then, the software installation device provided in this embodiment may also include: a monitoring module 27, which is used to monitor whether the target host has run the software package installation program. If so, it is determined that the target host needs to install the target software.
[0102] In some embodiments of the present application, Figure 4 As shown, the software installation device provided in this embodiment may also include:
[0103] The second detection module 28 is used to detect whether there is a request to customize the executable program of the target software based on some instruction sets among all instruction sets supported by the target host; if so, the customization module 22 is triggered to display the instruction set name corresponding to each instruction set supported by the target host, and customize the executable program of the target software adapted to the target host based on the instruction set corresponding to the selected instruction set name; if not, the customization module 22 is triggered to execute the step of customizing the executable program of the target software adapted to the target host based on all the instruction sets supported by the identified target host.
[0104] In the software installation device provided in the embodiment of the present application, the detailed explanations used in the operation of each functional module can be found in the corresponding detailed explanations of the above-mentioned software installation method embodiment, which will not be repeated here.
[0105] Furthermore, an embodiment of the present application also provides a computer-readable storage medium, wherein the storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the above-mentioned software installation method.
[0106] Furthermore, an embodiment of the present application also provides an electronic device, which includes: a memory for storing a program; and a processor, coupled to the memory, for running the program to execute the above-mentioned software installation method.
[0107] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0108] It is understandable that the related features in the above methods and devices can be referenced to each other. In addition, the "first", "second" and the like in the above embodiments are used to distinguish the embodiments, but do not represent the advantages and disadvantages of the embodiments.
[0109] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0110] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the application is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to realize the content of the application described herein, and the description of the above specific language is to disclose the preferred embodiment of the application.
[0111] In addition, the memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0112] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0113] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data cutover device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data cutover device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0114] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data switching device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0115] These computer program instructions can also be loaded onto a computer or other programmable data transfer device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0116] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0117] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0118] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0119] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0120] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0121] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A software installation method, characterized in that: The method comprises: Identify all instruction sets supported by the target host on which the target software needs to be installed; Based on the identified full instruction sets supported by the target host, customize the executable program of the target software adapted to the target host; The target software is installed on the target host based on the executable program.
2. The method according to claim 1, characterized in that The target host includes a file system, and the file system records a target character string for representing an instruction set supported by the target host. Then, identifying all instruction sets supported by the target host on which the target software needs to be installed includes: reading the target character string recorded by the file system; determining the instruction set represented by the read target character string as the instruction set supported by the target host; and / or, Identifying all instruction sets supported by a target host on which target software needs to be installed, including: obtaining all currently known instruction sets, wherein the known instruction sets include at least one instruction; performing for each of the known instruction sets: executing each instruction of the known instruction set in an operating system of the target host through a preset instruction test program, and if the operating system does not feed back a signal for prompting that the target host does not support the instruction after each instruction is executed, determining the known instruction set as an instruction set supported by the target host; and / or, The kernel space of the operating system of the target host is provided with an instruction set record table and a target interface, the instruction set record table is used to record the instruction set information of the instruction set supported by the target host, and the target interface is used to call the instruction set record table. Then, identifying all the instruction sets supported by the target host on which the target software needs to be installed comprises: calling the instruction set record table from the kernel space through the target interface; determining the instruction set corresponding to the instruction set information recorded in the called instruction set record table as the instruction set supported by the target host; and / or, The instruction set supported by the target host is hard-coded in the logic circuit within the CPU of the target host, and the target host includes a hardware detection interface for detecting the instruction set corresponding to the logic circuit. Therefore, identifying all instruction sets supported by the target host on which the target software needs to be installed includes: calling the hardware detection interface to perform instruction set detection on the logic circuit within the CPU of the target host; and determining the detected instruction set as the instruction set supported by the target host.
3. The method according to claim 1, characterized in that: A first code group corresponding to a plurality of software functions is stored in a first storage location; the first code group includes a plurality of first sample codes corresponding to a first instruction set combination, each first sample code is used to implement a software function corresponding to a corresponding code group, and is adapted to a corresponding first instruction set combination; the plurality of software functions are obtained by splitting the target software; then, based on all the identified instruction sets supported by the target host, an executable program of the target software adapted to the target host is customized, including: Extracting first sample codes from the first code groups corresponding to each software function of the target software respectively, wherein the instruction sets included in the first instruction set combination corresponding to the first sample codes are the same as all instruction sets supported by the target host; The extracted first sample codes corresponding to each software function are integrated to obtain an executable program of the target software adapted to the target host.
4. The method according to claim 3, characterized in that The method further comprises: If some software functions in the target software cannot extract from the corresponding first code group the first sample code whose instruction set included in the corresponding first instruction set combination is completely identical to all the instruction sets supported by the target host, perform any of the following operations: issue a prompt for notifying that the customization of the executable program has failed; or issue a prompt for notifying that the first code group of the some software functions lacks the first sample code adapted to the instruction set supported by the target host.
5. The method according to claim 1, characterized in that: Based on the identified full instruction sets supported by the target host, customizing an executable program of the target software adapted to the target host, including: Inputting all the identified instruction sets supported by the target host into an executable program generation model corresponding to the target software, so that the executable program generation model generates an executable program, wherein the executable program generation model is trained based on multiple sets of data, each set of data including a sample executable program of the target software and at least one instruction set adapted to the sample executable program; The executable program generated by the executable program generation model is determined as the executable program of the target software adapted to the target host.
6. The method according to any one of claims 1 to 5, characterized in that The second code group corresponding to the plurality of extensible software functions of the target software is stored in a third storage location, the second code group includes second sample codes corresponding to a plurality of second instruction set combinations, each second sample code is used to implement the extensible software function corresponding to the corresponding second code group, and is adapted to the corresponding second instruction set combination; then, after customizing the executable program of the target software adapted to the target host, the method further includes: Determining whether it is necessary to expand the software functions of the target software; If necessary, determine the target software function that needs to be expanded in the target software, and extract a second sample code from a second code group corresponding to the target software function, wherein the instruction set included in the second instruction set combination corresponding to the second sample code is the same as the instruction set supported by the target host; and incrementally integrate the extracted second target sample code into the executable program.
7. The method according to any one of claims 1 to 5, characterized in that The method further comprises: detecting whether the second storage location stores a historical executable program customized for the target software, the historical executable program having a corresponding instruction set based on which the customization is performed; if the historical executable program is stored in the second storage location, the historical executable program is determined as an executable program of the target software adapted to the target host; if the historical executable program does not exist, performing the step of customizing the executable program of the target software adapted to the target host based on the instruction set supported by the target host identified; and / or, If the target software has a software package installation program for booting the installation, the method further includes: monitoring whether the target host has run the software package installation program, and if so, determining that the target host needs to install the target software; and / or, The method also includes: detecting whether there is a request to customize the executable program of the target software based on some instruction sets among all instruction sets supported by the target host; if so, displaying the instruction set name corresponding to each instruction set supported by the target host, and customizing the executable program of the target software adapted to the target host based on the instruction set corresponding to the selected instruction set name; if not, executing the step of customizing the executable program of the target software adapted to the target host based on all the instruction sets supported by the identified target host.
8. A software installation device, characterized in that: The device comprises: An identification module, used to identify all instruction sets supported by the target host on which the target software needs to be installed; A customization module, used for customizing the executable program of the target software adapted to the target host based on all the instruction sets supported by the identified target host; An installation module is used to install the target software on the target host based on the executable program.
9. A computer-readable storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the software installation method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: The electronic device comprises: Memory, used to store programs; A processor, coupled to the memory, is used to run the program to execute the software installation method according to any one of claims 1 to 7.