[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN1851679A - USB device automatic initialization method and device - Google Patents

USB device automatic initialization method and device Download PDF

Info

Publication number
CN1851679A
CN1851679A CNA2006100832094A CN200610083209A CN1851679A CN 1851679 A CN1851679 A CN 1851679A CN A2006100832094 A CNA2006100832094 A CN A2006100832094A CN 200610083209 A CN200610083209 A CN 200610083209A CN 1851679 A CN1851679 A CN 1851679A
Authority
CN
China
Prior art keywords
usb
usb device
initialization
monitoring
removal
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
CNA2006100832094A
Other languages
Chinese (zh)
Other versions
CN100386751C (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.)
Feitian Technologies Co Ltd
Original Assignee
Beijing Feitian Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Feitian Technologies Co Ltd filed Critical Beijing Feitian Technologies Co Ltd
Priority to CNB2006100832094A priority Critical patent/CN100386751C/en
Publication of CN1851679A publication Critical patent/CN1851679A/en
Application granted granted Critical
Publication of CN100386751C publication Critical patent/CN100386751C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

本发明公开了一种USB设备自动初始化的方法及装置,是一种将USB设备初始化的方法及装置。由初始化设备中的监控装置自动判断USB设备在初始化设备USB口的插入和拔除,在插入时由初始化装置对USB设备自动进行初始化,在拔除时如果有需要则自动进行清理操作,并等待下一个USB设备的插入,否则直接等待下一个USB设备的插入。本发明由于不需要人工干预,也不需要配备人工干预所需要的硬件,因而节省了时间,降低了成本,减少了出错的可能性。另外,还可以利用多线程技术来同时对多个USB设备进行初始化操作,大大提高了工作效率。

The invention discloses a method and a device for automatically initializing a USB device, in particular to a method and a device for initializing a USB device. The monitoring device in the initialization device automatically judges the insertion and removal of the USB device in the USB port of the initialization device. When it is inserted, the initialization device automatically initializes the USB device. When it is removed, it automatically performs cleaning operations if necessary, and waits for the next one. The insertion of the USB device, otherwise directly wait for the insertion of the next USB device. Since the present invention does not require manual intervention and does not need to be equipped with hardware required for manual intervention, time is saved, costs are reduced, and the possibility of errors is reduced. In addition, multi-threading technology can also be used to initialize multiple USB devices at the same time, which greatly improves work efficiency.

Description

A kind of method of USB device auto-initiation and device
Technical field
The present invention relates to a kind ofly USB device be carried out initialized method and device, specifically a kind of method and apparatus that USB device is carried out auto-initiation.
Background technology
USB is the abbreviation of English Universal Serial Bus, and Chinese implication is " USB (universal serial bus) ", and it is a kind of interfacing that is applied in computer realm.In recent years, along with popularizing of the computing machine of a large amount of support USB interface, the USB technology has entered into the practical stage, use the equipment of USB interface also to grow with each passing day, for example digital camera, scanner, joystick, keyboard, mouse, printer, memory device, vision facilities etc., product---the USB token that also has USB technology and smart card techniques to combine in addition.
These USB device are being dispatched from the factory or before sales all will pass through certain initialization, write certain data and information, and operating system can be discerned, and its software kit can be operated them.Initialization operation comprises creates required data structure, the file storage structure of software, makes up hardware information, as model, sequence number, the information of dispatching from the factory, and the management software etc. of downloading self hardware inside.
Existing initial method generally all is to write specific initializers, reception click or keyboard knock under the situation of computing machine USB mouth insertion USB device, there is certain external event to take place, software begins to carry out the initialization flow process then, pull out USB device then, repeat above operation.Such initial method is not long at initialization flow process spended time, the quantity of initialization USB device is too not big, task is to satisfy the demand when not being too urgent, but when wanting initialized USB device a lot of, just be difficult to reach gratifying effect, its work efficiency is low, time, human and material resources, financial resources all are a kind of wastes, do not make full use of the resource of computing machine.
Summary of the invention
Complex operation, long, the ineffective problem of spended time in order to solve in the prior art to the USB device initialization, the invention provides a kind of method and apparatus of USB device auto-initiation, it can replace manual method automatically USB device to be carried out initialization process, simple to operate, high efficiency.
The method of USB device auto-initiation of the present invention, its implementation is: judge that automatically USB device in the insertion of the USB of initialization apparatus mouth with pull out, carries out initialization automatically when inserting, wait for the insertion of next USB device pulling out the back.
Described method realizes by following steps:
Steps A: start;
Step B: the monitoring USB device is in the insertion of USB mouth;
Step C: when monitoring the USB device insertion, carry out the initialization flow process;
Step D: pulling out of monitoring USB device, after USB device is pulled out, carry out step B.
Described method realizes by following steps:
Steps A: start;
Steps A 1: detect on the USB mouth whether be connected with USB device;
Steps A 2:, carry out the initialization flow process if be connected with USB device on the USB mouth; If do not connect USB device on the USB mouth, carry out step B;
Steps A 3: pulling out of monitoring USB device, after USB device is pulled out, carry out step B;
Step B: the monitoring USB device is in the insertion of USB mouth;
Step C: when monitoring the USB device insertion, carry out the initialization flow process;
Step D: pulling out of monitoring USB device, after USB device is pulled out, carry out step B.
Described monitoring USB device is inserted and is extracted by the PC/SC interface and realize.
Described monitoring USB device is inserted and equipment control (Device Management) interface and the message mechanism that provide by Windows operating system is provided is realized.
Described monitoring USB device is inserted and is extracted by calling and the privately owned interface that provides is provided realizes.
The device of USB device auto-initiation of the present invention comprises supervising device and apparatus for initializing, and whether described supervising device is used to monitor has USB device to insert and pull out on the USB mouth; Described apparatus for initializing is used for the USB device initialization.
The device of USB device auto-initiation of the present invention also comprises pick-up unit, is used to detect the current USB device that whether is connected with on the USB mouth.
The beneficial effect that the present invention produces is:
1, saved the time: judge automatically and carry out initialization operation by software, can't help and manually to control, reduced the possibility of makeing mistakes.Owing to saved the manual intervention time, so upward saved much the time than the method for prior art.
2, saved resource: because most of computing machine is supported a plurality of USB mouths, so can being set, multithreading carries out initial work, monitor the plug incident of USB mouth as much as possible, can a plurality of USB device of parallel initialization, reduce the quantity of initialization personnel and initialization apparatus comparatively speaking, and made full use of computer resource.
3, reduced cost: owing to do not need manual intervention, therefore can not be equipped with the needed instrument of manual intervention, as mouse, keyboard etc. have reduced cost.In addition, the equipment that initialization is used both can be ordinary PC, also can be the special equipment of making that only has function of initializing, had so just further reduced cost.
Description of drawings
The present invention is further described below in conjunction with drawings and Examples.
Fig. 1 is the structural representation of the device of USB device auto-initiation of the present invention;
Fig. 2 is the process flow diagram of the method for USB device auto-initiation of the present invention.
Embodiment
The invention will be further described below in conjunction with the drawings and specific embodiments, but not as the present invention is limited.
The present invention is suitable for all equipment that use USB interface, for example mouse, keyboard, digital camera, USBKey etc., USB device is inserted the USB mouth, initialization apparatus detects the insertion of USB device, USB device is carried out initialization operation automatically, finish and wait for pulling out of USB device after the initialization, pull out the insertion that initialization apparatus behind the USB continues the next USB device of monitoring.
Specify with the example that is initialized as below USB Key:
USB Key (USB lock), also be USB Token (USB token), it is the form that key or cryptographic hardware (as IC-card and various crypto chip) is packaged into the USB joint, by inserting USB interface of computer, use USB communications protocol and computing machine to carry out communication, reach data interaction and computation purpose.USB Key must pass through initialization, and by software on computers is installed, reaches the purpose of data and software protection and personal identification.
Embodiment one:
Set up the initialization apparatus of being made up of pick-up unit 101, supervising device 102 and apparatus for initializing 103 shown in Figure 1, initialization apparatus is provided with the USB mouth, its method that USB device is carried out auto-initiation as shown in Figure 2:
Step 201: start initialization apparatus;
Step 202: pick-up unit 101 detects on the current USB mouth whether be inserted with USB Key, if having, and execution in step 204; If no, execution in step 203;
Step 203: supervising device 102 is monitored the USB mouth by the PC/SC interface, can utilize SCardListReaders, SCardLocateCard, smart card com interface under interfaces such as SCardGetStatusChange or the Windows operating system is monitored, when on monitoring the USB mouth, having USB Key to insert, execution in step 204;
Step 204: 103 couples of USB Key of apparatus for initializing carry out initialization;
Step 205: supervising device 102 monitoring USB Key pull out, and carry out steps 203 after monitoring the pulling out of USB Key.
Embodiment two:
Set up the initialization apparatus of being made up of pick-up unit 101, supervising device 102 and apparatus for initializing 103 shown in Figure 1, initialization apparatus is provided with the USB mouth, its method that USB device is carried out auto-initiation as shown in Figure 2:
Step 201: start initialization apparatus;
Step 202: pick-up unit 101 detects on the current USB mouth whether be inserted with USB Key, if having, and execution in step 204; If no, execution in step 203;
Step 203: the equipment control interface that supervising device 102 provides by Windows operating system is monitored and is obtained the USB device attribute and comes the USB Key of appointment is detected to USB device, can use the RegisterDeviceNotification function to register the device type that receives the plug notice from operating system, use the SetupDiGetClassDevsEx function to obtain the USB Key information of on the USB of initialization apparatus mouth, having inserted, use the windows messaging treatment mechanism to handle the plug that WM_DEVICECHANGE message is monitored USB Key.When on monitoring the USB mouth, having USB Key to insert, execution in step 204;
Step 204: 103 couples of USB Key of apparatus for initializing carry out initialization;
Step 205: supervising device 102 monitoring USB Key pull out, and carry out steps 203 after monitoring the pulling out of USB Key.
Embodiment three:
Set up the initialization apparatus of being made up of pick-up unit 101, supervising device 102 and apparatus for initializing 103 shown in Figure 1, initialization apparatus is provided with the USB mouth, its method that USB device is carried out auto-initiation as shown in Figure 2:
Step 201: start initialization apparatus;
Step 202: pick-up unit 101 detects on the current USB mouth whether be inserted with USB Key, if having, and execution in step 204; If no, execution in step 203;
Step 203: supervising device 102 is monitored by the privately owned interface of the driving that use card reader manufacturer provides.When on monitoring the USB mouth, having USB Key to insert, execution in step 204;
Step 204: 103 couples of USB Key of apparatus for initializing carry out initialization;
Step 205: supervising device 102 monitoring USB Key pull out, and carry out steps 203 after monitoring the pulling out of USB Key.
In above-mentioned three embodiment, the startup method of initialization apparatus can be the start-up by hand initialize routine, also can be this program of moving automatically when computer starting, but does not limit to this two kinds of methods.Above-mentioned three employed method for supervising of embodiment can use or use wherein one or both simultaneously by multithreading, can also use other method, if can monitor USB device on the USB mouth insertion and pull out.In addition, execution in step 202 and directly the USB mouth being monitored not in actual applications, and then can carry out a series of cleaning operations if necessary after pulling out the intact USB device of firm initialization is as discharging the resource used etc.The present invention is the limit erroneous disposal route not, can directly withdraw from this program or prompting user when makeing mistakes and whether continue monitoring or withdraw from this flow process, also can use other error handling methods.In whole flow process, can add more humane interface, as wrong, the frequency of failure, back prompting insertion etc. was pulled out, is pulled out in prompting after initialization was finished, also can use special USB extender (as a kind of hardware of expanding a plurality of USB mouths, by the energising of control expansion USB mouth, the effect that outage reaches the simulation plug, can insert a plurality of USB device once) and a plurality of USB device of multithreading initialization simultaneously, to increase work efficiency.

Claims (8)

1、一种USB设备自动初始化的方法,其特征在于:自动判断USB设备在初始化设备的USB口的插入和拔除,在插入时自动进行初始化,在拔除后等待下一个USB设备的插入。1. A method for automatic initialization of a USB device, characterized in that: automatically determine the insertion and removal of the USB device at the USB port of the initialization device, automatically initialize when inserted, and wait for the insertion of the next USB device after pulling out. 2、根据权利要求1所述的USB设备自动初始化的方法,其特征在于:所述方法通过以下步骤实现:2. The method for automatic initialization of a USB device according to claim 1, characterized in that: said method is implemented through the following steps: 步骤A:启动;Step A: start; 步骤B:监控USB设备在USB口的插入;Step B: monitoring the insertion of the USB device into the USB port; 步骤C:监控到USB设备插入时,执行初始化流程;Step C: When monitoring that the USB device is plugged in, execute the initialization process; 步骤D:监控USB设备的拔除,USB设备拔除后,进行步骤B。Step D: monitor the removal of the USB device, and proceed to step B after the USB device is removed. 3、根据权利要求1或2所述的USB设备自动初始化的方法,其特征在于:所述方法通过以下步骤实现:3. The method for automatic initialization of a USB device according to claim 1 or 2, characterized in that: said method is implemented through the following steps: 步骤A:启动;Step A: start; 步骤A1:检测USB口上是否连接有USB设备;Step A1: Detect whether there is a USB device connected to the USB port; 步骤A2:如果USB口上连接有USB设备,执行初始化流程;如果USB口上没有连接USB设备,进行步骤B;Step A2: If there is a USB device connected to the USB port, execute the initialization process; if there is no USB device connected to the USB port, proceed to step B; 步骤A3:监控USB设备的拔除,USB设备拔除后,进行步骤B;Step A3: monitor the removal of the USB device, and proceed to step B after the USB device is removed; 步骤B:监控USB设备在USB口的插入;Step B: monitoring the insertion of the USB device into the USB port; 步骤C:监控到USB设备插入时,执行初始化流程;Step C: When monitoring that the USB device is plugged in, execute the initialization process; 步骤D:监控USB设备的拔除,USB设备拔除后,进行步骤B。Step D: monitor the removal of the USB device, and proceed to step B after the USB device is removed. 4、根据权利要求1所述的USB设备自动初始化的方法,其特征在于:所述监控USB设备插入和拔出通过PC/SC接口来实现。4. The method for automatic initialization of a USB device according to claim 1, wherein the monitoring of the insertion and removal of the USB device is realized through a PC/SC interface. 5、根据权利要求1所述的USB设备自动初始化的方法,其特征在于:所述监控USB设备插入和拔出通过Windows操作系统提供的设备管理接口和消息机制来实现。5. The method for automatic initialization of a USB device according to claim 1, wherein the monitoring of the insertion and removal of the USB device is realized through the device management interface and message mechanism provided by the Windows operating system. 6、根据权利要求1所述的USB设备自动初始化的方法,其特征在于:所述监控USB设备插入和拔出通过调用驱动提供的私有接口来实现。6. The method for automatic initialization of a USB device according to claim 1, wherein the monitoring of the insertion and removal of the USB device is realized by calling a private interface provided by the driver. 7、一种USB设备自动初始化的装置,其特征在于:所述装置包括:7. A device for automatic initialization of a USB device, characterized in that: the device includes: 监控装置:用于监控USB口上是否有USB设备插入和拔除;Monitoring device: used to monitor whether there is a USB device inserted and removed from the USB port; 初始化装置:用于将USB设备初始化。Initialization device: used to initialize the USB device. 8、根据权利要求7所述的USB设备自动初始化的装置,其特征在于:所述装置还包括检测装置,所述检测装置用于检测USB口上当前是否连接有USB设备。8. The device for automatically initializing a USB device according to claim 7, characterized in that the device further comprises a detection device for detecting whether a USB device is currently connected to the USB port.
CNB2006100832094A 2006-05-30 2006-05-30 Method and device for automatic initialization of USB equipment Expired - Fee Related CN100386751C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006100832094A CN100386751C (en) 2006-05-30 2006-05-30 Method and device for automatic initialization of USB equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006100832094A CN100386751C (en) 2006-05-30 2006-05-30 Method and device for automatic initialization of USB equipment

Publications (2)

Publication Number Publication Date
CN1851679A true CN1851679A (en) 2006-10-25
CN100386751C CN100386751C (en) 2008-05-07

Family

ID=37133158

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006100832094A Expired - Fee Related CN100386751C (en) 2006-05-30 2006-05-30 Method and device for automatic initialization of USB equipment

Country Status (1)

Country Link
CN (1) CN100386751C (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1976279B (en) * 2006-12-04 2010-10-06 北京飞天诚信科技有限公司 Automatic monitoring and cleaning intelligent key system and working method thereof
CN102333015A (en) * 2011-10-25 2012-01-25 山西省电力公司大同供电分公司 A method for monitoring computer information network
CN102968325A (en) * 2012-12-04 2013-03-13 北京深思洛克软件技术股份有限公司 USB (Universal Serial Bus) equipment and method and device for automatically initializing same
CN104484196A (en) * 2014-11-28 2015-04-01 上海动联信息技术股份有限公司 Production system and method for automatically finishing USB KEY equipment firmware initialization

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100395664B1 (en) * 2001-08-20 2003-08-25 엠텍비젼 주식회사 Universal serial bus device and initializing mehtod of the device
CN1303542C (en) * 2003-10-24 2007-03-07 英业达股份有限公司 Method of Plug and Play for USB Devices under Linux Operating System

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1976279B (en) * 2006-12-04 2010-10-06 北京飞天诚信科技有限公司 Automatic monitoring and cleaning intelligent key system and working method thereof
CN102333015A (en) * 2011-10-25 2012-01-25 山西省电力公司大同供电分公司 A method for monitoring computer information network
CN102968325A (en) * 2012-12-04 2013-03-13 北京深思洛克软件技术股份有限公司 USB (Universal Serial Bus) equipment and method and device for automatically initializing same
CN102968325B (en) * 2012-12-04 2016-12-21 北京深思数盾科技股份有限公司 A kind of USB device and the method and apparatus of auto-initiation thereof
CN104484196A (en) * 2014-11-28 2015-04-01 上海动联信息技术股份有限公司 Production system and method for automatically finishing USB KEY equipment firmware initialization
CN104484196B (en) * 2014-11-28 2018-01-02 上海动联信息技术股份有限公司 A kind of production system and method for being automatically performed the initialization of USBKEY equipment firmwares

Also Published As

Publication number Publication date
CN100386751C (en) 2008-05-07

Similar Documents

Publication Publication Date Title
CN1208722C (en) Method and apparatus for monitoring and processing related thread events in a data processing system
CN1138212C (en) Method and system for implementing non-destructive live insertion and extraction of function cards in computer system
CN1269033C (en) Method and apparatus to power off and/or reboot logical partitions in data processing system
CN200983158Y (en) A knife management card for computer knife server
CN101060436A (en) A fault analyzing method and device for communication equipment
CN1564987A (en) Apparatus and method for enumeration of processors during hot-plug of a compute node
CN1949179A (en) Method and system for using processlets to model service processes
CN1754150A (en) System and apparatus for eliminating user interaction during hardware configuration at system boot
CN1831777A (en) System and method for managing multiple hot plug operations
CN1752942A (en) Monitoring diagnosis device of computer main board failure
CN1904864A (en) Device and method for making HID apparatus provide smart card interface
CN100346298C (en) System and method for remotely loading or upgrading program
CN1949169A (en) TV software upgrading method
CN1851679A (en) USB device automatic initialization method and device
CN110135130A (en) A kind of embedded device software tamper-resistant method and system
CN1713127A (en) Systems and methods for SCSI and SAS hardware availability
CN1256663C (en) Management method possessing real time helping function in insertion type system
CN1993676A (en) Method and apparatus for discovering hardware in a data processing system
CN1869973A (en) Method and system for generating file
CN1940884A (en) Computer system, computer network and method
CN1928837A (en) Method and system to detect errors in computer systems by using state tracking
CN1262921C (en) Method for computer starting and multiple operation system switching
CN1534920A (en) Method of realizing internal external network physical partition and its device
CN1693918A (en) Robust for detecting physical system model
CN1369802A (en) Method for recording and automatically restoring flow state

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
C56 Change in the name or address of the patentee

Owner name: FEITIAN CHENGXIN TECHNOLOGIES CO., LTD.

Free format text: FORMER NAME: BEIJING FEITIAN CHENGXIN SCIENCE + TECHNOLOGY CO. LTD.

CP03 Change of name, title or address

Address after: 100085 Beijing city Haidian District Xueqing Road No. 9 Ebizal building B block 17 layer

Patentee after: Feitian Technologies Co.,Ltd.

Address before: 100083, Haidian District, Xueyuan Road, No. 40 research, 7 floor, 5 floor, Beijing

Patentee before: FEITIAN TECHNOLOGIES Co.,Ltd.

CP03 Change of name, title or address

Address after: 17th floor, building B, Huizhi building, No.9, Xueqing Road, Haidian District, Beijing 100085

Patentee after: Feitian Technologies Co.,Ltd.

Country or region after: China

Address before: 100085 17th floor, block B, Huizhi building, No.9 Xueqing Road, Haidian District, Beijing

Patentee before: Feitian Technologies Co.,Ltd.

Country or region before: China

CP03 Change of name, title or address
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20080507

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