CN108196886A - A kind of card reader service implementation method and card reader - Google Patents
A kind of card reader service implementation method and card reader Download PDFInfo
- Publication number
- CN108196886A CN108196886A CN201711428220.4A CN201711428220A CN108196886A CN 108196886 A CN108196886 A CN 108196886A CN 201711428220 A CN201711428220 A CN 201711428220A CN 108196886 A CN108196886 A CN 108196886A
- Authority
- CN
- China
- Prior art keywords
- card
- reader
- card reader
- style
- target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 241
- 238000011017 operating method Methods 0.000 claims abstract description 40
- 238000011068 loading method Methods 0.000 claims abstract description 14
- 238000007616 round robin method Methods 0.000 claims description 18
- 238000012544 monitoring process Methods 0.000 claims description 13
- 230000002159 abnormal effect Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000005856 abnormality Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 239000002131 composite material Substances 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 238000005538 encapsulation Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000004064 recycling Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/0008—General problems related to the reading of electronic memory record carriers, independent of its reading method, e.g. power transfer
Abstract
The present invention provides a kind of card reader service implementation methods and card reader, this method to include:Determine at least one card-reader style and the corresponding at least one operating method of each described card-reader style;In at least one card-reader style, the corresponding target card-reader style of card taking of continuing is selected;Generate the corresponding card reader instance object of the target card-reader style;Using the card reader instance object, at least one object run method is called to operate the card to be read, wherein, at least one object run method is included in the corresponding at least one operating method of the target card-reader style.Therefore, scheme provided by the invention can reduce the complexity for realizing a variety of card-reader style loadings.
Description
Technical field
The present invention relates to field of computer technology, more particularly to a kind of card reader service implementation method and card reader.
Background technology
The different types of cards such as bank card, IC card is applied relatively broad in daily life.In order to can be so as to
Profit operates various types card, it usually needs can realize that a variety of card-reader styles are common simultaneously in a card reader
Loading.
At present, realize that the method that a variety of card-reader styles load jointly is usually:Determine that each card-reader style corresponds to
At least one continue card taking, a corresponding applet control is then set respectively for each card taking of continuing.Then it is needing
When operating any card to be read, need to call its corresponding applet control, but due to being deposited in applet controls
It is cumbersome using complexity when calling in diversified interface and operation code.Therefore, existing mode realizes a variety of Card Readers
The loading of device type is complex.
Invention content
An embodiment of the present invention provides a kind of card reader service implementation method and card reader, can reduce and realize a variety of Card Readers
The complexity of device type loading.
In a first aspect, an embodiment of the present invention provides a kind of card reader service implementation method, this method includes:
Determine at least one card-reader style and the corresponding at least one operating method of each described card-reader style;
In at least one card-reader style, the corresponding target card-reader style of card taking of continuing is selected;
Generate the corresponding card reader instance object of the target card-reader style;
Using the card reader instance object, at least one object run method is called to grasp the card to be read
Make, wherein, at least one object run method is included in the corresponding at least one operation side of the target card-reader style
In method.
Preferably,
Further comprise:
Determine the correspondence of at least one card reader class and at least one sample identification information;
It is described to generate the corresponding card reader instance object of the target card-reader style, including:
According to the target card-reader style and the card taking of continuing, card reader identification information is determined;
According to the correspondence, mesh corresponding to the card reader identification information is loaded using preset Classloader
Mark card reader class;
Using the target card reader class, the card reader instance object is generated.
Preferably,
Determining at least one card-reader style and each described card-reader style correspond at least one operation side
Method, including
At least one card reader interface of setting, wherein, each described card reader interface includes at least one card reader
Method, and a kind of corresponding card-reader style;
Common interface is set, wherein, the common interface includes at least one public method;
It is performed both by for card-reader style each described:In at least one card reader that corresponding card reader interface includes
In at least one public method that method and the common interface include, the card-reader style corresponding at least one is determined
Kind operating method.
Preferably,
It is described to utilize the card reader instance object, at least one object run method is called to be read to be sticked into described
Row operation, including:
A1:Judge at least one object run method with the presence or absence of public method, if so, performing A2;Otherwise,
Perform A3;
A2:At least one public method to be called is determined at least one object run method, and utilize institute
It states card reader instance object and at least one public method to be called is called from the common interface;
A3:It is called from the corresponding card reader interface of the target card-reader style using the card reader instance object
At least one object run method.
Preferably,
The corresponding at least one operating method of each described card-reader style includes:Single card writing method, single Card Reader
Method, cycle card writing method stop writing at least one in card round-robin method, cycle card reading method and stopping Card Reader round-robin method
Kind is a variety of.
Preferably,
The card reader instance object is utilized described, calls at least one object run method to the card taking of continuing
After being operated, further comprise:
Continue the operation progress of card taking described in monitoring, and the operation progress monitored is carried out real-time exhibition.
Second aspect, an embodiment of the present invention provides a kind of card reader, which includes:
Determining module, for determining that at least one card-reader style and each described card-reader style are corresponding at least
A kind of operating method;
Selecting module, at least one card-reader style for being determined in the determining module, selecting and continuing
The corresponding target card-reader style of card taking;
Generation module, for generating the corresponding card reader reality of the target card-reader style that the selecting module is selected
Exampleization object;
Calling module, the card reader instance object generated using the generation module call at least one target
Operating method operates the card to be read, wherein, at least one object run method is included in the target and reads
In the corresponding at least one operating method of card device type.
Preferably,
Further comprise:
Relationship determination module closes for determining that at least one card reader class is corresponding at least one sample identification information
System;
The generation module, including:Load submodule and generation submodule;
The loading submodule, for according to the target card-reader style and the card taking of continuing, determining Card Reader
Device identification information;According to the correspondence, load the card reader identification information using preset Classloader and correspond to
Target card reader class;
The generation submodule for utilizing the target card reader class, generates the card reader instance object.
Preferably,
The determining module, including:Submodule and determination sub-module are set;
The setting submodule, for setting at least one card reader interface, wherein, in each described card reader interface
Including at least one card reader method, and correspond to a kind of card-reader style;Common interface is set, wherein, in the common interface
Including at least one public method;
The determination sub-module is performed both by for being directed to each described card-reader style:In corresponding card reader interface
Including at least one public method for including of at least one card reader method and the common interface in, determine the reading
The corresponding at least one operating method of card device type.
Preferably,
The calling module, including:Judging submodule, the first calling submodule and second call the submodule;
The judging submodule, for judging to whether there is public method at least one object run method, such as
Fruit is that submodule is called in triggering described first;Otherwise, it triggers described second and calls submodule;
Described first calls submodule, under the triggering of the judging submodule, being grasped at least one target
Make to determine at least one public method to be called in method, and utilize the card reader instance object from the common interface
It is middle to call at least one public method to be called;
Described second calls submodule, under the triggering of the judging submodule, being instantiated using the card reader
Object calls at least one object run method from the corresponding card reader interface of the target card-reader style.
Preferably,
Further comprise:Monitoring module;
The monitoring module, for monitoring the operation progress of the card taking of continuing, and by the operation progress monitored into
Row real-time exhibition.
An embodiment of the present invention provides a kind of card reader service implementation method and card reader, it is first determined setting quantity kind is read
Card device type and the corresponding setting quantity kind operating method of each determining card-reader style.It is needing to carry out card to be read
During operation, the corresponding target card-reader style of card taking of continuing is selected in identified card-reader style, and generates target reading
The corresponding card reader instance object of card device type.Then generated card reader embodiment object is utilized in identified reading
At least one object run method is called to operate card to be read in card device type.By above-mentioned it is found that in this programme
When needing to operate card to be read, the card reader instance object for card taking of continuing is directed to due to that can generate, is utilized
Card reader instance object goes call operation method that can be operated to card to be read.Therefore, the embodiment of the present invention provides
Scheme can reduce the complexity for realizing the loading of a variety of card-reader styles.
Description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, to embodiment or will show below
There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is the present invention
Some embodiments, for those of ordinary skill in the art, without creative efforts, can also basis
These attached drawings obtain other attached drawings.
Fig. 1 is a kind of flow chart of card reader service implementation method provided by one embodiment of the present invention;
Fig. 2 is a kind of flow chart for card reader service implementation method that another embodiment of the present invention provides;
Fig. 3 is a kind of structure diagram of card reader provided by one embodiment of the present invention;
Fig. 4 is a kind of structure diagram for card reader that another embodiment of the present invention provides;
Fig. 5 is the structure diagram of a kind of card reader that another embodiment of the invention provides;
Fig. 6 is a kind of structure diagram of card reader including monitoring module provided by one embodiment of the present invention.
Specific embodiment
Purpose, technical scheme and advantage to make the embodiment of the present invention are clearer, below in conjunction with the embodiment of the present invention
In attached drawing, the technical solution in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
Part of the embodiment of the present invention, instead of all the embodiments, based on the embodiments of the present invention, those of ordinary skill in the art
The all other embodiments obtained under the premise of creative work is not made, shall fall within the protection scope of the present invention.
As shown in Figure 1, an embodiment of the present invention provides a kind of card reader service implementation method, this method can include following
Step:
Step 101:Determine at least one card-reader style and the corresponding at least one of each described card-reader style
Operating method;
Step 102:In at least one card-reader style, the corresponding target card reader class of card taking of continuing is selected
Type;
Step 103:Generate the corresponding card reader instance object of the target card-reader style;
Step 104:Using the card reader instance object, at least one object run method is called to described to be read
Card is operated, wherein, at least one object run method is included in the target card-reader style corresponding at least one
In kind operating method.
Embodiment according to figure 1, it is first determined setting quantity kind card-reader style and each determining card reader
The corresponding setting quantity kind operating method of type.When needing to operate card to be read, in identified card-reader style
In select the corresponding target card-reader style of card taking of continuing, and generate the instantiation pair of target card-reader style corresponding card reader
As.Then generated card reader embodiment object is utilized to call at least one target behaviour in identified card-reader style
Make method to operate card to be read.By it is above-mentioned it is found that in this programme need to it is to be read card operate when, by
In the card reader instance object that is directed to card taking of continuing can be generated, call operation method is gone using card reader instance object
Card to be read can be operated.Therefore, scheme provided in an embodiment of the present invention, which can reduce, realizes a variety of card reader classes
The complexity of type loading.
In an embodiment of the invention, at least one card-reader style involved in flow chart shown in above-mentioned Fig. 1 can
To be determined according to business need.For example, at least one card-reader style can include but is not limited to card reader of ID card, integrated electricity
At least one of an outpost of the tax office's IC card card reader and bank's card reader are a variety of.
In the present embodiment, each card-reader style can correspond at least one card reader manufacturer.
In an embodiment of the invention, the step 101 in flow chart shown in above-mentioned Fig. 1 determines at least one card reader class
Type and each described card-reader style correspond at least one operating method, can include:
At least one card reader interface of setting, wherein, each described card reader interface includes at least one card reader
Method, and a kind of corresponding card-reader style;
Common interface is set, wherein, the common interface includes at least one public method;
It is performed both by for card-reader style each described:In at least one card reader that corresponding card reader interface includes
In at least one public method that method and the common interface include, the card-reader style corresponding at least one is determined
Kind operating method.
In the present embodiment, the public method that common interface includes is the side that each card-reader style can call
Method.Wherein, at least one public method that common interface includes can include but is not limited to cycle card reading method and stop reading
At least one of card round-robin method is a variety of.
In the present embodiment, each card reader interface can be a kind of interface of card reader manufacturer oneself encapsulation.For example,
It can include state of mind card reader of ID card interface, the corresponding card-reader style of the card reader interface is card reader of ID card;It can be with
Card reader of ID card interface is regarded including China, the corresponding card-reader style of the card reader interface is card reader of ID card;It can include
De Ka banks card reader, the corresponding card-reader style of the card reader interface are bank's card reader.
In the present embodiment, the corresponding at least one card reader method of each card reader interface can include but is not limited to
Single card writing method, cycle card writing method, stops writing at least one of card round-robin method or a variety of single card reading method.
In the present embodiment, determine that the corresponding at least one operating method of each card-reader style can be by following mistake
Cheng Shixian:
B1 is performed both by B6 for each card-reader style:
B1:Judge whether current card-reader style needs at least one public method to be placed of setting, if so, performing
B2;Otherwise, B3 is performed;
B2:At least one public method to be placed is selected in at least one public method included in common interface, and
Perform B3;
B3:Judge whether current card-reader style needs at least one card reader method to be placed of setting, if so, performing
B4;Otherwise, B6 is performed;
B4:At least one card reader method to be placed is selected in the corresponding card reader interface of current card-reader style;
B5:At least one public method to be placed selected and at least one card reader method to be placed are determined as
The corresponding operating method of current card-reader style.
B6:At least one card reader method to be placed selected is determined as the corresponding operation side of current card-reader style
Method.
In an embodiment of the invention, the step 104 in flow chart shown in above-mentioned Fig. 1 is instantiated using the card reader
Object calls at least one object run method to operate the card to be read, can include:
A1:Judge at least one object run method with the presence or absence of public method, if so, performing A2;Otherwise,
Perform A3;
A2:At least one public method to be called is determined at least one object run method, and utilize institute
It states card reader instance object and at least one public method to be called is called from the common interface;
A3:It is called from the corresponding card reader interface of the target card-reader style using the card reader instance object
At least one object run method.
In the present embodiment, at least one object run method is judged there are during public method, at least one
Each public method to be called is determined in object run method.Then it is adjusted from common interface using card reader instance object
With each public method to be called.And judge with the presence or absence of card reader method at least one object run method, if so,
Various card reader methods to be called are determined at least one object run method, in the corresponding card reader of target card-reader style
Various card reader methods to be called are called in style interface, and utilize the public method to be called called and Card Reader to be called
Device method operates card to be read.
In the present embodiment, when public method is not present in judging at least one object run method, illustrate at least
A kind of object run method is card reader method, then using card reader instance object from the corresponding reading of target card-reader style
At least one object run method is called in card device interface, and card to be read is grasped using the object run method called
Make.
In the present embodiment, in card taking of continuing for IC card, and object run method includes single card writing method, single Card Reader
During method, using card reader instance object, at least one object run method is called to operate and can wrap card to be read
It includes:Single card reading method reading IC card is called to specify the card number in region (such as chip) using IC card card reader instance object
And the amount of money.Single card writing method is called to be write in IC card specifies region (such as chip) using IC card card reader instance object
Enter the amount of money of setting.
In the present embodiment, continue card taking for identity card when, and object run method include cycle card reading method when, profit
With card reader instance object, at least one object run method is called to operate and can include card to be read:Utilize body
Part card card reader instance object calls identification card number, name, address, identity card figure in cycle card reading method reading identity card
Piece.
In the present embodiment, in card taking of continuing for the bank card (composite card that magnetic stripe card, chip card or magnetic stripe and chip coexist
In any one) when, and when object run method includes single card reading method, using card reader instance object, call extremely
A kind of few object run method is operated and can be included to card to be read:It is called using bank's card reader instance object single
Secondary card reading method reads the bank card number in bank card.
According to above-described embodiment, when at least one object run method is called to operate card to be read, Ke Yicong
Each object run method is called in the corresponding card reader interface of target card-reader style and common interface.Due to object run
Method exists in the interface of default setting, therefore, is operated for the angle of exploitation and is easy to extend and convenient for safeguarding.
In an embodiment of the invention, each involved card reader class in flow chart shown in above-mentioned Fig. 1
The corresponding at least one operating method of type can include:Single card writing method, cycle card writing method, stops single card reading method
It writes card round-robin method, cycle card reading method and stops at least one of Card Reader round-robin method or a variety of.
In the present embodiment, at least one operating method can be configured according to business need, it is mentioned above at least
A kind of operating method can include single card writing method, single card reading method, cycle card writing method, stop write card round-robin method,
It recycles card reading method and stops at least one of Card Reader round-robin method or a variety of, only a kind of preferred mode.It can be with
At least one operating method is increased and deleted according to business need.
According to above-described embodiment, at least one operating method can select single card writing method, single according to business need
Card reading method, cycle card writing method stop writing card round-robin method, cycle card reading method and stop in Card Reader round-robin method extremely
It is few one or more.Therefore, business is with strong applicability.
In an embodiment of the invention, at least one card reader is further comprised determining in card reader service implementation method
During the correspondence of class and at least one sample identification information,
Then, the step 103 in flow chart shown in above-mentioned Fig. 1 generates the corresponding card reader example of the target card-reader style
Change object, can include:
According to the target card-reader style and the card taking of continuing, card reader identification information is determined;
According to the correspondence, mesh corresponding to the card reader identification information is loaded using preset Classloader
Mark card reader class;
Using the target card reader class, the card reader instance object is generated.
In the present embodiment, each card reader class corresponds to a sample identification information respectively in correspondence.It is each
A card reader class corresponds to the attribute information and method of manufacturer's card reader.
In the present embodiment, according to target card-reader style and card taking of continuing, the side of card reader identification information is determined
Method can include:It determines the type information of target card-reader style and determines the corresponding trade name of card taking that continues, generate lattice
Formula is the card reader identification information of " card-reader style _ manufacturer's initial ".
In the present embodiment, according to target card-reader style and card taking of continuing, determine card reader identification information it
Afterwards, the sample identification information consistent with card reader identification information is found out at least one sample identification information.Then basis
Correspondence determines target card reader class corresponding with the sample identification information found out.Then it is loaded using Classloader
The attribute information and method that target card reader class includes.After loading is completed, preset construction letter can be passed through
Number (such as constructed fuction of TestClass) utilizes the target card reader class of loading, the corresponding reading of generation target card-reader style
Card device instance object.
According to above-described embodiment, target card reader class corresponding to card reader identification information, and profit are loaded using Classloader
With target card reader class, card reader instance object is generated.Since instance object is generated according to target card reader class, because
This can ensure the uniqueness of card reader instance object.
In an embodiment of the invention, step 104 is instantiated using the card reader in flow chart shown in above-mentioned Fig. 1
Object after at least one object run method of calling operates the card to be read, may further include:
Continue the operation progress of card taking described in monitoring, and the operation progress monitored is carried out real-time exhibition.
In the present embodiment, at least one object run method is being called to card to be read using card reader instance object
After being operated, in order to understand the operation progress for card taking of continuing in time, the operation progress of card to be read can be monitored,
And the operation progress monitored is subjected to real-time exhibition.
In the present embodiment, user can recognize the operational circumstances for card taking of continuing according to the operation progress of real-time exhibition,
And can in time found the abnormal situation according to operation progress, to carry out abnormality processing to abnormal conditions in time.
According to above-described embodiment, card to be read is being grasped using card reader instance object invocation target operating method
After work, need to monitor the operation progress for card taking of continuing.And the operation progress monitored is subjected to real-time exhibition.So that user
The operational circumstances for card taking of continuing can be recognized according to the operation progress of real-time exhibition, and can in time be found according to operation progress
Abnormal conditions more fully recognize the operational circumstances for card taking of continuing thereby using family.
Below for including card reader of ID card, IC card card reader and bank's card reader for card-reader style.Exhibition
It opens and illustrates card reader service implementation method, as shown in Fig. 2, the card reader service implementation method may include steps of:
Step 201:At least one card reader interface of setting, wherein, each card reader interface includes at least one reading
Card device method, and a kind of corresponding card-reader style.
In this step, there is provided card reader interface 1, card reader interface 2 and card reader interfaces 3.Wherein, card reader connects
Mouth 1 corresponds to card reader of ID card, card reader interface 2 corresponds to IC card card reader, card reader interface 3 corresponds to bank's card reader.
In this step, the card reader method that each card reader interface includes is single card writing method, single reading
Chucking method, stops writing card round-robin method cycle card writing method.
Step 202:Common interface is set, wherein, common interface includes at least one public method.
In this step, common interface includes recycling card reading method and stops Card Reader round-robin method.
Step 203:Determine at least one card-reader style.
In this step, determining card-reader style includes card reader of ID card, IC card card reader and bank card Card Reader
Device.
Step 204:It is performed both by for each card-reader style:In at least one reading that corresponding card reader interface includes
In at least one public method that card device method and common interface include, the corresponding at least one behaviour of card-reader style is determined
Make method.
In this step, by card-reader style to be illustrated for IC card card reader:It will be in corresponding card reader interface 2
Method " single card writing method, cycle card writing method, stops writing card round-robin method single card reading method " and common interface packet
The method " cycle card reading method and stopping Card Reader round-robin method " included is determined as the corresponding operating method of IC card card reader.
Step 205:Determine the correspondence of at least one card reader class and at least one sample identification information.
In this step, for example, determining at least one card reader class includes writing brush high mountain IC card reader classes, writing brush high mountain IC is read
The corresponding sample identification information of card device class is C_HY.
Step 206:In at least one card-reader style, the corresponding target card-reader style of card taking of continuing is selected.
In this step, in various card-reader styles, the corresponding target card reader class of card taking of continuing " IC card 1 " is selected
Type is IC card card reader.
Step 207:According to target card-reader style and card taking of continuing, card reader identification information is determined.
In this step, it determines the type information " IC card " of target card-reader style and determines the corresponding factory of card taking of continuing
Quotient's title " writing brush high mountain ", generation form are the card reader identification information " C_HY " of " card-reader style _ manufacturer's initial ".
Step 208:According to correspondence, mesh corresponding to preset Classloader loading card reader identification information is utilized
Mark card reader class.
In this step, the correspondence set according to step 205 loads card reader using preset Classloader
The corresponding target card reader class of identification information " C_HY " " writing brush high mountain IC card reader class ".
Step 209:Using target card reader class, card reader instance object is generated.
In this step, it can be utilized and added by preset constructed fuction (such as constructed fuction of TestClass)
The target card reader class of load, the corresponding card reader instance object of generation target card-reader style " IC card card reader ".
Step 210:Determine at least one object run method, wherein, at least one object run method is included in target
In the corresponding at least one operating method of card-reader style.
In this step, at least one object run method determined includes single card writing method.
Step 211:Judge at least one object run method with the presence or absence of public method, if so, performing step
212;Otherwise, step 215 is performed.
In this step, judge that there is no public methods in object run method, perform step 215.
Step 212:At least one public method to be called is determined at least one object run method, and utilizes reading
Card device instance object calls at least one public method to be called from common interface.
Step 213:It is adjusted from the corresponding card reader interface of target card-reader style using the card reader instance object
With at least one card reader method to be called, wherein, at least one card reader method to be called is at least one object run side
It is not determined as the object run method of public method to be called in method.
Step 214:At least one public method to be called and at least one called using card reader instance object
Card reader method to be called operates, and perform step 217 card to be read.
Step 215:Called from the corresponding card reader interface of target card-reader style using card reader instance object to
A kind of few object run method.
In this step, using the card reader instance object generated in step 209 from the corresponding Card Reader of IC card card reader
Single card writing method is called in device interface.
Step 216:Card to be read is carried out using at least one object run method that card reader instance object calls
Operation.
In this step, reading card " IC card 1 " is treated using the single card writing method of calling to be operated.For example, it will set
The fixed amount of money is written in specified region (chip).
Step 217:The operation progress for card taking of continuing is monitored, and the operation progress monitored is subjected to real-time exhibition.
In this step, the operation progress for card taking " IC card 1 " that continue is monitored, and the operation progress monitored is carried out in fact
When show.So that user recognizes operation progress in time according to displaying.
Can the present embodiment be realized by following code.Code includes:
As shown in figure 3, an embodiment of the present invention provides a kind of card reader, which can include:
Determining module 301, for determining that at least one card-reader style and each described card-reader style are corresponding
At least one operating method;
Selecting module 302, in the determining at least one card-reader style of the determining module 301, selecting
Go out the corresponding target card-reader style of card taking of continuing;
Generation module 303, for generating the corresponding reading of the target card-reader style that the selecting module 302 is selected
Card device instance object;
Calling module 304, the card reader instance object generated using the generation module 303 call at least one
Kind object run method operates the card to be read, wherein, at least one object run method is included in described
In the corresponding at least one operating method of target card-reader style.
Shown embodiment according to fig. 3, in this programme when needing to operate card to be read, due to generation module
The card reader instance object for being directed to card taking of continuing can be generated, then calling module goes to adjust using card reader instance object
Card to be read can be operated with operating method.Therefore, it is more can to reduce realization for scheme provided in an embodiment of the present invention
The complexity of kind card-reader style loading.
In an embodiment of the invention, card reader may further include:
Relationship determination module 401, for determining that at least one card reader class is corresponding at least one sample identification information
Relationship;
Then, the generation module 303 can include:Load submodule 3031 and generation submodule 3032;
The loading submodule 3031, for according to the target card-reader style and the card taking of continuing, determining
Card reader identification information;According to the correspondence, the card reader identification information is loaded using preset Classloader
Corresponding target card reader class;
The generation submodule 3032, for utilizing the target card reader class, generates the card reader instance object.
In an embodiment of the invention, as shown in figure 5, the determining module 301 can include:Submodule 3011 is set
And determination sub-module 3012;
The setting submodule 3011, for setting at least one card reader interface, wherein, each described card reader connects
Mouth includes at least one card reader method, and a kind of corresponding card-reader style;Common interface is set, wherein, it is described public to connect
Mouth includes at least one public method;
The determination sub-module 3012 is performed both by for being directed to each described card-reader style:In corresponding card reader
In at least one public method that at least one card reader method and the common interface that interface includes include, institute is determined
State the corresponding at least one operating method of card-reader style.
In an embodiment of the invention, as shown in figure 5, the calling module 304 can include:Judging submodule
3041st, first submodule 3042 and second is called to call submodule 3043;
The judging submodule 3041, for judging at least one object run method with the presence or absence of public side
Method, if so, submodule 3042 is called in triggering described first;Otherwise, it triggers described second and calls submodule 3043;
Described first calls submodule 3042, under the triggering of the judging submodule 3041, described at least one
Determine at least one public method to be called in kind of object run method, and using the card reader instance object from described
At least one public method to be called is called in common interface;
Described second calls submodule 3043, under the triggering of the judging submodule 3041, utilizing the Card Reader
Device instance object calls at least one object run side from the corresponding card reader interface of the target card-reader style
Method.
In an embodiment of the invention, as shown in fig. 6, card reader may further include:Monitoring module 501;
The monitoring module 501, for monitoring the operation progress of the card taking of continuing, and the operation progress that will be monitored
Carry out real-time exhibition.
The contents such as the information exchange between each unit, implementation procedure in above device, due to implementing with the method for the present invention
Example can be found in the narration in the method for the present invention embodiment based on same design, particular content, and details are not described herein again.
In conclusion each embodiment of the present invention can at least realize following advantageous effect:
1st, in embodiments of the present invention, it is first determined setting quantity kind card-reader style and each determining card reader class
The corresponding setting quantity kind operating method of type.When needing to operate card to be read, in identified card-reader style
The corresponding target card-reader style of card taking of continuing is selected, and generates the corresponding card reader instantiation pair of target card-reader style
As.Then generated card reader embodiment object is utilized to call at least one target behaviour in identified card-reader style
Make method to operate card to be read.By it is above-mentioned it is found that in this programme need to it is to be read card operate when, by
In the card reader instance object that is directed to card taking of continuing can be generated, call operation method is gone using card reader instance object
Card to be read can be operated.Therefore, scheme provided in an embodiment of the present invention, which can reduce, realizes a variety of card reader classes
The complexity of type loading.
It 2nd, in embodiments of the present invention, can when at least one object run method is called to operate card to be read
To call each object run method from the corresponding card reader interface of target card-reader style and common interface.Due to target
Operating method exists in the interface of default setting, therefore, is operated for the angle of exploitation and is easy to extend and convenient for safeguarding.
3rd, in embodiments of the present invention, at least one operating method can be selected according to business need single card writing method,
Single card reading method, cycle card writing method stop writing card round-robin method, cycle card reading method and stop in Card Reader round-robin method
It is at least one or more of.Therefore, business is with strong applicability.
4th, in embodiments of the present invention, target card reader class corresponding to card reader identification information is loaded using Classloader,
And target card reader class is utilized, generate card reader instance object.Since instance object is generated according to target card reader class
, therefore can ensure the uniqueness of card reader instance object.
5th, in embodiments of the present invention, it is sticked into using card reader instance object invocation target operating method to be read
After row operation, need to monitor the operation progress for card taking of continuing.And the operation progress monitored is subjected to real-time exhibition.So that
User can recognize the operational circumstances for card taking of continuing according to the operation progress of real-time exhibition, and can be timely according to operation progress
It found the abnormal situation, the operational circumstances for card taking of continuing more fully are recognized thereby using family.
It should be noted that herein, such as first and second etc relational terms are used merely to an entity
Or operation is distinguished with another entity or operation, is existed without necessarily requiring or implying between these entities or operation
Any actual relationship or order.Moreover, term " comprising ", "comprising" or its any other variant be intended to it is non-
It is exclusive to include, so that process, method, article or equipment including a series of elements not only include those elements,
But also it including other elements that are not explicitly listed or further includes solid by this process, method, article or equipment
Some elements.In the absence of more restrictions, the element limited by sentence " including one ", is not arranged
Except in the process, method, article or apparatus that includes the element also in the presence of other identical factor.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above method embodiment can pass through
The relevant hardware of program instruction is completed, and aforementioned program can be stored in computer-readable storage medium, the program
When being executed, step including the steps of the foregoing method embodiments is performed;And aforementioned storage medium includes:ROM, RAM, magnetic disc or light
In the various media that can store program code such as disk.
It is last it should be noted that:The foregoing is merely presently preferred embodiments of the present invention, is merely to illustrate the skill of the present invention
Art scheme, is not intended to limit the scope of the present invention.Any modification for being made all within the spirits and principles of the present invention,
Equivalent replacement, improvement etc., are all contained in protection scope of the present invention.
Claims (10)
1. a kind of card reader service implementation method, which is characterized in that
Determine at least one card-reader style and the corresponding at least one operating method of each described card-reader style;
It further includes:
In at least one card-reader style, the corresponding target card-reader style of card taking of continuing is selected;
Generate the corresponding card reader instance object of the target card-reader style;
Using the card reader instance object, at least one object run method is called to operate the card to be read,
Wherein, at least one object run method is included in the corresponding at least one operating method of the target card-reader style
In.
2. according to the method described in claim 1, it is characterized in that,
Further comprise:
Determine the correspondence of at least one card reader class and at least one sample identification information;
It is described to generate the corresponding card reader instance object of the target card-reader style, including:
According to the target card-reader style and the card taking of continuing, card reader identification information is determined;
According to the correspondence, load target corresponding to the card reader identification information using preset Classloader and read
Card device class;
Using the target card reader class, the card reader instance object is generated.
3. according to the method described in claim 1, it is characterized in that,
Determining at least one card-reader style and each described card-reader style correspond at least one operating method, packet
It includes:
At least one card reader interface of setting, wherein, each described card reader interface includes at least one card reader method,
And a kind of corresponding card-reader style;
Common interface is set, wherein, the common interface includes at least one public method;
It is performed both by for card-reader style each described:In at least one card reader method that corresponding card reader interface includes
And at least one public method for including of the common interface, the corresponding at least one behaviour of the card-reader style is determined
Make method.
4. according to the method described in claim 3, it is characterized in that,
It is described to utilize the card reader instance object, at least one object run method is called to grasp the card to be read
Make, including:
A1:Judge at least one object run method with the presence or absence of public method, if so, performing A2;Otherwise, it performs
A3;
A2:At least one public method to be called is determined at least one object run method, and utilize the reading
Card device instance object calls at least one public method to be called from the common interface;
A3:Described in being called from the corresponding card reader interface of the target card-reader style using the card reader instance object
At least one object run method.
5. method according to any one of claims 1 to 4, which is characterized in that
The corresponding at least one operating method of each described card-reader style includes:Single card writing method, single card reading method,
Cycle card writing method, stop writing card round-robin method, cycle card reading method and stop at least one of Card Reader round-robin method or
It is a variety of;
And/or
The card reader instance object is utilized described, at least one object run method is called to carry out the card to be read
After operation, further comprise:
Continue the operation progress of card taking described in monitoring, and the operation progress monitored is carried out real-time exhibition.
6. a kind of card reader, which is characterized in that including:
Determining module, for determining at least one card-reader style and the corresponding at least one of each described card-reader style
Operating method;
Selecting module, at least one card-reader style for being determined in the determining module, selecting card taking of continuing
Corresponding target card-reader style;
Generation module, for generating the corresponding card reader instantiation of the target card-reader style that the selecting module is selected
Object;
Calling module, the card reader instance object generated using the generation module call at least one object run
Method operates the card to be read, wherein, at least one object run method is included in the target card reader
In the corresponding at least one operating method of type.
7. card reader according to claim 6, which is characterized in that
Further comprise:
Relationship determination module, for determining the correspondence of at least one card reader class and at least one sample identification information;
The generation module, including:Load submodule and generation submodule;
The loading submodule, for according to the target card-reader style and the card taking of continuing, determining card reader mark
Know information;According to the correspondence, mesh corresponding to the card reader identification information is loaded using preset Classloader
Mark card reader class;
The generation submodule for utilizing the target card reader class, generates the card reader instance object.
8. card reader according to claim 6, which is characterized in that
The determining module, including:Submodule and determination sub-module are set;
The setting submodule, for setting at least one card reader interface, wherein, each described card reader interface includes
At least one card reader method, and a kind of corresponding card-reader style;Common interface is set, wherein, the common interface includes
At least one public method;
The determination sub-module is performed both by for being directed to each described card-reader style:Include in corresponding card reader interface
At least one card reader method and at least one public method for including of the common interface in, determine the card reader
The corresponding at least one operating method of type.
9. card reader according to claim 8, which is characterized in that
The calling module, including:Judging submodule, the first calling submodule and second call the submodule;
The judging submodule, for judging at least one object run method with the presence or absence of public method, if so,
It triggers described first and calls submodule;Otherwise, it triggers described second and calls submodule;
Described first calls submodule, under the triggering of the judging submodule, at least one object run side
At least one public method to be called is determined in method, and is adjusted from the common interface using the card reader instance object
With at least one public method to be called;
Described second calls submodule, under the triggering of the judging submodule, utilizing the card reader instance object
At least one object run method is called from the corresponding card reader interface of the target card-reader style.
10. according to any card reader of claim 6 to 9, which is characterized in that
Further comprise:Monitoring module;
The monitoring module for monitoring the operation progress of the card taking of continuing, and the operation progress monitored is carried out in fact
When show.
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 true CN108196886A (en) | 2018-06-22 |
CN108196886B 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) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112491848A (en) * | 2020-11-18 | 2021-03-12 | 山东浪潮通软信息科技有限公司 | Method and equipment for supporting extensible secure docking of third-party system |
Citations (14)
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 |
CN101404000A (en) * | 2008-01-04 | 2009-04-08 | 深圳市江波龙电子有限公司 | Reading-writing method and device with multi-memory card logic in one |
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 |
US20130316778A1 (en) * | 2006-01-24 | 2013-11-28 | Igt | Keno simulation of other game outcomes |
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 |
CN105190296A (en) * | 2013-03-15 | 2015-12-23 | 米利开尔文科技有限公司 | Improved techniques, systems and machine readable programs for magnetic resonance |
CN105303115A (en) * | 2015-10-29 | 2016-02-03 | 成都信息工程大学 | Detection method and apparatus for out-of-bounds access bug of Java card |
CN107066254A (en) * | 2017-03-02 | 2017-08-18 | 武汉斗鱼网络科技有限公司 | A kind of method and device for calling animation data |
CN107403119A (en) * | 2017-06-13 | 2017-11-28 | 北京三快在线科技有限公司 | A kind of smart card information read method and device |
-
2017
- 2017-12-26 CN CN201711428220.4A patent/CN108196886B/en active Active
Patent Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130316778A1 (en) * | 2006-01-24 | 2013-11-28 | Igt | Keno simulation of other game outcomes |
CN101221617A (en) * | 2007-01-11 | 2008-07-16 | 劲永国际股份有限公司 | Card reader and data processing method using the same |
CN101404000A (en) * | 2008-01-04 | 2009-04-08 | 深圳市江波龙电子有限公司 | Reading-writing method and device with multi-memory card logic in one |
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 |
CN105190296A (en) * | 2013-03-15 | 2015-12-23 | 米利开尔文科技有限公司 | Improved techniques, systems and machine readable programs for magnetic resonance |
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 |
CN107066254A (en) * | 2017-03-02 | 2017-08-18 | 武汉斗鱼网络科技有限公司 | A kind of method and device for calling animation data |
CN107403119A (en) * | 2017-06-13 | 2017-11-28 | 北京三快在线科技有限公司 | A kind of smart card information read method and device |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112491848A (en) * | 2020-11-18 | 2021-03-12 | 山东浪潮通软信息科技有限公司 | Method and equipment for supporting extensible secure docking of third-party system |
CN112491848B (en) * | 2020-11-18 | 2022-07-08 | 山东浪潮通软信息科技有限公司 | Method and equipment for supporting extensible secure docking of third-party system |
Also Published As
Publication number | Publication date |
---|---|
CN108196886B (en) | 2020-11-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106156353B (en) | A kind of method and system increasing multilingual on-the-flier compiler enforcement engine for database | |
CN108319543A (en) | A kind of asynchronous processing method and its medium, system of computer log data | |
CN105975948A (en) | Cloud service platform architecture for face identification | |
CN103794000B (en) | Method for processing in case of non-contact IC card data reading failure and device for implementing method | |
US20090313501A1 (en) | Method and arrangement for processing transactions in a flash type memory device | |
CN108492177A (en) | Domestic assets cross-border transaction method, server and storage medium | |
CN107480963A (en) | Payment processing method, device and electronic equipment | |
CN112560114B (en) | Method and device for calling intelligent contract | |
CN110310079A (en) | Request for data evaluation method, device, computer equipment and storage medium based on intelligent decision | |
CN109376811A (en) | A kind of intelligence changes chucking method, device, terminal and computer-readable medium | |
Faraj et al. | Investigation of Java Smart Card Technology for Multi-Task Applications | |
KR100197761B1 (en) | Ic card and ic card access processing method | |
CN1211329A (en) | Method of modifying the instruction set of a smart card | |
CN109816517A (en) | Based on method for processing business, device, computer equipment and the storage medium for increasing letter | |
CN108196886A (en) | A kind of card reader service implementation method and card reader | |
CN105100372B (en) | Minutes method and mobile terminal | |
CN103810249B (en) | A kind of method and system of the multiple print test cma algorithms of compatibility | |
TWI240893B (en) | Microprocessor circuit for portable data carriers | |
CN110245954A (en) | Method and apparatus for risk control | |
CN107437174A (en) | virtual card management method and device | |
CN106021492A (en) | Method and device for unloading form data | |
CN110515974A (en) | Data pick-up method, apparatus, computer equipment and storage medium | |
CN101989365A (en) | Power source device and control method thereof | |
CA2818567C (en) | Method for the creation of a dynamic data record within a payment system environment application | |
CN109508994A (en) | Business risk control method, device, computer equipment and storage medium |
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 |