Virtual card reader debugging method, system, device and equipment and storage medium

Through dynamic library files and port technology, smart card virtual card reader debugging without additional installation of driver software is realized, solving the problems of complexity and poor versatility of the existing technology, and providing a simple and efficient debugging method.

CN118916273APending Publication Date: 2024-11-08CHINA UNITED NETWORK COMM GRP CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410954686.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-16
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

The debugging technology of existing smart card virtual card readers is complex and requires additional driver software to be installed. It has poor versatility and is difficult to achieve simple debugging operations.

Method used

By obtaining dynamic library files, using its encapsulated functions to realize communication connection between the host computer and the virtual card reader, sending data information for debugging, and receiving debugging results, avoiding additional installation of driver software, and using ports to perform virtual card reader and virtual card System data interaction.

Benefits of technology

It realizes simple and versatile virtual card reader debugging without additional driver software. It realizes communication and debugging between the host computer and the virtual card reader through dynamic library files and ports, improving debugging efficiency and application sex.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118916273A_ABST
    Figure CN118916273A_ABST
Patent Text Reader

Abstract

The invention provides a virtual card reader debugging method, system and device, equipment and a storage medium, and relates to the technical field of equipment communication. The method comprises the following steps: acquiring a dynamic library file, and adding a virtual card reader according to the dynamic library file so as to realize communication connection between software of an upper computer and the virtual card reader; sending data information to the virtual card reader; wherein the data information is data used for indicating software of the upper computer to debug the virtual card system; the virtual card system refers to an intelligent card operating system; and receiving information returned after the virtual card reader processes the data information, and taking the returned information as a debugging result. According to the method provided by the invention, on the premise of not additionally installing driving software, the debugging operation of the virtual card reader is simple and convenient, and the universality is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of device communication technology, and in particular to a method, system, device, equipment and storage medium for implementing virtual card reader debugging. Background Art

[0002] A smart card is a plastic card with a microelectronic chip embedded in it. The application range of smart cards is very wide, covering many fields such as mobile communications, public transportation and health care. Due to its portability, security and versatility, smart cards have become an indispensable part of today's society. However, the virtual card system used to read and interact with smart cards is mainly implemented by various smart card developers. There is no unified open source system, which makes the processing of smart card data and other functions complicated.

[0003] Currently, most methods for implementing virtual electronic card communication are based on the socket communication protocol to exchange data between the virtual electronic card and the host computer; or use the socket communication protocol and the circuit to complete the data interaction. However, this type of implementation is relatively complicated, requires the installation of driver software in advance, and has poor versatility.

[0004] How to realize the virtual card reader debugging and operation is simple and versatile without installing additional driver software is a problem that the present invention urgently needs to solve. Summary of the invention

[0005] The present application provides a method, system, device, equipment and storage medium for implementing virtual card reader debugging, which is used to solve the problem of simple and versatile virtual card reader debugging without installing additional driver software.

[0006] In a first aspect, the present application provides a method for implementing virtual card reader debugging, which is applied to a host computer, and the method includes:

[0007] Obtain the dynamic library file, and add the virtual card reader according to the dynamic library file to realize the communication connection between the software of the host computer and the virtual card reader;

[0008] Sending data information to the virtual card reader; wherein the data information is data used to instruct the software of the host computer to debug the virtual card system; the virtual card system refers to the smart card operating system;

[0009] Receive the information returned by the virtual card reader after processing the data information, and use the returned information as the debugging result.

[0010] In a possible design, a virtual card reader is added according to a dynamic library file, including:

[0011] According to the first function in the dynamic library file corresponding to the software of the host computer, a virtual card list is obtained;

[0012] Add a virtual card reader based on the virtual card list.

[0013] In a possible design, data information is sent to the virtual card reader, including:

[0014] When the communication connection between the software of the host computer and the virtual card reader is successful, the ATR data returned by the virtual card reader is obtained to verify whether the communication connection between the virtual card reader and the virtual card system is correct according to the ATR data;

[0015] When the virtual card reader and the virtual card system are correctly connected in communication, data information is sent to the virtual card reader; wherein the data information refers to application protocol data unit data information.

[0016] In a second aspect, the present application provides a method for implementing virtual card reader debugging, which is applied to a virtual card reader, and the method includes:

[0017] Create a port, send a command for obtaining ATR data to the virtual card system through the port, and obtain the ATR data returned by the virtual card system;

[0018] The ATR data is sent to the software of the host computer, and the acquired data information is sent to the virtual card system; wherein the data information refers to the application protocol data unit data information;

[0019] Receive the information returned by the virtual card system after processing the data information, and send the information returned by the virtual card system after processing the data information to the software of the host computer.

[0020] In one possible design, the port includes a socket data port and a socket control port, wherein the socket control port is used to indicate status communication between the virtual card reader and the virtual card system; the socket data port is used to indicate data communication between the virtual card reader and the virtual card system;

[0021] The dynamic library file includes a first function, a second function, a third function and a fourth function;

[0022] The first function is generated according to the SCardListReadersA function and the ScardListReadersW function; the first function is used to instruct to add the card reader name to the card reader list, so as to add the virtual card reader according to the card reader list;

[0023] The second function is obtained according to the SCardConnectA and ScardConnectW functions; the second function is used to establish the connection between the software of the host computer and the virtual card reader;

[0024] The third function is generated according to the ScardDisconnect function; the third function is used to indicate the disconnection mode between the software of the host computer and the virtual card reader;

[0025] The fourth function is generated according to the ScardTransmit function; the fourth function is used to instruct the software of the host computer and the virtual card reader on the data transmission method.

[0026] In a possible design, an instruction for obtaining ATR data is sent to the virtual card system through a port to obtain the ATR data returned by the virtual card system, including:

[0027] Start the virtual card system and listen to the socket data port and socket control port to receive the command of the virtual card reader;

[0028] Sending a hot reset instruction to the virtual card system through the socket control port; wherein the hot reset instruction is used to indicate an instruction for obtaining ATR data;

[0029] Get the ATR data returned by the virtual card system through the socket data port.

[0030] In one possible design, the ATR data is sent to the software of the host computer, and the acquired data information is sent to the virtual card system, including:

[0031] The ATR data is sent to the host computer software through the second function;

[0032] The data information sent by the software of the host computer is obtained through the fourth function, and the data information is sent to the virtual card system through the socket data port.

[0033] In a possible design, receiving information returned by the virtual card system after processing data information, and sending the information returned by the virtual card system after processing data information to the software of the host computer includes:

[0034] Receiving information returned by the virtual card system after processing the data information through the socket data port, and sending the information returned by the virtual card system after processing the data information to the software of the host computer through the fourth function;

[0035] After sending the information returned by the virtual card system after processing the data information to the software of the host computer through the fourth function, the method further includes:

[0036] When receiving the disconnection instruction sent by the software of the host computer, the port is closed and the return information of the disconnection is returned; wherein the disconnection instruction is sent by the software of the host computer through the third function.

[0037] In a third aspect, the present application provides a virtual card reader debugging system, comprising: a host computer and a virtual card reader;

[0038] The virtual machine is used to implement a method for debugging a virtual card reader according to the first aspect of the invention, and the virtual card reader is used to implement a method for debugging a virtual card reader according to the second aspect of the invention.

[0039] In a fourth aspect, the present application provides a device for implementing virtual card reader debugging, the device is applied to a host computer, and the device includes:

[0040] The acquisition module is used to acquire the dynamic library file and add the virtual card reader according to the dynamic library file to realize the communication connection between the software of the host computer and the virtual card reader;

[0041] A data information module is used to send data information to the virtual card reader; wherein the data information is data used to instruct the software of the host computer to debug the virtual card system; the virtual card system refers to the smart card operating system;

[0042] The debugging module is used to receive information returned by the virtual card reader after processing data information, and use the returned information as the debugging result.

[0043] In a fifth aspect, the present application provides a device for implementing virtual card reader debugging, the device is applied to the virtual card reader, and the device includes:

[0044] A port creation module is used to create a port, send an instruction for obtaining ATR data to the virtual card system through the port, and obtain the ATR data returned by the virtual card system;

[0045] A data sending module is used to send ATR data to the software of the host computer, and send the acquired data information to the virtual card system; wherein the data information refers to the application protocol data unit data information;

[0046] The data receiving module is used to receive the information returned by the virtual card system after processing the data information, and send the information returned by the virtual card system after processing the data information to the software of the host computer.

[0047] In a sixth aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0048] Memory stores computer-executable instructions;

[0049] The processor executes the computer-executable instructions stored in the memory to implement the first invention content and a method for implementing virtual card reader debugging in the second invention content.

[0050] In a seventh aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the invention content of the first aspect and a method for implementing virtual card reader debugging of the second aspect.

[0051] In an eighth aspect, the present application provides a computer program product, including: a computer program, which, when executed by a processor, is used to implement the first aspect of the invention and a method for implementing virtual card reader debugging of the second aspect of the invention.

[0052] The present application provides a method, system, device, equipment and storage medium for implementing virtual card reader debugging, which obtains a dynamic library file, and adds a virtual card reader according to the dynamic library file to realize the communication connection between the software of the host computer and the virtual card reader; sends data information to the virtual card reader; wherein the data information is data used to instruct the software of the host computer to debug the virtual card system; the virtual card system refers to the smart card operating system; receives the information returned by the virtual card reader after processing the data information, and uses the returned information as the debugging result. The following technical effects are achieved: the dynamic library file contains multiple re-packaged functions, which respectively implement different functions. These functions can realize the communication between the host computer and the virtual card reader and the debugging of the virtual card system by the host computer software; the functions in the dynamic library file can be used to verify the correct connection of the virtual card system and transfer data, and this data is used as the data that needs to be debugged, and the host computer software and the virtual card reader are connected by the dynamic library file; the communication between the virtual card reader and the virtual card system is realized by using the port, and the communication between the host computer software and the virtual card reader is realized by using the dynamic library file, so that there is no need to install driver software and write programs to realize communication debugging, and it has strong versatility. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0054] Figure 1 A system architecture framework diagram for implementing a virtual card reader debugging method provided in an embodiment of the present application;

[0055] Figure 2 Schematic diagram of the process of implementing the virtual card reader debugging method provided in the embodiment of the present application Figure 1 ;

[0056] Figure 3Schematic diagram of the process of implementing the virtual card reader debugging method provided in the embodiment of the present application Figure 2 ;

[0057] Figure 4 Schematic diagram of the process of implementing the virtual card reader debugging method provided in the embodiment of the present application Figure 3 ;

[0058] Figure 5 Schematic diagram of the process of implementing the virtual card reader debugging method provided in the embodiment of the present application Figure 4 ;

[0059] Figure 6 An interactive schematic diagram of a method for implementing a virtual card reader debugging method provided in an embodiment of the present application;

[0060] Figure 7 A schematic diagram of the structure of a virtual card reader debugging system provided in an embodiment of the present application;

[0061] Figure 8 A schematic diagram of a virtual card reader debugging device provided in an embodiment of the present application Figure 1 ;

[0062] Fig. 9 A schematic diagram of a virtual card reader debugging device provided in an embodiment of the present application Figure 2 ;

[0063] Fig.10 A schematic diagram of the structure of the electronic device hardware provided in an embodiment of the present application.

[0064] Reference numerals:

[0065] 100-host computer software; 110-virtual card reader 1; 120-virtual card system;

[0066] 710-host computer; 720-virtual card reader 2;

[0067] 810-acquisition module; 820-data information module; 830-debugging module;

[0068] 910-port creation module; 920-data sending module; 930-data receiving module;

[0069] 1010 - processor; 1020 - memory; 1030 - communication component; 1040 - bus. DETAILED DESCRIPTION

[0070] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0071] In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with basically the same functions and effects. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit the difference. It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design schemes. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way. In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more.

[0072] It should be noted that the "at..." in the embodiment of the present application can be the instant when a certain situation occurs, or can be a period of time after a certain situation occurs, and the embodiment of the present application does not specifically limit this. In addition, the method for implementing virtual card reader debugging provided in the embodiment of the present application is only an example, and the method for implementing virtual card reader debugging can also include more or less content.

[0073] In order to clearly describe the technical solutions of the embodiments of the present application, some terms and technologies involved in the embodiments of the present application are briefly introduced below:

[0074] Smart card: A card with a microelectronic chip embedded in it. It usually looks like a credit card and has the ability to store and process data. These cards can not only store information, but also perform certain computing tasks. Smart cards need to be read and written to exchange data.

[0075] Smart card system: Smart card system is a comprehensive technical solution for data storage and processing using smart cards. It combines hardware, software and communication technologies to achieve secure identity authentication, data protection and transaction management. It is mainly used to receive and process various information sent to smart cards by the outside world (such as mobile phones or card readers), execute various instructions sent by the outside world, manage the memory space in the card, and send response information back to the outside world.

[0076] Virtual card system: Virtual smart card system, also known as virtual card system in Chinese, is a smart card operating system that can simulate smart card-related processing behaviors and logic.

[0077] Virtual card reader: A virtual card reader is a software or hardware solution that simulates the functionality of a physical card reader, allowing a computer or other electronic device to read information from a smart card, magnetic stripe card tag, or other type of card, even without the physical card reader hardware. It is used to implement communication between the virtual card system and the host computer software.

[0078] Host computer software: software that can communicate with the virtual card reader and debug the virtual card system.

[0079] Answer To Reset (ATR): In smart card and RFID (radio frequency identification) technology, ATR refers to a series of data sent from a smart card to a card reader after a device reset. The ATR data contains information about the smart card, such as its communication rate, protocol characteristics, etc., which is essential for the reader to communicate with the smart card correctly.

[0080] Application Protocol Data Unit (APDU) is a basic information unit used to transmit commands and responses between a smart card and an external device (such as a smart card reader).

[0081] 7816 protocol: 7816 protocol is a series of standards jointly developed by the International Organization for Standardization (ISO) and the International Electrotechnical Commission (IEC), mainly used to regulate the communication between smart cards (IC cards) and card readers (or interface devices). This series of standards covers many aspects, including the physical characteristics, electrical characteristics, command sets and application program interfaces of smart cards.

[0082] Dynamic Link Library: It is a part of the Microsoft Windows operating system and is mainly used for smart card related functions.

[0083] Dynamic library file: The dynamic library file of this application repackages some functions based on the dynamic link library to facilitate the presentation of the implementation effect of this application.

[0084] ScardListReadersA function and ScardListReadersW function: Both functions return a list of card reader names using a character set.

[0085] ScardConnectA and SCardConnectW are part of the PC / SC (Personal Computer / SmartCard) specification and are used to establish a connection with a smart card reader in a smart card application. The main function of these two functions is to open a handle to a smart card reader and allow the application to communicate with the smart card through this handle.

[0086] SCardReconnect function: SCardReconnect function is an API function defined in the PC / SC (Personal Computer / SmartCard) standard, which is used to re-establish the connection between the smart card application and the smart card. This function allows the application to change the sharing mode or communication protocol with the smart card, or to restore the connection when an error occurs during the connection process.

[0087] SCardDisconnect function: SCardDisconnect function is an important function in the smart card API (PC / SC specification) and is used to disconnect the smart card. When the application completes all interactions with the smart card, this function should be called to release the smart card reader resources and ensure that the smart card returns to a state that can be accessed by other applications.

[0088] SCardStatusA and SCardStatusW functions: SCardStatusA and SCardStatusW functions are part of the smart card API (PC / SC specification) and are used to query the status information of the smart card. These two functions allow the application to obtain detailed information about the currently connected smart card, including the name of the card reader, the status of the smart card, and some related protocols and communication parameters.

[0089] SCardTransmit function: SCardTransmit function is a key function in the smart card API (PC / SC specification) used to send and receive data between smart cards and applications. It is one of the core mechanisms for data exchange in smart card programming, enabling applications to interact with applications on smart cards and perform operations such as identity authentication, data reading and writing, and command response.

[0090] Currently, the application scope of smart cards is very wide, covering many fields such as mobile communications, public transportation and healthcare. Due to their portability, security and versatility, smart cards have become an indispensable part of today's society.

[0091] The existing virtual card systems corresponding to smart cards or electronic cards are all implemented by various smart card developers, and there is no unified open source platform. Nowadays, the methods for realizing virtual electronic card communication mainly include: calling the created circuit, and cooperating with the socket communication protocol to realize the communication and reading and writing between the electronic card and the host computer software.

[0092] However, there are the following technical problems:

[0093] First, existing smart cards and electronic matching virtual card systems are all developed by smart card developers. Different cards correspond to different systems, and there is no unified platform for management, resulting in low versatility.

[0094] Secondly, the existing virtual card reader technology is generally complex to implement, requiring additional installation of driver software and programming of system drivers, and the implementation method is relatively complex, and the virtual card system debugging process is complicated.

[0095] Therefore, how to realize the virtual card reader debugging operation is simple and versatile without installing additional driver software is a problem that the present invention needs to solve urgently.

[0096] Based on this, the embodiments of the present application provide a method, system, device, equipment and storage medium for implementing virtual card reader debugging, which can be used in the field of device communication technology, aiming to solve the above technical problems of the prior art.

[0097] Figure 1 A schematic diagram of the system architecture for implementing the virtual card reader debugging method provided in the embodiment of the present application. The system architecture diagram can be used in the various scenarios described below, and can also be used in other scenarios not specified. The virtual card system, virtual card reader, and host computer software shown in the figure are not actual devices, and are drawn separately for easy distinction.

[0098] like Figure 1 As shown, when the dynamic library file is placed in the software folder of the host computer software 100, the card reader list is obtained through the dynamic library file, and the name of the virtual card reader 110 is added, and finally the communication connection between the host computer software 100 and the virtual card reader 110 is realized; thus, the virtual card reader can realize the instructions and data interaction between the host computer software 100 and the virtual card reader through the functions in the dynamic library file.

[0099] The virtual card system 120 obtains the instruction or data sent by the virtual card reader 110 by listening to the data port and the control port, and then sends the processed data to the virtual card reader 110 through the port. The virtual card reader 110 sends the data to the host computer software 100, thereby completing the debugging of the virtual card system 120 by the host computer software 100.

[0100] Figure 2Schematic diagram of the process of implementing the virtual card reader debugging method provided in the embodiment of the present application Figure 1 .like Figure 2 As shown, the method includes:

[0101] S201, obtaining a dynamic library file, and adding a virtual card reader according to the dynamic library file to achieve communication connection between the software of the host computer and the virtual card reader.

[0102] Specifically, obtain the dynamic library file, and implement the virtual card reader function according to the dynamic library file, add your own virtual card reader name, so as to realize the communication connection between the host computer software and the virtual card reader.

[0103] S202: Send data information to the virtual card reader.

[0104] The data information is data used to instruct the software of the host computer to debug the virtual card system; the virtual card system refers to the smart card operating system.

[0105] Specifically, the host computer software sends data for debugging the virtual card system to the virtual card reader.

[0106] S203, receiving information returned by the virtual card reader after processing the data information, and using the returned information as a debugging result;

[0107] Specifically, the information returned by the receiving virtual card reader after processing the data information is the data after the upper computer software debugs the virtual card system.

[0108] The present application provides a method for implementing virtual card reader debugging, obtaining a dynamic library file, and adding a virtual card reader according to the dynamic library file to realize the communication connection between the host computer software and the virtual card reader; sending data information to the virtual card reader; wherein the data information is data used to instruct the host computer software to debug the virtual card system; the virtual card system refers to the smart card operating system; receiving the information returned by the virtual card reader after processing the data information, and using the returned information as the debugging result. The following technical effects are achieved: the dynamic library file contains multiple repackaged functions, which respectively realize different functions, and these functions can realize the communication between the host computer and the virtual card reader and the debugging of the virtual card system by the host computer software; the functions in the dynamic library file can be used to verify the correct connection of the virtual card system and transfer data, and this data is used as the data that needs to be debugged, and the host computer software and the virtual card reader are connected with the dynamic library file; the communication between the virtual card reader and the virtual card system is realized by using the port, and the communication between the host computer software and the virtual card reader is realized by using the dynamic library file, so that there is no need to install additional driver software and write programs to realize communication debugging, and the versatility is strong.

[0109] Figure 3 Schematic diagram of the process of implementing the virtual card reader debugging method provided in the embodiment of the present application Figure 2 In this embodiment Figure 2 Based on the embodiment, a method for implementing virtual card reader debugging applied to a host computer is described in detail, such as Figure 3 As shown, this embodiment provides a method for implementing virtual card reader debugging, including:

[0110] S301, obtaining a dynamic library file.

[0111] Specifically, the dynamic library file is a re-encapsulation of the functions in the dynamic link library. The dynamic library file at this time is obtained.

[0112] S302: Obtain a virtual card list according to the first function in the dynamic library file corresponding to the software of the host computer.

[0113] Specifically, the path of the dynamic library file is identified, and based on the path, the dynamic library file corresponding to the software of the host computer with the same path can be preferentially identified.

[0114] The virtual card reader list is obtained through the dynamic library file, and the dynamic library file obtains the card list corresponding to the upper computer software according to the first function.

[0115] S303: Add a virtual card reader according to the virtual card list.

[0116] Specifically, add the virtual card reader you need based on the obtained virtual card reader list.

[0117] S304: When the communication connection between the software of the host computer and the virtual card reader is successful, the ATR data returned by the virtual card reader is obtained to verify whether the communication connection between the virtual card reader and the virtual card system is correct according to the ATR data.

[0118] Specifically, when the host computer software and the virtual card reader are successfully connected, a command to obtain ATR data is sent to the virtual card reader, and the ATR data returned by the virtual card reader is obtained. According to the returned ATR data, the host computer can verify through the function of the dynamic library file to check whether the connection is correct.

[0119] S305: When the virtual card reader and the virtual card system are correctly connected in communication, data information is sent to the virtual card reader.

[0120] The data information refers to the application protocol data unit data information.

[0121] Specifically, when the virtual card reader and the virtual card system are correctly communicated and connected, APDU data is sent to the virtual card reader.

[0122] The embodiment of the present application provides a method for implementing virtual card reader debugging applied to a host computer, which utilizes a dynamic library file to implement a virtual card reader function, thereby solving the communication debugging problem between the host computer software and the virtual card system.

[0123] Figure 4 Schematic diagram of the process of implementing the virtual card reader debugging method provided in the embodiment of the present application Figure 3 In this embodiment Figure 2 Based on the embodiment, a method for debugging a virtual card reader applied to a virtual card reader is described in detail. Figure 4 As shown, this embodiment provides a method for implementing virtual card reader debugging, including:

[0124] S401. Create a port, send an instruction for obtaining ATR data to the virtual card system through the port, and obtain the ATR data returned by the virtual card system.

[0125] Specifically, a port is created, and an instruction is sent to the virtual card system through the port, wherein the instruction is to obtain ATR data, and the ATR data of the virtual card system is obtained.

[0126] S402, sending the ATR data to the software of the host computer, and sending the acquired data information to the virtual card system.

[0127] The data information refers to the application protocol data unit data information.

[0128] Specifically, the acquired ATR data is sent to the host computer software, and the data information sent from the host computer software is received, and the data information is sent to the virtual card system.

[0129] S403: receiving information returned by the virtual card system after processing the data information, and sending the information returned by the virtual card system after processing the data information to the software of the host computer.

[0130] Specifically, the information returned by the virtual card system after processing the data information is received, and the returned information is sent to the software of the host computer.

[0131] The present application provides a method for debugging a virtual card reader, which creates a port, sends an instruction for obtaining ATR data to the virtual card system through the port, and obtains the ATR data returned by the virtual card system; sends the ATR data to the software of the host computer, and sends the obtained data information to the virtual card system; wherein the data information refers to the application protocol data unit data information; receives the information returned by the virtual card system after processing the data information, and sends the information returned by the virtual card system after processing the data information to the software of the host computer. The following technical effects are achieved: the created port is used to realize the interaction between the virtual card reader and the virtual card system; the repackaged functions in the dynamic library file are used to realize the interaction between the virtual card reader and the software of the host computer.

[0132] Figure 5 Schematic diagram of the process of implementing the virtual card reader debugging method provided in the embodiment of the present application Figure 4 In this embodiment Figure 4 Based on the embodiment, the specific steps of a method for debugging a virtual card reader applied to a virtual card reader are described in detail, such as Figure 4 As shown, this embodiment provides a method for implementing virtual card reader debugging, including:

[0133] S501. Create a port.

[0134] Specifically, two ports are created, namely the socket data port and the socket control port.

[0135] In one possible design, the port includes a socket data port and a socket control port, wherein the socket control port is used to indicate status communication between the virtual card reader and the virtual card system; the socket data port is used to indicate data communication between the virtual card reader and the virtual card system;

[0136] The dynamic library file includes a first function, a second function, a third function and a fourth function;

[0137] The first function is generated according to the SCardListReadersA function and the ScardListReadersW function; the first function is used to instruct to add the card reader name to the card reader list, so as to add the virtual card reader according to the card reader list;

[0138] The second function is obtained according to the SCardConnectA and ScardConnectW functions; the second function is used to establish the connection between the software of the host computer and the virtual card reader;

[0139] The third function is generated according to the ScardDisconnect function; the third function is used to indicate the disconnection mode between the software of the host computer and the virtual card reader;

[0140] The fourth function is generated according to the ScardTransmit function; the fourth function is used to instruct the software of the host computer and the virtual card reader on the data transmission method.

[0141] Specifically, two ports are created, namely, adding and modifying the Socket communication port, to implement the 7816 protocol, so that the virtual card system can communicate and interact with the virtual card reader through the Socket port according to the 7816 protocol.

[0142] The dynamic library file contains multiple functions: the first function is generated by repackaging related data based on the SCardListReadersA function and the ScardListReadersW function. The first function can be used to add its own virtual card reader name to the card reader list, and read the virtual card reader list through the SCardListReadersA function and the ScardListReadersW function, so as to obtain the original card reader list and the newly added virtual card reader name.

[0143] The second function is generated based on the SCardConnectA and ScardConnectW functions. The second function is used to determine whether the selection is a virtual card reader. If the selection is a virtual card reader, a specific resource manager context is used to call the application to establish a connection with the smart card contained in the specific reader, that is, the software of the host computer establishes a connection with the smart card in the virtual card reader.

[0144] The third function is generated based on the ScardDisconnect function. The third function can determine whether the selected card reader is a virtual card reader. If the selected card reader is a virtual card reader, the Socket communication port is closed and a successful closure message is returned; if the selected card reader is not a virtual card reader, the original dynamic link library file function is called. The third function is used for the connection previously opened by the terminal between the calling application and the smart card in the target reader.

[0145] The fourth function is generated based on the ScardTransmit function. The fourth function is used to indicate that a service request is sent to the smart card and data is expected to be received from the smart card. The fourth function can determine whether the connection is a virtual card reader. If it is a virtual card reader, it sends and receives APDU data.

[0146] The dynamic library file also includes: the fifth function and the sixth function.

[0147] The fifth function is generated based on the ScardReconnect function and is used to re-establish the existing connection between the application and the smart card. The fifth function can determine whether the selected card reader is a virtual card reader. If it is a virtual card reader, the dynamic link library is called; if it is not a virtual card reader, the ATR data can be re-obtained for verification.

[0148] The sixth function is generated based on SCardStatusA and ScardStatusW. It is used to provide the status of the smart card in the card reader. The sixth function can determine whether the selection is a virtual card reader. If it is not a virtual card reader, the dynamic link library is called; if it is a virtual card reader, the protocol parameters can be modified, the ATR value can be modified, the virtual card reader name can be added, and the information of successful addition can be returned.

[0149] S502: Start the virtual card system and listen to the socket data port and the socket control port to receive instructions from the virtual card reader.

[0150] Specifically, the virtual card system is started, and the virtual card system listens to the socket port to receive instructions and data sent by the virtual card reader.

[0151] S503, sending a hot reset instruction to the virtual card system through the socket control port; wherein the hot reset instruction is used to indicate an instruction for obtaining ATR data.

[0152] Specifically, the virtual card reader sends a hot reset instruction to the virtual card system through the socket control port to obtain ATR data from the virtual card system.

[0153] S504: Acquire the ATR data returned by the virtual card system through the socket data port.

[0154] Specifically, the virtual card reader obtains the ATR data returned by the virtual card system through the socket data port.

[0155] S505, sending the ATR data to the software of the host computer through the second function.

[0156] Specifically, the acquired ATR data is sent to the software of the host computer through the second function.

[0157] S506. Obtain data information sent by the software of the host computer through the fourth function, and send the data information to the virtual card system through the socket data port.

[0158] Specifically, the data information sent by the software of the host computer is obtained through the fourth function, and the received data information is sent to the virtual card system through the socket data port.

[0159] S507. Receive information returned by the virtual card system after processing the data information through the socket data port, and send the information returned by the virtual card system after processing the data information to the software of the host computer through the fourth function.

[0160] Specifically, after the data information is sent to the virtual card system, the virtual card system processes the data information, obtains the data information processed by the virtual card system, and sends the data information processed by the virtual card system to the software of the host computer.

[0161] The present application provides a method for debugging a virtual card reader, which creates a port to realize the interaction between the virtual card reader and the virtual card system; uses the repackaged functions in the dynamic library file to realize the interaction between the virtual card reader and the software of the host computer. The dynamic library file avoids the need to install driver software and write new programs to debug the virtual card system, thereby realizing communication and debugging between the host computer software, the virtual card reader and the virtual card system.

[0162] The following is the example based on Figure 2 , Figure 3 , Figure 4 and Figure 5 A specific example provided:

[0163] Taking the host computer software PyApduTool as an example, the developer dynamic link library corresponding to the smart card is the winscard.dll dynamic library.

[0164] Figure 6 An interactive schematic diagram of a virtual card reader debugging method provided in an embodiment of the present application.

[0165] like Figure 6 As shown, the method includes:

[0166] S601, obtaining a dynamic library file of a virtual card reader;

[0167] On the basis of the dynamic link library, a dynamic library file is written to overload the functions of the original winscard.dll dynamic library, replace some function methods in the original dynamic link library, and realize the virtual card reader function. Among them, the dynamic library file needs to be placed in the software file of the host computer so that the software of the host computer can recognize the newly added virtual card reader when obtaining the host computer card list.

[0168] The virtual card system owner adds and modifies the socket communication interface to implement the 7816 protocol. This port is used to realize the communication connection between the virtual card reader and the virtual card system.

[0169] S602: The software of the host computer obtains a card reader list and adds a virtual card reader.

[0170] The software of the host computer obtains the card reader list through the dynamic link library. The dynamic library file can obtain the card list of the host computer through the first function and add the required virtual card reader name.

[0171] S603: The virtual card reader returns the card list to the software of the host computer.

[0172] Start the virtual card system and listen to the port. Put the virtual card system in operation and make it listen to the port so as to receive instructions and data from the virtual card reader at any time.

[0173] S604: The host computer selects a virtual card reader from the card list.

[0174] The software of the host computer selects the virtual card reader to be connected from the card list.

[0175] S605: The virtual card reader creates a port.

[0176] The virtual card reader adds or modifies the socket communication interface to implement the 7816 protocol.

[0177] S606: The virtual card reader returns a selection success message to the software of the host computer.

[0178] S607: The software of the host computer establishes a connection with the virtual card reader.

[0179] The software of the host computer can establish a connection with the virtual card reader through the second function.

[0180] S608: The virtual card reader sends a hot reset notification to the virtual card system through the socket control port.

[0181] The virtual card reader sends a notification to obtain ATR data to the virtual card system through the socket control port.

[0182] S609: The virtual card system obtains a hot reset instruction from the socket control port, and sends an ATR to the virtual card reader through the socket data port.

[0183] The virtual card system obtains the hot reset instruction from the socket control port and sends the ATR to the virtual card reader through the socket data port.

[0184] S610: The virtual card reader returns the acquired ATR data to the software of the host computer through the second function.

[0185] The virtual card reader sends the acquired ATR data to the host computer software through the second function. The host computer software can determine whether the target virtual card reader is selected according to the ATR data through the function in the dynamic library file. If the virtual card reader is selected, the sixth function provides the current status of the smart card in the current card reader, modifies the protocol parameters, modifies the ATR value, adds the virtual card reader name, and returns the successful selection information; or the fifth function can call the reset method to re-acquire the ATR. If the target virtual card reader is not selected, the original dynamic link library is called.

[0186] S611. The software of the host computer sends APDU data to the virtual card reader through the fourth function.

[0187] The software of the host computer sends the ADPU data to the virtual card reader through the fourth function.

[0188] S612: The virtual card reader sends the APDU data to the virtual card system.

[0189] The virtual card reader sends APDU data to the virtual card system through the socket data port.

[0190] S613: The virtual card system debugs the APDU data.

[0191] The virtual card system debugs and processes the acquired APDU data.

[0192] S614: Return the processed APDU data to the virtual card reader.

[0193] Return the processed APDU data to the virtual card reader.

[0194] S615: The virtual card reader sends the processed APDU data to the software of the host computer through the fourth function.

[0195] The virtual card reader sends the processed APDU data to the software of the host computer through the fourth function.

[0196] The software of the host computer, the virtual card reader and the virtual card system repeatedly perform steps S611-S615 until the software of the host computer no longer interacts with the virtual card system and the virtual card system is debugged.

[0197] S616: The software of the host computer sends a disconnection instruction to the virtual card reader through the third function.

[0198] S617: The virtual card reader closes the port according to the disconnection instruction.

[0199] S618. The virtual card reader sends a successful disconnection message to the software of the host computer.

[0200] The present embodiment provides a method for implementing virtual card reader debugging. According to different host computer software, some function methods of the corresponding dynamic link library are replaced, and the functions of the original functions are overloaded, so that the host computer software can communicate and debug the virtual card reader and the virtual card system according to different dynamic library files; using some newly modified functions, the virtual card reader and the virtual card system can be verified, and if incorrect, the ATR data can be re-obtained for verification; the port is set to two, and different ports are used for transmission according to different instructions and data transmission.

[0201] The above-mentioned functions implemented by the electronic device and the main control device introduce the scheme provided by the embodiment of the present invention. It can be understood that in order to implement the above-mentioned functions, the electronic device or the main control device includes a hardware structure and / or software module corresponding to the execution of each function. In combination with the units and algorithm steps of each example described in the embodiment disclosed in the embodiment of the present invention, the embodiment of the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiment of the present invention.

[0202] The embodiment of the present application provides a method for implementing a virtual card reader debugging system such as Figure 7 As shown, the system includes a host computer and a virtual card reader, and the system is applied to a method for implementing virtual card reader debugging in the above embodiment.

[0203] A virtual card reader debugging system includes: a host computer 710 and a virtual card reader 2 720.

[0204] The virtual machine is used to implement a method for debugging a virtual card reader according to the first aspect of the invention, and the virtual card reader is used to implement a method for debugging a virtual card reader according to the second aspect of the invention.

[0205] This embodiment provides a virtual card reader debugging system. The host computer obtains the dynamic library file and adds the name of the virtual card reader according to the dynamic library file to facilitate the connection between the host computer software and the target virtual card reader. The virtual card reader can also implement data interaction and command interaction with the host computer software through some functions of the dynamic library file.

[0206] Figure 8 A schematic diagram of a virtual card reader debugging device provided in an embodiment of the present application Figure 1 .like Figure 8As shown, a virtual card reader debugging device is implemented and applied to a host computer, including: an acquisition module 810, a data information module 820 and a debugging module 830.

[0207] The acquisition module 810 is used to acquire a dynamic library file and add a virtual card reader according to the dynamic library file to achieve communication connection between the software of the host computer and the virtual card reader;

[0208] The data information module 820 is used to send data information to the virtual card reader; wherein the data information is data used to instruct the software of the host computer to debug the virtual card system; the virtual card system refers to the smart card operating system;

[0209] The debugging module 830 is used to receive information returned by the virtual card reader after processing data information, and use the returned information as the debugging result.

[0210] In one possible design, the acquisition module 810 includes:

[0211] A list module, used to obtain a virtual card list according to the first function in the dynamic library file corresponding to the software of the host computer;

[0212] Add module, used to add virtual card reader according to the virtual card list.

[0213] In one possible design, the data information module 820 includes:

[0214] The verification module is used to obtain the ATR data returned by the virtual card reader when the communication connection between the software of the host computer and the virtual card reader is successful, so as to verify whether the communication connection between the virtual card reader and the virtual card system is correct according to the ATR data;

[0215] The information sending module is used to send data information to the virtual card reader when the virtual card reader and the virtual card system are correctly connected in communication; wherein the data information refers to application protocol data unit data information.

[0216] Fig. 9 A schematic diagram of a virtual card reader debugging device provided in an embodiment of the present application Figure 2 .like Fig. 9 As shown, a virtual card reader debugging device is implemented and applied to a virtual card reader, including: a port creation module 910, a data sending module 920 and a data receiving module 930.

[0217] The port creation module 910 is used to create a port, send an instruction for obtaining ATR data to the virtual card system through the port, and obtain the ATR data returned by the virtual card system;

[0218] The data transmission module 920 is used to transmit the ATR data to the software of the host computer, and transmit the acquired data information to the virtual card system; wherein the data information refers to the application protocol data unit data information;

[0219] The data receiving module 930 is used to receive information returned by the virtual card system after processing the data information, and send the information returned by the virtual card system after processing the data information to the software of the host computer.

[0220] In one possible design, the port includes a socket data port and a socket control port, wherein the socket control port is used to indicate status communication between the virtual card reader and the virtual card system; the socket data port is used to indicate data communication between the virtual card reader and the virtual card system;

[0221] The dynamic library file includes a first function, a second function, a third function and a fourth function;

[0222] The first function is generated according to the SCardListReadersA function and the ScardListReadersW function; the first function is used to instruct to add the card reader name to the card reader list, so as to add the virtual card reader according to the card reader list;

[0223] The second function is obtained according to the SCardConnectA and ScardConnectW functions; the second function is used to establish the connection between the software of the host computer and the virtual card reader;

[0224] The third function is generated according to the ScardDisconnect function; the third function is used to indicate the disconnection mode between the software of the host computer and the virtual card reader;

[0225] The fourth function is generated according to the ScardTransmit function; the fourth function is used to instruct the software of the host computer and the virtual card reader on the data transmission method.

[0226] In one possible design, the port creation module 910 includes:

[0227] A startup module is used to start the virtual card system and listen to the socket data port and the socket control port to receive instructions from the virtual card reader;

[0228] The instruction module is used to send a hot reset instruction to the virtual card system through the socket control port; wherein the hot reset instruction is used to indicate an instruction for obtaining ATR data;

[0229] The return module is used to obtain the ATR data returned by the virtual card system through the socket data port.

[0230] In one possible design, the data sending module 920 includes:

[0231] The data sending module is used to send the ATR data to the software of the host computer through the second function;

[0232] The unit data module is used to obtain the data information sent by the software of the host computer through the fourth function, and send the data information to the virtual card system through the socket data port.

[0233] In one possible design, the data receiving module 930 includes:

[0234] The return information processing module is used to receive the information returned by the virtual card system after processing the data information through the socket data port, and send the information returned by the virtual card system after processing the data information to the software of the host computer through the fourth function;

[0235] After the data receiving module 930, the method further includes:

[0236] The disconnection module is used to close the port and return the disconnection return information when receiving the disconnection instruction sent by the software of the host computer; wherein the disconnection instruction is sent by the software of the host computer through the third function

[0237] The present embodiment provides a device for implementing virtual card reader debugging, which can execute the method for implementing virtual card reader debugging of the above-mentioned embodiment. The implementation principle and technical effect are similar, and will not be described in detail in the present embodiment.

[0238] In the above-mentioned specific implementation of the virtual card reader debugging method, each module can be implemented as a processor, and the processor can execute the computer execution instructions stored in the memory, so that the processor executes the above-mentioned virtual card reader debugging method.

[0239] The embodiment of the present invention can divide the electronic device or the main control device into functional modules according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0240] Fig.10 This is a schematic diagram of the structure of the electronic device hardware provided in the embodiment of the present application. Fig.10As shown, the electronic device includes: at least one processor 1010 and a memory 1020. The electronic device also includes a communication component 1030. The processor 1010, the memory 1020 and the communication component 1030 are connected via a bus 1040.

[0241] In a specific implementation process, at least one processor 1010 executes the computer execution instructions stored in the memory 1020, so that at least one processor 1010 executes a method for implementing virtual card reader debugging as performed by the electronic device side above.

[0242] The specific implementation process of the processor 1010 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0243] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0244] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk storage.

[0245] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0246] The above-mentioned functions implemented by the electronic device and the main control device introduce the scheme provided by the embodiment of the present invention. It can be understood that in order to implement the above-mentioned functions, the electronic device or the main control device includes a hardware structure and / or software module corresponding to the execution of each function. In combination with the units and algorithm steps of each example described in the embodiment disclosed in the embodiment of the present invention, the embodiment of the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiment of the present invention.

[0247] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the above-mentioned method for debugging a virtual card reader.

[0248] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0249] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in an electronic device or a main control device.

[0250] The present application also provides a computer program product, which includes: a computer program, which is stored in a readable storage medium. At least one processor of an electronic device can read the computer program from the readable storage medium. When the computer program is executed by the processor, it is used to implement a virtual card reader debugging method as described above.

[0251] Those skilled in the art can understand that all or part of the steps of the above method embodiments can be completed by hardware related to program instructions. The above program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above method embodiments are executed; and the above storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0252] So far, the technical solution of the present application has been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present application is obviously not limited to these specific embodiments, and the above embodiments are only used to illustrate the technical solution of the present application rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for debugging a virtual card reader, characterized in that: The method is applied to a host computer, and the method includes: Acquire a dynamic library file, and add a virtual card reader according to the dynamic library file to achieve communication connection between the software of the host computer and the virtual card reader; Sending data information to the virtual card reader; wherein the data information is data used to instruct the software of the host computer to debug the virtual card system; the virtual card system refers to a smart card operating system; Receive information returned by the virtual card reader after processing the data information, and use the returned information as a debugging result.

2. The method according to claim 1, characterized in that The adding of a virtual card reader according to the dynamic library file includes: Obtain a virtual card list according to the first function in the dynamic library file corresponding to the software of the host computer; The virtual card reader is added according to the virtual card list.

3. The method according to claim 2, characterized in that The sending of data information to the virtual card reader includes: When the communication connection between the software of the host computer and the virtual card reader is successful, obtaining ATR data returned by the virtual card reader to verify whether the communication connection between the virtual card reader and the virtual card system is correct according to the ATR data; When the virtual card reader and the virtual card system are correctly communicated and connected, the data information is sent to the virtual card reader; wherein the data information refers to application protocol data unit data information.

4. A method for debugging a virtual card reader, characterized in that: The method is applied to a virtual card reader, and the method comprises: Creating a port, sending an instruction for obtaining ATR data to a virtual card system through the port, and obtaining the ATR data returned by the virtual card system; Sending the ATR data to the software of the host computer, and sending the acquired data information to the virtual card system; wherein the data information refers to the application protocol data unit data information; The information returned by the virtual card system after processing the data information is received, and the information returned by the virtual card system after processing the data information is sent to the software of the host computer.

5. The method according to claim 4, characterized in that The port includes a socket data port and a socket control port, wherein the socket control port is used to indicate the status communication between the virtual card reader and the virtual card system; the socket data port is used to indicate the data communication between the virtual card reader and the virtual card system; The dynamic library file includes a first function, a second function, a third function and a fourth function; The first function is generated according to the SCardListReadersA function and the ScardListReadersW function; the first function is used to instruct to add the card reader name to the card reader list, so as to add the virtual card reader according to the card reader list; The second function is obtained according to the SCardConnectA and ScardConnectW functions; the second function is used to establish a connection mode between the software of the host computer and the virtual card reader; The third function is generated according to the ScardDisconnect function; the third function is used to indicate the disconnection mode between the software of the host computer and the virtual card reader; The fourth function is generated according to the ScardTransmit function; the fourth function is used to instruct the software of the host computer and the data transmission method of the virtual card reader.

6. The method according to claim 5, characterized in that The step of sending an instruction for obtaining ATR data to the virtual card system through the port to obtain the ATR data returned by the virtual card system includes: Starting the virtual card system and listening to the socket data port and the socket control port to receive instructions from the virtual card reader; Sending a hot reset instruction to the virtual card system through the socket control port; wherein the hot reset instruction is used to indicate an instruction for obtaining ATR data; The ATR data returned by the virtual card system is obtained through the socket data port.

7. The method according to claim 6, characterized in that The software for sending the ATR data to the host computer and sending the acquired data information to the virtual card system includes: Sending the ATR data to the software of the host computer through the second function; The data information sent by the software of the host computer is obtained through the fourth function, and the data information is sent to the virtual card system through the socket data port.

8. The method according to claim 7, characterized in that The software for receiving the information returned by the virtual card system after processing the data information, and sending the information returned by the virtual card system after processing the data information to the host computer includes: Receiving information returned by the virtual card system after processing the data information through the socket data port, and sending the information returned by the virtual card system after processing the data information to the software of the host computer through a fourth function; After sending the information returned by the virtual card system after processing the data information to the software of the host computer through the fourth function, the method further includes: When receiving a disconnection instruction sent by the software of the host computer, the port is closed and disconnection return information is returned; wherein the disconnection instruction is sent by the software of the host computer through a third function.

9. A virtual card reader debugging system, characterized in that: Includes: host computer and virtual card reader; The virtual machine is used to implement a method for debugging a virtual card reader as described in any one of claims 1 to 3, and the virtual card reader is used to implement a method for debugging a virtual card reader as described in any one of claims 4 to 8.

10. A device for debugging a virtual card reader, characterized in that: The device is applied to a host computer, and the device comprises: An acquisition module, used for acquiring a dynamic library file, and adding a virtual card reader according to the dynamic library file, so as to realize the communication connection between the software of the host computer and the virtual card reader; A data information module, used to send data information to the virtual card reader; wherein the data information is data used to instruct the software of the host computer to debug the virtual card system; the virtual card system refers to a smart card operating system; The debugging module is used to receive information returned by the virtual card reader after processing the data information, and use the returned information as the debugging result.

11. A device for debugging a virtual card reader, characterized in that: The device is applied to a virtual card reader, and the device comprises: A port creation module, used for creating a port, sending an instruction for obtaining ATR data to the virtual card system through the port, and obtaining the ATR data returned by the virtual card system; A data sending module, used to send the ATR data to the software of the host computer, and send the acquired data information to the virtual card system; wherein the data information refers to the application protocol data unit data information; The data receiving module is used to receive the information returned by the virtual card system after processing the data information, and send the information returned by the virtual card system after processing the data information to the software of the host computer.

12. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; When the processor executes the computer-executable instructions stored in the memory, it is used to implement a method for implementing virtual card reader debugging as described in any one of claims 1 to 3 or a method for implementing virtual card reader debugging as described in any one of claims 4 to 8.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement a method for implementing a virtual card reader debugging as described in any one of claims 1 to 3 or a method for implementing a virtual card reader debugging as described in any one of claims 4 to 8.

Citation Information

Cited By

  • Smart card reading method, system and device and terminal equipment

    CN120822529A