CN114330396B - 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 PDFInfo
- Publication number
- CN114330396B CN114330396B CN202111680608.XA CN202111680608A CN114330396B CN 114330396 B CN114330396 B CN 114330396B CN 202111680608 A CN202111680608 A CN 202111680608A CN 114330396 B CN114330396 B CN 114330396B
- 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.)
- Active
Links
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, wherein the Android platform-based POS machine, the NFC unit and the external password keyboard are included in the information interaction method, and the information interaction method comprises the following steps: s01, establishing an interaction thread to drive an NFC unit to perform magnetic card identification work; s02, judging the working state of the NFC unit, and generating a judging result; s03, acquiring a judgment result, and initializing the NFC unit when the NFC unit is in a non-information interaction state; s04, enabling the NFC unit to enter a card searching state, taking an apdu random number when the card searching is successful, further starting apdu communication, and simultaneously, enabling the NFC unit to send read magnetic card information to a POS machine and completing response interaction; s05, judging the apdu communication condition, and executing the onTagdiscovered callback of the NFC unit by combining the read magnetic card data; s06, releasing an interaction thread for driving the NFC unit, and completing the magnetic card identification work by the NFC unit.
Description
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-range contactless identification and interconnection technology. Compared with the infrared and Bluetooth communication technology, the NFC transmission distance is shorter, the response time is shorter, and sensitive data can be conveniently, safely and rapidly interacted. Based on NFC technology, mobile phone payment means such as Apple Pay and Huawei Pay are generated, and meanwhile, various POS products integrate NFC chips as means for identifying and transacting. From the aspect of using scene angle, the NFC technology complements the currently popular two-dimensional code payment state: 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 such as network disconnection and information leakage are hidden. The NFC integrated equipment can complete transactions without networking, important information is stored in the user equipment, and a third party is difficult to steal private information of the user through the Internet, so that the safety performance is greatly improved. As NFC technology has matured, it has been widely used in the field of payment. Similar to a mobile phone, a general POS terminal device adopts an integrated design style: that is, all functions and input/output devices are concentrated on one main body device, and the POS machine has the problems of bulky functions, poor suitability and the like. 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, the expansion interface on the POS main body device can be considered, a sensor or other functional modules are separated from a processor of the POS main body, user data are collected by means of external equipment, and information needed by people is fed back; in general, the advantages of NFC technology in the field of POS payment are gradually revealed, and the external equipment has important significance for perfecting POS functions.
Disclosure of Invention
Therefore, the invention aims to provide the external password keyboard and identity card information interaction method based on the Android platform, which is reliable to implement, convenient to operate and high in data communication efficiency.
In order to achieve the technical purpose, the invention adopts the following technical scheme:
an NFC-based information interaction method, comprising:
s01, establishing an interaction thread to drive an NFC unit to perform magnetic card identification work;
s02, judging the working state of the NFC unit, and generating a judging result;
s03, acquiring a judgment result, and initializing the NFC unit when the NFC unit is in a non-information interaction state;
s04, enabling the NFC unit to enter a card searching state, taking an apdu random number when the card searching is successful, further starting apdu communication, and simultaneously, enabling the NFC unit to send read magnetic card information to a POS machine and completing response interaction;
s05, acquiring an apdu communication condition, and executing an onTagdiscovered callback of the NFC unit by combining the read magnetic card data;
s06, releasing the interaction thread for driving the NFC unit, and completing the magnetic card identification work by the NFC unit.
As a possible implementation manner, further, in S02, when the NFC unit is in interworking, it creates a working file as a flag bit correspondingly, where the working state of the NFC unit is identified by determining the presence or absence of the working file in real time; in S06, when the interaction thread for driving the NFC unit is released, the work file is deleted.
As a possible implementation manner, further, the magnetic card is an identity card.
Based on the scheme, the invention provides an Android platform-based external password keyboard and identity card information interaction method, 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 both in communication connection with the POS machine, and the NFC platform-based information interaction method is further included.
As a preferred optional implementation manner, in S01, the POS machine establishes wired connection with the external password keyboard and the NFC unit through an RS-232 serial communication interface, then establishes an interaction thread to drive the NFC unit to perform magnetic card recognition work, or the POS machine establishes wired connection with the external password keyboard through the RS-232 serial communication interface, establishes wired connection with the NFC unit through the RS-232 serial communication interface, realizes indirect connection between the POS machine and the NFC unit, and then establishes the interaction thread to drive the NFC unit to perform magnetic card recognition work.
As a preferred alternative implementation, in S04, the POS machine sends data to the NFC unit through a preset app, and invokes the card seeking service thread.
As a preferred alternative embodiment, S04 preferably further includes: the current state of the app is obtained, and when the app is in a background running or not started, the working file generated in step S02 is cleared, that is, the flag bit is cleared, and the working state of the NFC unit is defaulted to be a closed state.
Based on the above scheme, the invention also provides a computer readable storage medium, wherein at least one instruction, at least one section of program, code set or instruction set is stored in the storage medium, and the at least one instruction, the at least one section of program, the code set or the instruction set is loaded and executed by a processor to realize the external password keyboard and identity card information interaction method based on the Android platform.
By adopting the technical scheme, compared with the prior art, the invention has the beneficial effects that: according to the scheme, customization demands are met on the POS machine based on the android system, the password keyboard and the NFC module (NFC unit) are arranged externally, the POS machine is connected with the password keyboard and the NFC unit through the RS-232 serial port, communication is conducted, operation is convenient, implementation is reliable, practical significance of specific use scenes is achieved, in addition, the magnetic card identification work start and thread release of the NFC unit can be achieved rapidly through the customized working mechanism, and the working efficiency and the working performance of the device are improved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a brief implementation of the interaction method of the present invention;
fig. 2 is a schematic diagram of a simple judgment flow for initializing the judgment of the working state of the NFC unit in the interaction method of the present invention;
FIG. 3 is a schematic logic sequence diagram of a NFC unit performing card seeking, apdu communication and callback in the interaction method of the present invention;
FIG. 4 is a schematic diagram of a hardware communication connection of the interactive method of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is specifically noted that the following examples are only for illustrating the present invention, but do not limit the scope of the present invention. Likewise, the following examples are only some, but not all, of the examples of the present invention, and all other examples, which a person of ordinary skill in the art would obtain without making any inventive effort, are within the scope of the present invention.
Based on fig. 1 and referring to fig. 4, the method for information interaction between an external password keyboard and an identity card based on an 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 method for information interaction comprises the following steps:
s01, establishing an interaction thread to drive an NFC unit to perform magnetic card identification work, wherein the magnetic card is an identity card, in the step, the POS machine establishes wired connection with an external password keyboard and the NFC unit through an RS-232 serial communication interface, and then establishes the interaction thread to drive the NFC unit to perform magnetic card identification work;
s02, referring to FIG. 2, judging the working state of the NFC unit to generate a judging result;
s03, acquiring a judgment result, and initializing the NFC unit when the NFC unit is in a non-information interaction state;
s04, referring to FIG. 3, the NFC unit enters a card searching state, when the card searching is successful, the random number of the apdu is obtained, and then 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 the apdu communication condition, and executing the onTagdiscovered callback of the NFC unit by combining the read magnetic card data, wherein in the step, when the apdu communication is successful, the onTagdiscovered callback value is non-null, and when the apdu communication is failed, the onTagdiscovered callback value is null, and the step S06 is carried out no matter whether the onTagdiscovered callback value is null or not;
s06, releasing an interaction thread for driving the NFC unit, wherein the NFC unit completes the magnetic card identification work, namely, the card searching, the activation and the random number acquisition are all completed, the processing thread is emptied, and the identification process of the identity card of the round is finished.
In order to facilitate the judgment of the working state of the NFC unit, in the present solution S02, when the NFC unit is in the interworking, it correspondingly creates a working file as a flag bit, where the working state of the NFC unit is identified by judging in real time whether the working file exists or not; in S06, when the interaction thread for driving the NFC unit is released, the work file is deleted.
The method and the device have the advantages that the zone bit is judged before each card identification, and if the zone bit has a value, the last interaction is not finished, and waiting is needed to be continued. Otherwise, the interactive thread is released, and a new round of card searching flow is started, as shown in fig. 2. In order to accurately position whether identification card identification is finished or not, the scheme adopts a file reading and writing mode to judge whether the previous transaction is finished or not. Creating a file and writing data when interaction starts, and judging that the previous interaction is still in progress if the file exists; if the file does not exist, the fact that the previous interaction is finished is judged, and the file is deleted while the interaction thread is released is achieved.
In order to facilitate the control operation, in step S04, the POS machine sends data to the NFC unit through a preset app, and invokes a card seeking service thread; preferably, S04 further includes: the method comprises the steps of obtaining the current state of the app, when the app is in background operation or not started, clearing a working file generated in step S02, namely clearing a flag bit, defaulting the working state of an NFC unit to be in a closed state, and in short, sending data to an NFC module (namely an NFC unit) connected with an external password keyboard by the POS machine through an application program, and calling a card searching service thread. Then, the card searching service executes SP100 tool class, the tool class encapsulates the data, and then the encapsulated data is transmitted to the JNI interface through serial port interfaces of the system, and the data is received, and the original path is returned. The application program of the POS machine is used as an initiator of the card identification flow, and the initiator can call up NFC service when the application is required to start and send NFC identification instructions. When the application is in the background or not started, the system will close the related service and empty the card interaction zone bit, and defaulting the NFC card identification function to be in a closed state.
The customization demand that this scheme realized on the POS based on android system carries out externally through password keyboard and NFC module, has realistic meaning to specific use scene, but adopts native NFC scheme to general transaction recognition occasion can solve the problem. On the basis, the scheme can set a specific identity-hardware configuration code for each POS machine. In order to distinguish customized machine types under different use scenes, the scheme can carry out classified configuration on the POS machine according to the hardware configuration code.
In addition to the above, the present solution may further include: s07, after identifying the card, obtaining the serial code or key information stored in the magnetic card (such as the identity card), docking the serial code or key information with a background database, and carrying out apdu identity card instruction communication to obtain the detailed information of the identity card.
In addition, each functional unit in each embodiment of the present invention may be integrated in one processing unit, each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the methods of 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, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing description is only a partial embodiment of the present invention, and is not intended to limit the scope of the present invention, and all equivalent devices or equivalent processes using the descriptions and the drawings of the present invention or directly or indirectly applied to other related technical fields are included in the scope of the present invention.
Claims (7)
1. An information interaction method based on NFC, which is characterized by comprising the following steps:
s01, establishing an interaction thread to drive an NFC unit to perform magnetic card identification work;
s02, judging the working state of the NFC unit, and generating a judging result;
s03, acquiring a judgment result, and initializing the NFC unit when the NFC unit is in a non-information interaction state;
s04, enabling the NFC unit to enter a card searching state, taking an apdu random number when the card searching is successful, further starting apdu communication, and simultaneously, enabling the NFC unit to send read magnetic card information to a POS machine and completing response interaction;
s05, acquiring an apdu communication condition, and executing an onTagdiscovered callback of the NFC unit by combining the read magnetic card data;
s06, releasing an interaction thread for driving the NFC unit, and completing the magnetic card identification work by the NFC unit;
in S02, when the NFC unit is in the interworking, it creates a working file as a flag bit, where the working state of the NFC unit is identified by determining the presence or absence of the working file in real time;
in S06, when the interaction thread for driving the NFC unit is released, the work file is deleted.
2. The NFC-based information interaction method according to claim 1, wherein the magnetic card is an identity card.
3. The information interaction method based on the NFC and the identity card 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 characterized by comprising the information interaction method based on the NFC as claimed in claim 2.
4. The Android platform-based external password keyboard and identity card information interaction method according to claim 3, 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 is in wired connection with the NFC unit through the RS-232 serial communication interface, indirect communication connection between the POS machine and the NFC unit is achieved, and then an interaction thread is established by the POS machine to drive the NFC unit to conduct magnetic card identification work.
5. The Android platform based external password keyboard and identity card information interaction method according to claim 4, wherein in S04, the POS machine sends data to the NFC unit through a preset app and invokes a card searching service thread.
6. The Android platform based external password keyboard and identity card information interaction method according to claim 5, wherein S04 further comprises: the current state of the app is obtained, and when the app is in a background running or not started, the working file generated in step S02 is cleared, that is, the flag bit is cleared, and the working state of the NFC unit is defaulted to be a closed state.
7. A computer-readable storage medium, characterized by: the storage medium stores at least one instruction, at least one section of program, code set or instruction set, and the at least one instruction, the at least one section of program, the code set or the instruction set is loaded and executed by the processor to realize the external password keyboard and identity card information interaction method based on the Android platform according to one of claims 3 to 6.
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 CN114330396A (en) | 2022-04-12 |
CN114330396B true 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)
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 |
-
2021
- 2021-12-31 CN CN202111680608.XA patent/CN114330396B/en active Active
Patent Citations (14)
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 |
---|---|
CN114330396A (en) | 2022-04-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9552579B2 (en) | Near field communication activation and authorization | |
US20180114260A1 (en) | System, method, apparatus and computer program product for interfacing a multi-card radio frequency (rf) device with a mobile communications device | |
RU2735093C2 (en) | Method and system of mobile payment | |
US11188893B2 (en) | Access control bypass on mobile for mass transit | |
US10885509B2 (en) | Bridge device for linking wireless protocols | |
EP2131313A1 (en) | Method for selecting an application in a mobile wireless communication device in an NFC system and corresponding mobile wireless communication device | |
JP2022524831A (en) | Context tapping engine | |
US20150242844A1 (en) | System and method for secure remote access and remote payment using a mobile device and a powered display card | |
CN110475233B (en) | Resource transfer method, device, computer equipment and storage medium | |
US20160239837A1 (en) | Method and system for facilitating a payment transaction with a mobile payment server | |
WO2018121366A1 (en) | Tee-based offline payment method, payment system thereof and mobile terminal | |
WO2019086045A1 (en) | Mobile terminal and receipt/payment method therefor, and device having storage function | |
US10810591B2 (en) | Virtual reality headset device and payment method | |
WO2017036249A1 (en) | Method and device using mobile terminal to make payment | |
CN102467708A (en) | Payment method, transaction origination terminal and transaction execution terminal | |
CN113052580A (en) | Method, system and terminal for processing payment by agency based on 5G message and biological recognition | |
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 | |
WO2020042794A1 (en) | Transaction device, method, and apparatus, server, and storage medium | |
US20240078581A1 (en) | Buyer initiated automatic seller account creation for item | |
CN111918264B (en) | Service menu display method and device | |
US20230042425A1 (en) | Intelligent real time card alert system to detect suspicious contactless card reader | |
EP3627419B1 (en) | Secure transaction using a mobile device | |
US11775961B2 (en) | Order and purchase integration | |
US20160180319A1 (en) | System and method for facilitating an online transaction with a mobile device |
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 |