CN1991806A - Method for safety load-off of USB apparatus - Google Patents

Method for safety load-off of USB apparatus Download PDF

Info

Publication number
CN1991806A
CN1991806A CN 200510023073 CN200510023073A CN1991806A CN 1991806 A CN1991806 A CN 1991806A CN 200510023073 CN200510023073 CN 200510023073 CN 200510023073 A CN200510023073 A CN 200510023073A CN 1991806 A CN1991806 A CN 1991806A
Authority
CN
China
Prior art keywords
usb device
routine
watchdog routine
usb
watchdog
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
Application number
CN 200510023073
Other languages
Chinese (zh)
Other versions
CN100437533C (en
Inventor
袁大龙
李高强
徐琳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CNB2005100230733A priority Critical patent/CN100437533C/en
Publication of CN1991806A publication Critical patent/CN1991806A/en
Application granted granted Critical
Publication of CN100437533C publication Critical patent/CN100437533C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention provides a method for uninstalling the USB device safely, the method includes following steps: when the USB device inserts into the USB port of the host computer, the partitions of auto run program file, initial program and the monitoring program contained in the USB device are converted into virtual CD-ROM drive; run the initial program in the auto run program file, and when running the monitoring program and exit the initial program; when the monitoring program detects the safe uninstalling information sent by the USB device, and the uninstalling the USB device; when completing the said operation, the monitoring program is exited. By the said method, the remove and insert of USB device is more convenient, and it avoids the potential safety hazard for the system and device brought by unsafe uninstall.

Description

A kind of method of safety load-off of USB apparatus
Technical field
The present invention relates to a kind of method of load-off of USB apparatus, particularly relate to a kind of method of safety load-off of USB apparatus.
Background technology
Because USB device has characteristics such as easy and simple to handle, plug and play, application such as therefore become calculatings, consumption fast and communicate by letter is the wired connection technology of selection preferentially.It is transfer files fast, realizes the real-time edition and the playing function of video stream media, is used widely at MP3 player, digital camera, mobile phone, PDA, Digital Television, set-top box and other various amusement equipment.
Though USB device can plug and play, the user will carry out a safe unloading operation of craft when pulling out USB device.The safe unloading of this craft will be carried out such as discharging USB device buffer memory and addresses distributed, stop the operations such as power supply, unloading driver to USB device, and this manual operation passes into silence easily, and perhaps the user dislikes trouble and can directly pull out USB device.If long-time non-safe unloading may cause a lot of problems, gently then file is unavailable, and is heavy then cause PC to crash and problem that USB device insertion next time can't be discerned, brings a lot of inconvenience to user's use, and also equipment had infringement.
Summary of the invention
In order to address the above problem, the present invention proposes a kind of method of safety load-off of USB apparatus.
The method of safety load-off of USB apparatus of the present invention may further comprise the steps:
Step 1, be inserted into the USB port of main frame in USB device after, main frame invents CD-ROM drive with the subregion that comprises self-operating message file, initialize routine and watchdog routine in the USB device;
Step 2, the initialize routine of appointment in the operation self-operating message file, and when carrying out watchdog routine, initialize routine is withdrawed from;
Step 3 after this watchdog routine detects the safe unloading information that USB device sends, is carried out the operation of safety load-off of USB apparatus;
Step 4, after finishing aforesaid operations, watchdog routine withdraws from.
Wherein, can may further comprise the steps in the step 2:
Step I, the operation initialize routine detects whether there is above-mentioned watchdog routine under the assigned catalogue of local disk;
Step I i detecting when having above-mentioned watchdog routine, moves the above-mentioned watchdog routine under this assigned catalogue, simultaneously initialize routine is withdrawed from, otherwise, the watchdog routine in the above-mentioned subregion is copied under this assigned catalogue, and when the operation monitoring program, initialize routine is withdrawed from.
Selectable, can may further comprise the steps in the step 2:
Step I, the operation initialize routine copies the watchdog routine in the above-mentioned subregion under the assigned catalogue of local disk;
Step I i moves this watchdog routine, simultaneously initialize routine is withdrawed from.
In said method, the step that obtains the safe unloading information described in the step 3 comprises:
Step a is when the user chooses USB device and when pressing safety unloading button, produces corresponding level;
Step b becomes this level coding in predetermined safe unloading information that above-mentioned watchdog routine can discern and the impact damper that is stored in USB device;
Step c, this watchdog routine regularly sends to USB device with predetermined button request command, and the safe unloading information that this USB device then will be stored in the impact damper is submitted to this watchdog routine.
Further, after this watchdog routine detected safe unloading information, the data that stop USB device transmitted, and carry out the operation of safety load-off of USB apparatus then in step 3.
Compared with prior art, the invention has the beneficial effects as follows: by the method for safety load-off of USB apparatus of the present invention, the user can press the safety unloading button that is arranged on the USB device when pulling out USB device, system just can automatically perform the operation of this USB device of safety unloading, make USB device pull out and insert for the user simple and convenient equally, the potential safety hazard of also having avoided simultaneously non-safety unloading to bring for system and equipment.
Description of drawings
Fig. 1 is the synoptic diagram of the employed USB device of method of safety load-off of USB apparatus of the present invention.
Fig. 2 is the subregion synoptic diagram of the storage area of USB device among Fig. 1.
Fig. 3 is the process flow diagram of the method for safety USB device of the present invention.
Embodiment
At present, self-operating (Autorun) technology is used widely.This is a kind of after USB device is inserted main frame, automatically the technology of the designated program in the operational outfit.Because the Windows system supports the self-operating technology based on local disk or CD-ROM, so the self-operating technology based on USB device mainly invents local disk or CD-ROM realization to USB device at present, the present invention adopts the mode that invents CD-ROM drive that USB device is invented CD-ROM drive.
Based on above-mentioned self-operating technology, the present invention proposes a kind of method of safety load-off of USB apparatus, and in the method, the user only need press the safety unloading button that is arranged on the USB device when choosing USB device just can realize safe unloading.
For this reason, as shown in Figure 1, safety unloading button need be set on USB device at first.According to the choose custom of USB device of user, this button preferably is arranged on the represented position of 1 (center of top) or 2 (both sides) among USB device insertion end such as Fig. 1.Like this, when the user chooses USB device, can press safety unloading button, trigger the safe uninstall process of USB device.
Further, USB device need be carried out subregion, as shown in Figure 2, be divided at least two subregions in the storage area with USB device, for convenience of description it is divided into subregion A and subregion B here.Wherein, subregion A can be invented CD-ROM drive, the initialize routine (init) of wherein depositing self-operating message file (autorun.inf) and will moving, watchdog routine (observer).The A district is read-only storage area for the user, and the user can see the software in the virtual drive that is invented by subregion A in browser, but can not carry out any modification to the software in this zone; The B district is the storage area that the user can use the line operate of going forward side by side.After being provided with like this, when this USB device was connected to main frame, system identification just can move wherein program automatically to CD-ROM drive.
The method of safety load-off of USB apparatus of the present invention is described below in conjunction with Fig. 3.
As shown in Figure 3, the method for safety load-off of USB apparatus of the present invention may further comprise the steps:
At first, be inserted into the USB port of main frame in USB device after, main frame invents CD-ROM drive (step 301) with the subregion that comprises self-operating message file, initialize routine and watchdog routine in the USB device.
Then, whether the initialize routine of appointment has watchdog routine (step 302) under the assigned catalogue of detection local disk in the operation self-operating message file.If have watchdog routine under this assigned catalogue, then carry out this watchdog routine, finish initialization procedure simultaneously.If do not have watchdog routine under the assigned catalogue, then the watchdog routine in the USB device is copied under the assigned catalogue of local disk, finish initialization procedure simultaneously.
Here, can also adopt another kind of mode execution in step 302.Just, initialize routine operation back directly copies watchdog routine under the assigned catalogue of local disk to.If just there was same watchdog routine down originally in this assigned catalogue, then directly cover.
Next, after the watchdog routine operation, this watchdog routine will detect USB device at any time and whether send safe unloading information (step 303).This safe unloading information is to extract USB device the user to press the safety unloading information that button produced simultaneously.
Concrete, when the user chose USB device, safety unloading button was pressed.At this moment, because pressing of safety unloading button can produce corresponding level, this level is encoded in predetermined safe unloading information that watchdog routine can discern and the impact damper that is stored in USB device then.
Above-mentioned watchdog routine regularly calling system api function is sent the button request command to USB device, and the transmission of this control data is finished by control channel, does not influence the data communication of normal main frame and USB device.After receiving the button request command, the safe unloading information that this USB device then will be stored in the impact damper is submitted to watchdog routine by control channel.Above-mentioned order is different from intrinsic USB device request command, specially for the user reserves, as 0xc2 being defined as the button request command.
In step 303, if watchdog routine detects the safe unloading information that USB device sends, then stop to detect, and carry out the operation (step 304) of safety load-off of USB apparatus, for example discharge USB device buffer memory and addresses distributed, stop power supply, unloading driver etc. USB device.Otherwise, return step 303, continue to detect.
Further, in step 303, after stopping detection, watchdog routine judges by the monitor data passage whether USB device is transmitting data.When USB device transmits data, can whether end data by the form prompting user who ejects dialog box and transmit, the data that also can directly stop USB device transmit, and carry out the associative operation of safety load-off of USB apparatus then.
After finishing aforesaid operations, watchdog routine withdraws from, and finishes to carry out (step 305), finishes the safety unloading of USB device.In step 305, can before withdrawing from, watchdog routine on browser, eject prompting frame, and the indication USB device is unloading safely, and the user can extract USB device.Simultaneously, also can point out the user safety load-off of USB apparatus, like this, can increase user interactivity by loudspeaker.
To eject the time that proposes frame very short owing to press from safety unloading button, and for the user, its experience is just to have occurred the USB device sound of the expression USB device safety of the prompting of unloading or loudspeaker unloading safely when extracting USB device.
From above to specific descriptions of the present invention as can be seen, the method for safety load-off of USB apparatus of the present invention has the following advantages:
1. the user only need click safety unloading button before pulling out USB device, and system just can automatically perform the operation of safety load-off of USB apparatus, made that it is the same simple and convenient pulling out with inserting for the user;
2. because safety unloading button is arranged on the position that the user can press usually on the USB device; the user will press safety unloading button and trigger the safety unloading and handle, the potential safety hazard of having avoided non-safety unloading to bring for system and USB device like this when choosing USB device.
Should be noted that at last, above embodiment is only unrestricted in order to technical scheme of the present invention to be described, although the present invention is had been described in detail with reference to preferred embodiment, those of ordinary skill in the art is to be understood that, can make amendment or be equal to replacement technical scheme of the present invention, and not breaking away from the spiritual scope of technical solution of the present invention, it all should be encompassed in the middle of the claim scope of the present invention.

Claims (6)

1. the method for a safety load-off of USB apparatus may further comprise the steps:
Step 1, be inserted into the USB port of main frame in USB device after, main frame invents CD-ROM drive with the subregion that comprises self-operating message file, initialize routine and watchdog routine in the USB device;
Step 2, the initialize routine of appointment in the operation self-operating message file, and when carrying out watchdog routine, initialize routine is withdrawed from;
Step 3 after this watchdog routine detects the safe unloading information that USB device sends, is carried out the operation of safety load-off of USB apparatus;
Step 4, after finishing aforesaid operations, watchdog routine withdraws from.
2. the method for claim 1, wherein may further comprise the steps in the step 2:
Step I, the operation initialize routine detects whether there is above-mentioned watchdog routine under the assigned catalogue of local disk;
Step I i detecting when having above-mentioned watchdog routine, moves the above-mentioned watchdog routine under this assigned catalogue, simultaneously initialize routine is withdrawed from, otherwise, the watchdog routine in the above-mentioned subregion is copied under this assigned catalogue, and when the operation monitoring program, initialize routine is withdrawed from.
3. the method for claim 1, wherein may further comprise the steps in the step 2:
Step I, the operation initialize routine copies the watchdog routine in the above-mentioned subregion under the assigned catalogue of local disk;
Step I i moves this watchdog routine, simultaneously initialize routine is withdrawed from.
4. as each described method of claim 1 to 3, wherein, the step that obtains the safe unloading information described in the step 3 comprises:
Step a is when the user chooses USB device and when pressing safety unloading button, produces corresponding level;
Step b becomes this level coding in predetermined safe unloading information that above-mentioned watchdog routine can discern and the impact damper that is stored in USB device;
Step c, this watchdog routine regularly sends to USB device with predetermined button request command, and the safe unloading information that this USB device then will be stored in the impact damper is submitted to this watchdog routine.
5. as each described method of claim 1 to 3, it is characterized in that after this watchdog routine detected safe unloading information, the data that stop USB device transmitted, and carry out the operation of safety load-off of USB apparatus then in step 3.
6. method as claimed in claim 4 is characterized in that, after this watchdog routine detected safe unloading information, the data that stop USB device transmitted, and carry out the operation of safety load-off of USB apparatus then in step 3.
CNB2005100230733A 2005-12-26 2005-12-26 Method for safety load-off of USB apparatus Expired - Fee Related CN100437533C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2005100230733A CN100437533C (en) 2005-12-26 2005-12-26 Method for safety load-off of USB apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005100230733A CN100437533C (en) 2005-12-26 2005-12-26 Method for safety load-off of USB apparatus

Publications (2)

Publication Number Publication Date
CN1991806A true CN1991806A (en) 2007-07-04
CN100437533C CN100437533C (en) 2008-11-26

Family

ID=38214069

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005100230733A Expired - Fee Related CN100437533C (en) 2005-12-26 2005-12-26 Method for safety load-off of USB apparatus

Country Status (1)

Country Link
CN (1) CN100437533C (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010022681A1 (en) * 2008-09-01 2010-03-04 Xu Fei Method and storage medium for realizing safe removal of hardware devices in computer system
CN101132418B (en) * 2007-09-26 2010-11-24 杭州华三通信技术有限公司 Method and apparatus for client logoff in iSCSI system
CN101937320A (en) * 2009-06-26 2011-01-05 巴比禄股份有限公司 Memory storage, information handling system and computer program
CN101221615B (en) * 2008-02-05 2011-08-17 北京飞天诚信科技有限公司 Method for monitoring objective software and intelligent cryptographic key device
CN101425050B (en) * 2007-11-02 2011-09-28 北京华旗资讯数码科技有限公司 System for safely uninstalling mobile electronic apparatus
CN102651228A (en) * 2011-02-24 2012-08-29 鸿富锦精密工业(深圳)有限公司 USB (Universal Serial Bus) flash disk and unloading method thereof
CN102662882A (en) * 2012-03-30 2012-09-12 奇智软件(北京)有限公司 Method and device for unloading mobile storage equipment
CN103377151A (en) * 2012-04-16 2013-10-30 福建星网视易信息系统有限公司 Hard disk power-down protecting method and electronic equipment using same
CN105824736A (en) * 2016-03-29 2016-08-03 乐视控股(北京)有限公司 Method and device for detecting disconnection risk of external equipment
US10361511B1 (en) 2018-06-27 2019-07-23 Western Digital Technologies, Inc. Removal delay feature for removably connected devices

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU1618601A (en) * 1999-11-17 2001-05-30 Granite Microsystems, Inc. Device bay system with surprise removal prevention for supporting and controlling usb and ieee 1394 peripheral devices
CN2655462Y (en) * 2003-09-30 2004-11-10 东莞世华电子有限公司 USB connector male head
CN1605983A (en) * 2003-10-10 2005-04-13 联想(北京)有限公司 Method of live-wire equipment plugging from computer

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101132418B (en) * 2007-09-26 2010-11-24 杭州华三通信技术有限公司 Method and apparatus for client logoff in iSCSI system
CN101425050B (en) * 2007-11-02 2011-09-28 北京华旗资讯数码科技有限公司 System for safely uninstalling mobile electronic apparatus
CN101221615B (en) * 2008-02-05 2011-08-17 北京飞天诚信科技有限公司 Method for monitoring objective software and intelligent cryptographic key device
WO2010022681A1 (en) * 2008-09-01 2010-03-04 Xu Fei Method and storage medium for realizing safe removal of hardware devices in computer system
CN101937320A (en) * 2009-06-26 2011-01-05 巴比禄股份有限公司 Memory storage, information handling system and computer program
CN102651228A (en) * 2011-02-24 2012-08-29 鸿富锦精密工业(深圳)有限公司 USB (Universal Serial Bus) flash disk and unloading method thereof
CN102662882A (en) * 2012-03-30 2012-09-12 奇智软件(北京)有限公司 Method and device for unloading mobile storage equipment
CN102662882B (en) * 2012-03-30 2015-04-29 北京奇虎科技有限公司 Method and device for unloading mobile storage equipment
CN103377151A (en) * 2012-04-16 2013-10-30 福建星网视易信息系统有限公司 Hard disk power-down protecting method and electronic equipment using same
CN105824736A (en) * 2016-03-29 2016-08-03 乐视控股(北京)有限公司 Method and device for detecting disconnection risk of external equipment
US10361511B1 (en) 2018-06-27 2019-07-23 Western Digital Technologies, Inc. Removal delay feature for removably connected devices

Also Published As

Publication number Publication date
CN100437533C (en) 2008-11-26

Similar Documents

Publication Publication Date Title
CN1991806A (en) Method for safety load-off of USB apparatus
US7694030B2 (en) Automatic protocol migration when upgrading operating systems
US9122623B1 (en) Method for creation of device drivers and device objects for peripheral devices
CN1239016C (en) Receiver and receiving method
CN1251060C (en) Method and apparatus for increasing battery life of portable electronic devices
US20190124388A1 (en) Determining context to initiate interactivity
US20040085977A1 (en) Method, system, and program for processing data packets in packet buffers
CN101030146A (en) Method and system for updating fastener
CN105808447A (en) Memory reclaiming method and device for terminal device
FR2862400A1 (en) MEMORY CONTROL DEVICE AND METHOD
CN1534474A (en) Method of direct calling one or more auxiliary program in computer starting program
US8578065B2 (en) Communication speed control apparatus and communication speed control method
US20100153347A1 (en) Method and system for preventing corruption of hard disk drive file system
US20050130745A1 (en) DVD-enabling dongle for a console-based gaming system
EP1912129A2 (en) Method of generating and playing playback file and apparatus using the same
JP2010522406A (en) System and method for preventing errors in storage media
KR20100051665A (en) Hard disk sector/track remapping for transparent wear leveling
CN1892624A (en) Signal generating circuit and related method for activating physical channel between host and peripheral device
CN101470676B (en) Method for automatic management software installation and operation of USB modem
EP1592016A3 (en) Tape drive apparatus
CN1303530C (en) Security device for a mass storage
CN1734419A (en) Software updating apparatus and method for digital video record system
CN1532696A (en) Recoivery when audio frequency processing object access violating the regulations
CN1834910A (en) Multi-mode computer system and its operation method
CN1143300C (en) Recording/reproducing equipment, method and indication media

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: 20081126

Termination date: 20201226

CF01 Termination of patent right due to non-payment of annual fee