CN112306368A - Method and device for expanding user data partition by EMMC (enhanced multi-media card) - Google Patents

Method and device for expanding user data partition by EMMC (enhanced multi-media card) Download PDF

Info

Publication number
CN112306368A
CN112306368A CN201910672487.0A CN201910672487A CN112306368A CN 112306368 A CN112306368 A CN 112306368A CN 201910672487 A CN201910672487 A CN 201910672487A CN 112306368 A CN112306368 A CN 112306368A
Authority
CN
China
Prior art keywords
partition
user data
built
video
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910672487.0A
Other languages
Chinese (zh)
Other versions
CN112306368B (en
Inventor
朱敏
马峥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Hisense Media Network Technology Co Ltd
Original Assignee
Qingdao Hisense Media Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Hisense Media Network Technology Co Ltd filed Critical Qingdao Hisense Media Network Technology Co Ltd
Priority to CN201910672487.0A priority Critical patent/CN112306368B/en
Publication of CN112306368A publication Critical patent/CN112306368A/en
Application granted granted Critical
Publication of CN112306368B publication Critical patent/CN112306368B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Television Signal Processing For Recording (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a device for expanding user data partitions by EMMC, and relates to the field of intelligent equipment. In the embodiment of the invention, the physical addresses of the user data partition and the built-in video partition are configured to be adjacent in advance, when the capacity of the user data partition needs to be expanded, the partition information of the user data partition and the partition information of the built-in video partition are modified according to the capacity of the user data partition needing to be expanded, and the file system information is modified according to the modified partition information, so that the expanded user data partition and the reduced built-in video partition are formed. Therefore, the capacity of the user data partition can be expanded, the capacity of the built-in video partition is reduced, namely the user data partition is expanded by reducing the built-in video partition, the expansion of the user data partition is realized under the condition of avoiding the influence on data in other partitions, and the reasonable utilization of the storage space in the EMMC is improved.

Description

Method and device for expanding user data partition by EMMC (enhanced multi-media card)
Technical Field
The invention relates to the technical field of intelligent equipment, in particular to a method and a device for expanding user data partitions by EMMC.
Background
In order to better sell products, the market displays the display effects of products of different models, such as HDR (high-definition link), highlight screen and the like, ensures that the display requirements of video display contents and models are consistent, and needs to play built-in videos in a market mode, so that the requirement that mass production products must be preset with built-in video partitions is met.
Also, since the user data partition is cleared at the time of factory reset or user reset, the built-in video cannot be stored in the user data partition, but a separate partition needs to be separately created for storage (i.e., a built-in video partition). But the shopping mall mode and the built-in video are functions which cannot be used by the user in the normal use process of the product, so that the space is greatly wasted. In addition, even after the built-in video in the built-in video partition is deleted, the storage space released by the built-in video partition cannot be used by the user, which also wastes the storage space.
Therefore, how to expand the user data partition and reasonably utilize the storage space in an Embedded Multi Media Card (EMMC) is a technical problem to be solved by those skilled in the art.
Disclosure of Invention
The embodiment of the invention provides a method and a device for expanding user data partitions by EMMC (embedded multi-media card), which are used for expanding the user data partitions and reasonably utilizing storage space in an embedded memory.
In a first aspect, an embodiment of the present invention provides a method for extending a user data partition for an embedded memory EMMC, where the EMMC includes a built-in video partition and a user data partition, and the method includes:
when the capacity of the user data partition needs to be expanded, modifying the partition information of the user data partition and the partition information of the built-in video partition according to the capacity of the user data partition needing to be expanded; wherein the partition information includes a physical address and a capacity, and the physical addresses of the user data partition and the built-in video partition are pre-configured to be adjacent;
and modifying the file system information according to the modified partition information to form an expanded user data partition and a reduced built-in video partition.
Optionally, the address start position of the user data partition is located before the address start position of the built-in video partition.
Optionally, modifying the partition information of the user data partition and the partition information of the built-in video partition according to the capacity of the user data partition that needs to be expanded, specifically including:
deleting the partition information of the user data partition and the partition information of the built-in video partition;
and according to the capacity of the user data partition needing to be expanded and the sum of the capacities of the user data partition and the built-in video partition, re-creating partition information of the user data partition and partition information of the built-in video partition.
Optionally, determining that the capacity of the user data partition needs to be expanded specifically includes:
acquiring an indication sent by a user for expanding the capacity of the user data partition;
or after the system is started or when the system OTA is upgraded, judging that the residual capacity of the user data partition is smaller than a preset threshold value.
Optionally, modifying the file system information according to the modified partition information, specifically including:
checking file system parameters through e2 fsck;
when the file system parameters are not matched with the modified partition information, carrying out repair processing on the file system parameters;
the size of the file system is modified by resize2fs according to the modified partition information.
In a second aspect, an embodiment of the present invention provides an apparatus for extending a user data partition in an embedded memory EMMC, where the EMMC includes a built-in video partition and a user data partition, and the apparatus includes:
a first modifying unit, configured to modify, when the capacity of the user data partition needs to be expanded, partition information of the user data partition and partition information of the built-in video partition according to the capacity of the user data partition that needs to be expanded; wherein the partition information includes a physical address and a capacity, and the physical addresses of the user data partition and the built-in video partition are pre-configured to be adjacent;
and the second modification unit is used for modifying the file system information according to the modified partition information to form an expanded user data partition and a reduced built-in video partition.
In a third aspect, an embodiment of the present invention provides an intelligent display device, including:
a memory for storing program instructions;
a processor for calling the program instructions stored in the memory, and executing according to the obtained program:
when the capacity of the user data partition needs to be expanded, modifying the partition information of the user data partition and the partition information of the built-in video partition according to the capacity of the user data partition needing to be expanded; wherein the EMMC includes a built-in video partition and a user data partition, the partition information includes a physical address and a capacity, and the physical addresses of the user data partition and the built-in video partition are preconfigured to be adjacent;
and modifying the file system information according to the modified partition information to form an expanded user data partition and a reduced built-in video partition.
Optionally, the address start position of the user data partition is located before the address start position of the built-in video partition.
Optionally, the processor is specifically configured to:
deleting the partition information of the user data partition and the partition information of the built-in video partition;
and according to the capacity of the user data partition needing to be expanded and the sum of the capacities of the user data partition and the built-in video partition, re-creating partition information of the user data partition and partition information of the built-in video partition.
In a fourth aspect, embodiments of the present invention provide a computer-readable non-volatile storage medium having stored thereon computer-executable instructions for causing a computer to perform the above-described method.
The invention has the following beneficial effects:
according to the method and the device for expanding the user data partition by the EMMC, the physical addresses of the user data partition and the built-in video partition are configured to be adjacent in advance, when the capacity of the user data partition needs to be expanded, partition information of the user data partition and partition information of the built-in video partition are modified according to the capacity of the user data partition needing to be expanded, namely the physical addresses, the capacity and other information of the user data partition and the built-in video partition are modified, file system information is modified according to the modified partition information, and the expanded user data partition and the reduced built-in video partition are formed. Therefore, the capacity of the user data partition can be expanded, the capacity of the built-in video partition is reduced, namely the user data partition is expanded by reducing the built-in video partition, the expansion of the user data partition is realized under the condition of avoiding the influence on data in other partitions, and the reasonable utilization of the storage space in the EMMC is improved.
Drawings
Fig. 1 is a flowchart of a method for EMMC to extend user data partitions according to an embodiment of the present invention;
FIG. 2 is a diagram of a user data partition before and after capacity expansion according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a triggering method provided in an embodiment of the present invention;
FIG. 4 is a flow chart of an embodiment provided in an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an apparatus for EMMC to extend a user data partition according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an intelligent display device provided in an embodiment of the present invention.
Detailed Description
The following describes in detail a specific implementation of a method and an apparatus for extending user data partitions by an EMMC according to an embodiment of the present invention with reference to the accompanying drawings. It should be noted that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
An embodiment of the present invention provides a method for extending a user data partition by an EMMC, where the EMMC includes a built-in video partition and a user data partition, and at this time, referring to a flowchart shown in fig. 1, the method may include:
s101, when the capacity of a user data partition needs to be expanded, modifying partition information of the user data partition and partition information of a built-in video partition according to the capacity of the user data partition needing to be expanded;
the partition information may include a physical address and a capacity, and of course, the content included in the partition information is not limited to the physical address and the capacity, and also includes other information that may be used to indicate a partition, and is not limited herein.
In order to avoid affecting data in other partitions except the user data partition and the built-in video partition when the capacity of the user data partition is expanded, the physical addresses of the user data partition and the built-in video partition need to be configured to be adjacent in advance.
For example, for a memory with 16G capacity, starting from 1G, the 1 st to 3 rd spaces 1G may be pre-configured as user data partitions, and the 3 rd to 4 th spaces 1G may be pre-configured as built-in video partitions.
Of course, the foregoing merely illustrates that the physical addresses of the user data partition and the built-in video partition are adjacent, but in the actual configuration process, the user data partition and the built-in video partition are not necessarily configured according to the foregoing example, as long as the physical addresses of the user data partition and the built-in video partition are adjacent, and the configuration is not limited herein.
Specifically, the physical addresses of the user data partition and the built-in video partition need to be configured to be adjacent in advance, and this process may be configured before the intelligent display device leaves a factory, and may be implemented by modifying the partition configuration table. The partition configuration table may include configuration information of the partitions, and information such as physical addresses, capacities, address start positions, and the like of the partitions.
S102, according to the modified partition information, modifying file system information to form an expanded user data partition and a reduced built-in video partition.
Wherein the total size of the two partitions and the total size before adjustment are consistent.
That is, after the capacity of the user data partition is expanded by reducing the capacity of the built-in video partition, it is necessary to ensure that the built-in video partition must exist to avoid reading errors when reading each partition, which may affect the normal startup of the system.
In the embodiment of the present invention, in the first aspect, the capacity expansion of the user data partition can be realized, and the capacity of the built-in video partition is reduced, that is, the user data partition is expanded by reducing the built-in video partition, so that the expansion of the user data partition is realized under the condition of avoiding the influence on data in other partitions, and the reasonable utilization of the storage space in the EMMC is improved.
In a second aspect, the above-mentioned method for expanding the user data partition is simpler, that is, the purpose of expanding the user data partition can be achieved after the system is restarted by simple operation, and it is not necessary to rebuild the system and upgrade the system as in the prior art, thereby greatly improving the expansion efficiency of the user data partition.
In the third aspect, when the user data partition is expanded, the user does not need to perform partition operation with strong speciality and high complexity, that is, no special limitation and requirement are imposed on the operation level of the user, so that the application range and the application field of the method are wide.
In specific implementation, in order to avoid affecting data in the user data partition and implement lossless extension, in the embodiment of the present invention, the address start position of the user data partition is located before the address start position of the built-in video partition.
This is due to: since the embodiment of the present invention expands the capacity of the user data partition by reducing the capacity of the built-in video partition, if the address start position of the user data partition is configured to be located before the address start position of the built-in video partition, when the capacity of the built-in video partition is reduced and the capacity of the user data partition is expanded, the address start position of the user data partition may need to be reset, and thus, the data in the user data partition may be erased.
If the address start position of the built-in video partition is configured to be located before the address start position of the user data partition, the address start position of the built-in video partition may be reset when the capacity of the built-in video partition is reduced and the capacity of the user data partition is expanded, and at this time, the data in the built-in video partition is affected, but the data in the user data partition is not affected.
Therefore, in order to achieve lossless capacity expansion and avoid affecting data in the user data partition, the address start position of the user data partition needs to be configured to be located before the address start position of the built-in video partition.
In specific implementation, in the embodiment of the present invention, in step S101, modifying the partition information of the user data partition and the partition information of the built-in video partition according to the capacity that needs to be expanded by the user data partition may specifically include:
deleting partition information of the user data partition and partition information of the built-in video partition;
and according to the capacity of the user data partition needing to be expanded and the sum of the capacities of the user data partition and the built-in video partition, re-creating partition information of the user data partition and partition information of the built-in video partition.
In the starting process of the system, several phases may be considered to pass, a first phase may be considered as a Uboot starting phase, a second phase may be considered as an operating system starting phase, and of course, other phases may also be included, which are not described in detail herein. After the system is started in multiple stages, the system is started to enter a normal running state, and a user can operate and apply the system.
In the embodiment of the present invention, step S101 is performed when the system enters the Uboot mode during the system startup process, and at this time, partition information is modified by the Uboot, that is, partition information such as physical addresses, capacities or sizes, address start positions, and the like of the user data partition and the built-in video partition, is rewritten, but data in the original user data partition is not changed, which is beneficial to avoiding damage to data in the original user data partition.
Moreover, when the partition information of the user data partition and the partition information of the built-in video partition are created again, it is necessary to ensure that the sum of the capacities of the created user data partition and the built-in video partition is not changed, as shown in fig. 2, so as to avoid affecting data in other partitions.
In fig. 2, "user data" indicates a user data partition, "Video" indicates a built-in Video partition, and indicates a configuration situation of the user data partition and the built-in Video partition before the user data partition is expanded, and indicates a configuration situation of the user data partition and the built-in Video partition after the user data partition is expanded.
In addition, when the partition information of the user data partition and the partition information of the built-in video partition are created again, the capacity of the user data partition that needs to be expanded may be determined according to user needs, system needs, or the like.
In the Uboot mode, after the partition information of the user data partition and the built-in video partition is modified, an operating system Kernel (Kernel) is started, namely, an operating system is started, and the file system information is modified based on the operating system, so that the purpose of expanding the user data partition is achieved.
Therefore, in particular, in the embodiment of the present invention, the modifying the file system information according to the modified partition information in step S102 may specifically include the following sub-steps:
substep 1: checking file system parameters through e2 fsck;
the file system parameters may include block size, inode, directory structure, and cluster parameters.
At this time, the specific checking process is:
the first step is as follows: checking inode, block and size;
the second step is that: checking a directory structure;
the third step: checking the directory connectivity Pass;
the fourth step: checking the reference count;
the fifth step is to check the cluster summary information, such as/dev/sdb 1:5496/6111232 files (1.8% non-contiguous), 18781569/24416784 blocks.
It should be noted that, in the prior art, generally, the e2fsck is not used to check the hard disk partition, but in the embodiment of the present invention, in order to expand the user data partition, the e2fsck needs to be used to check the hard disk partition, and at this time, the partition amount command needs to be performed first, and then the e2fsck check needs to be performed, so as to improve the efficiency and accuracy of the check.
Substep 2: when the file system parameters are not matched with the modified partition information, repairing the file system parameters;
since the Uboot modifies the partition information, but the file system of the partition is not modified correspondingly, it is necessary to use e2fsck to check whether the partition of the hard disk is normal, that is, check whether the parameters of the file system match the modified partition information, and if not, perform the repair process. The process of performing the repair process can be referred to in the prior art, and is not described herein again.
Substep 3: the size of the file system is modified by resize2fs according to the modified partition information.
Wherein, this substep 3 can be understood as: the size of the file system in the ext2, ext3, or ext4 format is adjusted.
Also, the size of the file system may be smaller than the size of the partition, the size of the file system in ext2, ext3, or ext4 format may be adjusted by running resize2fs to use all storage space in the extended user data partition, and resize2fs may enlarge or reduce the size of the file system that is not mounted, if the file system is already mounted, resize2fs may enlarge the size of the file system, provided that the kernel supports online adjustment of the file system size.
To illustrate, the above mentioned resize2fs can be understood as a command, e2fsck is used to check the file system parameters, and the specific implementation of resize2fs and e2fsck can be referred to in the prior art and will not be described in detail herein.
Therefore, the file system information can be modified through the operating system, so that the file system information is matched with the partition information, and the expansion of the user data partition is completed; in addition, the data in the original user data partition can be ensured to be unchanged through the expansion mode, and the data in the original user data partition cannot be damaged, so that the lossless expansion is favorably realized, and the management of the EMMC storage space is improved.
Specifically, in this embodiment of the present invention, before entering the Uboot mode, that is, before modifying partition information of the user data partition and partition information of the built-in video partition according to a capacity that needs to be expanded by the user data partition, the method may further include:
setting a value of a first flag in a memory, wherein the first flag is used for indicating whether the Uboot modifies the partition information of the user data partition and the built-in video partition; the memory may be an EMMC, flash memory (flash), or a charged erasable programmable read only memory (eepROM).
Therefore, when entering the Uboot mode, the Uboot is indicated to modify the partition information, thereby being beneficial to realizing the expansion of the user data partition.
At this time, modifying the partition information of the user data partition and the partition information of the built-in video partition according to the capacity that needs to be expanded by the user data partition may specifically include:
reading the first mark;
determining whether a value of the first flag is a value indicating that the Uboot modifies partition information of the user data partition and the built-in video partition;
if so, modifying the partition information of the user data partition and the partition information of the built-in video partition according to the capacity of the user data partition needing to be expanded in the Uboot mode;
if not, in the Uboot mode, the partition information of the user data partition and the partition information of the built-in video partition are not modified.
Further, after modifying the partition information of the user data partition and the partition information of the built-in video partition according to the capacity of the user data partition that needs to be expanded, the method may further include:
modifying the value of the first flag to indicate that the Uboot is no longer modifying the partition information of the user data partition and the partition information of the built-in video partition;
setting a value of a second flag in the memory, the second flag indicating whether the operating system modified the file system information.
Therefore, when the Uboot enters the starting stage of the operating system after the Uboot is started, the operating system is indicated to modify the file system information, and the expansion of the user data partition is facilitated.
In addition, the condition that the partition information is modified due to misoperation when the Uboot reads the value of the first mark in the next system starting process can be avoided, and further, the condition that errors occur in the Uboot mode is avoided, so that the system can be enabled to be started normally.
At this time, modifying the file system information according to the modified partition information may specifically include:
reading the second mark;
determining whether the value of the second mark is a value indicating that an operating system modifies file system information corresponding to the user data partition and the built-in video partition;
if so, modifying the file system information according to the modified partition information based on the operating system;
if not, based on the operating system, the file system information is not modified.
Further, after modifying the file system information according to the modified partition information, the method may further include:
the value of the second flag is modified to indicate that the operating system is no longer modifying file system information.
Therefore, the situation that the information of the file system is modified due to misoperation when the operating system reads the value of the second mark in the next system starting process can be avoided, and further, errors in the operating system starting process are avoided, so that the system can be enabled to be normally started.
In specific implementation, when determining whether the capacity of the user data partition needs to be expanded, in the embodiment of the present invention, the following triggering manners are given, as shown in fig. 3:
the first trigger mode is as follows: acquiring an indication for expanding the partition capacity of user data sent by a user;
that is, a user menu option (i.e. lossless expansion of the remaining space of the user data partition) is added to the user menu, and after the user selects the option, the system automatically sets the value of the first flag, and when the system is restarted for the first time, the lossless expansion of the user data partition is automatically completed.
The second triggering mode is as follows: after the system is started, reading the remaining space of the user data partition, detecting that the remaining space of the user data partition is smaller than a preset threshold (for example, the preset threshold is 500MB, or 10% or 15% of the capacity of the user data partition, and the like, which is not limited herein), automatically setting the value of the first flag by the system, and automatically completing the lossless expansion of the user data partition when the system is restarted or restarted next time. And if the residual space of the user data partition is detected to be larger than or equal to the preset threshold value, the system can normally operate.
The third trigger mode is as follows: when the OTA of the system is upgraded, the residual space of the user data partition is read, when the fact that the residual space of the user data partition is smaller than a preset threshold value is detected, the system automatically sets the value of the first mark, and when the system is restarted, lossless expansion of the user data partition is automatically completed. And if the residual space of the user data partition is detected to be larger than or equal to the preset threshold value, the system can normally perform OTA upgrading.
Therefore, by setting several trigger modes, when the user data partition needs to be expanded, the expansion of the user data partition can be realized, and the management of the storage space in the EMMC is improved.
The method provided by the embodiment of the invention is explained by combining the specific embodiment.
Referring to the flowchart shown in fig. 4, the following description will be given by taking an example that after the system is started, it is detected that the remaining space of the user data partition is smaller than the preset threshold. Wherein, the value of the first mark is 0 to indicate that Uboot modifies the partition information of the user data partition and the built-in video partition, and the value of the second mark is 0 to indicate that the operating system modifies the file system information.
S401, determining whether the user data partition needs to be expanded; if yes, go to step S402; if not, ending the flow;
s402, setting the value of a first mark in the EMMC;
s403, restarting the system;
s404, entering a Uboot mode, reading the value of the first mark, and judging whether the value of the first mark is 0; if yes, go to step S405; if not, ending the flow;
s405, deleting partition information of the user data partition and deleting partition information of the built-in video partition;
s406, recreating the partition information of the user data partition and recreating the partition information of the built-in video partition according to the capacity of the user data partition needing to be expanded;
s407, modifying the value of the first mark, and setting the value of the second mark in the EMMC;
s408, starting kernel;
s409, entering an operating system starting stage, reading a value of a second mark, and judging whether the value of the second mark is 0; if yes, go to step S410; if not, ending the flow;
s410, checking file system parameters through e2 fsck;
s411, when the file system parameters are not matched with the modified partition information, repairing the file system parameters;
s412, modifying the size of the file system through resize2fs according to the modified partition information;
s413, modifying the value of the second mark;
and S414, the system is started and enters an operation state.
It should be noted that, optionally, the extension of the user data partition may also be implemented by combining the Uboot and dd commands, for example, in the Uboot mode, partition information of the user data partition and the built-in video partition is modified, and in the Uboot mode, an image file of the user data partition that needs to be extended and the built-in video partition that needs to be reduced is generated, and then the image file is directly written into the EMMC by using the dd command, so as to generate the extended user data partition and the reduced built-in video partition. Although the file system information does not need to be modified through the operating system, the partition can be directly written in, and the expansion efficiency of the user data partition is improved, it is noted that the data in the original user data partition is lost through the mode, so that in the specific implementation, the mode of combining the Uboot and the operating system or the mode of combining the Uboot and the dd command can be determined according to the needs of the actual situation, so as to realize the expansion of the user data partition.
Optionally, in the embodiment of the present invention, before the intelligent display device leaves the factory, a reset operation may be performed on the system, in the process, the user data partition may be formatted and erased, and if the built-in video data is placed in a file and then the file is stored in the user data partition, the file may be erased in the process of resetting the system, so that the built-in video data needs to be rewritten after the system is reset, and thus, the operation is repeated.
Therefore, in order to avoid the above problems, the file storing the built-in video data may be read into the memory before the system is reset, and the file storing the built-in video data may be rewritten into the user data partition after the system is reset, so as to reduce the repetitive operations, and also to ensure that the built-in video data is not lost before and after the system is reset.
Based on the same inventive concept, an embodiment of the present invention provides an apparatus for extending a user data partition of an embedded memory EMMC, as shown in fig. 5, where the EMMC includes a built-in video partition and a user data partition, and the apparatus includes:
a first modifying unit 501, configured to modify partition information of a user data partition and partition information of a built-in video partition according to a capacity that needs to be expanded for a user data partition when the capacity of the user data partition needs to be expanded; the partition information comprises physical addresses and capacity, and the physical addresses of the user data partition and the built-in video partition are configured to be adjacent in advance;
a second modifying unit 502, configured to modify file system information according to the modified partition information, so as to form an expanded user data partition and a reduced built-in video partition.
Optionally, in this embodiment of the present invention, the address start position of the user data partition is located before the address start position of the built-in video partition.
Optionally, in this embodiment of the present invention, the first modifying unit 501 is specifically configured to:
deleting partition information of the user data partition and partition information of the built-in video partition;
and according to the capacity of the user data partition needing to be expanded and the sum of the capacities of the user data partition and the built-in video partition, re-creating partition information of the user data partition and partition information of the built-in video partition.
Optionally, in this embodiment of the present invention, the first modifying unit 501 is further configured to:
acquiring an indication for expanding the partition capacity of user data sent by a user;
or after the system is started or when the system OTA is upgraded, judging that the residual capacity of the user data partition is smaller than the preset threshold value.
Optionally, in this embodiment of the present invention, the second modifying unit 502 is specifically configured to:
checking file system parameters through e2 fsck;
when the file system parameters are not matched with the modified partition information, repairing the file system parameters;
the size of the file system is modified by resize2fs according to the modified partition information.
Based on the same inventive concept, an embodiment of the present invention provides an intelligent display device, as shown in fig. 6, which may include:
a memory 601 for storing program instructions;
a processor 602, configured to call the program instructions stored in the memory 601, and execute the following steps according to the obtained program:
when the capacity of the user data partition needs to be expanded, modifying the partition information of the user data partition and the partition information of the built-in video partition according to the capacity of the user data partition needing to be expanded; the EMMC comprises a built-in video partition and a user data partition, partition information comprises a physical address and capacity, and the physical addresses of the user data partition and the built-in video partition are configured to be adjacent in advance;
and modifying the file system information according to the modified partition information to form an expanded user data partition and a reduced built-in video partition.
It should be noted that the intelligent display device provided in the embodiment of the present invention may be any intelligent home device (e.g., an intelligent television) or terminal device (e.g., a mobile phone or a tablet computer) with a display screen, and is not limited herein.
Optionally, in this embodiment of the present invention, the address start position of the user data partition is located before the address start position of the built-in video partition.
Optionally, in this embodiment of the present invention, the processor 602 is specifically configured to:
deleting partition information of the user data partition and partition information of the built-in video partition;
and according to the capacity of the user data partition needing to be expanded and the sum of the capacities of the user data partition and the built-in video partition, re-creating partition information of the user data partition and partition information of the built-in video partition.
Optionally, in an embodiment of the present invention, the processor 602 is further configured to:
acquiring an indication for expanding the partition capacity of user data sent by a user;
or after the system is started or when the system OTA is upgraded, judging that the residual capacity of the user data partition is smaller than the preset threshold value.
Optionally, in this embodiment of the present invention, the processor 602 is specifically configured to:
checking file system parameters through e2 fsck;
when the file system parameters are not matched with the modified partition information, repairing the file system parameters;
the size of the file system is modified by resize2fs according to the modified partition information.
Based on the same inventive concept, the embodiment of the present invention provides a computer-readable non-volatile storage medium, in which computer-executable instructions are stored, and the computer-executable instructions are used for causing a computer to execute the above method.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A method for extending a user data partition of an embedded memory EMMC, wherein the EMMC includes a built-in video partition and a user data partition, the method comprising:
when the capacity of the user data partition needs to be expanded, modifying the partition information of the user data partition and the partition information of the built-in video partition according to the capacity of the user data partition needing to be expanded; wherein the partition information includes a physical address and a capacity, and the physical addresses of the user data partition and the built-in video partition are pre-configured to be adjacent;
and modifying the file system information according to the modified partition information to form an expanded user data partition and a reduced built-in video partition.
2. The method of claim 1, wherein the address start location of the user data partition precedes the address start location of the built-in video partition.
3. The method according to claim 1, wherein modifying the partition information of the user data partition and the partition information of the built-in video partition according to the capacity of the user data partition that needs to be expanded comprises:
deleting the partition information of the user data partition and the partition information of the built-in video partition;
and according to the capacity of the user data partition needing to be expanded and the sum of the capacities of the user data partition and the built-in video partition, re-creating partition information of the user data partition and partition information of the built-in video partition.
4. The method of claim 1, wherein determining that the capacity of the user data partition needs to be expanded comprises:
acquiring an indication sent by a user for expanding the capacity of the user data partition;
or after the system is started or when the system OTA is upgraded, judging that the residual capacity of the user data partition is smaller than a preset threshold value.
5. The method of claim 1, wherein modifying the file system information according to the modified partition information comprises:
checking file system parameters through e2 fsck;
when the file system parameters are not matched with the modified partition information, carrying out repair processing on the file system parameters;
the size of the file system is modified by resize2fs according to the modified partition information.
6. An apparatus for extending a user data partition for an embedded memory EMMC, the EMMC including a built-in video partition and a user data partition, the apparatus comprising:
a first modifying unit, configured to modify, when the capacity of the user data partition needs to be expanded, partition information of the user data partition and partition information of the built-in video partition according to the capacity of the user data partition that needs to be expanded; wherein the partition information includes a physical address and a capacity, and the physical addresses of the user data partition and the built-in video partition are pre-configured to be adjacent;
and the second modification unit is used for modifying the file system information according to the modified partition information to form an expanded user data partition and a reduced built-in video partition.
7. An intelligent display device, comprising:
a memory for storing program instructions;
a processor for calling the program instructions stored in the memory, and executing according to the obtained program:
when the capacity of the user data partition needs to be expanded, modifying the partition information of the user data partition and the partition information of the built-in video partition according to the capacity of the user data partition needing to be expanded; wherein the EMMC includes a built-in video partition and a user data partition, the partition information includes a physical address and a capacity, and the physical addresses of the user data partition and the built-in video partition are preconfigured to be adjacent;
and modifying the file system information according to the modified partition information to form an expanded user data partition and a reduced built-in video partition.
8. The intelligent display device of claim 7, wherein the address start location of the user data partition is located before the address start location of the built-in video partition.
9. The smart display device of claim 7, wherein the processor is specifically configured to:
deleting the partition information of the user data partition and the partition information of the built-in video partition;
and according to the capacity of the user data partition needing to be expanded and the sum of the capacities of the user data partition and the built-in video partition, re-creating partition information of the user data partition and partition information of the built-in video partition.
10. A computer-readable non-volatile storage medium having computer-executable instructions stored thereon for causing a computer to perform the method of any one of claims 1-5.
CN201910672487.0A 2019-07-24 2019-07-24 Method and device for expanding user data partition by EMMC (enhanced multi-media card) Active CN112306368B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910672487.0A CN112306368B (en) 2019-07-24 2019-07-24 Method and device for expanding user data partition by EMMC (enhanced multi-media card)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910672487.0A CN112306368B (en) 2019-07-24 2019-07-24 Method and device for expanding user data partition by EMMC (enhanced multi-media card)

Publications (2)

Publication Number Publication Date
CN112306368A true CN112306368A (en) 2021-02-02
CN112306368B CN112306368B (en) 2022-11-04

Family

ID=74329186

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910672487.0A Active CN112306368B (en) 2019-07-24 2019-07-24 Method and device for expanding user data partition by EMMC (enhanced multi-media card)

Country Status (1)

Country Link
CN (1) CN112306368B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114237506A (en) * 2021-12-14 2022-03-25 四川长虹电器股份有限公司 EMMC data storage and read-write method
EP4092539A1 (en) 2021-05-17 2022-11-23 Elektrobit Automotive GmbH Re-partitioning of a flash memory device
CN117874843A (en) * 2024-03-08 2024-04-12 荣耀终端有限公司 Method, apparatus and computer readable storage medium for expanding protected memory space

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104021022A (en) * 2014-06-23 2014-09-03 联想(北京)有限公司 Partition adjusting method and electronic equipment
CN104536841A (en) * 2014-11-26 2015-04-22 四川长虹电器股份有限公司 Self-repairing method and self-repairing system for Data subarea of Android system
CN106598593A (en) * 2016-12-13 2017-04-26 济南浪潮高新科技投资发展有限公司 Method for starting WinCE by utilizing U disk of Uboot
CN107148612A (en) * 2015-12-08 2017-09-08 华为技术有限公司 A kind of method and apparatus of extending user subregion
CN107315544A (en) * 2017-06-29 2017-11-03 郑州云海信息技术有限公司 A kind of solid-state disk logical partition management method and device
CN108509639A (en) * 2018-04-11 2018-09-07 武汉斗鱼网络科技有限公司 Table approaches to IM, device and readable storage medium storing program for executing

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104021022A (en) * 2014-06-23 2014-09-03 联想(北京)有限公司 Partition adjusting method and electronic equipment
CN104536841A (en) * 2014-11-26 2015-04-22 四川长虹电器股份有限公司 Self-repairing method and self-repairing system for Data subarea of Android system
CN107148612A (en) * 2015-12-08 2017-09-08 华为技术有限公司 A kind of method and apparatus of extending user subregion
CN106598593A (en) * 2016-12-13 2017-04-26 济南浪潮高新科技投资发展有限公司 Method for starting WinCE by utilizing U disk of Uboot
CN107315544A (en) * 2017-06-29 2017-11-03 郑州云海信息技术有限公司 A kind of solid-state disk logical partition management method and device
CN108509639A (en) * 2018-04-11 2018-09-07 武汉斗鱼网络科技有限公司 Table approaches to IM, device and readable storage medium storing program for executing

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4092539A1 (en) 2021-05-17 2022-11-23 Elektrobit Automotive GmbH Re-partitioning of a flash memory device
US11989435B2 (en) 2021-05-17 2024-05-21 Elektrobit Automotive Gmbh Re-partitioning of a flash memory device
CN114237506A (en) * 2021-12-14 2022-03-25 四川长虹电器股份有限公司 EMMC data storage and read-write method
CN114237506B (en) * 2021-12-14 2023-05-02 四川长虹电器股份有限公司 Method for storing and reading/writing EMMC data
CN117874843A (en) * 2024-03-08 2024-04-12 荣耀终端有限公司 Method, apparatus and computer readable storage medium for expanding protected memory space

Also Published As

Publication number Publication date
CN112306368B (en) 2022-11-04

Similar Documents

Publication Publication Date Title
EP2998861B1 (en) Implementing and deleting method and device for intelligent terminal multi-operation system
CN112306368B (en) Method and device for expanding user data partition by EMMC (enhanced multi-media card)
JP5575338B2 (en) Information processing apparatus, information processing method, and computer program
CN102033790B (en) Method and device for upgrading embedded-type system BOOTROM
CN111796856B (en) Differential upgrading method and device, storage medium and computer equipment
CN102238265B (en) Mobile phone and method for realizing double-system mobile phone
CN108121556B (en) eMMC compatible upgrading method, intelligent terminal and readable storage medium
CN111263354B (en) OTA differential upgrading method and device
CN112162773B (en) Differential upgrading method and device, storage medium and terminal
CN105472278A (en) Method and device for television set screen display control
CN109710286B (en) System upgrading method, device, equipment and storage medium
CN111290773B (en) System upgrade method, device and readable storage medium
CN107783724A (en) A kind of generation method and device of full image file
CN108037932B (en) SPI-NAND configuration file acquisition method and device
CN102664990B (en) Installation and display method of dynamic wallpaper of Android mobile phone
CN117707626A (en) System starting method and electronic equipment
JP2016533588A (en) Storage processing method, apparatus and terminal
CN107148612B (en) Method and device for expanding user partition
CN102184375A (en) Management method and terminal of data in subscriber identity module (SIM) card
CN115951920A (en) Mobile equipment upgrading method and device, storage unit and mobile equipment
CN105701162B (en) Management method for user data partition of intelligent terminal and intelligent terminal
CN113010195B (en) System upgrading method, storage medium and terminal equipment
CN113190244A (en) Method and device for upgrading wireless module, computer equipment and storage medium
KR100811559B1 (en) Method and apparatus managing data storage partitions for non-volatile memory
CN107832090B (en) Method for improving starting speed of man-machine interaction module of fault information processing device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant