The content of the invention
The present invention provides a kind of reader drive device, reader control system and reader driving method, solves existing
Reader drive device is not supported to recognize the problem of various protocols type label in technology, or reader drive device is in difference
Toggled between application operating interface, cause application and development inconvenience, low efficiency and the problems such as high cost.
In order to solve the above technical problems, the present invention takes following technical scheme.
A kind of reader drive device, it is characterised in that including communication unit and application operating interface unit, the application
Operate interface unit includes mixing read-write interface, wherein, the mixing read-write interface is used to receive calling for upper layer application, configures
The mixing read-write rule of reader, according to the mixing read-write rule control reader to two or more protocol type
Label carries out mixing read-write operation, is additionally operable to obtain the mixing read-write result of reader, and report to upper layer application;The communication
Unit is used to realize the information exchange between the mixing read-write interface and reader.
In an embodiment of the present invention, the mixing read-write interface is used to receive the mixing read-write ginseng that upper layer application is issued
Rule is read and write in number, the mixing according to the mixing read-write parameter configuration reader, wherein, carry two in the mixing read-write parameter
Plant or two or more protocol types.
In an embodiment of the present invention, the mixing read-write interface is used for according to two carried in the mixing read-write parameter
Plant or two or more protocol types, issue corresponding RO rules and AO rules to the reader, to configure the mixed of reader
Close read-write rule.
In an embodiment of the present invention, the mixing read-write interface includes that mixing read-write starts interface, mixing read-write result
Obtain interface and mixing read-write stops interface;The mixing read-write starts interface and is used to receive calling for upper layer application, lower clouding
Read-write rule to reader is closed, starts the mixing read-write operation of reader;The mixing read-write result obtains interface to be used to obtain
The mixing read-write result of reader, and report the mixing read-write result to upper layer application;The mixing read-write stops interface and uses
The mixing read-write rule of reader is issued in mixing read-write startup interface is deleted, and stops the mixing read-write operation of reader.
In an embodiment of the present invention, the mixing read-write interface is used for according to the mixing read-write rule control reader
Label to two or more protocol type is circulated mixing read-write operation.
In an embodiment of the present invention, the application operating interface unit also includes that mixing single is checked interface and/or mixed
The conjunction cycle checks interface;The mixing single checks interface for receiving calling for upper layer application, control reader to two kinds or
The label of two or more protocol types carries out single inventory operation;The mixing monocycle checks interface for receiving upper layer application
Call, control reader periodicity inventory operation is carried out to the label of two or more protocol type.
In an embodiment of the present invention, the application operating interface unit also includes one or more single agreement application operatings
Interface, each single agreement application operating interface is used to receive calling for upper layer application, mark of the control reader to single protocol type
Label are written and read, single is checked and/or cycle inventory operation.
In an embodiment of the present invention, single agreement application operating interface includes ISO18000-6C agreement application operatings
Interface and/or ISO18000-6B agreement application operating interfaces;The ISO18000-6C agreements application operating interface is used to control
Reader is written and read to the label of ISO18000-6C protocol types, single is checked and/or cycle inventory operation;It is described
ISO18000-6B agreement application operatings interface be used for control reader to be written and read the label of ISO18000-6B protocol types,
Single is checked and/or cycle inventory operation.
In an embodiment of the present invention, the reader drive device also includes message processing unit, the Message Processing
Unit includes coding module and decoder module, wherein, the coding module is used for from the application operating interface unit
Information is converted into the format transmission of bit streams to the communication unit;The decoder module is used for from the communication unit
Information is converted into Message forms, and accordingly transmits to the application operating interface unit.
In an embodiment of the present invention, the message processing unit also includes buffer area, and the communication is come from for storing
The information of unit, and it is supplied to the decoder module.
In an embodiment of the present invention, the message processing unit also includes queue processing module, for by the decoding
After the information that module is completely decoded is added to message queue, there is provided to the application operating interface unit.
In an embodiment of the present invention, the message processing unit also includes message searching modul, for from the message
After corresponding information is searched in queue, there is provided to the application operating interface unit.
In an embodiment of the present invention, the reader drive device also includes reader administrative unit, the reader
Administrative unit includes that reader opens module and reader closedown module, wherein, the reader opens module to be used for by setting
Corresponding parameter object is put, linking between the communication unit and reader is set up;The reader closedown module is used to break
Open linking for the communication unit and reader.
In an embodiment of the present invention, the reader administrative unit also includes that link monitors module, in reader
The reader is monitored under client mode.
In an embodiment of the present invention, the reader administrative unit also includes link detection module, described for detecting
The linking status of reader.
A kind of reader control system, including the reader driving described in reader, upper layer application and any of the above-described
Device;Wherein, the reader drive device includes communication unit and application operating interface unit, the application operating interface list
Unit includes mixing read-write interface;The mixing read-write interface is used to receive calling for upper layer application, and the mixing for configuring reader is read
Rule is write, mixing reading is carried out to the label of two or more protocol type according to the mixing read-write rule control reader
Write operation, is additionally operable to obtain the mixing read-write result of reader, and report to upper layer application;The communication unit is used to realize institute
State the information exchange between mixing read-write interface and reader;The upper layer application is used to call the mixing read-write interface, and
Receive the mixing read-write result that the mixing read-write interface is reported;The reader is used for mixed with described by the communication unit
Closing read-write interface carries out information exchange, adds the mixing read-write rule of the mixing read-write interface configuration, is read according to the mixing
Write rule carries out mixing read-write operation to the label of two or more protocol type, mixed to the mixing read-write interface feedback
Close read-write result.
A kind of reader driving method, the reader that the reader driving method is applied to described in any of the above-described drives
Device, the reader driving method includes:Mixing read-write interface in the reader drive device receives upper layer application
Call;The mixing read-write rule of reader is configured, the mixing read-write rule is for controlling reader to two or more
The label of protocol type carries out mixing read-write operation, and starts mixing read-write behaviour of the reader according to the mixing read-write rule
Make;The mixing read-write result of reader is obtained, and reports to upper layer application.
In an embodiment of the present invention, the process of the mixing read-write rule of configuration reader is specially:Receive upper layer application
The mixing read-write parameter for issuing, two or more protocol type is carried in the mixing read-write parameter;According to described mixed
Close the mixing read-write rule of read-write parameter configuration reader.
In an embodiment of the present invention, the process of the mixing read-write rule according to the mixing read-write parameter configuration reader
Specially:According to two or more the protocol type carried in the mixing read-write parameter, corresponding RO rules are issued
With AO rules to the reader, rule, a kind of one of AO rules protocol class of correspondence are read and write with the mixing for configuring reader
Type.
In an embodiment of the present invention, obtain after the mixing read-write result of reader, also include:Mixing read-write is deleted to open
Mobile interface is issued to the mixing read-write rule of reader, and stops the mixing read-write operation of reader.
In an embodiment of the present invention, the mixing read-write rule is circulation mixing read-write rule, and the circulation mixing is read
Writing rule includes that circulate operation is spaced, and the circulation mixing read-write rule is for controlling reader to assist two or more
The label for discussing type is circulated mixing read-write operation.
The beneficial effects of the invention are as follows:Reader drive device, reader control system and reader that the present invention is provided
Driving method makes reader possess the read-write operation function to the label of two or more protocol type, upper layer application exploitation
Operation can be developed by unified application operating interface correspondence different agreement label, it is clear that development cost can be reduced, together
Shi Tigao reader operating efficiencies.
Further, can also check interface, mixing cycle and check interface by mixing single makes reader possess to two kinds
Or the single of the label of two or more protocol types check, cycle inventory operation function.
Further, can also be set up again in addition to including mixing read-write interface in reader drive device of the invention
One or more support single agreement application operating interface of the common single protocol type label of identification, such as support identification ratio
The ISO18000-6C agreement application operating interfaces of more typical ISO18000-6C protocol type labels, support that identification is common
ISO18000-6B agreement application operating interfaces of ISO18000-6B protocol type labels etc..Label is being identified known to user
Protocol type in the case of, application operating interface corresponding with the protocol type can be called to enter row information in upper layer application
Interaction, improves communication efficiency.Do not know the protocol type of identified label in user, or need to recognize different agreement type simultaneously
In the case of label, mixing read-write interface, mixing single can be called to check interface, mixing cycle and check and connect in upper layer application
Mouth carries out business operation.
Specific embodiment
The present invention is described in further detail below by specific embodiment combination accompanying drawing.
In the present invention, reader drive device can (Low Level Reader Protocol, bottom be read based on LLRP
Read device agreement) realize.Mixing read-write operation, refers to reader and possesses reading to the label of two or more protocol type
Write operation function, including operation is written and read simultaneously to the label of two or more protocol type, also including to two kinds or
The label of two or more protocol types is circulated read-write operation.For ISO18000-6C labels, main You Sige areas
Domain, Reserve areas, EPC areas, TID field, User areas.For ISO18000-6B labels, generally one is represented by several bytes
Region, such as 8-12 bytes represent a region, and 16-20 bytes represent another region of the label.ISO18000-6C is marked
Sign the mode for being circulated mixing read-write operation with ISO18000-6B labels for example:ISO18000-6C labels are read in circulation
The 8-12 bytes of ISO18000-6B protocol labels are read in TID field 0-4 bytes, and circulation;Or ISO18000-6C is read in circulation
The TID field 0-4 bytes and User areas 0-8 bytes of label, and circulation read ISO18000-6B protocol labels 8-12 bytes and
16-20 bytes.Mixing read-write interface is used to configure the mixing read-write operation function of reader, and should on upper strata by communication unit
This function is realized with the transmission and reader between for information about.Mixing single inventory operation refers to reader to be possessed to two
The single inventory operation function of the label of kind or two or more protocol types.Mixing single checks interface and is used to configure reader
Mixing single inventory operation function, and transmitted between upper layer application and reader by communication unit and realize having for the function
Pass information.Mixing cycle inventory operation refers to reader and possesses clear to the cycle of the label of two or more protocol type
Point operating function.Mixing cycle checks the mixing cycle inventory operation function that interface is used to configure reader, and by communication unit
Unit's transmission between upper layer application and reader realizes the function for information about.
As shown in figure 1, a kind of reader control system provided for one embodiment of the invention, the system includes upper layer application
1st, reader 2 and reader drive device 3.
Wherein, reader drive device 3 includes application operating interface unit 31, communication unit 32, message processing unit 33
With reader administrative unit 34.Application operating interface unit 31 and reader administrative unit 34 all calling according to upper layer application 1
Realize corresponding operational control.Communication unit 32 is used to realize application operating interface unit 31, message processing unit 33, reader
Information exchange between administrative unit 34 and reader 2.
Upper layer application 1 can call application operating interface unit 31 and the reader management in reader drive device 3 single
Unit 34, so as to realize reader link control and business operation control.Such as reader link control includes opening reader, closes
Link monitoring closed under reader, link detecting, reader service end pattern etc.;Business operation control is included to ISO18000-
The operation such as the checking of the label of 6C protocol types, reading and writing, locking, kill, to the clear of the label of ISO18000-6B protocol types
Point, reading and writing, locking, kill etc. are operated, and the mixing single of the label of various protocols type are checked, mixing cycle is checked, mix
Close read-write operation etc..
Reader 2 can carry out information exchange by primitive interface and reader drive device 3.
Application operating interface unit 31 includes the multi-protocols application for supporting to recognize two or more protocol type label
Operate interface 311, also including only support recognize ISO18000-6C protocol type labels ISO18000-6C agreement application operatings
Interface 312, the ISO18000-6B agreement application operatings interface 313 for only supporting identification ISO18000-6B protocol type labels.Its
In, ISO18000-6C agreement application operatings interface 312 is used to control reader 2 to enter the label of ISO18000-6C protocol types
The business operations such as row is checked, reading and writing, locking, kill.ISO18000-6B agreement application operatings interface 313 is used to control reader
The business operations such as the label of 2 pairs of ISO18000-6B protocol types is checked, reading and writing, locking, kill.Multi-protocols application operating
Interface 311 is used to carrying out the label of two or more protocol type mixing, and single is checked, mixing cycle is checked, mix
The business operations such as read-write.According to actual needs, application operating interface unit 31 can also include other support identification single agreements
Single agreement application operating interface of type label.Upper layer application 1 can be by application operating interface unit 31 to the business of reader
Operating function is configured, and realizes the secondary development to reader.
Multi-protocols application operating interface 311 of the present invention, the and of ISO18000-6C agreement application operatings interface 312
ISO18000-6B agreement application operatings interface 313 refers both to the interface in units of set, and such as multi-protocols application operating interface 311 refers to
Be a set of multi-protocols application operating interface, including at least one interface for supporting identification various protocols type label.Such as Fig. 2 institutes
Show:
Multi-protocols application operating interface 311 includes that mixing single checks interface 311a, mixing cycle and checks interface 311b
With mixing read-write interface 311c etc., it is respectively used to receive calling for upper layer application, to the mark of two or more protocol type
Label carry out mixing, and single is checked, mixing cycle is checked, mix read-write operation.As a example by mixing read-write interface 311c, upper strata should
The mixing read-write rule of reader can be configured by mixing read-write interface 311c with 1, realize reading the mixing of reader
Write the secondary development of function.Specifically, mixing read-write interface 311c receives calling for upper layer application, the mixing of reader 3 is configured
Read-write rule, reads and writes rule control reader 3 and the label of two or more protocol type is mixed according to the mixing
Read-write operation, is additionally operable to obtain the mixing read-write result of reader 3, and report to upper layer application 1.Wherein, read-write interface is mixed
The mixing read-write rule configuration reader 3 that 311c can be previously set according to interface internal, it is also possible to issued according to upper layer application 1
Mixing read-write parameter configuration reader 3 mixing read-write rule, in a word, the mixing read-write rule for being configured causes reader 3
Mixing read-write operation can be carried out to the label of two or more protocol type.
ISO18000-6C agreement application operatings interface 312 checks interface 312a, ISO18000-6C including ISO18000-6C
Read interface 312b, ISO18000-6C and write interface 312c, ISO18000-6C lock port 312d, ISO18000-6C kill interface
312e etc., be respectively used to realize reader 2 to the checking of the label of ISO18000-6C protocol types, reading and writing, locking, kill behaviour
Make.So that the label to ISO18000-6C protocol types carries out inventory operation as an example, ISO18000-6C checks interface 312a receptions
After the calling of upper layer application 1, information exchange is carried out by communication unit 32 and reader 2, it is clear that the reader 2 to receiving is returned
After point information is packaged, there is provided to upper layer application 1.
ISO18000-6B agreement application operatings interface 313 checks interface 313a, ISO18000-6B including ISO18000-6B
Read interface 313b, ISO18000-6B and write interface 313c, ISO18000-6B lock port 313d, ISO18000-6B kill interface
313E etc., be respectively used to realize reader 2 to the checking of the label of ISO18000-6B protocol types, reading and writing, locking, kill behaviour
Make.
Message processing unit 33 is used to carry out accordingly the information from application operating interface unit 31 and communication unit 32
Encoding and decoding, including coding module 331, decoder module 332, buffer area 333, queue processing module 334 and message searching modul
335 etc..
In down direction, coding module 331 is used for will be from multi-protocols application operating interface 311, ISO18000-6C agreements
The information of application operating interface 312, ISO18000-6B agreement application operatings interface 313(Such as Message forms)It is converted into bit
The format transmission of stream is to communication unit 32, it is preferred that coding module 331 carries out Message forms to turning that bit flows based on LLRP
Change.
In up direction, decoder module 332 is used for the information from communication unit 32(Such as bit streams)It is converted into
Message forms, and accordingly transmit to multi-protocols application operating interface 311, ISO18000-6C agreement application operatings interface 312
Or ISO18000-6B agreement application operatings interface 313.Preferably, decoder module 332 carries out bit and flows to Message based on LLRP
The conversion of form.
Up direction, before decoder module 332 is decoded, it is possible to use buffer area 333 is stored from communication unit
The information of unit 2(Such as bit streams), transmitted to decoder module 332, in buffer area after carrying out reception processing according to corresponding reception state
The reception state of message three kinds of states such as including READY, FRAME_ERROR, NEED_MORE, representative respectively receives complete
One frame message, receive mistake, need to continue to.After decoder module 332 completes decoding, queue processing module can be used
After 334 information for completely decoding decoder module 332 are added to message queue, according to being sequentially presented to accordingly for message queue
Multi-protocols application operating interface 311, ISO18000-6C agreement application operatings interface 312 or ISO18000-6B agreement application operatings
Interface 313.
After message searching modul 335 is used to search specific information from the message queue, there is provided to corresponding multi-protocols
Application operating interface 311, ISO18000-6C agreement application operatings interface 312 or ISO18000-6B agreement application operating interfaces
313.Can be searched according to information type or No. ID, it can be deleted from message queue after the completion of lookup.For example, upper strata
Application call multi-protocols application operating interface 311, multi-protocols application operating interface 311 is based on LLRP agreements and sends one
addROSpec(Increase RO rules)Message returns to addROSpecResponse to reader 2, reader 2 after receiving(Increase RO
Rule is responded)Message, at this moment message searching modul 335 need to search the addROSpecResponse from from message queue and disappear
Breath, if No. ID of the message consistent with No. ID of addROSpec message, judgement have found receiveing the response for addROSpec, carry
The addROSpecResponse message is taken to corresponding multi-protocols application operating interface 311, is grasped by corresponding multi-protocols application
Make interface 311 and return to upper layer application 1, the message is deleted from message queue.
Reader administrative unit 34 is used to manage the linking status of reader 2, including reader is opened module 341, read
Device closedown module 342, link monitors module 343 and link detection module 344, when upper layer application 1 is interacted with reader 2,
Reader opens module 341 to be used to, by setting corresponding parameter object, open communication unit 32, is set up communication unit 32 and is read
Read the link between device, reader closedown module 342 is used to disconnect linking for communication unit 32 and reader 1.
The communication pattern of reader drive device includes serial ports pattern and network interface mode, reader drive device 3 and reading
When device 2 realizes communication under serial ports pattern, upper layer application 1 calls reader administrative unit 34, by reader opening module 341
Corresponding parameter object is set to serial ports parameter, you can established the link with reader 2 with the serial ports for opening communication unit 32, links
After the completion of, reader closedown module 342 can be called to disconnect and to be linked with reader 2.Network interface mode includes reader service end
Pattern and reader client mode.Under the pattern of reader service end, after reader 2 starts, upper layer application 1 calls reader
Administrative unit 34, and corresponding parameter object in reader opening module 341 is set to the IP letters of the reader 2 for needing link
Breath, you can the network interface and the reader 2 for opening communication unit 32 are realized linking, and after the completion of link, upper layer application 1 can call reading
The break link of device closedown module 342.Under reader client mode, upper layer application 1 calls reader administrative unit 34, utilizes
Link monitors module 343 and monitors reader 2 and wait the link setup of reader 2, after the completion of link setup, can stop link and monitor disconnection and read
Read the link of device 2.
Link detection module 344 is used for the linking status of the real-time or periodic detection reader 2 in link process, so that
Whether the quantity of reader 2 that judgement is currently linked with upper layer application 1, and each reader 2 normally links with upper layer application 1
Deng, if certain reader 2 it is already off link if can report upper layer application 1.It is preferred that using the detection mode of heartbeat, that is, linking
During link detection module 314 periodically reply the heartbeat message of reader 2, such as eartbeat interval time is defaulted as 5s, if
The heartbeat message that reader 2 is not received in 10 seconds then thinks the break link of reader 2, can also be regular by link detection module 314
Heartbeat message is sent to reader 2 and await a response.
As shown in figure 3, being the schematic diagram of mixing read-write interface 311c, mixing read-write interface 311c includes that mixing read-write starts
Interface(Such as the StartPeriodRW interfaces of LLRP agreements), mixing read-write result obtain interface(Such as LLRP agreements
GetPeriodRWResult interfaces)Stop interface with mixing read-write(Such as the StopPeriodRW interfaces of LLRP agreements).To be based on
As a example by the circulation mixing read-write operation of LLRP agreements:
The mixing read-write parameter that StartPeriodRW interfaces upper layer application 1 is issued, and parsed, it is mixed according to this
Close read-write parameter and issue corresponding RO rules and AO rules to reader 3, rule is read and write with the mixing for configuring reader, it is to be read
After the addition of device 3 completes RO rules and AO rules, start the mixing read-write operation of reader.Specifically, StartPeriodRW connects
Mouthful the mixing read-write parameter that upper layer application 1 is issued is received, circulate operation interval, reader can be included in mixing read-write parameter
Mark, two or more protocol type and reading writing information etc., certainly can also be including mask information etc..Parsed
Afterwards, corresponding RO rules and AO rules to reader 3 are issued, it is preferred that issue a RO rule for a reader, and
Two or two or more AO rules, wherein, a kind of each AO rule protocol types of correspondence such as issue an ISO18000-
The AO rules of 6B agreements and an AO rule for ISO18000-6C agreements.Each RO rules, AO rules are packaged into different message
It is issued to reader.Specifically issuing the process of RO rules and AO rules can be:
First, RO rules are issued:Can include antenna configuration, protocol type in RO rules(If being wrapped in mixing read-write parameter
Include both protocol types of ISO18000-6C and ISO18000-6B, then the RO rule in also configure ISO18000-6C and
ISO18000-6B both protocol types), circulate operation interval, ROSpecID(The unique mark of RO rules)Etc. information,
ROSpecID is used to recognize this RO rules that be issued to reader 3 in standard LLRP agreement Message forms, reader 3 to be docked
The RO rules for receiving are added, and the notice of addition success or failure is returned to StartPeriodRW interfaces.
Secondly, for protocol type entrained in mixing read-write parameter, corresponding AO rules are issued respectively:In AO rules
It is the ROSpecID in above-mentioned RO rules that AccessSpecID (accessing the unique mark of rule) can be configured, and is also wrapped in AO rules
Include protocol type(If mixing read-write parameter includes both protocol types of ISO18000-6C and ISO18000-6B, the AO
Also both protocol types of ISO18000-6C and ISO18000-6B are configured in rule), at least one OpSpec (operation rules,
Including reading OPSpec, writing OPSpec etc.), each OpSpec also carries a different OpSpecID, and each AO rule may include
Multiple OpSpec a, OpSpec can correspond to an a kind of region of protocol type label, in such as one AO rule, wherein one
Individual OpSpec is the read operation in the EPC areas of ISO18000-6C protocol labels, and initial address is 2, and length is 8 words;Another
OpSpec is the USER areas write operation of ISO18000-6C protocol labels, and initial address is 0,4 words of length.The AO for so issuing
Rule, you can the EPC areas to ISO18000-6C protocol labels carry out read operation, it is also possible to ISO18000-6C protocol labels
USER areas carry out write operation.Each AO rules are issued to reader 3 in standard LLRP agreement Message forms, and reader 3 is docked
The AO rules for receiving are added, and the notice of addition success or failure is returned to StartPeriodRW interfaces.If without
OpSpec, reader only can merely carry out inventory operation.Can also include mask information in AO rules(Configuration mask information
Afterwards, it is necessary to match mask reported data, only pair label matched with mask information is written and read operation), operator password(Read-write behaviour
The password of work, first carries out password check before read-write operation, just allow to be written and read operation after checking successfully)Deng.
Impinj labels belong to one kind of ISO18000-6C protocol labels, and its tag state is divided into publicly-owned, privately owned state,
When carrying out mixing read-write operation to it, mixing read-write interface can issue an interim publicly-owned turn of privately owned operation, subsequently be added
Plus AO operations.
After the addition of device to be read 3 completes RO rules and AO rules, the circulation that StartPeriodRW interfaces start reader is mixed
Close read-write operation.
Reader 3 reports circulation mixing to read and write result, including label substance in units of antenna, and label substance includes agreement
The information such as type, antenna, tag ID, label OpSpec results, read OpSpec results and include the reading issued in regular with AO
The data of OPSpec corresponding OpSpecID, the data length of reading and reading;Write OpSpec results include with AO rule in
What is issued writes the corresponding OpSpecID of OPSpec, and writes Op results.Entrained OpSpecID and AO is advised in read-write result
The OpSpecID entrained by corresponding OpSpec operations issued in then is consistent, therefore GetPeriodRWResult interfaces are obtained
To after the mixing read-write result of the feedback of reader 3, each OpSpec can be parsed and operate corresponding read-write result, and to upper strata
Using reporting.
At the end of circulation mixing read-write operation, StopPeriodRW interfaces issue DeleteRO(Delete RO rules)Operation,
Reader deletes the RO rules issued before StartPeriodRW interfaces, and all of AO rules according to DeleteRO, and stops
The only circulation mixing read-write operation of reader.
The present invention also provides a kind of reader driving method, specifically, by reading between upper layer application 1 and reader 2
After device drive device 3 realizes link, in down direction, will be from multi-protocols application operating interface 311, ISO18000-6C agreements
The information of application operating interface 312, ISO18000-6B agreement application operatings interface 313(Such as Message forms)It is converted into bit
The form of stream, transmits to reader 2;In up direction, the operation information of the bit stream format from reader 2 is converted into
Message forms, and upper layer application 1 is supplied to by corresponding interface.As shown in figure 4, for control reader realizes that business is grasped
The process of work:
S401:Before upper layer application 1 is communicated with reader 2, reader drive device 3 is established the link with reader 2,
According to the communication pattern of reader drive device 3(Serial ports pattern, network interface mode, network interface mode include reader service end pattern
With reader client mode)Difference, the mode for establishing the link is also different:
Under serial ports pattern, upper layer application 1 calls reader administrative unit 34, will be corresponding in reader opening module 341
Parameter object be set to serial ports parameter, the serial ports for opening communication unit 32 is established the link with reader 2.
Under reader client mode, upper layer application 1 calls reader administrative unit 34, starts link and monitors module
343, link monitors module 343 and calls window networking DLL WSAStart to initialize Winsock first, so as to create
One socket function;Call one monitoring of socket function creations;The communication object specified for socket functions is monitored in binding;
Call listen etc. to be linked;Call accept to receive link, and generate session socket;Call send()And recv()With read
Read device 2 to conversate.In addition, after the completion of link, closesocket functions can be called to close socket, stop to reading
The monitoring of device 2, disconnection is linked with reader 2.
Under the pattern of reader service end, upper layer application 1 calls reader administrative unit 34, starts reader and opens module
341, reader opens module 341 and calls window networking DLL WSAStart to initialize Winsock first, so as to create
Build a socket function;Call one session of socket function creations;Connect is called after conversation establishing success, will be read
Corresponding parameter object is set to the IP information of the reader 2 for needing link in device opening module 341;Call send()And recv
(), conversated with reader 2 by communication unit 32;In addition, after the completion of link, can be by reader closedown module 342
Closesocket functions are called to close socket, disconnection is linked with reader 2.
After linking successfully, upper layer application 1 can also call the configuration operate interface of reader drive device 3 to inquire about and update and read
Read device 2 basic configuration, including antenna power, antenna detect in place, antenna condition inquiry, preceding reverse rate, type of coding, tune
Mode processed, communication type parameter, protocol type, device coding, determine chatter frequency etc. Common Parameters.Protocol type, antenna power etc.
After the completion of configuration, you can realize interacting for business basic operation message with reader 2.
S402:Upper layer application 1 selects the application operating interface that this calls according to the actual conditions of label to be operated(Support
Recognize the multi-protocols application operating interface 311 of two or more protocol type label, only support identification ISO18000-6C associations
The ISO18000-6C agreement application operatings interface 312 of type label is discussed, or only supports identification ISO18000-6B protocol type marks
ISO18000-6B agreement application operatings interface 313 of label etc.).
In the case of the protocol type for being identified label known to user, can be called in upper layer application and the protocol class
The corresponding application operating interface of type carries out information exchange, improves communication efficiency.Do not know the protocol type of identified label in user,
Or in the case of needing the label of identification different agreement type simultaneously, multi-protocols application operating can be called to connect in upper layer application
Mouth 311, further according to the specific function of wanting and realize, Selection and call mixing single is checked interface 311a, mixing cycle and is checked
Interface 311b or mixing read-write interface 311c.
S403:If have invoked mixing read-write interface 311c, the mixing read-write in mixing read-write interface 311c starts interface
Calling for upper layer application is received, and mixing read-write rule is converted into bit by the coding module 331 in message processing unit 33
The format transmission of stream is issued to reader 3 to communication unit 32 by communication unit 32.
Wherein, mixing read-write rule can be that mixing read-write interface 311c interface internals are previously set, or mix
Close read-write interface 311c and mix the mixing read-write rule that read-write parameter draws according to what upper layer application 1 was issued, in a word, issued
Mixing read-write rule enables that reader 3 carries out mixing read-write operation to the label of two or more protocol type.
S404:Reader is added to mixing read-write rule, and to mixing read-write interface 311c feedback add successfully or
The result of failure.If all adding successfully, mixing read-write interface 311c starts the mixing read-write operation of reader, into step
S405;If addition failure, mixing read-write interface 311c re-issues respective rule, or flow terminates.
S405:Reader 3 reads and writes rule and the label of two or more protocol type is mixed according to the mixing
Read-write operation.
S406:Reader 3 reads and writes result, message processing unit 33 with the form that bit flows to the feedback mixing of communication unit 32
In decoder module 332 will be converted into Message forms from the mixing of communication unit 32 read-write result, and accordingly transmit to mixed
The mixing read-write result closed in read-write interface 311c obtains interface.
S407:Mixing read-write result obtains interface and the mixing read-write result of Message forms is returned into upper layer application 1.
If step S403 has been issued to defined in the mixing read-write rule of reader 3 circulation mixing read-write operation, returns and perform S305;
Otherwise, upper layer application judges whether to need to terminate mixing read-write operation flow, if desired terminates read-write operation flow, then mixing is read
Write the read-write stopping interface of the mixing in interface 311c and issue delete command to reader, read-write is mixed in delete step S403 and is started
Interface is issued to the mixing read-write rule of reader, and stops the mixing read-write operation of reader.
Reader drive device, reader control system and the reader driving method that the present invention is provided can make same reading
Device is written and read operation to the label of two or more protocol type, that is, mix read-write operation, and upper layer application exploitation can be with
Operation is developed by unified application operating interface correspondence different agreement label, it is clear that development cost can be reduced, while carrying
Reader operating efficiency high.Further interface, mixing cycle can also be checked check interface by mixing single makes same reading
Device to the label of two or more protocol type carry out mixing single check, mixing cycle inventory operation.Can also read
Read to set up one or more single agreement application behaviour for supporting the common single protocol type label of identification in device drive device
Make interface, in the case of the protocol type for being identified label known to user, can be called in upper layer application and the protocol class
The corresponding application operating interface of type carries out information exchange, improves communication efficiency.Do not know the protocol type of identified label in user,
Or in the case of needing the label of identification different agreement type simultaneously, mixing read-write interface can be called in upper layer application, is mixed
Closing single and checking interface, mixing cycle and check interface carries out business operation.
Above content is to combine specific embodiment further description made for the present invention, it is impossible to assert this hair
Bright specific implementation is confined to these explanations.For general technical staff of the technical field of the invention, do not taking off
On the premise of present inventive concept, some simple deduction or replace can also be made, should all be considered as belonging to protection of the invention
Scope.