Storage space expansion method and device, electronic equipment, medium and program product
By adjusting partitioning strategies in different states of electronic devices and optimizing subpartition structure, the problem of user data partition space is solved, the user data partitioning is expanded, and the user experience is improved.
Patent Information
- Application Number
- CN202410102275.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-24
- Publication Date
- 2025-07-29
AI Technical Summary
In the prior art, the available storage space of the user data partition of the electronic device is limited, making it difficult to meet the growing storage needs and poor user experience.
Different partitioning strategies are implemented in different states of electronic devices, and the partition structure is optimized by dividing part of the space in the dynamic partition as idle space to the user data partition, including adjusting the protection boundary, interval space and sorting strategies of the subpartitions.
It realizes the storage space expansion of user data partitions in a specific state, meets the storage needs of more user data and improves user experience.
Smart Images

Figure CN120386480A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of storage, and in particular to a method, apparatus, electronic device, medium and program product for expanding storage space. Background Art
[0002] In recent years, with the rapid development of storage technologies, storage devices such as Embedded Multi MediaCard (EMMC) have been widely used in many electronic devices due to their small size and low power consumption. An electronic device is usually divided into multiple different partitions, including a user data partition for storing user data and a dynamic partition for storing system data.
[0003] However, partitioning an electronic device using the methods of related technologies is restricted by the system firmware and further expanded by application programs, resulting in an increasingly small available storage space in the user data partition, making it difficult to meet the storage requirements of user data and providing a poor user experience. Summary of the Invention
[0004] To overcome the problems existing in the related technologies, the present disclosure provides a method, apparatus, electronic device, medium and program product for expanding storage space.
[0005] According to a first aspect of an embodiment of the present disclosure, a method for expanding storage space is provided. The method for expanding storage space includes:
[0006] Responding to the system of the electronic device being in a first state, and executing a first partitioning policy on the electronic device;
[0007] Responding to the system of the electronic device being in a second state, and executing a second partitioning policy on the electronic device;
[0008] Wherein, a part of the space in the dynamic partition determined by the second partitioning policy is divided into the user data partition as idle space in the first partitioning policy.
[0009] In some embodiments of the present disclosure, the dynamic partition includes multiple sub-partitions;
[0010] Executing the first partitioning policy on the electronic device includes: the protection boundary of each sub-partition is a first protection boundary, and the first protection boundary is used to represent the maximum space of each sub-partition under the first partitioning policy;
[0011] Executing the second partitioning policy on the electronic device includes: the protection boundary of each sub-partition is a second protection boundary, and the second protection boundary is used to represent the maximum space of each sub-partition under the second partitioning policy;
[0012] The second protection boundary is greater than the first protection boundary.
[0013] In some embodiments of the present disclosure, the idle space includes a first space that is the difference between the second protection boundary and the first protection boundary of each of the sub - partitions.
[0014] In some embodiments of the present disclosure, the dynamic partition includes a plurality of sub - partitions;
[0015] Performing a first partitioning strategy on the electronic device includes: there is a first interval space between adjacent sub - partitions;
[0016] Performing a second partitioning strategy on the electronic device includes: there is a second interval space between adjacent sub - partitions;
[0017] The first interval space is smaller than the second interval space.
[0018] In some embodiments of the present disclosure, the idle space includes a second space that is the difference between the second interval space and the first interval space.
[0019] In some embodiments of the present disclosure, the dynamic partition includes a plurality of sub - partitions;
[0020] Performing a first partitioning strategy on the electronic device includes: re - sorting at least some of the sub - partitions based on a preset sorting strategy;
[0021] Performing a second partitioning strategy on the electronic device includes setting each of the sub - partitions according to the system default layout.
[0022] In some embodiments of the present disclosure, the preset sorting strategy includes:
[0023] Each of the sub - partitions is sorted in ascending order of partition space; or,
[0024] Each of the sub - partitions is sorted in descending order of partition space.
[0025] In some embodiments of the present disclosure, the idle space includes a third space generated by re - sorting at least some of the sub - partitions according to the preset sorting strategy.
[0026] In some embodiments of the present disclosure, the first state is the power - on startup state, and the second state is the over - the - air download state.
[0027] In some embodiments of the present disclosure, the electronic device further includes a first static partition and a second static partition. The dynamic partition includes a first virtual partition corresponding to the first static partition and a second virtual partition corresponding to the second static partition. The first virtual partition and the second virtual partition are used to perform the over-the-air download process;
[0028] The idle space includes the partition space of the spare partition in the first virtual partition and the second virtual partition.
[0029] In some embodiments of the present disclosure, after performing a first partitioning strategy on the electronic device, the storage space expansion method further includes:
[0030] Storing the cold data of the electronic device in the idle space.
[0031] According to a second aspect of the embodiments of the present disclosure, there is provided a storage space expansion device, including:
[0032] A first execution module, configured to perform a first partitioning strategy on the electronic device in response to the system of the electronic device being in a first state;
[0033] A second execution module, configured to perform a second partitioning strategy on the electronic device in response to the system of the electronic device being in a second state;
[0034] Wherein, a part of the space in the dynamic partition determined by the second partitioning strategy is divided into the user data partition as idle space in the first partitioning strategy.
[0035] According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device, including:
[0036] A processor;
[0037] A memory for storing instructions executable by the processor;
[0038] Wherein, the processor is configured to:
[0039] Perform a first partitioning strategy on the electronic device in response to the system of the electronic device being in a first state;
[0040] Perform a second partitioning strategy on the electronic device in response to the system of the electronic device being in a second state;
[0041] Wherein, a part of the space in the dynamic partition determined by the second partitioning strategy is divided into the user data partition as idle space in the first partitioning strategy.
[0042] According to a fourth aspect of the embodiments of the present disclosure, a non-transitory computer-readable storage medium is provided. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute a storage space expansion method, and the storage space expansion method includes:
[0043] In response to the system of the electronic device being in a first state, performing a first partitioning policy on the electronic device;
[0044] In response to the system of the electronic device being in a second state, performing a second partitioning policy on the electronic device;
[0045] Wherein, a part of the space in the dynamic partition determined by the second partitioning policy is divided into the user data partition as idle space in the first partitioning policy.
[0046] According to a fifth aspect of the embodiments of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, it realizes:
[0047] In response to the system of the electronic device being in a first state, performing a first partitioning policy on the electronic device;
[0048] In response to the system of the electronic device being in a second state, performing a second partitioning policy on the electronic device;
[0049] Wherein, a part of the space in the dynamic partition determined by the second partitioning policy is divided into the user data partition as idle space in the first partitioning policy.
[0050] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects: By performing different partitioning policies on the electronic device when the system of the electronic device is in different states, it is possible to divide a part of the space in the dynamic partition in the second state into the user data partition as idle space when the system is in the first state, so that the storage space of the user data partition is expanded in the first state relative to the second state, meeting the storage requirement of storing more user data and improving the user experience.
[0051] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present invention, and are used together with the specification to explain the principles of the present invention.
[0053] Figure 1 It is a schematic diagram of the partition layout of an electronic device in the related art.
[0054] Figure 2 is a flowchart of a storage space expansion method shown according to an exemplary embodiment.
[0055] Figure 3 is a schematic diagram of a partition layout of an electronic device shown according to an exemplary embodiment.
[0056] Figure 4 is a test chart of storage space expansion results.
[0057] Figure 5 is a flowchart of a storage space expansion method shown according to another exemplary embodiment.
[0058] Figure 6 is a block diagram of a storage space expansion device shown according to an exemplary embodiment.
[0059] Figure 7 is a block diagram of an electronic device shown according to an exemplary embodiment.
[0060] In the figure:
[0061] 10 - First execution module; 20 - Second execution module; 101 - Processing component; 102 - Memory; 103 - Power component; 104 - Multimedia component; 105 - Audio component; 106 - Input / output interface; 107 - Sensor component; 108 - Communication component; 109 - Processor. Detailed implementation manners
[0062] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all the implementation manners consistent with the present invention. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0063] In recent years, with the rapid development of storage technologies and devices, more and more storage devices such as embedded memories have characteristics such as small volume and low power consumption, making storage devices widely used in different electronic devices such as mobile phones, tablet computers, and smart bracelets to implement the data storage function of the electronic devices. Refer to Figure 1 As shown, an electronic device is usually divided into multiple different partitions, including a user data partition for storing user data and a dynamic partition for storing system data.
[0064] However, when partitioning an electronic device using related methods, due to the limitations of the system firmware and the further expansion of the space occupied by application programs, the available storage space in the user data partition is getting smaller and smaller, making it difficult to meet the growing storage needs of user data and resulting in a poor user experience.
[0065] Based on this, the exemplary embodiments of the present disclosure provide a storage space expansion method. By executing different partitioning policies on the electronic device when the system of the electronic device is in different states, it is possible to divide a part of the space in the dynamic partition in the second state as idle space into the user data partition when the system is in the first state, so that the storage space of the user data partition is expanded relative to the second state when the system is in the first state, meeting the storage needs of storing more user data and improving the user experience.
[0066] In an exemplary embodiment, a storage space expansion method is provided, which is applied to an electronic device. The electronic device can be, for example, a mobile phone, a tablet computer, a smart bracelet, etc. The electronic device includes storage devices such as an embedded memory. Refer to Figure 2 As shown, the storage space expansion method includes:
[0067] S100. In response to the system of the electronic device being in the first state, execute the first partitioning policy on the electronic device.
[0068] In step S100, the first state can be, for example, the power-on startup state or the initialization state of the system. The electronic device can detect and identify the current state of the system. When the system of the electronic device is in the first state, execute the first partitioning policy on the electronic device to divide each partition of the electronic device in the first state. Exemplarily, the first partitioning policy can be executed on the electronic device by determining the logical addresses corresponding to each partition to define each partition of the electronic device in the first state.
[0069] S200. In response to the system of the electronic device being in the second state, execute the second partitioning policy on the electronic device.
[0070] In step S200, the second state can be, for example, the over-the-air (OTA) state of the system. When the system of the electronic device is in the second state, remote management of the electronic device and the subscriber identity module (SIM) card in the electronic device can be achieved through the air interface of mobile communication, enabling the electronic device to update the system through the over-the-air technology. The electronic device can detect and identify the current state of the system. When the system of the electronic device is in the second state, a second partitioning strategy is executed on the electronic device. Exemplarily, the second partitioning strategy can be executed on the electronic device by changing the logical addresses corresponding to each partition to define each partition of the electronic device in the second state.
[0071] Among them, a part of the space in the dynamic partition determined by the second partitioning strategy is used as idle space in the first partitioning strategy and is divided into the user data partition.
[0072] In each partition divided by executing the first partitioning strategy or the second partitioning strategy on the electronic device, both include a dynamic partition (super) and a user data partition (user data). When the electronic device is in the first state or the second state, the sum of the storage spaces of the dynamic partition and the user data partition is a fixed value. When executing the first partitioning strategy on the electronic device, a part of the space in the dynamic partition defined when executing the second partitioning strategy can be used as idle space and divided into the user data partition, so that the storage space of the user data partition of the electronic device in the first state is expanded compared with the second state to store more user data.
[0073] Exemplarily, a part of the space in the dynamic partition determined by the second partitioning strategy is space that is not storing data and is available when the system of the electronic device is in the first state. When executing the first partitioning strategy on the electronic device, this part of the space can be determined as idle space, and the idle space can be divided from the dynamic partition to which it belongs in the related art to the user data partition by changing the logical address of this part of the space.
[0074] It should be noted that the partition situation formed by executing the second partitioning strategy on the electronic device can be, for example, the same as the partition situation of the related art shown in Figure 1 As shown in the reference Figure 3 The storage space of the dynamic partition determined by executing the first partitioning strategy on the electronic device is smaller than the storage space of the dynamic partition of the related art or determined by the second partitioning strategy, and the storage space of the user data partition determined by executing the first partitioning strategy on the electronic device is larger than the storage space of the user data partition of the related art or determined by the second partitioning strategy.
[0075] In this embodiment, by implementing different partitioning policies for the electronic device when the system of the electronic device is in different states, it is possible to divide some of the space in the dynamic partition in the second state as idle space into the user data partition when the system is in the first state, so that the storage space of the user data partition is expanded relative to the second state when the system is in the first state, meeting the storage requirement of storing more user data and improving the user experience.
[0076] In some embodiments, the dynamic partition includes multiple sub - partitions. Implementing the first partitioning policy for the electronic device includes: the protection boundary of each sub - partition is the first protection boundary, and the first protection boundary is used to represent the maximum space of each sub - partition under the first partitioning policy. Implementing the second partitioning policy for the electronic device includes: the protection boundary of each sub - partition is the second protection boundary, and the second protection boundary is used to represent the maximum space of each sub - partition under the second partitioning policy, and the second protection boundary is greater than the first protection boundary.
[0077] Among them, the dynamic partition may, for example, include sub - partitions such as Figure 3 shown as "system", "vendor", "product", etc. Different sub - partitions are used to store different types of system data. The protection boundary of each sub - partition is the maximum space of each sub - partition, that is, the upper limit value of the data amount that can be written. When the data amount written into a sub - partition reaches the protection boundary, the write operation to this sub - partition will be blocked to protect the data in the sub - partition.
[0078] When implementing the first partitioning policy for the electronic device, the protection boundary of each sub - partition can be determined as the first protection boundary. When implementing the second partitioning policy for the electronic device, the protection boundary of each sub - partition can be determined as the second protection boundary, and the second protection boundary is greater than the first protection boundary. Since the first protection boundary and the second protection boundary respectively represent the maximum space of each sub - partition under the first partitioning policy and the second partitioning policy, the maximum space of each sub - partition in the first state of the system of the electronic device is less than the maximum space of each sub - partition in the second state, so as to shorten the occupied space of the sub - partition itself when implementing the first partitioning policy relative to the second partitioning policy.
[0079] Exemplarily, for example, by changing the Global Unique Identifier Partition Table (GPT) and the logical addresses of each sub - partition, the first protection boundary and the second protection boundary can be defined when implementing the first partitioning policy and the second partitioning policy. The first protection boundary can be, for example, 4096KB, and the second protection boundary can be, for example, 65536KB.
[0080] In this embodiment, by implementing the first partitioning policy and the second partitioning policy, the protection boundaries of each sub-partition can be defined as the first protection boundary and the second protection boundary respectively, and the second protection boundary is set to be greater than the first protection boundary, so that the maximum space of each sub-partition determined by the first partitioning policy is less than the maximum space of each sub-partition determined by the second partitioning policy, thereby reducing the overall space of the dynamic partition of the electronic device in the first state and realizing the expansion of the storage space of the user data partition.
[0081] In some embodiments, the idle space includes a first space that is the difference between the second protection boundary and the first protection boundary of each sub-partition.
[0082] As described above, the second protection boundary of each sub-partition determined by the second partitioning policy is greater than the first protection boundary of each sub-partition determined by the first partitioning policy, that is, the maximum space of each sub-partition of the system of the electronic device in the first state is less than the maximum space of each sub-partition of the system of the electronic device in the second state. The second protection boundary corresponding to each sub-partition of the second partitioning policy and the first protection boundary corresponding to the first partitioning policy have a difference of the first space. The first space is the space that is not storing data and is available when the system of the electronic device is in the first state. When the first partitioning policy is executed on the electronic device, the first space can be determined as at least part of the idle space, and the first space can be divided into the user data partition to store more user data.
[0083] In this embodiment, the second protection boundary and the first protection boundary of each sub-partition have a difference of the first space. By using the first space as the idle space, the first space that is not storing data can be divided into the user data partition when the first partitioning policy is executed on the electronic device. When the system is in the first state, the storage space of the user data partition is expanded relative to the second state, meeting the storage requirement of storing more user data and improving the user experience.
[0084] In some embodiments, the dynamic partition includes multiple sub-partitions as described above. Executing the first partitioning policy on the electronic device includes: there is a first interval space between adjacent sub-partitions. Executing the second partitioning policy on the electronic device includes: there is a second interval space between adjacent sub-partitions, and the first interval space is less than the second interval space.
[0085] Among them, there is a certain interval space between adjacent sub - partitions. The interval space is used to prevent the logical addresses of adjacent sub - partitions from conflicting, so as to protect the data of the sub - partitions. When the first partition policy is executed on the electronic device, the interval space between adjacent sub - partitions can be determined as the first interval space. When the second partition policy is executed on the electronic device, the interval space between adjacent sub - partitions can be determined as the second interval space, and the first interval space is set to be smaller than the second interval space, so that the interval space between adjacent sub - partitions in the first state of the electronic device system is smaller than the interval space between adjacent sub - partitions in the second state, so as to shorten the space between adjacent sub - partitions relative to the second partition when the first partition policy is executed.
[0086] Exemplarily, for example, by changing the globally unique identifier partition table and the logical addresses of each sub - partition, the definition of the first interval space and the second interval space can be realized when the first partition policy and the second partition policy are executed. The first interval space can be, for example, 0.
[0087] In this embodiment, by executing the first partition policy and the second partition policy, the interval space between adjacent sub - partitions can be respectively defined as the first interval space and the second interval space, and the first interval space is set to be smaller than the second interval space, which can make the interval space between adjacent sub - partitions determined by the first partition policy smaller than the interval space between adjacent sub - partitions determined by the second partition policy. Thus, the overall space of the dynamic partition of the electronic device in the first state can be reduced, and the storage space of the user data partition can be expanded.
[0088] In some embodiments, the idle space includes the second space by which the second interval space differs from the first interval space.
[0089] As mentioned above, the first interval space between adjacent sub - partitions determined by the first partition policy is smaller than the second interval space between adjacent sub - partitions determined by the second partition policy, that is, the interval space between adjacent sub - partitions in the first state of the electronic device system is smaller than the interval space between adjacent sub - partitions in the second state of the electronic device system. The second interval space corresponding to the second partition policy between adjacent sub - partitions and the first interval space corresponding to the first partition policy have a different second space. The second space is the space that is not storing data and can be used when the electronic device system is in the first state. When the first partition policy is executed on the electronic device, the second space can be determined as at least part of the idle space, and the second space can be divided into the user data partition to store more user data.
[0090] In this embodiment, the second interval space between adjacent sub - partitions and the first interval space have a different second space. By using the second space as an idle space, when the first partitioning strategy is executed on the electronic device, the second space without stored data can be partitioned into the user data partition. When the system is in the first state, the storage space of the user data partition is expanded relative to the second state, meeting the storage requirement of storing more user data and improving the user experience.
[0091] In some embodiments, the dynamic partition includes a plurality of sub - partitions as described above. Executing the first partitioning strategy on the electronic device includes: re - sorting at least some of the sub - partitions based on a preset sorting strategy. Executing the second partitioning strategy on the electronic device includes setting each sub - partition according to the system default layout.
[0092] Among them, a certain degree of alignment needs to be ensured between the multiple sub - partitions included in the dynamic partition, so that each sub - partition can be consistent with the request size for input / output. If the sub - partitions are not correctly aligned, the operating efficiency of the Device - mapper kernel module that abstracts the physical device into a logical device will be reduced. Therefore, when setting each sub - partition according to the system default layout, due to the large difference in the space size between sub - partitions and the limitation of the sub - partition setting method, each sub - partition needs to include a large alignment space for alignment.
[0093] When executing the first partitioning strategy on the electronic device, at least some of the sub - partitions can be re - sorted according to the preset sorting strategy. When executing the second partitioning strategy on the electronic device, each sub - partition can be set according to the system default layout. Since the re - sorted sub - partitions have a certain regularity, the alignment space required for each sub - partition determined by the first partitioning strategy is no longer large, while the sub - partitions determined by the second partitioning strategy are still set according to the system default layout, so a large alignment space is still required. This makes the alignment space required for each sub - partition in the first state of the electronic device system less than that in the second state, so as to shorten the alignment space required for sub - partitions when executing the first partitioning strategy relative to the second partitioning strategy. Exemplarily, for example, the system default layout can be judged, and a suitable preset sorting strategy can be selected to re - sort at least some of the sub - partitions by the preset sorting strategy when executing the first partitioning strategy.
[0094] In this embodiment, by executing the first partitioning strategy and the second partitioning strategy, the sub - partitions can be set according to the preset sorting strategy and the system default layout respectively, and the alignment space required for the sub - partitions determined by the first partitioning strategy is less than that required for the sub - partitions determined by the second partitioning strategy, so that the overall space of the dynamic partition in the first state of the electronic device can be reduced, realizing the expansion of the storage space of the user data partition.
[0095] In some embodiments, the preset sorting strategy includes: sorting the sub - partitions in ascending order of the partition space, or sorting the sub - partitions in descending order of the partition space.
[0096] In this embodiment, when re - sorting at least some of the sub - partitions according to the preset sorting strategy, the sub - partitions can be sorted in ascending or descending order of the partition space through a preset algorithm, so that the difference in the space size of adjacent sub - partitions is reduced, thereby enabling each sub - partition to ensure alignment between partitions without requiring a large alignment space, providing a basis for determining the idle space.
[0097] In some embodiments, the idle space includes a third space generated by re - sorting at least some of the sub - partitions according to the preset sorting strategy.
[0098] As mentioned above, the alignment space required for the sub - partitions set according to the system default layout is greater than the alignment space required for the sub - partitions re - sorted according to the preset sorting strategy, that is, the alignment space required for the sub - partitions in the first state of the electronic device system is less than the maximum space required for the sub - partitions in the second state of the electronic device system. There is a third space difference between the alignment space required for each sub - partition corresponding to the second partition strategy and the alignment space required for the first partition strategy, that is, the third space generated by re - sorting according to the preset sorting strategy. The third space is space that is not storing data and is available when the electronic device system is in the first state. When implementing the first partition strategy for the electronic device, the third space can be determined as at least part of the idle space and divided into the user data partition to store more user data.
[0099] In this embodiment, after re - sorting at least some of the sub - partitions according to the preset sorting strategy, a third space is generated compared with the system default layout. By using the third space as the idle space, when implementing the first partition strategy for the electronic device, the third space that is not storing data can be divided into the user data partition, realizing an expansion of the storage space of the user data partition in the first state of the system compared with the second state, meeting the storage requirement of storing more user data, and improving the user experience.
[0100] In some embodiments, the first state is the power - on startup state, and the second state is the over - the - air (OTA) download state.
[0101] When the electronic device system is in the power - on startup state, it is necessary to expand the storage space of the user data partition through the first partition strategy. When the electronic device system is in the OTA download state, the idle space determined by the first partition strategy needs to be used for OTA download services such as system updates, and the idle space needs to be re - divided into the dynamic partition to ensure the normal progress of OTA downloads.
[0102] Exemplarily, when the system of the electronic device is in the boot-up state, a first partitioning policy is executed on the electronic device to divide a part of the space in the dynamic partition determined by the second partitioning policy as idle space into the user data partition to expand the storage space of the user data partition. When the system of the electronic device is in the over-the-air (OTA) download state, a second partitioning policy is executed on the electronic device to re-divide the idle space into the dynamic partition to implement OTA download services such as system updates.
[0103] In this embodiment, by taking the boot-up state as the first state and the OTA download state as the second state, when the system is in the boot-up state, a part of the space in the dynamic partition in the OTA download state can be divided as idle space into the user data partition, so that the system can achieve an expansion of the storage space of the user data partition relative to the OTA download after boot-up, meet the storage requirement of storing more user data, and ensure the normal execution of OTA downloads, improving the user experience.
[0104] In some embodiments, the electronic device further includes a first static partition and a second static partition. The dynamic partition includes a first virtual partition corresponding to the first static partition and a second virtual partition corresponding to the second static partition. The first virtual partition and the second virtual partition are used to execute the OTA download process. The idle space includes the partition space of the spare partitions in the first virtual partition and the second virtual partition.
[0105] Refer to Figure 3 As shown, in addition to the dynamic partition and the user data partition, the electronic device further includes a basic partition, a first static partition, i.e., static partition A, and a second static partition, i.e., static partition B. The first static partition may include partitions such as "recovery_a" and "vbmeta_a", and the second static partition may include partitions such as "recovery_b" and "vbmeta_b". The first static partition and the second static partition are used to store fixed system data.
[0106] The dynamic partition includes a first virtual partition corresponding to the first static partition and a second virtual partition corresponding to the second static partition. The first virtual partition and the second virtual partition are used to execute the OTA download process. When the electronic device is not performing the OTA download process, one of the first virtual partition and the second virtual partition is used to store the original data, and the other partition in the first virtual partition and the second virtual partition stores no data and is used as a spare partition to store updated data during the OTA download process to implement system updates.
[0107] When the system of the electronic device is in the boot-up state, a first partitioning policy is executed on the electronic device, and the partition spaces of the spare partitions in the first virtual partition and the second virtual partition are used as idle spaces and partitioned into the user data partition to expand the storage space of the user data partition. When the system of the electronic device is in the over-the-air (OTA) download state, a second partitioning policy is executed on the electronic device, and the spare partitions in the first virtual partition and the second virtual partition are repartitioned into the dynamic partition to ensure the existence of the partition spaces of the spare partitions to enable the OTA download process.
[0108] In this embodiment, using the partition spaces of the spare partitions in the first virtual partition and the second virtual partition as idle spaces can partition the partition spaces of the spare partitions without stored data into the user data partition when the first partitioning policy is executed on the electronic device. When the system is in the boot-up state, the storage space of the user data partition is expanded relative to the OTA download state, meeting the storage requirement of storing more user data and improving the user experience. When the electronic device is in the OTA download state, by executing the second partitioning policy, the partition spaces of the spare partitions are repartitioned into the dynamic partition, ensuring the normal progress of the OTA download process.
[0109] In some embodiments, after executing the first partitioning policy on the electronic device, the storage space expansion method further includes: storing the cold data of the electronic device in the idle space.
[0110] The cold data of the electronic device can be data that has not been accessed for a long time or data with low usage requirements determined by the user according to usage needs. Exemplarily, for example, data in the user data partition whose time difference between the current moment and the most recent access moment is greater than a preset value can be used as cold data, or data with a preset identifier added by the user can be used as cold data.
[0111] After determining the idle space partitioned into the user data partition after executing the first partitioning policy on the electronic device, the cold data of the electronic device can be stored in the idle space to release the storage space originally occupied by the cold data, thereby increasing the available storage space in the user data partition. It should be noted that storing the cold data in the idle space does not change the physical address of the cold data itself, but realizes the pointing of the cold data to the idle space by establishing a mapping relationship between the physical address of the cold data and the logical address of the idle space.
[0112] In this embodiment, by storing the cold data of the electronic device in the idle space determined by the first partitioning policy, that is, filling and reusing the idle space with cold data when the OTA download process is not in progress, the storage space originally occupied by the cold data can be released, the available storage space in the user data partition can be expanded, the storage requirement of storing more user data can be met, and the user experience can be improved.
[0113] It should be noted that when implementing the first partitioning policy for the electronic device, any one or a combination of the partitioning spaces of the first space, the second space, the third space, and the spare partition can be used as idle space and partitioned into the user data partition. Exemplarily, Figure 4 It is a test chart for the storage space expansion result. Figure 4 On the horizontal axis is the storage space of the user data partition, with the unit of GB, and on the vertical axis are different partitioning policies. Among them, Policy A represents the partitioning policy of the related technology or the second partitioning policy executed when the system of the electronic device is in the second state, Policy B represents the first partitioning policy when the third space is used as idle space, and Policy C represents the first partitioning policy when the partitioning spaces of the first space, the second space, the third space, and the spare partition are all used as idle space. From Figure 3 it can be seen that by reordering the sub - partitions, the storage space of the user data partition can be expanded by about 800 MB, and by using the first partitioning policy when the partitioning spaces of the first space, the second space, the third space, and the spare partition are all used as idle space, the storage space of the user data partition can be expanded by about 1.3 GB.
[0114] In an exemplary embodiment, referring to Figure 5 as shown, a storage space expansion method is provided. The storage space expansion method includes:
[0115] S1. In response to the system of the electronic device being in the boot - up state, set the protection boundary of each sub - partition as the first protection boundary and determine the first space;
[0116] S2. Set the space between adjacent sub - partitions as the first interval space and determine the second space;
[0117] S3. Based on a preset sorting policy, re - order at least some of the sub - partitions and determine the third space;
[0118] S4. Determine the partitioning space of the spare partition in the first virtual partition and the second virtual partition as the fourth space;
[0119] S5. Determine any one or a combination of the first space, the second space, the third space, and the fourth space as idle space and partition it into the user data partition;
[0120] S6. Store the cold data of the electronic device in the idle space;
[0121] S7. In response to the system of the electronic device being in the over - the - air download state, set the protection boundary of each sub - partition as the second protection boundary, and the second protection boundary is greater than the first protection boundary;
[0122] S8. Set the space between adjacent sub - partitions as the second interval space, and the first interval space is less than the second interval space;
[0123] S9. Set each sub - partition according to the system default layout method;
[0124] S10. Divide the partition spaces of the spare partitions in the first virtual partition and the second virtual partition into the dynamic partition.
[0125] In this embodiment, by executing different partition strategies on the electronic device when the system of the electronic device is in different states, it is possible to divide some of the space in the dynamic partition in the second state as idle space into the user data partition when the system is in the first state, so that the storage space of the user data partition is expanded relative to the second state when the system is in the first state, meeting the storage requirement of storing more user data and improving the user experience.
[0126] In an exemplary embodiment, a storage space expansion device is provided. Refer to Figure 6 As shown, the storage space expansion device includes a first execution module 10 and a second execution module 20. The first execution module 10 is configured to execute a first partition strategy on the electronic device in response to the system of the electronic device being in the first state. The second execution module 20 is configured to execute a second partition strategy on the electronic device in response to the system of the electronic device being in the second state. A part of the space in the dynamic partition determined by the second partition strategy is used as idle space and divided into the user data partition in the first partition strategy.
[0127] In this embodiment, by the first execution module 10 and the second execution module 20 executing different partition strategies on the electronic device when the system of the electronic device is in different states, it is possible to divide some of the space in the dynamic partition in the second state as idle space into the user data partition when the system is in the first state, so that the storage space of the user data partition is expanded relative to the second state when the system is in the first state, meeting the storage requirement of storing more user data and improving the user experience.
[0128] In one embodiment, the dynamic partition includes multiple sub - partitions. The first execution module 10 is further configured to: the protection boundary of each sub - partition is the first protection boundary, and the first protection boundary is used to represent the maximum space of each sub - partition under the first partition strategy. The second execution module 20 is further configured to: the protection boundary of each sub - partition is the second protection boundary, and the second protection boundary is used to represent the maximum space of each sub - partition under the second partition strategy, and the second protection boundary is greater than the first protection boundary.
[0129] In one embodiment, the idle space includes the first space by which the second protection boundary of each sub - partition differs from the first protection boundary.
[0130] In one embodiment, the dynamic partition includes a plurality of sub - partitions. The first execution module 10 is further configured to: there is a first spacing space between adjacent sub - partitions. The second execution module 20 is further configured to: there is a second spacing space between adjacent sub - partitions, and the first spacing space is smaller than the second spacing space.
[0131] In one embodiment, the idle space includes a second space which is the difference between the second spacing space and the first spacing space.
[0132] In one embodiment, the dynamic partition includes a plurality of sub - partitions. The first execution module 10 is further configured to: re - sort at least some of the sub - partitions based on a preset sorting strategy. The second execution module 20 is further configured to: set each sub - partition according to the system default layout method.
[0133] In one embodiment, the preset sorting strategy includes: the sub - partitions are sorted in ascending order of partition space; or, the sub - partitions are sorted in descending order of partition space.
[0134] In one embodiment, the idle space includes a third space generated by re - sorting at least some of the sub - partitions according to the preset sorting strategy.
[0135] In one embodiment, the first state is the power - on startup state, and the second state is the over - the - air (OTA) download state.
[0136] In one embodiment, the electronic device further includes a first static partition and a second static partition. The dynamic partition includes a first virtual partition corresponding to the first static partition and a second virtual partition corresponding to the second static partition. The first virtual partition and the second virtual partition are used to execute the over - the - air download process. The idle space includes the partition space of the spare partitions in the first virtual partition and the second virtual partition.
[0137] In some embodiments, the storage space expansion device further includes a storage module, and the storage module is used to store the cold data of the electronic device in the idle space.
[0138] In an exemplary embodiment, an electronic device is provided. The electronic device can be, for example, a mobile phone, a tablet computer, a smart bracelet and other devices.
[0139] Reference Figure 7 As shown, the electronic device may include one or more of the following components: a processing component 101, a memory 102, a power component 103, a multimedia component 104, an audio component 105, an input / output (I / O) interface 106, a sensor component 107, and a communication component 108.
[0140] The processing component 101 generally controls the overall operation of the electronic device, such as operations associated with display, telephone calls, data communication, camera operations, and recording operations. The processing component 101 may include one or more processors 109 to execute instructions to complete all or part of the steps of the above methods. In addition, the processing component 101 may include one or more modules to facilitate the interaction between the processing component 101 and other components. For example, the processing component 101 may include a multimedia module to facilitate the interaction between the multimedia component 104 and the processing component 101.
[0141] The memory 102 is configured to store various types of data to support the operation of the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phone book data, messages, pictures, videos, etc. The memory 102 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disks, or optical disks.
[0142] The power component 103 supplies power to various components of the electronic device. The power component 103 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device.
[0143] The multimedia component 104 includes a screen that provides an output interface between the electronic device and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can not only sense the boundaries of touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 104 includes a front camera and / or a rear camera. When the electronic device is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0144] The audio component 105 is configured to output and / or input audio signals. For example, the audio component 105 includes a microphone (MIC) that is configured to receive external audio signals when the electronic device is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 102 or transmitted via the communication component 108. In some embodiments, the audio component 105 further includes a speaker for outputting audio signals.
[0145] The I / O interface 106 provides an interface between the processing component 101 and a peripheral interface module, and the peripheral interface module can be a keyboard, a click wheel, buttons, etc. These buttons can include but are not limited to: a home button, a volume button, a power button, and a lock button.
[0146] The sensor component 107 includes one or more sensors for providing status assessments of various aspects of the electronic device. For example, the sensor component 107 can detect the on / off state of the electronic device, the relative positioning of components, such as the display and keypad of the electronic device, and the sensor component 107 can also detect a change in the position of the electronic device or a component of the electronic device, the presence or absence of user contact with the electronic device, the orientation or acceleration / deceleration of the electronic device, and the temperature change of the electronic device. The sensor component 107 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor component 107 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 107 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0147] The communication component 108 is configured to facilitate communication between the electronic device and other devices in a wired or wireless manner. The device can access a wireless network based on a communication standard, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 108 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 108 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0148] In an exemplary embodiment, the electronic device may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components for performing the above-described method for expanding the storage space of the electronic device.
[0149] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as the memory 102 including instructions. The above instructions can be executed by the processor 109 of the electronic device to complete the above-described method for expanding the storage space of the electronic device. For example, the non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc. When the instructions in the storage medium are executed by the processor 109 of the electronic device, the electronic device is enabled to execute the storage space expansion method shown in the above embodiments.
[0150] In an exemplary embodiment, a computer program product is also provided. The computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the storage space expansion method shown in the above embodiments are implemented.
[0151] Those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present invention, which follow the general principles of the present invention and include common general knowledge or conventional technical means in the technical field not disclosed in this disclosure. The specification and embodiments are only to be considered exemplary, and the true scope and spirit of the present invention are pointed out by the following claims.
[0152] It should be understood that the present invention is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present invention is only limited by the appended claims.
Claims
1. A method for expanding storage space, characterized in that, The storage space expansion method includes: In response to the system of the electronic device being in the first state, performing a first partitioning policy on the electronic device; In response to the system of the electronic device being in the second state, performing a second partitioning policy on the electronic device; Wherein, a part of the space in the dynamic partition determined by the second partitioning policy is divided into the user data partition as idle space in the first partitioning policy.
2. The storage space expansion method according to claim 1, wherein The dynamic partition includes multiple sub - partitions; Performing the first partitioning policy on the electronic device includes: the protection boundary of each sub - partition is the first protection boundary, and the first protection boundary is used to represent the maximum space of each sub - partition under the first partitioning policy; Performing the second partitioning policy on the electronic device includes: the protection boundary of each sub - partition is the second protection boundary, and the second protection boundary is used to represent the maximum space of each sub - partition under the second partitioning policy; The second protection boundary is greater than the first protection boundary.
3. The storage space expansion method according to claim 2, wherein The idle space includes a first space which is the difference between the second protection boundary and the first protection boundary of each sub - partition.
4. The storage space expansion method according to claim 1, characterized in that The dynamic partition includes multiple sub - partitions; Performing the first partitioning policy on the electronic device includes: there is a first interval space between adjacent sub - partitions; Performing the second partitioning policy on the electronic device includes: there is a second interval space between adjacent sub - partitions; The first interval space is less than the second interval space.
5. The storage space expansion method according to claim 4, wherein The idle space includes a second space which is the difference between the second interval space and the first interval space.
6. The storage space expansion method according to claim 1, wherein The dynamic partition includes multiple sub - partitions; Performing the first partitioning policy on the electronic device includes: re - sorting at least part of the sub - partitions based on a preset sorting policy; Performing the second partitioning policy on the electronic device includes: setting each sub - partition according to the system default arrangement method.
7. The storage space expansion method according to claim 6, wherein The preset sorting policy includes: Each sub - partition is sorted in ascending order of partition space; or, Each sub - partition is sorted in descending order of partition space.
8. The storage space expansion method according to claim 6, wherein The idle space includes a third space generated by re - sorting at least part of the sub - partitions by the preset sorting policy.
9. The storage space expansion method according to claim 1, wherein The first state is the power - on startup state, and the second state is the over - the - air download state.
10. The storage space expansion method according to claim 9, wherein The electronic device further includes a first static partition and a second static partition. The dynamic partition includes a first virtual partition corresponding to the first static partition and a second virtual partition corresponding to the second static partition. The first virtual partition and the second virtual partition are used to perform the over - the - air download process; The idle space includes the partition space of the spare partitions in the first virtual partition and the second virtual partition.
11. The storage space expansion method according to any one of claims 1-10, characterized in that, After performing the first partitioning policy on the electronic device, the storage space expansion method further includes: Storing the cold data of the electronic device in the idle space.
12. A storage space expansion device, characterized in that, The storage space expansion device includes: A first execution module, which is used to perform a first partitioning policy on the electronic device in response to the system of the electronic device being in the first state; A second execution module, which is used to execute a second partitioning policy on the electronic device in response to the system of the electronic device being in a second state; Among them, a part of the space in the dynamic partition determined by the second partitioning policy is divided into the user data partition as idle space in the first partitioning policy.
13. An electronic device, characterized in that, The electronic device includes: A processor; A memory for storing processor-executable instructions; Among them, the processor is configured to: Execute a first partitioning policy on the electronic device in response to the system of the electronic device being in a first state; Execute a second partitioning policy on the electronic device in response to the system of the electronic device being in a second state; Among them, a part of the space in the dynamic partition determined by the second partitioning policy is divided into the user data partition as idle space in the first partitioning policy.
14. A non-transitory computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is enabled to execute a storage space expansion method, and the storage space expansion method includes: Execute a first partitioning policy on the electronic device in response to the system of the electronic device being in a first state; Execute a second partitioning policy on the electronic device in response to the system of the electronic device being in a second state; Among them, a part of the space in the dynamic partition determined by the second partitioning policy is divided into the user data partition as idle space in the first partitioning policy.
15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it realizes: Execute a first partitioning policy on the electronic device in response to the system of the electronic device being in a first state; Execute a second partitioning policy on the electronic device in response to the system of the electronic device being in a second state; Among them, a part of the space in the dynamic partition determined by the second partitioning policy is divided into the user data partition as idle space in the first partitioning policy.