[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN104484636A - Data reading method and device - Google Patents

Data reading method and device Download PDF

Info

Publication number
CN104484636A
CN104484636A CN201410856329.8A CN201410856329A CN104484636A CN 104484636 A CN104484636 A CN 104484636A CN 201410856329 A CN201410856329 A CN 201410856329A CN 104484636 A CN104484636 A CN 104484636A
Authority
CN
China
Prior art keywords
card
card reader
program
data
cpu
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.)
Pending
Application number
CN201410856329.8A
Other languages
Chinese (zh)
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.)
Shenzhen Kemanda Intelligent Management Science & Technology Co Ltd
Original Assignee
Shenzhen Kemanda Intelligent Management Science & Technology 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 Shenzhen Kemanda Intelligent Management Science & Technology Co Ltd filed Critical Shenzhen Kemanda Intelligent Management Science & Technology Co Ltd
Priority to CN201410856329.8A priority Critical patent/CN104484636A/en
Publication of CN104484636A publication Critical patent/CN104484636A/en
Pending legal-status Critical Current

Links

Landscapes

  • Credit Cards Or The Like (AREA)

Abstract

The invention is applicable to the technical field of data reading and provides a data reading method and device. The data reading method comprises the steps that a card reading program of IC cards, a card reading program of ID cards and a card reading program of CPU cards are acquired; the card reading program of the IC cards, the card reading program of the ID cards and the card reading program of the CPU cards are divided in a modularization mode; according to a pre-configured polling sequence, the card reading program of the IC cards, the card reading program of the ID cards and the card reading program of the CPU cards are called for reading the cards in a polling mode. The data reading method and device have the advantages that on one hand, delay of program execution can be prevented; on the other hand, the robustness of the programs can be increased; therefore, the problems that data are misread and can not be read out due to the fact that the data reading speed and the data reading reliability are low through existing data reading methods of card readers or card senders are solved; on the condition that the card readers or the card senders are used normally, the data reading speed is increased, and the data reading reliability is also improved.

Description

A kind of method for reading data and device
Technical field
The invention belongs to data reading techniques field, particularly relate to a kind of method for reading data and device.
Background technology
At present, hold in fields such as passage, parking lot, gate inhibitions very general, usually adopt the method for reading data of card reader, read card internal information, to pay Parking Fee.And according to the difference of the situations such as user-selected set meal and Interim use, the card class held also is not quite similar, popular at present have IC-card, ID card, CPU card etc.
But the method for reading data of existing card reader or card sender, reads data speed slow, and the reliability reading data is low, easily there are misreading data and can not the situation of sense data.Its reason is, existing usual employing be compatible card sender or card reader, i.e. a card sender or card reader can read the data in IC-card but also the data that can read in ID card, CPU card, and Data Update is carried out to it.And in compatible card sender or card reader, do not distinguish the Card Reader program of IC-card, ID card, CPU card, the Card Reader program of IC-card, ID card, CPU card can perform simultaneously at one time, therefore there is interference between each Card Reader program, therefore data speed is read slow, read the reliability of data low, easily occur misreading data and can not the situation of sense data.
Summary of the invention
The object of the embodiment of the present invention is to provide a kind of method for reading data, is intended to the method for reading data solving existing card reader or card sender, reads data speed slow, and the reliability reading data is low, causes misreading data and can not the problem of sense data.
The embodiment of the present invention is achieved in that a kind of method for reading data, comprising:
Obtain the Card Reader program of IC-card, ID card, CPU card;
Adopt Componentized mode, separately the Card Reader program of described IC-card, ID card, CPU card;
Adopt pre-configured polling sequence, call the Card Reader program of described IC-card, ID card, CPU card, poll Card Reader.
Another object of the embodiment of the present invention is to provide a kind of data fetch device, comprising:
Card Reader program acquisition module, for obtaining the Card Reader program of IC-card, ID card, CPU card;
Card Reader program separates module, for adopting Componentized mode, and the separately Card Reader program of described IC-card, ID card, CPU card;
Card Reader program poller module, for adopting pre-configured polling sequence, calls the Card Reader program of described IC-card, ID card, CPU card, poll Card Reader.
In embodiments of the present invention, adopt Componentized mode, the separately Card Reader program of described IC-card, ID card, CPU card, adopt pre-configured polling sequence, call the Card Reader program of described IC-card, ID card, CPU card, poll Card Reader, its beneficial effect is two aspects, can prevent program performs delay on the one hand, can increase the robustness of program on the other hand.Solve the method for reading data of existing card reader or card sender, reading data speed is slow, the reliability reading data is low, cause misreading data and can not the problem of sense data, thus when card reader or card sender normally use, both improve the speed reading data, also improve the reliability reading data.
Accompanying drawing explanation
Fig. 1 is the realization flow figure of the method for reading data that the embodiment of the present invention provides;
Fig. 2 is the implementing procedure figure of the method for reading data step S103 that the embodiment of the present invention provides;
Fig. 3 is the first structured flowchart of the data fetch device that the embodiment of the present invention provides;
Fig. 4 is the second structured flowchart of the data fetch device that the embodiment of the present invention provides;
Fig. 5 is the 3rd structured flowchart of the data fetch device that the embodiment of the present invention provides;
Fig. 6 is the 4th structured flowchart of the data fetch device that the embodiment of the present invention provides.
Fig. 7 is the 5th structured flowchart of the data fetch device that the embodiment of the present invention provides.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
embodiment one
Fig. 1 is the realization flow figure of the method for reading data that the embodiment of the present invention provides, and details are as follows:
In step S101, obtain the Card Reader program of IC-card, ID card, CPU card;
In step s 102, adopt Componentized mode, separately the Card Reader program of described IC-card, ID card, CPU card;
Wherein, adopt Componentized mode, by the Card Reader program of IC-card, ID card, CPU card separately, make the Card Reader program of IC-card, ID card, CPU card not mutual mutually.When masking the Card Reader program of the Card Reader program of IC-card and ID card, card reader can go to read CPU card equally.
In step s 103, adopt pre-configured polling sequence, call the Card Reader program of described IC-card, ID card, CPU card, poll Card Reader.
Wherein, before step S103, configuration polling sequence, described polling sequence is calling sequentially of Card Reader program.
Due to the structure of fixture block, the information distribution difference of sector, the program that different cards class reads fixture block information is different, therefore needs to adopt different sub-interfaces according to different card classes.For ease of illustrating, be exemplified below:
IC-card, ID card, CPU card adopt the sub-interface of ICReader, IDReader, CPUReader respectively.Wherein, ICReader, IDReader, CPUReader are the function name of sub-interface.
Wherein, adopt pre-configured polling sequence, call the Card Reader program of described IC-card, ID card, CPU card, poll Card Reader, is specially:
By the driver Card Reader of card sender or card reader read head, adopt the sub-interface of ICReader, IDReader, CPUReader, according to pre-configured polling sequence, according to card media numbering, the card media numbering of poll Card Reader, determines that the kind of card is IC, ID or CPU.
Wherein, poll Card Reader adopts multithreading Card Reader, the every information of a thread to card that starts at regular intervals reads, when a thread complete paired card reading or when writing operation, namely, when program runs to default code, terminate polling operation, namely terminate thread below, can prevent program performs delay on the one hand, can increase the robustness of program on the other hand., reach the speed that improve and read data, also improve the effect of the reliability reading data.
Wherein, during Card Reader, read data in card, upgrade data in described card.
In embodiments of the present invention, owing to adopting pre-configured polling sequence, call the Card Reader program of described IC-card, ID card, CPU card, poll Card Reader, can prevent program performs delay on the one hand, the robustness of program can be increased on the other hand, thus solve the method for reading data of existing card reader or card sender, reading data speed is slow, the reliability reading data is low, cause misreading data and can not the problem of sense data, thus reach the speed that improve and read data, also improve the effect of the reliability reading data.
embodiment two
Fig. 2 is the implementing procedure figure of the method for reading data step S103 that the embodiment of the present invention provides, and details are as follows:
In step s 201, when card reader or card sender detect card, trigger Card Reader event;
In step S202, according to described Card Reader event, adopt pre-configured polling sequence, call the Card Reader program of described IC-card, ID card, CPU card, successively poll Card Reader.
Wherein, using Card Reader event as trigger condition, monitor Card Reader event in card reader or card sender, when there is Card Reader event, adopting pre-configured polling sequence, calling the Card Reader program of described IC-card, ID card, CPU card, successively poll Card Reader.
Such as, triggering Card Reader event when there being card to be put on card reader or card sender, opening Card Reader program and running.And Card Reader program threads is in non-opening when not having card to put up.
In embodiments of the present invention, triggering Card Reader event when there being card to be put on card reader or card sender, making Card Reader program constantly need not be in opening, thus decreasing the active thread of card reader or card sender, improve the processing speed of card reader or card sender.
embodiment three
Present embodiment describes the implementation process lighting mark lamp, details are as follows:
During Card Reader, read the card class mark in card, according to described card class mark, light and mark corresponding mark lamp with described card class.
Wherein, card class is labeled as the mark of card type class, and card class mark comprises IC, ID, CPU.
IC, ID, CPU is marked respectively, when user card punching, when the kind of this card is IC in card reader, the mark lamp that then IC is corresponding is bright, and when the kind of this card is ID, then the mark lamp that ID is corresponding is bright, when the kind of this card is CPU, then the mark lamp that CPU is corresponding is bright.
In the present embodiment, light and mark corresponding mark lamp with described card class, the card class both having facilitated user to know oneself to use, and verify, also facilitate the user of sentry box personnel record's different cards class to come in and go out situation, be also beneficial to investigation error source when card sender or card reader go wrong simultaneously.
embodiment four
Present embodiment describes method for reading data implementation process in actual applications, details are as follows:
When not blocking, card type class combobox shows: the kind not reading card.
When repeating query Card Reader, when the kind reading card is IC-card, then card type class combobox is shown as " IC ", when reading the kind of card as being ID card, then card type class combobox is shown as " ID ", when reading the kind of card as being CPU card, then card type class combobox is shown as " CPU ", is next the data called according to the kind of card in the Card Reader program reading card of this card class.
embodiment five
Fig. 3 is the first structured flowchart of the data fetch device that the embodiment of the present invention provides, and this data fetch device can run in card reader or card sender.For convenience of explanation, illustrate only part related to the present embodiment.
With reference to Fig. 3, this data fetch device, comprising:
Card Reader program acquisition module 31, for obtaining the Card Reader program of IC-card, ID card, CPU card;
Card Reader program separates module 32, for adopting Componentized mode, and the separately Card Reader program of described IC-card, ID card, CPU card;
Card Reader program poller module 33, for adopting pre-configured polling sequence, calls the Card Reader program of described IC-card, ID card, CPU card, poll Card Reader.
In a kind of implementation of the present embodiment, be the second structured flowchart of the data fetch device that the embodiment of the present invention provides with reference to figure 4, Fig. 4, this data fetch device, also comprises:
Polling sequence configuration module 34, for configuring polling sequence.
In a kind of implementation of the present embodiment, be the 3rd structured flowchart of the data fetch device that the embodiment of the present invention provides with reference to figure 5, Fig. 5, in this Card Reader program poller module 33, also comprise:
Card Reader event trigger element 331, for when card reader or card sender detect card, triggers Card Reader event;
Card Reader program poll units 332, for according to described Card Reader event, adopts pre-configured polling sequence, calls the Card Reader program of described IC-card, ID card, CPU card, successively poll Card Reader.
In a kind of implementation of the present embodiment, with reference to the 4th structured flowchart that figure 6, Fig. 6 is the data fetch device that the embodiment of the present invention provides, in this data fetch device, also comprise:
Mark lamp lights module 35, during for Card Reader, reads the card class mark in card, according to described card class mark, lights and mark corresponding mark lamp with described card class.
In a kind of implementation of the present embodiment, with reference to the 5th structured flowchart that figure 7, Fig. 7 is the data fetch device that the embodiment of the present invention provides, in this data fetch device, also comprise:
Data update module 36 in card, for reading data in card, upgrades data in described card.
The device that the embodiment of the present invention provides can be applied in the embodiment of the method for aforementioned correspondence, and details, see the description of above-described embodiment, do not repeat them here.
Through the above description of the embodiments, those skilled in the art can be well understood to the mode that the present invention can add required common hardware by software and realizes.Described program can be stored in read/write memory medium, described storage medium, as random access memory, flash memory, ROM (read-only memory), programmable read only memory, electrically erasable programmable storer, register etc.This storage medium is positioned at storer, and processor reads the information in storer, performs the method described in each embodiment of the present invention in conjunction with its hardware.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; the change that can expect easily or replacement, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claim.

Claims (10)

1. a method for reading data, is characterized in that, comprising:
Obtain the Card Reader program of IC-card, ID card, CPU card;
Adopt Componentized mode, separately the Card Reader program of described IC-card, ID card, CPU card;
Adopt pre-configured polling sequence, call the Card Reader program of described IC-card, ID card, CPU card, poll Card Reader.
2. method for reading data as claimed in claim 1, is characterized in that, at the polling sequence that described employing is pre-configured, call the Card Reader program of described IC-card, ID card, CPU card, successively before poll Card Reader, comprising:
Configuration polling sequence.
3. method for reading data as claimed in claim 1, is characterized in that, the polling sequence that described employing is pre-configured, calls the Card Reader program of described IC-card, ID card, CPU card, successively poll Card Reader, be specially:
When card reader or card sender detect card, trigger Card Reader event;
According to described Card Reader event, adopt pre-configured polling sequence, call the Card Reader program of described IC-card, ID card, CPU card, successively poll Card Reader.
4. the method for reading data as described in claim 1 or 3, is characterized in that, adopting pre-configured polling sequence, call the Card Reader program of described IC-card, ID card, CPU card, after poll Card Reader, described method for reading data comprises:
During Card Reader, read the card class mark in card, according to described card class mark, light and mark corresponding mark lamp with described card class.
5. method for reading data as claimed in claim 4, is characterized in that, when described Card Reader, reads the card class mark in card, and according to described card class mark, light after marking corresponding mark lamp with described card class, described method for reading data comprises:
Read data in card, upgrade data in described card.
6. a data fetch device, is characterized in that, comprising:
Card Reader program acquisition module, for obtaining the Card Reader program of IC-card, ID card, CPU card;
Card Reader program separates module, for adopting Componentized mode, and the separately Card Reader program of described IC-card, ID card, CPU card;
Card Reader program poller module, for adopting pre-configured polling sequence, calls the Card Reader program of described IC-card, ID card, CPU card, poll Card Reader.
7. data fetch device as claimed in claim 6, it is characterized in that, described data fetch device also comprises:
Polling sequence configuration module, for configuring polling sequence.
8. data fetch device as claimed in claim 6, it is characterized in that, described Card Reader program poller module, comprising:
Card Reader event trigger element, for when card reader or card sender detect card, triggers Card Reader event;
Card Reader program poll units, for according to described Card Reader event, adopts pre-configured polling sequence, calls the Card Reader program of described IC-card, ID card, CPU card, successively poll Card Reader.
9. the data fetch device as described in claim 6 or 8, is characterized in that, described data fetch device also comprises:
Mark lamp lights module, during for Card Reader, reads the card class mark in card, according to described card class mark, lights and mark corresponding mark lamp with described card class.
10. data fetch device as claimed in claim 9, it is characterized in that, described data fetch device also comprises:
Data update module in card, for reading data in card, upgrades data in described card.
CN201410856329.8A 2014-12-31 2014-12-31 Data reading method and device Pending CN104484636A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410856329.8A CN104484636A (en) 2014-12-31 2014-12-31 Data reading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410856329.8A CN104484636A (en) 2014-12-31 2014-12-31 Data reading method and device

Publications (1)

Publication Number Publication Date
CN104484636A true CN104484636A (en) 2015-04-01

Family

ID=52759177

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410856329.8A Pending CN104484636A (en) 2014-12-31 2014-12-31 Data reading method and device

Country Status (1)

Country Link
CN (1) CN104484636A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116702802A (en) * 2023-06-07 2023-09-05 河南省新星科技有限公司 Service data processing method, device and equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6577229B1 (en) * 1999-06-10 2003-06-10 Cubic Corporation Multiple protocol smart card communication device
CN101023434A (en) * 2004-07-15 2007-08-22 万事达卡国际股份有限公司 Collision detection and avoidance scheme for contactless card payment systems

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6577229B1 (en) * 1999-06-10 2003-06-10 Cubic Corporation Multiple protocol smart card communication device
CN101023434A (en) * 2004-07-15 2007-08-22 万事达卡国际股份有限公司 Collision detection and avoidance scheme for contactless card payment systems

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
谢轲等: "支持多协议的读卡器设计", 《电子测量技术》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116702802A (en) * 2023-06-07 2023-09-05 河南省新星科技有限公司 Service data processing method, device and equipment

Similar Documents

Publication Publication Date Title
CN110634530B (en) Chip testing system and method
CN108256337B (en) Intelligent contract vulnerability detection method and device and electronic equipment
CN108959069A (en) A kind of method for tracing and device of function operation
US7725646B2 (en) Method of using a flash memory for a circular buffer
CN103186461A (en) Storage method and recover method for field data, and related devices
CN105261329A (en) Multi-LED display module management method
CN109240665A (en) Log recording method, device and electronic equipment
CN105074656A (en) Methods and apparatus to manage concurrent predicate expressions
CN100511179C (en) Enhancement type microprocessor piece on-chip dynamic state tracking method with special function register breakpoints
CN103577727A (en) Software deadline verifying method and device
CN105357799A (en) LED display module management apparatus
CN104484636A (en) Data reading method and device
CN102662847B (en) System and method for program debugging of embedded system based on flash memory application
WO2022143991A1 (en) Multi-time programming electronic fuse apparatus
CN113127314A (en) Method and device for detecting program performance bottleneck and computer equipment
CN107527228B (en) Method and device for sending electronic ticket
CN102629212A (en) Method for indirectly programming to NANDFLASH based on J-LINK
CN111857785B (en) MCU starting method and device and terminal equipment
CN108334335A (en) A kind of software source code version determines method and device
CN107045606B (en) Method and apparatus for monitoring execution of program code
CN105159810A (en) Method and device for testing BIOS of computer system
US20190095219A1 (en) Method for intel platform detection of parameters in flash rom
CN113342376B (en) Method and device for upgrading operating system of Internet of things equipment
CN115827347A (en) Control method of embedded equipment and embedded equipment
US20160275011A1 (en) Microcomputer with built-in flash memory, method for writing data to built-in flash memory of microcomputer, and program for writing data to flash memory

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20150401

RJ01 Rejection of invention patent application after publication