CN102156678A - Safety uninstalling method of memory, computer program product and electronic apparatus - Google Patents
Safety uninstalling method of memory, computer program product and electronic apparatus Download PDFInfo
- Publication number
- CN102156678A CN102156678A CN2010101092055A CN201010109205A CN102156678A CN 102156678 A CN102156678 A CN 102156678A CN 2010101092055 A CN2010101092055 A CN 2010101092055A CN 201010109205 A CN201010109205 A CN 201010109205A CN 102156678 A CN102156678 A CN 102156678A
- Authority
- CN
- China
- Prior art keywords
- computer terminal
- memory
- finish
- storer
- communication protocol
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention provides a safety uninstalling method of a memory, a computer program product and an electronic apparatus, wherein the safety uninstalling method of the memory executed by a device end provided with the memory comprises the following steps of: a) detecting USB communication protocol operation between the device end and a computer end, judging whether the handshaking is finished, and if so, carrying out step b); b) storing data in the memory, judging whether the data are completely stored, and if so, carrying out step c), otherwise carrying out step d) if the data are still not completely stored after a preset time, wherein the preset time is less than an online allowance time set on the computer end; c) uninstalling the memory, and informing the computer end about mounting; and d) re-starting the USB communication protocol operation with the computer end, and carrying out the steps a)-b) again. The invention saves hardware use so that the device end has enough time to finish the program and store data, thereby safely uninstalling the memory.
Description
Technical field
The present invention relates to a kind of memory-safe discharging method, computer program and electronic installation, particularly a kind of memory-safe discharging method, computer program and electronic installation that utilizes computer software to replace hardware detection.
Background technology
Electronic installation, for example personal navigation equipment (personal navigation device is called for short PND) adopts USB connector to be used as the transmission interface of data and electric power mostly.Many on the market at present electronic installations can be supported as storage device owing to possessing flash memory (flash), when this electronic installation is connected with computing machine by USB interface, the storer meeting carry (mount) of electronic installation is to computing machine, and the operating system of electronic installation (OS) is the action of corresponding do unloading (unmount) then.Before the OS of electronic installation unloads its storer, need end relative program and storage data, otherwise might cause the problems such as sector contingency table damage of data loss even storer.
Therefore, when the USB interface of electronic installation is connected with computing machine, for fear of its storer safely the unloading promptly be mounted on the computing machine, prior art is by the hardware detection mode, just detect identity pin (ID pin) signal of USB, promptly represent device to be connected with computing machine in case produce the connection signal, OS then notifies upper level applications (AP) termination routine and storage data, then just unloads with carry and moves.The identity pin of USB connector often need be supported other functions and can't cause guaranteeing the memory-safe unloading of electronic installation as the usefulness of connection status detection yet in fact.
On the other hand, inserting a storage device and exceed default online allowed time to its USB slot when COMPUTER DETECTION still can't device for identifying, with sending information that can't device for identifying and suspending the usb communication protocol action, causes the failure of storage device carry.
Thereby, be necessary to provide a kind of new memory-safe discharging method, computer program and electronic installation to solve above-mentioned problems of the prior art.
Summary of the invention
Therefore, purpose of the present invention is promptly providing a kind of memory-safe discharging method, replaces traditional detection hardware by the mode that detects the usb communication protocol operation, collocation reset mechanism and guarantee memory-safe unloading and carry.
Another object of the present invention is to provide a kind of electronic installation, replaces traditional detection hardware by the mode that detects the usb communication protocol operation, collocation reset mechanism and guarantee memory-safe unloading and carry.
A further object of the present invention is to provide a kind of computer program, and when this computer program is read by electronic installation, this electronic installation will be carried out this memory-safe discharging method.
So memory-safe discharging method of the present invention is carried out by a device end with a storer, and comprises following steps:
(a) check the usb communication protocol operation between this device end and the computer terminal and judge whether to shake hands and finish, finish, then carry out step (b) if shake hands; If finish and do not shake hands, then get back to the beginning of flow process, rejudge USB interface and whether be connected.Preferably, this step is to finish under the situation of affirmation at least one customizing messages, is considered as shaking hands and finishes; This customizing messages comprises in address, speed and the flow.
(b) notify the upper level applications termination routine, and carry out the data storing of this storer; On the other hand, whether judgment data finishes storage, if finish, then carries out step (c), if reaching a Preset Time remains unfulfilled, then carries out step (d), the online allowed time that this Preset Time is set less than this computer terminal.
(c), and notify this computer terminal carry with this storer unloading.
(d) restart and computer terminal between the usb communication protocol operation, and execution in step (a)~(b) again.Preferably, this step is to send a reset signal, makes between this device end and this computer terminal and restarts the usb communication protocol operation, causes this computer terminal to recomputate the online time automatically.
The present invention also provides a kind of memory-safe discharging method, is carried out by a device end with a storer, and may further comprise the steps:
(a) check the usb communication protocol operation between this device end and the computer terminal and judge whether to shake hands and finish, finish, then carry out step (b) if shake hands;
(b) carry out the data storing of this storer, and whether judgment data finish storage,, then carry out step (c), if reaching a Preset Time remains unfulfilled, then carry out step (d), the online allowed time that this Preset Time is set less than this computer terminal if finish;
(c), and notify this computer terminal carry with this storer unloading; And
(d) restart and computer terminal between the usb communication protocol operation, and execution in step (a)~(b) again.
Preferably, the present invention also comprises a step (a) step (p) before, is connected when detecting USB interface, then begin and computer terminal between usb communication protocol operation, device end pick up counting, as the starting point that judges whether to reach this Preset Time.
The present invention also provides a kind of computer program, when this computer program is read by an electronic installation with a storer, makes this electronic installation can carry out described memory-safe discharging method.
Electronic installation of the present invention comprises a central processing unit, a storer, a timer and a USB interface, and memory storage has the program group of an operating system, and this program group comprises a USB driver, reads and carries out for this central processing unit.USB interface is connected with the USB interface of a computer terminal, triggers this central processing unit and carries out this USB driver.Wherein, this central processing unit is checked the usb communication protocol operation between this electronic installation and this computer terminal and is judged whether to shake hands and finishes, finish if shake hands, then carry out the data storing of this storer, and whether judgment data finishes storage, if finish storage,, and notify this computer terminal carry then with this storer unloading; If cooperating this timer to judge to reach a Preset Time remains unfulfilled storage, then restart and this computer terminal between the usb communication protocol operation, and check the usb communication protocol operation again and judge whether to shake hands and finish.
The present invention also provides a kind of electronic installation, and this electronic installation comprises a storer, stores a USB driver; One timer; One USB interface is connected with the USB interface of a computer terminal; An and central processing unit, check the usb communication protocol operation between this electronic installation and this computer terminal and judge whether to shake hands and finish, finish if shake hands, then carry out the data storing of this storer, and whether judgment data finishes storage, if finish storage,, and notify this computer terminal carry then with this storer unloading; If cooperating this timer to judge to reach a Preset Time remains unfulfilled storage, then restart and this computer terminal between the usb communication protocol operation, and check the usb communication protocol operation again and judge whether to shake hands and finish.
Preferably, this central processing unit reaches under the situation that a Preset Time remains unfulfilled storage in judgement and sends a reset signal, make between this electronic installation and this computer terminal and restart the usb communication protocol operation, cause this computer terminal to recomputate the online time automatically.
Preferably, this central processing unit is carried out this USB driver, is to be considered as shaking hands finishing under at least one customizing messages is finished the situation of affirmation; This customizing messages comprises in address, speed and the flow.
Preferably, this storer also stores an application program, and this central processing unit is carried out this USB driver and finished when judging to shake hands, and also notifies this application program termination routine.
Effect of the present invention is, utilize the mode that detects the usb communication protocol operation to judge the USB interface connection status, save the use of hardware, and collocation reset mechanism and the online time of extension fixture end and computer terminal, allow device end have time enough to finish the data storing of storer, guarantee the memory-safe unloading.
Description of drawings
Fig. 1 is a block scheme, and the hardware resource of electronic installation preferred embodiment of the present invention and the framework of software collaboration operation are described; And
Fig. 2 is a process flow diagram, and the execution in step of memory-safe discharging method of the present invention preferred embodiment is described.
The primary clustering symbol description:
1 device end, 15 operating systems
11 usb 1s, 6 application programs
12 central processing units, 2 computer terminals
13 storeies, 21 USB interface
14 timer S
1~S
10Step
Embodiment
About aforementioned and other technology contents, characteristics and effect of the present invention, in the detailed description of a following cooperation preferred embodiment with reference to the accompanying drawings, can clearly present.
Consult Fig. 1, the preferred embodiment of memory-safe discharging method of the present invention is to be carried out by an electronic installation (to call device end 1 in the following text), this electronic installation for example is personal navigation equipment (PND), intelligent mobile phone, PDA(Personal Digital Assistant) etc., is connected with the USB interface 21 of a computer terminal 2 by its usb 11 and carries out data transmission.
Device end 1 also has a central processing unit (CPU) 12, a storer (flash) 13 and a timer (timer) 14.Storer 13 stores program group, at least one application program 16 and the data of an operating system 15.Comprise a USB driver in the middle of the program group of operating system 15.This USB driver can be stored in a computer program in advance, for example installs the recording medium such as disk, discs of manufacturer or the storer of the webserver, and supplying apparatus end 1 is downloaded and installed.
The memory-safe discharging method that present embodiment device end 1 is realized cooperates Fig. 1 and Fig. 2 to be described as follows.
Step S
1-judge whether usb 11 is connected.The signal that 4 stitch (pin) of cooperation hardware USB interface were spread out of when present embodiment was central processing unit 12 executive operating systems 15 is judged.Finish with the USB interface 21 of computer terminal 2 when the usb 11 of device end 1 and to be connected, the signal triggering central processing unit 12 that the stitch of the usb 11 of device end 1 produces is carried out these USB drivers, judges that this usb 11 is for being connected and carrying out step S
2And S
3
Step S
2Usb communication protocol operation between-starting apparatus end 1 and the computer terminal 2.In general, the usb communication protocol operation can be divided into setting (setup) stage, data (data) stage and last state (state) stage, but the present invention is not as limit.Stage is being set, computer terminal 2 inquires that to device end 1 it is which kind of describes unit, device form with default address (address) 0 and end points (EP) 0 earlier, device end 1 is enumerated it (enumeration) information and is repaid to computer terminal 2, make the attribute and the working method of computer terminal 2 acquisition device ends 1, then computer terminal 2 is specified new transfer address and end points, both sides is reached on agreement reach an agreement on and get the hang of the stage.All there are token (token), data (data) in aforementioned each stage and (handshake) the three kinds of packet types of shaking hands, and will carry out relevant treatment according to handshake packet in the present embodiment subsequent step, but is not limited to than the stage that is provided with early or the state phase.
Step S
3-when communication protocol operation beginning, the timer 14 of device end 1 picks up counting, and judges that as follow-up particular step carries out the starting point whether spent time reaches a Preset Time.On the other hand, time to count in computer terminal 2 also can begin from the communication protocol operation automatically is as the starting point that judges whether to finish the storer carry in an online allowed time of presetting.The related content of the online allowed time of relevant calculation machine end 2 and the Preset Time of device end 1 is specified in hereinafter.
Step S
4-check the usb communication protocol operation and judge whether to shake hands and finish.In detail, no matter this step is to separate code check at the handshake packet that stage, data phase or state phase are set, as long as customizing messages in the packet content, for example address, speed and flow are finished affirmation, promptly are considered as shaking hands finishing.Aforementioned customizing messages does not exceed with present embodiment, can be any predefined information project.Finish if shake hands, expression usb 11 is connected really, is equivalent to confirm that by detection hardware identity pin USB interface is connected in the prior art, then carries out step S
5And S
6, still shake hands and do not finish if reach a default allowed time of shaking hands, for example the connection status of usb 11 is disengaged, and then gets back to the beginning of flow process.
Step S
5-notification application 16 termination routines also carry out the data storing of this storer 13.
Step S
6-on the other hand, operating system 15 checks continuously and whether judgment data finishes storage, in case receive the signal of finishing storage, represents that this storer 13 can unload safely, then carries out step S
7If do not finish storage, then carry out step S
8
Step S
7-this storer 13 is unloaded from device end 1, and notice computer terminal 2 carries out carry.
Step S
8-check from step S
3Pick up counting to this step time of origin point whether reached this Preset Time, the online allowed time that this Preset Time is set less than computer terminal 2.If do not reach Preset Time as yet, then get back to step S
6Check once more and whether finish data storing, if reached Preset Time, expression is about to arrive the online allowed time that computer terminal 2 is set, so execution in step S
9, send replacement (reset) signal, make between device end 1 and the computer terminal 2 and restart the usb communication protocol operation, cause computer terminal 2 to recomputate the online time automatically.Thus, computer terminal 2 will can not be considered as the carry failure because storer 13 does not finish carry in the online allowed time, stop online action.In other words, step S
9Be to utilize reset mechanism extension fixture end 1 and computer terminal 2 to set up the online time.
For instance, suppose that the online allowed time that computer terminal 2 is set is two seconds, it is 19 second that present embodiment sets Preset Time.Formerly should have computer terminal 2 surpass two seconds and fail to finish storer 13 carries, computer terminal 2 will be considered as can't device for identifying and the carry failure, stop online action; But the step S of present embodiment
6To step S
9Design, make computer terminal 2 on one point nine seconds less than reclocking automatically between two seconds, make device end 1 and computer terminal 2 set up online time lengthening, the application program 16 of device end 1 has time enough to finish the program of carrying out, and can proceed data storing work, finish and enter step S up to data storing
7Make storer 13 safety unloadings, avoid data loss or storer 13 to suffer damage.
Finish unloading and be mounted to computer terminal 2 when storer 13, whether the connection that 1 timing of device end detects usb 11 is removed (step S
10), if be removed, then get back to the flow process section start, if be not removed, execution in step S continuously then
10
In sum, whether memory-safe discharging method of the present invention is to go device for identifying end 1 to finish with computer terminal 2 by the usb communication protocol operation to be connected, can omit the application of the identity pin of hardware usb 11 by this, this identity pin can be used as other functions; On the other hand, the collocation reset mechanism, extension fixture end 1 is set up the online time with computer terminal 2, guarantees storer 13 safety unloadings, so can reach purpose of the present invention really.
The above person of thought, it only is preferred embodiment of the present invention, can not limit scope of the invention process with this, the promptly every scope of claims and simple equivalent variations and modification that the invention description content is done according to the present invention all still belongs in the scope that patent of the present invention contains.
Claims (12)
1. memory-safe discharging method, carry out by a device end with a storer, and may further comprise the steps:
(a) check the usb communication protocol operation between this device end and the computer terminal and judge whether to shake hands and finish, finish, then carry out step (b) if shake hands;
(b) carry out the data storing of this storer, and whether judgment data finish storage,, then carry out step (c), if reaching a Preset Time remains unfulfilled, then carry out step (d), the online allowed time that this Preset Time is set less than this computer terminal if finish;
(c), and notify this computer terminal carry with this storer unloading; And
(d) restart and computer terminal between the usb communication protocol operation, and execution in step (a)~(b) again.
2. memory-safe discharging method according to claim 1, also comprising a step (a) step (p) before is connected when detecting USB interface, then begin and computer terminal between usb communication protocol operation, device end pick up counting, as the starting point that judges whether to reach this Preset Time.
3. memory-safe discharging method according to claim 2, whether wherein, this step (a) if finish is not shaken hands, and then gets back to the beginning of flow process, rejudge USB interface and be connected.
4. memory-safe discharging method according to claim 1, wherein, this step (d) is to send a reset signal, makes between this device end and this computer terminal and restarts the usb communication protocol operation, causes this computer terminal to recomputate the online time automatically.
5. memory-safe discharging method according to claim 1, wherein, this step (a) is to finish under the situation of affirmation at least one customizing messages, is considered as shaking hands and finishes.
6. memory-safe discharging method according to claim 5, wherein, this customizing messages comprises in address, speed and the flow.
7. memory-safe discharging method according to claim 1, wherein, this step (b) also notify the upper level applications termination routine.
8. a computer program when this computer program is read by an electronic installation with a storer, makes this electronic installation enforcement of rights require each described memory-safe discharging method in 1 to 7.
9. electronic installation comprises:
One storer stores a USB driver;
One timer;
One USB interface is connected with the USB interface of a computer terminal; And
One central processing unit, check the usb communication protocol operation between this electronic installation and this computer terminal and judge whether to shake hands and finish, finish if shake hands, then carry out the data storing of this storer, and whether judgment data finishes storage, if finish storage,, and notify this computer terminal carry then with this storer unloading; If cooperating this timer to judge to reach a Preset Time remains unfulfilled storage, then restart and this computer terminal between the usb communication protocol operation, and check the usb communication protocol operation again and judge whether to shake hands and finish.
10. electronic installation according to claim 9, wherein, this central processing unit reaches under the situation that a Preset Time remains unfulfilled storage in judgement and sends a reset signal, make between this electronic installation and this computer terminal and restart the usb communication protocol operation, cause this computer terminal to recomputate the online time automatically.
11. electronic installation according to claim 9, wherein, this central processing unit is carried out this USB driver, is to be considered as shaking hands finishing under at least one customizing messages is finished the situation of affirmation; This customizing messages comprises in address, speed and the flow.
12. electronic installation according to claim 9, wherein, this storer also stores an application program, and this central processing unit is carried out this USB driver and finished when judging to shake hands, and also notifies this application program termination routine.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201010109205 CN102156678B (en) | 2010-02-11 | 2010-02-11 | Safety uninstalling method of memory, computer program product and electronic apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201010109205 CN102156678B (en) | 2010-02-11 | 2010-02-11 | Safety uninstalling method of memory, computer program product and electronic apparatus |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102156678A true CN102156678A (en) | 2011-08-17 |
CN102156678B CN102156678B (en) | 2013-04-24 |
Family
ID=44438182
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 201010109205 Expired - Fee Related CN102156678B (en) | 2010-02-11 | 2010-02-11 | Safety uninstalling method of memory, computer program product and electronic apparatus |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102156678B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103577453A (en) * | 2012-08-01 | 2014-02-12 | 腾讯科技(深圳)有限公司 | Android system based import file tracking method and device |
CN103902257A (en) * | 2012-12-24 | 2014-07-02 | 联想(北京)有限公司 | Method for management of storages and electronic equipment |
CN104317745A (en) * | 2014-10-13 | 2015-01-28 | 记忆科技(深圳)有限公司 | SSD power down data protecting method based on system order control |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1567137A (en) * | 2003-06-18 | 2005-01-19 | 仁宝电脑工业股份有限公司 | Computer system with a recognition device |
US20050120343A1 (en) * | 2003-12-01 | 2005-06-02 | Horng-Ming Tai | Method and system for firmware downloads |
US20070180153A1 (en) * | 2006-01-27 | 2007-08-02 | Cornwell Michael J | Reducing connection time for mass storage class devices |
-
2010
- 2010-02-11 CN CN 201010109205 patent/CN102156678B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1567137A (en) * | 2003-06-18 | 2005-01-19 | 仁宝电脑工业股份有限公司 | Computer system with a recognition device |
US20050120343A1 (en) * | 2003-12-01 | 2005-06-02 | Horng-Ming Tai | Method and system for firmware downloads |
US20070180153A1 (en) * | 2006-01-27 | 2007-08-02 | Cornwell Michael J | Reducing connection time for mass storage class devices |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103577453A (en) * | 2012-08-01 | 2014-02-12 | 腾讯科技(深圳)有限公司 | Android system based import file tracking method and device |
CN103577453B (en) * | 2012-08-01 | 2018-09-07 | 腾讯科技(深圳)有限公司 | Tracking based on Android system imports the method and device of file |
CN103902257A (en) * | 2012-12-24 | 2014-07-02 | 联想(北京)有限公司 | Method for management of storages and electronic equipment |
CN103902257B (en) * | 2012-12-24 | 2017-03-01 | 联想(北京)有限公司 | A kind of method that memorizer is managed and electronic equipment |
CN104317745A (en) * | 2014-10-13 | 2015-01-28 | 记忆科技(深圳)有限公司 | SSD power down data protecting method based on system order control |
Also Published As
Publication number | Publication date |
---|---|
CN102156678B (en) | 2013-04-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109086079B (en) | Mounting management method and device for storage equipment | |
CN101354677A (en) | Method for detecting and restoring application program running state and restoring device thereof | |
CN101882092A (en) | Management method and device for application program | |
CN104503828A (en) | Process management method and terminal | |
CN103678084A (en) | Flexible application process guarding method | |
CN109375956B (en) | Method for restarting operating system, logic device and control device | |
CN102156678B (en) | Safety uninstalling method of memory, computer program product and electronic apparatus | |
CN108563472B (en) | Service plug-in loading method and device based on multi-open application | |
CN113760333A (en) | Software upgrading method and device, electronic equipment and computer readable storage medium | |
CN103514014A (en) | Method for designing boot system of embedded terminal equipment | |
CN103425539B (en) | Information processing method and device | |
CN110675058A (en) | Work order processing method, electronic device, storage medium and system | |
CN107885548B (en) | System starting method and device | |
CN111722888B (en) | Operation execution method, device, equipment and readable storage medium | |
CN106686627B (en) | WiFi/hotspot starting method and device | |
CN110365839B (en) | Shutdown method, shutdown device, shutdown medium and electronic equipment | |
CN113412480B (en) | Mounting processing method, mounting processing device, electronic equipment and computer readable storage medium | |
CN109634782B (en) | Method and device for detecting system robustness, storage medium and terminal | |
CN108958808A (en) | Method for starting terminal and device, terminal and storage medium | |
CN116450224A (en) | Data recovery method, device and system based on clearing CMOS | |
CN101630278A (en) | Method for recording crash abnormal information of electronic device and electronic device | |
CN105426304A (en) | Control method and device of restart test | |
CN113741918B (en) | Method for deploying application on cloud and application | |
CN111132097B (en) | Wireless module driving method and device, wireless module, terminal and storage medium | |
CN114385537A (en) | Page slot number dynamic allocation method, device, equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20130424 Termination date: 20200211 |
|
CF01 | Termination of patent right due to non-payment of annual fee |