CN101620662B - Method for downloading data from intelligent card based on flash memory - Google Patents
Method for downloading data from intelligent card based on flash memory Download PDFInfo
- Publication number
- CN101620662B CN101620662B CN2008101161679A CN200810116167A CN101620662B CN 101620662 B CN101620662 B CN 101620662B CN 2008101161679 A CN2008101161679 A CN 2008101161679A CN 200810116167 A CN200810116167 A CN 200810116167A CN 101620662 B CN101620662 B CN 101620662B
- Authority
- CN
- China
- Prior art keywords
- data
- card
- flash
- verification
- character frame
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 42
- 230000015654 memory Effects 0.000 title claims abstract description 24
- 238000004364 calculation method Methods 0.000 claims abstract description 6
- 238000012795 verification Methods 0.000 claims description 24
- 230000006854 communication Effects 0.000 claims description 14
- 238000004891 communication Methods 0.000 claims description 12
- 230000005540 biological transmission Effects 0.000 claims description 8
- 230000007246 mechanism Effects 0.000 claims description 6
- 230000008901 benefit Effects 0.000 claims description 2
- 230000006870 function Effects 0.000 claims description 2
- 230000008569 process Effects 0.000 description 14
- 238000010586 diagram Methods 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 1
- 230000008092 positive effect Effects 0.000 description 1
Images
Landscapes
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
The invention discloses a method for downloading data from an intelligent card based on a flash memory, and relates to the technical field of application of intelligent cards/integrated circuit chips. The method uses the intelligent card comprising a controller, a data interface and one or more flash memories FLASH. The method comprises the following steps that: (1) a card reading device and the intelligent card establish contact and carry out downloading duration calculation and parameter setting; (2) the data interface of the intelligent card receives a character frame datum sent by the card reading device; (3) the controller writes the previous character frame datum into the flash memory FLASH while the intelligent card receives a next character frame datum; and (4) the step (3) is repeated till the downloading of all data is finished. Compared with the prior art, the method greatly improves the efficiency and accuracy for downloading the data. The method has active meaning in the fields similar to large-scale card issue of a mobile operator, on-line program update of a digital television payment system and the like.
Description
Technical field
The present invention relates to smart card/integrated circuit (IC) chip applied technical field, particularly based on the method for the downloading data from intelligent card of flash memory.
Background technology
Smart card is a kind of of IC-card.Generally comprise parts such as controller, nonvolatile memory FLASH, volatile memory RAM, data-interface in the smart card based on flash memory FLASH, the smart card of operate as normal also contains chip operating system COS.
At present, for the method for downloading COS and mass data based on the smart card controller of flash memory, the practice widely followed of industry is (referring to Fig. 1): the first step, and at the smart card end, open up one by program and be positioned at the volatibility device, such as the buffer area of SRAM.In second step, communication data at first is buffered and enters the buffer area that previous step is set up.The correctness of this process can be guaranteed by the verification retransmission mechanism of different communication protocol, also can be guaranteed by the mode of user oneself definition.The 3rd step after confirming correctly to receive a certain amount of data, was begun the FLASH device is carried out write operation by card-programm, will go among the data importing FLASH in the buffer memory.The correctness of this process can just be carried out the checking of retaking of a year or grade or coding checkout after writing, also can carry out after a while.If in this process, make a mistake, can select by the data cached FLASH that writes again, also can wait for the processing of card-reading apparatus directly to the card-reading apparatus reporting errors.The 4th step finished as the equal successful execution of above-mentioned step, then analyze whether need the repetition above-mentioned steps partly or entirely go so that finally finish the data greater than the buffer area byte number are downloaded in the FLASH device.
The method of above-mentioned data download, no matter in data transmission or data writing process, all there are a large amount of stand-by period in controller and FLASH device.Therefore, its shortcoming is: 1, large batch of program is downloaded, is upgraded, and occupies bigger time and human resources, inefficiency; 2, online a large amount of programs or Data Update can occupy line resource, and operating process makes that wrong possibility occurring improves for a long time.
Summary of the invention
At the shortcoming that exists in the above-mentioned prior art, the purpose of this invention is to provide a kind of method of the downloading data from intelligent card based on flash memory.The character frame period of physical layer transmission was finished the write operation to flash memory FLASH when it utilized smart card communications, effectively improved the intelligent card data downloading efficiency, guaranteed the accuracy that data are downloaded.
In order to reach the foregoing invention purpose, technical scheme of the present invention realizes as follows:
A kind of method of the downloading data from intelligent card based on flash memory, its uses the smart card that comprises controller, data-interface and and above flash memory FLASH.Smart card utilizes the time interval of character frame when physical layer transmission to finish write operation to FLASH when receiving data, and it comprises the steps:
1. card-reading apparatus and smart card are set up contact and are carried out downloading duration calculation and parameter setting;
2. the intelligent card data interface receives the character frame data that card-reading apparatus sends;
3. controller writes flash memory FLASH with previous character frame data when smart card receives the character late frame data;
4. 3. repeating step is downloaded until all data and is finished.
In said method, to be character frame data at the interval of smart card physical layer transmission duration T1 be not less than described downloading duration calculation described character frame data are write the required duration T2 of flash memory FLASH writes the duration T3 sum that the performed program of character frame data or control expend, i.e. T1>=T2+T3 with finishing.
In said method, the communication mode of described Physical layer is observed ISO/IEC 7816-3 or ISO/IEC 1444 regulations.
In said method, described parameter setting comprises downloads destination address, data download length and verification agreement.
In said method, described verification agreement is that part of having downloaded or the total data of having downloaded are carried out verification, and checking procedure is finished at smart card and/or card-reading apparatus end.Verification is found will carry out data re-transmitting after the mistake, and the employing of data re-transmitting mechanism retransmits immediately after verification goes wrong, waits for and retransmit after a while or wouldn't retransmit that retransmitted content is all data contents or the content of makeing mistakes.
In said method, described verification is meant and reads back check, sum check, the verification of mould difference, mould are taken advantage of verification, code distance coding, parity checking, Hamming check, CRC check or hash function verification.
The present invention is owing to adopted said method, and smart card is being communicated by letter with extraneous data source, when receiving extraneous data source data, utilizes the interval of character frame when physical layer transmission to finish write operation to FLASH.Compare with prior art, the efficient and the accuracy of data download of the present invention greatly improve.To being similar to mobile operator hair fastener in enormous quantities, fields such as the online program updates of Digital Television charging system have positive effect.
The present invention will be further described below in conjunction with the drawings and specific embodiments.
Description of drawings
Fig. 1 is a downloading data from intelligent card process flow diagram in the prior art;
Downloading data from intelligent card process flow diagram among Fig. 2 the present invention;
Fig. 3 is communication process and the sequential relationship synoptic diagram of writing the FLASH flow process during for data download of the present invention.
Embodiment
The present invention includes the smart card that uses controller, data-interface and and above flash memory FLASH.Smart card utilizes the time interval of character frame when physical layer transmission to finish write operation to FLASH when receiving data.
Referring to Fig. 2 and Fig. 3, smart card and the card-reading apparatus of deferring to ISO/IEC 7816 agreements regulation adopt the inventive method data download, and its step is as follows:
1. card-reading apparatus and smart card are set up contact and are carried out downloading duration calculation.Confirm clock frequency, communication baud rate, smart card controller dominant frequency, smart card FLASH performance parameter and other desired parameters of card-reading apparatus communication interface.According to the corresponding computing method in ISO/IEC 7816 agreements (relevant) with being provided with of communication speed when calculating proper communication two character frames (byte) receive constantly mistiming T1, this time period and character frame data are write the required duration T2 of flash memory FLASH write the duration T3 sum that the performed program of character frame data or control expends and compare with finishing.If T1>=T2+T3 can adopt quick-downloading COS of this method and mass data.Otherwise suitably change above-mentioned correlation parameter (communication speed parameter).Select the communication control port of employing, be provided with as software PIN mouth or hardware UART.As select UART to be provided with, the relevant setting of UART should rationally be set.Enter the download stream Cheng Qian, also will download parameter settings such as destination address, data download length and verification agreement.
2. the intelligent card data interface receives character frame data (byte data) back that card-reading apparatus sends and requires byte to receive according to the related protocol of ISO/IEC7816-3, and then parity checking also is finished.
3. controller writes flash memory FLASH with previous character frame data when smart card receives the character late frame data.The state that receives character frame data needs duration T 1, and during this period of time, the data of a byte can be guaranteed to write FLASH.After affirmation write and finishes, program was waited for next complete bytes gathering data arrival.If parity error appears in communication process, the card-reading apparatus end should start retransmission mechanism, and retransmission mechanism makes T1 become big, can not exert an influence to downloading flow process; Mistake occurs if write the FLASH flow process, phenomenons such as FLASH is overtime unusually, device reports an error occur writing, then need to enter the fault processing flow process.FLASH to be written such as do not continue and finish, change the flow process that receives next byte data in the suitable moment over to.
4. 3. repeating step is downloaded until all data and is finished.Promptly begin to carry out verification operation afterwards.In this example, selecting sum check, is numeral and the verification that minimum 2 bytes are got by unit with some bytes.After data download finishes, send the check code of some bytes by the card-reading apparatus end, the data that program is read in the corresponding FLASH space are also carried out read group total, and and check code compare.As verification succeeds, then whole flow process finishes, and as the verification failure, then starts retransmission mechanism.Repeating step 3 flow processs.
The method that the present invention protected is not limited to the embodiment described in the embodiment, and other embodiment that person skilled technical scheme according to the present invention draws belongs to protection scope of the present invention equally.
Claims (5)
1. method based on the downloading data from intelligent card of flash memory, its uses the smart card comprise controller, data-interface and one and above flash memory FLASH, smart card is when receiving data, utilize the time interval of character frame when physical layer transmission to finish write operation to FLASH, it comprises the steps:
1. card-reading apparatus and smart card are set up contact and are carried out downloading duration calculation and parameter setting; Communication speed parameter in the above-mentioned parameter is set to make character frame data write the required duration T2 of flash memory FLASH at the interval of smart card physical layer transmission duration T1 more than or equal to the character frame data to write the duration T3 sum that the performed program of character frame data or control expend, i.e. T1>=T2+T3 with finishing;
2. the intelligent card data interface receives the character frame data that card-reading apparatus sends;
3. controller writes flash memory FLASH with previous character frame data when smart card receives the character late frame data;
4. 3. repeating step is downloaded until all data and is finished.
2. method according to claim 1 is characterized in that, the communication mode of described Physical layer is observed ISO/IEC 7816-3 or ISO/IEC 1444 regulations.
3. method according to claim 1 and 2 is characterized in that, described parameter setting comprises downloads destination address, data download length and verification agreement.
4. method according to claim 3, it is characterized in that, described verification agreement is that part of having downloaded or the total data of having downloaded are carried out verification, checking procedure is finished at smart card and/or card-reading apparatus end, verification is found will carry out data re-transmitting after the mistake, the employing of data re-transmitting mechanism retransmits immediately after verification goes wrong, waits for and retransmit after a while or wouldn't retransmit that retransmitted content is all data contents or the content of makeing mistakes.
5. method according to claim 4 is characterized in that, described verification is adopted and read back check, sum check, the verification of mould difference, mould are taken advantage of verification, code distance coding, parity checking, Hamming check, CRC check or hash function verification.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2008101161679A CN101620662B (en) | 2008-07-04 | 2008-07-04 | Method for downloading data from intelligent card based on flash memory |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2008101161679A CN101620662B (en) | 2008-07-04 | 2008-07-04 | Method for downloading data from intelligent card based on flash memory |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101620662A CN101620662A (en) | 2010-01-06 |
CN101620662B true CN101620662B (en) | 2011-09-28 |
Family
ID=41513893
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2008101161679A Active CN101620662B (en) | 2008-07-04 | 2008-07-04 | Method for downloading data from intelligent card based on flash memory |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101620662B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102201913A (en) * | 2010-03-23 | 2011-09-28 | 深圳华北工控股份有限公司 | Network isolation communication method |
CN102547454B (en) * | 2011-12-30 | 2014-04-16 | 四川长虹电器股份有限公司 | Data replication method for STB (Set Top Box) |
CN105259150B (en) * | 2015-11-02 | 2019-01-18 | 深圳市锦瑞生物科技有限公司 | A kind of fluorescence analyser scaling system |
CN107590405A (en) * | 2016-07-06 | 2018-01-16 | 上海华虹集成电路有限责任公司 | The method for improving intelligent card data speed of download |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1848296A (en) * | 2005-04-11 | 2006-10-18 | 海力士半导体有限公司 | Flash memory device with reduced access time |
CN101196851A (en) * | 2006-12-05 | 2008-06-11 | 慧荣科技股份有限公司 | Data management method of flash memory |
-
2008
- 2008-07-04 CN CN2008101161679A patent/CN101620662B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1848296A (en) * | 2005-04-11 | 2006-10-18 | 海力士半导体有限公司 | Flash memory device with reduced access time |
CN101196851A (en) * | 2006-12-05 | 2008-06-11 | 慧荣科技股份有限公司 | Data management method of flash memory |
Also Published As
Publication number | Publication date |
---|---|
CN101620662A (en) | 2010-01-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106843942B (en) | Wearable device and firmware upgrading method thereof | |
US6769622B1 (en) | System and method for simulating universal serial bus smart card device connected to USB host | |
CN103019788A (en) | Remote online upgrading method based on CAN (Controller Area Network) bus | |
CN101241542B (en) | Communication apparatus, communication method | |
CN101183314A (en) | Method for realizing digital signal processor program online programming | |
CN101620662B (en) | Method for downloading data from intelligent card based on flash memory | |
CN103197943A (en) | Online single-chip microcomputer upgrading method and system | |
CA2631140A1 (en) | Programming electronic meter settings using a bandwidth limited communications channel | |
CN1630403A (en) | Subscriber identification module (SIM) emulator | |
CN114020297B (en) | Bluetooth-based intelligent water meter program upgrading method, device, equipment and medium | |
CN104077166A (en) | EPCS and EPCQ storer online upgrading method based on IP core in FPGA | |
CN117687664A (en) | Online upgrade configuration method and device for DSP | |
CN111897560B (en) | Program upgrading system, method, device and storage medium based on NB-IoT module | |
CN109933340A (en) | A kind of spacecraft EEPROM in-orbit write-in and self checking method based on page mode | |
CN102711095A (en) | Method for updating nodes of wireless sensor network in wireless mode | |
CN106033551B (en) | Data analysis method, apparatus and system | |
CN107239358A (en) | Startup method, mobile terminal and the device with store function of Android system | |
JP2012094107A (en) | Memory system | |
CN106775904A (en) | A kind of program burn writing system and method for microcontroller built-in type system | |
CN106843805A (en) | A kind of 8031 Series MCU download online modules and implementation method | |
CN102196411A (en) | Mobile communication terminal and communication software upgrading method | |
CN103678751B (en) | Processor chips emulation debugging system | |
JP5754287B2 (en) | IC chip, processing method in IC chip, UIM, portable terminal, and processing program for IC chip | |
CN104376283A (en) | Smart card COS high-speed downloading system | |
JPH01255990A (en) | Ic card data transmitting system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address |
Address after: 100000 106A, Floor 1, B-1, Zhongguancun Dongsheng Science Park, 66 Xixiaokou Road, Haidian District, Northern Territory, Beijing Patentee after: ZIGUANG TONGXIN MICROELECTRONICS CO.,LTD. Country or region after: China Address before: 100083 A, block 2901, Tongfang science and Technology Square, Beijing Patentee before: BEIJING TONGFANG MICROELECTRONICS Co.,Ltd. Country or region before: China |
|
CP03 | Change of name, title or address |