EMMC storage system partition management methods, devices and terminal equipment
The EMMC partition management program can resize FATFS file system partitions without deleting file data, generate EMMC reserved partitions, and back up important files, solving the problem of file loss caused by partition adjustment in existing technologies, and improving device mass production efficiency and system recovery speed.
Patent Information
- Application Number
- CN202411910256.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2044-12-24
AI Technical Summary
Existing embedded system EMMC storage devices require deleting all file data in the FAT file system partition when modifying the partition size, resulting in the loss of user file information, inflexible partition size adjustment, and low mass production efficiency.
Without deleting the FAT file system partition data, the EMMC partition management program dynamically adjusts the size of the FATFS file system partition, generates an EMMC reserved partition and establishes a file index table, backs up important files to the reserved partition, and then reloads the file system.
It enables dynamic adjustment of the EMMC partition size without losing file data, improving the mass production efficiency of embedded devices and allowing for quick system boot recovery by reserving the EMMC partition.
Smart Images

Figure CN119847432B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus and terminal device for partition management of an EMMC storage system. Background Technology
[0002] In the field of smart wearable IoT, with the continuous increase in user demand, the data storage requirements of smart wearable devices are constantly growing. Ordinary single-chip FLASH (flash memory) storage can no longer meet the current data storage needs. Currently, mid-to-high-end smart wearable devices generally adopt a combination of FLASH + EMMC (Embedded Multi Media Card) to design embedded storage systems. FLASH is used to store the embedded system program firmware code, while EMMC is used to store user data and large-capacity data required by the device, such as offline map files, music files, firmware backup files, UI image files, etc. Embedded systems generally use embedded file systems, such as FAT (File Allocation Table) file systems, for file management of EMMC.
[0003] The FAT file system meets most of the file management needs of the large-capacity eMMC storage unit in smart wearable IoT devices. It also provides operations such as file system formatting, partition formatting, multi-file system management, file creation, deletion, opening, reading and writing, and directory creation, deletion, opening, and closing. Users can also customize whether the eMMC uses a single-file system partition or multi-file system partition management using the configuration file provided by the FAT file system. Users can flexibly set the size of the file system formatting partition during multi-file system partitioning through the program API interface provided by the FAT file system, or they can map the USB drive to a computer and use computer software to format the FAT file system partition.
[0004] Existing embedded system eMMC storage devices typically use the FAT file system for partition management. Software developers can modify the FAT file system configuration files and use the API interfaces provided by the FAT file system. The size of the eMMC partition needs to be determined at the initial stage of system design. If the size of the eMMC partition needs to be changed, the f_disk and f_mkfs interfaces are required to format the eMMC partition. However, formatting the partition will delete all file data in the FAT file system partition, resulting in the complete loss of the user's original stored file information. Summary of the Invention
[0005] The EMMC storage system partition management method, apparatus, and terminal device provided by this invention can re-partition EMMC without deleting file data in the FAT file system partition.
[0006] In a first aspect, the present invention provides a partition management method for an EMMC storage system, wherein the EMMC storage area includes a FATFS file system partition and an EMMC reserved partition, the FATFS file system partition including a FATFS partition in the MBR area and a FATFS partition in the DBR area, and the method includes:
[0007] After the firmware upgrade, the terminal device restarts and runs the EMMC partition management program in the firmware, mounting the FATFS file system. The upgraded firmware contains the EMMC partition management program.
[0008] Load data from sector 0 of the EMMC storage device and check if the current EMMC storage device system is performing the latest partitioning.
[0009] If the current EMMC storage device system is not performing the latest partitioning, then modify the FATFS partition size values of the MBR area and the DBR area to the preset FATFS partition size values in the upgraded firmware.
[0010] An EMMC reserved partition is generated in the storage area of the EMMC, and a file index table of the EMMC reserved partition is generated in the starting sector of the EMMC reserved partition;
[0011] Copy the files that need to be backed up from the FATFS file system to the EMMC reserved partition, and record the starting sector and file size of each file in the file index table;
[0012] Update the EMMC partition version number in the MBR area;
[0013] Unmount the current FATFS file system and remount the FATFS file system to boot the system.
[0014] Optionally, detecting whether the current EMMC storage device system is performing the latest partitioning includes:
[0015] Determine if the EMMC partition version number of the MBR area is the latest version number. If it is the latest version number, it means that the current EMMC storage device system is performing the latest partitioning. Otherwise, it means that the current EMMC storage device system is not performing the latest partitioning.
[0016] Optionally, modifying the FATFS partition size values of the MBR and DBR regions to the preset FATFS partition size values in the upgraded firmware includes:
[0017] The partition size of the FATFS file system is obtained by using the data structure after offset 446 bytes from sector 0 of the EMMC storage device, and the FATFS file system partition size value preset by the new firmware is written to the FATFS partition in the MBR area by the EMMC driver.
[0018] The system reads 512 bytes from the DBR area into the data buffer and writes the FATFS file system partition size value preset by the new firmware into the FATFS file system capacity data stored in the DBR area, thus completing the modification of the FATFS file system capacity.
[0019] Optionally, before loading the data from sector 0 of the EMMC storage device, the method further includes:
[0020] Determine if the used space of the FATFS file system is greater than the firmware's preset FATFS partition space size. If so, proceed with normal system startup; otherwise, execute the step of loading data from sector 0 of the EMMC storage device.
[0021] Optionally, the method further includes:
[0022] If the current EMMC storage device system is using the latest partitioning, there is no need to repartition the EMMC and the system can boot normally.
[0023] Optionally, the first 446 bytes of the MBR area store at least the starting sector address, partition size, partition version number, and checksum of the partition information of the EMMC reserved partition.
[0024] Secondly, the present invention provides an EMMC storage system partition management device, wherein the EMMC storage area includes a FATFS file system partition and an EMMC reserved partition, the FATFS file system partition including a FATFS partition in the MBR area and a FATFS partition in the DBR area, and the device includes:
[0025] The mounting unit is used to run the EMMC partition management program in the firmware and mount the FATFS file system after the terminal device restarts following a firmware upgrade. The upgraded firmware contains the EMMC partition management program.
[0026] The detection unit is used to load data from sector 0 of the EMMC storage device and detect whether the current EMMC storage device system is performing the latest partitioning.
[0027] The modification unit is used to modify the FATFS partition size values of the MBR area and the DBR area to the preset FATFS partition size values in the upgraded firmware if the current EMMC storage device system is not performing the latest partitioning.
[0028] The generation unit is used to generate an EMMC reserved partition in the storage area of the EMMC and generate a file index table of the EMMC reserved partition in the starting sector of the EMMC reserved partition;
[0029] The backup unit is used to copy the files that need to be backed up in the FATFS file system to the EMMC reserved partition, and record the starting sector and file size of each file in the file index table;
[0030] The update unit is used to update the EMMC partition version number of the MBR area;
[0031] The reload unit is used to unload the current FATFS file system and reload it to start the system.
[0032] Optionally, the detection unit is used to determine whether the EMMC partition version number of the MBR area is the latest version number. If it is the latest version number, it indicates that the current EMMC storage device system is performing the latest partitioning; otherwise, it indicates that the current EMMC storage device system is not performing the latest partitioning.
[0033] Optionally, the modification unit is used to obtain the partition size data of the FATFS file system through the data structure after the data offset of 446 bytes from sector 0 of the EMMC storage device, and write the FATFS file system partition size value preset by the new firmware into the FATFS partition in the MBR area through the EMMC driver; read 512 bytes from the DBR area into the data buffer, and write the FATFS file system partition size value preset by the new firmware into the FATFS file system capacity data stored in the DBR area, thereby completing the modification of the FATFS file system capacity.
[0034] Thirdly, the present invention provides a terminal device, the terminal device comprising:
[0035] At least one processor; and
[0036] A memory communicatively connected to the at least one processor; wherein,
[0037] The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the EMMC storage system partition management method described above.
[0038] The EMMC storage system partition management method, apparatus, and terminal device provided in this invention can dynamically modify the size of the FATFS file system and re-partition the EMMC without deleting file data in the FAT file system partition. In addition, an EMMC reserved partition is extended outside the FATFS file system, an EMMC reserved partition file index table is established, and files that need to be backed up in the FATFS file system are copied to the EMMC reserved partition. The basic files required for system startup and operation can be restored through the EMMC reserved partition. Since the access speed of the EMMC reserved partition is faster than that of the embedded FATFS file system, the efficiency of mass production of embedded devices can be improved. Attached Figure Description
[0039] Figure 1 This is a flowchart of an EMMC storage system partition management method according to an embodiment of the present invention;
[0040] Figure 2 This is a schematic diagram of the EMMC storage partition management hierarchy provided in an embodiment of the present invention;
[0041] Figure 3 This is a schematic diagram showing the dynamic modification of the storage partition using EMMC before and after, as provided in an embodiment of the present invention.
[0042] Figure 4 This is a flowchart of another embodiment of the EMMC storage system partition management method of the present invention;
[0043] Figure 5 This is a schematic diagram of the structure of an EMMC storage system partition management device according to an embodiment of the present invention. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0045] The existing FAT file system, when formatting a partition without using a multi-file system partition configuration, defaults to using the entire capacity of the eMMC as the FAT file system partition. This lacks flexibility in configuring the size of the FAT file system partition and reserving some storage space on the eMMC. Furthermore, large-capacity eMMCs for embedded devices typically have capacities of 16GB or 32GB. During mass production, the eMMC needs to be image-programmed. However, since mass-produced embedded devices usually use a single-chip eMMC, data is batch-programmed onto the eMMC chip at the chip programming factory before the eMMC chip is soldered onto the embedded device board. But the eMMC typically only needs a small amount of data, about 1GB. The FAT file system is located at the beginning of the eMMC partition, while the reserved backup partition is at the end. If the eMMC's FAT file system partition data and reserved partition data are simultaneously programmed into the eMMC during mass production, the entire 16GB or 32GB eMMC image needs to be programmed. However, only about 2GB of this image may contain valid data. Therefore, the mass production process spends a significant amount of time programming invalid data, resulting in low efficiency in eMMC mass production.
[0046] Based on this, this application sets up an EMMC storage partition management module on the basis of the embedded FATFS file system, which dynamically adjusts the size of the FATFS file system partitions while retaining the original FATFS file system. This EMMC storage partition management module provides functions for dynamically adjusting the size of FATFS file system partitions on the EMMC storage device, the size of EMMC reserved partitions, and EMMC reserved partition read / write access management. In the later stages of use, due to changes in storage partition requirements, it is necessary to dynamically adjust the partition size while retaining the original file data within the FATFS file system. In this case, firmware upgrades can be performed via OTA (Over The Air). The new firmware includes an EMMC partition management program that dynamically modifies the FATFS file system partition size and generates an EMMC reserved partition during the first boot after the OTA firmware upgrade. Alternatively, during the EMMC data burning process on the embedded device, only valid data from the FATFS partition can be burned. When the embedded device is powered on for the first time, the EMMC storage partition management module will first adjust the size of the FATFS file system partition, expand the EMMC reserved partition, establish an EMMC reserved partition file index table, and copy the files that need to be backed up from the FATFS file system to the EMMC reserved partition, thereby improving the efficiency of mass production of embedded devices.
[0047] This invention provides a partition management method for an EMMC storage system. The EMMC storage area includes a FATFS file system partition and an EMMC reserved partition. The FATFS file system partition includes a FATFS partition in the MBR area and a FATFS partition in the DBR area. Figure 1 As shown, the method includes:
[0048] S11. After the firmware upgrade, the terminal device restarts and runs the EMMC partition management program in the firmware to mount the FATFS file system. The upgraded firmware contains the EMMC partition management program.
[0049] S12. Load the data from sector 0 of the EMMC storage device and check whether the current EMMC storage device system is performing the latest partitioning.
[0050] S13. If the current EMMC storage device system is not performing the latest partitioning, then modify the FATFS partition size values of the MBR area and the DBR area to the preset FATFS partition size values in the upgraded firmware.
[0051] S14. Generate an EMMC reserved partition in the storage area of the EMMC, and generate a file index table for the EMMC reserved partition in the starting sector of the EMMC reserved partition.
[0052] S15. Copy the files that need to be backed up in the FATFS file system to the EMMC reserved partition, and record the starting sector and file size of each file in the file index table.
[0053] S16. Update the EMMC partition version number of the MBR area.
[0054] S17. Unmount the current FATFS file system and remount the FATFS file system to start the system.
[0055] The EMMC storage system partition management method provided in this invention can dynamically modify the size of the FATFS file system and re-partition the EMMC without deleting file data in the FAT file system partition. In addition, an EMMC reserved partition is extended outside the FATFS file system, an EMMC reserved partition file index table is established, and files that need to be backed up in the FATFS file system are copied to the EMMC reserved partition. The basic files required for system startup and operation can be restored through the EMMC reserved partition. Since the access speed of the EMMC reserved partition is faster than that of the embedded FATFS file system, the efficiency of mass production of embedded devices can be improved.
[0056] The EMMC storage system partition management method of the present invention will be described in detail below with reference to specific embodiments.
[0057] like Figure 2 The diagram illustrates the EMMC storage partition management hierarchy. An EMMC storage partition management module is set up on top of the embedded FATFS file system. While retaining the original FATFS file system, the size of the FATFS file system partitions is dynamically adjusted. Above the EMMC storage partition management module is the user application layer, used to run user applications; below the EMMC storage partition management module is the EMMC storage device driver layer, used to run the drivers for the EMMC storage devices.
[0058] The embedded FATFS file system typically uses partitions that cover all storage areas of the EMMC, whereas in this application, such as Figure 3 As shown, an EMMC reserved partition is extended on top of the FATFS file system partition to store the basic file data of the embedded system. This is used to recover the basic files required for the embedded system to boot and run after formatting the FATFS file system in the event of an unrecoverable crash of the embedded FATFS file system. This avoids the problem of all data loss and unrecoverable data loss, as well as the inability of the embedded system to boot properly, caused by formatting the FATFS file system. At the same time, the EMMC reserved partition can also serve as a file storage area for fast data access, offering faster access speeds than the embedded FATFS file system.
[0059] like Figure 4 As shown, the EMMC storage system partition management method provided in this embodiment of the invention includes the following steps:
[0060] S201. The firmware of the terminal device is upgraded using OTA, and the upgraded firmware contains an EMMC partition management program.
[0061] S202. The terminal device restarts and first runs the EMMC partition management program in the firmware to mount the FATFS file system.
[0062] S203. Determine whether the space used by the FATFS file system is greater than the preset FATFS partition space size in the firmware. If yes, proceed to step S214; otherwise, proceed to step S204.
[0063] S204. The EMMC partition management program first reads the data in sector 0 of the EMMC storage device through the EMMC driver and enters it into the MCU cache.
[0064] In an EMMC storage device where a FATFS file system already exists and is running normally, sector 0 (MBR sector) records the starting address of the DBR (Dual Boundary Block) area of the FATFS file system, as well as the size and number of FATFS file system partitions. Since the remote embedded device uses internal Flash as the boot program storage device, and the EMMC, as an external storage device, is not used for system boot program storage, the first 446 bytes of sector 0 (MBR area) of the EMMC can be used to store information such as the starting sector address, partition size, partition version number, and checksum of the partition information for the backup partition retained by the EMMC storage device.
[0065] S205. By reading the data of sector 0 of the EMMC storage device, determine whether the current EMMC storage device system is performing the latest partitioning; if yes, proceed to step S214; otherwise, proceed to step S206.
[0066] Specifically, the system determines whether the EMMC storage device system is performing the latest partitioning by reading the EMMC partition version number of the MBR area. If it is the latest version number, it means that the current EMMC storage device system is performing the latest partitioning and does not need to re-partition the EMMC; the system can start normally directly. Otherwise, it means that the current EMMC storage device system is not performing the latest partitioning and needs to re-partition the EMMC.
[0067] S206. Modify the FATFS partition size value of the MBR area.
[0068] By using the data structure after offset 446 bytes from sector 0 of the EMMC storage device, the partition size of the FATFS file system is obtained. The EMMC driver then writes the FATFS file system partition size value preset by the new firmware into the FATFS partition in the MBR area and obtains the sector offset address of the DBR area of the FATFS file system.
[0069] S207. Modify the FATFS partition size value of the DBR area.
[0070] The 512 bytes of the DBR area are read into the data buffer, and the FATFS file system size value stored in the firmware is written into the FATFS file system capacity data stored in the DBR area, thus completing the modification of the FATFS file system capacity.
[0071] S208. Generate an EMMC reserved partition in the storage area of the EMMC, and generate the basic information and file index table of the EMMC reserved partition in the starting sector of the EMMC reserved partition.
[0072] S209. Copy the files that need to be backed up in the FATFS file system to the EMMC reserved partition.
[0073] The files that need to be backed up include basic map data files, configuration files required for system startup, and built-in music files, but are not limited to these.
[0074] S210. Record the starting sector, file size, and other information of each file into the file index table of the starting sector of the EMMC reserved partition.
[0075] S211. Determine whether all files to be backed up have been copied. If not, return to steps S209-S210; otherwise, proceed to step S212.
[0076] S212. Update the EMMC partition version number of the MBR area.
[0077] Update the EMMC partition version number of the MBR area so that after a subsequent firmware upgrade, the EMMC partition version number of the MBR area can be used to determine whether EMMC partitioning needs to be re-dismantled.
[0078] S213. Unload the original FATFS file system and reload the FATFS file system, so that the system capacity and other data of the FATFS file system are updated.
[0079] S214. Enter normal system startup.
[0080] This invention also provides an EMMC storage system partition management device, wherein the EMMC storage area includes a FATFS file system partition and an EMMC reserved partition, and the FATFS file system partition includes a FATFS partition in the MBR area and a FATFS partition in the DBR area, such as... Figure 5 As shown, the device includes:
[0081] The mounting unit 11 is used to run the EMMC partition management program in the firmware and mount the FATFS file system after the terminal device restarts following the firmware upgrade. The upgraded firmware contains the EMMC partition management program.
[0082] Detection unit 12 is used to load data from sector 0 of the EMMC storage device and detect whether the current EMMC storage device system is performing the latest partitioning.
[0083] Modification unit 13 is used to modify the FATFS partition size values of the MBR area and the DBR area to the preset FATFS partition size values in the upgraded firmware if the current EMMC storage device system is not performing the latest partitioning.
[0084] The generation unit 14, connected to the modification unit 13, is used to generate an EMMC reserved partition in the storage area of the EMMC after the modification unit 13 modifies the FATFS partition size value of the MBR area and the FATFS partition size value of the DBR area to the preset FATFS partition size value in the upgraded firmware, and to generate an EMMC reserved partition file index table in the starting sector of the EMMC reserved partition.
[0085] Backup unit 15, connected to generation unit 14, is used to copy the files that need to be backed up in the FATFS file system to the EMMC reserved partition, and record the starting sector and file size of each file in the file index table;
[0086] Update unit 16, connected to backup unit 15, is used to update the EMMC partition version number of the MBR area;
[0087] The reload unit 17, connected to the update unit 16, is used to unload the current FATFS file system and reload the FATFS file system to start the system.
[0088] The EMMC storage system partition management device provided in this invention can dynamically modify the size of the FATFS file system and re-partition the EMMC without deleting file data in the FAT file system partition. In addition, an EMMC reserved partition is extended outside the FATFS file system, an EMMC reserved partition file index table is established, and files that need to be backed up in the FATFS file system are copied to the EMMC reserved partition. The basic files required for system startup and operation can be restored through the EMMC reserved partition. Since the access speed of the EMMC reserved partition is faster than that of the embedded FATFS file system, the efficiency of mass production of embedded devices can be improved.
[0089] Optionally, the detection unit 12 is used to determine whether the EMMC partition version number of the MBR area is the latest version number. If it is the latest version number, it indicates that the current EMMC storage device system is performing the latest partitioning; otherwise, it indicates that the current EMMC storage device system is not performing the latest partitioning.
[0090] Optionally, the modification unit 13 is used to obtain the partition size data of the FATFS file system through the data structure after the data offset of 446 bytes from sector 0 of the EMMC storage device, and write the FATFS file system partition size value preset by the new firmware into the FATFS partition in the MBR area through the EMMC driver; read 512 bytes from the DBR area into the data buffer, and write the FATFS file system partition size value preset by the new firmware into the FATFS file system capacity data stored in the DBR area, thereby completing the modification of the FATFS file system capacity.
[0091] The apparatus in this embodiment can be used to execute the technical solutions of the above method embodiments. Its implementation principle and technical effects are similar, and will not be repeated here.
[0092] This invention also provides a terminal device, the terminal device comprising:
[0093] At least one processor; and
[0094] A memory communicatively connected to the at least one processor; wherein,
[0095] The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the EMMC storage system partition management method described above.
[0096] Those skilled in the art will understand that all or part of the processes in the above method embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0097] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A partition management method for an EMMC storage system, characterized in that, The EMMC storage area includes a FATFS file system partition, which includes a FATFS partition in the MBR area and a FATFS partition in the DBR area. The method includes: After the firmware upgrade, the terminal device restarts and runs the EMMC partition management program in the firmware, mounting the FATFS file system. The upgraded firmware embeds the EMMC partition management program. Load data from sector 0 of the EMMC storage device and check if the current EMMC storage device system is performing the latest partitioning. If the current EMMC storage device system is not performing the latest partitioning, then the FATFS partition size value of the MBR area and the FATFS partition size value of the DBR area will be modified to the preset FATFS partition size value in the upgraded firmware. An EMMC reserved partition is generated in the storage area of the EMMC, and a file index table of the EMMC reserved partition is generated in the starting sector of the EMMC reserved partition; Copy the files that need to be backed up in the FATFS file system to the EMMC reserved partition, and record the starting sector and file size of each file in the file index table; Update the EMMC partition version number of the MBR area; Unmount the current FATFS file system and remount the FATFS file system to boot the system.
2. The method according to claim 1, characterized in that, The step of detecting whether the current EMMC storage device system is performing the latest partitioning includes: Determine whether the EMMC partition version number of the MBR area is the latest version number. If it is the latest version number, it indicates that the current EMMC storage device system is performing the latest partitioning. Otherwise, it indicates that the current EMMC storage device system is not performing the latest partitioning.
3. The method according to claim 1, characterized in that, The step of modifying the FATFS partition size values of the MBR area and the DBR area to the preset FATFS partition size values in the upgraded firmware includes: The partition size of the FATFS file system is obtained by using the data structure after offset 446 bytes from sector 0 of the EMMC storage device, and the FATFS file system partition size value preset by the new firmware is written to the FATFS partition in the MBR area by the EMMC driver. The 512 bytes of the DBR area are read into the data buffer, and the FATFS file system partition size value preset by the new firmware is written into the FATFS file system capacity data stored in the DBR area, thus completing the modification of the FATFS file system capacity.
4. The method according to any one of claims 1 to 3, characterized in that, Before loading the data from sector 0 of the EMMC storage device, the method further includes: Determine whether the space used by the FATFS file system is greater than the preset FATFS partition space size in the firmware. If so, proceed with normal system startup; otherwise, execute the step of loading data from sector 0 of the EMMC storage device.
5. The method according to any one of claims 1 to 3, characterized in that, The method further includes: If the current EMMC storage device system is performing the latest partitioning, then there is no need to repartition the EMMC and the system can boot normally.
6. The method according to any one of claims 1 to 3, characterized in that, The first 446 bytes of the MBR area store at least the starting sector address, partition size, partition version number, and checksum of the partition information of the EMMC reserved partition.
7. A partition management device for an EMMC storage system, characterized in that, The EMMC's storage area includes a FATFS file system partition, which includes a FATFS partition in the MBR area and a FATFS partition in the DBR area. The device includes: The mounting unit is used to run the EMMC partition management program in the firmware and mount the FATFS file system after the terminal device restarts following a firmware upgrade. The upgraded firmware contains the EMMC partition management program. The detection unit is used to load data from sector 0 of the EMMC storage device and detect whether the current EMMC storage device system is performing the latest partitioning. The modification unit is used to modify the FATFS partition size value of the MBR area and the FATFS partition size value of the DBR area to the preset FATFS partition size value in the upgraded firmware if the current EMMC storage device system is not performing the latest partitioning. The generation unit is used to generate an EMMC reserved partition in the storage area of the EMMC and generate a file index table of the EMMC reserved partition in the starting sector of the EMMC reserved partition; The backup unit is used to copy the files that need to be backed up in the FATFS file system to the EMMC reserved partition, and record the starting sector and file size of each file in the file index table; The update unit is used to update the EMMC partition version number of the MBR area; The reload unit is used to unload the current FATFS file system and reload it to start the system.
8. The apparatus according to claim 7, characterized in that, The detection unit is used to determine whether the EMMC partition version number of the MBR area is the latest version number. If it is the latest version number, it indicates that the current EMMC storage device system is performing the latest partitioning; otherwise, it indicates that the current EMMC storage device system is not performing the latest partitioning.
9. The apparatus according to claim 7, characterized in that, The modification unit is used to obtain the partition size data of the FATFS file system through the data structure after the data offset of 446 bytes from sector 0 of the EMMC storage device, and write the FATFS file system partition size value preset by the new firmware into the FATFS partition of the MBR area through the EMMC driver; read 512 bytes of the DBR area into the data buffer, and write the FATFS file system partition size value preset by the new firmware into the FATFS file system capacity data stored in the DBR area, thereby completing the modification of the FATFS file system capacity.
10. A terminal device, characterized in that, The terminal device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 6.
Citation Information
Patent Citations
Flash memory with data retention partition
CN104769678A
Dynamic partition customization method and device, equipment and computer readable storage medium
CN112416359A