Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP5895566B2 - Electronic information medium, writing method, writing program, and electronic information medium issuing method - Google Patents
[go: Go Back, main page]

JP5895566B2 - Electronic information medium, writing method, writing program, and electronic information medium issuing method - Google Patents

Electronic information medium, writing method, writing program, and electronic information medium issuing method Download PDF

Info

Publication number
JP5895566B2
JP5895566B2 JP2012022083A JP2012022083A JP5895566B2 JP 5895566 B2 JP5895566 B2 JP 5895566B2 JP 2012022083 A JP2012022083 A JP 2012022083A JP 2012022083 A JP2012022083 A JP 2012022083A JP 5895566 B2 JP5895566 B2 JP 5895566B2
Authority
JP
Japan
Prior art keywords
compressed data
program
electronic information
information medium
writing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2012022083A
Other languages
Japanese (ja)
Other versions
JP2013161223A (en
Inventor
歩 小林
歩 小林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing 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 Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP2012022083A priority Critical patent/JP5895566B2/en
Publication of JP2013161223A publication Critical patent/JP2013161223A/en
Application granted granted Critical
Publication of JP5895566B2 publication Critical patent/JP5895566B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)
  • Credit Cards Or The Like (AREA)

Description

本発明は、ICカードにおけるプログラムデータの書き込み技術に関する。   The present invention relates to a technique for writing program data in an IC card.

近年、フラッシュメモリの需要が増加している中、ICカードにおいても、ROMに代えてフラッシュメモリが市場に採用されていく傾向にある。しかしながら、フラッシュメモリの場合、これまでチップメーカーがROMに書き込んでいたプログラム(プログラムコード)についても、ICカードベンダーがフラッシュメモリに書き込む必要がある。そのため、ICカードベンダーにおけるICカードの発行時間が増加するという問題がある。ICカードの発行時間を短縮するための技術として、例えば特許文献1には、ICカードを発行する際には専用の通信経路を用いることによって、プロトコルの制限を受けずに発行データの書き込みを行う技術が開示されている。   In recent years, as the demand for flash memory is increasing, there is a tendency that flash memory is adopted in the market for IC cards instead of ROM. However, in the case of a flash memory, the IC card vendor needs to write the program (program code) that has been written in the ROM by the chip manufacturer so far into the flash memory. For this reason, there is a problem that the IC card issuance time increases in the IC card vendor. As a technique for shortening the issue time of an IC card, for example, in Patent Document 1, when issuing an IC card, a dedicated communication path is used to write issued data without being restricted by a protocol. Technology is disclosed.

ところで、ICカードにおける通信には、従来からISO/IEC7816−3で定められた通信プロトコルが用いられている。ICカードの発行時間を短縮するためには、SWP(Single Wire Protocol)やUSB(Universal Serial Bus)といった高速通信のインターフェイスをICカードに採用する方法が考えられる。   By the way, the communication protocol defined by ISO / IEC7816-3 is conventionally used for communication in an IC card. In order to shorten the IC card issuance time, a method of adopting a high-speed communication interface such as SWP (Single Wire Protocol) or USB (Universal Serial Bus) in the IC card is conceivable.

特開2003−16404号公報JP 2003-16404 A

しかしながら、SWPやUSBといった高速通信のインターフェイスを搭載したICカードは、一般に、ISO/IEC7816−3が採用されたICカードよりも価格が高い。また、SWPやUSBといったインターフェイスを使用する場合、COT(Chip On Tape)検査機や発行機といったインフラ側も、当該インターフェイスをあわせる必要があり、相応の費用がかかる。また、例えばSWPのインターフェイスを搭載したICカードにおいて、発行機ではSWPのインターフェイスによる発行データの書き込みが可能であるが、COT検査機ではISO/IEC7816−3のインターフェイスを使用せざるを得ないといった現状がある。これは、COT検査機などでは、検査時に使用するコマンドを動作させるためのOSをICカードが保持している必要があるため、一部コードを書き込む必要があるためである。   However, an IC card equipped with a high-speed communication interface such as SWP or USB is generally more expensive than an IC card adopting ISO / IEC7816-3. In addition, when using an interface such as SWP or USB, the infrastructure side such as a COT (Chip On Tape) inspection machine or issuing machine also needs to match the interface, which requires a corresponding cost. In addition, for example, in an IC card equipped with an SWP interface, the issuing machine can write issued data through the SWP interface, but the COT inspection machine must use the ISO / IEC7816-3 interface. There is. This is because, in a COT inspection machine or the like, since the IC card needs to hold an OS for operating a command used at the time of inspection, it is necessary to write a part of the code.

他方、ICカードの発行時間を短縮する方法として、通信データのデータ量を小さくし通信効率性をあげる方法が考えられる。具体的には、発行データを可逆圧縮することでデータ量を小さくした発行データを通信し、ICカードのメモリ内で展開する方法である。可逆圧縮法には、スライド辞書型圧縮法(LZ法)やハフマン符号化圧縮が知られている。しかしながら、このような汎用圧縮法を単純に発行に適応する場合、ICカード側に書き込む展開プログラム自体のサイズが大きくなり、結局、通信データの増大につながる。   On the other hand, as a method of shortening the IC card issuance time, a method of increasing the communication efficiency by reducing the amount of communication data can be considered. Specifically, it is a method of communicating issuance data having a reduced data amount by reversibly compressing the issuance data and expanding it in the memory of the IC card. As the lossless compression method, a slide dictionary type compression method (LZ method) and Huffman coding compression are known. However, when such a general-purpose compression method is simply adapted for issuance, the size of the decompression program itself written on the IC card side becomes large, resulting in an increase in communication data.

そこで、本発明は、より効率良く発行時間を短縮させることが可能な電子情報媒体、書き込み方法、書き込みプログラム、及び電子情報媒体発行方法を提供することを目的とする。   In view of the above, an object of the present invention is to provide an electronic information medium, a writing method, a writing program, and an electronic information medium issuing method that can shorten the issuing time more efficiently.

上記課題を解決するために、請求項1に記載の発明は、不揮発性メモリを備える電子情報媒体であって、所定の命令を示すオペコードと、前記オペコードを圧縮した圧縮データとの対応関係を規定するテーブルを外部の通信装置から受信する第1受信手段と、複数の前記オペコードを含むプログラムであって、複数の前記オペコードの中で使用頻度が相対的に高い一部のオペコードが前記圧縮データに置換された前記プログラムを前記通信装置から受信する第2受信手段と、前記第1受信手段により受信されたテーブルを参照して、前記第2受信手段により受信されたプログラムに含まれる前記圧縮データを前記オペコードに置換する置換手段と、前記圧縮データが前記オペコードに置換された前記プログラムを前記不揮発性メモリに書き込む書込手段と、を備えることを特徴とする。 In order to solve the above-described problem, the invention according to claim 1 is an electronic information medium including a nonvolatile memory, and defines a correspondence relationship between an operation code indicating a predetermined instruction and compressed data obtained by compressing the operation code. First receiving means for receiving a table to be transmitted from an external communication device and a program including a plurality of the operation codes , wherein some of the operation codes having a relatively high frequency of use are included in the compressed data. A second receiving means for receiving the replaced program from the communication device; and referring to a table received by the first receiving means, the compressed data included in the program received by the second receiving means Replacement means for replacing with the operation code, and writing the program in which the compressed data is replaced with the operation code into the nonvolatile memory Characterized in that it comprises a writing means.

請求項に記載の発明は、請求項1に記載の電子情報媒体において、前記圧縮データは、前記圧縮データであることを示すフラグと、前記オペコードに一意に対応するナンバーとから構成されることを特徴とする。 The invention according to claim 2, the electronic information medium according to claim 1, wherein the compressed data includes a flag indicating that the it is compressed data, be comprised of a number uniquely corresponding to the operation code It is characterized by.

請求項に記載の発明は、請求項1または2に記載の電子情報媒体において、前記テーブルは、前記プログラムが受信される前に、前記通信装置から受信され記憶手段に記憶されることを特徴とする。 According to a third aspect of the present invention, in the electronic information medium according to the first or second aspect , the table is received from the communication device and stored in a storage unit before the program is received. And

請求項に記載の発明は、不揮発性メモリ及びコントローラを備える電子情報媒体において前記コントローラにより実行される書き込み方法であって、所定の命令を示すオペコードと、前記オペコードを圧縮した圧縮データとの対応関係を規定するテーブルを外部の通信装置から受信するステップと、複数の前記オペコードを含むプログラムであって、複数の前記オペコードの中で使用頻度が相対的に高い一部のオペコードが前記圧縮データに置換された前記プログラムを前記通信装置から受信するステップと、前記受信されたテーブルを参照して、前記受信されたプログラムに含まれる前記圧縮データを前記オペコードに置換するステップと、前記圧縮データが前記オペコードに置換された前記プログラムを前記不揮発性メモリに書き込むステップと、を含むことを特徴とする。 The invention according to claim 4 is a writing method executed by the controller in an electronic information medium including a non-volatile memory and a controller, and corresponds to an operation code indicating a predetermined instruction and compressed data obtained by compressing the operation code Receiving a table defining a relationship from an external communication device; and a program including a plurality of the operation codes , wherein a part of the operation codes having a relatively high frequency of use are included in the compressed data. Receiving the replaced program from the communication device; referring to the received table; replacing the compressed data included in the received program with the opcode; and Write the program replaced with the opcode to the nonvolatile memory Characterized in that it comprises a step, a.

請求項に記載の発明は、不揮発性メモリ及びコントローラを備える電子情報媒体における前記コントローラに、所定の命令を示すオペコードと、前記オペコードを圧縮した圧縮データとの対応関係を規定するテーブルを外部の通信装置から受信するステップと、複数の前記オペコードを含むプログラムであって、複数の前記オペコードの中で使用頻度が相対的に高い一部のオペコードが前記圧縮データに置換された前記プログラムを前記通信装置から受信するステップと、前記受信されたテーブルを参照して、前記受信されたプログラムに含まれる前記圧縮データを前記オペコードに置換するステップと、前記圧縮データが前記オペコードに置換された前記プログラムを前記不揮発性メモリに書き込むステップと、を実行させることを特徴とする。 According to a fifth aspect of the present invention, a table that defines a correspondence relationship between an operation code indicating a predetermined instruction and compressed data obtained by compressing the operation code is externally provided to the controller in an electronic information medium including a nonvolatile memory and a controller. A step of receiving from a communication device; and a program including a plurality of the operation codes , wherein a part of the operation codes having a relatively high frequency of use among the plurality of operation codes is replaced with the compressed data. Receiving from the apparatus; referring to the received table; replacing the compressed data included in the received program with the opcode; and the program in which the compressed data is replaced with the opcode. Writing to the non-volatile memory. To.

請求項に記載の発明は、電子情報媒体を発行する発行システムにおける電子情報媒体発行方法において、前記発行システムに備えられる通信装置が、所定の命令を示すオペコードと、前記オペコードを圧縮した圧縮データとの対応関係を規定するテーブルを発行対象の電子情報媒体へ送信した後、複数の前記オペコードを含むプログラムであって複数の前記オペコードの中で使用頻度が相対的に高い一部のオペコードが前記圧縮データに置換された前記プログラムを前記電子情報媒体へ送信する工程と、前記電子情報媒体が、前記通信装置から受信した前記テーブルを参照して、前記通信装置から受信した前記プログラムに含まれる前記圧縮データを前記オペコードに置換し、前記圧縮データが前記オペコードに置換された前記プログラムを不揮発性メモリに書き込む工程と、を含むことを特徴とする。 According to a sixth aspect of the present invention, in the electronic information medium issuing method in the issuing system for issuing the electronic information medium, the communication device provided in the issuing system includes an operation code indicating a predetermined instruction, and compressed data obtained by compressing the operation code Are transmitted to the electronic information medium to be issued, and a part of the operation codes including the plurality of operation codes are used with a relatively high frequency of use. Transmitting the program replaced with compressed data to the electronic information medium, and the electronic information medium is included in the program received from the communication device with reference to the table received from the communication device. The program in which compressed data is replaced with the operation code, and the compressed data is replaced with the operation code Characterized in that it comprises a step of writing into the nonvolatile memory.

本発明によれば、発行対象の電子情報媒体が、オペコードと該オペコードを圧縮した圧縮データとの対応関係を規定するテーブルを通信装置から受信した後、複数のオペコードのうち少なくとも一部が圧縮データに置換されたプログラムを受信し、該テーブルを参照して該圧縮データがオペコードに置換されたプログラムを不揮発性メモリに書き込むように構成したので、より効率良く発行時間を短縮させることができる。   According to the present invention, after the electronic information medium to be issued receives the table defining the correspondence between the operation code and the compressed data obtained by compressing the operation code from the communication device, at least a part of the plurality of operation codes is compressed data. Since the program replaced with the operation code is received and the program in which the compressed data is replaced with the operation code is written in the nonvolatile memory with reference to the table, the issue time can be shortened more efficiently.

ICカード発行システムSの概要構成例を示す図である。It is a figure showing an example of outline composition of IC card issue system S. (A)は、参照用テーブルの一例を示す図であり、(B)は、圧縮前と圧縮後におけるオブジェクトコードの一例を示す図である。(A) is a figure which shows an example of the table for a reference, (B) is a figure which shows an example of the object code before compression and after compression. ICチップ2aにおけるRAM22とフラッシュメモリ23内の機能ブロックを示す概念図である。2 is a conceptual diagram showing functional blocks in a RAM 22 and a flash memory 23 in an IC chip 2a. FIG. ICチップ2aにおけるCPU21の書き込み処理を示すフローチャートである。It is a flowchart which shows the write-in process of CPU21 in IC chip 2a.

以下、図面を参照して本発明の実施形態について詳細に説明する。以下に説明する実施形態は、ICカード発行システムに対して本発明を適用した場合の実施の形態である。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. The embodiment described below is an embodiment when the present invention is applied to an IC card issuing system.

先ず、図1を参照して、本実施形態に係るICカード発行システムの構成及び機能概要について説明する。図1は、ICカード発行システムSの概要構成例を示す図である。図1に示すように、ICカード発行システムSは、ICカード発行機1(外部の通信装置の一例)と、発行対象のICカード2(電子情報媒体の一例)と、を備える。   First, with reference to FIG. 1, the configuration and functional overview of an IC card issuing system according to the present embodiment will be described. FIG. 1 is a diagram showing a schematic configuration example of the IC card issuing system S. As shown in FIG. 1, the IC card issuing system S includes an IC card issuing machine 1 (an example of an external communication device) and an IC card 2 to be issued (an example of an electronic information medium).

ICカード発行機1は、ICカード2の不揮発性メモリに書き込むべき発行データを記憶している。発行データには、複数のオブジェクトコードから構成されるプログラム(「以下、カード用プログラム」という)が含まれる。ここで、カード用プログラムは、ICカード2の発行後に、認証処理等の各種の情報処理に用いられるプログラムである。オブジェクトコードは、オペコードとアドレスを含んで構成される。オペコードとは、所定の命令(コマンド)を示すものであり、命令ごとに固有の番号(アルファベット及び数字からなる)で表される。そして、ICカード発行機1は、ICカード2の発行工程において、発行データをICカード2へ送信する。   The IC card issuer 1 stores issuance data to be written in the nonvolatile memory of the IC card 2. The issued data includes a program composed of a plurality of object codes (hereinafter referred to as “card program”). Here, the card program is a program used for various types of information processing such as authentication processing after the IC card 2 is issued. The object code includes an operation code and an address. The operation code indicates a predetermined instruction (command), and is represented by a unique number (consisting of alphabets and numbers) for each instruction. Then, the IC card issuing machine 1 transmits issuance data to the IC card 2 in the issuing process of the IC card 2.

ICカード2は、キャッシュカード、クレジットカード、社員カード等として使用される。或いは、ICカード2は、スマートフォンや携帯電話機等に組み込まれる。ICカード2には、ICチップ2aが搭載されている。ICチップ2aは、CPU(Central Processing Unit)21、RAM(Random Access Memory)22、フラッシュメモリ23、及びI/O回路24を備えて構成される。フラッシュメモリ23には、コプロセッサ(Co-Processor)及びクロックの制御等のハードウェアの最低限の制御を行う命令を有するドライバが予め格納されている。なお、ICチップ2aにROMが備えられる場合、ROMに上記ドライバが予め格納される場合もある。また、RAM22またはフラッシュメモリ23は本発明における記憶手段として機能する。   The IC card 2 is used as a cash card, credit card, employee card or the like. Alternatively, the IC card 2 is incorporated in a smartphone, a mobile phone, or the like. An IC chip 2a is mounted on the IC card 2. The IC chip 2 a includes a CPU (Central Processing Unit) 21, a RAM (Random Access Memory) 22, a flash memory 23, and an I / O circuit 24. The flash memory 23 stores in advance a driver having instructions for performing minimum hardware control such as control of a coprocessor (Co-Processor) and a clock. When the IC chip 2a is provided with a ROM, the driver may be stored in the ROM in advance. The RAM 22 or the flash memory 23 functions as a storage unit in the present invention.

CPU21は、各種プログラムを実行するコントローラであり、本発明における置換手段及び書込手段として機能する。CPU21は、上記ドライバによりフラッシュメモリ23への書き込み処理を行う。RAM22は、データを一時的に記憶する作業用メモリである。また、RAM22は、ICカード発行機1から受信されたプログラムやデータがフラッシュメモリ23に書き込まれる際のバッファとして使用される。フラッシュメモリ23は、ICカード発行機1から受信されたプログラムやデータを格納する不揮発性メモリである。なお、フラッシュメモリ23の代わりにEEPROM(Electrically Erasable Programmable Read-Only Memory)であっても構わない。   The CPU 21 is a controller that executes various programs, and functions as a replacement unit and a writing unit in the present invention. The CPU 21 performs a writing process to the flash memory 23 by the driver. The RAM 22 is a working memory that temporarily stores data. The RAM 22 is used as a buffer when a program or data received from the IC card issuer 1 is written to the flash memory 23. The flash memory 23 is a nonvolatile memory that stores programs and data received from the IC card issuer 1. Instead of the flash memory 23, an EEPROM (Electrically Erasable Programmable Read-Only Memory) may be used.

I/O回路24は、ICカード発行機1とのインターフェイスを担うものであり、本発明における第1受信手段及び第2受信手段として機能する。I/O回路24には、例えばISO/IEC7816によって定められたC1〜C8の8個の端子が設けられている。例えば、C1端子は電源端子、C2端子はリセット端子、C3端子はクロック端子、C5端子はグランド端子、C7端子はICカード発行機2とのデータ通信を行う端子である。   The I / O circuit 24 serves as an interface with the IC card issuer 1 and functions as the first receiving means and the second receiving means in the present invention. The I / O circuit 24 is provided with eight terminals C1 to C8 defined by, for example, ISO / IEC7816. For example, the C1 terminal is a power supply terminal, the C2 terminal is a reset terminal, the C3 terminal is a clock terminal, the C5 terminal is a ground terminal, and the C7 terminal is a terminal that performs data communication with the IC card issuer 2.

以上の構成において、ICカード2の発行工程の前段階では、複数のオペコードのうち少なくとも一部が圧縮データに置換されたカード用プログラムが、ICカード発行機1又はこれに接続される端末により作成される。ここで、複数のオペコードのうち一部とは、カード用プログラムに含まれる複数のオペコードの中で使用頻度が相対的に高い一部のオペコード(mov,sub,add,jmp等の命令を示すオペコード)を意味する。使用頻度が相対的に高いオペコード群は、例えば次のように決定される。プログラムのコンパイル結果のイメージを解析にかけることでオペコード群の頻度集計を出し、その頻度上位10数個程度が、使用頻度が相対的に高いオペコード群として決定される。その上位10個程度を集計すると、例えば全体の約50%以上の使用頻度になる。カード用プログラムに含まれる複数のオペコードの全部が圧縮データに置換されるように構成しても構わないが、使用頻度が相対的に高い一部のオペコードを置換対象とすることで、オペコードを圧縮データに置換する圧縮処理に要する時間を短縮することができる。圧縮データとは、オペコードを圧縮したデータであり、該オペコードよりもデータ量が小さい。また、圧縮データは、例えば、圧縮データであることを示すフラグ(F)と、オペコードに一意に対応するナンバーとから構成される。また、オペコードを圧縮データに置換する圧縮処理では、使用頻度の高いオペコードと、該オペコードを圧縮した圧縮データとの対応関係を規定する参照用テーブルが用いられる。このような参照用テーブルは、例えばICカード発行機1又はこれに接続される端末により予め作成される。   In the above configuration, before the IC card 2 issuance process, a card program in which at least a part of a plurality of opcodes is replaced with compressed data is created by the IC card issuer 1 or a terminal connected thereto. Is done. Here, a part of the plurality of operation codes is an operation code indicating an instruction such as a part of operation codes (mov, sub, add, jmp, etc.) having a relatively high frequency of use among the plurality of operation codes included in the card program. ). An opcode group having a relatively high use frequency is determined as follows, for example. The frequency of the operation code group is calculated by analyzing the image of the compilation result of the program, and the top 10 or so frequencies are determined as the operation code group having a relatively high use frequency. If the top 10 are totaled, for example, the frequency of use is about 50% or more of the total. You may be configured to replace all of the multiple opcodes included in the card program with compressed data, but compress the opcodes by replacing some opcodes with relatively high use frequency. It is possible to reduce the time required for the compression processing to replace with data. The compressed data is data obtained by compressing the operation code, and the data amount is smaller than that of the operation code. The compressed data includes, for example, a flag (F) indicating that the data is compressed data, and a number uniquely corresponding to the operation code. Further, in the compression processing for replacing the operation code with the compressed data, a reference table that defines the correspondence relationship between the frequently used operation code and the compressed data obtained by compressing the operation code is used. Such a reference table is created in advance by, for example, the IC card issuing machine 1 or a terminal connected thereto.

図2(A)は、参照用テーブルの一例を示す図である。図2(A)に示す参照用テーブルでは、使用頻度の高い順に、7つのオペコードと、それぞれの圧縮データ(フラグとナンバー)との対応関係が規定されている。ICカード発行機1又はこれに接続される端末は、このような参照用テーブルを用いて、テーブル列のオペコードに一致する、オブジェクトコードのオペコードをテーブル列の圧縮データに置換することで圧縮処理を実行する。これにより、複数のオペコード(言い換えれば、オブジェクトコード)のうち少なくとも一部が圧縮データに置換されたカード用プログラムを作成することができる。   FIG. 2A is a diagram illustrating an example of a reference table. In the reference table shown in FIG. 2A, the correspondence relationship between the seven opcodes and the respective compressed data (flag and number) is defined in descending order of use frequency. The IC card issuing machine 1 or a terminal connected thereto uses such a reference table to perform the compression process by replacing the operation code of the object code that matches the operation code of the table sequence with the compressed data of the table sequence. Run. As a result, a card program in which at least a part of a plurality of operation codes (in other words, object codes) is replaced with compressed data can be created.

図2(B)は、圧縮前と圧縮後におけるオブジェクトコードの一例を示す図である。図2(B)に示す例において、オペコード(E92d)は、使用頻度が高くないことから圧縮されていないが、オペコード(E3a0)は、使用頻度が高いことから圧縮データ(F1)に置換されている。   FIG. 2B is a diagram illustrating an example of the object code before and after compression. In the example shown in FIG. 2B, the operation code (E92d) is not compressed because it is not used frequently, but the operation code (E3a0) is replaced with compressed data (F1) because it is used frequently. Yes.

次に、図3及び図4を参照して、ICカード発行システムSにおけるICカード2の発行工程(発行方法)について説明する。図3は、ICチップ2aにおけるRAM22とフラッシュメモリ23内の機能ブロックを示す概念図である。図4は、ICチップ2aにおけるCPU21の書き込み処理を示すフローチャートである。   Next, with reference to FIG. 3 and FIG. 4, an IC card 2 issuing process (issuing method) in the IC card issuing system S will be described. FIG. 3 is a conceptual diagram showing functional blocks in the RAM 22 and the flash memory 23 in the IC chip 2a. FIG. 4 is a flowchart showing the writing process of the CPU 21 in the IC chip 2a.

ICカード発行システムSにおけるICカード2の発行工程において、ICカード発行機1とICチップ2aとの接続完了後、ICカード発行機1は、事前に記憶した上記参照用テーブルと展開用プログラムをICチップ2aへ送信する。ここで、展開用プログラムは、参照用テーブルに基づいて、カード用プログラムに含まれる圧縮データをオペコードに置換してフラッシュメモリ23に書き込むための書き込み処理を規定するプログラムであり、例えばドライバを使用する際の準備処理(例えば、特定レジスタのビットのON/OFF、クロックの逓倍制御等)を含むプログラムである。   In the issuing process of the IC card 2 in the IC card issuing system S, after the connection between the IC card issuing machine 1 and the IC chip 2a is completed, the IC card issuing machine 1 uses the previously stored reference table and the expansion program as an IC. Transmit to chip 2a. Here, the expansion program is a program that defines a writing process for writing into the flash memory 23 by replacing the compressed data included in the card program with an operation code based on the reference table, and uses a driver, for example. Program including preparatory processing (for example, ON / OFF of a bit of a specific register, clock multiplication control, etc.).

なお、ICカード発行機1とICチップ2aとの間の通信は、例えば、ISO/IEC7816−3のインターフェイスを使用して行われる(ただし、SWPのインターフェイスを用いてもよい)。そして、ICチップ2aのCPU21は、ICカード発行機1からI/O回路24により受信された参照用テーブルと展開用プログラムを、図3に示すように、フラッシュメモリ23に書き込む。こうして、参照用テーブルと展開用プログラムは、上記カード用プログラムがICチップ2aにより受信される前に、ICカード発行機1から受信されフラッシュメモリ23に記憶されることになる。   The communication between the IC card issuer 1 and the IC chip 2a is performed using, for example, an ISO / IEC7816-3 interface (however, an SWP interface may be used). Then, the CPU 21 of the IC chip 2a writes the reference table and the expansion program received from the IC card issuer 1 by the I / O circuit 24 in the flash memory 23 as shown in FIG. Thus, the reference table and the expansion program are received from the IC card issuer 1 and stored in the flash memory 23 before the card program is received by the IC chip 2a.

そして、参照用テーブルと展開用プログラムがフラッシュメモリ23に記憶されると、ICカード発行機1は上記カード用プログラムの送信を開始し、ICチップ2aのCPU21は上記展開用プログラムにしたがって図4に示す処理を開始する。なお、ICカード発行機1は、上記カード用プログラムを所定の通信サイズ(データ量)ごとに分けてICチップ2aに送信することになる。この通信サイズは、例えばRAM22に設けられた作業領域の容量分である。   Then, when the reference table and the expansion program are stored in the flash memory 23, the IC card issuing machine 1 starts transmitting the card program, and the CPU 21 of the IC chip 2a in FIG. The process shown is started. Note that the IC card issuer 1 transmits the card program to the IC chip 2a by dividing it into predetermined communication sizes (data amounts). This communication size is, for example, the capacity of the work area provided in the RAM 22.

図4に示すステップS1では、ICチップ2aのCPU21は、上記カード用プログラムの一部データをI/O回路24を介してUART (Universal Asynchronous Receiver Transmitter)から受信する。次いで、CPU21は、受信された上記カード用プログラムの一部データをRAM22の作業領域に記憶(コピー)する(ステップS2)。   In step S1 shown in FIG. 4, the CPU 21 of the IC chip 2a receives a part of the card program data from a UART (Universal Asynchronous Receiver Transmitter) via the I / O circuit 24. Next, the CPU 21 stores (copies) the received partial data of the card program in the work area of the RAM 22 (step S2).

次いで、CPU21は、RAM22の作業領域に記憶されたデータを検索して所定バイト分抽出する(ステップS3)。次いで、CPU21は、該抽出したデータと、フラッシュメモリ23に記憶された参照用テーブルに規定された圧縮データとを比較し(ステップS4)、比較結果が一致するか否かを判定する(ステップS5)。つまり、CPU21は、抽出したデータからフラグ(F)をキーとして圧縮データを検索し、検索された圧縮データが参照用テーブルに規定されているかどうかを判定する。   Next, the CPU 21 retrieves data stored in the work area of the RAM 22 and extracts a predetermined number of bytes (step S3). Next, the CPU 21 compares the extracted data with the compressed data defined in the reference table stored in the flash memory 23 (step S4), and determines whether the comparison results match (step S5). ). That is, the CPU 21 searches the extracted data using the flag (F) as a key, and determines whether the searched compressed data is defined in the reference table.

そして、CPU21は、比較結果が一致すると判定した場合には(ステップS5:YES)、ステップS6に進み、参照用テーブルに基づいて、一致すると判定された圧縮データを展開する展開処理を実行する(ステップS6)。この展開処理では、一致すると判定された圧縮データが該圧縮データに対応付けられたオペコードに置換される。次いで、CPU21は、置換されたオペコードを含むデータを、RAM22のバッファに記憶(コピー)する(ステップS7)。   If the CPU 21 determines that the comparison results match (step S5: YES), the CPU 21 proceeds to step S6 and executes a decompression process for decompressing the compressed data determined to match based on the reference table (step S6). Step S6). In this decompression process, the compressed data determined to match is replaced with the opcode associated with the compressed data. Next, the CPU 21 stores (copies) the data including the replaced operation code in the buffer of the RAM 22 (step S7).

一方、上記ステップS5において、CPU21は、比較結果が一致しないと判定した場合には(ステップS5:NO)、ステップS7に進んで該抽出したデータを、RAM22のバッファに記憶(コピー)する。   On the other hand, if it is determined in step S5 that the comparison results do not match (step S5: NO), the CPU 21 proceeds to step S7 and stores (copies) the extracted data in the buffer of the RAM 22.

次いで、CPU21は、RAM22のバッファにデータが所定量(例えば、数十〜数百バイトのデータブロック(1ページ)のデータ量分)記憶されたか(埋まったか)否かを判定し(ステップS8)、データが所定量記憶されていないと判定した場合には(ステップS8:NO)、ステップS3に戻り上記と同様の処理を行う。一方、CPU21は、RAM22のバッファにデータが所定量記憶されたと判定した場合には(ステップS8:YES)、RAM22のバッファに記憶されたデータをフラッシュメモリ23のオブジェクトコード書き込み領域に書き込む(ステップS9)。   Next, the CPU 21 determines whether or not a predetermined amount of data (for example, data amount of several tens to several hundred bytes of data block (one page)) is stored (filled) in the buffer of the RAM 22 (step S8). If it is determined that a predetermined amount of data is not stored (step S8: NO), the process returns to step S3 and the same processing as described above is performed. On the other hand, when the CPU 21 determines that a predetermined amount of data has been stored in the buffer of the RAM 22 (step S8: YES), the data stored in the buffer of the RAM 22 is written into the object code writing area of the flash memory 23 (step S9). ).

次いで、CPU21は、データの検索が終了したか否かを判定し(ステップS10)、検索が終了しないと判定した場合には(ステップS10:NO)、上記ステップS3に戻り上記と同様の処理を行う。一方、CPU21は、検索が終了したと判定した場合には(ステップS10:YES)、フラッシュメモリ23に書き込まれたデータの続きのアドレスをレスポンスとしてUARTに設定してICカード発行機1へ送信する(ステップS11)。これにより、ICカード発行機1は、上記カード用プログラムにおける次の通信サイズのデータをICチップ2aに送信することになる。   Next, the CPU 21 determines whether or not the data search has ended (step S10). If it is determined that the search has not ended (step S10: NO), the CPU 21 returns to step S3 and performs the same processing as described above. Do. On the other hand, if the CPU 21 determines that the search is complete (step S10: YES), the CPU 21 sets the continuation address of the data written in the flash memory 23 as a response to the UART and transmits it to the IC card issuer 1. (Step S11). Thereby, the IC card issuing machine 1 transmits data of the next communication size in the card program to the IC chip 2a.

次いで、CPU21は、圧縮データがオペコードに置換されたカード用プログラムのフラッシュメモリ23への書き込みが全て完了したか否かを判定し(ステップS12)、完了していないと判定した場合には(ステップS12:NO)、上記ステップS1に戻り上記と同様の処理を行う。一方、CPU21は、完了したと判定した場合には(ステップS12:YES)、フラッシュメモリ23に記憶されている参照用テーブルと展開用プログラムをフラッシュメモリ23から消去し(ステップS13)、図4に示す処理を終了する。   Next, the CPU 21 determines whether or not the writing of the card program in which the compressed data is replaced with the operation code to the flash memory 23 is completed (step S12). (S12: NO), the process returns to step S1 and the same processing as described above is performed. On the other hand, if the CPU 21 determines that the process has been completed (step S12: YES), the reference table and the expansion program stored in the flash memory 23 are erased from the flash memory 23 (step S13), and FIG. The processing shown in FIG.

以上説明したように、上記実施形態によれば、発行対象のICカード2が、オペコードと該オペコードを圧縮した圧縮データとの対応関係を規定する参照用テーブルをICカード発行機1から受信した後、複数のオペコードのうち少なくとも一部が圧縮データに置換されたカード用プログラムを受信し、参照用テーブルを参照して、カード用プログラムに含まれる圧縮データを展開し、圧縮データがオペコードに置換されたカード用プログラムをフラッシュメモリ23に書き込むように構成したので、通信速度の遅いISO/IEC7816−3のインターフェイスを使用した場合であっても、より効率良く発行時間を短縮させることができる。   As described above, according to the above-described embodiment, after the IC card 2 to be issued receives the reference table that defines the correspondence between the operation code and the compressed data obtained by compressing the operation code, from the IC card issuer 1 Receiving a card program in which at least a part of a plurality of opcodes is replaced with compressed data, referring to a reference table, expanding the compressed data included in the card program, and replacing the compressed data with the opcode Since the card program is written in the flash memory 23, the issue time can be shortened more efficiently even when the ISO / IEC7816-3 interface having a low communication speed is used.

また、使用頻度が相対的に高い一部のオペコードを置換対象とすることで、オペコードを圧縮データに置換する圧縮処理に要する時間を短縮することができる。なお、図2(B)に示す例によれば、カード用プログラムが約83%に圧縮される。一般に、ICカード開発においてはオブジェクトコードが数百キロバイト以上になることが多く、8割程度の圧縮においても、通信速度150Kbps、内部クロック10MHz、展開処理50Clkと仮定すると85%程度に発行時間を短縮することが見込まれる。   In addition, by setting a part of the operation code having a relatively high use frequency as a replacement target, it is possible to reduce the time required for the compression processing for replacing the operation code with the compressed data. According to the example shown in FIG. 2B, the card program is compressed to about 83%. In general, in the development of IC cards, the object code is often several hundred kilobytes or more. Even with compression of about 80%, the issuance time is shortened to about 85% assuming a communication speed of 150 Kbps, an internal clock of 10 MHz, and expansion processing of 50 Clk Expected to do.

なお、上記実施形態においては、本発明の電子情報媒体をICカードに対して適用した例を示したが、不揮発性メモリ及びコントローラを備えるその他の電子情報媒体、例えばSDカードに対しても適用可能である。また、上記実施形態においては、本発明の発行システムに備えられる通信装置をICカード発行機1に対して適用した例を示したが、検査機等に対しても適用可能である。   In the above embodiment, an example in which the electronic information medium of the present invention is applied to an IC card has been described. However, the present invention can also be applied to other electronic information media including a nonvolatile memory and a controller, such as an SD card. It is. Moreover, in the said embodiment, although the example which applied the communication apparatus with which the issuing system of this invention is provided with respect to the IC card issuing machine 1 was shown, it is applicable also to an inspection machine etc.

1 ICカード発行機
2 ICカード
2a ICチップ
21 CPU
22 RAM
23 フラッシュメモリ
24 I/O回路
S ICカード発行システム
1 IC card issuing machine 2 IC card 2a IC chip 21 CPU
22 RAM
23 Flash memory 24 I / O circuit S IC card issuing system

Claims (6)

不揮発性メモリを備える電子情報媒体であって、
所定の命令を示すオペコードと、前記オペコードを圧縮した圧縮データとの対応関係を規定するテーブルを外部の通信装置から受信する第1受信手段と、
複数の前記オペコードを含むプログラムであって、複数の前記オペコードの中で使用頻度が相対的に高い一部のオペコードが前記圧縮データに置換された前記プログラムを前記通信装置から受信する第2受信手段と、
前記第1受信手段により受信されたテーブルを参照して、前記第2受信手段により受信されたプログラムに含まれる前記圧縮データを前記オペコードに置換する置換手段と、
前記圧縮データが前記オペコードに置換された前記プログラムを前記不揮発性メモリに書き込む書込手段と、
を備えることを特徴とする電子情報媒体。
An electronic information medium comprising a non-volatile memory,
First receiving means for receiving, from an external communication device, a table that defines a correspondence relationship between an operation code indicating a predetermined instruction and compressed data obtained by compressing the operation code;
Second receiving means for receiving, from the communication device, a program including a plurality of the operation codes , wherein the operation data in a part of the plurality of operation codes, which is relatively frequently used, is replaced with the compressed data. When,
Replacement means for referring to the table received by the first receiving means and replacing the compressed data included in the program received by the second receiving means with the opcode;
Writing means for writing the program in which the compressed data is replaced with the operation code to the nonvolatile memory;
An electronic information medium comprising:
前記圧縮データは、前記圧縮データであることを示すフラグと、前記オペコードに一意に対応するナンバーとから構成されることを特徴とする請求項1に記載の電子情報媒体。 The electronic information medium according to claim 1, wherein the compressed data includes a flag indicating the compressed data and a number uniquely corresponding to the operation code. 前記テーブルは、前記プログラムが受信される前に、前記通信装置から受信され記憶手段に記憶されることを特徴とする請求項1または2に記載の電子情報媒体。 It said table, before the program is received, an electronic information medium according to claim 1 or 2, characterized in that it is stored in to the storage means received from the communication device. 不揮発性メモリ及びコントローラを備える電子情報媒体において前記コントローラにより実行される書き込み方法であって、
所定の命令を示すオペコードと、前記オペコードを圧縮した圧縮データとの対応関係を規定するテーブルを外部の通信装置から受信するステップと、
複数の前記オペコードを含むプログラムであって、複数の前記オペコードの中で使用頻度が相対的に高い一部のオペコードが前記圧縮データに置換された前記プログラムを前記通信装置から受信するステップと、
前記受信されたテーブルを参照して、前記受信されたプログラムに含まれる前記圧縮データを前記オペコードに置換するステップと、
前記圧縮データが前記オペコードに置換された前記プログラムを前記不揮発性メモリに書き込むステップと、
を含むことを特徴とする書き込み方法。
A writing method executed by the controller in an electronic information medium comprising a non-volatile memory and a controller,
Receiving from an external communication device a table that defines a correspondence relationship between an operation code indicating a predetermined instruction and compressed data obtained by compressing the operation code;
Receiving from the communication device a program including a plurality of the operation codes, in which a part of the operation codes having a relatively high frequency of use among the plurality of operation codes is replaced with the compressed data;
Referring to the received table, replacing the compressed data contained in the received program with the opcode;
Writing the program in which the compressed data is replaced with the opcode to the nonvolatile memory;
A writing method comprising:
不揮発性メモリ及びコントローラを備える電子情報媒体における前記コントローラに、
所定の命令を示すオペコードと、前記オペコードを圧縮した圧縮データとの対応関係を規定するテーブルを外部の通信装置から受信するステップと、
複数の前記オペコードを含むプログラムであって、複数の前記オペコードの中で使用頻度が相対的に高い一部のオペコードが前記圧縮データに置換された前記プログラムを前記通信装置から受信するステップと、
前記受信されたテーブルを参照して、前記受信されたプログラムに含まれる前記圧縮データを前記オペコードに置換するステップと、
前記圧縮データが前記オペコードに置換された前記プログラムを前記不揮発性メモリに書き込むステップと、
を実行させることを特徴とする書き込みプログラム。
In the controller in an electronic information medium comprising a nonvolatile memory and a controller,
Receiving from an external communication device a table that defines a correspondence relationship between an operation code indicating a predetermined instruction and compressed data obtained by compressing the operation code;
Receiving from the communication device a program including a plurality of the operation codes, in which a part of the operation codes having a relatively high frequency of use among the plurality of operation codes is replaced with the compressed data;
Referring to the received table, replacing the compressed data contained in the received program with the opcode;
Writing the program in which the compressed data is replaced with the opcode to the nonvolatile memory;
A writing program characterized in that
電子情報媒体を発行する発行システムにおける電子情報媒体発行方法において、
前記発行システムに備えられる通信装置が、所定の命令を示すオペコードと、前記オペコードを圧縮した圧縮データとの対応関係を規定するテーブルを発行対象の電子情報媒体へ送信した後、複数の前記オペコードを含むプログラムであって複数の前記オペコードの中で使用頻度が相対的に高い一部のオペコードが前記圧縮データに置換された前記プログラムを前記電子情報媒体へ送信する工程と、
前記電子情報媒体が、前記通信装置から受信した前記テーブルを参照して、前記通信装置から受信した前記プログラムに含まれる前記圧縮データを前記オペコードに置換し、前記圧縮データが前記オペコードに置換された前記プログラムを不揮発性メモリに書き込む工程と、
を含むことを特徴とする電子情報媒体発行方法。
In the electronic information medium issuing method in the issuing system for issuing the electronic information medium,
A communication device provided in the issuing system transmits a table defining a correspondence relationship between an operation code indicating a predetermined instruction and compressed data obtained by compressing the operation code to an electronic information medium to be issued, and then a plurality of the operation codes are transmitted. A step of transmitting to the electronic information medium the program in which a part of the operation codes that are relatively frequently used among the plurality of operation codes is replaced with the compressed data;
The electronic information medium refers to the table received from the communication device and replaces the compressed data included in the program received from the communication device with the opcode, and the compressed data is replaced with the opcode. Writing the program into a nonvolatile memory;
An electronic information medium issuing method comprising:
JP2012022083A 2012-02-03 2012-02-03 Electronic information medium, writing method, writing program, and electronic information medium issuing method Active JP5895566B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012022083A JP5895566B2 (en) 2012-02-03 2012-02-03 Electronic information medium, writing method, writing program, and electronic information medium issuing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012022083A JP5895566B2 (en) 2012-02-03 2012-02-03 Electronic information medium, writing method, writing program, and electronic information medium issuing method

Publications (2)

Publication Number Publication Date
JP2013161223A JP2013161223A (en) 2013-08-19
JP5895566B2 true JP5895566B2 (en) 2016-03-30

Family

ID=49173426

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012022083A Active JP5895566B2 (en) 2012-02-03 2012-02-03 Electronic information medium, writing method, writing program, and electronic information medium issuing method

Country Status (1)

Country Link
JP (1) JP5895566B2 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06230927A (en) * 1993-01-28 1994-08-19 Mitsubishi Electric Corp Program code transmission method
JPH11224199A (en) * 1998-02-06 1999-08-17 Matsushita Electric Ind Co Ltd Translation device, information processing device, and recording medium
JP2004038287A (en) * 2002-06-28 2004-02-05 Toshiba Corp System and method for issuing portable electronic medium and portable electronic medium

Also Published As

Publication number Publication date
JP2013161223A (en) 2013-08-19

Similar Documents

Publication Publication Date Title
US8931705B2 (en) IC card, mobile electronic device and data processing method in IC card
US8645624B2 (en) Portable electronic device, smartcard and control method for portable electronic device
CN102799931B (en) Data protection method of radio frequency smart card
CN105630687B (en) Data writing method, memory control circuit unit and memory storage device
US20130013851A1 (en) Data stream dispatching method, memory controller, and memory storage apparatus
JP2013161222A (en) Ic card and program
JP5150672B2 (en) Portable electronic device and method for controlling portable electronic device
JP5895566B2 (en) Electronic information medium, writing method, writing program, and electronic information medium issuing method
US20120234926A1 (en) Portable electronic apparatus
JP2003533807A (en) How to handle write commands
US8870079B2 (en) IC card, portable electronic device, IC card issuing apparatus, and command execution method
JP2004185419A (en) Portable electronic medium, system for issuing portable electronic medium, processing method, and issuing method
JP7468757B1 (en) ELECTRONIC INFORMATION STORAGE MEDIUM, IC CHIP, IC CARD, RESPONSE TRANSMISSION METHOD, AND PROGRAM
JP6092342B2 (en) Non-contact portable electronic device and method for issuing non-contact portable electronic device
US7346730B2 (en) Mobile electronic device
JP7438432B1 (en) Electronic information storage medium, IC chip, IC card, record writing method, and program
JP2008242998A (en) IC card
JP2000137776A (en) IC card and method of transmitting / receiving information to / from IC card
JP2018194995A (en) Electronic information storage medium, IC card, data transmission method, data writing method, data transmission program, and data writing program
JP5492172B2 (en) Portable electronic device, IC card and IC module
JP2026054830A (en) Electronic information storage medium, IC chip, IC card, terminal device, data rewriting method, data transmission method, medium program, and terminal program
JP2002304605A (en) IC card
JP6823289B2 (en) IC card and computer program
US8360326B2 (en) Method for pre-personalizing an IC card
JP6015461B2 (en) Information recording medium, data read / write method, and data read / write program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20141219

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150819

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150915

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20151110

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20160202

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160215

R150 Certificate of patent or registration of utility model

Ref document number: 5895566

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150