CN102455981A - Hot-plug implementation method of universal serial bus (USB) equipment based on Qt/embedded (QTE) environment - Google Patents

Hot-plug implementation method of universal serial bus (USB) equipment based on Qt/embedded (QTE) environment Download PDF

Info

Publication number
CN102455981A
CN102455981A CN2010105115412A CN201010511541A CN102455981A CN 102455981 A CN102455981 A CN 102455981A CN 2010105115412 A CN2010105115412 A CN 2010105115412A CN 201010511541 A CN201010511541 A CN 201010511541A CN 102455981 A CN102455981 A CN 102455981A
Authority
CN
China
Prior art keywords
usb device
finger daemon
qte
usb
implementation method
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
Application number
CN2010105115412A
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.)
Konka Group Co Ltd
Original Assignee
Konka Group 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 Konka Group Co Ltd filed Critical Konka Group Co Ltd
Priority to CN2010105115412A priority Critical patent/CN102455981A/en
Publication of CN102455981A publication Critical patent/CN102455981A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The invention relates to the field of electronic information, in particular to a hot-plug implementation method of universal serial bus (USB) equipment based on a Qt/embedded (QTE) environment. The method comprises the following steps that: (1) a QWS server process establishes interception at an appointed port to obtain an interception socket; (2) a daemon process is created for monitoring the service condition of the USB equipment; and (3) the daemon process sends the data information of the USB equipment to the QWS server process of a QTE end through a local socket. The method has the advantages that: a QWS server of the QTE end directly reads the socket without acquisition of the condition information of USB input equipment, so that application and hardware are effectively isolated; meanwhile, when the daemon process monitors the service condition of the USB input equipment, the response time is short, so that the response speed of the equipment is improved.

Description

Implementation method based on the USB device hot plug under the QTE environment
Technical field
The present invention relates to electronic information field, relate in particular to a kind of implementation method based on the USB device hot plug under the QTE environment.
Background technology
Along with the continuous development of Embedded Application, the continuous enhancing of flush bonding processor arithmetic capability, increasing embedded device begins to adopt comparatively complicated GUI system, and the GUI system development in the handheld device gets very fast.Qt/Embedded (QTE) is the Qt version towards embedded system that famous Qt storehouse developer Trolltech company develops, and the Qt/Embedded class libraries adopts the C++ encapsulation fully.At present; QTE software also is used to support USB mouse and keyboard equipment, and input equipment opens and closes at the QWSServer end, like this; Under the situation that application program does not withdraw from; If USB device has Plug Action, then QWSServer can't carry out the opening of USB device, shutoff operation, thereby causes respective file system equipment node to change the problem that can't respond.
Summary of the invention
In order to solve the problems of the prior art, the invention provides a kind of implementation method based on the USB device hot plug under the QTE environment, solve in the prior art problem that under the situation that current application does not withdraw from hot plug USB device does not have response.
The invention provides a kind of implementation method, may further comprise the steps: (S1) create finger daemon, the operating position of monitoring USB device based on the USB device hot plug under the QTE environment; (S2) finger daemon and QWSServer server processes connect; (S3) finger daemon sends the QWSServer server processes of data message to QTE.
As further improvement of the present invention, in the said step (S2), the corresponding thread of each USB device of opening; And in this thread, read the data message of this USB device.
As further improvement of the present invention, in the said step (S2), said finger daemon is unidirectional the connection with said QWSServer server processes; Said finger daemon is a data receiver, and said QWSServer server processes are the data receiver; Said finger daemon is set up SOCKET with the QWSServer server processes and is connected.
As further improvement of the present invention, in the said step (S3), finger daemon connects the QWSServer server processes of transmission USB device data message to QTE through local Socket.
As further improvement of the present invention, in the said step (S1), finger daemon monitoring USB device open and remove state; If the state of USB device is when opening, finger daemon generates the thread of this USB device automatically; If the state of USB device is when removing, finger daemon is closed the thread of this USB device automatically; The data message of said USB device is obtained by the thread that finger daemon generates.
As further improvement of the present invention, said QWSSERVER server processes are responsible for allocated display area, generation incident; Said QWSSERVER server processes receive the data message of the USB device that comes from said finger daemon and show.
As further improvement of the present invention; In the said step (S1); Finger daemon is judged the validity of USB device when the operating position of monitoring USB device, this finger daemon is opened this USB device when USB device is effective input equipment; Otherwise this finger daemon is closed this USB device when USB device is removed.
As further improvement of the present invention, said USB device comprises USB mouse and keyboard.
The invention has the beneficial effects as follows: the QWS Server of QTE end does not obtain the condition information of USB input equipment, directly reads socket, and effective isolation is used and hardware; Simultaneously, it is fast that finger daemon is kept watch on the operating position response time of USB input equipment, improved the response speed of equipment.
[description of drawings]
Fig. 1 is the process flow diagram that the present invention is based on the implementation method of the USB device hot plug under the QTE environment;
Fig. 2 is one embodiment of the invention schematic process flow diagram.
 
[embodiment]
Below in conjunction with description of drawings and embodiment the present invention is further specified.
Like Fig. 1, a kind of implementation method based on the USB device hot plug under the QTE environment may further comprise the steps: S1 creates finger daemon, the operating position of monitoring USB device; S2 finger daemon and QWS Server server processes connect; The S3 finger daemon sends the QWS Server server processes of data message to QTE.Being connected between finger daemon and the QWS Server server processes can be adopted multiple connected mode; Communication protocol by certain connects; Can adopt the SOCKET mode to set up data transmission and connect, can adopt unidirectional, also can be two-way connection, in order to increase response speed and to save the spending of finger daemon system; Here adopt unidirectional connection, promptly finger daemon only only sends data to QWS SERVER end.
Among the said step S2, the corresponding thread of each USB device of opening; And in this thread, read the data message of this USB device.
Among the said step S2, said finger daemon is unidirectional the connection with said QWSServer server processes; Said finger daemon is a data receiver, and said QWSServer server processes are the data receiver; Said finger daemon is set up SOCKET with the QWSServer server processes and is connected.
Among the said step S3, finger daemon connects the QWS Server server processes of transmission USB device data message to QTE through local Socket.When (non-plug operation) operated to USB device automatically by artificial or system; As when importing a letter or Chinese character; The letter that finger daemon will monitor or the information of Chinese character send to QWS Server server processes through local SOCKET agreement; QWS Server handles after receiving letter or Chinese character information more accordingly, as showing etc.
Among the said step S1, finger daemon monitoring USB device open and remove state; If the state of USB device is when opening, finger daemon generates the thread of this USB device automatically; If the state of USB device is when removing, finger daemon is closed the thread of this USB device automatically; The data message of said USB device is obtained by the thread that finger daemon generates.
Said QWSSERVER server processes are responsible for allocated display area, generation incident; Said QWSSERVER server processes receive the data message of the USB device that comes from said finger daemon and show.
Among the said step S1; Finger daemon is judged the validity of USB device when the operating position of monitoring USB device, this finger daemon is opened this USB device when USB device is effective input equipment; Otherwise this finger daemon is closed this USB device when USB device is removed.
Said USB device comprises USB mouse and keyboard.
 
In one embodiment, in the QTE environment, each Qte uses like Fig. 2, all exists server to exist.After handheld device (like mobile phone, portable terminal etc.) operation is got up, oneself become the Server process in this way, be connected to a Server process that has existed exactly.The Qt/E application program that first moves will start this server to be let and oneself becomes this Server process, and the program of follow-up operation will be connected to this Server and manage oneself.At Server end, each client that is connected to QWSServer has a QWSClient object corresponding with it, this object essential record client ID.Top-level windows of every establishment in application program just has QWSWindow instance of establishment at the server end so and comes corresponding with it.When Server receives an event incident; It need be judged send to that window; At this time, it will go for from the QWSWindow tabulation, goes for corresponding client application according to this window then; Pack this event incident with a QWSEvent object then, send to concrete client application client or finger daemon through socket mechanism.The processing of mouse event and the processing of KeyEvent also meet top flow process.Mouse-driven is by a QWSMouseHandler object encapsulation, and keyboard drive is encapsulated by a QWSKeyboardHandler.Concrete mouse and KeyEvent all can be encapsulated into a QWSEvent object and send to concrete client incident after taking place.
When USB device (like usb keyboard, mouse and some other USB devices) is plugged; Finger daemon will monitor this operational motion; At this moment, finger daemon directly obtains the relevant information and the insertion of this USB device or the action of pulling out USB device, and this information directly is sent on the QWS Server end through local SOCKET; And need not bring in processing by QWS Server, promptly the QWSServer of QTE end is indifferent to the situation of USB input equipment.Because it is fast that finger daemon is kept watch on the operating position response time of USB input equipment, thereby promoted the response speed of equipment.Simultaneously; Concrete operations information to USB device; As import the perhaps information of rolling mouse of a Chinese character, letter, and finger daemon can monitor these and these information are sent on the QWS Server through local SOCKET, and QWS Server handles accordingly again.Like this, the QWS Server situation that can not monitor the state that removes of USB device has then just obtained preferably solving through finger daemon.
Certainly, finger daemon is only monitored the Plug Action of USB device, certainly, also can increase the monitoring to other operation of USB device according to actual needs, and the monitoring flow process is the same.
Above content is to combine concrete preferred implementation to the further explain that the present invention did, and can not assert that practical implementation of the present invention is confined to these explanations.For the those of ordinary skill of technical field under the present invention, under the prerequisite that does not break away from the present invention's design, can also make some simple deduction or replace, all should be regarded as belonging to protection scope of the present invention.

Claims (8)

1. the implementation method based on the USB device hot plug under the QTE environment is characterized in that: may further comprise the steps: (S1) create finger daemon, the operating position of monitoring USB device; (S2) finger daemon and QWSServer server processes connect; (S3) finger daemon sends the QWSServer server processes of data message to QTE.
2. the implementation method based on the USB device hot plug under the QTE environment according to claim 1 is characterized in that: in the said step (S1), and the corresponding thread of each USB device of opening; And in this thread, read the data message of this USB device.
3. the implementation method based on the USB device hot plug under the QTE environment according to claim 1 is characterized in that: in the said step (S2), said finger daemon is unidirectional the connection with said QWSServer server processes; Said finger daemon is a data receiver, and said QWSServer server processes are the data receiver; Said finger daemon is set up SOCKET with the QWSServer server processes and is connected.
4. the implementation method based on the USB device hot plug under the QTE environment according to claim 1; It is characterized in that: in the said step (S3), finger daemon connects the QWSServer server processes of transmission USB device data message to QTE through local Socket.
5. the implementation method based on the USB device hot plug under the QTE environment according to claim 1 is characterized in that: in the said step (S1), finger daemon monitoring USB device open and remove state; If the state of USB device is when opening, finger daemon generates the thread of this USB device automatically; If the state of USB device is when removing, finger daemon is closed the thread of this USB device automatically; The data message of said USB device is obtained by the thread that finger daemon generates.
6. the implementation method based on the USB device hot plug under the QTE environment according to claim 1 is characterized in that: said QWSSERVER server processes are responsible for allocated display area, generation incident; Said QWSSERVER server processes receive the data message of the USB device that comes from said finger daemon and show.
7. the implementation method based on the USB device hot plug under the QTE environment according to claim 1; It is characterized in that: in the said step (S1); Finger daemon is judged the validity of USB device when the operating position of monitoring USB device, this finger daemon is opened this USB device when USB device is effective input equipment; Otherwise this finger daemon is closed this USB device when USB device is removed.
8. the implementation method based on the USB device hot plug under the QTE environment according to claim 1, it is characterized in that: said USB device comprises USB mouse and keyboard.
CN2010105115412A 2010-10-19 2010-10-19 Hot-plug implementation method of universal serial bus (USB) equipment based on Qt/embedded (QTE) environment Pending CN102455981A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010105115412A CN102455981A (en) 2010-10-19 2010-10-19 Hot-plug implementation method of universal serial bus (USB) equipment based on Qt/embedded (QTE) environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010105115412A CN102455981A (en) 2010-10-19 2010-10-19 Hot-plug implementation method of universal serial bus (USB) equipment based on Qt/embedded (QTE) environment

Publications (1)

Publication Number Publication Date
CN102455981A true CN102455981A (en) 2012-05-16

Family

ID=46039186

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010105115412A Pending CN102455981A (en) 2010-10-19 2010-10-19 Hot-plug implementation method of universal serial bus (USB) equipment based on Qt/embedded (QTE) environment

Country Status (1)

Country Link
CN (1) CN102455981A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103544061A (en) * 2013-10-30 2014-01-29 乐视致新电子科技(天津)有限公司 Smart television based safe exit method and device for external storage device
CN105352517A (en) * 2015-11-21 2016-02-24 广西南宁至简至凡科技咨询有限公司 Embedded GPS and GIS vehicle navigation system based on QTE
WO2018014627A1 (en) * 2016-07-20 2018-01-25 北京海誉动想科技股份有限公司 Method and apparatus for electronic device connection, security verification, communication and communication monitoring

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1609829A (en) * 2003-10-24 2005-04-27 英业达股份有限公司 Plug-and-play method for USB equipment under linux operation system
CN1877550A (en) * 2006-01-13 2006-12-13 深圳创维-Rgb电子有限公司 Method for implementing real-time hot-plug of USB memory under TV embedded Linux system
CN101694641A (en) * 2009-09-28 2010-04-14 北京深思洛克软件技术股份有限公司 Method and system for initializing universal serial bus (USB) devices

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1609829A (en) * 2003-10-24 2005-04-27 英业达股份有限公司 Plug-and-play method for USB equipment under linux operation system
CN1877550A (en) * 2006-01-13 2006-12-13 深圳创维-Rgb电子有限公司 Method for implementing real-time hot-plug of USB memory under TV embedded Linux system
CN101694641A (en) * 2009-09-28 2010-04-14 北京深思洛克软件技术股份有限公司 Method and system for initializing universal serial bus (USB) devices

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
宋智宁等: "基于Qte通信机制的GUI系统", 《机电工程》 *
段佳秋: "QT/Embedded软件体系结构介绍", 《中国高新技术企业》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103544061A (en) * 2013-10-30 2014-01-29 乐视致新电子科技(天津)有限公司 Smart television based safe exit method and device for external storage device
CN105352517A (en) * 2015-11-21 2016-02-24 广西南宁至简至凡科技咨询有限公司 Embedded GPS and GIS vehicle navigation system based on QTE
WO2018014627A1 (en) * 2016-07-20 2018-01-25 北京海誉动想科技股份有限公司 Method and apparatus for electronic device connection, security verification, communication and communication monitoring

Similar Documents

Publication Publication Date Title
Nayak et al. Smart surveillance monitoring system using Raspberry Pi and PIR sensor
KR101198271B1 (en) Display management method for computer controled mobile telephone
US8595321B2 (en) Supporting system for remote control
CN103577594A (en) Lock screen interface information pushing system and method
CN105550051B (en) The asynchronous processing method and device of service request
CN104199723B (en) Camera mapping method based on virtual equipment
EP2899944B1 (en) Socket processing method and device and web server
US9274894B1 (en) System and method for providing a watchdog timer to enable collection of crash data
CN101702690A (en) Method for carrying out human-computer interaction by embedded equipment through internet instant messaging system
CN101827082B (en) Method and device for recording and playing back desktop operating information of user
WO2018000675A1 (en) Background application management apparatus and terminal, and background application management method
CN105005474B (en) A kind of pair of Android phone information carries out the micromodule equipment and extracting method of secret extraction
KR101624821B1 (en) Method, apparatus, terminal, and server for synchronizing terminal mirror
CN105610915A (en) Data reporting method and system
CN105302621A (en) Method for remotely achieving initial value restoration of server BIOS Setup
CN101562545B (en) WOL test method
WO2012092896A3 (en) Method and device for data transmission
CN102455981A (en) Hot-plug implementation method of universal serial bus (USB) equipment based on Qt/embedded (QTE) environment
CN103885666A (en) Transmission processing method and transmission processing system of shared information
US20160026602A1 (en) Method and System for Communication of Device Information
WO2023088198A1 (en) Network connection method and apparatus, and electronic device
WO2017107429A1 (en) Operation processing method, apparatus and device for interconnection application, and non-volatile computer storage medium
US9888281B2 (en) Set-top box, client, system and method for access of virtual desktop
CN103078865A (en) Network server communication model based on transmission control protocol (TCP)
CN103916458A (en) Power enterprise internal application program remote monitoring system based on short message technology

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20120516