System installation method and device, electronic equipment and storage medium

By partitioning unused storage areas on the target physical storage disk to install the first system, the problem of excessive computational overhead caused by virtual machines is solved, and efficient computing is achieved when multiple systems run simultaneously.

CN122363714APending Publication Date: 2026-07-10NEW H3C INTELLIGENCE TERMINAL CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NEW H3C INTELLIGENCE TERMINAL CO LTD
Filing Date
2026-03-27
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

When multiple systems are running simultaneously, the computational overhead caused by virtual machines is too high, leading to a decrease in device performance.

Method used

By partitioning an unused storage area on the target physical storage disk as the first physical storage area and installing the installation package of the first system into that area, the target physical storage disk can simultaneously contain both the first and second systems, thus avoiding the computational overhead of virtual machines.

Benefits of technology

It enables the simultaneous installation and operation of multiple systems on a single physical storage disk, eliminating the computational overhead of virtual machines and reducing the computational burden on the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122363714A_ABST
    Figure CN122363714A_ABST
Patent Text Reader

Abstract

This application discloses a system installation method, relating to the field of computer processing technology. The method includes: obtaining an installation package for a first system; responding to an installation command for the first system, partitioning a first physical storage area from an unused storage area of ​​a second physical storage region in a target physical storage disk, wherein a second system is installed in the second physical storage area; and installing the installation package into the first physical storage area, so that the target physical storage disk includes both the first and second systems. This application enables the installation of multiple systems on a single physical storage disk, eliminating the need to first bear the computational overhead of virtual machines when multiple systems are running simultaneously, thus reducing the computational overhead of the device when multiple systems are running concurrently.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer processing technology, specifically to system installation methods, devices, electronic devices, and storage media. Background Technology

[0002] Currently, with the development of data storage technology, two operating systems can be installed on a single disk.

[0003] In related technologies, virtual machines are used to allow a single disk to host two operating systems simultaneously. Specifically, a virtual machine is created on a Windows (Microsoft) system, an Android system is installed on the virtual machine, and a certain amount of memory and storage space is allocated to the virtual machine. In this way, the two systems can run concurrently, achieving the goal of storing two systems on a single disk.

[0004] However, in the aforementioned technologies, when running the Android system, the computational overhead caused by the virtual machine must be borne first, and the computational overhead is too large when both systems are running simultaneously. Summary of the Invention

[0005] In view of this, this application provides a system installation method, apparatus, electronic device, and storage medium to solve the problem of excessive computational overhead caused by virtual machines running multiple systems simultaneously.

[0006] In a first aspect, this application provides a system installation method, the method comprising: Obtain the installation package for the first system; In response to an installation command for the first system, a first physical storage area is partitioned from an unused storage area of ​​a second physical storage region in the target physical storage disk; wherein the second physical storage area is where the second system is installed; The installation package is installed into the first physical storage area, so that the target physical storage disk includes both the first system and the second system.

[0007] Secondly, this application provides a system installation apparatus, the apparatus comprising: The installation package acquisition module is used to acquire the installation package of the first system. A region partitioning module is used to partition a first physical storage region from an unused storage region of a second physical storage region in a target physical storage disk in response to an installation command for the first system; wherein the second physical storage region is where the second system is installed; The system installation module is used to install the installation package into the first physical storage area, so that the target physical storage disk includes the first system and the second system.

[0008] Thirdly, this application provides an electronic device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the system installation method described in the first aspect or any corresponding embodiment.

[0009] Fourthly, this application provides a computer-readable storage medium storing computer instructions for causing a computer to perform the system installation method described in the first aspect or any corresponding embodiment thereof.

[0010] Fifthly, this application provides a computer program product, including computer instructions for causing a computer to execute the system installation method described in the first aspect or any corresponding embodiment thereof.

[0011] The system installation method provided in this application embodiment, by using the installation instructions for the first system, when the second system is installed in the second physical storage area, divides the first physical storage area from the second physical storage area, and then installs the installation package of the first system into the first physical storage area, so that the target physical storage disk has both the first system and the second system installed at the same time, realizing the installation of multiple systems in one physical storage disk. When multiple systems are running at the same time, there is no need to bear the computational overhead of the virtual machine first, reducing the computational overhead of the device when multiple systems are running at the same time. Attached Figure Description

[0012] To more clearly illustrate the technical solutions in the specific embodiments or related technologies of this application, the drawings used in the description of the specific embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0013] Figure 1 This is a schematic diagram illustrating an application scenario according to an embodiment of this application; Figure 2 This is a schematic flowchart of a first method for system installation according to an embodiment of this application; Figure 3 An example diagram of the installation package is shown; Figure 4 This is a schematic diagram of a second process for a system installation method according to an embodiment of this application; Figure 5 This is a schematic diagram of the third process of the system installation method according to the embodiments of this application; Figure 6 This is a schematic diagram of the fourth process of the system installation method according to the embodiments of this application; Figure 7 An exemplary diagram of the first system uninstallation method is shown; Figure 8 This is a structural block diagram of a system installation apparatus according to an embodiment of this application; Figure 9 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0014] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0015] It should be noted that the information (including but not limited to user input information, such as information entered by the user into input boxes), data (including but not limited to data used for analysis, stored data, and displayed data, such as context code, all code of the current project, the service pressure corresponding to operations performed on all code of the current project, and the code development status of the current project), and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with relevant laws, regulations, and standards. For example, the context code, operations performed on all code of the current project, the corresponding service pressure, and the code development status involved in this application were all obtained with full authorization.

[0016] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0017] As one optional application scenario in the embodiments of this application, such as Figure 1 As shown, the system may include at least one electronic device, which includes at least one physical storage disk 10.

[0018] The physical storage disk 10 includes a first physical storage area 11 and a second physical storage area 12. The first physical storage area 11 refers to the physical storage area corresponding to the first system, and the second system storage area 12 refers to the physical storage area corresponding to the second system. For example, the first system is an x86 Android system, and the second system is a Windows (Microsoft) system.

[0019] The system installation method provided in this application will be described in detail below with reference to the embodiments of this application.

[0020] According to an embodiment of this application, a system installation method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0021] This embodiment provides a system installation method that can be used in the aforementioned electronic devices. Figure 2 This is a flowchart of a system installation method according to an embodiment of this application, such as... Figure 2 As shown, the process includes the following steps: Step S201: Obtain the installation package for the first system.

[0022] In this embodiment, during system installation of the first system, the electronic device obtains the installation package of the first system. The installation package is used to characterize the partition layout, boot information, and boot loading information of the first system. For example, the first system is an x86 system.

[0023] For example, such as Figure 3 As shown, the installation of the first system includes a partition configuration file (gpt.bin), a boot image file (boot.img), and a bootloader image (bootloader.img). The partition configuration file represents the partition layout of the first system, such as the unique identifier, type identifier, and required physical storage space for each partition; the boot image file represents the boot information of the first system; and the bootloader image represents the boot loading information of the first system.

[0024] For example, the installation package of the first system is a file pre-configured by the staff.

[0025] In step S202, in response to the installation command for the first system, a first physical storage area is partitioned from the unused storage area of ​​the second physical storage area in the target physical storage disk.

[0026] In this embodiment, upon obtaining the installation package of the first system, the electronic device, in response to an installation command for the first system, partitions a first physical storage area within an unused storage area of ​​the second physical storage region in the target physical storage disk. The target physical storage disk includes the second physical storage area, on which the second system is installed.

[0027] For example, the partitioning model of the target physical storage disk is GPT (Globally Unique Identifier Partition Table) mode.

[0028] For example, the second system is a system that was previously stored on the target physical storage disk before the first system was installed. For example, the second system may include one or more subsystems that can run simultaneously, that is, two or more systems can run at the same time if there is sufficient space on the target physical storage disk.

[0029] For example, the second system is a Windows system.

[0030] Step S203: Install the installation package into the first physical storage area so that the target physical storage disk includes the first system and the second system.

[0031] In this embodiment of the application, after obtaining the first physical storage area, the electronic device installs the installation package into the first physical storage area so that the target physical storage disk includes the first system and the second system.

[0032] The system installation method provided in this embodiment, by targeting the installation instructions of the first system, when the second system is installed in the second physical storage area, divides the first physical storage area from the second physical storage area, and then installs the installation package of the first system into the first physical storage area, so that the target physical storage disk has both the first system and the second system installed at the same time, realizing the installation of multiple systems on one physical storage disk. When multiple systems are running at the same time, there is no need to bear the computational overhead of the virtual machine first, thus reducing the computational overhead of the device when multiple systems are running at the same time.

[0033] This embodiment provides a system installation method that can be used in the aforementioned electronic devices. Figure 4 This is a flowchart of a system installation method according to an embodiment of this application, such as... Figure 4 As shown, the process includes the following steps: Step S401: Obtain the installation package for the first system.

[0034] The above steps S401 and Figure 2 Step S201 in the embodiment is similar; see details below. Figure 2 Examples are not detailed here.

[0035] In step S402, in response to the installation command for the first system, a first physical storage area is partitioned in the target physical storage disk.

[0036] Specifically, step S402 includes: Step S4021: In response to the installation command for the first system, obtain the target physical storage disk indicated by the installation command.

[0037] In this embodiment of the application, after obtaining the installation package of the first system, the electronic device responds to the installation instruction for the first system and obtains the target physical storage disk indicated by the installation instruction.

[0038] Optionally, to allow for flexible selection of the target physical storage disk and improve system installation flexibility, step S4021 specifically includes: Step S4021a, in response to the installation operation for the first system, displays at least one candidate physical storage disk.

[0039] Optionally, the electronic device includes one or more candidate physical storage disks. In this embodiment, the electronic device displays at least one candidate physical storage disk in response to an installation operation for the first system. The at least one candidate physical storage disk includes the target physical storage disk.

[0040] For example, the electronic device displays a start installation control; in response to an operation on the start installation control, an installation operation for the first system is generated; in response to the installation operation for the first system, the DiskDriveInfo::GetDiskDriveInfo function is called through the WMI (Windows Management Instrumentation) interface to traverse all candidate physical storage disks in the electronic device, exclude removable storage devices, and obtain basic information such as device identifier, model, serial number, total capacity, and used space of the candidate physical storage disks; at least one candidate physical storage disk is displayed.

[0041] For example, if only one candidate physical storage disk is detected by calling the DiskDriveInfo::GetDiskDriveInfo function through the WMI interface, the electronic device displays the candidate physical storage disk and directly identifies the candidate physical storage disk as the target physical storage disk.

[0042] Step S4021b: In response to the selection operation for the target physical storage disk, an installation command is generated.

[0043] In this embodiment of the application, after displaying at least one candidate physical storage disk, the electronic device generates an installation command in response to the selection operation for the target physical storage disk.

[0044] Step S4021c: Obtain the target physical storage disk indicated by the installation instructions.

[0045] In this embodiment of the application, after obtaining the above-mentioned installation instructions, the electronic device obtains the target physical storage disk indicated by the installation instructions.

[0046] Step S4022: Based on the globally unique identifier partition table of the target physical storage disk, separate the unallocated physical storage area in the second physical storage area.

[0047] In this embodiment of the application, after obtaining the target physical storage disk, the electronic device separates the unallocated physical storage area in the second physical storage area based on the globally unique identifier partition table (GPT) of the target physical storage disk.

[0048] For example, the electronic device reads the GPT to obtain partition table information, which includes partition entries, partition type GUID (Globally Unique Identifier), start sector, end sector, partition name, location and checksum of the primary GPT, and location and checksum of the backup GPT table; further, the GPTInfos::FindNonContinuousPartitions function is called to traverse the partition entries in the partition table information and filter out at least one unused contiguous sector in the second physical storage area of ​​the target physical storage disk; further, the start sector, end sector, and total capacity of each contiguous sector are recorded.

[0049] For example, step S4022 above includes: Step S4022a: Obtain the preset physical storage space of the first system.

[0050] The preset physical storage space is used to represent the maximum storage space required by the first system. For example, the preset content is pre-set by the staff.

[0051] Step S4022b: Based on the globally unique identifier partition table of the target physical storage disk, the unused storage area of ​​the second physical storage region is detected.

[0052] For example, the GPTInfos::FindNonContinuousPartitions function is called to obtain the unused storage area of ​​the second physical storage region. The unused storage area of ​​the second physical storage region includes at least one unused contiguous sector as described above.

[0053] Step S4022c: If the unused storage area meets the preset physical storage space of the first system, detect whether the unused storage area is a contiguous sector.

[0054] Step S4022d: When the unused storage area is a contiguous sector, an unallocated physical storage area is separated from the second physical storage area based on the preset physical storage space.

[0055] In step S4022e, when the unused storage area includes multiple discrete sectors, the unused storage area is merged based on the preset physical storage space, and the merged unused storage area is separated in the second physical storage area to obtain the unallocated physical storage area.

[0056] In step S4022f, if the unallocated physical storage area does not meet the preset physical storage space of the first system, a first prompt message is displayed.

[0057] The first prompt message is used to indicate that the first system cannot be installed due to insufficient physical storage space. That is, when the unallocated physical storage area does not meet the preset physical storage space of the first system, the first prompt message is displayed to remind that the first system cannot be installed due to insufficient physical storage space. Timely error reporting helps to improve the installation efficiency of the first system.

[0058] For example, the storage space corresponding to the unallocated physical storage area is equal to the preset physical storage space. Of course, in other possible implementations, the storage space corresponding to the unallocated physical storage area is greater than the preset physical storage space.

[0059] Step S4023: The unallocated physical storage area is determined as the first physical storage area.

[0060] In this embodiment of the application, after obtaining the aforementioned unallocated physical storage area, the electronic device determines the unallocated physical storage area as the first physical storage area.

[0061] Step S403: If the characteristic information of the third system is detected based on the target physical storage disk, the first installation control and the second installation control are displayed.

[0062] In this embodiment of the application, after acquiring the target physical storage disk, the electronic device displays a first installation control and a second installation control when it detects the feature information of the third system based on the target physical storage disk.

[0063] For example, the electronic device reads the aforementioned GPT and uses characteristic information such as partition name and partition type GUID (such as the system / data / cache partition identifier unique to the Android system) to detect whether a third system exists on the target physical storage disk.

[0064] In this embodiment, the third system and the first system cannot coexist on the target physical storage disk. For example, the third system and the first system are of the same type.

[0065] Step S404: In response to the operation on the first installation control, uninstall the third system and install the first system.

[0066] In this embodiment of the application, after the first installation control is displayed, the electronic device responds to the operation on the first installation control by uninstalling the third system and installing the first system.

[0067] Step S405: In response to an operation on the second installation control, the first system is overwritten and installed based on the third system.

[0068] In this embodiment of the application, after the second installation control is displayed, the electronic device responds to the operation on the second installation control and installs the first system over the third system.

[0069] Step S406: Install the installation package into the first physical storage area so that the target physical storage disk includes the first system and the second system.

[0070] The above steps S406 and Figure 2 Step S203 in the embodiment is similar; see details below. Figure 2 Examples are not detailed here.

[0071] The system installation method provided in this embodiment separates an unallocated physical storage area from the second physical storage area by targeting the installation instructions of the first system, and determines the unallocated physical storage area as the first physical storage area of ​​the first system. This separates multiple physical storage areas from a target physical storage disk, thereby enabling the installation of multiple systems on a single physical storage disk.

[0072] In addition, when the unused storage area includes multiple discrete sectors, the unused storage area is merged based on the preset physical storage space, and the unallocated physical storage area is separated. The flexible merging of discrete sectors enables the target physical storage disk to provide sufficient installation space for the first system, thereby improving the smoothness of the first system installation.

[0073] In addition, if a third system that cannot coexist with the first system exists on the target physical storage disk, the third system can be uninstalled using the first installation control to install the first system, and the first system can be installed over the third system using the second installation control. This improves the flexibility of the first system installation and detects the existence of the third system in advance, which helps to improve the success rate of the first system installation.

[0074] This embodiment provides a system installation method that can be used in the aforementioned electronic devices. Figure 5 This is a flowchart of a system installation method according to an embodiment of this application, such as... Figure 5 As shown, the process includes the following steps: Step S501: Obtain the installation package for the first system.

[0075] The above steps S501 and Figure 2 Step S201 in the embodiment is similar; see details below. Figure 2 Examples are not detailed here.

[0076] In step S502, in response to the installation command for the first system, a first physical storage area is partitioned in the target physical storage disk.

[0077] The above steps S502 and Figure 4 Step S402 in the embodiment is similar; see details below. Figure 4 Examples are not detailed here.

[0078] Step S503: Install the installation package into the first physical storage area so that the target physical storage disk includes the first system and the second system.

[0079] Specifically, step S503 includes: Step S5031: Based on the partition configuration file in the installation package, obtain the first partition entry of the first system.

[0080] In this embodiment of the application, when the installation package is installed to the first physical storage area, the electronic device obtains the first partition entry of the first system based on the partition configuration file in the installation package. The first partition entry includes at least one first partition, and each first partition corresponds to a unique identifier (Universally Unique Identifier), a type identifier (type GUID), a start position in the first physical storage area, and an end position.

[0081] Step S5032: Configure each first partition to obtain the second partition entries.

[0082] In this embodiment of the application, after obtaining the first partition entries, the electronic device configures each of the first partitions to obtain second partition entries. Each second partition entry includes at least one second partition. For example, the second partition is the configured first partition.

[0083] For example, the electronic device obtains the bootloader partition from the first partition entry; further, it configures the type identifier of the bootloader partition based on first configuration information, which is used to identify the bootloader partition; further, it configures the file format of all first partitions in the first partition entry based on second configuration information, where the file format indicated by the second configuration information is a file format that the second system cannot recognize; further, in response to the completion of the type identifier configuration and the completion of the file format configuration, a second partition entry is obtained.

[0084] For example, for the bootloader partition, the type should be changed to UUID('A19D880F-05FC-4D3B-A006-743F0F84911E') to identify this partition as a bootloader partition, and the file format of the bootloader partition is Linux RAID partition.

[0085] For example, the first system is an x86 Android system, and the second system is a Windows system. The first partition of the first system uses file formats such as Linux Data partition, EXT4, Linux RAID partition, Android-AI MISCPartition, and Android-AI Boot Partition, while the second system uses file formats such as NTFS, FAT32, FAT, and REFS. The use of different file formats by the first and second systems prevents them from accessing each other's files, achieving physical isolation through file format differences and avoiding cross-system file leaks.

[0086] For example, the second configuration information includes attribute information. When the electronic device writes the second partition entry into the globally unique identifier partition table, it controls the second system to scan the second partition entry. Based on this attribute information, the second system determines that the first partition is a partition that is prohibited from being mounted and is inaccessible.

[0087] Step S5033: Write the second partition entry into the first partition corresponding to the first system in the globally unique identifier partition table of the target physical storage disk.

[0088] In this embodiment of the application, after obtaining the second partition entry, the electronic device writes the second partition entry into the first partition corresponding to the first system in the globally unique identifier partition table of the target physical storage disk.

[0089] For example, the electronic device synchronously modifies the primary GPT and backup GPT to ensure the fault tolerance of the target physical storage disk partition table, and calls the GPTInfos::Write function to write the modified primary GPT and backup GPT to a specified sector of the target physical storage disk; further, it calls the CRC32 function to recalculate the CRC32 check value of the GPT and update the GPT header information (including checksum, partition table size, backup GPT location, etc.).

[0090] Step S5034: In the second partition entry, write the image file contained in the installation package into the corresponding second partition.

[0091] In this embodiment of the application, after the second partition entry is written to the first partition, the electronic device writes the image file contained in the installation package into the corresponding second partition in the second partition entry.

[0092] For example, the electronic device obtains multiple image files of the first system from the installation package, as well as the mapping relationship between each image file and the second partition; further, if the image file is a sparse format image file, the image file is converted to the original format; further, based on the mapping relationship, the image file is written to the second partition.

[0093] It should be noted that in the first system of partition A / B, the electronic device synchronously writes the common boot content to the corresponding partition A and partition B.

[0094] It should also be noted that if a first partition exists but there is no corresponding image file, the electronic device will use the first partition that exists but has no corresponding image file as the target partition, and then write 500KB of empty data (0x00 padding) to the target partition in order to clean up the old data in the target partition and ensure data security.

[0095] Step S5035: Configure the boot entry for the first system in the boot entry list of the target physical storage disk.

[0096] In this embodiment, after the image file is written to the corresponding second partition, the electronic device configures a boot entry for the first system in the boot entry list of the target physical storage disk. The boot entry provides an interface for switching between the first and second systems.

[0097] For example, the electronic device sets the boot version information of the first system based on the above installation package; further, the boot version information is added as a boot item to the boot item list.

[0098] For example, when setting the boot version information of the first system, the electronic device uses the information access tools provided by the BIOS system (Basic Input / Output System), such as the H2OSDE-Wx64 tool in Insyde, to set the boot version information of the first system through the command: H2OSDE-Wx64 -CV. For example, if the first system is an x86 Android system, then the boot version information of the first system is the Android version number.

[0099] Step S5036: In response to the completion of the boot configuration of the first system, instruct the first system to be installed in the first physical storage area.

[0100] In this embodiment of the application, the electronic device, in response to the completion of the first system's configuration, instructs the first system to be installed in the first physical storage area.

[0101] The system installation method provided in this embodiment installs the first system through the partition configuration file of the installation package, which is simple to operate and improves the installation efficiency of the first system.

[0102] Furthermore, by configuring file formats, the first and second systems are isolated from the perspective of file format. The second system cannot recognize the file formats in the first system, thus improving data security when multiple systems are running. In addition, by explicitly indicating through attribute information that the second system should not mount and cannot access the partitions of the first system, data security is further enhanced.

[0103] In addition, converting sparse format image files to original format image files eliminates the risk of directly writing to sparse format image files and improves the success rate of installing the first system.

[0104] In addition, by adding the boot version information as a boot item to the boot item list, and by using the boot item to provide a switching interface between the first system and the second system, the switching between the first system and the second system becomes more flexible.

[0105] This embodiment provides a system installation method that can be used in the aforementioned electronic devices. Figure 6 This is a flowchart of a system installation method according to an embodiment of this application, such as... Figure 6 As shown, the process includes the following steps: Step S601: Obtain the installation package of the first system.

[0106] The above steps S601 and Figure 2 Step S201 in the embodiment is similar; see details below. Figure 2 Examples are not detailed here.

[0107] In step S602, in response to the installation command for the first system, a first physical storage area is partitioned in the target physical storage disk.

[0108] The above steps S602 and Figure 4 Step S402 in the embodiment is similar; see details below. Figure 4 Examples are not detailed here.

[0109] Step S603: Install the installation package into the first physical storage area so that the target physical storage disk includes the first system and the second system.

[0110] The above steps S603 and Figure 5 Step S503 in the embodiment is similar; see details below. Figure 5 Examples are not detailed here.

[0111] Step S604: In response to the unload command for the first system, the first partition of the first system is obtained from the globally unique identifier partition table of the target physical storage disk.

[0112] In this embodiment of the application, after the first system is installed, the electronic device, in response to the uninstallation command for the first system, obtains the first partition of the first system from the globally unique identifier partition table of the target physical storage disk.

[0113] For example, the electronic device reads the GPT of the target physical storage disk and parses it to obtain the partition layout of the target physical storage disk; further, based on the partition layout, it identifies the feature information of the first system to obtain the first partition of the first system.

[0114] Step S605: Based on the partition configuration file in the installation package, delete the second partition entry in the first partition.

[0115] In this embodiment of the application, after obtaining the first partition, the electronic device deletes the second partition entry in the first partition based on the partition configuration file in the installation package.

[0116] For example, the electronic device reads the second partition entry based on the partition configuration file in the installation package; further, it calls the GPTInfos::RemoveTable function to delete the image file of the second partition entry from the GPT based on the characteristic information of the first system.

[0117] Step S606: Delete the boot entry of the first system from the boot entry list of the target physical storage disk.

[0118] In this embodiment of the application, after deleting the second partition entry in the first partition, the electronic device deletes the boot entry of the first system from the boot entry list of the target physical storage disk.

[0119] For example, electronic devices can use the H2OSDE-Wx64 tool provided by the BIOS system, such as Insyde, to clear the boot entries of the first system using the command: H2OSDE-Wx64 -CV.

[0120] Step S607: The first physical storage area is treated as an unallocated physical storage area and merged into the second physical storage area.

[0121] In this embodiment of the application, after the above-mentioned guide item is deleted, the electronic device merges the first physical storage area as an unallocated physical storage area into the above-mentioned second physical storage area.

[0122] For example, the electronic device displays a system deletion control; in response to an operation on the system deletion control, an uninstallation command for the first system is generated; further, execution begins from step S604 above until the deletion of the first system is completed. For example, as... Figure 7 As shown, the display device shows the delete Android partition control (i.e., the system delete control). The user sets the target physical storage disk as the disk to be processed, and the electronic device responds to the operation of the delete Android partition control to delete the first system on the target physical storage disk.

[0123] The system installation method provided in this embodiment uninstalls the first system using an uninstallation command. Based on flexible system installation, it can uninstall the first system, thereby improving the overall flexibility of the first system's usage.

[0124] This embodiment also provides a system installation apparatus for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0125] This embodiment provides a system installation device, such as... Figure 8 As shown, it includes: The installation package acquisition module 801 is used to acquire the installation package of the first system. The region partitioning module 802 is used to partition a first physical storage region from an unused storage region of a second physical storage region in a target physical storage disk in response to an installation command for the first system; wherein the second physical storage region is where the second system is installed; The system installation module 803 is used to install the installation package into the first physical storage area so that the target physical storage disk includes the first system and the second system.

[0126] In some alternative implementations, the region partitioning module 802 includes: The disk acquisition unit is configured to acquire the target physical storage disk indicated by the installation instruction in response to the installation instruction for the first system. A region separation unit is used to separate unallocated physical storage regions in the second physical storage region based on the globally unique identifier partition table of the target physical storage disk. A region determination unit is used to determine the unallocated physical storage region as the first physical storage region.

[0127] In some alternative implementations, the region separation unit is used for: Obtain the preset physical storage space of the first system; wherein, the preset physical storage space is used to characterize the maximum storage space required by the first system; Based on the globally unique identifier partition table of the target physical storage disk, the unused storage area of ​​the second physical storage region is detected; If the unused storage area meets the preset physical storage space of the first system, it is detected whether the unused storage area is a contiguous sector; If the unused storage area is a contiguous sector, the unused storage area is separated in the second physical storage area based on the preset physical storage space to obtain the unallocated physical storage area; In the case where the unused storage area includes multiple discrete sectors, the unused storage area is merged based on the preset physical storage space, and the merged unused storage area is separated in the second physical storage area to obtain the unallocated physical storage area.

[0128] In some alternative embodiments, the apparatus further includes: The control display module is used to display a first installation control and a second installation control when the characteristic information of the third system is detected based on the target physical storage disk; wherein the third system and the first system cannot coexist on the target physical storage disk; A first installation module is configured to uninstall the third system and install the first system in response to an operation on the first installation control; The second installation module is configured to, in response to an operation on the second installation control, overwrite the first system based on the third system.

[0129] In some alternative implementations, the system installation module 803 includes: The partition acquisition unit is used to acquire the first partition entry of the first system based on the partition configuration file in the installation package; wherein, the first partition entry includes at least one first partition, and each first partition corresponds to a unique identifier, a type identifier, a start position and an end position in the first physical storage area; A partition configuration unit is used to configure each of the first partitions to obtain a second partition entry; wherein the second partition entry includes at least one second partition; The partition writing unit is used to write the second partition entry into the first partition corresponding to the first system in the globally unique identifier partition table of the target physical storage disk; The file writing unit is used to write the image file contained in the installation package into the corresponding second partition in the second partition entry; A boot configuration unit is configured to configure a boot entry for the first system in the boot entry list of the target physical storage disk; wherein the boot entry is used to provide a switching selection interface between the first system and the second system; The installation completion unit is configured to, in response to the completion of the boot configuration of the first system, instruct the first system to be installed into the first physical storage area.

[0130] In some optional implementations, the partition configuration unit is used for: Retrieve the bootloader partition from the first partition entry; The type identifier of the bootloader partition is configured based on the first configuration information; wherein, the first configuration information is used to identify the bootloader partition; The file format of all first partitions in the first partition entry is configured based on the second configuration information; wherein the file format indicated by the second configuration information is a file format that the second system cannot recognize; In response to the completion of the type identifier configuration and the file format configuration, the second partition entry is obtained.

[0131] In some optional implementations, the second configuration information includes attribute information; the apparatus further includes: The scanning control module is used to control the second system to scan the second partition entry when the second partition entry is written into the globally unique identifier partition table; wherein, the second system determines the first partition as a partition that is prohibited from being mounted and cannot be accessed based on the attribute information.

[0132] In some optional implementations, the file writing unit is used for: Obtain multiple image files of the first system from the installation package, as well as the mapping relationship between each image file and the second partition; If the image file is a sparse format image file, then the image file is converted to the original format; Based on the mapping relationship, the image file is written to the second partition.

[0133] In some alternative implementations, the boot configuration unit is used for: Based on the installation package, set the boot version information of the first system; Add the boot version information as the boot item to the boot item list.

[0134] In some alternative embodiments, the apparatus further includes: The system unloading module is used to obtain the first partition of the first system from the globally unique identifier partition table of the target physical storage disk in response to an unloading command for the first system. An entry deletion module is used to delete a second partition entry in the first partition based on the partition configuration file in the installation package. A boot deletion module is used to delete the boot entry of the first system from the boot entry list of the target physical storage disk; The region merging module is used to merge the first physical storage region as an unallocated physical storage region into the second physical storage region.

[0135] The system installation apparatus provided in this application can execute the system installation method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the various modules and units described above are the same as in the corresponding embodiments described above, and will not be repeated here.

[0136] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0137] The following is a detailed reference. Figure 9 The diagram illustrates a structural schematic suitable for implementing the electronic device described in the embodiments of this application. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 901, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 902 or a program loaded from memory 908 into random access memory (RAM) 903. The RAM 903 also stores various programs and data required for the operation of the electronic device. The processor 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0138] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 908 including, for example, magnetic tapes, disks, etc.; and communication devices 909. Communication device 909 allows electronic devices to exchange data via wireless or wired communication with other devices. Although Figure 9 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.

[0139] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a memory 908, or installed from a ROM 902. When the computer program is executed by the processor 901, it performs the functions defined in the system installation method of embodiments of this application.

[0140] Figure 9The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0141] This application also provides a computer-readable storage medium. The methods described in this application can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code downloaded over a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, magnetic disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the system installation method shown in the above embodiments is implemented.

[0142] For example, the electronic device is the target terminal device.

[0143] A portion of this application can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to this application through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0144] Although embodiments of this application have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of this application, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A system installation method, characterized in that, The method includes: Obtain the installation package for the first system; In response to an installation command for the first system, a first physical storage area is partitioned from an unused storage area of ​​a second physical storage region in the target physical storage disk; wherein the second physical storage area is where the second system is installed; The installation package is installed into the first physical storage area so that the target physical storage disk includes the first system and the second system.

2. The method according to claim 1, characterized in that, The step of partitioning a first physical storage area from an unused storage area of ​​a second physical storage region in response to an installation command for the first system includes: In response to an installation command for the first system, the target physical storage disk indicated by the installation command is obtained; Based on the globally unique identifier partition table of the target physical storage disk, an unallocated physical storage area is separated in the second physical storage area; The unallocated physical storage area is designated as the first physical storage area.

3. The method according to claim 2, characterized in that, The partition table based on the globally unique identifier of the target physical storage disk, which separates unallocated physical storage areas in the second physical storage area, includes: Obtain the preset physical storage space of the first system; wherein, the preset physical storage space is used to characterize the maximum storage space required by the first system; Based on the globally unique identifier partition table of the target physical storage disk, the unused storage area of ​​the second physical storage region is detected; If the unused storage area meets the preset physical storage space of the first system, it is detected whether the unused storage area is a contiguous sector; If the unused storage area is a contiguous sector, the unused storage area is separated in the second physical storage area based on the preset physical storage space to obtain the unallocated physical storage area; In the case where the unused storage area includes multiple discrete sectors, the unused storage area is merged based on the preset physical storage space, and the merged unused storage area is separated in the second physical storage area to obtain the unallocated physical storage area.

4. The method according to claim 2, characterized in that, The method further includes: If the characteristic information of the third system is detected based on the target physical storage disk, a first installation control and a second installation control are displayed; wherein the third system and the first system cannot coexist on the target physical storage disk; In response to an operation on the first installation control, the third system is uninstalled to install the first system; In response to an operation on the second installation control, the first system is installed over the third system.

5. The method according to claim 1, characterized in that, The step of installing the installation package into the first physical storage area includes: Based on the partition configuration file in the installation package, the first partition entry of the first system is obtained; wherein, the first partition entry includes at least one first partition, and each first partition corresponds to a unique identifier, a type identifier, a start position and an end position in the first physical storage area; Configure each of the first partitions to obtain a second partition entry; wherein, the second partition entry includes at least one second partition; In the globally unique identifier partition table of the target physical storage disk, the second partition entry is written into the first partition corresponding to the first system; In the second partition entry, the image file contained in the installation package is written into the corresponding second partition; Configure the boot entry for the first system in the boot entry list of the target physical storage disk; wherein, the boot entry is used to provide a switching selection interface between the first system and the second system; In response to the completion of the boot configuration of the first system, the first system is instructed to be installed in the first physical storage area.

6. The method according to claim 5, characterized in that, The configuration of each of the first partitions to obtain the second partition entries includes: Retrieve the bootloader partition from the first partition entry; The type identifier of the bootloader partition is configured based on the first configuration information; wherein, the first configuration information is used to identify the bootloader partition; The file format of all first partitions in the first partition entry is configured based on the second configuration information; wherein the file format indicated by the second configuration information is a file format that the second system cannot recognize; In response to the completion of the type identifier configuration and the file format configuration, the second partition entry is obtained; The second configuration information includes attribute information; the method further includes: When the second partition entry is written into the globally unique identifier partition table, the second system is controlled to scan the second partition entry; wherein, based on the attribute information, the second system determines that the first partition is a partition that is prohibited from being mounted and cannot be accessed.

7. The method according to claim 5, characterized in that, The step of writing the image file contained in the installation package into the corresponding second partition in the second partition entry includes: Obtain multiple image files of the first system from the installation package, as well as the mapping relationship between each image file and the second partition; If the image file is a sparse format image file, then the image file is converted to the original format; Based on the mapping relationship, the image file is written to the second partition.

8. The method according to claim 5, characterized in that, Configuring the boot entry for the first system in the boot entry list of the target physical storage disk includes: Based on the installation package, set the boot version information of the first system; Add the boot version information as the boot item to the boot item list.

9. The method according to claim 1, characterized in that, The method further includes: In response to an uninstallation command for the first system, the first partition of the first system is obtained from the globally unique identifier partition table of the target physical storage disk; Based on the partition configuration file in the installation package, delete the second partition entry in the first partition; Delete the boot entry of the first system from the boot entry list of the target physical storage disk; The first physical storage area is treated as an unallocated physical storage area and merged into the second physical storage area.

10. A system installation device, characterized in that, The device includes: The installation package acquisition module is used to acquire the installation package of the first system. A region partitioning module is used to partition a first physical storage region from an unused storage region of a second physical storage region in a target physical storage disk in response to an installation command for the first system; wherein the second physical storage region is where the second system is installed; The system installation module is used to install the installation package into the first physical storage area, so that the target physical storage disk includes the first system and the second system.

11. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the system installation method of any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the system installation method according to any one of claims 1 to 9.

13. A computer program product, characterized in that, Includes computer instructions for causing a computer to perform the system installation method according to any one of claims 1 to 9.