A method and device for bridging application software and NFC reader / writer

By building middleware, the problem of missing communication specifications and user interfaces between MAC operating systems and NFC readers and writers is solved, effective communication between MAC operating systems and NFC readers and writers is realized, and the lack of standard user interfaces is filled. It has modules ization and scalability.

CN118377465BActive Publication Date: 2024-09-24KUNSHAN KIMD CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410798673.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-09-24
Estimated Expiration
2044-06-20

AI Technical Summary

Technical Problem

The lack of corresponding communication specifications and standard user interfaces between the MAC operating system and the NFC reader/writer results in the application software being unable to effectively communicate with the NFC reader/writer.

Method used

By building middleware, including NFC reader driver component and application software XML command interaction component, the connection and data interaction link between the MAC operating system and the NFC reader is established, and the XML format instructions are parsed into executable read and write instructions, and Packaging the returned data into XML format data fills the gap in the standard user interface.

Benefits of technology

It implements the communication specifications and user interface between the MAC operating system and NFC readers and writers, solves the problem of the lack of standard user interfaces between application software and NFC readers and writers, and has modularity independent of specific application software and readers. and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118377465B
    Figure CN118377465B
Patent Text Reader

Abstract

The present invention discloses a method and device for bridging application software and NFC reader / writer. The method comprises: constructing middleware, wherein the middleware comprises an NFC reader / writer driving component and an application software XML command interaction component; wherein the NFC reader / writer driving component is used to establish connection and communication between the middleware and the NFC reader / writer; the application software XML command interaction component is used to receive XML format instructions of application software installed in a MAC operating system, establish a data interaction link between the application software installed in the MAC operating system and the application software XML command interaction component, parse the instructions into executable read / write instructions of the NFC reader / writer, and then the NFC reader / writer driving component performs data interaction between the read / write instructions and the NFC reader / writer; and the application software installed in the MAC operating system calls the middleware.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of short-range wireless communication, and in particular to a method and a device for bridging application software and an NFC reader / writer. Background Art

[0002] NFC near field communication technology provides short-range wireless communication. NFC technology can be used for mobile payment, identity authentication, access control systems, etc. Currently, all application software that connects to NFC readers is based on the PC / SC specification. However, the PC / SC specification is a standard user interface (AP1) based on the WINDOWS platform, and there is no corresponding specification and standard user interface for communication between the MAC operating system and the NFC reader. Summary of the invention

[0003] In view of this, the present invention provides a method and device for bridging application software and NFC reader / writer, which can solve the technical problem of lack of corresponding communication specifications and user interface between MAC operating system and NFC reader / writer.

[0004] In order to solve the above technical problems, the present invention is implemented as follows.

[0005] A method for bridging application software and an NFC reader / writer, wherein the NFC reader / writer is connected to a USB port of hardware on which the MAC operating system is deployed via a USB cable, the method comprising:

[0006] Step S1: constructing middleware, the middleware includes an NFC reader / writer driver component and an application software XML command interaction component; wherein the NFC reader / writer driver component is used to establish connection and communication between the middleware and the NFC reader / writer; the application software XML command interaction component is used to receive XML format instructions of application software installed in the MAC operating system, establish a data interaction link between the application software installed in the MAC operating system and the application software XML command interaction component, parse the instructions into executable read and write instructions of the NFC reader / writer, and then the NFC reader / writer driver component exchanges data between the read and write instructions and the NFC reader / writer, and the NFC reader / writer driver component passes the return data obtained from the NFC reader / writer to the application software XML command interaction component, and the application software XML command interaction component packages the data into XML format data according to the protocol and returns it to the application software;

[0007] Step S2: the application software installed in the MAC operating system calls the middleware; wherein the middleware is installed in each application software.

[0008] Preferably, each NFC reader is connected to a USB port of the hardware on which the MAC operating system is deployed in turn, with each USB port serving as a workstation; a correspondence is established between the address of each NFC reader in the MAC system and the number of the workstation where the NFC reader is located; a dictionary is established based on the correspondence; in the dictionary, the workstation number is used as a primary key value, and the address of the NFC reader in the MAC system corresponding to the workstation number is used as a value, and a key-value pair is composed of the primary key value and the value, and the dictionary is converted into a plist file.

[0009] Preferably, the NFC reader / writer driver component includes a reader / writer matching submodule and a reader / writer function implementation submodule;

[0010] The reader / writer matching submodule monitors one or more NFC readers / writers connected to the MAC operating system, and for each NFC reader / writer: obtains the station number of the NFC reader / writer, obtains the address of the NFC reader / writer in the MAC system based on the dictionary, and thus communicates with the NFC reader / writer;

[0011] The reader / writer function implementation submodule is used to implement the NFC reader / writer function; obtain read / write instructions, perform data exchange between the read / write instructions and the NFC reader / writer, and pass the return data obtained from the NFC reader / writer to the application software XML command interaction component.

[0012] Preferably, the application software XML command interaction component includes an XML data parsing submodule, an XML data packaging submodule, an XML file processing interface, an XML format data processing interface, and a log path setting interface;

[0013] The processing XML file interface is used to establish a data interaction link between the application software installed in the MAC operating system and the application software XML command interaction component, and receive the XML file of the application software installed in the MAC operating system;

[0014] The XML format data processing interface is used to parse XML format instructions from an XML file;

[0015] The XML data parsing submodule is used to parse the instructions in the XML format into executable read and write instructions of the NFC reader / writer, and send the executable read and write instructions to the NFC reader / writer driver component;

[0016] The XML data packaging submodule is used to obtain the returned data or the data to be sent by the application software to the NFC reader / writer, package the returned data or the data to be sent by the application software to the NFC reader / writer into XML format data according to the protocol, and transmit the packaged XML format data through the data interaction link;

[0017] The log path setting interface is used by the application software to set the output path of the log.

[0018] Preferably, the middleware is a dynamic link library.

[0019] A device for bridging application software in a MAC operating system and an NFC reader / writer, wherein the NFC reader / writer is connected to a USB port of hardware on which the MAC operating system is deployed via a USB cable, the device comprising:

[0020] Configuration module: configured to build middleware, the middleware includes an NFC reader / writer driver component and an application software XML command interaction component; wherein the NFC reader / writer driver component is used to establish connection and communication between the middleware and the NFC reader / writer; the application software XML command interaction component is used to receive XML format instructions of the application software installed in the MAC operating system, establish a data interaction link between the application software installed in the MAC operating system and the application software XML command interaction component, parse the instructions into executable read and write instructions of the NFC reader / writer, and then the NFC reader / writer driver component exchanges data between the read and write instructions and the NFC reader / writer, the NFC reader / writer driver component passes the return data obtained from the NFC reader / writer to the application software XML command interaction component, and the application software XML command interaction component packages the data into XML format data according to the protocol and returns it to the application software;

[0021] Calling module: configured for application software installed in the MAC operating system to call the middleware; wherein the middleware is installed in each application software.

[0022] A computer-readable storage medium stores a plurality of instructions; the plurality of instructions are used for a processor to load and execute the method as described above.

[0023] An electronic device, comprising:

[0024] A processor, which is used to execute multiple instructions;

[0025] A memory for storing a plurality of instructions;

[0026] The plurality of instructions are used to be stored by the memory and loaded and executed by the processor to implement the method as described above.

[0027] Beneficial effects:

[0028] (1) The present invention proposes a method for bridging application software and NFC reader / writer, which implements a communication specification and user interface for MAC operating system and NFC reader / writer;

[0029] (2) The present invention solves the problem of the lack of a standard user interface (API) between the application software installed in the MAC operating system and the NFC reader / writer. The middleware generated by the method of bridging the application software and the NFC reader / writer fills the problem of the lack of a standard user interface (API) between the application software installed in the MAC operating system and the NFC reader / writer;

[0030] (3) The proposed method is independent of the specific application software and reader / writer, and has the advantages of modularity and scalability. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 It is a flowchart of a method for bridging application software and NFC reader / writer according to the present invention;

[0032] Figure 2 It is a schematic diagram of the architecture of the method for bridging application software and NFC reader / writer of the present invention;

[0033] Figure 3 The figure is a schematic diagram of the structure of the device used for bridging application software and NFC reader / writer according to the present invention. DETAILED DESCRIPTION

[0034] The present invention is described in detail below in conjunction with the accompanying drawings and embodiments.

[0035] like Figure 1-Figure 2 As shown, the present invention proposes a method for bridging application software in a MAC operating system and an NFC reader / writer, wherein the NFC reader / writer is connected to a USB port of hardware on which the MAC operating system is deployed via a USB cable, comprising:

[0036] Step S1: constructing middleware, the middleware includes an NFC reader / writer driver component and an application software XML command interaction component; wherein the NFC reader / writer driver component is used to establish connection and communication between the middleware and the NFC reader / writer; the application software XML command interaction component is used to receive XML format instructions of application software installed in the MAC operating system, establish a data interaction link between the application software installed in the MAC operating system and the application software XML command interaction component, parse the instructions into executable read and write instructions of the NFC reader / writer, and then the NFC reader / writer driver component exchanges data between the read and write instructions and the NFC reader / writer, and the NFC reader / writer driver component passes the return data obtained from the NFC reader / writer to the application software XML command interaction component, and the application software XML command interaction component packages the data into XML format data according to the protocol and returns it to the application software;

[0037] Step S2: the application software installed in the MAC operating system calls the middleware; wherein the middleware is installed in each application software.

[0038] The mechanism of communication between other types of operating systems, especially the WINDOWS operating system, and the NFC reader is that the application software only needs to call the user interface (API) that has been developed and embedded in the operating system to complete the data interaction with the reader. However, since the MAC operating system is completely closed, developers cannot develop a user interface (API) embedded in the operating system. The above method is not applicable to the MAC operating system. Therefore, the present invention is specifically used for the MAC operating system. In addition, the user interface (API) embedded in the operating system is usually used to develop application software by using a large number of APIs provided by the system, through which the NFC reader can be directly controlled to operate the smart card (electronic tag). For example: establish a connection using the function SCardConnect; start transaction processing using the function SCardBeginTransaction; perform transaction processing using the function SCardTransmit; end transaction processing using the function SCardEndTransaction; disconnect using the function SCardDisconnect, etc., based on calling a rich API to complete application software development, its principle is different from the present application.

[0039] An application scenario of the present invention, for example, is a MAC operating system terminal installed with application software including the middleware, the application software calls the middleware, passes the requested XML format data to the middleware, the middleware parses the XML format data into function codes and parameters executable by a specific NFC reader, packages the function codes and parameters according to the NFC reader standard protocol and performs CRC check, and then sends them to the reader through a USB port. After receiving the packaged data, the NFC reader performs a specific functional operation and returns the data read from the NFC device or the execution result to the middleware, the middleware parses the data returned by the reader, packages it into XML format data and returns it to the application software.

[0040] The middleware is a dynamic link library, and the hardware on which the MAC operating system is deployed is, for example, a computer.

[0041] Connect each NFC reader / writer to the USB port of the hardware on which the MAC operating system is deployed in turn, with each USB port serving as a workstation; establish a correspondence between the address of each NFC reader / writer in the MAC system and the number of the workstation where the NFC reader / writer is located; establish a dictionary based on the correspondence; in the dictionary, the number of the workstation is used as a primary key value, and the address of the NFC reader / writer in the MAC system corresponding to the number of the workstation is used as a value, and a key-value pair is composed of the primary key value and the value, and the dictionary is converted into a plist file.

[0042] Furthermore, based on the vendor identification code (VID) and the product identification code (PID), the NFC reader / writer not recorded in the dictionary is determined, the address of the NFC reader / writer not recorded in the dictionary in the MAC system and the number of the workstation where the NFC reader / writer is located are obtained, and the dictionary is updated; when the dictionary is updated, a new plist file is generated; the plist file is a file format of the MAC operating system.

[0043] The NFC reader / writer driver component includes a reader / writer matching submodule and a reader / writer function implementation submodule.

[0044] The reader matching submodule monitors one or more NFC readers connected to the MAC operating system, and for each NFC reader: obtains the station number of the NFC reader, obtains the address of the NFC reader in the MAC system based on the dictionary, and thus communicates with the NFC reader.

[0045] The reader / writer function realization submodule is used to realize the NFC reader / writer function; obtain read / write instructions, perform data exchange between the read / write instructions and the NFC reader / writer, and pass the return data obtained from the NFC reader / writer to the application software XML command interaction component. The NFC reader / writer function also includes opening and closing the NFC reader / writer, RF reset, anti-collision, sending APDU data, sending transparent data, deleting tags, etc.

[0046] The application software XML command interaction component includes an XML data parsing submodule, an XML data packaging submodule, an XML file processing interface, an XML format data processing interface, and a log path setting interface.

[0047] The processing XML file interface is used to establish a data interaction link between the application software installed in the MAC operating system and the application software XML command interaction component, and receive the XML file of the application software installed in the MAC operating system.

[0048] The XML format data processing interface is used to parse XML format instructions from an XML file.

[0049] The XML data parsing submodule is used to parse the instructions in the XML format into executable read and write instructions for the NFC reader / writer, and send the executable read and write instructions to the NFC reader / writer driver component.

[0050] The XML data packaging submodule is used to obtain the returned data or the data to be sent by the application software to the NFC reader / writer, package the returned data or the data to be sent by the application software to the NFC reader / writer into XML format data according to the protocol, and realize the transmission of the packaged XML format data through the data interaction link.

[0051] The log path setting interface is used by the application software to set the output path of the log.

[0052] like Figure 3 As shown, the present invention proposes a device for bridging application software and NFC reader / writer, comprising:

[0053] Configuration module: configured to build middleware, the middleware includes an NFC reader / writer driver component and an application software XML command interaction component; wherein the NFC reader / writer driver component is used to establish connection and communication between the middleware and the NFC reader / writer; the application software XML command interaction component is used to receive XML format instructions of the application software installed in the MAC operating system, establish a data interaction link between the application software installed in the MAC operating system and the application software XML command interaction component, parse the instructions into executable read and write instructions of the NFC reader / writer, and then the NFC reader / writer driver component exchanges data between the read and write instructions and the NFC reader / writer, the NFC reader / writer driver component passes the return data obtained from the NFC reader / writer to the application software XML command interaction component, and the application software XML command interaction component packages the data into XML format data according to the protocol and returns it to the application software;

[0054] Calling module: configured for application software installed in the MAC operating system to call the middleware; wherein the middleware is installed in each application software.

[0055] The above specific embodiments only describe the design principle of the present invention. The shapes and names of the components in the description may be different and are not limited. Therefore, those skilled in the art in the field of the present invention may modify or replace the technical solutions recorded in the above embodiments; and these modifications and replacements do not deviate from the creative purpose and technical solutions of the present invention and should all fall within the protection scope of the present invention.

Claims

1. A method for bridging application software in a MAC operating system and an NFC reader / writer, wherein the NFC reader / writer is connected to a USB port of hardware on which the MAC operating system is deployed via a USB cable, It is characterized in that Methods include: Step S1: constructing middleware, the middleware includes an NFC reader / writer driver component and an application software XML command interaction component; wherein the NFC reader / writer driver component is used to establish connection and communication between the middleware and the NFC reader / writer; the application software XML command interaction component is used to receive XML format instructions of application software installed in the MAC operating system, establish a data interaction link between the application software installed in the MAC operating system and the application software XML command interaction component, parse the instructions into executable read and write instructions of the NFC reader / writer, and then the NFC reader / writer driver component exchanges data between the read and write instructions and the NFC reader / writer, and the NFC reader / writer driver component passes the return data obtained from the NFC reader / writer to the application software XML command interaction component, and the application software XML command interaction component packages the data into XML format data according to the protocol and returns it to the application software; Step S2: the application software installed in the MAC operating system calls the middleware; wherein the middleware is installed in each application software; Connecting each NFC reader / writer to a USB port of the hardware on which the MAC operating system is deployed in sequence, with each USB port serving as a workstation; establishing a correspondence between the address of each NFC reader / writer in the MAC system and the number of the workstation where each NFC reader / writer is located; establishing a dictionary based on the correspondence; in the dictionary, the number of the workstation is used as a primary key value, and the address of the NFC reader / writer in the MAC system corresponding to the number of the workstation is used as a value, and a key-value pair is composed of the primary key value and the value, and the dictionary is converted into a plist file; The NFC reader driver component includes a reader matching submodule and a reader function implementation submodule; The reader / writer matching submodule monitors one or more NFC readers / writers connected to the MAC operating system, and for each NFC reader / writer: obtains the station number of the NFC reader / writer, obtains the address of the NFC reader / writer in the MAC system based on the dictionary, and thus communicates with the NFC reader / writer; The reader / writer function implementation submodule is used to implement the NFC reader / writer function; obtain read / write instructions, perform data exchange between the read / write instructions and the NFC reader / writer, and pass the return data obtained from the NFC reader / writer to the application software XML command interaction component.

2. The method according to claim 1, It is characterized in that The application software XML command interaction component includes an XML data parsing submodule, an XML data packaging submodule, an XML file processing interface, an XML format data processing interface, and a log path setting interface; The processing XML file interface is used to establish a data interaction link between the application software installed in the MAC operating system and the application software XML command interaction component, and receive the XML file of the application software installed in the MAC operating system; The XML format data processing interface is used to parse XML format instructions from an XML file; The XML data parsing submodule is used to parse the instructions in the XML format into executable read and write instructions of the NFC reader / writer, and send the executable read and write instructions to the NFC reader / writer driver component; The XML data packaging submodule is used to obtain the returned data or the data to be sent by the application software to the NFC reader / writer, package the returned data or the data to be sent by the application software to the NFC reader / writer into XML format data according to the protocol, and transmit the packaged XML format data through the data interaction link; The log path setting interface is used by the application software to set the output path of the log.

3. The method according to any one of claims 1 to 2, It is characterized in that The middleware is a dynamic link library.

4. A device for bridging application software in a MAC operating system and an NFC reader / writer, wherein the NFC reader / writer is connected to a USB port of hardware on which the MAC operating system is deployed via a USB cable, It is characterized in that The device includes: Configuration module: configured to build middleware, the middleware includes an NFC reader / writer driver component and an application software XML command interaction component; wherein the NFC reader / writer driver component is used to establish connection and communication between the middleware and the NFC reader / writer; the application software XML command interaction component is used to receive XML format instructions of the application software installed in the MAC operating system, establish a data interaction link between the application software installed in the MAC operating system and the application software XML command interaction component, parse the instructions into executable read and write instructions of the NFC reader / writer, and then the NFC reader / writer driver component exchanges data between the read and write instructions and the NFC reader / writer, the NFC reader / writer driver component passes the return data obtained from the NFC reader / writer to the application software XML command interaction component, and the application software XML command interaction component packages the data into XML format data according to the protocol and returns it to the application software; Calling module: configured to call middleware from application software installed in the MAC operating system; wherein the middleware is installed in each application software; Connecting each NFC reader / writer to a USB port of the hardware on which the MAC operating system is deployed in sequence, with each USB port serving as a workstation; establishing a correspondence between the address of each NFC reader / writer in the MAC system and the number of the workstation where each NFC reader / writer is located; establishing a dictionary based on the correspondence; in the dictionary, the number of the workstation is used as a primary key value, and the address of the NFC reader / writer in the MAC system corresponding to the number of the workstation is used as a value, and a key-value pair is composed of the primary key value and the value, and the dictionary is converted into a plist file; The NFC reader driver component includes a reader matching submodule and a reader function implementation submodule; The reader / writer matching submodule monitors one or more NFC readers / writers connected to the MAC operating system, and for each NFC reader / writer: obtains the station number of the NFC reader / writer, obtains the address of the NFC reader / writer in the MAC system based on the dictionary, and thus communicates with the NFC reader / writer; The reader / writer function implementation submodule is used to implement the NFC reader / writer function; obtain read / write instructions, perform data exchange between the read / write instructions and the NFC reader / writer, and pass the return data obtained from the NFC reader / writer to the application software XML command interaction component.

5. A computer-readable storage medium, It is characterized in that The storage medium stores a plurality of instructions; the plurality of instructions are used by a processor to load and execute the method as described in any one of claims 1 to 3.

6. An electronic device, It is characterized in that The electronic device comprises: A processor, which is used to execute multiple instructions; A memory for storing a plurality of instructions; The plurality of instructions are used to be stored in the memory and loaded and executed by the processor according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • RFID integration machine

    CN101344931A

  • Secondary development method and development system of handheld reader-writer

    CN102004638A

  • Radio frequency identification middleware integrated method based on extensible markup language

    CN102622231A

  • Track traffic automatic fare collection system reader-writer middleware

    CN104714804A

  • Workshop data acquisition RFID middleware system

    CN113298199A