CN107168896A - The control system and control method of a kind of USB device - Google Patents

The control system and control method of a kind of USB device Download PDF

Info

Publication number
CN107168896A
CN107168896A CN201710282945.0A CN201710282945A CN107168896A CN 107168896 A CN107168896 A CN 107168896A CN 201710282945 A CN201710282945 A CN 201710282945A CN 107168896 A CN107168896 A CN 107168896A
Authority
CN
China
Prior art keywords
usb
events
type
keyword
monitoring process
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.)
Withdrawn
Application number
CN201710282945.0A
Other languages
Chinese (zh)
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.)
Fiberhome Telecommunication Technologies Co Ltd
Original Assignee
Fiberhome Telecommunication 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 Fiberhome Telecommunication Technologies Co Ltd filed Critical Fiberhome Telecommunication Technologies Co Ltd
Priority to CN201710282945.0A priority Critical patent/CN107168896A/en
Publication of CN107168896A publication Critical patent/CN107168896A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/102Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Systems (AREA)

Abstract

The invention discloses a kind of control system of USB device, including:Bottom layer driving module, the USB events for catching bottom, and corresponding keyword is reported according to the type of USB events, the type of the USB events includes device type identification, label read-write, capacity reading and hot plug events;Monitoring process module, for receiving the keyword, judges the type of the corresponding USB events of the keyword, responds the USB events, interacted according to the type of the USB events with respective modules.The present invention can realize the identification of the device type of USB device, label read-write, capacity are read, the control management function of hot plug events, meet user's needs, applied widely, operating aspect.

Description

The control system and control method of a kind of USB device
Technical field
The present invention relates to the control technology field of the USB device in intelligent gateway embedded system, and in particular to a kind of USB The control system and control method of equipment.
Background technology
USB (USB) is had become embedding due to the transmission speed and versatility in industry of its high speed Enter the particularly important mode that formula equipment communicates with other equipment., can high speed after being connected by USB with host computer such as mobile phone Data are transmitted, for charging etc. handheld device can be allow to play storage device, a variety of work(such as wireless network card and debugging again Energy.But the USB device in intelligent gateway embedded system can only realize the carry of USB device, it is impossible to which realization is such as recognized The device type of carry, the reading write-in of label reports the plug time to give other functions such as module interested, it is impossible to full Sufficient user's request, such as light cat can only carry out carry to USB device, can not carry out excessive processing, and as light cat is more next More intelligent, user has more intelligentized demands, and the control to USB device requires higher.
The content of the invention
For defect present in prior art, it is an object of the invention to provide a kind of control system of USB device and Control method, can realize the control management function of USB device.
To achieve the above objectives, the present invention is adopted the technical scheme that:
A kind of control system of USB device, including:
Bottom layer driving module, the USB events for catching bottom, and corresponding key is reported according to the type of USB events Word, the type of the USB events includes device type identification, label read-write, capacity reading and hot plug events;
Monitoring process module, for receiving the keyword, judges the type of the corresponding USB events of the keyword, rings The USB events are answered, are interacted according to the type of the USB events with respective modules.
On the basis of above-mentioned technical proposal, the type that the bottom layer driving module captures the USB events is equipment Type identification, then send storage device keyword or serial equipment keyword, the monitoring process to the monitoring process module It is storage device or serial equipment that module goes out device type according to storage device keyword or serial equipment keyword recognition, and is incited somebody to action Device type is sent to display device.
On the basis of above-mentioned technical proposal, the type that the bottom layer driving module captures the USB events is label Read-write, then send label to the monitoring process module and read keyword, the monitoring process module reads crucial according to label Word calls open source software to read the form of label, is called according to the form of label and transplants the write-in that software realizes label.
On the basis of above-mentioned technical proposal, the type that the bottom layer driving module captures the USB events is capacity Read, then sending capacity to the monitoring process module reads keyword, and the monitoring process module reads crucial according to capacity Word calls xml document, writes capacity information, device name information and the format type information of USB device.
On the basis of above-mentioned technical proposal, the type that the bottom layer driving module captures the USB events is that heat is inserted Event is pulled out, then sends hot plug events keyword to the monitoring process module, the monitoring process module is according to hot plug thing Part keyword calls communication interface, reports the hot plug events to module interested.
A kind of control method of USB device, is comprised the following steps that:
S1, bottom layer driving module catches the USB events of bottom, and the type of the USB events includes device type identification, volume Mark read-write, capacity are read and hot plug events, and corresponding keyword is reported according to the type of USB events;
S2, the keyword that the monitoring process module reception bottom layer driving module is reported judges the type of USB events, according to The type of USB events, calls correlation module, performs function corresponding with USB events.
On the basis of above-mentioned technical proposal, if the type of the USB events is device type identification, the monitoring process Module calls web display devices, display device type.
On the basis of above-mentioned technical proposal, if the type of the USB events is label read-write, the monitoring process module Open source software and transplanting software are called, the read-write of label is realized.
On the basis of above-mentioned technical proposal, read if the type of the USB events is capacity, the monitoring process module Xml document is called, the capacity information of USB device, device name information and format type information are write in xml document.
On the basis of above-mentioned technical proposal, if the type of the USB events is hot plug events, the monitoring process mould Block calls socket communication interfaces, reports the hot plug events to module interested.
Compared with prior art, the advantage of the invention is that:
The present invention by starting a monitoring process in the usb device, and the USB events to bottom are monitored, to bottom The USB events reported are driven to be handled, compared to the carry function that traditional embedded device can only realize USB device, this hair The bright device type identification that can be realized to USB device, label read-write, capacity reading, the control management function of hot plug events, Meet user's needs, applied widely, operating aspect.
Brief description of the drawings
Fig. 1 is the structured flowchart of control system in the embodiment of the present invention;
Fig. 2 is the flow chart of control method in the embodiment of the present invention.
Embodiment
The present invention is described in further detail below in conjunction with drawings and Examples.
Shown in Figure 1, the embodiment of the present invention provides a kind of control system of USB device, including:
Bottom layer driving module, bottom layer driving module is used for the USB events for catching bottom, and the type of USB events includes equipment Type identification, label read-write, capacity are read and hot plug events, and corresponding keyword is reported according to the type of USB events;
Monitoring process module, monitoring process module is used to receive the type that keyword judges corresponding USB events, and rings USB events are answered, are interacted according to the type of USB events and respective modules.The device type knowledge to USB device can be realized Not, label read-write, capacity reading, the control management function of hot plug events, meet user's needs, applied widely, operation side Face.
The type that bottom layer driving module captures USB events is device type identification, then sends and deposit to monitoring process module Equipment keyword or serial equipment keyword are stored up, wherein storage device keyword includes " ttyACM ", serial equipment keyword bag Include " ttyUSB ", monitoring process module identifies that device type is storage device according to " ttyACM ", recognized according to " ttyUSB " It is serial equipment to go out device type, and the device type that will identify that is sent to web display devices and is presented to user.
The type that bottom layer driving module captures USB events is label read-write, then sending label to monitoring process module reads Keyword is taken, label, which reads keyword, includes " label ", monitoring process module calls open source software blkid, open source software Blkid realizes the reading of label, identify be fat32 or NTFS format equipment, for the equipment of fat32 forms, then call Transplant software mlable to complete the write-in of label, for the equipment of NTFS format, then call transplanting software ntfslablee to come Complete the write-in of label.
The type that bottom layer driving module captures USB events is that capacity is read, then sending capacity to monitoring process module reads Keyword is taken, capacity, which reads keyword, includes " Storage ", monitoring process module reads keyword according to capacity and calls xml texts Part, xml document writes capacity information, device name information and the format type information of USB device, is used for other modules.
The type that bottom layer driving module captures USB events is hot plug events, then sending heat to monitoring process module inserts Event keyword is pulled out, hot plug events keyword includes " Hotplus ", and monitoring process module is adjusted according to hot plug events keyword Socket communication interfaces are used, hot plug events are reported to module interested.
A kind of control method of USB device, is comprised the following steps that:
S1, bottom layer driving module catches the USB events of bottom, and the type of USB events includes device type identification, label and read Write, capacity is read and hot plug event, and corresponding keyword is reported according to the type of USB events;Bottom layer driving module captures USB The type of event is device type identification, then being sent to monitoring process module includes the keyword of " ttyACM " or " ttyUSB "; The type that bottom layer driving module captures USB events is label read-write, then being sent to monitoring process module includes the pass of " label " Key word;The type that bottom layer driving module captures USB events is that capacity is read, then being sent to monitoring process module includes The keyword of " Storage ";The type that bottom layer driving module captures USB events is hot plug events, then to monitoring process mould Block, which is sent, includes the keyword of " Hotplus ";
S2, the keyword that monitoring process module reception bottom layer driving module is reported judges the type of USB events, according to USB The type of event, calls correlation module, performs function corresponding with USB events.If the type of USB events is equipment identification, Monitoring process module calls web display devices, display device type;If the type of USB events is spool read-write, monitoring process Module calls open source software to recognize the form of label, calls corresponding transplanting software according to the form of label, realizes writing for label Enter;Read if the type of USB events is capacity, monitoring process module is called xml document, by the capacity information of USB device, set In standby name information and format type information write-in xml document;If the type of USB events is hot plug events, monitor into Journey module calls socket communication interfaces, reports hot plug events to module interested.
The present invention is not limited to the above-described embodiments, for those skilled in the art, is not departing from On the premise of the principle of the invention, some improvements and modifications can also be made, these improvements and modifications are also considered as the protection of the present invention Within the scope of.The content not being described in detail in this specification belongs to prior art known to professional and technical personnel in the field.

Claims (10)

1. a kind of control system of USB device, it is characterised in that including:
Bottom layer driving module, the USB events for catching bottom, and corresponding keyword, institute are reported according to the type of USB events Stating the type of USB events includes device type identification, label read-write, capacity reading and hot plug events;
Monitoring process module, for receiving the keyword, judges the type of the corresponding USB events of the keyword, responds institute USB events are stated, are interacted according to the type of the USB events with respective modules.
2. a kind of control system of USB device as claimed in claim 1, it is characterised in that:
The type that the bottom layer driving module captures the USB events is device type identification, then to the monitoring process mould Block sends storage device keyword or serial equipment keyword, and the monitoring process module is according to storage device keyword or serial ports It is storage device or serial equipment that equipment keyword recognition, which goes out device type, and device type is sent into display device.
3. a kind of control system of USB device as claimed in claim 1, it is characterised in that:
The type that the bottom layer driving module captures the USB events is label read-write, then is sent out to the monitoring process module Label is sent to read keyword, the monitoring process module reads the lattice that keyword calls open source software to read label according to label Formula, calls according to the form of label and transplants the write-in that software realizes label.
4. a kind of control system of USB device as claimed in claim 1, it is characterised in that:
The type that the bottom layer driving module captures the USB events is that capacity is read, then is sent out to the monitoring process module Capacity is sent to read keyword, the monitoring process module reads keyword according to capacity and calls xml document, write-in USB device Capacity information, device name information and format type information.
5. a kind of control system of USB device as claimed in claim 1, it is characterised in that:
The type that the bottom layer driving module captures the USB events is hot plug events, then to the monitoring process module Hot plug events keyword is sent, the monitoring process module calls communication interface according to hot plug events keyword, reports institute Hot plug events are stated to module interested.
6. a kind of control method of USB device, it is characterised in that comprise the following steps that:
S1, bottom layer driving module catches the USB events of bottom, and the type of the USB events includes device type identification, label and read Write, capacity is read and hot plug events, and corresponding keyword is reported according to the type of USB events;
S2, the keyword that the monitoring process module reception bottom layer driving module is reported judges the type of USB events, according to USB The type of event, calls correlation module, performs function corresponding with USB events.
7. a kind of control method of USB device as claimed in claim 6, it is characterised in that:
If the type of the USB events is device type identification, the monitoring process module calls web display devices, and display is set Standby type.
8. a kind of control method of USB device as claimed in claim 6, it is characterised in that:
If the type of the USB events is label read-write, the monitoring process module calls open source software and transplanting software, realizes The read-write of label.
9. a kind of control method of USB device as claimed in claim 6, it is characterised in that:
Read if the type of the USB events is capacity, the monitoring process module calls xml document, by the capacity of USB device In information, device name information and format type information write-in xml document.
10. a kind of control method of USB device as claimed in claim 6, it is characterised in that:If the type of the USB events It is hot plug events, the monitoring process module calls socket communication interfaces, reports the hot plug events to interested Module.
CN201710282945.0A 2017-04-26 2017-04-26 The control system and control method of a kind of USB device Withdrawn CN107168896A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710282945.0A CN107168896A (en) 2017-04-26 2017-04-26 The control system and control method of a kind of USB device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710282945.0A CN107168896A (en) 2017-04-26 2017-04-26 The control system and control method of a kind of USB device

Publications (1)

Publication Number Publication Date
CN107168896A true CN107168896A (en) 2017-09-15

Family

ID=59812407

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710282945.0A Withdrawn CN107168896A (en) 2017-04-26 2017-04-26 The control system and control method of a kind of USB device

Country Status (1)

Country Link
CN (1) CN107168896A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108021520A (en) * 2017-11-30 2018-05-11 深圳市华德安科技有限公司 Display methods, device and the computer-readable recording medium of access device title
CN111159789A (en) * 2019-12-26 2020-05-15 深信服科技股份有限公司 Method, device, equipment and storage medium for monitoring file

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101452369A (en) * 2007-11-29 2009-06-10 国际商业机器公司 Method and system for controlling logical unit of USB mass storage device
CN101465930A (en) * 2007-12-18 2009-06-24 日本冲信息株式会社 Image processing apparatus
CN101853224A (en) * 2010-04-21 2010-10-06 中兴通讯股份有限公司 Method and device for identifying port of data card device under Linux system
CN102830970A (en) * 2012-08-10 2012-12-19 深圳市共进电子股份有限公司 Hot-plug treatment method applicable to Linux embedded system
CN104199569A (en) * 2014-09-03 2014-12-10 山东超越数控电子有限公司 Keyboard and mouse switching and using method based on USB interfaces in KVM equipment
CN104539665A (en) * 2014-12-15 2015-04-22 北京极科极客科技有限公司 Remote file control system based on routers

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101452369A (en) * 2007-11-29 2009-06-10 国际商业机器公司 Method and system for controlling logical unit of USB mass storage device
CN101465930A (en) * 2007-12-18 2009-06-24 日本冲信息株式会社 Image processing apparatus
CN101853224A (en) * 2010-04-21 2010-10-06 中兴通讯股份有限公司 Method and device for identifying port of data card device under Linux system
CN102830970A (en) * 2012-08-10 2012-12-19 深圳市共进电子股份有限公司 Hot-plug treatment method applicable to Linux embedded system
CN104199569A (en) * 2014-09-03 2014-12-10 山东超越数控电子有限公司 Keyboard and mouse switching and using method based on USB interfaces in KVM equipment
CN104539665A (en) * 2014-12-15 2015-04-22 北京极科极客科技有限公司 Remote file control system based on routers

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108021520A (en) * 2017-11-30 2018-05-11 深圳市华德安科技有限公司 Display methods, device and the computer-readable recording medium of access device title
CN111159789A (en) * 2019-12-26 2020-05-15 深信服科技股份有限公司 Method, device, equipment and storage medium for monitoring file

Similar Documents

Publication Publication Date Title
JP6193859B2 (en) RFID card management method and terminal
CN101799942B (en) Security watching tour inspection record method and system thereof
CN103426208A (en) Cell phone attendance system based on WiFi signals
CN100578524C (en) Appratus and method for changing data of RFID tag in handheld terminal
CN107168896A (en) The control system and control method of a kind of USB device
CN101699416B (en) Communication method and system between host computer and card reader with multiple card holders
CN103489148A (en) Mobile intelligent information collection terminal and mobile information collection contrasting method
CN105612531A (en) Network access method, RFID tag, electronic device, and control system
CN202584236U (en) Portable attendance terminal
CN205959254U (en) Intelligence system of patrolling and examining
CN101149811B (en) Memory device information mark system and method
CN209545580U (en) A kind of portable voice communication device and system with positioning function
CN100365607C (en) Apparatus and method for controlling SD card interface
CN101566975A (en) Method for communication with safe mobile memory apparatus
CN203118071U (en) Novel wireless finger-print attendance system
CN208207874U (en) Electronic mineral bill system
CN201749501U (en) Security watching and inspection recording system
CN210804422U (en) Labeling device for power equipment image
CN101256489A (en) System and method for implementing AT command interaction with Apple computer
CN205050162U (en) Mutual -inductor management system
CN206209624U (en) Support that mobile non-contact data exchanges the electronic handwriting pen system of storage
CN201765602U (en) Production data real-time management device based on PLM
CN201742450U (en) Mobile phone with A-type USB port
CN206025516U (en) Reagent kit
CN105184338A (en) Mutual inductor, mutual inductor identity information acquisition system and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20170915