CN104933161B - A kind of method and device for obtaining the input data from input equipment - Google Patents
A kind of method and device for obtaining the input data from input equipment Download PDFInfo
- Publication number
- CN104933161B CN104933161B CN201510363882.2A CN201510363882A CN104933161B CN 104933161 B CN104933161 B CN 104933161B CN 201510363882 A CN201510363882 A CN 201510363882A CN 104933161 B CN104933161 B CN 104933161B
- Authority
- CN
- China
- Prior art keywords
- device file
- equipment
- information
- input
- index information
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/24569—Query processing with adaptation to specific hardware, e.g. adapted for using GPUs or SSDs
Abstract
The invention provides a kind of method and device for obtaining the input data from input equipment, methods described includes:By the device file title of equipment index information and input equipment or device file descriptor corresponding to the device file title of equipment index information and input equipment is established into corresponding relation and preserved, input data of the device file descriptor acquiring from different input equipments corresponding to the device file title of input equipment or the device file title of input equipment corresponding with equipment index information according to corresponding to from equipment index information, realizing can use multiple input equipments to obtain the function of input data in production, improve production efficiency.
Description
Technical field
The present invention relates to computer realm, more particularly to a kind of method and dress for obtaining the input data from input equipment
Put.
Background technology
Linux is that one kind is increased income computer (SuSE) Linux OS kernel, and " kernel " is one and provides hardware abstraction layer, disk
And the system software of the function such as file system control, multitask.A set of complete operating system based on linux kernel is Linux
Operating system.
In the prior art, after multiple input equipments are connected with main frame, if main frame is obtained from the defeated of multiple input equipments
Enter data, then which input equipment is the input data that cannot be distinguished by getting come from, therefore causes not making in production
Input data is obtained with multiple input equipments, so as to reduce production efficiency.
The content of the invention
The present invention carries solving can not use multiple input equipments to obtain input data in production, so as to reduce production
The technical problem of efficiency.
The technical scheme is that:
The invention provides a kind of method for obtaining the input data from input equipment, including:
The device file title for the multiple input equipments being connected with main frame is obtained, is held respectively according to the device file title
Row step A1;
Step A1:Device file descriptor is obtained, according to the equipment index information to be obtained such as the device file descriptor,
After equipment index information is got, the equipment index information and the device file title are established into corresponding relation and preserved
Or the equipment index information and the device file descriptor are established into corresponding relation and preserved;
It is described according to the equipment index information to be obtained such as the device file descriptor, be specially:According to equipment text
The device file information to be obtained such as part descriptor, after the device file information is got, by the device file information
External input information is as equipment index information;
After the equipment index information and the device file title are established into corresponding relation and preserved, methods described is also
Including:Step S1:The multiple equipment index information of outside input is obtained, according to the equipment index information and the device file
The corresponding relation of title, device file title corresponding with the multiple equipment index information difference is obtained, according to the equipment
File name obtains the input data of input equipment corresponding with device file title difference;
After the equipment index information and the device file descriptor are established into corresponding relation and preserved, methods described
Also include:Step S2:The multiple equipment index information of outside input is obtained, according to the equipment index information and equipment text
The corresponding relation of part descriptor, device file descriptor corresponding with the multiple equipment index information difference is obtained, according to institute
State the input data of device file descriptor acquiring input equipment corresponding with device file descriptor difference.
Present invention also offers a kind of device for obtaining the input data from input equipment, including:
First acquisition module, for obtaining the device file title for the multiple input equipments being connected with main frame;
Trigger module, for obtaining the device file for the multiple input equipments being connected with main frame when first acquisition module
After title, the second acquisition module is triggered according to the device file title respectively;
Second acquisition module, for obtaining device file descriptor;
3rd acquisition module, for after second acquisition module obtains device file descriptor, being set according to described
The equipment index informations to be obtained such as standby filec descriptor;
3rd acquisition module, specifically for when second acquisition module obtain device file descriptor after, according to
The device file information to be obtained such as the device file descriptor, after the device file information is got, by the equipment
The external input information of fileinfo is as equipment index information;
Relating module, for after the 3rd acquisition module getting equipment index information, the equipment being indexed and believed
Breath and the device file title are established corresponding relation and preserved;Or when the 3rd acquisition module gets equipment index letter
After breath, the equipment index information and the device file descriptor are established into corresponding relation and preserved;
4th acquisition module, for building the equipment index information and the device file title when the relating module
After vertical corresponding relation and preservation, the multiple equipment index information of outside input is obtained, according to the equipment index information and institute
The corresponding relation of device file title is stated, obtains device file title corresponding with the multiple equipment index information difference, root
According to the input data of device file name acquiring input equipment corresponding with device file title difference;
5th acquisition module, for when the relating module is by the equipment index information and the device file descriptor
After establishing corresponding relation and preserving, obtain the multiple equipment index information of outside input, according to the equipment index information and
The corresponding relation of the device file descriptor, obtain and the corresponding device file description respectively of the multiple equipment index information
Symbol, according to the input number of device file descriptor acquiring input equipment corresponding with device file descriptor difference
According to.
The beneficial effects of the invention are as follows:The invention provides it is a kind of obtain the input data from input equipment method and
Device, methods described is by the device file title of equipment index information and input equipment or by equipment index information and input equipment
Device file title corresponding to device file descriptor establish corresponding relation and preserve, according to corresponding with equipment index information
Equipment corresponding to the device file title of input equipment or the device file title of input equipment corresponding with equipment index information
Filec descriptor obtains the input data from different input equipments, it is achieved thereby that obtaining multiple input equipments in production
Input data function, improve production efficiency.
Brief description of the drawings
Fig. 1 is that one kind that the embodiment of the present invention 1 provides indexes device file title and equipment according to device file title
Information establish corresponding relation and preserve or will corresponding with device file title device file descriptor and equipment index information
Establish corresponding relation and the flow chart of the method preserved;
Fig. 2 is that equipment index information and device file title are established corresponding relation by one kind that the embodiment of the present invention 2 provides
Method flow chart;
Fig. 3 is a kind of structure chart of the device for input data of acquisition from input equipment that the embodiment of the present invention 3 provides.
Embodiment
Below in conjunction with the accompanying drawing of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described,
Obviously, described embodiment is only the part of the embodiment of the present invention, rather than whole embodiments.Based in the present invention
Embodiment, the every other embodiment that those skilled in the art are obtained under the premise of creative work is not made, all belong to
In the scope of protection of the invention.
Embodiment 1
A kind of method for obtaining the input data from input equipment is present embodiments provided, is specifically included:
Step 101:The device file title for the multiple input equipments being connected with main frame is obtained, respectively according to device file name
Claim device file title and equipment index information establishing corresponding relation and preserve or corresponding with device file title will set
Standby filec descriptor and equipment index information are established corresponding relation and preserved;
Specifically, the device file title for the multiple input equipments being connected with main frame is obtained, basis is connected with main frame respectively
The device file title of each input equipment create thread, according to device file title by device file name in each thread
Claim and equipment index information establish corresponding relation and preservation or will device file descriptor corresponding with device file title and
Equipment index information is established corresponding relation and preserved.
It is multiple to refer both to two or more (including two) in the present embodiment.
In the present embodiment, device file title and equipment index information are established simultaneously by corresponding relation according to device file title
Preserve or corresponding with device file title device file descriptor and equipment index information established corresponding relation and preserved,
Can with as shown in figure 1, including:
Step a1:According to device file name acquiring device file descriptor;
Specifically, device file corresponding with device file title is opened according to the device file title of input equipment, obtained
The device file descriptor of taking equipment file.
Step a2:According to the equipment index information to be obtained such as device file descriptor, after equipment index information is got,
Perform step a3;
In the present embodiment, step a2 is specifically included:
Step b1:According to the device file information to be obtained such as device file descriptor, after device file information is got,
Perform step b2;
Specifically, according to the device file information to be obtained from input equipment such as device file descriptor, when getting
After device file information from input equipment, step b2 is performed;
Step b2:Whether the external input information for judging device file information is default input information type, if it is,
Using external input information as equipment index information, after equipment index information is got, step a3 is performed;Otherwise, step is returned
Rapid b1.
Specifically, whether the external input information for judging the device file information from input equipment is default input information
Type, if it is, using the external input information of the device file information from input equipment as equipment index information, when obtaining
After getting the equipment index information from input equipment, step a3 is performed;Otherwise, return to step b1.
In the present embodiment, it can be numeral or character etc. to preset input information type.
In the present embodiment, device file information includes external input information, can also include input equipment type information.Its
In, external input information is the data of the outside input got, and external input information is specially what is got in the present embodiment
Come from the data of input equipment, i.e. external input information is the data for the input that the outside got passes through input equipment;It is defeated
Enter the type that device type information is the input equipment got.In the present embodiment, after step b1, before step b2, also wrap
Include:Whether the type that input equipment is judged according to the input equipment type information of device file information is default device type, such as
Fruit is then to perform step b2;Otherwise, report an error.
Specifically, whether the input equipment type information for judging device file information is the mark letter for presetting device type
Breath, if it is, the type for judging input equipment is default device type;Otherwise, the type for judging input equipment is not default
Device type.
In embodiment, default device type can be key-press input device type, and the identification information for presetting device type can
To be EV_KEY.
In the present embodiment, when the external input information for judging device file information is default input info class in step b2
After type, also include before using external input information as equipment index information:Judge whether equipment index identification information is the
One preset value, if it is, being the second preset value by equipment index update of identification information, using external input information as equipment rope
Fuse ceases;Otherwise, report an error;
Correspondingly, also include before step a2:It is the first preset value to set equipment to index identification information.
In the present embodiment, the first preset value and the second preset value are different.
Step a3:Equipment index information and device file title are established into corresponding relation and preserved or by equipment index information
Corresponding relation is established with device file descriptor and is preserved;
In the present embodiment, when equipment index information and device file title are established into corresponding relation and preserve it in step a3
Afterwards, in addition to:Close the device file opened.
In the present embodiment, also include before step 101:Detect whether that input equipment is connected with main frame, if it is, holding
Row step 101;Otherwise, continue to have detected whether that input equipment is connected with main frame.
Step 201:After equipment index information and device file title are established into corresponding relation and preserved, obtain outside defeated
The multiple equipment index information entered, according to equipment index information and the corresponding relation of device file title, acquisition and multiple equipment
Device file title corresponding to index information difference, it is corresponding defeated respectively according to device file name acquiring and device file title
Enter the input data of equipment;
In the present embodiment, step 210 specifically includes:
Step 2011:After equipment index information and device file title are established into corresponding relation and preserved, obtain outside
The multiple equipment index information of input, according to equipment index information and the corresponding relation of device file title obtains and multiple equipment
Device file title corresponding to index information difference;
In the present embodiment, also include before step 2012:It is right respectively with multiple equipment index information to judge whether to get
The device file title answered, if it is, performing step 2012;Otherwise, report an error.
Step 2012:According to the input number of device file name acquiring input equipment corresponding with device file title difference
According to.
Specifically, according to device file name acquiring device file descriptor corresponding with device file title difference, root
According to the input data of device file descriptor acquiring input equipment corresponding with multiple equipment index information difference.
More specifically, according to device file name acquiring, corresponding device file describes respectively with device file title
Symbol, corresponding device file information is distinguished with device file descriptor according to device file descriptor etc. is to be obtained, when getting
After device file descriptor respectively corresponding device file information, the external input information in device file information is made respectively
For the input data of input equipment corresponding with device file information.
In the present embodiment, step 201 can also be:When equipment index information and device file title are established into corresponding relation
And after preserving, according to input data of the device file name acquiring from multiple input equipments, according to equipment index information and set
The corresponding relation of standby file name obtains equipment index information corresponding to the input data difference of multiple input equipments.
Step 301:After equipment index information and device file descriptor are established into corresponding relation and preserved, obtain outside
The multiple equipment index information of input, according to equipment index information and the corresponding relation of device file descriptor, obtain with it is multiple
Device file descriptor corresponding to equipment index information difference, according to device file descriptor, obtain and device file descriptor
The input data of input equipment corresponding to respectively.
In this implementation, step 310 specifically includes:
Step 3011:After equipment index information and device file descriptor are established into corresponding relation and preserved, obtain outer
Portion input multiple equipment index information, according to the corresponding relation of equipment index information and device file descriptor obtain with it is multiple
Device file descriptor corresponding to equipment index information difference;
Also include before step 3012:Judge whether to get device file corresponding with multiple equipment index information difference
Descriptor, if it is, continuing;Otherwise, report an error.
Step 3012:According to the defeated of device file descriptor acquiring input equipment corresponding with device file descriptor difference
Enter data.
Specifically, believed according to the device file corresponding with device file descriptor difference to be obtained such as device file descriptor
Breath, after device file information is got, believes using the external input information in device file information as with device file
The input data of input equipment corresponding to breath.
In the present embodiment, 301 can also be:When equipment index information and device file descriptor are established into corresponding relation simultaneously
After preservation, according to input data of the device file descriptor acquiring from multiple input equipments, according to equipment index information and set
The corresponding relation of standby filec descriptor obtains equipment index information corresponding to the input data difference of multiple input equipments.
Embodiment 2
A kind of method for obtaining the input data from input equipment is present embodiments provided, suitable for including being provided with
The system of (SuSE) Linux OS, the main frame of calibration application and upper layer application and input equipment.
A kind of method that equipment index information and device file title are established into corresponding relation that the present embodiment provides, such as scheme
Shown in 2, specifically include:
Step 401:Calibration application obtains the device file title for the input equipment being connected with main frame;
Specifically, calibration application calls the acquisition device file name interface of (SuSE) Linux OS, obtains Linux operations system
The device file title for all input equipments being connected with main frame that system returns.
In the present embodiment, obtaining device file name interface includes opendir (), readdir (),
The system interface function such as closedir ().
In the present embodiment, according to the characteristic of (SuSE) Linux OS, the device file title of input equipment is unique.For example, school
The device file title of 4 input equipments that standard is connected using obtaining with main frame be respectively event0, event1, event2 and
event3。
In the present embodiment, the input equipment being connected with main frame comprises at least one.
Step 402:Thread is respectively created according to device file title in calibration application, in line corresponding with device file title
Device file corresponding to being opened in journey, obtains device file descriptor corresponding to device file;
Specifically, thread is respectively created according to the device file title of each input equipment got in calibration application,
In each thread corresponding with device file title, the opening equipment of (SuSE) Linux OS is called according to device file title
File interface, open corresponding with device file title device file, obtain (SuSE) Linux OS return with device file pair
The device file descriptor answered.
In the present embodiment, opening device file interface includes the system interface functions such as open ().
Such as:Calibration application creates thread corresponding with device file title event2, according to device file title
Event2 calls the opening device file interface of (SuSE) Linux OS, opens device file corresponding with event2, obtains
The device file descriptor fd2 of device file corresponding to the event2 that (SuSE) Linux OS returns.
In the present embodiment, calibration application is according to device file title event0, device file title event1 and equipment text
Thread is respectively created in part title event3, device file descriptor fd0, fd1 and fd3 method corresponding to acquisition, can and root
Thread is created according to event2, device file descriptor fd2 method is identical corresponding to acquisition.
It should be noted that in the present embodiment, device file title event0 and device file descriptor fd0 are corresponding, if
Standby file name event1 and device file descriptor fd1 is corresponding, device file title event2 and device file descriptor fd2
It is corresponding, device file title event3 and device file descriptor fd3.
Step 403:Calibration application judges whether that getting device file retouches in thread corresponding with device file title
Symbol is stated, if it is, performing step 404;Otherwise, report an error;
Specifically, calibration application in thread corresponding with device file title, retouch by the device file for judging to get
State whether symbol is nonnegative integer, if the device file descriptor got is nonnegative integer, judge to get and equipment
Device file descriptor corresponding to file, then perform step 404;Otherwise, judge not get corresponding with device file
Device file descriptor, reports an error.
Step 404:Calibration application obtains corresponding with device file descriptor in thread corresponding with device file title
Device file information;
Specifically, calibration application waits to be obtained and device file to describe in thread corresponding with device file title
The device file information of device file corresponding to symbol, when the equipment text for getting device file corresponding with device file descriptor
During part information, step 405 is performed;
More specifically, the reading file interface of (SuSE) Linux OS is called according to corresponding device file descriptor,
When getting the corresponding device file information of (SuSE) Linux OS return, step 405 is performed.
In the present embodiment, calibration application can also in preset time etc. device file information to be obtained, when get with
During device file information, step 405 is performed;Otherwise, pass hull closure file.
Preferably, preset time can be 180s.
In the present embodiment, reading file interface includes the system interface functions such as read ().
Such as:Calibration application is waited and to be obtained retouched with device file in thread corresponding with device file title event2
The device file information of device file corresponding to symbol fd2 is stated, (SuSE) Linux OS is called according to device file descriptor fd2
File interface is read, that waits that (SuSE) Linux OS to be obtained returns sets with the device file descriptor corresponding device files of fd2
Standby fileinfo, when getting the device file information of (SuSE) Linux OS return in 180s, perform step 405;It is no
Then, device file corresponding to pass hull closure filec descriptor fd2.
In the present embodiment, calibration application in thread corresponding with device file title event0, event1 and event3,
Etc. the method for device file information corresponding with device file descriptor fd0, fd1 and fd3 to be obtained, can with device file
Thread corresponding to title event2, wait to be obtained identical with the method for device file descriptor fd2 device file information.
In the present embodiment, device file information comprises at least input equipment type information and external input information, can be with
Including:Input time information and input triggering information, such as:
Wherein, struct timeval time are input time information;
_ _ s32value, information is triggered for input;
_ _ u16type is input equipment type information, for obtaining the type of input equipment.
_ _ u16code is an externally input information, for obtaining the outside data inputted by input equipment.
Step 405:Calibration application is in thread corresponding with device file title, according to the input in device file information
Device type information judges whether the type of input equipment is default device type, if it is, performing step 406;Otherwise, close
Close device file corresponding with device file title;
Specifically, calibration application judges the input in device file information in thread corresponding with device file title
Whether device type information is the device type identification information for presetting device type, if it is, judging input equipment type
It is default device type, performs step 406;Otherwise, device file corresponding with device file title is closed.
In the present embodiment, it is preferred that default device type is key-press input device type.Key-press input device type is set
Standby type identification information is EV_KEY.Wherein, key-press input device type can be keyboard or barcode scanning gun.
It is for example, defeated in the device file information of the input equipment for the device file title event2 that calibration application is got
Enter device type information _ _ u16type==EV_KEY, then judge that the entitled event2 of device file input equipment is default
Device type.
For example, in the device file information of the input equipment for the entitled event3 of device file that calibration application is got
Event type information _ _ u16type==EV_ABS, the then input equipment for judging the entitled event3 of device file are not default
Device type.
Step 406:Calibration application judges the outside in device file information in thread corresponding with device file title
Whether input information is default input information type, if it is, performing step 407;Otherwise, return to step 404;
In the present embodiment, it can be numeral or character etc. to preset input information type.Preferably, presupposed information type is number
Word.
Specifically, calibration application is in thread corresponding with device file title, in device file information corresponding to judgement
External input information whether be numeral, specifically judge external input information _ _ u16code whether be numeral, for example, ought _ _
During u16code==2, the external input information in device file information corresponding to judgement is numeral, then performs step 407;It is no
Then, return to step 404.
Step 407:Whether calibration application judges equipment index identification information in thread corresponding with device file title
It is the first preset value, if it is, being the second preset value by equipment index update of identification information, performs step 408;Otherwise, report
It is wrong;
Accordingly, in the present embodiment, after the application of step 402 alignment creates thread, in addition to:Equipment is set to index mark
Knowledge information is the first preset value.
In the present embodiment, the first preset value can be x.First preset value and the second preset value are different.
Step 408:Calibration application is in thread corresponding with device file title, using external input information as equipment rope
Fuse is ceased, and equipment index information and device file title are established into corresponding relation and preserved.
Such as:Calibration application is in thread corresponding with device file title event2, by equipment index information 2 and equipment
Storage is into Maintenance Table 1 corresponding to file name event2.
In the present embodiment, calibration application is by device file title event0 and equipment index information 0 and by device file
Title event1 and equipment index information 1 establish corresponding relation and the same above method of method preserved, no longer superfluous in the present embodiment
State.
In this embodiment, after step 408, the Maintenance Table 1 that calibration application obtains can be with as follows:
Device file title | Equipment index information |
event0 | 0 |
event1 | 1 |
event2 | 2 |
Maintenance Table 1
This implementation additionally provides a kind of to be obtained from defeated according to equipment index information and the corresponding relation of device file title
Enter the method for the input data of equipment, specifically include:
Step 501:Upper layer application obtains the equipment index information of outside input, according to equipment index information and device file
The corresponding relation of title, obtain the input data of input equipment corresponding with device file title.
Step 501 specifically includes:
Step 5011:Upper layer application obtains the equipment index information of outside input, and equipment index letter is sent to calibration application
Breath;
Step 5012:Calibration application is obtained and equipment according to device file title and the corresponding relation of equipment index information
Device file title corresponding to index information, retouched according to device file name acquiring device file corresponding with device file title
Symbol is stated, according to the input data of input equipment corresponding to device file descriptor acquiring, by the input number of corresponding input equipment
According to upper layer application is returned to, terminate.
In the present embodiment, the application of step 5012 alignment obtains device file name corresponding with equipment index information and is referred to as
Afterwards, before according to device file name acquiring device file descriptor corresponding with device file title,
Also judge whether to get device file title corresponding with equipment index information including calibration application, if it is,
Then continue;Otherwise, error message is returned to upper layer application.
Step 501 can also specifically include:
Step 5013:Upper layer application obtains the equipment index information of outside input, and equipment index letter is sent to calibration application
Breath;
Step 5014:Calibration application is obtained and equipment according to device file title and the corresponding relation of equipment index information
Device file title corresponding to index information, device file title corresponding with equipment index information is returned into upper layer application;
Step 5015:Upper layer application is according to device file name acquiring corresponding with equipment index information and device file name
Device file descriptor corresponding to title, inputted and set according to corresponding to device file descriptor acquiring corresponding with device file title
Standby input data, terminate.
, will be with equipment after calibration application obtains device file title corresponding with equipment index information in step 5014
Before device file title returns to upper layer application corresponding to index information, in addition to:Calibration application judge whether to get with
Device file title corresponding to equipment index information, if it is, continuing;Otherwise, error message is returned to upper layer application.
In the present embodiment for example, when input equipment is barcode scanning gun, on the input after electricity, calibration application obtains and master
The device file title of three barcode scanning guns of machine connection is respectively event0, event1 and event2, and calibration application is according to equipment
File name opens the device file of device file title event0, event1 and event2 barcode scanning gun respectively, obtains respectively
Device file descriptor fd0 corresponding to the device file of device file title event0, event1 and event2 barcode scanning gun,
Fd1 and fd2.After three barcode scanning guns get equipment index information, such as 0,1 and 2 by barcode scanning respectively, calibration application according to
Device file descriptor fd0, fd1 and fd2, obtained respectively by the external input information in the device file of corresponding barcode scanning gun
Equipment index information 0,1 and 2, equipment index information 0,1 and 2 and event0, event1 and event2 are established into corresponding relation simultaneously
Preserve.
When calibration application get upper layer application transmission equipment index information 0,1 and 2 when, according to equipment index information 0,
1 and 2 get corresponding device file title event0, event1 and event2, and event0, event1 and event2 are returned
To upper layer application, upper layer application according to device file title event0, event1 corresponding with equipment index information 0,1 and 2 and
The input data that barcode scanning gun corresponding to event2 acquisitions is obtained by barcode scanning.For example, sequence number information etc..
Or when calibration application gets equipment index information 0,1 and 2 of upper layer application transmission, indexed and believed according to equipment
Breath 0,1 and 2 gets corresponding device file title event0, event1 and event2, and calibration application indexes according to equipment
Barcode scanning gun corresponding to device file title event0, event1 and event2 acquisition corresponding to information 0,1 and 2 is obtained by barcode scanning
Input data, the input data that the corresponding barcode scanning gun got is obtained by barcode scanning is returned into upper layer application.For example, will
Sequence number information that the corresponding barcode scanning gun got is obtained by barcode scanning etc. returns to upper layer application.
It should be noted that the present embodiment additionally provides one kind by equipment index information and the foundation pair of device file descriptor
The method that should be related to, correspondingly, in the present embodiment, step 408 may be replaced by step 601;
Step 601:Calibration application is in thread corresponding with device file title, using external input information as equipment rope
Fuse is ceased, and equipment index information and device file descriptor are established into corresponding relation and preserved.
Such as:Calibration application is in thread corresponding with device file title event2, by equipment index information 2 and equipment
Storage is into Maintenance Table 2 corresponding to filec descriptor fd2.
In the present embodiment, calibration application is by device file descriptor fd0 and equipment index information 0, and by device file
Descriptor fd1 and equipment index information 1 establish corresponding relation and the same above method of method preserved, no longer superfluous in the present embodiment
State.
In this embodiment, after step 601, the Maintenance Table 2 that calibration application obtains can be with as follows:
Equipment index information | Device file descriptor |
0 | fd0 |
1 | fd1 |
2 | fd2 |
Maintenance Table 2
The present embodiment additionally provide it is a kind of according to the corresponding relation of equipment index information and device file descriptor obtain come
From the method for the input data of input equipment, correspondingly, step 501 is replaced by step 701;
Step 701:Upper layer application obtains the equipment index information of outside input, according to equipment index information and device file
The corresponding relation of descriptor, obtain the input data of input equipment corresponding with device file descriptor.
Step 701 specifically includes:
Step 7011:Upper layer application obtains the equipment index information of outside input, and equipment index letter is sent to calibration application
Breath;
Step 7012:Calibration application is obtained and equipment according to device file title and the corresponding relation of equipment index information
Device file descriptor corresponding to index information, according to the input data of input equipment corresponding to device file descriptor acquiring,
The input data of corresponding input equipment is returned into upper layer application, terminated.
In the present embodiment, the application of step 7012 alignment obtain corresponding with equipment index information device file descriptor it
Afterwards, before the input data of input equipment according to corresponding to device file descriptor acquiring,
Also judge whether to get device file descriptor corresponding with equipment index information including calibration application, if
It is then to continue;Otherwise, error message is returned to upper layer application.
Step 701 can also specifically include:
Step 7013:Upper layer application obtains the equipment index information of outside input, and equipment index letter is sent to calibration application
Breath;
Step 7014:Calibration application is obtained and set according to device file descriptor and the corresponding relation of equipment index information
Device file descriptor corresponding to standby index information, upper strata is returned to by device file descriptor corresponding with equipment index information
Using;
Step 7015:Upper layer application is defeated corresponding to acquisition according to device file descriptor corresponding with equipment index information
Enter the input data of equipment, terminate.
, will be with setting after calibration application obtains device file descriptor corresponding with equipment index information in step 7014
Before device file descriptor corresponding to standby index information returns to upper layer application, in addition to calibration application judges whether to get
Device file descriptor corresponding with equipment index information, if it is, continuing;Otherwise, error message is returned to upper layer application.
In the present embodiment in another example, when input equipment is barcode scanning gun, on the input electricity after, calibration application obtain with
The device file title of three barcode scanning guns of main frame connection is respectively event0, event1 and event2, and calibration application is according to setting
Standby file name opens the device file of device file title event0, event1 and event2 barcode scanning gun respectively, obtains respectively
Device file descriptor fd0 corresponding to the device file of taking equipment file name event0, event1 and event2 barcode scanning gun,
Fd1 and fd2.When three barcode scanning guns get equipment index information, such as 0,1 and 2 by barcode scanning respectively, calibration application is according to setting
Standby filec descriptor fd0, fd1 and fd2, obtained set by the external input information in the device file of corresponding barcode scanning gun respectively
Standby index information 0,1 and 2, establishes corresponding relation by equipment index information 0,1 and 2 and fd0, fd1 and fd2 and preserves.
When calibration application get upper layer application transmission equipment index information 0,1 and 2 when, according to equipment index information 0,
1 and 2 get corresponding device file descriptor fd0, fd1 and fd2, and fd0, fd1 and fd2 are returned into upper layer application, upper strata
Using the barcode scanning gun according to corresponding to device file descriptor fd0, fd1 and fd2 corresponding with equipment index information 0,1 and 2 acquisition
The input data obtained by barcode scanning, for example, sequence number information etc..
Or when calibration application gets equipment index information 0,1 and 2 of upper layer application transmission, indexed and believed according to equipment
Breath 0,1 and 2 get corresponding to device file descriptor fd0, fd1 and fd2, calibration application according to equipment index information 0,1
With 2 corresponding to device file descriptor fd0, fd1 and fd2 obtain corresponding to the input data that is obtained by barcode scanning of barcode scanning gun, will
The input data that the corresponding barcode scanning gun got is obtained by barcode scanning returns to upper layer application.For example, the correspondence that will be got
The sequence number information that is obtained by barcode scanning of barcode scanning gun etc. return to upper layer application.
Embodiment 3
A kind of device for obtaining the input data from input equipment is present embodiments provided, as shown in figure 3, including:
First acquisition module 01, for obtaining the device file title for the multiple input equipments being connected with main frame;
Trigger module 02, for obtaining the device file for the multiple input equipments being connected with main frame when the first acquisition module 01
After title, respectively according to device file title, the second acquisition module 03 is triggered;
Trigger module 02 is specifically used for the equipment for obtaining the multiple input equipments being connected with main frame when the first acquisition module 01
It is each input equipment respectively according to the device file title for each input equipment being connected with main frame after file name
Thread is created, the second acquisition module 03 is triggered in each thread.
Second acquisition module 03, for obtaining device file descriptor;
Second acquisition module 03 is specifically used for being opened and device file title pair according to the device file title of input equipment
The device file answered, obtain the device file descriptor of device file.
3rd acquisition module 04, for when the second acquisition module 03 is according to the device file name acquiring equipment of input equipment
After filec descriptor, according to the equipment index information to be obtained such as device file descriptor;
3rd acquisition module 04, specifically for when the second acquisition module 03 is according to the device file name acquiring of input equipment
After device file descriptor, according to the equipment index information to be obtained from input equipment such as device file descriptor.
3rd acquisition module 04, including:First acquisition unit, the first judging unit and the first setting unit;
First acquisition unit is used for the device file name acquiring equipment text according to input equipment when the second acquisition module 03
After part descriptor, according to the device file information to be obtained such as device file descriptor;
And when the first judging unit judges that the external input information of device file information is not default input info class
After type, according to the device file information to be obtained such as device file descriptor;
First judging unit is used for after first acquisition unit gets device file information, judges device file information
Whether external input information is default input information type;
First setting unit is used for when the first judging unit judges that the external input information of device file information is default
Input after information type, using external input information as equipment index information.
In the present embodiment, device file information includes external input information, can also include input equipment type information.Its
In, external input information is the data of the outside input got, and external input information is specially what is got in the present embodiment
Come from the data of input equipment, i.e. external input information is the data for the input that the outside got passes through input equipment;It is defeated
Enter the type that device type information is the input equipment got.
When device file information also includes input equipment type information, the 3rd acquisition module 04 also includes:Second judges
Unit and first reports an error unit;
Second judging unit, for when first acquisition unit is according to the device file information to be obtained such as device file descriptor
Afterwards, before the first judging unit judges whether the external input information of device file information is default input information type,
Whether the type that input equipment is judged according to the input equipment type information of device file information is default device type;
First reports an error unit, for being judged when the second judging unit according to the input equipment type information of device file information
The type for going out input equipment is not after presetting device type, to report an error;
First judging unit, it is additionally operable to when the second judging unit is sentenced according to the input equipment type information of device file information
Break input equipment type be default device type after, whether the external input information for judging device file information is default
Input information type.
In the present embodiment, when device file information includes external input information or is set including external input information and input
During standby type information, the 3rd acquisition module 04, in addition to:3rd judging unit, updating block and second report an error unit;
3rd judging unit is used for when the first judging unit judges that the external input information of device file information is default
Input after information type, before the first setting unit is using external input information as equipment index information, judge that equipment indexes
Whether identification information is the first preset value,
Updating block, for after it is the first preset value that the 3rd judging unit, which judges equipment index identification information, will set
Standby index update of identification information is the second preset value;
First setting unit, be additionally operable to when the 3rd judging unit judge equipment index identification information be the first preset value it
Afterwards, using external input information as equipment index information;
Second reports an error unit, for when the 3rd judging unit judge equipment index identification information be not the first preset value it
Afterwards, report an error;
Second acquisition module 03, it is additionally operable to when the 3rd acquisition module 04 is according to the equipment rope to be obtained such as device file descriptor
Before fuse breath, it is the first preset value to set equipment to index identification information.
In the present embodiment, the first preset value and the second preset value are different.
Relating module 05, for after the 3rd acquisition module 04 gets equipment index information, by equipment index information and
Device file title is established corresponding relation and preserved;Or after the 3rd acquisition module 04 gets equipment index information, it will set
Standby index information and device file descriptor are established corresponding relation and preserved;
Relating module 05 is specifically used for:When the 3rd acquisition module 04 gets the outside equipment rope inputted by input equipment
After fuse breath, equipment index information and device file title are established into corresponding relation and preserved;Or when the 3rd acquisition module 04
After getting the outside equipment index information inputted by input equipment, equipment index information and device file descriptor are established
Corresponding relation simultaneously preserves.
4th acquisition module 06, for equipment index information and device file title to be established into corresponding close when relating module 05
After being and preserving, the multiple equipment index information of outside input is obtained, according to equipment index information and device file title
Corresponding relation, obtain with multiple equipment index information corresponding device file title respectively, according to device file name acquiring and
The input data of input equipment corresponding to device file title difference;
In the present embodiment, the 4th acquisition module 06 can include:Second acquisition unit and the 3rd acquiring unit;
Second acquisition unit is used for when equipment index information and device file title are established corresponding relation by relating module 05
And after preserving, the multiple equipment index information of outside input is obtained, according to equipment index information and pair of device file title
It should be related to, obtain device file title corresponding with multiple equipment index information difference;
3rd acquiring unit is used for when second acquisition unit gets equipment corresponding with multiple equipment index information difference
After file name, according to device file title, the input data of acquisition input equipment corresponding with device file title difference;
3rd acquiring unit be specifically used for when second acquisition unit get with multiple equipment index information distinguish it is corresponding
After device file title, according to device file name acquiring device file descriptor corresponding with device file title difference, root
According to the input data of device file descriptor acquiring input equipment corresponding with device file descriptor difference.
5th acquisition module 07, corresponded to for establishing equipment index information and device file descriptor when relating module 05
After relation and preservation, the multiple equipment index information of outside input is obtained, is described according to equipment index information and device file
The corresponding relation of symbol, device file descriptor corresponding with multiple equipment index information difference is obtained, is described according to device file
Symbol obtains the input data of input equipment corresponding with device file descriptor difference.
5th acquisition module 07 can include:4th acquiring unit and the 5th acquiring unit;
4th acquiring unit is used for when equipment index information and device file descriptor are established corresponding close by relating module 05
After being and preserving, the multiple equipment index information of outside input is obtained, according to equipment index information and device file descriptor
Corresponding relation, obtain and distinguish corresponding device file descriptor with multiple equipment index information;
5th acquiring unit is used for when the 4th acquiring unit gets equipment corresponding with multiple equipment index information difference
After filec descriptor, according to the input number of device file descriptor acquiring input equipment corresponding with device file descriptor difference
According to;
5th acquiring unit be specifically used for when the 4th acquiring unit get with multiple equipment index information respectively it is corresponding
After device file descriptor, according to the device file corresponding with device file descriptor difference to be obtained such as device file descriptor
Information, after device file information is got, using the external input information in device file information as with device file
The input data of input equipment corresponding to information.
In the present embodiment, the 4th acquisition module 06 is additionally operable to when the correspondence according to equipment index information and device file title
Relation, obtain and set with after multiple equipment index information respectively corresponding device file title, judging whether to get with multiple
Device file title corresponding to standby index information difference;It is corresponding respectively with multiple equipment index information when judging to get
After device file title, according to the input number of device file name acquiring input equipment corresponding with device file title difference
According to;After judging not get with multiple equipment index information corresponding device file title respectively, report an error;
5th acquisition module 07 is additionally operable to, when the corresponding relation according to equipment index information and device file descriptor, obtain
After multiple equipment index information respectively corresponding device file descriptor, judge whether to get to index with multiple equipment and believe
Device file descriptor corresponding to breath difference, distinguish corresponding equipment text with multiple equipment index information when judging to get
After part descriptor, according to the input number of device file descriptor acquiring input equipment corresponding with device file descriptor difference
According to;After judging not get with multiple equipment index information corresponding device file descriptor respectively, report an error.
Device also includes:Detection module, for obtaining the multiple input equipments being connected with main frame when the first acquisition module 01
Device file title before, detected whether that input equipment is connected with main frame;When not detecting that input equipment and main frame connect
After connecing, then continue to have detected whether that input equipment is connected with main frame;
First acquisition module 01, be additionally operable to after detection module has detected that input equipment is connected with main frame, obtain with
The device file title of multiple input equipments of main frame connection.
In the present embodiment, device also includes:Close file module, for when relating module 05, by equipment index information and
After device file title is established corresponding relation and preserved, pass hull closure file.
In the present embodiment, the 4th acquisition module 06 or for when relating module 05 is by equipment index information and device file
After title is established corresponding relation and preserved, according to input data of the device file name acquiring from multiple input equipments, root
Set according to the input data of equipment index information and the multiple input equipments of the corresponding relation of device file title acquisition is corresponding respectively
Standby index information;
In the present embodiment, the 5th acquisition module 07 or for when relating module 05 is by equipment index information and device file
After descriptor is established corresponding relation and preserved, according to input number of the device file descriptor acquiring from multiple input equipments
According to the input data that multiple input equipments are obtained according to the corresponding relation of equipment index information and device file descriptor is right respectively
The equipment index information answered.
The foregoing is only a preferred embodiment of the present invention, but protection scope of the present invention be not limited thereto,
Any one skilled in the art is in technical scope disclosed by the invention, the change or replacement that can readily occur in,
It should all be included within the scope of the present invention.Therefore, protection scope of the present invention should be with scope of the claims
It is defined.
Claims (24)
- A kind of 1. method for obtaining the input data from input equipment, it is characterised in that including:The device file title for the multiple input equipments being connected with main frame is obtained, step is performed according to the device file title respectively Rapid A1;Step A1:Device file descriptor is obtained, according to the equipment index information to be obtained such as the device file descriptor, when obtaining After getting equipment index information, the equipment index information and the device file title are established into corresponding relation and preserves or incites somebody to action The equipment index information and the device file descriptor are established corresponding relation and preserved;It is described according to the equipment index information to be obtained such as the device file descriptor, be specially:Retouched according to the device file The device file information to be obtained such as symbol are stated, after the device file information is got, by the outside of the device file information Enter information as equipment index information;After the equipment index information and the device file title are established into corresponding relation and preserved, methods described is also wrapped Include:Step S1:The multiple equipment index information of outside input is obtained, according to the equipment index information and the device file name The corresponding relation of title, device file title corresponding with the multiple equipment index information difference is obtained, according to equipment text The input data of part name acquiring input equipment corresponding with device file title difference;After the equipment index information and the device file descriptor are established into corresponding relation and preserved, methods described is also wrapped Include:Step S2:The multiple equipment index information of outside input is obtained, is retouched according to the equipment index information and the device file The corresponding relation of symbol is stated, device file descriptor corresponding with the multiple equipment index information difference is obtained, is set according to described Standby filec descriptor obtains the input data of input equipment corresponding with device file descriptor difference.
- 2. according to the method for claim 1, it is characterised in that the step S1 may be replaced by according to equipment text Input data of the part name acquiring from multiple input equipments, according to the equipment index information and the device file title Corresponding relation obtains equipment index information corresponding to the input data difference of the multiple input equipment;The step S2 may be replaced by according to input number of the device file descriptor acquiring from multiple input equipments According to according to the defeated of the multiple input equipment of the corresponding relation of the equipment index information and device file descriptor acquisition Enter equipment index information corresponding to data difference.
- 3. method according to claim 1 or 2, it is characterised in that described to be performed respectively according to the device file title Step A1 is specially:Thread is created according to the device file title for each input equipment being connected with the main frame respectively, every Step A1 is performed in one thread.
- 4. method according to claim 1 or 2, it is characterised in that described to obtain the multiple input equipments being connected with main frame Device file title before also include:Detect whether that input equipment is connected with main frame, be connected if it is, obtaining with main frame Multiple input equipments device file title, continue;Otherwise, continue to have detected whether that input equipment is connected with main frame.
- 5. method according to claim 1 or 2, it is characterised in that it is described acquisition device file descriptor be specially:According to The device file title of input equipment opens device file corresponding with the device file title, obtains the device file Device file descriptor.
- 6. according to the method for claim 5, it is characterised in that described by the equipment index information and the device file After title is established corresponding relation and preserved, in addition to:Close the device file.
- 7. method according to claim 1 or 2, it is characterised in that described waited according to the device file descriptor is obtained Taking equipment index information specifically includes:Step B1:According to the device file information to be obtained such as the device file descriptor, believe when getting the device file After breath, step B2 is performed;Step B2:Whether the external input information for judging the device file information is default input information type, if it is, Using the external input information as equipment index information;Otherwise, return to step B1.
- 8. according to the method for claim 7, it is characterised in that the device file information also includes:Input equipment type Information;After the step B1, before the step B2, in addition to:According to the input equipment class of the device file information Type information judges whether the type of the input equipment is default device type, if it is, performing the step B2;Otherwise, Report an error.
- 9. according to the method for claim 7, it is characterised in that when judging the device file information in the step B2 External input information be default input information type after, using the external input information as before equipment index information and also Including:Judge whether equipment index identification information is the first preset value, if it is, the equipment is indexed into update of identification information For the second preset value, using the external input information as equipment index information;Otherwise, report an error;It is described also to be included before according to the equipment index information to be obtained such as the device file descriptor:The equipment is set to index Identification information is the first preset value.
- 10. according to the method for claim 1, it is characterised in that described according to the equipment index information and the equipment The corresponding relation of file name, obtain and also wrapped with after the multiple equipment index information respectively corresponding device file title Include:Judge whether to get device file title corresponding with the multiple equipment index information difference, if it is, according to institute State the input data of device file name acquiring input equipment corresponding with device file title difference;Otherwise, report an error;It is described according to the equipment index information and the corresponding relation of the device file descriptor, obtain and the multiple equipment After device file descriptor corresponding to index information difference, in addition to:Judge whether to get and indexed with the multiple equipment Device file descriptor corresponding to information difference, if it is, according to the device file descriptor acquiring and equipment text The input data of input equipment corresponding to part descriptor difference;Otherwise, report an error.
- 11. according to the method for claim 1, it is characterised in that it is described according to the device file name acquiring with it is described The input data of input equipment, is specifically included corresponding to device file title difference:According to the device file name acquiring with Device file descriptor corresponding to the device file title difference, according to the device file descriptor acquiring and the equipment The input data of input equipment corresponding to filec descriptor difference.
- 12. according to the method for claim 1, it is characterised in that described according to the device file descriptor acquiring and institute The input data of input equipment corresponding to device file descriptor difference is stated, is specifically included:According to the device file descriptor Etc. the corresponding device file information to be obtained respectively with the device file descriptor, when getting the device file information Afterwards, using the external input information in the device file information as input equipment corresponding with the device file information Input data.
- A kind of 13. device for obtaining the input data from input equipment, it is characterised in that including:First acquisition module, for obtaining the device file title for the multiple input equipments being connected with main frame;Trigger module, for obtaining the device file title for the multiple input equipments being connected with main frame when first acquisition module Afterwards, the second acquisition module is triggered according to the device file title respectively;Second acquisition module, for obtaining device file descriptor;3rd acquisition module, for when second acquisition module obtain device file descriptor after, according to the equipment text The equipment index information to be obtained such as part descriptor;3rd acquisition module, specifically for when second acquisition module obtain device file descriptor after, according to described The device file information to be obtained such as device file descriptor, after the device file information is got, by the device file The external input information of information is as equipment index information;Relating module, for after the 3rd acquisition module gets equipment index information, by the equipment index information and The device file title is established corresponding relation and preserved;Or when the 3rd acquisition module gets equipment index information Afterwards, the equipment index information and the device file descriptor are established into corresponding relation and preserved;4th acquisition module, for establishing the equipment index information and the device file title pair when the relating module After should being related to and preserving, the multiple equipment index information of outside input is obtained, according to the equipment index information and described is set The corresponding relation of standby file name, device file title corresponding with the multiple equipment index information difference is obtained, according to institute State the input data of device file name acquiring input equipment corresponding with device file title difference;5th acquisition module, for establishing the equipment index information and the device file descriptor when the relating module Corresponding relation and after preserving, obtains the multiple equipment index information of outside input, according to the equipment index information and described The corresponding relation of device file descriptor, device file descriptor corresponding with the multiple equipment index information difference is obtained, According to the input data of device file descriptor acquiring input equipment corresponding with device file descriptor difference.
- 14. device according to claim 13, it is characterised in that the 4th acquisition module or for when the association After the equipment index information and the device file title are established corresponding relation and preservation by module, according to equipment text Input data of the part name acquiring from multiple input equipments, according to the equipment index information and the device file title Corresponding relation obtains equipment index information corresponding to the input data difference of the multiple input equipment;5th acquisition module or for retouching the equipment index information and the device file when the relating module State symbol to establish after corresponding relation and preservation, according to input number of the device file descriptor acquiring from multiple input equipments According to according to the defeated of the multiple input equipment of the corresponding relation of the equipment index information and device file descriptor acquisition Enter equipment index information corresponding to data difference.
- 15. the device according to claim 13 or 14, it is characterised in that the trigger module is specifically used for working as described first After acquisition module obtains the device file title for the multiple input equipments being connected with main frame, basis is connected with the main frame respectively Each input equipment device file title, create thread for each input equipment, described the triggered in each thread Two acquisition modules.
- 16. the device according to claim 13 or 14, it is characterised in that described device also includes:Detection module;The detection module is used for when first acquisition module obtains the device file for the multiple input equipments being connected with main frame Before title, detect whether that input equipment is connected with main frame;After not detecting that input equipment is connected with main frame, then after It is continuous to have detected whether that input equipment is connected with main frame;First acquisition module, it is additionally operable to after the detection module has detected that input equipment is connected with main frame, obtains The device file title for the multiple input equipments being connected with main frame.
- 17. the device according to claim 13 or 14, it is characterised in that second acquisition module is specifically used for according to defeated The device file title for entering equipment opens device file corresponding with the device file title, obtains setting for the device file Standby filec descriptor.
- 18. device according to claim 17, it is characterised in that described device also includes:Close file module;The closing file module is used for when the relating module builds the equipment index information and the device file title After vertical corresponding relation and preservation, the device file is closed.
- 19. the device according to claim 13 or 14, it is characterised in that the 3rd acquisition module includes:First obtains Unit, the first judging unit and the first setting unit;The first acquisition unit is used for after second acquisition module obtains device file descriptor, according to the equipment The device file information to be obtained such as filec descriptor;And when first judging unit judges that the external input information of the device file information is not default input letter After ceasing type, according to the device file information to be obtained such as device file descriptor;First judging unit is used for after the first acquisition unit gets the device file information, is set described in judgement Whether the external input information of standby fileinfo is default input information type;First setting unit is used for when first judging unit judges the outside input letter of the device file information Breath is after presetting input information type, using the external input information as equipment index information.
- 20. device according to claim 19, it is characterised in that the device file information also includes:Input equipment class Type information;3rd acquisition module also includes:Second judging unit and first reports an error unit;Second judging unit is used for when the first acquisition unit is according to equipment to be obtained such as the device file descriptors After fileinfo, first judging unit judges whether the external input information of the device file information is default input Before information type, the type of the input equipment is judged according to the input equipment type information of the device file information Whether it is default device type;Described first reports an error unit for working as second judging unit, according to the input equipment of the device file information Type information judges that the type of the input equipment is not after presetting device type, to report an error;First judging unit is additionally operable to when second judging unit is set according to the input of the device file information Standby type information judges that the type of the input equipment is after presetting device type, judges the outer of the device file information Whether input information in portion's is default input information type.
- 21. device according to claim 19, it is characterised in that the 3rd acquisition module also includes:3rd judges list Member, updating block and second report an error unit;3rd judging unit is used for when first judging unit judges the outside input letter of the device file information After breath is default input information type, first setting unit using the external input information as equipment index information it Before, judge whether equipment index identification information is the first preset value,The updating block is used for when the 3rd judging unit judges that the equipment index identification information is the first preset value Afterwards, it is the second preset value by equipment index update of identification information;First setting unit is additionally operable to when the 3rd judging unit judges that the equipment index identification information is first After preset value, using the external input information as equipment index information;Described second reports an error unit, for judging that the equipment index identification information is not first when the 3rd judging unit After preset value, report an error;Second acquisition module is additionally operable to when the 3rd acquisition module is set according to the device file descriptor etc. is to be obtained Before standby index information, it is the first preset value to set equipment to index identification information.
- 22. device according to claim 13, it is characterised in that the 4th acquisition module is additionally operable to set when according to The corresponding relation of standby index information and the device file title, is obtained and the multiple equipment index information is corresponding respectively sets After standby file name, judge whether to get device file title corresponding with the multiple equipment index information difference;When Judge after getting device file title corresponding with the multiple equipment index information difference, according to the device file The input data of name acquiring input equipment corresponding with device file title difference;When judging not get and institute After stating device file title corresponding to multiple equipment index information difference, report an error;5th acquisition module is additionally operable to close when according to the equipment index information and the corresponding of the device file descriptor System, obtain after distinguishing corresponding device file descriptor with the multiple equipment index information, judge whether to get and institute State multiple equipment index information respectively corresponding to device file descriptor, when judging to get and the multiple equipment indexes After device file descriptor corresponding to information difference, according to the device file descriptor acquiring and the device file descriptor The input data of input equipment corresponding to respectively;It is corresponding respectively with the multiple equipment index information when judging not get Device file descriptor after, report an error.
- 23. device according to claim 13, it is characterised in that the 4th acquisition module specifically includes:Second obtains Unit and the 3rd acquiring unit;The second acquisition unit is used for when the relating module builds the equipment index information and the device file title After vertical corresponding relation and preservation, the multiple equipment index information of outside input is obtained, according to the equipment index information and institute The corresponding relation of device file title is stated, obtains device file title corresponding with the multiple equipment index information difference;3rd acquiring unit is specifically used for when the second acquisition unit is got and the multiple equipment index information point After not corresponding device file title, according to the device file name acquiring with the device file title is corresponding respectively sets Standby filec descriptor, according to device file descriptor acquiring input equipment corresponding with device file descriptor difference Input data.
- 24. device according to claim 13, it is characterised in that the 5th acquisition module specifically includes:4th obtains Unit and the 5th acquiring unit;4th acquiring unit is used to work as the relating module by the equipment index information and the device file descriptor After establishing corresponding relation and preserving, obtain the multiple equipment index information of outside input, according to the equipment index information and The corresponding relation of the device file descriptor, obtain and the corresponding device file description respectively of the multiple equipment index information Symbol;5th acquiring unit is specifically used for when the 4th acquiring unit is got and the multiple equipment index information point After not corresponding device file descriptor, divide according to the device file descriptor etc. is to be obtained with the device file descriptor Not corresponding device file information, it is after the device file information is got, the outside in the device file information is defeated Enter input data of the information respectively as input equipment corresponding with the device file information.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510363882.2A CN104933161B (en) | 2015-06-26 | 2015-06-26 | A kind of method and device for obtaining the input data from input equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510363882.2A CN104933161B (en) | 2015-06-26 | 2015-06-26 | A kind of method and device for obtaining the input data from input equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104933161A CN104933161A (en) | 2015-09-23 |
CN104933161B true CN104933161B (en) | 2018-03-09 |
Family
ID=54120328
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510363882.2A Active CN104933161B (en) | 2015-06-26 | 2015-06-26 | A kind of method and device for obtaining the input data from input equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104933161B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10747366B2 (en) * | 2015-11-23 | 2020-08-18 | Hewlett-Packard Development Company, L.P. | Calibration data identification |
CN107181635A (en) * | 2017-07-31 | 2017-09-19 | 郑州云海信息技术有限公司 | A kind of method and system of upgrade server external equipment |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1536499A (en) * | 2003-04-07 | 2004-10-13 | 华为技术有限公司 | Method for accessing remote terminal in UNIX cenvironment |
CN103309858A (en) * | 2012-03-06 | 2013-09-18 | 深圳市腾讯计算机系统有限公司 | Multi-threaded log management method and multi-threaded log management device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8200853B2 (en) * | 2010-01-14 | 2012-06-12 | Microsoft Corporation | Extensions for USB driver interface functions |
-
2015
- 2015-06-26 CN CN201510363882.2A patent/CN104933161B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1536499A (en) * | 2003-04-07 | 2004-10-13 | 华为技术有限公司 | Method for accessing remote terminal in UNIX cenvironment |
CN103309858A (en) * | 2012-03-06 | 2013-09-18 | 深圳市腾讯计算机系统有限公司 | Multi-threaded log management method and multi-threaded log management device |
Also Published As
Publication number | Publication date |
---|---|
CN104933161A (en) | 2015-09-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104899016B (en) | Allocating stack Relation acquisition method and device | |
CN104050417B (en) | A kind of method and device detected in mobile terminal to application state | |
CN105825535B (en) | A kind of figure layer merging method and system | |
CN107678937A (en) | Page compatibility detection method, device, server and medium | |
CN103902440B (en) | Character detecting method in application program and device | |
CN106201288A (en) | Storage method, device and the mobile terminal of a kind of finger print information | |
CN104933161B (en) | A kind of method and device for obtaining the input data from input equipment | |
CN107566388A (en) | Industry control vulnerability detection method, apparatus and system | |
CN109214178A (en) | APP application malicious act detection method and device | |
CN107133165A (en) | Browser compatibility detection method and device | |
CN103455640A (en) | Method and device for displaying file management interfaces | |
CN107450964A (en) | It is a kind of to be used to finding that virtual machine is examined oneself whether there is the method for leak in system | |
CN107741902A (en) | Program application detection method and program application detection means | |
CN105427507B (en) | fire monitoring method and device | |
US20080201601A1 (en) | Method and Apparatus for Elimination of Faults of a Data Processing System | |
CN109324967A (en) | The method, apparatus and terminal device of application program pop-up components testing | |
CN111274156B (en) | Automatic identification method and device compatible with multi-frame pages | |
CN103902590B (en) | Premises automation method of testing and its device | |
CN108255698A (en) | Test cases generation method and device based on visualization interface | |
CN106127202A (en) | The method of character recognition and device in a kind of picture | |
US8843818B2 (en) | Field correlation method and system, and program thereof | |
CN103778218B (en) | Cloud computation-based standard information consistency early warning system and method | |
CN116032581A (en) | Network equipment security management method and electronic equipment | |
CN106156311B (en) | The method and system that a kind of pair of dynamic content is labeled and shows | |
CN104796296A (en) | Automatic network interface card function test method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |