CN103186486A - Method for identifying, plugging and unplugging USB (universal serial bus) devices under Linux system in real time - Google Patents
Method for identifying, plugging and unplugging USB (universal serial bus) devices under Linux system in real time Download PDFInfo
- Publication number
- CN103186486A CN103186486A CN2011104515126A CN201110451512A CN103186486A CN 103186486 A CN103186486 A CN 103186486A CN 2011104515126 A CN2011104515126 A CN 2011104515126A CN 201110451512 A CN201110451512 A CN 201110451512A CN 103186486 A CN103186486 A CN 103186486A
- Authority
- CN
- China
- Prior art keywords
- usb
- information
- usb device
- equipment
- node
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Stored Programmes (AREA)
Abstract
The invention belongs to the technical field of electronic information processing and relates to a method for identifying, plugging and unplugging USB (universal serial bus) devices under the Linux system in real time. The method comprises the steps of finding the accessing or unplugging of a device in real time, determining the accessed or unplugged device to be the USB device and determining name, manufacturer information and device node of the USB device, combining multiple technologies to realize the real-time identifying of the accessed or unplugged USB device, and finally obtaining the focused device information content such as the name, manufacturer information and the node of the device. The method disclosed by the invention is simple in technical process, reliable in identifying principle, accurate in information data collection, advanced in processing effect and can be applied in USB plugging-unplugging occasions of multiple electric equipment and television digital equipment.
Description
Technical field:
The invention belongs to the electronic information processing technology field, relate under the method, particularly a kind of linux system of the plug of Real time identification under a kind of linux system USB device when set-top box or televisor insert or extract USB device the real-time identification method to USB device.
Background technology:
At present, in the electronic computer technology field, Linux is a kind of computer operating system of free and open source code, from mobile phone, panel computer, router, video game console, in desk-top computer and server, all be applied, especially in embedded devices such as set-top box, home gateway and mobile device, be used widely especially.USB interface has the characteristic of supporting hot plug, and simple in structure, with low cost and have good performance and be used widely in computer peripheral equipment and various instrument because of it, the equipment of USB interface has become the main flow of wire transmission and selected.At present, finish the general configuration of adopting artificial mode to finish equipment of data acquisition of USB device under the linux system, this mode is unfavorable for realizing the collection of robotization owing to the participation that needs the people, and capture program generally is to develop at certain equipment not have versatility, artificial participation is made troubles for the device data collection, and the acquisition software of special purpose is unfavorable for the integration of equipment.So, explore and research and develop a kind of new technological means to realize real-time discovery and the identification of USB device, get access to abundant facility information, and the actual conditions of utilizing these information bonding apparatus can develop the data acquisition program of compatible plurality of devices, and can finish data acquisition automatically and become and seeking the technical need that solves in the electronic information treatment technology.
Summary of the invention:
The objective of the invention is to overcome the shortcoming that prior art exists, seek to design a kind of can the Real time identification USB device insertion or extract, abundant information is provided, adopt different disposal routes at distinct device, finish the real-time data acquisition of plurality of devices under the linux system, and Real time identification goes out the information contents such as equipment vendors and title, the nodal information of collecting device simultaneously, thus finish the Real time identification task.
To achieve these goals, major function step of the present invention comprises that real-time discovery has equipment to insert or what extract, determine to insert or extract is USB device and device name, producer's information and three funtion parts of device node of determining the USB device that inserts or extract, and its concrete steps are:
(1), Linux usb file system (usbfs): linux system is provided with the support of usb file system, can produce USB device message file in the register system, this document comes USB device in the descriptive system with specific form and implication, what pay close attention in the message file is producer's information and device name, and the path of message file in linux system is/dev/bus/usb/devices;
(2), udev: the equipment manager of selecting the above version of Linux2.6 for use, its function is the device node under the management/dev catalogue, in esse device node in the system can dynamically be provided, and device node is supported the equipment operation of Linxu operating system, and equipment is operated based on node;
(3), the Netlink:Linux kernel provides a kind of communication modes, use the both-way communication between this communication modes realization linux kernel and application program, support the various protocols type, the information the when equipment that receiving linux kernel provides inserts or extracts, the real-time that the energy discovering device inserts or extracts;
(4), kernel information is handled: whether the equipment that preliminary judgement inserts or extracts is USB device, if USB device is finished the part work of recognition of devices then according to information format extraction device node;
(5), USB device file coupling: the variation of USB device message file before and after relatively USB device inserts or extracts, find the equipment that inserts or extract, effective content of extraction device title and producer's information prints or shows output.
The present invention realizes the Real time identification that USB device plugs in conjunction with multiple technologies, finally obtains the facility information content that device name, producer's information and device node etc. are paid close attention to; When inserting or extract, USB device at first use netlink to receive the information that linux kernel sends, the access of discovering device in real time or extract, and whether what tentatively judge access by above-mentioned information is USB device, if USB device, elder generation's extraction device node, facility information before and after extracting device inserts or extracts then in the USB device log file, insert or extract the facility information of front and back by compare facilities, obtain inserting or extracting device name and producer's information, device name and producer's information are described in the USB device descriptor.
The present invention compared with prior art has the following advantages: the one, realize the Real time identification that USB device plugs, and get access to abundant facility information; The 2nd, in conjunction with the actual conditions of multiple healthy equipment, develop the data acquisition program of compatible plurality of devices; Its whole technological process is simple, and recognition principle is reliable, and the information data collection is accurate, and the treatment effect advanced person can be applied to the USB plug occasion in various electronic and the TV digital equipment.
Description of drawings:
Fig. 1 is the workflow schematic block diagram of the inventive method.
Embodiment:
Also be described further by reference to the accompanying drawings below by embodiment.
Embodiment:
The major function of present embodiment comprises that real-time discovery has USB device to insert or what extract, determine to insert or extract is USB device and device name, producer's information and three funtion parts of device node of determining the USB device that inserts or extract, and its concrete steps are:
(1), Linux usb file system (usbfs): linux system has had the support of usb file system, will produce the file of USB device information in the register system, this document comes USB device in the descriptive system with specific form and implication, what this method was paid close attention in the information is manufacturer and device name, and the path of this document in linux system is/dev/bus/usb/devices;
(2), the equipment manager of the above version of udev:Linux2.6, function is the device node under management linux system/dev catalogue, in esse device node in the system can dynamically be provided, and device node is most important to the equipment operation of Linxu operating system, because the equipment operation is based on node;
(3), a kind of communication modes of providing of Netlink:Linux kernel, use this technology can realize both-way communication between linux kernel and application program, it supports the various protocols type, information when the equipment that using this technology to receive linux kernel in the method provides inserts or extracts, because linux kernel provides these information in real time, this technology can guarantee the real-time that discovering device inserts or extracts;
(4), kernel information is handled: whether the equipment that preliminary judgement inserts or extracts is USB device, if USB device is finished the part work of recognition of devices then according to information format extraction device node;
(5), USB device file coupling: the variation of USB device message file before and after compare facilities inserts or extracts, the equipment that finds access or extract, effective content such as extraction device title and producer's information.
Present embodiment is realized the Real time identification that USB device plugs in conjunction with multiple technologies, finally obtains the facility information content that device name, producer's information and device node etc. are paid close attention to; When inserting or extract, USB device at first use netlink to receive the information that linux kernel sends, the access of discovering device in real time or extract, and whether what tentatively judge access by this information is USB device.If USB device, elder generation's extraction device node, facility information before and after extraction equipment inserts or extracts then in the USB device log file, insert or extract the facility information of front and back by compare facilities, inserted or extract title and producer's information of equipment, and device name and producer's information are described in the USB device descriptor all.
Claims (1)
1. the method for Real time identification plug USB device under the linux system, comprise that real-time discovery has equipment to insert or what extract, determine to insert or extract is USB device and device name, producer's information and three funtion parts of device node of determining the USB device that inserts or extract, it is characterized in that concrete steps are:
(1), Linux usb file system (usbfs): linux system is provided with the support of usb file system, can produce USB device message file in the register system, this document comes USB device in the descriptive system with specific form and implication, what pay close attention in the message file is producer's information and device name, and the path of message file in linux system is/dev/bus/usb/devices;
(2), udev: the equipment manager of selecting the above version of Linux2.6 for use, its function is the device node under the management/dev catalogue, in esse device node in the system can dynamically be provided, and device node is supported the equipment operation of Linxu operating system, and equipment is operated based on node;
(3), the Netlink:Linux kernel provides a kind of communication modes, use the both-way communication between this communication modes realization linux kernel and application program, support the various protocols type, the information the when equipment that receiving linux kernel provides inserts or extracts, the real-time that the energy discovering device inserts or extracts;
(4), kernel information is handled: whether the equipment that preliminary judgement inserts or extracts is USB device, if USB device is finished the part work of recognition of devices then according to information format extraction device node;
(5), USB device file coupling: the variation of USB device message file before and after relatively USB device inserts or extracts, find the equipment that inserts or extract, effective content of extraction device title and producer's information prints or shows output.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2011104515126A CN103186486A (en) | 2011-12-30 | 2011-12-30 | Method for identifying, plugging and unplugging USB (universal serial bus) devices under Linux system in real time |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2011104515126A CN103186486A (en) | 2011-12-30 | 2011-12-30 | Method for identifying, plugging and unplugging USB (universal serial bus) devices under Linux system in real time |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103186486A true CN103186486A (en) | 2013-07-03 |
Family
ID=48677660
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2011104515126A Pending CN103186486A (en) | 2011-12-30 | 2011-12-30 | Method for identifying, plugging and unplugging USB (universal serial bus) devices under Linux system in real time |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103186486A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103400073A (en) * | 2013-07-09 | 2013-11-20 | 东莞天意电子有限公司 | Method for monitoring and identifying USB input equipment of video lottery terminal |
CN103744708A (en) * | 2014-01-23 | 2014-04-23 | 浪潮电子信息产业股份有限公司 | Method of fixing disk device names in Linux operating system |
CN105187879A (en) * | 2015-09-09 | 2015-12-23 | 青岛海信电器股份有限公司 | Remote control code value downloading method and television set |
CN105657464A (en) * | 2016-01-28 | 2016-06-08 | 四川长虹电器股份有限公司 | USB repeated node shielding method |
CN106598798A (en) * | 2016-12-19 | 2017-04-26 | 四川长虹电器股份有限公司 | Method of Android intelligent device to detect USB device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101398791A (en) * | 2007-09-25 | 2009-04-01 | 神州亿品科技有限公司 | Method for automatically monitoring USB disc |
CN101488114A (en) * | 2009-02-18 | 2009-07-22 | 北京飞天诚信科技有限公司 | USB equipment processing method in Linux system |
US20100174833A1 (en) * | 2009-01-05 | 2010-07-08 | Roderick David Earle Filer | Method and Apparatus for Identifying a Device Handle in a Computer System |
-
2011
- 2011-12-30 CN CN2011104515126A patent/CN103186486A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101398791A (en) * | 2007-09-25 | 2009-04-01 | 神州亿品科技有限公司 | Method for automatically monitoring USB disc |
US20100174833A1 (en) * | 2009-01-05 | 2010-07-08 | Roderick David Earle Filer | Method and Apparatus for Identifying a Device Handle in a Computer System |
CN101488114A (en) * | 2009-02-18 | 2009-07-22 | 北京飞天诚信科技有限公司 | USB equipment processing method in Linux system |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103400073A (en) * | 2013-07-09 | 2013-11-20 | 东莞天意电子有限公司 | Method for monitoring and identifying USB input equipment of video lottery terminal |
CN103744708A (en) * | 2014-01-23 | 2014-04-23 | 浪潮电子信息产业股份有限公司 | Method of fixing disk device names in Linux operating system |
CN105187879A (en) * | 2015-09-09 | 2015-12-23 | 青岛海信电器股份有限公司 | Remote control code value downloading method and television set |
CN105657464A (en) * | 2016-01-28 | 2016-06-08 | 四川长虹电器股份有限公司 | USB repeated node shielding method |
CN105657464B (en) * | 2016-01-28 | 2018-12-07 | 四川长虹电器股份有限公司 | A kind of screen method of USB duplicate node |
CN106598798A (en) * | 2016-12-19 | 2017-04-26 | 四川长虹电器股份有限公司 | Method of Android intelligent device to detect USB device |
CN106598798B (en) * | 2016-12-19 | 2019-11-19 | 四川长虹电器股份有限公司 | The method of Android intelligent equipment detection USB device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103186487A (en) | Method for real-time recognition of USB device hot plugging | |
US9537957B2 (en) | Seamless application session reconstruction between devices | |
CN103186486A (en) | Method for identifying, plugging and unplugging USB (universal serial bus) devices under Linux system in real time | |
WO2015024413A1 (en) | Conference summary extraction method and device | |
CN102710658B (en) | Information push method and system | |
CN103780970A (en) | Media playing method, device and system | |
CN103327005B (en) | Equipment cut-in method based on virtual desktop and device | |
TW201411508A (en) | Fingerprint identification and verification system and method thereof | |
TW200948075A (en) | Method for providing audio/video stream signal and share system | |
CN105005474B (en) | A kind of pair of Android phone information carries out the micromodule equipment and extracting method of secret extraction | |
CN110752930A (en) | Electronic evidence security device | |
CN109992938A (en) | A kind of method of multi-user access computer data | |
CN110134447A (en) | The system and method for BMC immediate updating hard disk information based on operating system | |
CN103077561A (en) | School office fingerprint access control management system | |
CN101605132A (en) | A kind of method for identifying network data stream | |
CN103024023B (en) | Digital Reading Room network audit method | |
CN102724305A (en) | Method for remotely accessing to terminal U (universal serial bus) flash disk | |
CN103996035A (en) | Passenger security check identity certification product | |
CN105635325A (en) | Multimedia system data storage and analysis method based on cloud computing and big data | |
CN105763930A (en) | Method for pushing two-dimensional code of television program, intelligent television, and set top box | |
CN103176454B (en) | The cluster method of multi-robot system and system | |
JP2007274582A (en) | Monitoring video image management system | |
CN106487862A (en) | Transfer interactive system and method based on fingerprint identification information | |
CN101909069A (en) | Data-processing system | |
CN106445489A (en) | System switching method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20130703 |