CN109614267A - A kind of method, apparatus, storage medium and terminal for repairing booting abnormal problem - Google Patents

A kind of method, apparatus, storage medium and terminal for repairing booting abnormal problem Download PDF

Info

Publication number
CN109614267A
CN109614267A CN201811487618.XA CN201811487618A CN109614267A CN 109614267 A CN109614267 A CN 109614267A CN 201811487618 A CN201811487618 A CN 201811487618A CN 109614267 A CN109614267 A CN 109614267A
Authority
CN
China
Prior art keywords
file
terminal
data
subregion
preset
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.)
Pending
Application number
CN201811487618.XA
Other languages
Chinese (zh)
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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201811487618.XA priority Critical patent/CN109614267A/en
Publication of CN109614267A publication Critical patent/CN109614267A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1441Resetting or repowering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the present application discloses a kind of method, apparatus, storage medium and terminal for repairing booting abnormal problem.This method includes the carry event detected for the data subregion for being stored with file destination;Obtain the mounting time of the data subregion;If the mounting time is more than preset time threshold, the backup file of the file destination is obtained by preset data backup area;The file destination in the data subregion, triggering terminal reboot event are replaced using the backup file.By using the technical solution of the application, when the mounting time of data subregion is more than preset time threshold in detecting start process, the backup file of file destination is obtained by preset data backup area, realize that terminal voluntarily restores the effect of normal use when being switched on abnormal problem caused by occurring because of specific reasons.

Description

A kind of method, apparatus, storage medium and terminal for repairing booting abnormal problem
Technical field
The invention relates to smart machine technology more particularly to it is a kind of repair booting abnormal problem method, apparatus, Storage medium and terminal.
Background technique
With terminal intelligence degree increase, in people's daily life using more more and more universal.However, by It is intelligent in the height of terminal, it will usually because various reason leads to terminal boot failure.
Currently, terminal user generallys use the hand-operated forced side restarted when encountering the stuck or not problem of start-up of booting Formula trial makes terminal normal boot-strap.But may have due to leading to terminal boot failure very much, not all asks Topic can be solved by way of restarting, and in most cases, terminal user, which needs to send terminal to maintenance center, to tie up It repairs.After-sales service personnel are usually to be made terminal factory reset using some tools or solved booting by brush machine to lose Problem is lost, it follows that terminal booting scheme in the related technology haves the defects that not problem of start-up can not be automatically repaired.
Summary of the invention
The embodiment of the present application provides a kind of method, apparatus, storage medium and terminal for repairing booting abnormal problem, Ke Yiyou Change booting scheme in the related technology.
In a first aspect, the embodiment of the present application provides a kind of method for repairing booting abnormal problem, comprising:
Detect the carry event for the data subregion for being stored with file destination;
Obtain the mounting time of the data subregion;
If the mounting time is more than preset time threshold, the standby of the file destination is obtained by preset data backup area Part file;
The file destination in the data subregion, triggering terminal reboot event are replaced using the backup file.
Second aspect, the embodiment of the present application also provides a kind of device for repairing booting abnormal problem, which includes:
Event checking module, for detecting the carry event for being directed to the data subregion for being stored with file destination;
Mounting time obtains module, for obtaining the mounting time of the data subregion;
Backup file acquisition module is backed up if being more than preset time threshold for the mounting time by preset data Area obtains the backup file of the file destination;
File replacement module is touched for replacing the file destination in the data subregion using the backup file Send out terminal reboot event.
The third aspect, the embodiment of the present application also provides a kind of computer readable storage mediums, are stored thereon with computer Program realizes the method for the reparation booting abnormal problem as described in the embodiment of the present application when the program is executed by processor.
Fourth aspect, the embodiment of the present application provide a kind of terminal, including memory, and processor and storage are on a memory And the computer program that can be run in processor, the processor realize such as the embodiment of the present application when executing the computer program The method of the reparation booting abnormal problem.
The embodiment of the present application provides a kind of scheme for repairing booting abnormal problem, detects for being stored with file destination The carry event of data subregion, obtains the mounting time of the data subregion;If the mounting time is more than preset time threshold, by Preset data backup area obtains the backup file of the file destination;The target text of the data subregion is replaced using the backup file Part, triggering terminal reboot event.By using the technical solution of the application, the carry of data subregion in detecting start process When time is more than preset time threshold, the backup file of file destination is obtained by preset data backup area;It can provide using one Kind backup Exchange rings realize the abnormal scheme of terminal self-healing booting, realize that the booting caused by generation is because of specific reasons is different When Chang Wenti, terminal voluntarily restores the effect of normal use.
Detailed description of the invention
Fig. 1 is a kind of flow chart of method for repairing booting abnormal problem provided by the embodiments of the present application;
Fig. 2 is a kind of frame diagram of starting up's process of terminal based on Android system;
Fig. 3 is the flow chart of another method for repairing booting abnormal problem provided by the embodiments of the present application;
Fig. 4 is the system framework figure under a kind of android system;
Fig. 5 is the flow chart of the method for another reparation booting abnormal problem provided by the embodiments of the present application;
Fig. 6 is a kind of structural block diagram of device for repairing booting abnormal problem provided by the embodiments of the present application;
Fig. 7 is a kind of structural schematic diagram of terminal provided by the embodiments of the present application;
Fig. 8 is a kind of structural block diagram of smart phone provided by the embodiments of the present application.
Specific embodiment
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining the application, rather than the restriction to the application.It also should be noted that in order to just Part relevant to the application is illustrated only in description, attached drawing rather than entire infrastructure.
It should be mentioned that some exemplary embodiments are described as before exemplary embodiment is discussed in greater detail The processing or method described as flow chart.Although each step is described as the processing of sequence by flow chart, many of these Step can be implemented concurrently, concomitantly or simultaneously.In addition, the sequence of each step can be rearranged.When its operation The processing can be terminated when completion, it is also possible to have the additional step being not included in attached drawing.The processing can be with Corresponding to method, function, regulation, subroutine, subprogram etc..
Fig. 1 is a kind of flow chart of method for repairing booting abnormal problem provided by the embodiments of the present application, and the present embodiment can Suitable for the scene of monitor terminal boot failure situation, this method can generally be integrated in end by software and or hardware realization In end.As shown in Figure 1, this method comprises:
Step 110 detects the carry event for being directed to the data subregion for being stored with file destination.
It should be noted that the terminal in the embodiment of the present application may include mobile phone, tablet computer, laptop, calculating The equipment that the settings such as machine, handheld device and intelligent appliance are equipped with operating system.To operating system in the embodiment of the present application Type without limitation, such as may include Android (Android) operating system, window (Windows) operating system and apple (ios) operating system etc..
It should be noted that the carry of above-mentioned data subregion is operated based on the mount_ inside init in terminal start process All orders are realized.The starting procedure of terminal is sketched by taking Android as an example.The start-up course of Android can be divided into two ranks Section, the first stage is the starting of Linux, and second stage is the starting (being properly termed as upper layer starting procedure) of Android.Fig. 2 is A kind of frame diagram of starting up's process of the terminal based on Android system.As shown in Fig. 2, starting up's process includes: 201, Boot Rom --- when pressing starting key, chip guide starts to execute since the pre-set code for being solidificated in ROM, Then bootload program is to RAM.202, Bootloader, also known as bootstrap are run before operating system A Duan Chengxu, be operation first program then jump to and reflect for mapping document of operation system to be copied in RAM As the entrance of file go execute this document, can also be referred to as enter start-up loading mode.203, Kernel --- by kernel plus After being loaded into memory, the boot kernel stage is initially entered, in the kernel vectoring phase finally, start_kernel is called to enter kernel Startup stage mainly completes most of initial work of kernel.Start_kernel can finally start user's space Init process.204, init process --- after initializing kernel, just will start init process, in Linux it is all into Journey is come out by the direct or indirect fork of init process.Init process is responsible for several cores of most critical in creation system Daemon (guards) process, including but not limited to zygote and service manager.Wherein, zygote is android starting First dalvik virtual machine, it be responsible for start Java process.Service manager is the basis of Binder communication. 205, Zygote process --- the process is the parent process of all Java processes.For example, zygote virtual machine starts subprocess System_server, while a Socket is defined, for receiving ActivityManagerService starting application program Request.206, SystemServer process --- when SystemServer process is opened, it can initialize ActivityManagerService.Meanwhile the service library of local system can be loaded, it calls createSystemContext () System context is created, create ActivityThread and open various services etc..207, Home Activity --- After ActivityManagerService is opened, finishBooting () can be called to complete bootup process, while sending and opening Machine broadcast shows desktop into the interface home.
It should be noted that can realize carry data subregion by executing fs_mgr_mount_all () function.It is optional , using fork () function creation subprocess, the carry for executing data subregion is operated, and design is advantageous in that i.e. in this way Make to occur being switched on abnormal problem caused by because of reasons such as file corruptions during the carry of data subregion, can also protect init into Journey.
Illustratively, setting monitoring program can be increased.Wherein, the code of the setting monitoring program is calling carry data It is executed before the method for subregion.Processing is monitored to carry operation by the setting monitoring program.If detection is to data subregion Carry function by above by fork () function creation subprocess calling, it is determined that detect for be stored with target text The carry event of the data subregion of part.It should be noted that triggering there are many kinds of the modes of above-mentioned carry event, however it is not limited on State the mode enumerated.For example, it is also possible to pass through binding service (bindService) mode pull-up framework by setting service Carry event etc. of the layer to data subregion.
Step 120, the mounting time for obtaining the data subregion.
It should be noted that mounting time is by the runing time of carry function, i.e. carry function starts to execute until inspection The carry function is measured to execute to the END position time experienced.
Illustratively, the operational process of the carry function of the data subregion can be monitored by above-mentioned setting monitoring program; The runing time for recording the carry function, using the runing time as the mounting time of the data subregion.Optionally, it is detecting When the program of carry function meets exit criteria, stop timing.Wherein, if detecting, carry function is executed to END, The program for confirmly detecting carry function meets exit criteria.In addition, if detecting, the runing time of the carry function is more than pre- If time threshold, it is determined that detect that the program of carry function meets exit criteria.
If step 130, the mounting time are more than preset time threshold, the target is obtained by preset data backup area The backup file of file.
It should be noted that can determine preset time threshold according to the carry duration of data subregion in terminal start process Value.For example, statistics different model different terminals in normal boot-strap process, the carry duration of data subregion, in the carry Increase by a set time on the basis of length, obtains preset time threshold.Wherein, the set time can be 2 seconds, be also possible to other Time value.It should be noted that the setting of the set time needs the practical switch on condition in view of terminal.If the set time What is be arranged is too long, it is determined that mounting time is longer more than the time required for preset time threshold, and then increases terminal and examining Voluntarily restore the time it takes when measuring booting exception, extends the available machine time.If set time setting is too small, have The case where being likely to occur error detection, it is possible to the state that terminal is capable of normal boot-strap is mistaken for terminal and abnormal ask that be switched on occur Topic.
In the embodiment of the present application, preset data backup area, which can be, is stored with text identical with data intrapartition destination mark file Another subregion of part.Optionally, preset data backup area can be terminal producer in order to store some key logs or its It is not intended to the customization subregion for the information removed.The customization subregion has the characteristics that read-write frequency lower than given threshold, this sets Determining threshold value can be the lower read-write frequency of system default, can be to avoid because of the case where frequently read-write causes subregion to damage hair It is raw.The characteristics of preset data backup area will not be wiped free of when being also equipped with brush machine.
In the embodiment of the present application, which can store target complete file.Due in data subregion File destination includes the associated documents such as third party application of address list, short message, setting data and user installation, with Family uses terminal the increase of time, and the file in data subregion is continuously increased.If storing number in preset data backup area According to the full dose data (i.e. target complete file) of subregion, then can a large amount of occupied terminal memories, influence the operational efficiency of terminal.In view of The above problem only can also be not easy the data reacquired, such as contact person after preset data backup area stores some loss With the private datas such as short message, to avoid file destination backup file a large amount of occupied terminal memories the case where occur.
Illustratively, the operational process that the carry function of the data subregion is monitored in setting monitoring program, based on monitoring knot After fruit determines mounting time, the mounting time is obtained according to the setting period.Judge whether the mounting time is more than preset time Threshold value;If so, executing the operation for obtaining the backup file of the file destination by preset data backup area.If preset data backs up It is only stored with the corresponding backup file of file destination of data subregion in area, then the file destination is obtained by preset data backup area Backup file can be obtain preset data backup area in all files.If preset data backup area is not only stored with data The file destination of subregion is also stored with other files, then traverses preset data backup area according to the file identification of file destination, Obtain the file destination determining according to this document mark.In addition, if only setting in storing data subregion in preset data backup area Determine file (such as private data), then preset data backup area is traversed according to the file identification of the setting file, reach the setting The backup file of file.
It should be noted that if the mounting time is less than preset time threshold, it is determined that successfully hangs after stopping timing Data subregion is carried, the downstream in start process is continued to execute.
Step 140 replaces the file destination in the data subregion using the backup file, and triggering terminal is restarted Event.
It illustratively, will be by the backup file copy that is obtained in preset data backup area to data by setting monitoring program Subregion, to replace all file destinations in the data subregion, triggering bootstrap starting, to guide the generation solidified in the chips Code starts since predefined position, realizes that terminal is restarted.It, can be to avoid due to the file destination being substituted in data subregion Boot failure occurs again caused by there is a situation where damaging because of file destination, realizes terminal self-healing booting abnormal problem Effect.
It should be noted that being replacing for target complete file by what is obtained in preset data backup area in some instances Exchange of notes part.It is the backup file that file is set in file destination by what is obtained in preset data backup area in other examples, In such a scenario, it needs to replace using backup file in the data subregion after corresponding setting file, to file destination In remaining file except the setting file execute delete operation, then, triggering bootstrap starting is solidificated in chip with guidance In code start since predefined position.Designing in this way is advantageous in that on the basis of self-healing booting abnormal problem On, EMS memory occupation is effectively reduced, the operational efficiency of terminal is improved.
The technical solution of the present embodiment detects the carry event for the data subregion for being stored with file destination, obtains The mounting time of the data subregion;If the mounting time is more than preset time threshold, which is obtained by preset data backup area Mark the backup file of file;The file destination of the data subregion, triggering terminal reboot event are replaced using the backup file.Pass through Using the technical solution of the application, when the mounting time of data subregion is more than preset time threshold in detecting start process, The backup file of file destination is obtained by preset data backup area;It can provide and realize terminal certainly using a kind of backup Exchange rings Row repairs the scheme of booting abnormal problem, realizes that terminal is voluntarily extensive when being switched on abnormal problem caused by occurring because of specific reasons The effect of multiple normal use.
Fig. 3 is the flow chart of another method for repairing booting abnormal problem provided by the embodiments of the present application, such as Fig. 3 institute Show, this method comprises:
If step 301, the carry function for detecting framework layers of calling data subregion, it is determined that detect to be directed to and deposit Contain the carry event of the data subregion of file destination.
It should be noted that framework layers, also known as ccf layer, are a part of terminal system frame, provide whole The mechanism of a system operation.
Illustrate that the system framework of terminal, Fig. 4 are the system framework under a kind of android system by taking android system as an example Figure, it should be noted that the sequence of each layer does not represent its real sequence in figure.As shown in figure 4, system framework includes: core Application layer 401, framework layer 402 (ccf layer), JNI layer 403, Dalvik virtual machine 404, local library 405, HAL layer 406 (hardware abstraction layer), producer's adaptation layer 407 and inner nuclear layer 408.Wherein, core application layer 401 includes system preset in terminal Included application, such as the softwares such as contact person and music.Ccf layer 402 is referred to as framework layers and provides entirely The mechanism of android system running, such as window management or program installation kit management.JNI layer 403 is java applet and bottom One mechanism of operating system communication.Android exploitation uses Java language, and the Java code of application program can be compiled into Dalvik virtual machine bytecode, these bytecodes are explained by Dalvik virtual machine 404 and are executed.Local library 405 generally comprises a variety of Library file, the library skia etc. such as comprising the library standard C, to drawing image.Hardware abstraction layer is referred to as HAL layer 406, A set of hardware interface that Android is defined runs the code on upper layer independently of different hardware.Producer's adaptation layer 407 include the interface function of manufacturer terminal self-defining, is one simply to producer's adaptation layer in the realization of HAL layer interface The calling of interface function.Inner nuclear layer 408 is linux kernel, includes various hardware drivings etc. in kernel.
It should be noted that carry function is for file system mounted function in init, for example, mount_all is ordered Fs_mgr_mount_all () function etc. under enabling.
Illustratively, it if detecting framework layers of calling fs_mgr_mount_all () function, confirmly detects and is directed to It is stored with the carry event of the data subregion of file destination.
Step 302, operation setting monitoring program, monitor the carry function of the data subregion by the setting monitoring program Operational process.
Illustratively, the setting monitoring program is run before the method for calling carry data subregion, is monitored by the setting Implementation procedure of the program tracking for fs_mgr_mount_all () function of carry data subregion.It should be noted that if inspection The exit statement for measuring fs_mgr_mount_all () function is performed, it is determined that the corresponding program code of carry function executes It completes.
Step 303, the runing time for recording the carry function, using the runing time as the extension of the data subregion Carry the time.
Illustratively, by detecting beginning timing carry function brings into operation constantly, it is detected moving back for the carry function Whether sentence is performed out.If the exit statement is performed, it is determined that the program of the carry function meets exit criteria, the carry The corresponding program code of function executes completion, stops timing.In addition, when above-mentioned mounting time is more than preset time threshold, It can determine that the program of the carry function meets exit criteria.Since mounting time is more than preset time threshold, it can determine and deposit In terminal booting abnormal problem, stop timing, is ready to carry out reparation operation.
Step 304 obtains the mounting time according to the setting period.
It should be noted that the setting period can be system default value, it can be according to the data in the case of normal boot-strap point The mounting time in area determines periodic quantity.The mounting time in the case of normal boot-strap is such as divided into 5 periods, when will be each Between section it is corresponding be used as periodic quantity.It is understood that the application does not make to have there are many kinds of the modes of determining above-mentioned periodic quantity Body limits.
Step 305 judges whether the mounting time is more than preset time threshold, if so, thening follow the steps 306, otherwise Execute step 304.
It should be noted that in the case of preset time threshold is according to normal boot-strap, data subregion in terminal start process Carry duration determines.In general, by preset time threshold setting slightly larger than in the case of normal boot-strap, data in terminal start process The carry duration of subregion.
Step 306 is obtained the setting backup file that file is set in the file destination by preset data backup area.
Illustratively, the file identification of file is set by determining in file destination.For example, file destination includes private number According to, setting data and third party application data etc. can be according to file since the filename of different types of file is different Name is by filtering out setting file in file destination.According to setting file file identification traverse preset data backup area, obtain with This document identifies matched setting backup file.
Above-mentioned setting backup file copy to data subregion is replaced setting file by step 307.
Step 308 removes the interior remaining file in addition to the setting file of the data subregion.
It should be noted that the remaining file in data subregion in addition to setting file refers to the setting for being stored with terminal The file of information or the relevant information of third party application etc., these information have after removing, can easily again Therefore the characteristics of reacquisition, even if not backing up to this class file, uses the upper shadow that not will cause and can not restore in terminal It rings.But a big chunk memory headroom can be saved by not backing up to this class file.
Illustratively, when the mounting time is more than preset time threshold, file destination is divided into according to type difference and being set Determine file and remaining file, removing (or to delete) operation is executed to remaining file, in addition, standby using the setting of setting file Setting file in part file replacement data subregion, to replace or delete impaired file.
Step 309, triggering terminal reboot event.
Illustratively, it is deleted (i.e. clearly in completion file replacement (i.e. setting file is set the replacement of backup file) and file Except remaining file) after, triggering bootstrap starting, to guide the code solidified in the chips to open since predefined position It is dynamic, it realizes that terminal is restarted, returns to step 301.
Step 310 judges whether terminal restarts success, if so, 311 are thened follow the steps, it is no to then follow the steps 309.
Illustratively, if detect terminal booting mark value become represent be switched on successfully value when, determine that terminal is restarted Success.For example, if detect bootcomplete be switched on successfully attribute be 1, illustrate booting complete.
If terminal boot failure, triggering terminal reboot event is until detect satisfaction setting termination condition.Wherein, it sets Termination condition can be terminal power and exhaust.Optionally, it is more than setting time that setting termination condition, which can also be that terminal restarts number, Number threshold value etc..After executing above-mentioned file replacement and file delete operation, terminal is restarted or is had failed, then can not confirm The reason for causing terminal booting abnormal, it is possible to be that setting file is damaged, it is also possible to due to lacking a certain setting file Cannot start etc..At this point it is possible to which terminal is made to restore normal by way of brush machine.
Step 311, the file identification based on the remaining file generate booting abnormal log.
Illustratively, due to deleting the remaining file in data subregion, terminal restarts success, then illustrates to deposit in remaining file In the file damaged by long-time service, booting abnormal log is generated according to the file identification of remaining file, in order to which terminal is ground Terminal easily damaged file after a period of use at the booting abnormal log analysis that hair personnel are reported based on different terminals.
The technical solution of the present embodiment, when the mounting time for detecting data subregion is more than preset time threshold, by pre- If data backup area obtains the setting backup file of setting file;Using the setting text in setting backup file replacement data subregion Part, and delete the remaining file in data subregion in addition to setting file, triggering terminal reboot event;If terminal restarts success, Then the file identification based on remaining file generates booting abnormal log.By using above-mentioned technical proposal, only in data subregion Partial document backed up, a big chunk memory headroom can be saved.Furthermore, it is possible to using the form of booting abnormal log Recording exceptional file positions the reason of leading to boot failure convenient for terminal research staff, optimizes booting stream for terminal research staff Journey provides foundation.
In some instances, it can will analyze the easily damaged file come and preset data backup area is written, it is thus possible to Easily damaged file is backed up in advance.Terminal occur load data subregion during booting exception when, can be direct Corresponding partial document is replaced by preset data backup area copy backup file, avoids excessive committed memory space, and will not send out It is raw to influence the case where terminal uses because removing partial document.
Fig. 5 is the flow chart of the method for another reparation booting abnormal problem provided by the embodiments of the present application, such as Fig. 5 institute Show, this method comprises:
If step 501, the carry function for detecting framework layers of calling data subregion, it is determined that detect to be directed to and deposit Contain the carry event of the data subregion of file destination.
Step 502, operation setting monitoring program, monitor the carry function of the data subregion by the setting monitoring program Operational process.
Step 503, the runing time for recording the carry function, using the runing time as the extension of the data subregion Carry the time.
Step 504 obtains the mounting time according to the setting period.
Step 505 judges whether the mounting time is more than preset time threshold, if so, thening follow the steps 506, otherwise Execute step 504.
Step 506 is obtained the setting backup file that file is set in the file destination by preset data backup area.
Above-mentioned setting backup file copy to data subregion is replaced setting file by step 507.
Step 508 removes the interior remaining file in addition to the setting file of the data subregion.
Step 509, triggering terminal reboot event.
Illustratively, it is deleted (i.e. clearly in completion file replacement (i.e. setting file is set the replacement of backup file) and file Except remaining file) after, triggering bootstrap starting, to guide the code solidified in the chips to open since predefined position It is dynamic, it realizes that terminal is restarted, returns to step 501.
Step 510 judges whether terminal restarts success, if so, 511 are thened follow the steps, it is no to then follow the steps 509.
Step 511, the file identification based on the remaining file generate booting abnormal log.
The booting abnormal log is stored in reserved subregion by step 512.
It should be noted that the read-write frequency of the reserved subregion is lower than given threshold, and in brush machine, the reserved subregion is not It can be wiped free of.Wherein, reserved subregion is terminal producer to store some key logs or other letters for being not intended to be removed The customization subregion of breath.Reserved subregion has the characteristics that read-write frequency lower than given threshold, which can be system default Lower read-write frequency, can to avoid because frequently read-write cause subregion to damage the case where.The reserved subregion is also equipped with brush The characteristics of will not being wiped free of when machine, can be safe keep records of booting exception information booting abnormal log.
Illustratively, after generating booting abnormal log, it is written into reserved subregion.
Step 513, detect meet preset condition when, read the journal file by the reserved subregion and exported.
It should be noted that preset condition includes but is not limited to detect the information acquisition request of default diagnostic tool, with And detect that terminal restarts the mobile data flow for successfully accessing WiFi or terminal afterwards more than setting flow threshold etc..
Illustratively, when detecting the information acquisition request that default diagnostic tool is sent, subregion reading is reserved by this and is somebody's turn to do The reason of journal file is simultaneously sent to default diagnostic tool, leads to terminal booting abnormal problem in order to after-sales staff collection, sells Personnel can feed back to the research staff of terminal producer after being collected into the related data for leading to terminal booting abnormal problem afterwards.Its In, default diagnostic tool can be not switched on for diagnosis terminal, the program of terminal crash or terminal booting the problems such as blocking.
Illustratively, after terminal is switched on successfully, the AP such as terminal access WiFi are detected, then are reported abnormal booting log To the server of terminal producer, in order to which the research staff of manufacturer terminal obtains the corresponding key of the failure that is not switched on of each terminal Information.Optionally, can also judge whether remaining mobile receipt flow is more than given threshold after terminal is switched on successfully, if so, Abnormal document log is then reported to the server of terminal producer.It is understood that terminal sends log to setting server Mode can there are many kinds of, the embodiment of the present application is simultaneously not especially limited.For example, can be by the way that log can be uploaded extremely with WiFi The server of terminal producer.It for another example, can also be by way of short message mode or mobile data etc..
The technical solution of the present embodiment is stored in reserved subregion, it is safe to realize after generating booting abnormal log Storage leads to the effect of the terminal not key message of problem of start-up;In addition, when meeting preset condition, by the booting abnormal log It is reported, may cause the file of terminal not problem of start-up in order to which the research staff of manufacturer terminal quickly positions, for research and development Personnel determine that the abnormal reason of terminal booting provides data basis and can effectively optimize starting procedure in turn.
Fig. 6 is a kind of structural block diagram of device for repairing booting abnormal problem provided by the embodiments of the present application, which can It by software and or hardware realization, is typically integrated in terminal, can voluntarily be modified by executing the method for repairing booting abnormal problem Part terminal booting abnormal problem.As shown in fig. 6, the device includes:
Event checking module 610, for detecting the carry event for being directed to the data subregion for being stored with file destination;
Mounting time obtains module 620, for obtaining the mounting time of the data subregion;
Backup file acquisition module 630, it is standby by preset data if being more than preset time threshold for the mounting time Part area obtains the backup file of the file destination;
File replacement module 640, for replacing the file destination in the data subregion using the backup file, Triggering terminal reboot event.
The embodiment of the present application provides a kind of device for repairing booting abnormal problem, detects for being stored with file destination The carry event of data subregion, obtains the mounting time of the data subregion;If the mounting time is more than preset time threshold, by Preset data backup area obtains the backup file of the file destination;The target text of the data subregion is replaced using the backup file Part, triggering terminal reboot event.By using the technical solution of the application, the carry of data subregion in detecting start process When time is more than preset time threshold, the backup file of file destination is obtained by preset data backup area;It can provide using one Kind backup Exchange rings realize the abnormal scheme of terminal self-healing booting, realize that the booting caused by generation is because of specific reasons is different When Chang Wenti, terminal voluntarily restores the effect of normal use.
Optionally, mounting time obtains module 620 and is specifically used for:
Monitor the operational process of the carry function of the data subregion;
The runing time for recording the carry function, using the runing time as the mounting time of the data subregion;
When detecting that the program of the carry function meets exit criteria, stop timing.
Optionally, backup file acquisition module 630 is specifically used for:
The mounting time is obtained according to the setting period;
Judge whether the mounting time is more than preset time threshold, wherein preset time threshold was switched on according to terminal The carry duration of data subregion described in journey determines;
If so, obtaining the backup file of the file destination by preset data backup area;
If the mounting time is less than the preset time threshold after stopping timing, it is determined that number described in success carry According to subregion.
Optionally, the backup file of the file destination is obtained by preset data backup area, comprising:
The setting backup file that file is set in the file destination is obtained by preset data backup area;
And before triggering terminal reboot event, further includes:
Remove the remaining file in the data subregion in addition to the setting file.
Optionally, further includes:
Log generation module, for if terminal restarts success, being based on the residue after triggering terminal reboot event The file identification of file generates booting abnormal log.
Optionally, further includes:
Log memory module, for inciting somebody to action after the file identification based on the remaining file generates booting abnormal log The booting abnormal log is stored in reserved subregion, wherein the read-write frequency of the reserved subregion is lower than given threshold, and is brushing When machine, the reserved subregion will not be wiped free of;
Journal output module, for detect meet preset condition when, the log text is read by the reserved subregion Part simultaneously exports.
Optionally, event checking module 610 is specifically used for:
If detecting the carry functions of framework layers of calling data subregion, it is determined that detect for being stored with target The carry event of the data subregion of file.
The embodiment of the present application also provides a kind of storage medium comprising computer executable instructions, and the computer is executable It instructs when being executed by computer processor for executing the method for repairing booting abnormal problem, this method comprises:
Detect the carry event for the data subregion for being stored with file destination;
Obtain the mounting time of the data subregion;
If the mounting time is more than preset time threshold, the standby of the file destination is obtained by preset data backup area Part file;
The file destination in the data subregion, triggering terminal reboot event are replaced using the backup file.
Storage medium --- any various types of memory devices or storage equipment.Term " storage medium " is intended to wrap It includes: install medium, such as CD-ROM, floppy disk or magnetic tape equipment;Computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Lan Basi (Rambus) RAM etc.;Nonvolatile memory, such as flash memory, magnetic medium (such as hard disk or optical storage);Register or the memory component of other similar types etc..Storage medium can further include other Memory of type or combinations thereof.In addition, storage medium can be located at program in the first computer system being wherein performed, Or can be located in different second computer systems, second computer system is connected to the by network (such as internet) One computer system.Second computer system can provide program instruction to the first computer for executing." storage is situated between term Matter " may include may reside in different location (such as by network connection different computer systems in) two or More storage mediums.Storage medium can store the program instruction that can be performed by one or more processors and (such as implement For computer program).
Certainly, a kind of storage medium comprising computer executable instructions, computer provided by the embodiment of the present application The operation for the reparation booting abnormal problem that executable instruction is not limited to the described above, can also be performed the application any embodiment institute Relevant operation in the method for the reparation booting abnormal problem of offer.
The embodiment of the present application provides a kind of terminal, and it is different that reparation booting provided by the embodiments of the present application can be integrated in the terminal The device of Chang Wenti.Fig. 7 is a kind of structural schematic diagram of terminal provided by the embodiments of the present application.As shown in fig. 7, the terminal includes Memory 710 and processor 720.The memory 710, for storing computer program, file destination and backup file etc.;Institute Processor 720 is stated to read and execute the computer program stored in the memory 710.The processor 720 is described in the execution The carry event detected for the data subregion for being stored with file destination is performed the steps of when computer program;Obtain institute State the mounting time of data subregion;If the mounting time is more than preset time threshold, institute is obtained by preset data backup area State the backup file of file destination;The file destination in the data subregion is replaced using the backup file, triggering is eventually Hold reboot event.
The memory and processor enumerated in above-mentioned example are some components of terminal, and the terminal can also include Other components.By taking smart phone as an example, illustrate the possible structure of above-mentioned terminal.Fig. 8 is one kind provided by the embodiments of the present application The structural block diagram of smart phone.As shown in figure 8, the smart phone may include: memory 801, central processing unit (Central Processing Unit, CPU) 802 (also known as processors, hereinafter referred to as CPU), Peripheral Interface 803, RF (Radio Frequency, radio frequency) circuit 805, voicefrequency circuit 806, loudspeaker 811, touch screen 812, power management chip 808, input/ Output (I/O) subsystem 809, other input/control devicess 810 and outside port 804, these components pass through one or more Communication bus or signal wire 807 communicate.
It should be understood that diagram smart phone 800 is only an example of terminal, and smart phone 800 can be with With than shown in the drawings more or less component, two or more components can be combined, or can have Different component configurations.Various parts shown in the drawings can include one or more signal processings and/or dedicated integrated It is realized in the combination of hardware, software or hardware and software including circuit.
The smart phone with regard to the device provided in this embodiment for being integrated with reparation booting abnormal problem carries out detailed below Description.
Memory 801, the memory 801 can be accessed by CPU802, Peripheral Interface 803 etc., and the memory 801 can It can also include nonvolatile memory to include high-speed random access memory, such as one or more disk memory, Flush memory device or other volatile solid-state parts.Computer program is stored in memory 801, can also be stored default File and default white list etc..
The peripheral hardware that outputs and inputs of equipment can be connected to CPU802 and deposited by Peripheral Interface 803, the Peripheral Interface 803 Reservoir 801.
I/O subsystem 809, the I/O subsystem 809 can be by the input/output peripherals in equipment, such as touch screen 812 With other input/control devicess 810, it is connected to Peripheral Interface 803.I/O subsystem 809 may include 8091 He of display controller For controlling one or more input controllers 8092 of other input/control devicess 810.Wherein, one or more input controls Device 8092 processed receives electric signal from other input/control devicess 810 or sends electric signal to other input/control devicess 810, Other input/control devicess 810 may include physical button (push button, rocker buttons etc.), dial, slide switch, behaviour Vertical pole clicks idler wheel.It is worth noting that input controller 8092 can with it is following any one connect: keyboard, infrared port, The indicating equipment of USB interface and such as mouse.
Touch screen 812, the touch screen 812 are the input interface and output interface between user terminal and user, can It is shown to user depending on output, visual output may include figure, text, icon, video etc..
Display controller 8091 in I/O subsystem 809 receives electric signal from touch screen 812 or sends out to touch screen 812 Electric signals.Touch screen 812 detects the contact on touch screen, and the contact that display controller 8091 will test is converted to and is shown The interaction of user interface object on touch screen 812, i.e. realization human-computer interaction, the user interface being shown on touch screen 812 Object can be the icon of running game, the icon for being networked to corresponding network etc..It is worth noting that equipment can also include light Mouse, light mouse are the extensions for the touch sensitive surface for not showing the touch sensitive surface visually exported, or formed by touch screen.
RF circuit 805 is mainly used for establishing the communication of mobile phone Yu wireless network (i.e. network side), realizes mobile phone and wireless network The data receiver of network and transmission.Such as transmitting-receiving short message, Email etc..Specifically, RF circuit 805 receives and sends RF letter Number, RF signal is also referred to as electromagnetic signal, and RF circuit 805 converts electrical signals to electromagnetic signal or electromagnetic signal is converted to telecommunications Number, and communicated by the electromagnetic signal with communication network and other equipment.RF circuit 805 may include for executing The known circuit of these functions comprising but it is not limited to antenna system, RF transceiver, one or more amplifiers, tuner, one A or multiple oscillators, digital signal processor, CODEC (COder-DECoder, coder) chipset, user identifier mould Block (Subscriber Identity Module, SIM) etc..
Voicefrequency circuit 806 is mainly used for receiving audio data from Peripheral Interface 803, which is converted to telecommunications Number, and the electric signal is sent to loudspeaker 811.
Loudspeaker 811 is reduced to sound for mobile phone to be passed through RF circuit 805 from the received voice signal of wireless network And the sound is played to user.
Power management chip 808, the hardware for being connected by CPU802, I/O subsystem and Peripheral Interface are powered And power management.
Terminal provided by the embodiments of the present application, when the mounting time of data subregion is more than default in detecting start process Between threshold value when, by preset data backup area obtain file destination backup file;It can provide using a kind of backup Exchange rings It realizes the abnormal scheme of terminal self-healing booting, realizes when being switched on abnormal problem caused by occurring because of specific reasons, terminal Voluntarily restore the effect of normal use.
Device, storage medium and the terminal of the reparation booting abnormal problem provided in above-described embodiment can be performed the application and appoint The method that booting abnormal problem is repaired provided by embodiment of anticipating has and executes the corresponding functional module of this method and beneficial to effect Fruit.The not technical detail of detailed description in the above-described embodiments, reference can be made to repairing booting provided by the application any embodiment The method of abnormal problem.
Note that above are only the preferred embodiment and institute's application technology principle of the application.It will be appreciated by those skilled in the art that The application is not limited to specific embodiment described here, be able to carry out for a person skilled in the art it is various it is apparent variation, The protection scope readjusted and substituted without departing from the application.Therefore, although being carried out by above embodiments to the application It is described in further detail, but the application is not limited only to above embodiments, in the case where not departing from the application design, also It may include more other equivalent embodiments, and scope of the present application is determined by the scope of the appended claims.

Claims (10)

1. a kind of method for repairing booting abnormal problem characterized by comprising
Detect the carry event for the data subregion for being stored with file destination;
Obtain the mounting time of the data subregion;
If the mounting time is more than preset time threshold, the backup text of the file destination is obtained by preset data backup area Part;
The file destination in the data subregion, triggering terminal reboot event are replaced using the backup file.
2. the method according to claim 1, wherein obtaining the mounting time of the data subregion, comprising:
Monitor the operational process of the carry function of the data subregion;
The runing time for recording the carry function, using the runing time as the mounting time of the data subregion;
When detecting that the program of the carry function meets exit criteria, stop timing.
3. the method according to claim 1, wherein if the mounting time be more than preset time threshold, by Preset data backup area obtains the backup file of the file destination, comprising:
The mounting time is obtained according to the setting period;
Judge whether the mounting time is more than preset time threshold, wherein preset time threshold is according in terminal start process The carry duration of the data subregion determines;
If so, obtaining the backup file of the file destination by preset data backup area;
If the mounting time is less than the preset time threshold after stopping timing, it is determined that data point described in success carry Area.
4. the method according to claim 1, wherein obtaining the standby of the file destination by preset data backup area Part file, comprising:
The setting backup file that file is set in the file destination is obtained by preset data backup area;
And before triggering terminal reboot event, further includes:
Remove the remaining file in the data subregion in addition to the setting file.
5. according to the method described in claim 4, it is characterized in that, after triggering terminal reboot event, further includes:
If terminal restarts success, the file identification based on the remaining file generates booting abnormal log.
6. according to the method described in claim 5, it is characterized in that, generating booting in the file identification based on the remaining file After abnormal log, further includes:
The booting abnormal log is stored in reserved subregion, wherein the read-write frequency of the reserved subregion is lower than given threshold, And in brush machine, the reserved subregion will not be wiped free of;
Detect meet preset condition when, read the journal file by the reserved subregion and exported.
7. method according to any one of claim 1 to 6, which is characterized in that detect for being stored with file destination Data subregion carry event, comprising:
If detecting the carry functions of framework layers of calling data subregion, it is determined that detect for being stored with file destination Data subregion carry event.
8. a kind of device for repairing booting abnormal problem characterized by comprising
Event checking module, for detecting the carry event for being directed to the data subregion for being stored with file destination;
Mounting time obtains module, for obtaining the mounting time of the data subregion;
Backup file acquisition module is obtained if being more than preset time threshold for the mounting time by preset data backup area Take the backup file of the file destination;
File replacement module, for replacing the file destination in the data subregion using the backup file, triggering is eventually Hold reboot event.
9. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is held by processor The method of the reparation booting abnormal problem as described in any in claim 1-7 is realized when row.
10. a kind of terminal, which is characterized in that including memory, processor and storage can be run on a memory and in processor Computer program, the reparation as described in any in claim 1-7 is realized when the processor executes the computer program The method of booting abnormal problem.
CN201811487618.XA 2018-12-06 2018-12-06 A kind of method, apparatus, storage medium and terminal for repairing booting abnormal problem Pending CN109614267A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811487618.XA CN109614267A (en) 2018-12-06 2018-12-06 A kind of method, apparatus, storage medium and terminal for repairing booting abnormal problem

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811487618.XA CN109614267A (en) 2018-12-06 2018-12-06 A kind of method, apparatus, storage medium and terminal for repairing booting abnormal problem

Publications (1)

Publication Number Publication Date
CN109614267A true CN109614267A (en) 2019-04-12

Family

ID=66007338

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811487618.XA Pending CN109614267A (en) 2018-12-06 2018-12-06 A kind of method, apparatus, storage medium and terminal for repairing booting abnormal problem

Country Status (1)

Country Link
CN (1) CN109614267A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112181934A (en) * 2020-09-10 2021-01-05 苏州浪潮智能科技有限公司 NFS partition mounting method, device, equipment and medium
CN112328343A (en) * 2020-10-30 2021-02-05 湖北亿咖通科技有限公司 Vehicle Android system exception handling method and system and storage medium
CN112565896A (en) * 2019-09-10 2021-03-26 深圳Tcl数字技术有限公司 System repair method, terminal and storage medium
CN112579359A (en) * 2020-12-24 2021-03-30 深圳市科力锐科技有限公司 Business system reconstruction method, device, equipment and storage medium
CN116055310A (en) * 2022-06-28 2023-05-02 荣耀终端有限公司 Method, device and network equipment for recovering user configuration information
WO2023103755A1 (en) * 2021-12-10 2023-06-15 中兴通讯股份有限公司 Terminal starting method, electronic device, and computer-readable storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104572352A (en) * 2015-01-12 2015-04-29 福建升腾资讯有限公司 POS terminal key data backup recovery method

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104572352A (en) * 2015-01-12 2015-04-29 福建升腾资讯有限公司 POS terminal key data backup recovery method

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112565896A (en) * 2019-09-10 2021-03-26 深圳Tcl数字技术有限公司 System repair method, terminal and storage medium
CN112565896B (en) * 2019-09-10 2023-09-19 深圳Tcl数字技术有限公司 System repairing method, terminal and storage medium
CN112181934A (en) * 2020-09-10 2021-01-05 苏州浪潮智能科技有限公司 NFS partition mounting method, device, equipment and medium
CN112328343A (en) * 2020-10-30 2021-02-05 湖北亿咖通科技有限公司 Vehicle Android system exception handling method and system and storage medium
CN112579359A (en) * 2020-12-24 2021-03-30 深圳市科力锐科技有限公司 Business system reconstruction method, device, equipment and storage medium
CN112579359B (en) * 2020-12-24 2024-05-03 深圳市科力锐科技有限公司 Service system reconstruction method, device, equipment and storage medium
WO2023103755A1 (en) * 2021-12-10 2023-06-15 中兴通讯股份有限公司 Terminal starting method, electronic device, and computer-readable storage medium
CN116055310A (en) * 2022-06-28 2023-05-02 荣耀终端有限公司 Method, device and network equipment for recovering user configuration information
CN116055310B (en) * 2022-06-28 2023-10-20 荣耀终端有限公司 Method, device and network equipment for recovering user configuration information

Similar Documents

Publication Publication Date Title
CN109614267A (en) A kind of method, apparatus, storage medium and terminal for repairing booting abnormal problem
CN109522147A (en) A kind of method, apparatus, storage medium and the terminal of record booting exception information
CN102043655B (en) Method and system for carrying out advanced uninstall on software
CN109542744B (en) Method, device, storage medium and terminal for detecting abnormal starting problem of terminal
CN108614718B (en) The method, apparatus and realization device of start-up operation system
CN100498704C (en) Persistent memory manipulation using EFI
CN102629206B (en) A kind of method for updating embedded system software and system
CN103065090B (en) A kind of application program malice Ad blocking method and device
CN103150231A (en) Computer booting method and computer system
US20120151258A1 (en) System reset
CN103927240A (en) Information dumping method and device answering to software breakdown
CN102446111A (en) Fast computer startup
CN104317623B (en) The management method of the preset application program of mobile terminal and mobile terminal
CN109408465B (en) File attribution information recording method, device, storage medium and terminal
CN110413432B (en) Information processing method, electronic equipment and storage medium
CN107368343A (en) A kind of starting up of terminal method, terminal and storage medium based on Android system
CN107766177A (en) Start optimization method, device, storage medium and terminal device
CN109117153A (en) Processing method, device, terminal and the storage medium of application program
CN102135923A (en) Method for integrating operating system into BIOS (Basic Input/Output System) chip and method for starting operating system
CN107025166B (en) Log collection method and system
CN109634782B (en) Method and device for detecting system robustness, storage medium and terminal
CN106897063B (en) Method and system for permanently adding OS boot entry to BIOS based on EFI
CN100410893C (en) Method and apparatus for master-controlled applied programm of self-repairing built-in equipment
CN107742076A (en) System is forbidden to put forward the method, apparatus, storage medium and terminal device of power
CN109491825B (en) Method, device, storage medium and terminal for positioning abnormal starting problem

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190412

RJ01 Rejection of invention patent application after publication