Partition space adjustment method and device, equipment and storage medium

By obtaining and analyzing the upgrade images in the upgrade package in the Linux system and dynamically adjusting the partition size, the problems of wasted storage space and failure of upgrade functions caused by traditional partition division methods are solved, and more efficient storage space utilization is achieved.

CN120122975APending Publication Date: 2025-06-10WEICHAI POWER CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510130524.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-05
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

During the Linux system upgrade process, traditional partitioning methods require a large amount of redundant storage space, resulting in wasted storage space. It cannot guarantee that the partition size is always suitable for upgrading needs, and may cause the upgrade function to fail.

Method used

By obtaining the upgrade image of each partition to be upgraded in the upgrade package, determine the storage space required for each upgrade image, and re-dividing all partitions based on this information to dynamically adjust the partition size and reduce redundant space.

Benefits of technology

It realizes dynamically adjusting the partition size according to actual needs during each upgrade, reducing redundant space, improving the utilization rate of storage space, and ensuring the normal operation of the upgrade function.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120122975A_ABST
    Figure CN120122975A_ABST
Patent Text Reader

Abstract

The invention provides a partition space adjustment method and device, equipment and a storage medium. The method comprises the steps of obtaining an upgrade mirror image corresponding to each to-be-upgraded partition in an upgrade package; determining a storage space required by each upgrading mirror image; and on the basis of the storage space required by each upgrading mirror image, dividing all the partitions again. According to the embodiment of the invention, each partition can be dynamically adjusted according to the size of the partition actually required by the upgrade every time the upgrade is carried out, so that the redundant space is reduced, and the storage space is more fully utilized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of computer technology, and particularly relates to a method, apparatus, device, and storage medium for adjusting partition space. Background Art

[0002] Currently, the Linux system is upgraded to implement different functions. The upgrade generally involves updating the version of the operating system to add new functions, fix vulnerabilities, or improve performance. The system upgrade can involve updates in multiple aspects such as the kernel, drivers, application programs, and library files. Generally, the Linux system is partitioned to store the images in the upgrade package, thereby completing the upgrade of the Linux system.

[0003] In the traditional solution, when making partition division before upgrading, a large part of redundant storage space needs to be reserved for each partition to ensure that the partition can meet the changes in partition size brought about by future version changes. This will inevitably lead to waste of storage space; moreover, it cannot be guaranteed that the reserved partition size will definitely be larger than the required size for the upgrade. If this situation occurs, the upgrade function will no longer be able to be used normally. Summary of the Invention

[0004] This application proposes a method, apparatus, device, and storage medium for adjusting partition space, which can solve the technical problems of redundant partition storage space or insufficient partition space in the process of upgrading the Linux system in the related art.

[0005] The first aspect embodiment of this application proposes a method for adjusting partition space, including:

[0006] Obtain the upgrade image corresponding to each partition to be upgraded in the upgrade package;

[0007] Determine the storage space required for each of the upgrade images;

[0008] Based on the storage space required for each of the upgrade images, re-partition all partitions.

[0009] The second aspect embodiment of this application provides a device for adjusting partition space, including:

[0010] An obtaining module, configured to obtain the upgrade image corresponding to each partition to be upgraded in the upgrade package;

[0011] A determining module, configured to determine the storage space required for each of the upgrade images;

[0012] A partitioning module, configured to re-partition all partitions based on the storage space required for each of the upgrade images.

[0013] An embodiment of the third aspect of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. The processor runs the computer program to implement the method described in the first aspect above.

[0014] An embodiment of the fourth aspect of the present application provides a computer-readable storage medium, on which a computer program is stored. The program is executed by a processor to implement the method described in the first aspect above.

[0015] The technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:

[0016] The present application proposes a method, device, equipment, and storage medium for partitioning space adjustment. The method includes: obtaining an upgrade image corresponding to each partition to be upgraded in the upgrade package; determining the storage space required for each upgrade image; and re-partitioning all partitions based on the storage space required for each upgrade image. In the embodiments of the present application, each partition is dynamically adjusted according to the actual partition size required for each upgrade during each upgrade, reducing redundant space and making more efficient use of the storage space.

[0017] The additional aspects and advantages of the present application will be partially given in the following description, partially become apparent from the following description, or be understood through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] By reading the detailed description of the preferred embodiments below, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present application. Moreover, throughout the drawings, the same reference numerals are used to represent the same components.

[0019] In the drawings:

[0020] Figure 1 Shows a flowchart of a method for partitioning space adjustment provided by an embodiment of the present application;

[0021] Figure 2 Shows a schematic diagram of the storage space of a Linux system provided by an embodiment of the present application;

[0022] Figure 3 Shows a schematic diagram of the structure of a device for partitioning space adjustment provided by an embodiment of the present application;

[0023] Figure 4 Shows a schematic diagram of the structure of an electronic device provided by an embodiment of the present application;

[0024] Figure 5Shows a schematic diagram of a storage medium provided by an embodiment of the present application. Detailed implementation manners

[0025] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present application can be more thoroughly understood and the scope of the present application can be fully conveyed to those skilled in the art.

[0026] It should be noted that, unless otherwise specified, the technical terms or scientific terms used in the present application should have the ordinary meanings understood by those skilled in the art to which the present application belongs.

[0027] The partition space adjustment method of the present application can be executed by a computing device. The computing device can be a server, such as a single server, multiple servers, a server cluster, a cloud computing platform, etc. Optionally, the computing device can also be a terminal device, such as a mobile phone, a tablet computer, a game console, a portable computer, a desktop computer, an advertising machine, an all-in-one computer, etc. The present application does not limit the device type and the number of devices of the computing device.

[0028] Continuing with the above background technology, when making partition division before the traditional solution is upgraded, a large part of redundant storage space needs to be reserved for each partition to ensure that the partition can meet the change in partition size brought about by future version changes. This will inevitably lead to waste of storage space; moreover, it cannot be guaranteed that the reserved partition size will definitely be larger than the size required for the upgrade. If this situation occurs, the upgrade function will no longer be able to be used normally.

[0029] To solve the technical problem of waste of storage space caused by fixed partition division in the Linux system upgrade solution, in the related art, the partition is expanded when the partition size is insufficient, but there may still be waste of storage space after the expansion. For example, if the current partition size is 1G and the actual upgrade package size is 500M, then the partition will not be expanded, resulting in a waste of 500M of storage space. Even after the upgrade is completed, this part of the storage resource cannot be utilized by the system.

[0030] To solve the above technical problems, the present application proposes a method, apparatus, device, and storage medium for partition space adjustment. The method includes: obtaining upgrade images corresponding to each partition to be upgraded in an upgrade package; determining the storage space required for each upgrade image; and re-partitioning all partitions based on the storage space required for each upgrade image. In the embodiments of the present application, each partition is dynamically adjusted according to the actual partition size required for each upgrade during each upgrade, reducing redundant space and making more efficient use of the storage space.

[0031] For the execution entity, in each embodiment of the present application, a computing device is taken as an example for illustration.

[0032] The following describes a method for partition space adjustment proposed according to an embodiment of the present application with reference to the accompanying drawings.

[0033] See Figure 1 , the method specifically includes the following steps:

[0034] S101. Obtain upgrade images corresponding to each partition to be upgraded in the upgrade package.

[0035] Among them, the upgrade package may include upgrade images corresponding to all partitions in the Linux system, or include upgrade images corresponding to the partitions to be upgraded. The upgrade package generally includes a set of files for system upgrade, including all files and scripts required for system update, such as kernels, drivers, library files, and configuration files, etc. The upgrade package can be incremental (only update the changed parts) or complete (include all components of the system).

[0036] An image is a form of file storage and a type of redundancy. A complete copy of the data on one disk exists on another disk, which is called an image.

[0037] The upgrade package can be transferred to the computing device through Over-the-Air Technology (OTA) or other means (such as a USB flash drive). Generally, the upgrade package is compressed. After obtaining the compressed package, it will be stored locally first, and after receiving the upgrade instruction, the upgrade package will be decompressed first to obtain upgrade images corresponding to each partition to be upgraded.

[0038] S102. Determine the storage space required for each upgrade image.

[0039] In some embodiments, the storage space required for each upgrade image can be viewed through the command line. For example, the du command can be used to obtain the size of each image. The du command can specifically be du -h -max-depth=1 <partition_image_file>.

[0040] In some other embodiments, when making an upgrade package, the storage space required for each upgrade image is packaged and placed in the upgrade package, and the storage space required for each upgrade image is directly read from the upgrade package before each upgrade.

[0041] S103. Redivide all partitions based on the storage space required for each upgrade image.

[0042] Among them, during the Linux system upgrade process, the AB dual-partition upgrade method can be adopted, that is, the system is divided into two parts, A and B, and different system versions are run in the two parts respectively or used as a backup. During the upgrade, one part is used for updating, and the other part continues to provide services, so as to achieve seamless switching and rollback during system update and ensure system stability.

[0043] Before the upgrade, parts A and B can be respectively divided into multiple partitions, and all partitions are multiple partitions divided for the storage space of each part.

[0044] The storage space of multiple partitions can be determined based on the storage space required for the corresponding upgrade image. For example, if the storage space required for the upgrade image is 500M, then the storage space of the corresponding partition can be 500M, 550M, etc., which can avoid the waste of storage resources caused by the traditional fixed partition method.

[0045] This application proposes a partition space adjustment method, device, equipment and storage medium. The method includes: obtaining the upgrade image corresponding to each partition to be upgraded in the upgrade package; determining the storage space required for each upgrade image; and redividing all partitions based on the storage space required for each upgrade image. In the embodiments of this application, each partition is dynamically adjusted according to the actual partition size required for the current upgrade during each upgrade, reducing redundant space and making more efficient use of the storage space.

[0046] In some embodiments, the upgrade package includes a first upgrade package corresponding to a full-package upgrade. The first upgrade includes upgrade images corresponding to all partitions. Redividing all partitions based on the storage space required for each upgrade image includes: determining the first target storage space corresponding to each partition, where the first target storage space is greater than or equal to the storage space required for the corresponding upgrade image and less than the first preset storage space; and redividing all partitions based on each first target storage space.

[0047] As can be seen from the above, the upgrade package can include upgrade images corresponding to all partitions in the Linux system, that is, the upgrade package can be the first upgrade package corresponding to a full-package upgrade, that is, the upgrade package corresponding to each upgrade includes upgrade images corresponding to all partitions, that is, all partitions are considered to be partitions to be upgraded.

[0048] After receiving the first upgrade package, the upgrade images corresponding to all partitions in the first upgrade package can be obtained, and the storage space of the corresponding partitions can be determined based on the upgrade images. Among them, the first preset storage space can be the same as the storage space required for the corresponding upgrade image, or just greater than the storage space required for the corresponding upgrade image. For example, it can be 1.1 times, 1.2 times, etc. of the storage space required for the corresponding upgrade image.

[0049] After determining the first target storage spaces corresponding to all partitions respectively, the storage space of part A or part B is divided to obtain the divided target partitions. When the storage space of part A or part B is less than the sum of the storage spaces corresponding to all partitions, the free space of the Linux system is obtained, and part of the space is divided from the free space so that the storage space of part A or part B is greater than or equal to the sum of the storage spaces corresponding to all partitions, so as to complete the division of all partitions.

[0050] In some embodiments, the upgrade package includes a second upgrade package for differential upgrade. The second upgrade includes the upgrade images corresponding to the partitions to be upgraded. Based on the storage spaces required for each upgrade image respectively, all partitions are repartitioned, including: determining the second target storage spaces corresponding to all partitions to be upgraded respectively, where the second target storage space is greater than or equal to the storage space required for the corresponding upgrade image and less than the second preset storage space; obtaining the first original images corresponding to the other partitions respectively; determining the storage spaces required for the first original images corresponding to the other partitions respectively; determining the third target storage spaces corresponding to the other partitions respectively based on the storage spaces required for each first original image, where the third target storage space is greater than or equal to the storage space required for the corresponding first original image and less than the third preset storage space; repartitioning all partitions based on each second target storage space and each third target storage space.

[0051] As can be seen from the above, the upgrade package can include the upgrade images corresponding to the partitions to be upgraded respectively, that is, the upgrade package can be the second upgrade package for differential upgrade, and the second upgrade package does not include the upgrade images corresponding to all partitions, but only includes the upgrade images corresponding to the partitions to be upgraded.

[0052] After receiving the second upgrade package, the upgrade images corresponding to all partitions in the second upgrade package can be obtained, and the storage space of the corresponding partitions can be determined based on the upgrade images. Among them, the second preset storage space can be the same as the storage space required for the corresponding upgrade image, or just greater than the storage space required for the corresponding upgrade image. For example, it can be 1.1 times, 1.2 times, etc. of the storage space required for the corresponding upgrade image.

[0053] In addition, the first original image corresponding to each of the other partitions will be obtained; the storage space required for the first original image corresponding to each of the other partitions will be determined; the other partitions are the other partitions among all partitions except the partition to be upgraded, and the third target storage space corresponding to each of the other partitions will be determined based on the storage space required for each first original image, where the third preset storage space can be the same as the storage space required for the corresponding original image, or just greater than the storage space required for the corresponding original image, such as 1.1 times, 1.2 times, etc. of the storage space required for the corresponding original image.

[0054] After determining the target storage space corresponding to each partition, the storage space of part A or part B is divided to obtain the partitioned target partitions. When the storage space of part A or part B is less than the sum of the storage spaces corresponding to all partitions, the free space of the Linux system is obtained, and a part of the space is divided from the free space so that the storage space of part A or part B is greater than or equal to the sum of the storage spaces corresponding to all partitions, so as to complete the partitioning of all partitions.

[0055] In some embodiments, based on the storage space required for each upgrade image respectively, all partitions are repartitioned, including: unmounting the second original image corresponding to each partition respectively; deleting all partitions; partitioning multiple target partitions corresponding to the storage space required for each upgrade image respectively.

[0056] It can be understood that to repartition the partitions, the original partitions need to be cleared. Correspondingly, the second original image corresponding to each partition can be unmounted first, and all partitions can be deleted, that is, the storage space of all partitions is divided into a total storage space, and then the total storage space is further divided based on the storage space required for each upgrade image respectively to obtain multiple target partitions.

[0057] In some embodiments, the above operations can be performed through the command line. For example, the command line umount / dev / can be used. <device>Unmount the target partition to facilitate subsequent operations. You can use the parted tool and execute the command in the command line: parted / dev / <device>rm<part_num>Delete the partition you want to delete. You can use the parted tool and execute the command in the command line: parted / dev / <device>mkpart primary ext4 <start_size> <part_size> Recreate a new partition.

[0058] In some embodiments, the method further includes: formatting the re-partitioned target partition; inputting the upgrade images into their respective corresponding target partitions.

[0059] After partitioning the target partition, the re-partitioned target partition will be formatted to input the respective corresponding upgrade images into the target partition, and further input the upgrade images into their respective corresponding target partitions so that each target partition can implement the functions corresponding to the upgrade image.

[0060] Among them, the target partition can be reformatted through the mkfs tool to match the current system, using the command line command: mkfs.ext4 / dev / <device>Complete partition formatting.

[0061] In some embodiments, based on each second target storage space and each third target storage space, all partitions are repartitioned, including: when the sum of the storage spaces of each second target storage space and each third target storage space is greater than the original storage space of all partitions, obtaining free space; repartitioning based on the free space and the original storage space to obtain the target partitions obtained by repartitioning.

[0062] It can be understood that when the sum of the storage spaces of the target spaces obtained by repartitioning may be greater than the original storage space of all partitions, that is, when the sum of the storage spaces of each second target storage space and each third target storage space is greater than the original storage space of all partitions, free space is obtained, where the free space may be the storage space of other parts of the Linux system.

[0063] In some embodiments, the storage space of the Linux system is as Figure 2 shown. The Linux system includes partitions A and B. In addition, it also includes a variable data partition (var partition), a root file system partition (root partition), a swap partition (swap partition), etc. The images can be Kernel image, Rootfs image, opt image, etc. Each image corresponds to a target partition of partitions A and B. The free space can be one of the variable data partition, the root file system partition, and the swap partition. Since the main function of the variable data partition is to store variable data generated during system operation, such as log files, cache files, temporary files, mail queues, etc., therefore, when the storage spaces of partitions A and B are insufficient, the storage space can be preferentially obtained from the variable data partition as free space.

[0064] Furthermore, repartition the free space and the original storage space of partition A or B to obtain the target partitions obtained by repartitioning.

[0065] In some embodiments, the method further includes: obtaining the second original image corresponding to each partition; determining the storage space required for the second original image corresponding to each partition; determining the fourth target storage space corresponding to each partition based on the storage space required for each second original image, where the third target storage space is greater than or equal to the storage space required for the corresponding second original image and less than the fourth preset storage space; partitioning the partition of each second original image according to each fourth target storage space.

[0066] It can be understood that before the Linux system is upgraded, the partitions will be divided for the first time, that is, the second original image corresponding to each partition is obtained; the storage space required for the second original image corresponding to each partition is determined, and further, based on the storage space required for each second original image, the fourth target storage space corresponding to each partition is determined. Among them, the fourth preset storage space can be the same as the storage space required for the corresponding original image, or just larger than the storage space required for the corresponding original image. For example, it can be 1.1 times, 1.2 times, etc. of the storage space required for the corresponding original image. Each partition of the second original image is divided according to each fourth target storage space.

[0067] Since all partitions will be re-divided each time there is an upgrade, therefore, a large part of redundant storage space is reserved for each partition when dividing the partitions for the first time to ensure that the partition can meet the changes in the partition size brought about by future version changes. Therefore, redundant space can be reduced, making the storage space more fully utilized.

[0068] The embodiment of the present application also provides a partition space adjustment device, which is used to execute the partition space adjustment method provided in any of the above embodiments. As Figure 3 shown, the device includes: an acquisition module 301, a determination module 302, and a division module 303.

[0069] The acquisition module 301 is used to acquire the upgrade image corresponding to each partition to be upgraded in the upgrade package;

[0070] The determination module 302 is used to determine the storage space required for each of the upgrade images;

[0071] The division module 303 is used to re-divide all partitions based on the storage space required for each of the upgrade images.

[0072] The present application proposes a partition space adjustment method, device, device, and storage medium. The method includes: acquiring the upgrade image corresponding to each partition to be upgraded in the upgrade package; determining the storage space required for each upgrade image; and re-dividing all partitions based on the storage space required for each upgrade image. In the embodiment of the present application, each partition is dynamically adjusted according to the actual partition size required for each upgrade during each upgrade, reducing redundant space and making the storage space more fully utilized.

[0073] In some embodiments, the upgrade package includes a first upgrade package corresponding to a full-package upgrade. The first upgrade includes upgrade images corresponding to all partitions. The division module 303 is specifically used for:

[0074] Determine the first target storage space corresponding to each of the above-mentioned all partitions, where the first target storage space is greater than or equal to the storage space required for the corresponding upgrade image and less than the first preset storage space;

[0075] Based on each of the first target storage spaces, re-partition all the partitions.

[0076] In some embodiments, the upgrade package includes a second upgrade package corresponding to differential upgrade, and the second upgrade includes an upgrade image corresponding to the partition to be upgraded. The partitioning module 303 is further specifically configured to:

[0077] Determine the second target storage space corresponding to each of the above-mentioned all partitions to be upgraded, where the second target storage space is greater than or equal to the storage space required for the corresponding upgrade image and less than the second preset storage space;

[0078] Obtain the first original image corresponding to each of the other partitions;

[0079] Determine the storage space required for the first original image corresponding to each of the other partitions;

[0080] Based on the storage space required for each of the first original images, determine the third target storage space corresponding to each of the other partitions, where the third target storage space is greater than or equal to the storage space required for the corresponding first original image and less than the third preset storage space;

[0081] Based on each of the second target storage spaces and each of the third target storage spaces, re-partition all the partitions.

[0082] In some embodiments, the partitioning module 303 is further specifically configured to:

[0083] Uninstall the second original image corresponding to each of all the partitions;

[0084] Delete all the partitions;

[0085] Partition multiple target partitions corresponding to the storage space required for each of the upgrade images respectively.

[0086] In some embodiments, the above-mentioned device further includes: a formatting module, configured to:

[0087] Format the re-partitioned target partitions;

[0088] Input the upgrade images into their respective corresponding target partitions.

[0089] In some embodiments, the partitioning module 303 is further specifically configured to:

[0090] When the sum of the storage spaces of each of the second target storage spaces and each of the third target storage spaces is greater than the original storage space of all the partitions, obtain free space;

[0091] Redivide based on the free space and the original storage space to obtain redivided target partitions.

[0092] In some embodiments, the partitioning module 303 is further configured to:

[0093] Obtain the second original image corresponding to each of all the partitions;

[0094] Determine the storage space required for the second original image corresponding to each of all the partitions;

[0095] Based on the storage space required for each second original image, determine the fourth target storage space corresponding to each of all the partitions, where the third target storage space is greater than or equal to the storage space required for the corresponding second original image and less than the fourth preset storage space;

[0096] Partition the partitions of each second original image according to each fourth target storage space.

[0097] The embodiment of the present application also provides an electronic device to execute the above partition space adjustment method. Please refer to Figure 3 It shows a schematic diagram of an electronic device provided by some embodiments of the present application. As Figure 4 shown, the electronic device 5 includes: a processor 500, a memory 501, a bus 502, and a communication interface 503. The processor 500, the communication interface 503, and the memory 501 are connected through the bus 502; a computer program that can run on the processor 500 is stored in the memory 501, and when the processor 500 runs the computer program, it executes the partition space adjustment method provided by any of the foregoing embodiments of the present application.

[0098] Among them, the memory 501 may include a high-speed random access memory (RAM: Random Access Memory), and may also include a non-volatile memory, such as at least one disk memory. Through at least one communication interface 503 (which can be wired or wireless), a communication connection is realized between the device network element and at least one other network element, and the Internet, a wide area network, a local area network, a metropolitan area network, etc. can be used.

[0099] The bus 502 can be an ISA bus, a PCI bus, an EISA bus, or the like. The bus can be divided into an address bus, a data bus, a control bus, etc. Among them, the memory 501 is used to store programs. After receiving an execution instruction, the processor 500 executes the program. Any implementation manner of the partition space adjustment method disclosed in any embodiment of the present application can be applied to the processor 500 or implemented by the processor 500.

[0100] The processor 500 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit in the hardware of the processor 500 or the instructions in the form of software. The above-mentioned processor 500 can be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by the hardware decoding processor, or executed and completed by the combination of the hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory 501, and the processor 500 reads the information in the memory 501 and combines its hardware to complete the steps of the above method.

[0101] The electronic device provided in the embodiments of the present application and the partition space adjustment method provided in the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run, or implemented by them.

[0102] The embodiments of the present application also provide a computer-readable storage medium corresponding to the partition space adjustment method provided in the foregoing embodiments. Please refer to Figure 5 which shows that the computer-readable storage medium is an optical disc 60, on which a computer program (i.e., a program product) is stored. When the computer program is run by a processor, it will execute the partition space adjustment method provided in any of the foregoing embodiments.

[0103] It should be noted that examples of computer-readable storage media may also 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 optical and magnetic storage media, which will not be elaborated here one by one.

[0104] The computer-readable storage medium provided by the above embodiments of the present application and the partition space adjustment method provided by the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run, or implemented by the application programs stored therein.

[0105] It should be noted that:

[0106] In the specification provided here, a large number of specific details are described. However, it can be understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known structures and technologies are not shown in detail so as not to obscure the understanding of this specification.

[0107] Similarly, it should be understood that, in order to streamline the present application and help understand one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present application, the various features of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be construed as reflecting the following schematic: that the claimed present application requires more features than those expressly recited in each claim. Rather, as reflected in the following claims, the inventive aspects lie in less than all the features of the single embodiments disclosed above. Thus, the claims following the detailed description are hereby expressly incorporated into the detailed description, where each claim itself serves as a separate embodiment of the present application.

[0108] In addition, those skilled in the art can understand that although some of the embodiments herein include certain features included in other embodiments but not others, the combination of the features of different embodiments means that it is within the scope of the present application and forms different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.

[0109] The above is only the preferred specific embodiment of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.< / device> < / device> < / device> < / device>

Claims

1. A partition space adjustment method, characterized in that: include: Get the upgrade image corresponding to each partition to be upgraded in the upgrade package; Determine the storage space required for each of the upgrade images; All partitions are divided again based on the storage space required by each of the upgrade images.

2. The method according to claim 1, characterized in that The upgrade package includes a first upgrade package corresponding to the entire upgrade package, the first upgrade includes upgrade images corresponding to all partitions, and the re-dividing all partitions based on the storage space required by each of the upgrade images includes: Determine a first target storage space corresponding to each of the partitions, where the first target storage space is greater than or equal to a storage space required by the corresponding upgrade image and less than a first preset storage space; Based on each of the first target storage spaces, all partitions are divided again.

3. The method according to claim 1, characterized in that The upgrade package includes a second upgrade package corresponding to the differential upgrade, the second upgrade includes an upgrade image corresponding to the partition to be upgraded, and the re-dividing all partitions based on the storage space required by each of the upgrade images includes: Determine a second target storage space corresponding to each of the partitions to be upgraded, where the second target storage space is greater than or equal to a storage space required by the corresponding upgrade image and less than a second preset storage space; Obtain the first original images corresponding to other partitions; Determine the storage space required for the first original image corresponding to each of the other partitions; Determine the third target storage space corresponding to each of the other partitions based on the storage space required by each of the first original images, wherein the third target storage space is greater than or equal to the storage space required by the corresponding first original image and less than the third preset storage space; Based on each of the second target storage spaces and each of the third target storage spaces, all partitions are re-divided.

4. The method according to claim 1, characterized in that: The re-dividing all partitions based on the storage space required by each of the upgrade images includes: Uninstall the second original images corresponding to all partitions; Deleting all said partitions; A plurality of target partitions are divided corresponding to the storage space respectively required by each of the upgrade images.

5. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Format the repartitioned target partition; Import the upgrade images into their corresponding target partitions respectively.

6. The method according to claim 3, characterized in that The re-dividing all partitions based on each of the second target storage spaces and each of the third target storage spaces includes: When the sum of the storage spaces of each of the second target storage spaces and each of the third target storage spaces is greater than the original storage spaces of all the partitions, obtaining free space; The free space and the original storage space are repartitioned to obtain a repartitioned target partition.

7. The method according to claim 1, characterized in that The method further comprises: Obtain the second original image corresponding to each of all partitions; Determine the storage space required for the second original images corresponding to all the partitions; Determine the fourth target storage space corresponding to each of the partitions based on the storage space required by each of the second original images, wherein the third target storage space is greater than or equal to the storage space required by the corresponding second original image and less than the fourth preset storage space; Each partition of the second original image is divided according to each of the fourth target storage spaces.

8. A partition space adjustment method, characterized in that: include: The acquisition module is used to obtain the upgrade image corresponding to each partition to be upgraded in the upgrade package; A determination module, used to determine the storage space required for each of the upgrade images; The partitioning module is used to re-divide all partitions based on the storage space required by each of the upgrade images.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: The processor runs the computer program to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the method according to any one of claims 1 to 7.