EMMC (Embedded Multi Media Card) storage system partition management method and device and terminal equipment
By introducing EMMC reserved partitions and file index tables into EMMC storage devices, dynamically adjusting the partition size of the FATFS file system, solving the problem of file data loss caused by partition size modification in the existing technology, achieving efficient partition management of EMMC storage system, and improving the efficiency of mass production of embedded devices.
Patent Information
- Application Number
- CN202411910256.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-12-24
AI Technical Summary
When existing embedded system EMMC storage devices need to format the partition when they need to re-modify the partition size, resulting in the loss of all file data stored by the user.
By introducing EMMC reserved partitions and file index tables into EMMC storage devices, the FATFS file system partition size is dynamically adjusted without deleting file data. The specific steps include mounting the FATFS file system, detecting the partition version number, modifying the partition size, generating EMMC reserved partition and file index table, and copying the files that need to be backed up to the EMMC reserved partition.
It realizes dynamically modifying the FATFS file system size and re-partitioning EMMC partition without deleting the FAT file system partition file data, which improves the efficiency of mass production of embedded devices.
Smart Images

Figure CN119847432A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an EMMC storage system partition management method, device and terminal equipment. Background Art
[0002] In the field of smart wearable IoT, with the continuous increase in user demand, the demand for data storage in smart wearable devices is increasing. Ordinary single-chip FLASH (flash memory) storage can no longer meet the current data storage needs. At present, mid-to-high-end smart wearable devices generally use FLASH+EMMC (Embedded Multi Media Card) to design embedded storage systems. FLASH is used to store embedded system program firmware code, and 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 picture files, etc. Embedded systems generally use embedded file systems for EMMC file management, such as FAT (File Allocation Table) file system.
[0003] The FAT file system meets most of the file management requirements of the EMMC large-capacity storage unit in smart wearable IoT devices, and also provides file system formatting, formatted partitions, multi-file system management, file creation, deletion, opening, reading and writing, and file directory creation, deletion, opening, closing, etc. At the same time, users can also use the configuration file provided by the FAT file system to customize EMMC to use single file system partition or multi-file system partition management. Users can flexibly set the size of the file system formatted partition in the multi-file system partition process through the program API interface provided by the FAT file system, and can also map to the computer through the USB drive letter and use the computer software to format the FAT file system partition.
[0004] Existing embedded system EMMC storage devices usually use FAT file system for partition management. Software developers can modify the configuration files of FAT file system and use the API interface provided by FAT file system. The size of EMMC partition needs to be determined in the early stage of system design. If the size of EMMC partition needs to be modified again, the f_disk and f_mkfs interfaces need to be used to format the EMMC partition. The operation of formatting the partition will delete all file data in the FAT file system partition, resulting in the loss of all file information originally stored by the user. Summary of the invention
[0005] The EMMC storage system partition management method, device and terminal equipment provided by the present invention can re-partition the EMMC without deleting file data in the FAT file system partition.
[0006] In a first aspect, the present invention provides an EMMC storage system partition management method, wherein the storage area of the EMMC includes a FATFS file system partition and an EMMC reserved partition, and the FATFS file system partition includes a FATFS partition in an MBR area and a FATFS partition in a DBR area, and the method includes:
[0007] After the firmware is upgraded, the terminal device is restarted, the EMMC partition management program in the firmware is run, and the FATFS file system is mounted, wherein the EMMC partition management program is embedded in the upgraded firmware;
[0008] Load the data of sector 0 of the EMMC storage device to detect whether the current EMMC storage device system is performing the latest partition division;
[0009] If the current EMMC storage device system does not perform the latest partition division, the FATFS partition size value in the MBR area and the FATFS partition size value in the DBR area are modified to the FATFS partition size value preset in the upgraded firmware;
[0010] 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;
[0011] Copy the files 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;
[0012] Update the EMMC partition version number in the MBR area;
[0013] Unmount the current FATFS file system, remount the FATFS file system, and start the system.
[0014] Optionally, the detecting whether the partition division currently performed by the EMMC storage device system is the latest includes:
[0015] Determine whether the EMMC partition version number in the MBR area is the latest version number. If it is the latest version number, it indicates that the current EMMC storage device system executes the latest partition division. Otherwise, it indicates that the current EMMC storage device system does not execute the latest partition division.
[0016] Optionally, modifying the FATFS partition size value in the MBR area and the FATFS partition size value in the DBR area to a FATFS partition size value preset in the upgraded firmware includes:
[0017] The partition size data of the FATFS file system is obtained through the data structure after the data offset 446 bytes of the 0th sector of the EMMC storage device, and the FATFS file system partition size value preset by the new firmware is written into the FATFS partition in the MBR area through the EMMC driver;
[0018] 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 saved in the DBR area to complete the modification of the FATFS file system capacity.
[0019] Optionally, before loading the data of sector 0 of the EMMC storage device, the method further includes:
[0020] Determine whether the used space of the FATFS file system is greater than the FATFS partition space size preset by the firmware. If so, enter the normal system startup. Otherwise, execute the step of loading the data of sector 0 of the EMMC storage device.
[0021] Optionally, the method further comprises:
[0022] If the current EMMC storage device system executes the latest partition division, there is no need to re-partition the EMMC and enter normal system startup.
[0023] Optionally, the first 446 bytes of the MBR area store at least the starting sector address of the EMMC reserved partition, the partition size, the partition version number and the check code of the partition information.
[0024] In a second aspect, the present invention provides an EMMC storage system partition management device, wherein the storage area of the EMMC includes a FATFS file system partition and an EMMC reserved partition, wherein the FATFS file system partition includes a FATFS partition in an MBR area and a FATFS partition in a DBR area, and the device includes:
[0025] The mounting unit is used to restart the terminal device after the firmware is upgraded, run the EMMC partition management program in the firmware, and mount the FATFS file system, wherein the upgraded firmware is embedded with the EMMC partition management program;
[0026] The detection unit is used to load the data of sector 0 of the EMMC storage device and detect whether the partition division currently executed by the EMMC storage device system is the latest one;
[0027] 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 FATFS partition size value preset in the upgraded firmware if the current EMMC storage device system does not perform the latest partition division;
[0028] A generating unit, used for generating an EMMC reserved partition in the storage area of the EMMC, and generating a file index table of the EMMC reserved partition in the starting sector of the EMMC reserved partition;
[0029] A backup unit, used for copying the files to be backed up in the FATFS file system to the EMMC reserved partition, and recording the starting sector and file size of each file in the file index table;
[0030] An update unit, used to update the EMMC partition version number in the MBR area;
[0031] The reload unit is used to unload the current FATFS file system and reload the FATFS file system 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 executes the latest partition division, otherwise it indicates that the current EMMC storage device system does not execute the latest partition division.
[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 446 bytes of 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 in 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 saved in the DBR area to complete the modification of the FATFS file system capacity.
[0034] In a third aspect, 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, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned EMMC storage system partition management method.
[0038] The EMMC storage system partition management method, device and terminal device provided by the embodiment of the present invention can dynamically modify the size of the FATFS file system and re-partition the EMMC without deleting the file data in the FAT file system partition; in addition, an EMMC reserved partition is expanded 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, and basic files required for system startup and operation are restored through the EMMC reserved partition. Since the access speed of the EMMC reserved partition is faster than the access speed of the embedded FATFS file system, the efficiency of mass production of embedded devices can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A flowchart of a partition management method for an EMMC storage system according to an embodiment of the present invention;
[0040] Figure 2 A schematic diagram of the EMMC storage partition management hierarchy provided by an embodiment of the present invention;
[0041] Figure 3 Schematic diagram of EMMC dynamically modifying storage partitions before and after the embodiment of the present invention;
[0042] Figure 4 A flowchart of a partition management method for an EMMC storage system according to another embodiment of the present invention;
[0043] Figure 5 The figure is a schematic diagram of the structure of an EMMC storage system partition management device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] When the existing FAT file system does not use the multi-file system partition configuration to format the partition, the entire capacity of the EMMC is used as the FAT file system partition by default, and the size of the FAT file system partition cannot be flexibly configured and the EMMC part of the storage space cannot be reserved. In addition, the large-capacity EMMC of the embedded device usually has a capacity of 16GB or 32GB. In the mass production process of the device, the EMMC needs to be image burned. However, since the EMMC of the mass-produced embedded device usually adopts a single chip, the chip burning factory batch burns the data into the EMMC chip, and then solders the EMMC chip to the embedded device board. However, the EMMC usually only needs a small amount of data within about 1GB, and the FAT file system is in the starting partition of the EMMC, and the reserved backup partition of the EMMC is in the end partition of the EMMC. If the FAT file system partition data of the EMMC and the reserved partition data of the EMMC are burned into the EMMC at the same time during the mass production process of the device, it is necessary to burn all the 16GB or 32GB capacity images of the EMMC, but the valid data may only occupy 2GB. Therefore, the mass production process will take a long time to burn invalid data, resulting in low efficiency of EMMC mass production.
[0046] Based on this, the present application sets an EMMC storage partition management module on the basis of the embedded FATFS file system, and dynamically adjusts the size of the FATFS file system partition on the basis of retaining the original FATFS file system. The EMMC storage partition management module provides the functions of dynamically adjusting the FATFS file system partition size on the EMMC storage device, the EMMC reserved partition size, and the EMMC reserved partition read-write access management. In the later stage of the use of the embedded FATFS file system, due to changes in storage partition requirements, it is necessary to dynamically adjust the partition size, and it is necessary to retain the file data in the original FATFS file system. In this case, the firmware can be upgraded through OTA (Over The Air, remote upgrade). The new firmware is equipped with an EMMC partition management program. At the first startup after the OTA firmware upgrade, the FATFS file system partition size is dynamically modified and an EMMC reserved partition is generated. In addition, only valid data of the FATFS partition can be burned during the EMMC data burning process of the embedded device. 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 the EMMC reserved partition file index table, and copy the files that need to be backed up in the FATFS file system to the EMMC reserved partition, thereby improving the efficiency of mass production of embedded devices.
[0047] The embodiment of the present invention provides an EMMC storage system partition management method, wherein the storage area of the EMMC includes a FATFS file system partition and an EMMC reserved partition, and the FATFS file system partition includes a FATFS partition in an MBR area and a FATFS partition in a DBR area, such as Figure 1 As shown, the method includes:
[0048] S11. After the firmware is upgraded, the terminal device is restarted, the EMMC partition management program in the firmware is run, and the FATFS file system is mounted, wherein the upgraded firmware is embedded with the EMMC partition management program.
[0049] S12, loading the data of sector 0 of the EMMC storage device, and detecting whether the partition division currently executed by the EMMC storage device system is the latest one.
[0050] S13. If the current EMMC storage device system does not perform the latest partition division, the FATFS partition size value of the MBR area and the FATFS partition size value of the DBR area are modified to the FATFS partition size value preset in the upgraded firmware.
[0051] S14, generating an EMMC reserved partition in the storage area of the EMMC, and generating a file index table of the EMMC reserved partition in the starting sector of the EMMC reserved partition.
[0052] S15, copy the files 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 in the MBR area.
[0054] S17, unload the current FATFS file system, reload the FATFS file system, and start the system.
[0055] The EMMC storage system partition management method provided by the embodiment of the present invention can dynamically modify the size of the FATFS file system and re-partition the EMMC without deleting the file data in the FAT file system partition; in addition, an EMMC reserved partition is expanded 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, and basic files required for system startup and operation are restored through the EMMC reserved partition. Since the access speed of the EMMC reserved partition is faster than the access speed 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 is described in detail below in conjunction with specific embodiments.
[0057] like Figure 2 As shown, it is a schematic diagram of the EMMC storage partition management hierarchy. An EMMC storage partition management module is set on the basis of the embedded FATFS file system. On the basis of retaining the original FATFS file system, the size of the FATFS file system partition is dynamically adjusted. The upper layer of the EMMC storage partition management module is the user application layer, which is used to run the user's application program; the lower layer of the EMMC storage partition management module is the EMMC storage device driver layer, which is used to run the driver program of the EMMC storage device.
[0058] The conventional partition of the embedded FATFS file system covers all storage areas of EMMC, and in this application, Figure 3 As shown in the figure, an EMMC reserved partition is extended on the basis of the FATFS file system partition to store the basic file data of the embedded system. When the embedded FATFS file system crashes abnormally and cannot be recovered, after formatting the FATFS file system, the basic files required for the startup and operation of the embedded system can be restored through the EMMC reserved partition, avoiding the problem that all data is lost and cannot be recovered and the embedded system cannot start normally due to formatting the FATFS file system. At the same time, the EMMC reserved partition can also be used as a file storage area for fast data access, which has a faster access speed than the embedded FATFS file system.
[0059] like Figure 4 As shown, the EMMC storage system partition management method provided by the embodiment of the present invention includes the following steps:
[0060] S201, upgrading the firmware of the terminal device by OTA mode, wherein the upgraded firmware is embedded with an EMMC partition management program.
[0061] S202, the terminal device restarts, first runs the EMMC partition management program in the firmware, and mounts the FATFS file system.
[0062] S203, determine whether the used space of the FATFS file system is greater than the FATFS partition space size preset by the firmware, if so, execute step S214, otherwise execute step S204.
[0063] S204, the EMMC partition management program first reads the data of sector 0 of the EMMC storage device through the EMMC driver and enters the data into the MCU cache.
[0064] Among them, when the EMMC storage device already has a FATFS file system and is operating normally, the EMMC's sector 0, namely the MBR sector, records the starting address of the FATFS file system's DBR area and the FATFS file system partition size and number of partitions. Since the remote embedded device uses the internal Flash as the boot program storage device, and the EMMC is an external storage device and is not used as the system boot program storage device, the EMMC's sector 0, namely the first 446 bytes of the MBR area, can be used to store the starting sector address, partition size, partition version number, partition information checksum, and other information of the backup partition reserved 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 executes the latest partition division; if so, execute step S214; otherwise, execute step S206.
[0066] Specifically, by reading the EMMC partition version number in the MBR area to see if it is the latest version number, it is determined whether the EMMC storage device system is executing the latest partition division. If it is the latest version number, it indicates that the current EMMC storage device system is executing the latest partition division, and there is no need to re-partition the EMMC, and the normal system startup can be performed directly; otherwise, it indicates that the current EMMC storage device system is not executing the latest partition division, and the EMMC partition needs to be re-partitioned.
[0067] S206: Modify the FATFS partition size value in the MBR area.
[0068] The partition size data of the FATFS file system is obtained through the data structure after the data offset 446 bytes of sector 0 of the EMMC storage device, and the FATFS file system partition size value preset by the new firmware is written into the FATFS partition in the MBR area through the EMMC driver, and the sector offset address of the DBR area of the FATFS file system is obtained.
[0069] S207. Modify the FATFS partition size value in the DBR area.
[0070] 512 bytes of the DBR area are read into the data buffer, and the FATFS file system size value stored in the firmware program is written into the FATFS file system capacity data stored in the DBR area to complete the modification of the FATFS file system capacity.
[0071] S208, generating an EMMC reserved partition in the storage area of the EMMC, and generating basic information and a file index table of the EMMC reserved partition in the starting sector of the EMMC reserved partition.
[0072] S209, copy the files to be backed up in the FATFS file system to the EMMC reserved partition.
[0073] Among them, the files that need to be backed up include map basic data files, configuration files required for system startup, and built-in music files, but are not limited to these.
[0074] S210, recording 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, execute step S212.
[0076] S212, update the EMMC partition version number in the MBR area.
[0077] The EMMC partition version number in the MBR area is updated so that after the firmware is upgraded, it is determined whether the EMMC partition needs to be re-performed according to the EMMC partition version number in the MBR area.
[0078] S213, unloading the original FATFS file system, and reloading the FATFS file system, so that data such as the system capacity size of the FATFS file system is updated.
[0079] S214, enter normal system startup.
[0080] The embodiment of the present invention also provides an EMMC storage system partition management device, wherein the storage area of the EMMC includes a FATFS file system partition and an EMMC reserved partition, and the FATFS file system partition includes a FATFS partition in an MBR area and a FATFS partition in a DBR area. Figure 5 As shown, the device comprises:
[0081] The mounting unit 11 is used to restart the terminal device after the firmware is upgraded, run the EMMC partition management program in the firmware, and mount the FATFS file system, wherein the upgraded firmware is embedded with the EMMC partition management program;
[0082] The detection unit 12 is used to load the data of sector 0 of the EMMC storage device and detect whether the partition division currently executed by the EMMC storage device system is the latest one;
[0083] The modification unit 13 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 FATFS partition size value preset in the upgraded firmware if the current EMMC storage device system does not perform the latest partition division;
[0084] A generating unit 14 is connected to the modifying unit 13, and is used to generate an EMMC reserved partition in the storage area of the EMMC after the modifying unit 13 modifies the FATFS partition size value of the MBR area and the FATFS partition size value of the DBR area to the FATFS partition size value preset in the upgraded firmware, and to generate a file index table of the EMMC reserved partition in the starting sector of the EMMC reserved partition;
[0085] The backup unit 15 is connected to the generation unit 14 and is used to copy the files 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] An updating unit 16, connected to the backup unit 15, for updating the EMMC partition version number of the MBR area;
[0087] The reloading unit 17 is connected to the updating unit 16 and 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 by the embodiment of the present invention can dynamically modify the size of the FATFS file system and re-partition the EMMC without deleting the file data in the FAT file system partition; in addition, an EMMC reserved partition is expanded 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, and basic files required for system startup and operation are restored through the EMMC reserved partition. Since the access speed of the EMMC reserved partition is faster than the access speed 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 executes the latest partition division, otherwise it indicates that the current EMMC storage device system does not execute the latest partition division.
[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 446 bytes of 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 in 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 to complete the modification of the FATFS file system capacity.
[0091] The device of this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar and will not be repeated here.
[0092] An embodiment of the present invention further 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, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned EMMC storage system partition management method.
[0096] Those skilled in the art can understand that all or part of the processes in the above method embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes in the above method embodiments. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0097] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A partition management method for an EMMC storage system, characterized in that: The storage area of the EMMC includes a FATFS file system partition, and the FATFS file system partition includes a FATFS partition in an MBR area and a FATFS partition in a DBR area. The method includes: After the firmware is upgraded, the terminal device is restarted, the EMMC partition management program in the firmware is run, and the FATFS file system is mounted, wherein the upgraded firmware is embedded with the EMMC partition management program; Load the data of sector 0 of the EMMC storage device to detect whether the current EMMC storage device system is performing the latest partition division; If the current EMMC storage device system does not perform the latest partition division, the FATFS partition size value of the MBR area and the FATFS partition size value of the DBR area are modified to the FATFS partition size value preset in the upgraded firmware; 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; Copy the files 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, remount the FATFS file system, and start the system.
2. The method according to claim 1, characterized in that: The detecting whether the partition division currently performed by the EMMC storage device system is the latest comprises: It is determined 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 executes the latest partition division. Otherwise, it indicates that the current EMMC storage device system does not execute the latest partition division.
3. The method according to claim 1, characterized in that The step of modifying the FATFS partition size value of the MBR area and the FATFS partition size value of the DBR area to the FATFS partition size value preset in the upgraded firmware includes: Obtain the partition size data of the FATFS file system through the data structure after the data offset 446 bytes of 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; 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, thereby 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 of sector 0 of the EMMC storage device, the method further includes: Determine whether the used space of the FATFS file system is greater than the FATFS partition space size preset by the firmware. If so, enter normal system startup. Otherwise, execute the step of loading the data of 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 comprises: If the current EMMC storage device system executes the latest partition division, there is no need to re-perform EMMC partitioning and enter normal system startup.
6. The method according to any one of claims 1 to 3, characterized in that The first 446 bytes of the MBR area at least store the starting sector address, partition size, partition version number and partition information check code of the EMMC reserved partition.
7. An EMMC storage system partition management device, characterized in that: The storage area of the EMMC includes a FATFS file system partition, and the FATFS file system partition includes a FATFS partition in an MBR area and a FATFS partition in a DBR area. The device includes: A mounting unit, used for restarting the terminal device after the firmware is upgraded, running the EMMC partition management program in the firmware, and mounting the FATFS file system, wherein the upgraded firmware is embedded with the EMMC partition management program; The detection unit is used to load the data of sector 0 of the EMMC storage device and detect whether the partition division currently executed by the EMMC storage device system is the latest one; A modification unit, configured to modify the FATFS partition size value of the MBR area and the FATFS partition size value of the DBR area to the FATFS partition size value preset in the upgraded firmware if the current EMMC storage device system does not perform the latest partition division; A generating unit, used for generating an EMMC reserved partition in the storage area of the EMMC, and generating a file index table of the EMMC reserved partition in the starting sector of the EMMC reserved partition; A backup unit, used for copying the files to be backed up in the FATFS file system to the EMMC reserved partition, and recording the starting sector and file size of each file in the file index table; An updating unit, used for updating the EMMC partition version number of the MBR area; The reload unit is used to unload the current FATFS file system and reload the FATFS file system to start the system.
8. The device 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 executes the latest partition division, otherwise it indicates that the current EMMC storage device system does not execute the latest partition division.
9. The device 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 446 bytes of 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 to complete the modification of the FATFS file system capacity.
10. A terminal device, characterized in that: The terminal device comprises: 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, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to 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
Virtual media transmission system with data verification and error retransmission mechanism
CN114124301A
Data safe box enforced by a storage device controller on a per-region basis for improved computer security
US20080046997A1