CN114330396A - External password keyboard and identity card information interaction method based on Android platform - Google Patents

External password keyboard and identity card information interaction method based on Android platform Download PDF

Info

Publication number
CN114330396A
CN114330396A CN202111680608.XA CN202111680608A CN114330396A CN 114330396 A CN114330396 A CN 114330396A CN 202111680608 A CN202111680608 A CN 202111680608A CN 114330396 A CN114330396 A CN 114330396A
Authority
CN
China
Prior art keywords
nfc unit
nfc
information interaction
password keyboard
interaction method
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111680608.XA
Other languages
Chinese (zh)
Other versions
CN114330396B (en
Inventor
张文硕
黄永辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian Newland Payment Technology Co ltd
Original Assignee
Fujian Newland Payment Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian Newland Payment Technology Co ltd filed Critical Fujian Newland Payment Technology Co ltd
Priority to CN202111680608.XA priority Critical patent/CN114330396B/en
Publication of CN114330396A publication Critical patent/CN114330396A/en
Application granted granted Critical
Publication of CN114330396B publication Critical patent/CN114330396B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Cash Registers Or Receiving Machines (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses an Android platform-based external password keyboard and identity card information interaction method, which comprises a POS machine, an NFC unit and an external password keyboard based on an Android platform, and the information interaction method comprises the following steps: s01, establishing an interactive thread to drive the NFC unit to carry out magnetic card identification work; s02, judging the working state of the NFC unit to generate a judgment result; s03, acquiring a judgment result, and initializing the NFC unit when the NFC unit is in a no-information interaction state; s04, the NFC unit enters a card searching state, when the card searching is successful, the apdu random number is taken, the apdu communication is started, and meanwhile, the NFC unit sends the read magnetic card information to the POS machine and completes response interaction; s05, judging apdu communication condition, and executing an ontagdistributed callback of the NFC unit by combining the read magnetic card data; s06, releasing the interactive thread driving the NFC unit, and completing the magnetic card identification work by the NFC unit.

Description

External password keyboard and identity card information interaction method based on Android platform
Technical Field
The invention relates to the technical field of data communication interaction, in particular to an external password keyboard and identity card information interaction method based on an Android platform.
Background
NFC (near field communication) is a short-distance contactless identification and interconnection technology. Compared with the infrared and Bluetooth communication technologies, the NFC transmission distance is shorter, the response time is shorter, and sensitive data can be interacted conveniently, safely and quickly. Based on the NFC technology, mobile payment means such as Apple Pay, Huawei Pay and the like are brought forward, and meanwhile, NFC chips are integrated into various POS products to serve as means for identification and transaction. From the perspective of a use scene, the NFC technology complements the current popular two-dimensional code payment business: the two-dimensional code payment does not depend on hardware conditions such as chip equipment and the like, and is easy to popularize. However, the two-dimensional code needs to complete data interaction through a network, and risks of network disconnection, information leakage and the like are hidden. And the equipment of integrated NFC need not the networking can accomplish the transaction, and important information stores in user equipment, and the third party is difficult to steal user's private information through the internet, and the security performance improves greatly. With the gradual maturity of NFC technology, it has been widely applied to the payment field. Similar to a mobile phone, a general POS terminal device adopts an integrated design style: that is, all functions and input/output devices are integrated into one main device, which results in a bulky POS device and poor adaptability. During daily transactions or card identification, there may be situations where the POS body device is not co-located with the user. In order to enhance the expansibility of the POS device, it may be considered to expand an interface on the POS main body device, separate a sensor or other functional module from a processor of the POS main body, collect user data depending on an external device, and feed back information required by people; generally, the advantages of the NFC technology are gradually revealed in the field of secure and fast POS payment, and the external device has an important meaning for the perfection of the POS function.
Disclosure of Invention
In view of this, the invention aims to provide an external password keyboard and identity card information interaction method based on an Android platform, which is reliable in implementation, convenient to operate and high in data communication efficiency.
In order to achieve the technical purpose, the technical scheme adopted by the invention is as follows:
an NFC-based information interaction method, comprising:
s01, establishing an interactive thread to drive the NFC unit to carry out magnetic card identification work;
s02, judging the working state of the NFC unit to generate a judgment result;
s03, acquiring a judgment result, and initializing the NFC unit when the NFC unit is in a no-information interaction state;
s04, the NFC unit enters a card searching state, when the card searching is successful, the apdu random number is taken, the apdu communication is started, and meanwhile, the NFC unit sends the read magnetic card information to the POS machine and completes response interaction;
s05, acquiring apdu communication condition, and executing an ontagdistributed callback of the NFC unit by combining the read magnetic card data;
and S06, releasing the interactive thread for driving the NFC unit, and finishing the magnetic card identification work by the NFC unit.
As a possible implementation manner, further, in S02, when the NFC unit is in the interworking mode, it correspondingly creates a working file as a flag, where the working state of the NFC unit is identified by determining in real time whether the working file exists or not; in S06, when the interactive thread driving the NFC unit is released, the work file is deleted.
As a possible implementation, further, the magnetic card is an identification card.
Based on the scheme, the invention provides an external password keyboard and identity card information interaction method based on an Android platform, which comprises a POS machine based on the Android platform, an NFC unit and an external password keyboard, wherein the NFC unit and the external password keyboard are in communication connection with the POS machine, and the information interaction method based on the NFC is also provided.
As a preferred alternative, in S01, it is preferable that the POS establishes a wired connection with the external password keyboard and the NFC unit through the RS-232 serial communication interface, and then establishes the interactive thread to drive the NFC unit to perform magnetic card identification, or the POS establishes a wired connection with the external password keyboard through the RS-232 serial communication interface, and the external password keyboard and the NFC unit establish a wired connection through the RS-232 serial communication interface, so that the POS is indirectly connected with the NFC unit, and then establishes the interactive thread to drive the NFC unit to perform magnetic card identification.
As a preferred alternative, in S04, preferably, the POS sends data to the NFC unit through a preset app, and invokes the card-searching service thread.
As a preferred alternative, it is preferable that S04 further includes: and acquiring the current state of the app, and clearing the working file generated in the step S02 when the app is running in the background or is not started, that is, clearing the flag bit, and defaulting the working state of the NFC unit to the off state.
Based on the above scheme, the present invention further provides a computer-readable storage medium, where at least one instruction, at least one program, a code set, or an instruction set is stored in the storage medium, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded by a processor and executed to implement the method for interacting information between the external password keyboard and the identity card based on the Android platform.
By adopting the technical scheme, compared with the prior art, the invention has the beneficial effects that: the customization demand that this scheme realized on POS machine based on tall and erect system of ann, through carrying out password keyboard and NFC module (NFC unit) external, and POS machine and password flange, the NFC unit expandes the communication through RS-232 serial ports mode and is connected, not only the operation is convenient, implement reliably moreover, to having realistic meaning of specific use scene, in addition, this scheme is through the operating mechanism of customization, can realize the magnetic card identification work of NFC unit and start and the thread release fast, the work efficiency and the working property of equipment have been improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of an interactive method of the present invention;
fig. 2 is a schematic diagram of a brief judgment flow for performing judgment initialization on the working state of the NFC unit in the interaction method of the present invention;
FIG. 3 is a schematic diagram of a brief logic sequence of the NFC unit performing card searching, apdu communication and call back in the interaction method of the present invention;
FIG. 4 is a schematic diagram of the hardware communication link of the interaction method of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be noted that the following examples are only illustrative of the present invention, and do not limit the scope of the present invention. Similarly, the following examples are only some but not all examples of the present invention, and all other examples obtained by those skilled in the art without any inventive work are within the scope of the present invention.
On the basis of fig. 1, with reference to fig. 4, the method for information interaction between the external password keyboard based on the Android platform and the identity card includes a POS machine based on the Android platform, an NFC unit, and an external password keyboard, where the NFC unit and the external password keyboard are both in communication connection with the POS machine, and the information interaction method includes:
s01, establishing an interactive thread to drive the NFC unit to perform magnetic card identification work, wherein the magnetic card is an identity card, in the step, the POS machine is in wired connection with an external password keyboard and the NFC unit through an RS-232 serial communication interface, then establishing the interactive thread to drive the NFC unit to perform magnetic card identification work, besides, the NFC unit can also be connected with the POS machine through the RS-232 serial communication interface through the external password keyboard, and then the external password keyboard is connected with the POS machine through the RS-232 serial communication interface, so that the NFC unit is in indirect communication connection with the POS machine;
s02, referring to fig. 2, determining the operating state of the NFC unit, and generating a determination result;
s03, acquiring a judgment result, and initializing the NFC unit when the NFC unit is in a no-information interaction state;
s04, referring to fig. 3, the NFC unit enters a card-seeking state, and when the card seeking is successful, the apdu random number is taken, and then the apdu communication is started, and meanwhile, the NFC unit sends the read magnetic card information to the POS and completes the response interaction;
s05, obtaining apdu communication condition, combining read magnetic card data, executing the ontagDiscoveredcallback of the NFC unit, in this step, when the apdu communication is successful, the ontagDiscoveredcallback value is not null, when the apdu communication is failed, the ontagDiscoveredcallback value is null, and no matter whether the ontagDiscoveredcallback value is null or not, the step enters S06;
and S06, releasing the interactive thread driving the NFC unit, completing the magnetic card identification work by the NFC unit, namely, completing card searching, activation and random number fetching, emptying the processing thread, and ending the identification card identification process.
In order to facilitate the judgment of the working state of the NFC unit, in S02, when the NFC unit is in interactive operation, it correspondingly creates a working file as a flag bit, where the working state of the NFC unit is identified by judging whether the working file exists in real time; in S06, when the interactive thread driving the NFC unit is released, the work file is deleted.
According to the scheme, the flag bit needs to be judged before the card is identified every time, and if the flag bit has a value, the last interaction is not finished, and the waiting is needed to be continued. Otherwise, the interactive thread is released, and a new round of card searching process is started, as shown in fig. 2. In the scheme, whether the previous round of transaction is finished or not is judged by adopting a file reading and writing mode in order to accurately position whether the identification of the identity card is finished or not. Creating a file and writing data when the interaction starts, and judging that the previous round of interaction is still carried out if the file exists; and in addition, after the NFC card reading is finished, the correspondingly generated file can be deleted, so that data residue cannot be caused to the equipment, and the equipment can keep the optimal working state.
In order to facilitate control operation, in step S04, the POS sends data to the NFC unit through a preset app, and invokes a card-searching service thread; preferably, S04 further includes: the current state of the app is obtained, when the app runs in a background or is not started, the working file generated in the step S02 is cleared, that is, the flag bit is cleared, and the working state of the NFC unit is defaulted to a closed state. And then, the card searching service executes an SP100 tool class, the tool class encapsulates the data, the encapsulated data is transmitted to a JNI (just in the index) interface through the serial port service of the system, the data is received, and the data is returned back in the original path. According to the scheme, the application program of the POS machine is used as an initiator of the card identification process, and the NFC service can be invoked when the application is required to be started and an NFC identification instruction is sent. When the application is in a background or is not started, the system closes the related service, clears the card interaction zone bit, and defaults that the NFC card identification function is in a closed state.
The customization demand that this scheme realized on POS based on tall and erect system of ann is through externally carrying out password keyboard and NFC module, and to the realistic meaning that has of specific use scene, nevertheless adopt native NFC scheme can solve the problem to general transaction discernment occasion. On the basis, the scheme can also set a specific identity, namely a hardware configuration code, for each POS machine. In order to distinguish customized models in different use scenes, the scheme can classify and configure the POS machine according to the hardware configuration code.
In addition to the above, the present solution may further include: and S07, after the card is identified and the serial code or the key information stored in the magnetic card (such as an ID card) is obtained, the card is butted with a background database, and apdu ID card instruction communication is carried out to obtain the detailed ID card information.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be substantially or partially implemented in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only a part of the embodiments of the present invention, and not intended to limit the scope of the present invention, and all equivalent devices or equivalent processes performed by the present invention through the contents of the specification and the drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (8)

1. An information interaction method based on NFC is characterized by comprising the following steps:
s01, establishing an interactive thread to drive the NFC unit to carry out magnetic card identification work;
s02, judging the working state of the NFC unit to generate a judgment result;
s03, acquiring a judgment result, and initializing the NFC unit when the NFC unit is in a no-information interaction state;
s04, the NFC unit enters a card searching state, when the card searching is successful, the apdu random number is taken, the apdu communication is started, and meanwhile, the NFC unit sends the read magnetic card information to the POS machine and completes response interaction;
s05, acquiring apdu communication condition, and executing an ontagdistributed callback of the NFC unit by combining the read magnetic card data;
and S06, releasing the interactive thread for driving the NFC unit, and finishing the magnetic card identification work by the NFC unit.
2. The NFC-based information interaction method according to claim 1, wherein in S02, when the NFC unit is in an interactive operation, it correspondingly creates a working file as a flag bit, wherein the working state of the NFC unit is identified by determining in real time whether the working file exists or not;
in S06, when the interactive thread driving the NFC unit is released, the work file is deleted.
3. An NFC-based information interaction method according to claim 1 or 2, wherein the magnetic card is an identification card.
4. The information interaction method of the external password keyboard and the identity card based on the Android platform comprises a POS machine based on the Android platform, an NFC unit and an external password keyboard, wherein the NFC unit and the external password keyboard are in communication connection with the POS machine, and the information interaction method is characterized by comprising the information interaction method based on the NFC according to claim 3.
5. The Android platform-based external password keyboard and identity card information interaction method of claim 4, wherein in S01, the POS machine is in wired connection with the external password keyboard through an RS-232 serial communication interface, the external password keyboard and the NFC unit are in wired connection through the RS-232 serial communication interface, indirect communication connection between the POS machine and the NFC unit is achieved, and then the POS machine establishes an interaction thread to drive the NFC unit to perform magnetic card identification work.
6. The Android platform-based external password keyboard and identity card information interaction method of claim 5, wherein in S04, the POS machine sends data to the NFC unit through a preset app, and calls a card-searching service thread.
7. The Android platform-based external password keyboard and identity card information interaction method of claim 6, wherein S04 further comprises: and acquiring the current state of the app, and clearing the working file generated in the step S02 when the app is running in the background or is not started, that is, clearing the flag bit, and defaulting the working state of the NFC unit to the off state.
8. A computer-readable storage medium, characterized in that: the storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded by a processor and executed to implement the method for interacting the external password keyboard and the identity card information based on the Android platform according to one of claims 4 to 7.
CN202111680608.XA 2021-12-31 2021-12-31 External password keyboard and identity card information interaction method based on Android platform Active CN114330396B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111680608.XA CN114330396B (en) 2021-12-31 2021-12-31 External password keyboard and identity card information interaction method based on Android platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111680608.XA CN114330396B (en) 2021-12-31 2021-12-31 External password keyboard and identity card information interaction method based on Android platform

Publications (2)

Publication Number Publication Date
CN114330396A true CN114330396A (en) 2022-04-12
CN114330396B CN114330396B (en) 2023-10-13

Family

ID=81023495

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111680608.XA Active CN114330396B (en) 2021-12-31 2021-12-31 External password keyboard and identity card information interaction method based on Android platform

Country Status (1)

Country Link
CN (1) CN114330396B (en)

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1928936A (en) * 2005-09-07 2007-03-14 吕航 POS machine
CN102542696A (en) * 2010-12-27 2012-07-04 中国银联股份有限公司 Security information interaction system and method
WO2014154129A1 (en) * 2013-03-26 2014-10-02 Shao Tong Two-time near distance connection secure payment device, method, and system
CN104219414A (en) * 2013-06-03 2014-12-17 三星电子株式会社 Method and image forming apparatus using near field communication
CN104463272A (en) * 2014-11-28 2015-03-25 郭宏志 Method for establishing information communication through NFC tag, mobile device terminal and NFC communication system
CN105450834A (en) * 2014-08-26 2016-03-30 宇龙计算机通信科技(深圳)有限公司 NFC state display method and NFC state display device
CN106407065A (en) * 2016-08-31 2017-02-15 福建联迪商用设备有限公司 Password keyboard USB communication abnormality recovery method and system
CN106529942A (en) * 2015-09-09 2017-03-22 青岛海信移动通信技术股份有限公司 NFC card access method and terminal
CN107590519A (en) * 2017-08-04 2018-01-16 咪咕视讯科技有限公司 A kind of player method of multimedia file, device and computer-readable recording medium
CN107943461A (en) * 2017-12-06 2018-04-20 福建新大陆支付技术有限公司 Method and system for multimedia intelligent POS identity information acquisitions
KR20190008502A (en) * 2017-07-15 2019-01-24 자이로캠주식회사 The media card having an NFC tag and a memory for storing a sound source, and a device for reproducing data of the media card
KR20190028987A (en) * 2017-09-11 2019-03-20 김병오 System and method for auto managing entrance and exit of employee using high-pass type
CN110867018A (en) * 2019-11-28 2020-03-06 福建新大陆支付技术有限公司 System and method for realizing safe PIN input on cash register with Android intelligent platform
CN214175061U (en) * 2021-01-27 2021-09-10 艾体威尔电子技术(北京)有限公司 Binding system of terminal equipment and external password keyboard

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1928936A (en) * 2005-09-07 2007-03-14 吕航 POS machine
CN102542696A (en) * 2010-12-27 2012-07-04 中国银联股份有限公司 Security information interaction system and method
WO2014154129A1 (en) * 2013-03-26 2014-10-02 Shao Tong Two-time near distance connection secure payment device, method, and system
CN104219414A (en) * 2013-06-03 2014-12-17 三星电子株式会社 Method and image forming apparatus using near field communication
CN105450834A (en) * 2014-08-26 2016-03-30 宇龙计算机通信科技(深圳)有限公司 NFC state display method and NFC state display device
CN104463272A (en) * 2014-11-28 2015-03-25 郭宏志 Method for establishing information communication through NFC tag, mobile device terminal and NFC communication system
CN106529942A (en) * 2015-09-09 2017-03-22 青岛海信移动通信技术股份有限公司 NFC card access method and terminal
CN106407065A (en) * 2016-08-31 2017-02-15 福建联迪商用设备有限公司 Password keyboard USB communication abnormality recovery method and system
KR20190008502A (en) * 2017-07-15 2019-01-24 자이로캠주식회사 The media card having an NFC tag and a memory for storing a sound source, and a device for reproducing data of the media card
CN107590519A (en) * 2017-08-04 2018-01-16 咪咕视讯科技有限公司 A kind of player method of multimedia file, device and computer-readable recording medium
KR20190028987A (en) * 2017-09-11 2019-03-20 김병오 System and method for auto managing entrance and exit of employee using high-pass type
CN107943461A (en) * 2017-12-06 2018-04-20 福建新大陆支付技术有限公司 Method and system for multimedia intelligent POS identity information acquisitions
CN110867018A (en) * 2019-11-28 2020-03-06 福建新大陆支付技术有限公司 System and method for realizing safe PIN input on cash register with Android intelligent platform
CN214175061U (en) * 2021-01-27 2021-09-10 艾体威尔电子技术(北京)有限公司 Binding system of terminal equipment and external password keyboard

Also Published As

Publication number Publication date
CN114330396B (en) 2023-10-13

Similar Documents

Publication Publication Date Title
WO2020182064A1 (en) Method for automatically selecting nfc emulation card, electronic apparatus, and communications system
EP2421216B1 (en) Enhanced near field communication terminal, smart card and communication method thereof
US9552579B2 (en) Near field communication activation and authorization
RU2489813C2 (en) Method and apparatus for automatic application selection in electronic device using multiple discovery managers
TWI633505B (en) System, apparatus and computer readable medium for payment credential-based mobile commerce
US6807561B2 (en) Generic communication filters for distributed applications
EP2455922A1 (en) NFC transaction method and system
EP2131313A1 (en) Method for selecting an application in a mobile wireless communication device in an NFC system and corresponding mobile wireless communication device
US10885509B2 (en) Bridge device for linking wireless protocols
US20150242844A1 (en) System and method for secure remote access and remote payment using a mobile device and a powered display card
WO2017128182A1 (en) Near field communication payment method and terminal
RU2756989C2 (en) Digital wallet application for mobile payment
WO2018121366A1 (en) Tee-based offline payment method, payment system thereof and mobile terminal
WO2020024795A1 (en) Implementation method for emv-based middleware and terminal device
EP1575005A2 (en) Method and apparatus for processing an application identifier from a smart cart
WO2012037791A1 (en) Method, device and system for displaying radio frequency identification application information
WO2010118612A1 (en) Method for installing contactless payment application, smart card and mobile terminal
US20150235228A1 (en) Method, device and system for on-line payment information transmission
CN114330396B (en) External password keyboard and identity card information interaction method based on Android platform
US9665414B2 (en) Communication protocol bridge for card computing devices
US20220398565A1 (en) Type 4 nfc tags as protocol interface
CN109872148B (en) Trusted data processing method and device based on TUI and mobile terminal
CN106778193B (en) Client and UI interaction method
US20210304185A1 (en) Electronic device control
KR100755915B1 (en) Mobile banking method through mobile telecommunication phone

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant