The content of the invention
The main object of the present invention is a kind of method and dress for unloading storage device based on android system faster of offerPut.
The present invention proposes a kind of method based on android system unloading storage device, including step:
Kill the process for accessing storage device;
Monitor the process and whether kill and finish;
If finishing, unloading accesses the data storage read during the storage device.
Further, the unloading includes after accessing the data step read during storage device:
Detect whether the data storage unloads success;
If it is not, send interrupt signal to the process for accessing storage device and start timing;
When the timing reaches preset time, unloading again accesses the data storage read during the storage device.
Further, include before the process steps for killing access storage device:
Receive the unloading command of user's triggering;
The process of the storage device is accessed according to unloading command search.
Further, when the timing reaches preset time, unloading again accesses what is read during the storage deviceInclude after data storage step:
Monitoring unloading accesses the number of the data storage read during the storage device;
Judge whether the number reaches preset times;
If it is not, return to step " detecting whether the data storage unloads success ".
Further, it is described to judge the number also includes after whether reaching preset times step:
If so, failed regeneration signal, sends to output end.
Further, it is described to judge the number also includes after whether reaching preset times:
If so, failed regeneration reason, sends to output end.
Further, whether the detection data storage also includes after unloading successfully:
If so, electric signal is sent to the LED for being arranged on the interface.
The present invention also proposes a kind of device based on android system unloading storage device, including:
Module is killed, the process of storage device is accessed for killing;
Module is monitored, whether kills for monitoring the process and finishes;
Unload module, finished if being killed for process, unloading accesses the data storage read during the storage device.
Further, the device based on android system unloading storage device, in addition to:
Detection module, for detecting whether the data storage unloads success;
Interrupt module, if for detecting data storage dismount failure, sent to the process for accessing storage device and interrupt letterNumber and start timing;
Unload module again, when accessing the storage device for when the timing reaches preset time, unloading againThe data storage read.
Further, the device based on android system unloading storage device, in addition to:
Instruction module is received, for receiving the unloading command of user's triggering;
Search module, for accessing the process of the storage device according to unloading command search.
Further, the device based on android system unloading storage device, in addition to:
Monitoring modular, the number of the data storage read when unloading for monitoring and access the storage device;
Number module is judged, for judging whether the number reaches preset times;
Second kills module, arrives preset times for judging that number is not crossed, calls detection module to detect the data storageWhether unloading is successful.
Further, the device based on android system unloading storage device, in addition to:
Failure module, if for detecting dismount failure after unloading preset times, failed regeneration signal, send to output end.
Further, the device based on android system unloading storage device, in addition to:
Reason module, if for detecting dismount failure after unloading preset times, failed regeneration reason, send to output end.
Further, the device based on android system unloading storage device, in addition to:
Success module, if being unloaded successfully for detecting the data storage, electric signal is sent to the LED for being arranged on the interfaceLamp.
Compared with prior art, the beneficial effects of the invention are as follows:The storage device of the interface of the terminal of android system is pulled outAfter going out, system directly kills the process of the storage device, faster unloads storage device, makes the interface facilitate user to insert againEnter storage device use.
Embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
Reference picture 1, propose the method based on android system unloading storage device of one embodiment of the invention, this methodApplied to terminal, it is preferable that the terminal is provided with android system, including step:
S3, kill the process for accessing storage device;
Whether S4, the monitoring process are killed and are finished;
If S5, finishing, unloading accesses the data storage read during the storage device.
In the present embodiment, the terminal has an interface with storage device grafting, interface can be USB interface orOther are used for the interface for connecting storage device.Storage device refers to the electronic product for having store function, such as USB flash disk, mobile phone etc..WithAfter family pulls the storage device on the interface in the terminal of android system, the access of storage device on the terminalLocation is still existing, if without unloading completely, other storage devices are inserted into the interface, and terminal is still gone according to former reference addressAccess, but the information of the storage device of other storage devices with pulling just now is inconsistent so that terminal can not access itHis storage device, the terminal that the present invention is provided with android system send signal, the access that the storage device is carried overLocation is all deleted, to prevent the reference address from also associating some other processes, therefore by the process related to the storage deviceAll to kill, kill process is exactly that the program process of access storage device is completely removed inside internal memory, forbids its operation,Because a process there are multiple sub-line journeys, also there is what can be run together with other processes.Set while listening for access storage is killedWhether standby process finishes, and confirms after killing, then is unloaded, and thus is avoided that because having related to storage device to enterJourney does not also unload the storage device in operation, and the process that the method for the present embodiment first kills interface unloads storage device again,The time of unloading storage device can be reduced, interface is inserted again by other storage devices as early as possible and use.
Reference picture 2, further, the unloading include after accessing the data S5 steps read during storage device:
Whether S6, the detection data storage unload success;
S7, if it is not, sending interrupt signal to the process for accessing storage device and starting timing;
S8, when the timing reaches preset time, the storage number that is read when unloading accesses the storage device againAccording to.
In the present embodiment, if not unloading success, it may be possible to which process is not over, or is provided with AndroidThe terminal of system is also sending signal with the storage device so that the storage device can not be unloaded, therefore terminal will be accessed and is somebody's turn to doAll signals of storage device send interrupt signal, storage device is not connected with terminal, and are sending the same of interrupt signalShi Jinhang timing, when timing reaches the default time, the terminal of android system is set to be set in the first preset time with storageStandby related process is all interrupted, and then unloading accesses the data storage read during storage device.The preset time according toThe design parameter of the terminal of android system is configured, and is preferably arranged to 5 seconds.
Reference picture 3, further, include before the process S3 steps for killing access storage:
S1, the unloading command for receiving user's triggering;
S2, the process according to the unloading command search access storage device.
In the present embodiment, when user prepares unloading storage device, that is, the instruction of unloading storage device, terminal are sentThe process relevant with the storage device will be searched at once after receiving instruction, carry out the preparation of unloading, accelerate the speed of unloading.
Reference picture 4, further, described when the timing reaches preset time, unloading again accesses the storage and setInclude after the data storage S8 steps read when standby:
S91, monitoring unloading access the number of the data storage read during storage device;
S92, judge whether the number reaches preset times;
If it is not, return to step S6 " detecting whether the data storage unloads success ".
In the present embodiment, the process still dismount failure of last time is have passed through, it is relevant with storage device to then proceed to killProcess, kill the reference address that carries over of storage device and other be not over or interrupt be still present in entering for terminalJourney.Unloading the data storage needs repeatedly unloading, and the number of unloading is by User Defined, if being not reaching to the number of unloading,Then need to continue to unload, therefore be back to S6 steps, detect whether to unload successfully.If do not unload successfully and be not reaching toDefault unloading number, then continue to unload.
Reference picture 5, it is further, described to judge the number also includes after whether reaching preset times S92 steps:
S10 is sent to output end if so, failed regeneration signal.
In the present embodiment, if being still dismount failure after the unloading of default number, system confirmation dismount failure, generate and loseSignal is lost, sending to output end knows user.Output end can be the display screen of Android system terminal, on a display screenDisplay dismount failure printed words are let the user know that, or output end is the loudspeaker of Android system terminal, sends dismount failureThe signal that sound is let the user know that or the other equipment of Android system terminal is sent can let the user know that unloadingThe information of failure, if user wants to reuse interface connection storage device, the Android system terminal is allowed to restart.
Reference picture 6, it is further, described to judge the number also includes after whether reaching preset times S92 steps:
S11 is sent to output end if so, failed regeneration reason.
In the present embodiment, failure cause is sent to output end, the reason for making user have a clear understanding of storage device dismount failure,Handled or repaired in time, the storage device is unloaded as early as possible, do not influenceed user and use the Android system terminal.
Reference picture 7, in the present embodiment, the detection data storage includes after whether unloading successfully S6 steps:
S12, if so, sending electric signal to the LED for being arranged on the interface.
In the present embodiment, after unloading successfully storage device, that is, represent that the interface can reconnect storage device, user can be withIt is continuing with the interface, sends electric signal to the LED of the interface, represent to control the LED bright, reminds the user interface can be withUse, bring user and experience well.Further, if detection dismount failure, sends another electric signal to LED, make thisLED sends the light of another color, and detects to unload and successfully send another different signal.
In summary, the method for the invention based on android system unloading storage device, can directly kill the storageThe process of equipment, makes storage device be unloaded as early as possible, optimization unloading flow, saves the usage time of user.Being detected after unloading isIt is no to unload successfully, and different signals is sent to different testing results, user is had a clear understanding of unloading result, be more convenient to useAndroid terminal.
Reference picture 8, the present invention also propose the device based on android system unloading storage device of an embodiment, including:
Module 3 is killed, the process of storage device is accessed for killing;
Module 4 is monitored, whether kills for monitoring the process and finishes;
Unload module 5, finished if being killed for process, unloading accesses the storage number read during the storage deviceAccording to.
In the present embodiment, the terminal has an interface with storage device grafting, interface can be USB interface orOther are used for the interface for connecting storage device.Storage device refers to the electronic product for having store function, such as USB flash disk, mobile phone etc..WithAfter family pulls the storage device on the interface in the terminal of android system, the access of storage device on the terminalLocation or existing, if Unload module 5 does not unload completely, other storage devices are inserted into the interface, and terminal is according to still visitingAsk that address is gone to access other storage devices, but the information of the storage device of other storage devices with pulling just now differsCause so that terminal can not access, and the terminal that the present invention is provided with android system sends signal, and the storage device is left downThe reference address come is all deleted, i.e., will be with by killing module 3 to prevent the reference address from also associating some other processesThe related process of the storage device is all killed, kill process be exactly the program process of access storage device inside internal memory it is completeAll clear is removed, and forbids its operation, because a process has multiple sub-line journeys, also there is what can be run together with other processes.TogetherWhen monitor module 4 monitor kill access storage device process whether finish, confirm kill after, Unload module 5 is againUnloaded, thus be avoided that because there is the process related to storage device also not unload the storage device, this implementation in operationThe process that the method for example first kills interface unloads storage device again, can reduce the time of unloading storage device, make interface as early as possibleIt can be inserted and use by other storage devices again.
Reference picture 9, further, the device based on android system unloading storage device also include:
Detection module 6, for detecting whether the data storage unloads success;
Interrupt module 7, if for detecting data storage dismount failure, sent to the process for accessing storage device and interrupt letterNumber and start timing;
Unload module 8 again, when accessing the storage device for when the timing reaches preset time, unloading againThe data storage read.
In the present embodiment, if detection module 6, which detects, does not unload success, it may be possible to process is not over, orIt is that the terminal for being provided with android system is also sending signal with the storage device so that the storage device can not be unloaded, becauseAll signals for accessing the storage device are sent interrupt signal by this interrupt module 7, storage device is not connected with terminal, andTiming is carried out while interrupt signal is sent, when timing reaches the default time, makes the terminal of android system firstThe process related to storage device is all interrupted in preset time, and then the unloading of Unload module 8 accesses storage device when institute againThe data storage of reading.The preset time is configured according to the design parameter of the terminal of android system, is preferably arranged to 5Second.
Reference picture 10, further, the device based on android system unloading storage device also include:
Instruction module 1 is received, for receiving the unloading command of user's triggering;
Search module 2, for accessing the process of the storage device according to unloading command search.
In the present embodiment, when user prepares unloading storage device, that is, the instruction of unloading storage device, instruction are sentAfter receiving module receives instruction, search module 2 will search for the process relevant with the storage device at once, carry out the standard of unloadingIt is standby, accelerate the speed of unloading.
Reference picture 11, further, the device based on android system unloading storage device also include:
Monitoring modular 91, monitoring unloading access the number of the data storage read during storage device;
Number module 92 is judged, for judging whether the number reaches preset times;
Second kills module 10, arrives preset times for judging that number is not crossed, calls detection module 6 to detect the storage numberAccording to whether unloading success.
In the present embodiment, the process still dismount failure of last time is have passed through, it is relevant with storage device to then proceed to killProcess, kill the reference address that carries over of storage device and other be not over or interrupt be still present in entering for terminalJourney.Monitoring modular 91, monitoring unload the number of data storage unloading, judge that number module 92 judges whether the number of unloading surpassesDefault number is crossed, wherein the preset times unloaded are unloaded by User Defined if the second kill judgement of module 10 is not reaching toThe number of load, then need to continue to unload, therefore call detection module 6 to continue to detect whether to unload successfully.If do not unload intoWork(and default unloading number is not reaching to, then continues to unload.
Reference picture 12, in the present embodiment, the device based on android system unloading storage device also includes:
Failure module 11, if for detecting dismount failure after unloading preset times, failed regeneration signal, send to outputEnd.
In the present embodiment, if being still dismount failure after the unloading of default number, system confirmation dismount failure, fail mouldThe failed regeneration signal of block 11, sending to output end knows user.Output end can be the display screen of Android system terminal,Show that dismount failure printed words are let the user know that on a display screen, or output end is the loudspeaker of Android system terminal, is sentThe signal that the sound of dismount failure is let the user know that or the other equipment of Android system terminal is sent can allow useThe information of dismount failure is known at family, if user wants to reuse interface connection storage device, makes the android system wholeRestart at end.
Reference picture 13, in the present embodiment, the device based on android system unloading storage device also includes:
Reason module 12, if for detecting dismount failure after unloading preset times, failed regeneration reason, send to outputEnd.
In the present embodiment, reason module 12 sends failure cause to output end, user is had a clear understanding of storage device unloadingThe reason for failure, handled or repaired in time, the storage device is unloaded as early as possible, do not influenceed user and use the AndroidSystem terminal.
Reference picture 14, in the present embodiment, the device based on android system unloading storage device also includes:
Success module 13, if unload successfully for detecting the data storage, transmission electric signal is to being arranged on the interfaceLED.
In the present embodiment, after unloading successfully storage device, that is, represent that the interface can reconnect storage device, user can be withThe interface is continuing with, success module 13 sends electric signal to the LED of the interface, represents to control the LED bright, remind userThe interface can use, and bring user and experience well.Further, if detection dismount failure, sends another electric signal extremelyLED, the LED is sent the light of another color, and detect to unload and successfully send another different signal.
In summary, the device of the invention based on android system unloading storage device, can directly kill the storageThe process of equipment, makes storage device be unloaded as early as possible, optimization unloading flow, saves the usage time of user.Being detected after unloading isIt is no to unload successfully, and different signals is sent to different testing results, user is had a clear understanding of unloading result, be more convenient to useAndroid terminal.
The preferred embodiments of the present invention are the foregoing is only, are not intended to limit the scope of the invention, every utilizationThe equivalent structure or equivalent flow conversion that description of the invention and accompanying drawing content are made, or directly or indirectly it is used in other correlationsTechnical field, be included within the scope of the present invention.