[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN105068891B - Method and terminal for repairing eMMC file - Google Patents

Method and terminal for repairing eMMC file Download PDF

Info

Publication number
CN105068891B
CN105068891B CN201510501429.3A CN201510501429A CN105068891B CN 105068891 B CN105068891 B CN 105068891B CN 201510501429 A CN201510501429 A CN 201510501429A CN 105068891 B CN105068891 B CN 105068891B
Authority
CN
China
Prior art keywords
file
emmc
check code
terminal
backup
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.)
Active
Application number
CN201510501429.3A
Other languages
Chinese (zh)
Other versions
CN105068891A (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.)
TCL Mobile Communication Technology Ningbo Ltd
Original Assignee
TCL Mobile Communication Technology Ningbo 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 TCL Mobile Communication Technology Ningbo Ltd filed Critical TCL Mobile Communication Technology Ningbo Ltd
Priority to CN201510501429.3A priority Critical patent/CN105068891B/en
Publication of CN105068891A publication Critical patent/CN105068891A/en
Application granted granted Critical
Publication of CN105068891B publication Critical patent/CN105068891B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Retry When Errors Occur (AREA)

Abstract

The invention provides a method and a terminal for repairing an eMMC file, wherein the eMMC file is backed up in advance, a check code of the eMMC file obtained by current calculation is compared with a check code of the eMMC file obtained in advance in the terminal starting-up stage, and if the check code of the eMMC file is different from the check code of the eMMC file, the eMMC file is damaged, and the terminal starts the backup file to replace the eMMC file. The method and the device can repair the damaged eMMC file, namely the system file, in the eMMC due to frequent reading, are beneficial to normal starting of the terminal and avoid abnormity of an operating system.

Description

Method and terminal for repairing eMMC file
Technical Field
The invention relates to a file monitoring and repairing technology in the field of storage, in particular to a method for repairing an eMMC (Embedded multimedia Card) file and a terminal using the method.
Background
The eMMC integrates an MMC (Multi Media Card) interface, a flash memory, and a host controller. At present, more and more terminals adopt the eMMC as a storage unit, and an operating system of the terminal, especially an android system, reads a large amount of data from the eMMC frequently in a startup phase, where the data includes executable programs, library files, resource configuration files, and the like, so that the probability of damaging files stored in the eMMC is greatly increased, and once the files stored in the eMMC are damaged, the mobile terminal is very easy to be started and the operating system is abnormal.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and a terminal for repairing an eMMC file, so as to repair a system file in the eMMC that is damaged due to frequent reading.
The method for repairing the embedded multimedia card eMMC file of the terminal provided by the embodiment of the invention comprises the following steps: acquiring a check code of the eMMC file in advance, and backing up the eMMC file to obtain a corresponding backup file; calculating a check code of the current eMMC file at the early stage of the starting-up of the terminal, and comparing the check code with a check code of the eMMC file acquired in advance; and when the check code of the eMMC file obtained by calculation is judged to be different from the check code of the eMMC file obtained in advance, the terminal starts the backup file to replace the eMMC file.
The digest algorithm MD5 is adopted to acquire the check code of the eMMC file in advance.
The flash memory of the eMMC of the terminal comprises a first storage area and a second storage area, the backup files are stored in the first storage area, and the second storage area is used for storing system files downloaded when the operating system of the terminal is upgraded.
After the terminal starts the backup file to replace the eMMC file, the method further includes: and forming and storing a repair log according to the replacement time, the check code of the backup file, the calculated check code of the eMMC file, the backup file and the eMMC file at the early stage of the starting.
Before comparing the check code of the eMMC file obtained by calculation with the check code of the eMMC file obtained in advance, the method further comprises the following steps: judging whether the backup file is effective or not; and when the backup file is judged to be valid, comparing the check code of the eMMC file obtained by calculation with the check code of the eMMC file obtained in advance.
The embodiment of the invention provides a terminal, which comprises: the computing module is used for acquiring a check code of the eMMC file of the terminal in advance; the backup storage module is used for backing up the eMMC file to obtain a corresponding backup file; in the early stage of the terminal starting up, the calculation module is further used for calculating the check code of the current eMMC file; the processing module is used for comparing the check code of the eMMC file obtained through calculation with the check code of the eMMC file obtained in advance; and when the processing module judges that the check code of the eMMC file obtained by calculation is different from the check code of the eMMC file obtained in advance, the processing module starts the backup file to replace the eMMC file.
The calculation module adopts a digest algorithm MD5 to acquire the check code of the eMMC file in advance.
The flash memory of the eMMC of the terminal comprises a backup storage module and another storage module, the backup file is stored in the backup storage module, and the other storage module is used for storing a system file downloaded when the operating system of the terminal is upgraded.
After the backup file is started to replace the eMMC file in the early stage of the starting-up, the processing module is further used for forming and storing a repair log according to the replacement time, the check code of the backup file, the calculated check code of the eMMC file, the backup file and the eMMC file in the early stage of the starting-up.
Before comparing the check code of the eMMC file obtained through calculation with the check code of the eMMC file obtained in advance, the processing module is further used for judging whether the backup file is valid or not, and when judging that the backup file is valid, comparing the check code of the eMMC file obtained through calculation with the check code of the eMMC file obtained in advance.
The method and the terminal for restoring the eMMC file, provided by the embodiment of the invention, have the advantages that the eMMC file is backed up in advance, the check code of the eMMC file obtained by current calculation is compared with the check code of the eMMC file obtained in advance in the starting-up stage of the terminal, if the check code of the eMMC file obtained in advance is different from the check code of the eMMC file obtained in advance, the eMMC file damaged is replaced by the backup file, so that the eMMC file damaged due to frequent reading in the eMMC file is restored, the normal starting-up of the terminal is facilitated, and the abnormity of an operating system is avoided.
Drawings
Fig. 1 is a flowchart illustrating an embodiment of a method for repairing an eMMC file according to the present invention;
fig. 2 is a schematic block diagram of an embodiment of the terminal of the present invention.
Detailed Description
The technical solutions of the exemplary embodiments provided in the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention.
Fig. 1 is a flowchart illustrating an embodiment of a method for repairing an eMMC file according to the present invention. It should be understood that the execution subject of each step in this embodiment may be a Central Processing Unit (CPU), a driver, an eMMC underlying driver, or a terminal having any of the foregoing, and is not limited thereto. As shown in fig. 1, the method includes:
step S11: the method comprises the steps of obtaining a check code of the eMMC file in advance, and backing up the eMMC file to obtain a corresponding backup file.
The eMMC stores data required for booting the terminal, such as system files such as executable files, library files, configuration resources, and the like, and when the terminal is powered on and booted, the terminal needs to read the data into a Memory such as an SDRAM (Synchronous Dynamic random Access Memory), a DDR (Double data Rate Synchronous random Access Memory), and the like.
Based on the above boot process, this embodiment may acquire check codes for all eMMC files stored in the eMMC, or may acquire only check codes for part of the eMMC files.
In this embodiment, a MD5(Message-Digest Algorithm5, fifth edition) standard Algorithm is preferably used to obtain a check code of the eMMC file in advance, where the check code may be an MD5 value of all data included in the eMMC file, or may be a package file formed by combining the eMMC file and an MD5 value of the eMMC file.
In view of the fact that the purpose of backing up the eMMC file is to perform replacement and repair when the eMMC file is damaged in the subsequent boot process, the embodiment may also back up all the eMMC files stored in the eMMC, or may only back up a part of the eMMC files, where the part of the eMMC files is customized by a user or preset by the terminal according to the role of the terminal in the boot process according to the registration sequence of important programs from high to low.
The backup file is stored in a flash memory of the eMMC, specifically, the flash memory of the eMMC comprises a first storage area and a second storage area, the first storage area is defined as a system partition to store the backup file, and the second storage area stores a system file downloaded when an operating system of the terminal is upgraded for system upgrade. In an actual boot application scenario, the memory of the second storage area is larger and the memory of the first storage area is smaller, for example, 40MB (megabytes), so that the embodiment may define that one or more eMMC files that are accessed most frequently during boot are backed up. The backup method is not limited in this embodiment.
Step S12: and calculating the check code of the current eMMC file at the early stage of the starting-up of the terminal.
The terminal calculates the check code for the backup eMMC file, but the terminal still reads other eMMC files required by the open-top machine only without calculating the check code. The check code of the current eMMC file can be obtained by calculation through an MD5 standard algorithm, and the check code of the current eMMC file can also be obtained through an algorithm for obtaining the check code of the eMMC file in advance.
Step S13: and comparing the check code of the current eMMC file obtained by calculation with the check code of the eMMC file obtained in advance, and judging whether the check code of the current eMMC file is the same as the check code of the eMMC file obtained in advance.
If the two are the same, indicating that the eMMC file which has been backed up is not damaged, executing step S15; if the two are different, it indicates that the eMMC file that has been backed up has been damaged, step S14 is executed.
Step S14: the terminal starts the backup file to replace the eMMC file, and the normal operation of the starting is ensured.
That is to say, when the terminal determines that the eMMC file is damaged in the boot stage, the backup file may be enabled to replace the damaged eMMC file to perform the boot operation, so as to repair the damaged eMMC file in the eMMC due to frequent reading, which is beneficial to normal boot of the terminal and avoids the abnormality of the operating system.
Step S15: and the terminal enters the normal stage of the starting-up, and the system operates normally.
Certainly, if the backup file itself is damaged, the terminal cannot be started, and for this, the embodiment of the present invention may determine whether the backup file itself is damaged by determining whether the backup file is valid, before comparing the check code of the calculated eMMC file with the check code of the pre-acquired eMMC file, and when determining that the backup file is valid, compare the check code of the calculated eMMC file with the check code of the pre-acquired eMMC file.
Further, no matter whether the repair is successful or not, in this embodiment, a repair log may be formed and stored according to the replacement time, the check code of the backup file, the calculated check code of the eMMC file, the backup file, and the eMMC file at the previous stage of the boot.
Fig. 2 is a schematic block diagram of an embodiment of the terminal of the present invention. As shown in fig. 2, the terminal 20 includes a computing module 21, a backup storage module 22, and a processing module 23, where:
the backup storage module 22 is configured to backup the eMMC file to obtain a corresponding backup file. The backup storage module 22 is a part of a flash memory of the eMMC of the terminal 20, and is configured to store a backup file, and the flash memory further includes another storage module, where the another storage module is configured to store a system file downloaded when the operating system of the terminal 20 is upgraded.
The calculation module 21 is configured to obtain a check code of the eMMC file of the terminal 20 in advance. Preferably, the calculation module 21 uses a digest algorithm MD5 to obtain the check code of the eMMC file in advance.
In an early stage of the current boot of the terminal 20, the calculation module 21 is further configured to calculate a check code of the current eMMC file. The processing module 23 is configured to compare the check code of the eMMC file calculated by the calculating module 21 with a check code of the eMMC file acquired in advance.
Preferably, before comparing the calculated check code of the eMMC file with the check code of the pre-acquired eMMC file, the processing module 23 is further configured to determine whether the backup file is valid, and when determining that the backup file is valid, compare the calculated check code of the eMMC file with the check code of the pre-acquired eMMC file.
When the processing module 23 determines that the calculated check code of the eMMC file is different from the check code of the pre-acquired eMMC file, the processing module 23 starts the backup file to replace the eMMC file at the previous stage of the boot.
After the backup file is started to replace the eMMC file in the previous stage of the boot, the processing module 23 may form and store a repair log according to the replacement time, the check code of the backup file, the calculated check code of the eMMC file, the backup file, and the eMMC file in the previous stage of the boot.
The above-described structure of the plurality of modules of the terminal 20, which correspondingly implements the repairing method described in the above-described embodiment, has the same technical effect as the above-described structure.
It should be understood that the above-described embodiment of the terminal 20 is merely illustrative, and the division of the modules is merely a logical division, and that in actual implementation, there may be other divisions, for example, two modules may be integrated into another system, or some features may be omitted, or not implemented. In addition, the modules may be connected to each other through some interfaces, and may also be in an electrical or other form. The above modules, which are used as the components of the terminal 20, may or may not be physical blocks, may be located in one place, or may be distributed on multiple network units, and may be implemented in the form of software functional blocks or hardware.
In addition, if the above functions of this embodiment are implemented in the form of software functional units and sold or used as a stand-alone product, the functions may be stored in a computer readable storage medium, that is, the embodiments of the present invention may be embodied in the form of a software product, which includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention.
On the basis of the above, the above mentioned embodiments are only examples of the present invention, and not intended to limit the scope of the present invention, and all equivalent structures or equivalent flow transformations made by using the contents of the present specification and the drawings, such as the combination of technical features between the embodiments, or the direct or indirect application to other related technical fields, are included in the scope of the present invention.

Claims (8)

1. A method for repairing an embedded multimedia card (eMMC) file of a terminal is characterized by comprising the following steps:
acquiring a check code of the eMMC file in advance, and backing up the eMMC file to obtain a corresponding backup file;
calculating a check code of the current eMMC file at the early stage of the starting-up of the terminal, and comparing the check code with the check code of the eMMC file acquired in advance;
when the check code of the eMMC file obtained through calculation is judged to be different from the check code of the eMMC file obtained in advance, the terminal starts the backup file to replace the eMMC file;
before comparing the check code of the calculated eMMC file with the check code of the pre-acquired eMMC file, the method further includes:
judging whether the backup file is valid;
and when the backup file is judged to be valid, comparing the check code of the eMMC file obtained by calculation with the check code of the eMMC file obtained in advance.
2. The method of claim 1, wherein a digest algorithm MD5 is used to pre-fetch the check code of the eMMC file.
3. The method of claim 1, wherein a flash memory of the eMMC of the terminal comprises a first storage area and a second storage area, wherein the backup file is stored in the first storage area, and wherein the second storage area is used to store system files downloaded during an operating system upgrade of the terminal.
4. The method of claim 1, wherein after the terminal enables the backup file to replace the eMMC file, further comprising:
and forming and storing a repair log according to the replacement time, the check code of the backup file, the calculated check code of the eMMC file, the backup file and the eMMC file at the early stage of the starting-up.
5. A terminal, characterized in that the terminal comprises:
the computing module is used for acquiring a check code of the eMMC file of the terminal in advance;
the backup storage module is used for backing up the eMMC file to obtain a corresponding backup file;
at the early stage of the current startup of the terminal, the calculation module is further used for calculating a check code of the current eMMC file;
the processing module is used for comparing the check code of the eMMC file obtained through calculation with the check code of the eMMC file obtained in advance;
when the processing module judges that the check code of the eMMC file obtained by calculation is different from the check code of the eMMC file obtained in advance, the processing module starts the backup file to replace the eMMC file;
before comparing the calculated check code of the eMMC file with the check code of the pre-acquired eMMC file,
the processing module is further configured to determine whether the backup file is valid, and compare the check code of the eMMC file obtained by the calculation with the check code of the eMMC file obtained in advance when it is determined that the backup file is valid.
6. The terminal of claim 5, wherein the calculation module uses a digest algorithm MD5 to pre-obtain the check code of the eMMC file.
7. The terminal of claim 5, wherein the flash memory of the eMMC of the terminal comprises the backup storage module and another storage module, wherein the backup file is stored in the backup storage module, and wherein the another storage module is configured to store a system file downloaded during an operating system upgrade of the terminal.
8. The terminal of claim 5, wherein after enabling the backup file to replace the eMMC file in the early stage of the current boot,
the processing module is further configured to form a repair log and store the repair log according to the replacement time, the check code of the backup file, the calculated check code of the eMMC file, the backup file, and the eMMC file at the previous stage of the boot.
CN201510501429.3A 2015-08-14 2015-08-14 Method and terminal for repairing eMMC file Active CN105068891B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510501429.3A CN105068891B (en) 2015-08-14 2015-08-14 Method and terminal for repairing eMMC file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510501429.3A CN105068891B (en) 2015-08-14 2015-08-14 Method and terminal for repairing eMMC file

Publications (2)

Publication Number Publication Date
CN105068891A CN105068891A (en) 2015-11-18
CN105068891B true CN105068891B (en) 2020-09-29

Family

ID=54498268

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510501429.3A Active CN105068891B (en) 2015-08-14 2015-08-14 Method and terminal for repairing eMMC file

Country Status (1)

Country Link
CN (1) CN105068891B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106776138A (en) * 2016-12-16 2017-05-31 广东美晨通讯有限公司 Data reconstruction method and Data Recapture Unit
CN107766177A (en) * 2017-10-12 2018-03-06 广东欧珀移动通信有限公司 Boot optimization method, device, storage medium and terminal equipment
CN108009054A (en) * 2017-12-27 2018-05-08 江苏徐工信息技术股份有限公司 A kind of double eMMC backup storage systems and method
CN108363632A (en) * 2018-03-13 2018-08-03 上海闻泰电子科技有限公司 A kind of start-up detection method and terminal
CN114691422A (en) * 2022-03-02 2022-07-01 深圳市天视通视觉有限公司 A method and device for repairing abnormal startup of equipment, and electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1991779A (en) * 2005-12-30 2007-07-04 联想(北京)有限公司 Safety chip based virus prevention method
CN103412759A (en) * 2013-08-19 2013-11-27 深圳市金立通信设备有限公司 Production data recovery method and terminal
CN103544026A (en) * 2012-07-11 2014-01-29 国基电子(上海)有限公司 Electronic device capable of being safely upgraded and upgrading method
CN103793293A (en) * 2012-11-03 2014-05-14 上海欧朋软件有限公司 Incremental backup method for archived data files
CN104216800A (en) * 2014-08-27 2014-12-17 福建星网视易信息系统有限公司 Automatic system fault recovering method and device based on data redundancy
CN104392188A (en) * 2014-11-06 2015-03-04 三星电子(中国)研发中心 Security data storage method and system
CN107066343A (en) * 2017-01-24 2017-08-18 广东欧珀移动通信有限公司 Method and device for repairing partition table in mobile terminal and mobile terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100017650A1 (en) * 2008-07-19 2010-01-21 Nanostar Corporation, U.S.A Non-volatile memory data storage system with reliability management

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1991779A (en) * 2005-12-30 2007-07-04 联想(北京)有限公司 Safety chip based virus prevention method
CN103544026A (en) * 2012-07-11 2014-01-29 国基电子(上海)有限公司 Electronic device capable of being safely upgraded and upgrading method
CN103793293A (en) * 2012-11-03 2014-05-14 上海欧朋软件有限公司 Incremental backup method for archived data files
CN103412759A (en) * 2013-08-19 2013-11-27 深圳市金立通信设备有限公司 Production data recovery method and terminal
CN104216800A (en) * 2014-08-27 2014-12-17 福建星网视易信息系统有限公司 Automatic system fault recovering method and device based on data redundancy
CN104392188A (en) * 2014-11-06 2015-03-04 三星电子(中国)研发中心 Security data storage method and system
CN107066343A (en) * 2017-01-24 2017-08-18 广东欧珀移动通信有限公司 Method and device for repairing partition table in mobile terminal and mobile terminal

Also Published As

Publication number Publication date
CN105068891A (en) 2015-11-18

Similar Documents

Publication Publication Date Title
US9471435B2 (en) Information processing device, information processing method, and computer program
CN105068891B (en) Method and terminal for repairing eMMC file
US9141464B2 (en) Computing device and method for processing system events of computing device
US20110302572A1 (en) Embedded network device and firmware upgrading method
US10514904B2 (en) Dynamically applying a patch to a computer application
CN104866391B (en) A kind of end message backup method and device based on increment information system
US20130138934A1 (en) Loading configuration information
CN101807152B (en) Basic output and input system for self verification of selection read only memory and verification method thereof
US10606579B2 (en) Multi-system terminal system updating method, updating device and terminal
US8788800B2 (en) OS processing method, system and non-transitory computer readable storage medium thereof
WO2016206514A1 (en) Startup processing method and device
CN111506326A (en) Method, device and equipment for upgrading terminal equipment and storage medium
WO2016101519A1 (en) Method and device for realizing restart of operating system
CN108762828B (en) DSP multi-core array secondary starting method and device
CN109582332B (en) System upgrading method and device for Internet camera
CN110941516B (en) Operating system restoration method, device, equipment and storage medium
CN111930429B (en) Method for rapidly starting Android operating system and electronic equipment
CN103605591A (en) Method and device for controlling memory initialization of terminal system
CN113703823A (en) BMC (baseboard management controller) firmware upgrading method and device, electronic equipment and storage medium
US20170242687A1 (en) Dynamically applying a patch to a shared library
CN101930384A (en) Fault tolerance method and device for file system
US11704198B2 (en) Method and apparatus for providing recovery from a computing device boot up error
CN108021405B (en) Method and device for driving storage medium in SOC system starting process
CN116339908A (en) Virtual machine starting method, device, computer equipment and storage medium
CN113641556B (en) System, method, device, processor and computer readable storage medium for ensuring stable operation of automobile instrument

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200908

Address after: 315000 10 / F, No. 5, Lane 999, Yangfan Road, hi tech Zone, Ningbo City, Zhejiang Province

Applicant after: TCL mobile communication technology (Ningbo) Co.,Ltd.

Address before: 516006 Guangdong province Huizhou City Zhongkai high tech Zone and seven West Road No. 86

Applicant before: HUIZHOU TCL MOBILE COMMUNICATION Co.,Ltd.

GR01 Patent grant
GR01 Patent grant