CN108196886B - Card reader service implementation method and card reader - Google Patents

Card reader service implementation method and card reader Download PDF

Info

Publication number
CN108196886B
CN108196886B CN201711428220.4A CN201711428220A CN108196886B CN 108196886 B CN108196886 B CN 108196886B CN 201711428220 A CN201711428220 A CN 201711428220A CN 108196886 B CN108196886 B CN 108196886B
Authority
CN
China
Prior art keywords
card reader
card
target
type
read
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711428220.4A
Other languages
Chinese (zh)
Other versions
CN108196886A (en
Inventor
曹雪韬
庞欢欢
邵辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur General Software Co Ltd
Original Assignee
Inspur General Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur General Software Co Ltd filed Critical Inspur General Software Co Ltd
Priority to CN201711428220.4A priority Critical patent/CN108196886B/en
Publication of CN108196886A publication Critical patent/CN108196886A/en
Application granted granted Critical
Publication of CN108196886B publication Critical patent/CN108196886B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/0008General problems related to the reading of electronic memory record carriers, independent of its reading method, e.g. power transfer

Landscapes

  • Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Stored Programmes (AREA)
  • Cash Registers Or Receiving Machines (AREA)

Abstract

The invention provides a card reader service realization method and a card reader, wherein the method comprises the following steps: determining at least one card reader type and at least one operation method corresponding to each card reader type; selecting a target card reader type corresponding to a card to be read from the at least one card reader type; generating a card reader instantiation object corresponding to the target card reader type; and utilizing the card reader instantiation object to call at least one target operation method to operate the card to be read, wherein the at least one target operation method is included in at least one operation method corresponding to the type of the target card reader. Therefore, the scheme provided by the invention can reduce the complexity of loading multiple card reader types.

Description

Card reader service implementation method and card reader
Technical Field
The invention relates to the technical field of computers, in particular to a card reader service implementation method and a card reader.
Background
Different types of cards such as bank cards and IC cards are widely applied in daily life of people. In order to operate various types of cards conveniently, common loading of multiple card reader types in one card reader is generally required to be realized simultaneously.
At present, the common loading method for multiple card reader types is generally as follows: and determining at least one card to be read corresponding to each card reader type, and then respectively setting a corresponding applet control for each card to be read. Then, when any card to be read needs to be operated, the corresponding applet control needs to be called, but due to the fact that diversified interfaces and running codes exist in the applet control, the use is complex and tedious when the applet control is called. Therefore, the existing mode is complex to realize the loading of multiple card reader types.
Disclosure of Invention
The embodiment of the invention provides a card reader service implementation method and a card reader, which can reduce the complexity of implementing loading of various card reader types.
In a first aspect, an embodiment of the present invention provides a method for implementing a card reader service, where the method includes:
determining at least one card reader type and at least one operation method corresponding to each card reader type;
selecting a target card reader type corresponding to a card to be read from the at least one card reader type;
generating a card reader instantiation object corresponding to the target card reader type;
and utilizing the card reader instantiation object to call at least one target operation method to operate the card to be read, wherein the at least one target operation method is included in at least one operation method corresponding to the type of the target card reader.
Preferably, the first and second electrodes are formed of a metal,
further comprising:
determining the corresponding relation between at least one card reader class and at least one sample identification information;
the generating of the card reader instantiation object corresponding to the target card reader type includes:
determining card reader identification information according to the type of the target card reader and the card to be read;
loading a target card reader class corresponding to the card reader identification information by using a preset class loader according to the corresponding relation;
and generating the card reader instantiation object by utilizing the target card reader class.
Preferably, the first and second electrodes are formed of a metal,
the determination of at least one card reader type and the corresponding at least one operation method of each card reader type comprise
Setting at least one card reader interface, wherein each card reader interface comprises at least one card reader method and corresponds to one card reader type;
setting a public interface, wherein the public interface comprises at least one public method;
performing for each of the card reader types: and determining at least one operation method corresponding to the type of the card reader in at least one card reader method included by the corresponding card reader interface and at least one public method included by the public interface.
Preferably, the first and second electrodes are formed of a metal,
the using the card reader instantiation object to call at least one target operation method to operate the card to be read includes:
a1: judging whether a public method exists in the at least one target operation method, if so, executing A2; otherwise, a3 is executed;
a2: determining at least one public method to be called in the at least one target operation method, and calling the at least one public method to be called from the public interface by using the card reader instantiation object;
a3: and calling the at least one target operation method from a card reader interface corresponding to the target card reader type by using the card reader instantiation object.
Preferably, the first and second electrodes are formed of a metal,
at least one operation method corresponding to each card reader type comprises the following steps: at least one or more of a card write once method, a card read once method, a card write cycle method, a card write stop cycle method, a card read cycle method, and a card read stop cycle method.
Preferably, the first and second electrodes are formed of a metal,
after the instantiating the object by the card reader and calling at least one target operation method to operate the card to be read, the method further comprises the following steps:
and monitoring the operation progress of the card to be read, and displaying the monitored operation progress in real time.
In a second aspect, an embodiment of the present invention provides a card reader, including:
the system comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining at least one card reader type and at least one operation method corresponding to each card reader type;
the selection module is used for selecting a target card reader type corresponding to a card to be read from the at least one card reader type determined by the determination module;
the generating module is used for generating a card reader instantiation object corresponding to the target card reader type selected by the selecting module;
and the calling module is used for calling at least one target operation method to operate the card to be read by utilizing the card reader instantiation object generated by the generating module, wherein the at least one target operation method is included in at least one operation method corresponding to the type of the target card reader.
Preferably, the first and second electrodes are formed of a metal,
further comprising:
the relation determining module is used for determining the corresponding relation between at least one card reader class and at least one sample identification information;
the generation module comprises: loading a submodule and generating a submodule;
the loading submodule is used for determining card reader identification information according to the type of the target card reader and the card to be read; loading a target card reader class corresponding to the card reader identification information by using a preset class loader according to the corresponding relation;
and the generation submodule is used for generating the card reader instantiation object by utilizing the target card reader class.
Preferably, the first and second electrodes are formed of a metal,
the determining module includes: setting a submodule and determining a submodule;
the setting submodule is used for setting at least one card reader interface, wherein each card reader interface comprises at least one card reader method and corresponds to one card reader type; setting a public interface, wherein the public interface comprises at least one public method;
the determining submodule is used for executing the following steps for each card reader type: and determining at least one operation method corresponding to the type of the card reader in at least one card reader method included by the corresponding card reader interface and at least one public method included by the public interface.
Preferably, the first and second electrodes are formed of a metal,
the calling module comprises: the judgment submodule, the first calling submodule and the second calling submodule;
the judging submodule is used for judging whether a public method exists in the at least one target operation method, and if so, triggering the first calling submodule; otherwise, triggering the second calling sub-module;
the first calling submodule is used for determining at least one public method to be called in the at least one target operation method under the trigger of the judging submodule, and calling the at least one public method to be called from the public interface by using the card reader instantiation object;
the second calling sub-module is configured to call the at least one target operation method from the card reader interface corresponding to the target card reader type by using the card reader instantiation object under the trigger of the determining sub-module.
Preferably, the first and second electrodes are formed of a metal,
further comprising: a monitoring module;
and the monitoring module is used for monitoring the operation progress of the card to be read and displaying the monitored operation progress in real time.
The embodiment of the invention provides a card reader service implementation method and a card reader. When the card to be read needs to be operated, the target card reader type corresponding to the card to be read is selected from the determined card reader types, and a card reader instantiation object corresponding to the target card reader type is generated. And then calling at least one target operation method in the determined card reader type by using the generated card reader implementation object to operate the card to be read. Therefore, when the card to be read needs to be operated in the scheme, because the card reader instantiation object aiming at the card to be read can be generated, the card to be read can be operated by calling the operation method by using the card reader instantiation object. Therefore, the scheme provided by the embodiment of the invention can reduce the complexity of realizing the loading of various card reader types.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flowchart of a card reader service implementation method according to an embodiment of the present invention;
fig. 2 is a flowchart of a card reader service implementation method according to another embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a card reader according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a card reader according to another embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a card reader according to another embodiment of the present invention;
fig. 6 is a schematic structural diagram of a card reader including a monitoring module according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer and more complete, the technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention, and based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts belong to the scope of the present invention.
As shown in fig. 1, an embodiment of the present invention provides a method for implementing a card reader service, where the method may include the following steps:
step 101: determining at least one card reader type and at least one operation method corresponding to each card reader type;
step 102: selecting a target card reader type corresponding to a card to be read from the at least one card reader type;
step 103: generating a card reader instantiation object corresponding to the target card reader type;
step 104: and utilizing the card reader instantiation object to call at least one target operation method to operate the card to be read, wherein the at least one target operation method is included in at least one operation method corresponding to the type of the target card reader.
According to the embodiment shown in FIG. 1, a set number of reader types is first determined and a set number of operating methods corresponding to each reader type is determined. When the card to be read needs to be operated, the target card reader type corresponding to the card to be read is selected from the determined card reader types, and a card reader instantiation object corresponding to the target card reader type is generated. And then calling at least one target operation method in the determined card reader type by using the generated card reader implementation object to operate the card to be read. Therefore, when the card to be read needs to be operated in the scheme, because the card reader instantiation object aiming at the card to be read can be generated, the card to be read can be operated by calling the operation method by using the card reader instantiation object. Therefore, the scheme provided by the embodiment of the invention can reduce the complexity of realizing the loading of various card reader types.
In an embodiment of the present invention, at least one card reader type involved in the flowchart shown in fig. 1 may be determined according to service requirements. For example, the at least one card reader type may include, but is not limited to, at least one or more of an identification card reader, an integrated circuit card (IC) card reader, and a bank card reader.
In this embodiment, each reader type may correspond to at least one reader manufacturer.
In an embodiment of the present invention, the step 101 in the flowchart shown in fig. 1 for determining at least one card reader type and at least one operation method corresponding to each card reader type may include:
setting at least one card reader interface, wherein each card reader interface comprises at least one card reader method and corresponds to one card reader type;
setting a public interface, wherein the public interface comprises at least one public method;
performing for each of the card reader types: and determining at least one operation method corresponding to the type of the card reader in at least one card reader method included by the corresponding card reader interface and at least one public method included by the public interface.
In this embodiment, the common method included in the common interface is a method that can be called by each card reader type. The at least one public method included in the public interface may include, but is not limited to, at least one or more of a circulation card reading method and a stop card reading circulation method.
In this embodiment, each card reader interface may be an interface packaged by the card reader manufacturer itself. For example, the system can include a myth identity card reader interface, and the type of the card reader corresponding to the card reader interface is an identity card reader; the system can comprise a China Vision identity card reader interface, and the type of a card reader corresponding to the card reader interface is an identity card reader; the card reader can comprise a German card bank card reader, and the type of the card reader corresponding to the card reader interface is a bank card reader.
In this embodiment, the at least one card reader method corresponding to each card reader interface may include, but is not limited to, at least one or more of a card write once method, a card read once method, a card write cycle method, and a card write stop cycle method.
In this embodiment, determining at least one operation method corresponding to each card reader type may be implemented by:
B1-B6 are performed for each card reader type:
b1: judging whether the current card reader type needs to set at least one public method to be set, if so, executing B2; otherwise, B3 is executed;
b2: selecting at least one public method to be set from the at least one public method included in the public interface, and executing B3;
b3: judging whether the current card reader type needs to set at least one card reader method to be set, if so, executing B4; otherwise, B6 is executed;
b4: selecting at least one card reader method to be set from card reader interfaces corresponding to the current card reader type;
b5: and determining the selected at least one public method to be set and the selected at least one card reader method to be set as the operation method corresponding to the current card reader type.
B6: and determining at least one selected card reader method to be set as an operation method corresponding to the current card reader type.
In an embodiment of the present invention, the step 104 in the flowchart shown in fig. 1, utilizing the card reader instantiation object to call at least one target operation method to operate on the card to be read, may include:
a1: judging whether a public method exists in the at least one target operation method, if so, executing A2; otherwise, a3 is executed;
a2: determining at least one public method to be called in the at least one target operation method, and calling the at least one public method to be called from the public interface by using the card reader instantiation object;
a3: and calling the at least one target operation method from a card reader interface corresponding to the target card reader type by using the card reader instantiation object.
In this embodiment, when it is determined that a common method exists in at least one target operation method, each common method to be called is determined in the at least one target operation method. And then, calling each public method to be called from the public interface by using the card reader instantiation object. And judging whether a card reader method exists in at least one target operation method, if so, determining various card reader methods to be called in at least one target operation method, calling various card reader methods to be called in a card reader type interface corresponding to the type of the target card reader, and operating the card to be read by using the called public method to be called and the card reader method to be called.
In this embodiment, when it is determined that a public method does not exist in at least one target operation method, which indicates that the at least one target operation method is a card reader method, the card reader instantiation object is used to call the at least one target operation method from a card reader interface corresponding to a target card reader type, and the called target operation method is used to operate a card to be read.
In this embodiment, when the card to be read is an IC card and the target operation method includes a card write-once method and a card read-once method, instantiating an object by using the card reader, and invoking at least one target operation method to operate the card to be read may include: and calling a single-time card reading method by using an instantiation object of the IC card reader to read the card number and the money amount in a specified area (such as a chip) of the IC card. And calling a card one-time-writing method by using the instantiation object of the IC card reader to write the set amount of money in the designated area (such as a chip) of the IC card.
In this embodiment, when the card to be read is an identity card and the target operation method includes a cyclic card reading method, instantiating an object by using the card reader, and invoking at least one target operation method to operate the card to be read may include: and calling a circulating card reading method by using an instantiation object of the identity card reader to read the identity card number, name, address and identity card picture in the identity card.
In this embodiment, when the card to be read is a bank card (any one of a magnetic stripe card, a chip card, or a composite card in which a magnetic stripe and a chip coexist), and the target operation method includes a single card reading method, instantiating an object by using a card reader, and invoking at least one target operation method to operate the card to be read may include: and calling a single card reading method to read the bank card number in the bank card by using the bank card reader instantiation object.
According to the embodiment, when at least one target operation method is called to operate the card to be read, each target operation method can be called from the card reader interface and the public interface corresponding to the type of the target card reader. Since the target operation method exists in the interface of the preset setting, the operation is easy to expand from the development point of view and the maintenance is convenient.
In an embodiment of the present invention, the at least one operation method corresponding to each of the card reader types involved in the flowchart shown in fig. 1 may include: at least one or more of a card write once method, a card read once method, a card write cycle method, a card write stop cycle method, a card read cycle method, and a card read stop cycle method.
In this embodiment, at least one operation method may be set according to a service requirement, and the at least one operation method mentioned above may include at least one or more of a card write once method, a card read once method, a card write cycle stop method, a card read cycle stop method, and a card read cycle stop method, but is a preferred method. At least one operation method can be added and deleted according to the service requirement.
According to the above embodiment, at least one operation method may select at least one or more of a card write once method, a card read once method, a card write cycle method, a card write stop cycle method, a card read cycle method, and a card read stop cycle method according to a service requirement. Therefore, the service applicability is strong.
In one embodiment of the present invention, when the card reader service implementation method further includes determining a correspondence between at least one card reader class and at least one sample identification information,
then, the step 103 in the flowchart shown in fig. 1 mentioned above to generate a card reader instantiation object corresponding to the target card reader type may include:
determining card reader identification information according to the type of the target card reader and the card to be read;
loading a target card reader class corresponding to the card reader identification information by using a preset class loader according to the corresponding relation;
and generating the card reader instantiation object by utilizing the target card reader class.
In this embodiment, each card reader class corresponds to one sample identification information in the corresponding relationship. Each card reader class corresponds to attribute information and methods of a manufacturer card reader.
In this embodiment, the method for determining the card reader identification information according to the type of the target card reader and the card to be read may include: the method comprises the steps of determining type information of a target card reader type, determining a manufacturer name corresponding to a card to be read, and generating card reader identification information in a format of 'card reader type-manufacturer initial'.
In this embodiment, after the card reader identification information is determined according to the type of the target card reader and the card to be read, the sample identification information consistent with the card reader identification information is found out from the at least one sample identification information. And then determining a target card reader class corresponding to the searched sample identification information according to the corresponding relation. And then loading the attribute information and the method included in the target card reader class by using the class loader. After the loading is completed, the loaded target card reader class can be utilized through a preset constructor (such as a constructor of TestClass), and a card reader instantiation object corresponding to the target card reader class is generated.
According to the embodiment, the class loader is used for loading the target card reader class corresponding to the card reader identification information, and the target card reader class is used for generating the card reader instantiation object. Since the instantiation object is generated according to the target card reader class, the uniqueness of the card reader instantiation object can be ensured.
In an embodiment of the present invention, after the step 104 in the flowchart shown in fig. 1 uses the card reader instantiation object to invoke at least one target operation method to operate on the card to be read, the method may further include:
and monitoring the operation progress of the card to be read, and displaying the monitored operation progress in real time.
In this embodiment, after the card reader instantiation object is used to call at least one target operation method to operate the card to be read, in order to know the operation progress of the card to be read in time, the operation progress of the card to be read may be monitored, and the monitored operation progress may be displayed in real time.
In this embodiment, the user can know the operation condition of the card to be read according to the operation progress displayed in real time, and can find the abnormal condition in time according to the operation progress and perform abnormal processing on the abnormal condition in time.
According to the embodiment, after the card reader instantiation object is used for calling the target operation method to operate the card to be read, the operation progress of the card to be read needs to be monitored. And displaying the monitored operation progress in real time. The user can know the operation condition of the card to be read according to the operation progress displayed in real time, and can find abnormal conditions in time according to the operation progress, so that the user can know the operation condition of the card to be read more comprehensively.
The following are examples of card reader types including identification card readers, IC card readers, and bank card readers. Explaining a card reader service implementation method, as shown in fig. 2, the card reader service implementation method may include the following steps:
step 201: at least one card reader interface is arranged, wherein each card reader interface comprises at least one card reader method and corresponds to one card reader type.
In this step, a card reader interface 1, a card reader interface 2, and a card reader interface 3 are provided. The card reader interface 1 corresponds to an identity card reader, the card reader interface 2 corresponds to an IC card reader, and the card reader interface 3 corresponds to a bank card reader.
In this step, the card reader methods included in each card reader interface are a single card writing method, a single card reading method, a cyclic card writing method, and a card writing stopping cyclic method.
Step 202: and setting a public interface, wherein the public interface comprises at least one public method.
In this step, the public interface includes a method of cyclically reading the card and a method of stopping the reading of the card cyclically.
Step 203: at least one card reader type is determined.
In this step, the determined card reader types include an identification card reader, an IC card reader, and a bank card reader.
Step 204: for each card reader type: and determining at least one operation method corresponding to the type of the card reader in at least one card reader method included by the corresponding card reader interface and at least one public method included by the public interface.
In this step, the card reader type is an IC card reader as an example: and determining the methods of the corresponding card reader interface 2, namely a single card writing method, a single card reading method, a circulating card writing method and a card writing circulation stopping method, and the methods of the public interface, namely a circulating card reading method and a card reading circulation stopping method, as the operation methods corresponding to the IC card reader.
Step 205: and determining the corresponding relation between at least one card reader class and at least one sample identification information.
In this step, for example, the determined at least one card reader class includes an hanyue IC card reader class, and the sample identification information corresponding to the hanyue IC card reader class is C _ HY.
Step 206: and selecting a target card reader type corresponding to the card to be read from at least one card reader type.
In this step, among various card reader types, the target card reader type corresponding to the card to be read, i.e., the IC card 1, is selected as the IC card reader.
Step 207: and determining the identification information of the card reader according to the type of the target card reader and the card to be read.
In this step, the type information "IC card" of the target card reader type is determined, the manufacturer name "hanyue" corresponding to the card to be read is determined, and the card reader identification information "C _ HY" in the format "card reader type _ manufacturer initial" is generated.
Step 208: and loading the target card reader class corresponding to the card reader identification information by using a preset class loader according to the corresponding relation.
In this step, the target card reader class "hanyue IC card reader class" corresponding to the card reader identification information "C _ HY" is loaded by using a preset class loader according to the correspondence set in step 205.
Step 209: and generating a card reader instantiation object by utilizing the target card reader class.
In this step, a card reader instantiation object corresponding to the target card reader type "IC card reader" may be generated by using the loaded target card reader type through a preset constructor (for example, a constructor of TestClass).
Step 210: and determining at least one target operation method, wherein the at least one target operation method is included in the at least one operation method corresponding to the type of the target card reader.
In this step, the determined at least one target operation method includes a card-write-once method.
Step 211: judging whether a public method exists in at least one target operation method, if so, executing step 212; otherwise, step 215 is performed.
In this step, it is determined that there is no common method in the target operation methods, and step 215 is performed.
Step 212: and determining at least one public method to be called in at least one target operation method, and calling the at least one public method to be called from the public interface by using the card reader instantiation object.
Step 213: and calling at least one card reader method to be called from a card reader interface corresponding to the type of the target card reader by using the card reader instantiation object, wherein the at least one card reader method to be called is a target operation method which is not determined to be a public method to be called in the at least one target operation method.
Step 214: and operating the card to be read by utilizing the at least one public method to be called and the at least one card reader method to be called, which are called by the card reader instantiation object, and executing the step 217.
Step 215: and calling at least one target operation method from a card reader interface corresponding to the type of the target card reader by using the card reader instantiation object.
In this step, the card-write-once method is called from the card reader interface corresponding to the IC card reader by using the card reader instantiation object generated in step 209.
Step 216: and operating the card to be read by utilizing at least one target operation method called by the instantiation object of the card reader.
In this step, the card to be read "IC card 1" is operated by using the called card-write-once method. For example, the set amount of money is written in a designated area (chip).
Step 217: and monitoring the operation progress of the card to be read, and displaying the monitored operation progress in real time.
In this step, the operation progress of the card "IC card 1" to be read is monitored, and the monitored operation progress is displayed in real time. So that the user can know the operation progress in time according to the display.
The present embodiment can be implemented by the following code. The code includes:
Figure BDA0001524385220000141
Figure BDA0001524385220000151
Figure BDA0001524385220000161
Figure BDA0001524385220000171
Figure BDA0001524385220000181
as shown in fig. 3, an embodiment of the present invention provides a card reader, which may include:
a determining module 301, configured to determine at least one card reader type and at least one operation method corresponding to each card reader type;
a selecting module 302, configured to select, from the at least one card reader type determined by the determining module 301, a target card reader type corresponding to a card to be read;
a generating module 303, configured to generate a card reader instantiation object corresponding to the target card reader type selected by the selecting module 302;
the invoking module 304, utilizing the card reader instantiation object generated by the generating module 303, invokes at least one target operation method to operate on the card to be read, where the at least one target operation method is included in at least one operation method corresponding to the target card reader type.
According to the embodiment shown in fig. 3, when the card to be read needs to be operated in the present solution, since the generation module can generate the card reader instantiation object for the card to be read, then the calling module can use the card reader instantiation object to call the operation method, so that the card to be read can be operated. Therefore, the scheme provided by the embodiment of the invention can reduce the complexity of realizing the loading of various card reader types.
In one embodiment of the present invention, the card reader may further include:
a relationship determining module 401, configured to determine a corresponding relationship between at least one card reader class and at least one sample identification information;
then, the generating module 303 may include: loading a sub-module 3031 and generating a sub-module 3032;
the loading submodule 3031 is configured to determine card reader identification information according to the type of the target card reader and the card to be read; loading a target card reader class corresponding to the card reader identification information by using a preset class loader according to the corresponding relation;
the generating submodule 3032 is configured to generate the card reader instantiation object by using the target card reader class.
In an embodiment of the present invention, as shown in fig. 5, the determining module 301 may include: a setting sub-module 3011 and a determination sub-module 3012;
the setting sub-module 3011 is configured to set at least one card reader interface, where each card reader interface includes at least one card reader method and corresponds to one card reader type; setting a public interface, wherein the public interface comprises at least one public method;
the determining sub-module 3012 is configured to, for each of the card reader types: and determining at least one operation method corresponding to the type of the card reader in at least one card reader method included by the corresponding card reader interface and at least one public method included by the public interface.
In an embodiment of the present invention, as shown in fig. 5, the invoking module 304 may include: a determination submodule 3041, a first calling submodule 3042, and a second calling submodule 3043;
the determining submodule 3041 is configured to determine whether a public method exists in the at least one target operation method, and if so, trigger the first invoking submodule 3042; otherwise, the second calling submodule 3043 is triggered;
the first invoking sub-module 3042 is configured to, under the triggering of the determining sub-module 3041, determine at least one to-be-invoked public method in the at least one target operation method, and invoke the at least one to-be-invoked public method from the public interface by using the card reader instantiation object;
the second invoking sub-module 3043 is configured to, under the trigger of the determining sub-module 3041, invoke the at least one target operation method from the card reader interface corresponding to the target card reader type by using the card reader instantiation object.
In an embodiment of the present invention, as shown in fig. 6, the card reader may further include: a monitoring module 501;
the monitoring module 501 is configured to monitor the operation progress of the card to be read, and display the monitored operation progress in real time.
Because the information interaction, execution process, and other contents between the units in the device are based on the same concept as the method embodiment of the present invention, specific contents may refer to the description in the method embodiment of the present invention, and are not described herein again.
In summary, the embodiments of the present invention can at least achieve the following beneficial effects:
1. in the embodiment of the invention, firstly, a set number of card reader types are determined, and a set number of operation methods corresponding to each card reader type are determined. When the card to be read needs to be operated, the target card reader type corresponding to the card to be read is selected from the determined card reader types, and a card reader instantiation object corresponding to the target card reader type is generated. And then calling at least one target operation method in the determined card reader type by using the generated card reader implementation object to operate the card to be read. Therefore, when the card to be read needs to be operated in the scheme, because the card reader instantiation object aiming at the card to be read can be generated, the card to be read can be operated by calling the operation method by using the card reader instantiation object. Therefore, the scheme provided by the embodiment of the invention can reduce the complexity of realizing the loading of various card reader types.
2. In the embodiment of the present invention, when at least one target operation method is called to operate a card to be read, each target operation method may be called from a card reader interface and a public interface corresponding to a type of a target card reader. Since the target operation method exists in the interface of the preset setting, the operation is easy to expand from the development point of view and the maintenance is convenient.
3. In the embodiment of the present invention, at least one operation method may select at least one or more of a card write once method, a card read once method, a card write cycle method, a card write stop cycle method, a card read cycle method, and a card read stop cycle method according to a service requirement. Therefore, the service applicability is strong.
4. In the embodiment of the invention, the class loader is used for loading the target card reader class corresponding to the card reader identification information, and the target card reader class is used for generating the card reader instantiation object. Since the instantiation object is generated according to the target card reader class, the uniqueness of the card reader instantiation object can be ensured.
5. In the embodiment of the present invention, after the card reader instantiation object is used to call the target operation method to operate the card to be read, the operation progress of the card to be read needs to be monitored. And displaying the monitored operation progress in real time. The user can know the operation condition of the card to be read according to the operation progress displayed in real time, and can find abnormal conditions in time according to the operation progress, so that the user can know the operation condition of the card to be read more comprehensively.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a" does not exclude the presence of other similar elements in a process, method, article, or apparatus that comprises the element.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it is to be noted that: the above description is only a preferred embodiment of the present invention, and is only used to illustrate the technical solutions of the present invention, and not to limit the protection scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (8)

1. A method for realizing card reader service is characterized in that,
determining at least one card reader type and at least one operation method corresponding to each card reader type;
further comprising:
selecting a target card reader type corresponding to a card to be read from the at least one card reader type;
generating a card reader instantiation object corresponding to the target card reader type;
calling at least one target operation method to operate the card to be read by utilizing the card reader instantiation object, wherein the at least one target operation method is included in at least one operation method corresponding to the type of the target card reader;
further comprising:
determining the corresponding relation between at least one card reader class and at least one sample identification information;
the generating of the card reader instantiation object corresponding to the target card reader type includes:
determining card reader identification information according to the type of the target card reader and the card to be read;
loading a target card reader class corresponding to the card reader identification information by using a preset class loader according to the corresponding relation;
and generating the card reader instantiation object by utilizing the target card reader class.
2. The method of claim 1,
the determining at least one card reader type and each card reader type corresponding to at least one operation method comprise:
setting at least one card reader interface, wherein each card reader interface comprises at least one card reader method and corresponds to one card reader type;
setting a public interface, wherein the public interface comprises at least one public method;
performing for each of the card reader types: and determining at least one operation method corresponding to the type of the card reader in at least one card reader method included by the corresponding card reader interface and at least one public method included by the public interface.
3. The method of claim 2,
the using the card reader instantiation object to call at least one target operation method to operate the card to be read includes:
a1: judging whether a public method exists in the at least one target operation method, if so, executing A2; otherwise, a3 is executed;
a2: determining at least one public method to be called in the at least one target operation method, and calling the at least one public method to be called from the public interface by using the card reader instantiation object;
a3: and calling the at least one target operation method from a card reader interface corresponding to the target card reader type by using the card reader instantiation object.
4. The method according to any one of claims 1 to 3,
at least one operation method corresponding to each card reader type comprises the following steps: at least one or more of a card single writing method, a card single reading method, a card circulating writing method, a card stopping writing circulating method, a card circulating reading method and a card stopping reading circulating method;
and/or the presence of a gas in the gas,
after the instantiating the object by the card reader and calling at least one target operation method to operate the card to be read, the method further comprises the following steps:
and monitoring the operation progress of the card to be read, and displaying the monitored operation progress in real time.
5. A card reader, comprising:
the system comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining at least one card reader type and at least one operation method corresponding to each card reader type;
the selection module is used for selecting a target card reader type corresponding to a card to be read from the at least one card reader type determined by the determination module;
the generating module is used for generating a card reader instantiation object corresponding to the target card reader type selected by the selecting module;
the calling module is used for calling at least one target operation method to operate the card to be read by utilizing the card reader instantiation object generated by the generating module, wherein the at least one target operation method is included in at least one operation method corresponding to the type of the target card reader;
further comprising:
the relation determining module is used for determining the corresponding relation between at least one card reader class and at least one sample identification information;
the generation module comprises: loading a submodule and generating a submodule;
the loading submodule is used for determining card reader identification information according to the type of the target card reader and the card to be read; loading a target card reader class corresponding to the card reader identification information by using a preset class loader according to the corresponding relation;
and the generation submodule is used for generating the card reader instantiation object by utilizing the target card reader class.
6. The card reader of claim 5,
the determining module includes: setting a submodule and determining a submodule;
the setting submodule is used for setting at least one card reader interface, wherein each card reader interface comprises at least one card reader method and corresponds to one card reader type; setting a public interface, wherein the public interface comprises at least one public method;
the determining submodule is used for executing the following steps for each card reader type: and determining at least one operation method corresponding to the type of the card reader in at least one card reader method included by the corresponding card reader interface and at least one public method included by the public interface.
7. The card reader of claim 6,
the calling module comprises: the judgment submodule, the first calling submodule and the second calling submodule;
the judging submodule is used for judging whether a public method exists in the at least one target operation method, and if so, triggering the first calling submodule; otherwise, triggering the second calling sub-module;
the first calling submodule is used for determining at least one public method to be called in the at least one target operation method under the trigger of the judging submodule, and calling the at least one public method to be called from the public interface by using the card reader instantiation object;
the second calling sub-module is configured to call the at least one target operation method from the card reader interface corresponding to the target card reader type by using the card reader instantiation object under the trigger of the determining sub-module.
8. The card reader according to any of claims 5 to 7,
further comprising: a monitoring module;
and the monitoring module is used for monitoring the operation progress of the card to be read and displaying the monitored operation progress in real time.
CN201711428220.4A 2017-12-26 2017-12-26 Card reader service implementation method and card reader Active CN108196886B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711428220.4A CN108196886B (en) 2017-12-26 2017-12-26 Card reader service implementation method and card reader

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711428220.4A CN108196886B (en) 2017-12-26 2017-12-26 Card reader service implementation method and card reader

Publications (2)

Publication Number Publication Date
CN108196886A CN108196886A (en) 2018-06-22
CN108196886B true CN108196886B (en) 2020-11-27

Family

ID=62584071

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711428220.4A Active CN108196886B (en) 2017-12-26 2017-12-26 Card reader service implementation method and card reader

Country Status (1)

Country Link
CN (1) CN108196886B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112491848B (en) * 2020-11-18 2022-07-08 山东浪潮通软信息科技有限公司 Method and equipment for supporting extensible secure docking of third-party system

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101221617A (en) * 2007-01-11 2008-07-16 劲永国际股份有限公司 Card reader and data processing method using the same
CN102509138A (en) * 2011-11-18 2012-06-20 山东神思电子技术股份有限公司 Authentication system based on second-generation ID card and human face feature recognition and working method therefor
CN102760075A (en) * 2012-06-01 2012-10-31 大唐微电子技术有限公司 Method and system for realizing application configuration of intelligent card
CN102800153A (en) * 2012-07-17 2012-11-28 武汉天喻信息产业股份有限公司 Service downloading method and system of card swiping terminal
CN103093541A (en) * 2011-10-31 2013-05-08 深圳光启高等理工研究院 Mobile payment distance control system and mobile payment distance control method
CN203311427U (en) * 2013-05-22 2013-11-27 中山市汉仁电子有限公司 Intelligent card identification system applied in identification field
CN103597779A (en) * 2011-06-08 2014-02-19 阿尔卡特朗讯 Method and apparatus for providing network access to a user entity
CN104360924A (en) * 2014-11-11 2015-02-18 上海天玑科技股份有限公司 Method for monitoring grade classification of virtual machine under cloud data center environment
CN105303115A (en) * 2015-10-29 2016-02-03 成都信息工程大学 Detection method and apparatus for out-of-bounds access bug of Java card

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8500544B2 (en) * 2006-01-24 2013-08-06 Igt Keno simulation of other game outcomes
CN101404000B (en) * 2008-01-04 2011-06-08 深圳市江波龙电子有限公司 Reading-writing method with multi-memory card logic in one
US9714995B2 (en) * 2011-03-23 2017-07-25 Millikelvin Technologies Llc Techniques, systems and machine readable programs for magnetic resonance
CN107066254B (en) * 2017-03-02 2021-02-02 武汉斗鱼网络科技有限公司 Method and device for calling animation data
CN107403119B (en) * 2017-06-13 2021-04-23 北京三快在线科技有限公司 Smart card information reading method and device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101221617A (en) * 2007-01-11 2008-07-16 劲永国际股份有限公司 Card reader and data processing method using the same
CN103597779A (en) * 2011-06-08 2014-02-19 阿尔卡特朗讯 Method and apparatus for providing network access to a user entity
CN103093541A (en) * 2011-10-31 2013-05-08 深圳光启高等理工研究院 Mobile payment distance control system and mobile payment distance control method
CN102509138A (en) * 2011-11-18 2012-06-20 山东神思电子技术股份有限公司 Authentication system based on second-generation ID card and human face feature recognition and working method therefor
CN102760075A (en) * 2012-06-01 2012-10-31 大唐微电子技术有限公司 Method and system for realizing application configuration of intelligent card
CN102800153A (en) * 2012-07-17 2012-11-28 武汉天喻信息产业股份有限公司 Service downloading method and system of card swiping terminal
CN203311427U (en) * 2013-05-22 2013-11-27 中山市汉仁电子有限公司 Intelligent card identification system applied in identification field
CN104360924A (en) * 2014-11-11 2015-02-18 上海天玑科技股份有限公司 Method for monitoring grade classification of virtual machine under cloud data center environment
CN105303115A (en) * 2015-10-29 2016-02-03 成都信息工程大学 Detection method and apparatus for out-of-bounds access bug of Java card

Also Published As

Publication number Publication date
CN108196886A (en) 2018-06-22

Similar Documents

Publication Publication Date Title
CN111814885B (en) Method, system, device and medium for managing image frames
CN108776595B (en) Method, device, equipment and medium for identifying display card of GPU (graphics processing Unit) server
CN108829371B (en) Interface control method and device, storage medium and electronic equipment
CN110704104A (en) Application counterfeit detection method, intelligent terminal and storage medium
CN111435391A (en) Method and apparatus for automatically determining interactive GUI elements to be interacted with in GUI
CN108319850A (en) Method, sandbox system and the sandbox equipment of sandbox detection
CN111597553A (en) Process processing method, device, equipment and storage medium in virus searching and killing
CN108196886B (en) Card reader service implementation method and card reader
CN109828715B (en) Screen recording method and device
CN111046349A (en) So library file reinforcement identification method, intelligent terminal and storage medium
CN108550033A (en) A kind of method and device of display Digital Object Unique Identifier
CN104809053A (en) Control style testing method and device
CN110647363B (en) Abnormity prompting method and device, storage medium and electronic equipment
CN113360805B (en) Data display method, device, computer equipment and storage medium
US20130125091A1 (en) Automatic program generation device and automatic program generation method
TWI732139B (en) Digital object unique identification code (DOI) display and transaction information verification method, device and equipment
CN112487414B (en) Method, device, equipment and storage medium for acquiring process command line
WO2016134637A1 (en) Bar code recognition method and device
CN111222377B (en) Commodity information determining method and device and electronic equipment
CN107766231A (en) A kind of automated testing method and device
US20230142407A1 (en) Apparatus for analyzing non-informative firmware and method using the same
US11989572B2 (en) Computer system enabled with runtime software module tracking
CN113805889B (en) Intelligent contract calling execution method, device, equipment and readable storage medium
CN113886774B (en) Anti-debugging method and device
JP4796876B2 (en) Risk prediction apparatus and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20201111

Address after: 250100 Ji'nan high tech Zone, Shandong, No. 1036 wave road

Applicant after: INSPUR GENERAL SOFTWARE Co.,Ltd.

Address before: 250100, No. 2877, fairway, Sun Town, Ji'nan hi tech Zone, Shandong

Applicant before: SHANDONG INSPUR GENESOFT INFORMATION TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant