CN109918340B - File processing method and terminal equipment - Google Patents

File processing method and terminal equipment Download PDF

Info

Publication number
CN109918340B
CN109918340B CN201910203626.5A CN201910203626A CN109918340B CN 109918340 B CN109918340 B CN 109918340B CN 201910203626 A CN201910203626 A CN 201910203626A CN 109918340 B CN109918340 B CN 109918340B
Authority
CN
China
Prior art keywords
target file
file
processing
type
target
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
CN201910203626.5A
Other languages
Chinese (zh)
Other versions
CN109918340A (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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication 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 Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN201910203626.5A priority Critical patent/CN109918340B/en
Publication of CN109918340A publication Critical patent/CN109918340A/en
Application granted granted Critical
Publication of CN109918340B publication Critical patent/CN109918340B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the technical field of communication, and provides a file processing method and terminal equipment, which are used for solving the problem that the terminal equipment is abnormal due to data abnormality of a memory. The method comprises the following steps: under the condition that data damage of a target file is detected, acquiring the attribute of the target file; and processing the target file according to a processing mode corresponding to the attribute of the target file. In this way, the terminal device can perform different processing for files with different attributes, thereby preventing the terminal device from generating abnormality.

Description

File processing method and terminal equipment
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a file processing method and a terminal device.
Background
A non-volatile memory (hereinafter referred to as memory) is a key component of a terminal device, which can be used to store system data and user data of the terminal device. When an external environment of the terminal device is abnormal, such as abnormal power failure, or an internal environment is abnormal, such as a bad block is generated, data in the memory may be lost, and file data may be damaged.
The prior art mainly includes two processing modes for data corruption of a memory: one is that no error value is returned, so that when the terminal device reads the error data, an unpredictable error may occur; and the other is to return a standard error code, so that the terminal equipment may crash and the like after detecting the error code. That is, when data in the memory is damaged, the terminal device may be abnormal by any of the above processing methods.
It can be seen that, in the prior art, the abnormal data of the memory can cause the abnormal condition of the terminal device.
Disclosure of Invention
The embodiment of the invention provides a file processing method and terminal equipment, and aims to solve the problem that the terminal equipment is abnormal due to data abnormality of a memory.
In order to solve the technical problem, the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a file processing method, including:
under the condition that data damage of a target file is detected, acquiring the attribute of the target file;
and processing the target file according to a processing mode corresponding to the attribute of the target file.
In a second aspect, an embodiment of the present invention further provides a terminal device, including:
the acquisition module is used for acquiring the attribute of the target file under the condition of detecting that the data of the target file is damaged;
and the processing module is used for processing the target file according to a processing mode corresponding to the attribute of the target file.
In a third aspect, an embodiment of the present invention further provides a terminal device, including: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps in the file processing method as described above when executing the computer program.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps in the file processing method as described above.
In the embodiment of the invention, under the condition that the data damage of the target file is detected, the attribute of the target file is obtained; and processing the target file according to a processing mode corresponding to the attribute of the target file. In this way, the terminal device can perform different processing for files with different attributes, thereby preventing the terminal device from generating abnormality.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive exercise.
FIG. 1 is a flowchart of a document processing method according to an embodiment of the present invention;
FIG. 2 is a second flowchart of a document processing method according to an embodiment of the present invention;
FIG. 2a is a schematic storage diagram of a file provided by an embodiment of the present invention;
FIG. 2b is a flowchart illustrating an update of a dynamic file according to an embodiment of the present invention;
FIG. 2c is a diagram illustrating a correspondence relationship between files and processing modes according to an embodiment of the present invention;
FIG. 2d is a schematic diagram of the processing of a corrupted file according to an embodiment of the present invention;
FIG. 2e is a third flowchart of a document processing method according to an embodiment of the present invention;
fig. 3 is one of the structural diagrams of the terminal device provided in the embodiment of the present invention;
fig. 4 is a structural diagram of a processing module in the terminal device according to the embodiment of the present invention;
fig. 5 is a second structural diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. 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.
Referring to fig. 1, fig. 1 is a flowchart of a file processing method according to an embodiment of the present invention, and as shown in fig. 1, the method includes the following steps:
step 101, acquiring the attribute of the target file under the condition that the data of the target file is detected to be damaged.
The target file may be any file in the terminal device, including a system file, a file of a third-party application, or another file.
The attribute of the target file may be an attribute for reflecting a characteristic of the target file, such as a type of the target file, a location where the target file is stored, an importance of the target file, and the like.
The data damage of the target file can be partial data or all data damage, and the target file cannot be read normally under the condition of the data damage of the target file.
And 102, processing the target file according to a processing mode corresponding to the attribute of the target file.
The terminal device may preset a correspondence between the attribute of the target file and the processing manner, and in this step, the target file may be processed according to the correspondence.
When the attributes of the target file include multiple attributes, the terminal device may determine the processing mode according to any one of the attributes, or according to multiple attributes at the same time.
In the prior art, the processing mode is fixed when the data is damaged, and the terminal equipment is abnormal when the data is damaged. By utilizing the file processing method provided by the embodiment of the invention, the corresponding processing method is determined according to the attribute of the target file, so that the target file is processed, the processing flexibility can be improved, and the processing method can be determined by combining different scenes. For example, when the target file is a file of an application program in operation, if the target file is damaged, the normal operation of the application program is affected, and the application program can be reinstalled; when the target file is an unimportant file, the target file can be directly deleted to reduce interference on the terminal equipment.
In the embodiment of the present invention, the file processing method may be applied to a terminal device, for example: a Mobile phone, a Tablet Personal Computer (Tablet Personal Computer), a Laptop Computer (Laptop Computer), a Personal Digital Assistant (PDA), a Mobile Internet Device (MID), a Wearable Device (Wearable Device), or the like.
According to the file processing method, under the condition that data damage of a target file is detected, the attribute of the target file is obtained; and processing the target file according to a processing mode corresponding to the attribute of the target file. In this way, the terminal device can perform different processing for files with different attributes, thereby preventing the terminal device from generating abnormality.
Referring to fig. 2, the present embodiment is mainly different from the above-described embodiments in that the target document is processed according to the type and/or importance level of the target document.
Fig. 2 is a flowchart of a file processing method according to an embodiment of the present invention, and as shown in fig. 2, the file processing method includes the following steps:
step 201, in the case that the data damage of the target file is detected, acquiring the type and/or importance level of the target file.
The relevant explanation of this step can be found in the description of step 101.
The types of the target files can comprise static files and dynamic files, wherein the static files can be files with fixed contents along with the operation of the terminal equipment, and the dynamic files can be files with updated contents along with the operation of the terminal equipment; the types of the object file may be further classified into a system file, a user data file, a junk file, an application file, and the like, and the embodiments of the present invention are not limited to the above-listed types.
The importance level of the target file may be preset by the terminal device.
In this step, either or both of the type and importance level of the target file may be acquired.
In specific implementation, a file database may be established for storing file information, including information such as the type, storage path, creation process, and importance of a file. The storage format of the file database can be seen in fig. 2 a.
For example, the compiling server compiling software may scan all files in the software of the version, store the file information in the static file database, and set the importance of the files in all the static file databases to "0". Files generated during the operation of the system are stored in the dynamic file database, the importance of the files can be determined according to the types of the created files, and the dynamic file updating process can be shown in fig. 2 b. And firstly, creating a file process, creating an application programming interface, and then storing the file into a dynamic file database. The file database may be used as a basis for determining the type and importance of the file.
Step 202, processing the target file according to a processing mode corresponding to the type and/or importance level of the target file.
In this step, the processing mode of the target file may be determined according to the type or the importance level of the target file, or may be determined according to both the type and the importance level.
For example, after the type of the target file is determined to be a dynamic file, the importance level of the dynamic file is further determined, so as to determine the processing mode of the target file. The importance level of the target file can also be determined first, and when the importance level of the target file indicates that the target file is more important, the type of the target file can be further determined. The foregoing is by way of example only.
The processing mode may include: directly deleting files, reinstalling application programs, deleting files in response to user operations, re-downloading files, and the like. Specifically, one of the processing manners may be selected according to the type or importance of the target file, or a plurality of processing manners may be output for selection by the user.
The terminal device may set in advance the correspondence between the type of the file, the importance level, and the processing manner, for example, set a correspondence table as shown in fig. 2 c.
The specific process of processing the target file can be seen in fig. 2 d. The memory is in "state 1" when the data is abnormal, and at this time, if the processor reads the "data abnormal block" of the memory, the unknown abnormality may be caused due to the data error. When the processor deletes or rewrites the data abnormal block of the memory, the memory marks the data abnormal block as a bad block, and replaces the bad block by a reserved block, and the state of the memory is changed into a state 2. In "state 2", there is a bad block in memory, but it is not affected by the processor, i.e., the bad block does not affect the system.
When the file is more important, the bad block processing mechanism in the memory can be triggered in the rewriting mode, and data cannot be lost; when the file is not important, a bad block processing mechanism in the memory can be triggered by deleting, although data may be lost, the influence on the operation of the terminal equipment is small, and the interference on the use of the terminal equipment by a user is small. Different processing modes are adopted for the files according to the importance or the category of the files, so that the influence on the terminal equipment can be reduced, and the interference on the user can also be reduced.
Optionally, the type of the target file is a first type;
the processing the target file according to the processing mode corresponding to the type and/or the importance level of the target file comprises the following steps:
downloading a file identical to the target file in the backup data under the condition that the importance level of the target file is a first level;
under the condition that the importance level of the target file is a second level, responding to the operation of a user, and deleting the target file;
under the condition that the importance level of the target file is a third level, reinstalling an application program, wherein the application program is an application program corresponding to the target file;
and directly deleting the target file under the condition that the importance level of the target file is a fourth level.
In this embodiment, the first type may be any type obtained by dividing the target file into types, such as the dynamic file type described in step 201.
In the case that the importance level of the target file is a first level, the same file as the target file may be downloaded in the backup data, thereby replacing the target file with the downloaded file; and under the condition that the importance level of the target file is the second level, the data may influence the use of the terminal equipment, the user can be prompted to delete the target file, and the target file is deleted according to the user operation. In the event that the importance level of the target file is a third level, the application may be reinstalled to reduce the impact of the target file on the use of the application. In the case where the importance level of the target file is the fourth level, it means that the target file is not important and the target file can be directly deleted.
Therefore, different processing modes are adopted for different types and important files, the processing flexibility can be improved, and the interference of file damage to the use of the terminal equipment is reduced. And the data is deleted according to the user operation, so that the user can be prompted that the file is deleted.
Optionally, the type of the target file is a second type;
the processing the target file according to the processing mode corresponding to the type and/or the importance level of the target file comprises the following steps:
downloading a replacement file with the same content as the target file at a server;
and replacing the target file by using the replacement file.
In this embodiment, the second type may be a static file as described in step 201. The terminal equipment can download the replacement file to replace the target file in the server, so that the damaged file is repaired, important data is prevented from being lost, normal operation of the terminal equipment is guaranteed, and interference to a user is reduced.
Optionally, the downloading, at the server, the replacement file having the same content as the target file includes:
downloading a replacement file with the same content as the target file at a server in the state that the terminal equipment is successfully started, and replacing the target file by using the replacement file when the terminal equipment is in a system repair state;
and under the condition that the terminal equipment fails to start, downloading a replacement file with the same content as the target file in a server under the condition that the terminal equipment is in a system repair state, and replacing the target file by using the replacement file.
In the embodiment, under the condition that the terminal equipment is successfully started, the terminal equipment downloads the replacement file in the server in the starting state and repairs the file in the system repairing state, so that frequent abnormality of the system is prevented, and further data is prevented from being damaged; under the condition that the terminal equipment fails to start, the terminal equipment downloads the replacement file in the server in the system repair state, and repairs the file, so that the file downloading speed and the upgrading speed are increased. The target file may be a read-only system partition data file, which is important for maintaining the system running. When the target file is the data of the non-read-only user area, the terminal equipment can guide and prompt the user to delete the abnormal data, and the influence on the terminal equipment is reduced.
In addition, the terminal equipment can scan the memory regularly in idle time, check abnormal data, and take repairing measures in advance to repair the abnormal data, so that interference caused by data abnormality to a user is reduced.
To facilitate an understanding of the above embodiments, reference is made to the following examples.
When the memory bad block is read, the memory firmware returns an error code to the memory driver, as shown in FIG. 2 e. When the bottom-layer driving error detection program detects the error code returned by the memory, the error information is returned to the upper-layer error detection and processing service device.
When the upper layer error detection and processing service device monitors error data, firstly, an error file path is found, the importance of the file is inquired in a file database according to the error file path, and the file is correspondingly processed according to the importance level of the file. The importance level and the processing of the file can be seen in fig. 2 c. All files of each system version are stored on the server, and for the file with the file importance of 0, the server needs to download the source file for recovery. Other specific processing manners may refer to the specific descriptions in the embodiments, and are not described herein again.
According to the file processing method provided by the embodiment of the invention, the target file is processed according to the type and/or the importance level of the target file. Important data can be prevented from being lost, and the interference of abnormal data to users can be reduced.
Referring to fig. 3, fig. 3 is a structural diagram of a terminal device according to an embodiment of the present invention, and as shown in fig. 3, the terminal device 300 includes: an acquisition module 301 and a processing module 302. Wherein:
an obtaining module 301, configured to obtain an attribute of a target file when data corruption of the target file is detected;
a processing module 302, configured to process the target file according to a processing manner corresponding to the attribute of the target file.
Optionally, the attribute of the target file includes a type and/or an importance level of the target file;
the processing module 302 is specifically configured to process the target file according to a processing manner corresponding to the type and/or importance level of the target file.
Optionally, the type of the target file is a first type;
the processing module 302 is specifically configured to:
downloading a file identical to the target file in the backup data under the condition that the importance level of the target file is a first level;
under the condition that the importance level of the target file is a second level, responding to the operation of a user, and deleting the target file;
under the condition that the importance level of the target file is a third level, reinstalling an application program, wherein the application program is an application program corresponding to the target file;
and directly deleting the target file under the condition that the importance level of the target file is a fourth level.
Optionally, the type of the target file is a second type;
the processing module 302 includes:
a download sub-module 3021 configured to download, at a server, a replacement file having the same content as the target file;
a replacing submodule 3022, configured to replace the target file with the replacement file.
Optionally, the download sub-module 3021 is specifically configured to:
downloading a replacement file with the same content as the target file at a server in the state that the terminal equipment is successfully started, and replacing the target file by using the replacement file when the terminal equipment is in a system repair state;
and under the condition that the terminal equipment fails to start, downloading a replacement file with the same content as the target file in a server under the condition that the terminal equipment is in a system repair state, and replacing the target file by using the replacement file.
The terminal device 300 can implement each process implemented by the terminal device in the above method embodiments, and is not described here again to avoid repetition.
According to the terminal device 300 of the embodiment of the invention, the terminal device can perform different processing aiming at files with different attributes, so that the terminal device is prevented from being abnormal.
Fig. 5 is a schematic diagram of a hardware structure of a terminal device for implementing various embodiments of the present invention, where the terminal device 500 includes, but is not limited to: a radio frequency unit 501, a network module 502, an audio output unit 503, an input unit 504, a sensor 505, a display unit 506, a user input unit 507, an interface unit 508, a memory 509, a processor 510, and a power supply 511. Those skilled in the art will appreciate that the terminal device configuration shown in fig. 5 does not constitute a limitation of the terminal device, and that the terminal device may include more or fewer components than shown, or combine certain components, or a different arrangement of components. In the embodiment of the present invention, the terminal device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted mobile terminal, a wearable device, a pedometer, and the like.
The processor 510 is configured to, when data corruption of a target file is detected, obtain an attribute of the target file; and processing the target file according to a processing mode corresponding to the attribute of the target file. In this way, the terminal device can perform different processing for files with different attributes, thereby preventing the terminal device from generating abnormality.
Optionally, the attribute of the target file includes a type and/or an importance level of the target file; the processor 510 executes the processing manner corresponding to the attribute of the target file to process the target file, including:
and processing the target file according to a processing mode corresponding to the type and/or the importance level of the target file.
Optionally, the type of the target file is a first type; the processor 510 performs the processing on the target file according to the processing manner corresponding to the type and/or importance level of the target file, including:
downloading a file identical to the target file in the backup data under the condition that the importance level of the target file is a first level;
under the condition that the importance level of the target file is a second level, responding to the operation of a user, and deleting the target file;
under the condition that the importance level of the target file is a third level, reinstalling an application program, wherein the application program is an application program corresponding to the target file;
and directly deleting the target file under the condition that the importance level of the target file is a fourth level.
Optionally, the type of the target file is a second type; the processor 510 performs the processing on the target file according to the processing manner corresponding to the type and/or importance level of the target file, including:
downloading a replacement file with the same content as the target file at a server;
and replacing the target file by using the replacement file.
Optionally, the processor 510 executes the downloading of the replacement file having the same content as the target file at the server, including:
downloading a replacement file with the same content as the target file at a server in the state that the terminal equipment is successfully started, and replacing the target file by using the replacement file when the terminal equipment is in a system repair state;
and under the condition that the terminal equipment fails to start, downloading a replacement file with the same content as the target file in a server under the condition that the terminal equipment is in a system repair state, and replacing the target file by using the replacement file.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 501 may be used for receiving and sending signals during a message sending and receiving process or a call process, and specifically, receives downlink data from a base station and then processes the received downlink data to the processor 510; in addition, the uplink data is transmitted to the base station. In general, radio frequency unit 501 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 501 can also communicate with a network and other devices through a wireless communication system.
The terminal device provides the user with wireless broadband internet access through the network module 502, such as helping the user send and receive e-mails, browse webpages, access streaming media, and the like.
The audio output unit 503 may convert audio data received by the radio frequency unit 501 or the network module 502 or stored in the memory 509 into an audio signal and output as sound. Also, the audio output unit 503 may also provide audio output related to a specific function performed by the terminal apparatus 500 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 503 includes a speaker, a buzzer, a receiver, and the like.
The input unit 504 is used to receive an audio or video signal. The input Unit 504 may include a Graphics Processing Unit (GPU) 5041 and a microphone 5042, and the Graphics processor 5041 processes image data of a still picture or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 506. The image frames processed by the graphic processor 5041 may be stored in the memory 509 (or other storage medium) or transmitted via the radio frequency unit 501 or the network module 502. The microphone 5042 may receive sounds and may be capable of processing such sounds into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 501 in case of the phone call mode.
The terminal device 500 further comprises at least one sensor 505, such as light sensors, motion sensors and other sensors. Specifically, the light sensor includes an ambient light sensor that adjusts the brightness of the display panel 5061 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 5061 and/or a backlight when the terminal device 500 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the terminal device posture (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration identification related functions (such as pedometer, tapping), and the like; the sensors 505 may also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which are not described in detail herein.
The display unit 506 is used to display information input by the user or information provided to the user. The Display unit 506 may include a Display panel 5061, and the Display panel 5061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 507 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the terminal device. Specifically, the user input unit 507 includes a touch panel 5071 and other input devices 5072. Touch panel 5071, also referred to as a touch screen, may collect touch operations by a user on or near it (e.g., operations by a user on or near touch panel 5071 using a finger, stylus, or any suitable object or attachment). The touch panel 5071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 510, and receives and executes commands sent by the processor 510. In addition, the touch panel 5071 may be implemented in various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 5071, the user input unit 507 may include other input devices 5072. In particular, other input devices 5072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
Further, the touch panel 5071 may be overlaid on the display panel 5061, and when the touch panel 5071 detects a touch operation thereon or nearby, the touch operation is transmitted to the processor 510 to determine the type of the touch event, and then the processor 510 provides a corresponding visual output on the display panel 5061 according to the type of the touch event. Although in fig. 5, the touch panel 5071 and the display 5061 are two independent components to implement the input and output functions of the terminal device, in some embodiments, the touch panel 5071 and the display 5061 may be integrated to implement the input and output functions of the terminal device, and is not limited herein.
The interface unit 508 is an interface for connecting an external device to the terminal apparatus 500. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 508 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the terminal apparatus 500 or may be used to transmit data between the terminal apparatus 500 and the external device.
The memory 509 may be used to store software programs as well as various data. The memory 509 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 509 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
The processor 510 is a control center of the terminal device, connects various parts of the entire terminal device by using various interfaces and lines, and performs various functions of the terminal device and processes data by running or executing software programs and/or modules stored in the memory 509 and calling data stored in the memory 509, thereby performing overall monitoring of the terminal device. Processor 510 may include one or more processing units; preferably, the processor 510 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 510.
The terminal device 500 may further include a power supply 511 (e.g., a battery) for supplying power to various components, and preferably, the power supply 511 may be logically connected to the processor 510 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system.
In addition, the terminal device 500 includes some functional modules that are not shown, and are not described in detail herein.
Preferably, an embodiment of the present invention further provides a terminal device, which includes a processor 510, a memory 509, and a computer program that is stored in the memory 509 and can be run on the processor 510, and when being executed by the processor 510, the computer program implements each process in the file processing method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not described here again.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the file processing method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (6)

1. A file processing method is applied to terminal equipment and is characterized by comprising the following steps:
under the condition that data damage of a target file is detected, acquiring the attribute of the target file;
processing the target file according to a processing mode corresponding to the attribute of the target file;
the attributes of the target file comprise the type and the importance level of the target file;
the processing the target file according to the processing mode corresponding to the attribute of the target file comprises the following steps:
processing the target file according to a processing mode corresponding to the type and the importance level of the target file;
the type of the target file is a second type, the second type is a static file type, and the static file is a file with fixed content along with the operation of the terminal equipment;
the processing the target file according to the processing mode corresponding to the type and the importance level of the target file comprises the following steps:
downloading a replacement file with the same content as the target file at a server;
replacing the target file with the replacement file;
the downloading of the replacement file with the same content as the target file at the server comprises:
downloading a replacement file with the same content as the target file at a server in the state that the terminal equipment is successfully started, and replacing the target file by using the replacement file when the terminal equipment is in a system repair state;
and under the condition that the terminal equipment fails to start, downloading a replacement file with the same content as the target file in a server under the condition that the terminal equipment is in a system repair state, and replacing the target file by using the replacement file.
2. The method of claim 1, wherein the type of the target file is a first type;
the processing the target file according to the processing mode corresponding to the type and the importance level of the target file comprises the following steps:
downloading a file identical to the target file in the backup data under the condition that the importance level of the target file is a first level;
under the condition that the importance level of the target file is a second level, responding to the operation of a user, and deleting the target file;
under the condition that the importance level of the target file is a third level, reinstalling an application program, wherein the application program is an application program corresponding to the target file;
and directly deleting the target file under the condition that the importance level of the target file is a fourth level.
3. A terminal device, comprising:
the acquisition module is used for acquiring the attribute of the target file under the condition of detecting that the data of the target file is damaged;
the processing module is used for processing the target file according to a processing mode corresponding to the attribute of the target file;
the attributes of the target file comprise the type and the importance level of the target file;
the processing module is specifically used for processing the target file according to a processing mode corresponding to the type and the importance level of the target file;
the type of the target file is a second type, the second type is a static file type, and the static file is a file with fixed content along with the operation of the terminal equipment;
the processing module comprises:
the downloading submodule is used for downloading a replacement file with the same content as the target file in a server;
the replacing submodule is used for replacing the target file by the replacing file;
the download sub-module is specifically configured to:
downloading a replacement file with the same content as the target file at a server in the state that the terminal equipment is successfully started, and replacing the target file by using the replacement file when the terminal equipment is in a system repair state;
and under the condition that the terminal equipment fails to start, downloading a replacement file with the same content as the target file in a server under the condition that the terminal equipment is in a system repair state, and replacing the target file by using the replacement file.
4. The terminal device according to claim 3, wherein the type of the target file is a first type;
the processing module is specifically configured to:
downloading a file identical to the target file in the backup data under the condition that the importance level of the target file is a first level;
under the condition that the importance level of the target file is a second level, responding to the operation of a user, and deleting the target file;
under the condition that the importance level of the target file is a third level, reinstalling an application program, wherein the application program is an application program corresponding to the target file;
and directly deleting the target file under the condition that the importance level of the target file is a fourth level.
5. A terminal device, comprising: memory, processor and computer program stored on the memory and executable on the processor, the processor implementing the steps in the file processing method according to any one of claims 1 to 2 when executing the computer program.
6. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps in the file processing method according to any one of claims 1 to 2.
CN201910203626.5A 2019-03-18 2019-03-18 File processing method and terminal equipment Active CN109918340B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910203626.5A CN109918340B (en) 2019-03-18 2019-03-18 File processing method and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910203626.5A CN109918340B (en) 2019-03-18 2019-03-18 File processing method and terminal equipment

Publications (2)

Publication Number Publication Date
CN109918340A CN109918340A (en) 2019-06-21
CN109918340B true CN109918340B (en) 2021-07-02

Family

ID=66965332

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910203626.5A Active CN109918340B (en) 2019-03-18 2019-03-18 File processing method and terminal equipment

Country Status (1)

Country Link
CN (1) CN109918340B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110377363A (en) * 2019-07-17 2019-10-25 Oppo(重庆)智能科技有限公司 Method, apparatus, terminal and the storage medium of application are installed

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103970579A (en) * 2014-05-29 2014-08-06 中国银行股份有限公司 Application version deploying method and application version deploying device
CN104424246A (en) * 2013-08-27 2015-03-18 鸿富锦精密工业(深圳)有限公司 Data storage system and method
CN107766005A (en) * 2017-11-02 2018-03-06 深圳天珑无线科技有限公司 E-file processing method, device and electric terminal

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101876914A (en) * 2010-04-23 2010-11-03 中兴通讯股份有限公司 Method for deleting files and mobile terminal
CN106096447A (en) * 2016-06-15 2016-11-09 杭州华三通信技术有限公司 A kind of document protection method and device
US20190005038A1 (en) * 2017-06-30 2019-01-03 Xerox Corporation Method and apparatus for grouping documents based on high-level features clustering
CN107766177A (en) * 2017-10-12 2018-03-06 广东欧珀移动通信有限公司 Start optimization method, device, storage medium and terminal device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104424246A (en) * 2013-08-27 2015-03-18 鸿富锦精密工业(深圳)有限公司 Data storage system and method
CN103970579A (en) * 2014-05-29 2014-08-06 中国银行股份有限公司 Application version deploying method and application version deploying device
CN107766005A (en) * 2017-11-02 2018-03-06 深圳天珑无线科技有限公司 E-file processing method, device and electric terminal

Also Published As

Publication number Publication date
CN109918340A (en) 2019-06-21

Similar Documents

Publication Publication Date Title
CN108845853B (en) Application program starting method and mobile terminal
CN109800179B (en) Method for acquiring data, method for sending data, host and embedded memory
CN107580147B (en) Management method of notification message and mobile terminal
CN111142930B (en) Installation package file packaging method and device, terminal device and storage medium
CN107967153B (en) Application program management method and mobile terminal
CN108228230A (en) Upgrade method, terminal and the computer readable storage medium of UFS firmwares
CN108089977A (en) A kind of abnormality eliminating method of application program, device and mobile terminal
US20220255639A1 (en) Radio frequency parameter processing method and device, and mobile terminal and storage medium
CN111522575B (en) Application program upgrading method and electronic equipment
CN111124753A (en) Application program control method, electronic equipment and server
CN109284146B (en) Light application starting method and mobile terminal
CN106919458B (en) Method and device for Hook target kernel function
CN108491125B (en) Operation control method of application store and mobile terminal
CN107844318B (en) Upgrading method of operating system, mobile terminal and server
CN108228357B (en) Memory cleaning method and mobile terminal
CN111443847B (en) Push message processing method and electronic equipment
CN109918340B (en) File processing method and terminal equipment
CN110471682B (en) Application program updating method and mobile terminal
CN111130995B (en) Image control method, electronic device, and storage medium
CN111966373A (en) APN resetting method, terminal equipment and storage medium
CN108491225B (en) Update package generation method and mobile terminal
CN109885317B (en) Information processing method, server and terminal
CN109871324B (en) Control operation method and device
CN107979688B (en) application program management method and mobile terminal
CN109783379B (en) Script execution exception determining method and 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