Summary of the invention
For solving the problem existing for above-mentioned prior art, the present invention proposes a kind of label immediate processing method, comprising:
NFC functional module is utilized to scan multiple smart card, communicated by infrared NEC agreement and mobile terminal, and scanning information is stored in the terminal, identified, to activate the smart card of specifying by pairing algorithm when mobile terminal uses smart card.
Preferably, described NFC functional module comprises NFC chip, micro-control unit, infrared module and auxiliary circuit and power supply, wherein, described NFC chip and infrared module carry out information transmission by SPI interface, and mobile terminal installs corresponding driving and library file in advance;
Micro-control unit is used for conversion and the transferring order of data layout, and by the functional authorization of this hardware kit, realize the automatic matching between infrared module, the automatic matching process of described infrared module comprises further:
1) first the infrared module in NFC functional module is arranged pass code;
2) in the application of mobile terminal, when infrared opening, infrared module is registered as receiver, makes it be in wait-for-response state;
3) when the infrared module of mobile terminal receives broadcast, pass code infrared in NFC functional module is set in infrared module;
4) the related function method such as infrared pairing, binding state verification is realized.So just achieve infrared automatic matching.
Preferably, described when mobile terminal use smart card time by match algorithm identify, to activate the smart card of specifying, comprise further:
The support of NFC and api interface are encapsulated in android.nfc and android.nfc.tech two bag of android system, in android.nfc, definition detects and finds the method for NFC object, a corresponding NFC adapter of NFC chip, wherein said detection and discovery procedure are:
1) constructing a NFC manager object during NFC initialization, by calling the control of getDefaultAdapater method acquisition to NFC chip, completing the initial work to NFC chip simultaneously.
2) NFC adapter automatically creates an Intent comprising NFC label by message distributing system and broadcasts, and the NFC label in communication field is replied after receiving this broadcast, if reply successfully, completes the discovery procedure of label;
The Intent of definition different priorities, NFC adapter establishes a communications link according to described priority and this Intent, the correlation technique of digital independent is defined in android.nfc.tech, label data is packaged into the packet of NFC data Interchange Format by NFC adapter, carry out reading and the transmission of data afterwards, finally all data messages of smart card are converted to the form of specifying and store.
The present invention compared to existing technology, has the following advantages:
The present invention proposes a kind of label immediate processing method, by simple and quick for smart card scanning, and store in the terminal, do not need to change the infrastructure of existing radio-frequency (RF) identification class, a large amount of artificial and equipment costs can be saved, achieve the integrated management of individual smart card, for daily life bring convenience, the experience of application of IC cards efficiently and high-quality.
Embodiment
Detailed description to one or more embodiment of the present invention is hereafter provided together with the accompanying drawing of the diagram principle of the invention.Describe the present invention in conjunction with such embodiment, but the invention is not restricted to any embodiment.Scope of the present invention is only defined by the claims, and the present invention contain many substitute, amendment and equivalent.Set forth many details in the following description to provide thorough understanding of the present invention.These details are provided for exemplary purposes, and also can realize the present invention according to claims without some in these details or all details.
Fig. 1 is the label immediate processing method process flow diagram according to the embodiment of the present invention.The present invention proposes a kind of smart card integrated system model, in conjunction with existing mobile terminal and NFC technique, by simple and quick for various smart card scanning, and stores in the terminal, carries out Intelligent Recognition also activate the smart card of specifying during use by pairing algorithm.
NFC functional module is by NFC chip, micro-control unit, infrared module and other auxiliary circuits and electric power generating composition, and wherein, NFC chip and infrared module carry out standardized information transmission by SPI interface.The present invention by NFC functional module by infrared NEC agreement with do not support that the terminal device of NFC function communicates, realize the mutual and transmission of order and data; After corresponding driving and library file are installed, do not support that the terminal device of NFC has just possessed NFC function.Such equipment can carry out NFC communication by the NFC functional module of expansion and other NFC device or label, realizes the operation such as access to content and reading and writing data fast.
The conversion of micro-control unit primary responsibility data layout and transferring order.Invention has been the functional authorization of this hardware kit, achieve the automatic matching link between infrared module, do not need manual input pass code to carry out authentication and successfully can match connection, and the conversion that can realize infrared data form and NFC data form with the basic function such as to communicate.
Here is the implementation procedure of infrared module without input automatic matching function:
1) first the infrared module in NFC functional module is arranged pass code, such as 0000.
2) when infrared opening, infrared module is registered as receiver in mobile terminal application, makes it be in wait-for-response state.
3) when mobile terminal infrared module receives broadcast, pass code infrared in NFC functional module is set in infrared module.
4) the related function method such as infrared pairing, binding state verification is realized.So just achieve infrared automatic matching.
In the Software for Design of mobile terminal, based on Android platform exploitation, realized the concrete function of the parts such as smartcard identification, data scanning and reading, card storage and smart card simulation activate by identifying processing and simulation activation two subsystems.
The function that identifying processing subsystem realizes mainly comprises the parts such as card identification, information reading and information storage.To the support of NFC and api interface predominant package in android.nfc and android.nfc.tech two bag of android system.Wherein, detect in this subsystem and find that the method for NFC object defines in android.nfc, a corresponding NFC adapter of NFC chip.Detection of the present invention and discovery procedure are:
1) constructing a NFC manager object during NFC initialization, by calling the control of getDefaultAdapater method acquisition to NFC chip, completing the initial work to hardware such as NFC chip simultaneously.
2) NFC adapter is broadcasted by the automatic establishment of message distributing system (label DSPIatchSystem) Intent comprising NFC label, NFC label in communication field is replied after receiving this broadcast, replys the discovery procedure successfully then completing label.
The Intent of definition 3 kinds of different priorities, priority is higher, then NFC adapter is more preferential establishes a communications link with this Intent.The correlation technique of digital independent defines in android.nfc.tech, label data is packaged into the packet of NFC data Interchange Format by NFC adapter, reading and the transmission of data can be carried out afterwards, finally all data messages of a sheet smart card are converted to the form of specifying and store.
By scanning smart card getter information, and data information being converted to specific format are stored in mobile phone, this completes the integrated of a sheet smart card; As long as multiple smart cards scan one by one, just multiple smart cards can be integrated in smart machine and suffer.
Simulation activates subsystem and is embodied as the smart card reader equipment of specifying and finds the corresponding NFC its data of pairing, simulates smart card and carries out swiping the card and operate and carry out the function of corresponding operation log recording.
The pairing of smart card NFC its data, information contrast table can be set up by information such as UID, SAK, HASH and the RFTechnology with relative entity smart card, selected by certain pairing algorithm, realize the Weigh sensor to smart card reader equipment.For the situation being paired to multiple NFC its data, also can carry out secondary pairing by error calculation and poll, improve the efficient and success ratio of pairing algorithm.
At present, the pairing algorithm that smart card integrated system adopts can be expressed as simply: if the acquisition of NFC target card reader discoverys → radio type → according to all records in radio-frequency queries card data → have SAK data, then carry out according to SAK value card data record → poll that filtering query arrives to activate and attempt and NFC card reader communication → smart card confirmation, these card data are added the UID mark of this card reader, and upgrade HASH → set up communication linkage and exchange data.
The bottom layer driving of NFC chip has supported the function being simulated passive label by NFC, by carrying out Function Extension to nfclib class libraries, and writes corresponding java class and is supplied to android system as middleware and calls, achieve the card analog functuion of NFC equally.The method of current employing software simulation, is namely that NFC chip divides resource by the processor of mobile terminal, and provides the function of information processing, communication response and part SE safe unit.This scheme need not increase special hardware, and it is relatively convenient to implement, and also substantially increases the applicability of this solution simultaneously.
In sum, the present invention proposes a kind of label immediate processing method, by simple and quick for smart card scanning, and store in the terminal, do not need to change the infrastructure of existing radio-frequency (RF) identification class, a large amount of artificial and equipment cost can be saved, achieve the integrated management of individual smart card, for daily life bring convenience, the experience of application of IC cards efficiently and high-quality.
Obviously, it should be appreciated by those skilled in the art, above-mentioned of the present invention each module or each step can realize with general computing system, they can concentrate on single computing system, or be distributed on network that multiple computing system forms, alternatively, they can realize with the executable program code of computing system, thus, they can be stored and be performed by computing system within the storage system.Like this, the present invention is not restricted to any specific hardware and software combination.
Should be understood that, above-mentioned embodiment of the present invention only for exemplary illustration or explain principle of the present invention, and is not construed as limiting the invention.Therefore, any amendment made when without departing from the spirit and scope of the present invention, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.In addition, claims of the present invention be intended to contain fall into claims scope and border or this scope and border equivalents in whole change and modification.