JPH0468487A - Portable storage medium - Google Patents

Portable storage medium

Info

Publication number
JPH0468487A
JPH0468487A JP2180412A JP18041290A JPH0468487A JP H0468487 A JPH0468487 A JP H0468487A JP 2180412 A JP2180412 A JP 2180412A JP 18041290 A JP18041290 A JP 18041290A JP H0468487 A JPH0468487 A JP H0468487A
Authority
JP
Japan
Prior art keywords
data
stored
sector
memory
data memory
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
JP2180412A
Other languages
Japanese (ja)
Inventor
Takashi Niimura
新村 貴志
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.)
Toshiba Corp
Toshiba Intelligent Technology Co Ltd
Original Assignee
Toshiba Corp
Toshiba Intelligent 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 Toshiba Corp, Toshiba Intelligent Technology Co Ltd filed Critical Toshiba Corp
Priority to JP2180412A priority Critical patent/JPH0468487A/en
Publication of JPH0468487A publication Critical patent/JPH0468487A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To insert new information at a desired position by successively moving respective stored data to idle sectors and producing an idle sector for writing a new data at the desired position. CONSTITUTION:One part or all the parts of a data memory 2 is divided into sectors 5 with a fixed length, and the respective data are stored successively from the sector 5 at the high-order address of the data memory 2. A CPU 1 retrieves the data already stored at a designated position in the data memory 2, and the respective data stored at positions with lower-orders than the position of the data in the data memory 2 are moved for each sector 5 storing each data. Therefore, the idle sector is generated at the designated position in the data memory 2. Thus, new information can be inserted between existent informa tion.

Description

【発明の詳細な説明】 〔発明の目的〕 (産業上の利用分野) 本発明は、例えば不揮発性メモリおよびCPUなどの制
御素子、を有するIC(集積回路)チップを内蔵した、
ICカードと称される携帯可能記憶媒体に関する。
[Detailed Description of the Invention] [Objective of the Invention] (Industrial Application Field) The present invention provides an integrated circuit (IC) chip having a built-in IC (integrated circuit) chip having, for example, a non-volatile memory and a control element such as a CPU.
It relates to a portable storage medium called an IC card.

(従来の技術) 従来、携帯可能なデータ記憶媒体として、EEPROM
などのデータメモリ及びCPUなどの制御素子を有する
ICチップを内蔵したICカードが考案されている、こ
の種のICカードは、内蔵する制御素子によって内蔵す
るデータメモリをアクセスし、外部(上位装置)からの
要求に応じて必要な情報の入出力を選択的に行なうよう
になっている。
(Prior Art) Conventionally, EEPROM has been used as a portable data storage medium.
An IC card has been devised that has a built-in IC chip that has a data memory such as a CPU and a control element such as a CPU. The system selectively inputs and outputs necessary information in response to requests from users.

さて1、このようなICカードにおいて、データメモリ
に複数のデータを記憶する場合があるが、その記憶方式
は、データメモリの上位または下位番地から書込まれた
順に詰めて記憶する。このデータメモリに新たなデータ
を格納する場合、データメモリ中の空部分を利用してこ
こに新たなデータを追記する方法と、既存のデータ上に
新たなデータを上書きする方法の2通りがある。ところ
が、前者の方法だと新たなデータは既に格納されている
データの順列の末尾に追記されるので、該デー夕を読出
す場合に、そのデータを書込んだ時の順序でしか読出せ
なかった。また、後者の方法だと、上書きされた既存の
データの内容が失われてしまう。そのため、従来のIC
カードにおいてデーターメモリ中に既に格納されている
データの間に新たなデータを挿入する動作を行うために
は、第5図(a)に示されるように、データの挿入され
る可能性のある部分には格納するデータのA、B。
Now, 1. In such an IC card, a plurality of data may be stored in the data memory, but the storage method is to store the data in the order in which it was written from the upper or lower address of the data memory. When storing new data in this data memory, there are two methods: one is to use the empty space in the data memory and add new data here, and the other is to overwrite the existing data with new data. . However, with the former method, new data is added to the end of the permutation of data that has already been stored, so when reading the data, it can only be read in the order in which it was written. Ta. Furthermore, if the latter method is used, the contents of the existing overwritten data will be lost. Therefore, conventional IC
In order to insert new data between data already stored in the data memory of the card, as shown in FIG. A and B of the data to be stored.

C,D、の間にあらかじめダミーデータを記録しておい
て第5図(b)に見られるように前記ダミーデータ上に
新たなデータEを上書きすることによって行っていた。
This is done by recording dummy data in advance between C and D and overwriting new data E on the dummy data, as shown in FIG. 5(b).

(発明が解決しようとする課題) 上述したように、従来の携帯可能記憶媒体において、デ
ータメモリ内に既に格納されているデータの間に新たな
データを挿入するためには、あらかじめデータメモリ中
に上書き用のダミーデータエリアを確保することによっ
てデータ挿入のための領域を確保しておかなければなら
ない。そのために、データメモリ中のデータを格納する
領域の使用効率が悪くなるという問題点があった。
(Problem to be Solved by the Invention) As described above, in a conventional portable storage medium, in order to insert new data between data already stored in the data memory, it is necessary to insert data into the data memory in advance. An area for data insertion must be secured by securing a dummy data area for overwriting. Therefore, there is a problem in that the use efficiency of the area for storing data in the data memory deteriorates.

そこで本発明はデータメモリ内にあらかじめ上書き用の
ダミーデータを有していなくても、既存の情報の間に新
たな情報の挿入を行うことのできる携帯可能記憶媒体を
提供することを目的とする。
Therefore, an object of the present invention is to provide a portable storage medium that can insert new information between existing information even if the data memory does not have dummy data for overwriting in advance. .

〔発明の構成〕[Structure of the invention]

(課題を解決するための手段) 上記目的を達成するために本発明の携帯可能記憶媒体は
、複数のデータを記憶する記憶手段と、この記憶手段に
記憶されている各データの順序を認識する認識手段と、
この認識手段により認識されたデータの順序に従って指
定されたデータを前記記憶手段神から検索する検索手段
と、前記記憶手段に格納されているデータのうち前記検
索手段により検索されたデータの順序よりも下位の順序
に格納されているデータを前記記憶手段内で移動させる
移動手段とを具備してなることを特徴とする。
(Means for Solving the Problems) In order to achieve the above object, the portable storage medium of the present invention includes a storage means for storing a plurality of data, and recognizes the order of each data stored in the storage means. recognition means;
a retrieval means for retrieving specified data from the storage means in accordance with the order of the data recognized by the recognition means; It is characterized by comprising a moving means for moving data stored in a lower order within the storage means.

(作 用) データメモリ(記憶手段)中に既に格納されているデー
タの順序は、認識手段により認識可能であり、これらの
データの間に新たなデータを挿入して格納する場合、ま
ず検索手段は挿入するデータを格納するためにデータメ
モリ内の指定された位置(順序)に既に記憶されている
データを検索する。そして、データメモリ内で前記デー
タの位置よりも下位の位置に格納されている各データを
それぞれのデータが格納されているセクタ毎に移動させ
る。これによってデータメモリ中の前記指定された位置
には空きセクタが生じるので、ここに新たなデータを格
納する。
(Function) The order of data already stored in the data memory (storage means) can be recognized by the recognition means, and when new data is inserted and stored between these data, the order of the data already stored in the data memory (storage means) can be recognized by the retrieval means first. retrieves data already stored at a specified position (sequence) in data memory to store the data to be inserted. Then, each piece of data stored in a position lower than the position of the data in the data memory is moved for each sector in which the data is stored. This creates an empty sector at the specified location in the data memory, so new data is stored there.

(実 施 例) 以下、本発明をICカードに適用した一実施例を図面を
参照して説明する。
(Example) Hereinafter, an example in which the present invention is applied to an IC card will be described with reference to the drawings.

第1図はICカードの構成例を示すもので、制御部とし
ての制御素子(以下CPUと称する)1、データメモリ
部としての記憶内容が消去可能な不揮発性のデータメモ
リ2、プログラムメモリ3、およびカードリーダライタ
(図示しない)との電気的接続を得るためのコンタクト
部4、によって構成されている。これらのうち破線内の
部分(CP U 1、データメモリ2、プログラムメモ
リ3)は1つのICチップで構成されてICカード本体
内に埋設されている。前記データメモリ2は各種データ
の記憶に使用され、たとえばEEFROMで構成されて
いる。
FIG. 1 shows an example of the configuration of an IC card, which includes a control element (hereinafter referred to as CPU) 1 as a control section, a non-volatile data memory 2 whose storage contents can be erased as a data memory section, a program memory 3, and a contact portion 4 for obtaining electrical connection with a card reader/writer (not shown). Of these, the portion within the broken line (CPU 1, data memory 2, program memory 3) is composed of one IC chip and is embedded within the IC card body. The data memory 2 is used to store various data, and is composed of, for example, an EEFROM.

ここで、データメモリ2のデータを記憶する部分のフォ
ーマットを第2図に示す。データメモリ2の一部または
全部は固定長のセクタ5に分割されており、このセクタ
5を単位として、上位装置から送られてきたデータを記
憶する。記憶される各データは、データメモリの上位番
地にあるセクタから順に詰めて格納されている。
Here, the format of the data storage portion of the data memory 2 is shown in FIG. A part or all of the data memory 2 is divided into fixed-length sectors 5, and each sector 5 is used as a unit to store data sent from a host device. Each piece of data to be stored is stored in sequential order starting from sectors at higher addresses in the data memory.

今、第3図(a)に示すようにデータメモリ3内にデー
タA、データB、データC,データDという4つのデー
タが格納されており、これらの格納されている順序はそ
れぞれ1番目、2番目、3番目、4番目であるとする。
Now, as shown in FIG. 3(a), four pieces of data, data A, data B, data C, and data D, are stored in the data memory 3, and the order in which they are stored is first, Assume that they are the second, third, and fourth.

このとき、上位装置から送られてくる新たなデータEを
、前記デ−タBとデータCの間に3番目のデータとして
挿入する動作について説明する。これは、CPUI(第
1図図示)はデータBとデータCのデータメモリ2内で
の順序がそれぞれ2番目3番目であることから、データ
メモリ3内の3番目以下に格納されているデータを移動
させることから始まる。
At this time, the operation of inserting new data E sent from the host device as the third data between data B and data C will be explained. This is because the CPU (shown in Figure 1) stores data B and C in the second and third positions in the data memory 2, respectively. It starts with moving.

まず、データメモリ3内でデータDが存在しているセク
タの次に存在する空セクタにデータDを移動させる。次
にCPUIはデータメモリ2内でデータCが存在してい
るセクタの次に存在する空セクタ、即ち、移動前にデー
タDが存在していたセクタにデータCを移動させる(第
3図(b))。
First, the data D is moved to the empty sector next to the sector in which the data D exists in the data memory 3. Next, the CPUI moves the data C to the empty sector next to the sector in which the data C exists in the data memory 2, that is, the sector in which the data D existed before the movement (Fig. 3(b) )).

そして、データCが存在していたセクタ(現在は空セク
タとなっている)にデータEを書込む。これらの動作に
よって、データBとデータCの間に3番目のデータとし
てデータEが挿入されたことになる(第3図(C))。
Then, data E is written in the sector where data C existed (currently an empty sector). Through these operations, data E is inserted as the third data between data B and data C (FIG. 3(C)).

これによってデータメモリ2内でのデータの順序は上位
から順にデータA、データB、データE、データC,デ
ータDとなる。
As a result, the order of data in the data memory 2 becomes data A, data B, data E, data C, and data D in order from the highest order.

上述のデータ挿入の過程を第4図のフローチャートを参
照して更に詳細に説明する。今、データメモリ2内に格
納されているデータの数をnとし、データメモリ2内の
格納順序が1番目(即ち、データ列の先頭に格納されて
いる)のデータをXl、納順序がn番目(即ち、データ
列の末尾に格格納されている)のデータをXn、格納順
序がm番目のデータをXmとする。このとき、1くmく
nである。ここで、上位装置から送られてきた新なデー
タYを、格納順序(m−1)番目のデータXm−1と格
納順序m番目のデータXmとの間に、格納順序m番目の
データとして挿入する。ます、格納順序を表すパラメー
タPにnを代入する(Stepl)o次にCPUI(m
1図図示)は、データメモリ2内で格納順序Pのデータ
Xpを検索する(Step2)、続いて、CPUIはデ
ータメモリ2内のデータXpが格納されているセクタよ
り下位に空セクタが存在するがどぅがを判断する(St
ep3)。ここで空セクタが存在していれば、CPUI
はデータXpを当該データが格納されているセクタより
下位で、最も近い位置に存在する空セクタに移動させる
(Step4)。データの移動が行われると、そのデー
タが移動される前に格納されていたセクタは空セクタと
なる。
The above data insertion process will be explained in more detail with reference to the flowchart of FIG. Now, let the number of data stored in the data memory 2 be n, the data stored first in the data memory 2 (that is, stored at the beginning of the data string) be Xl, and the data stored in the data memory 2 be stored in the order n. It is assumed that the th data (that is, stored at the end of the data string) is Xn, and the m-th data in the storage order is Xm. At this time, 1×n. Here, the new data Y sent from the host device is inserted as the m-th data in the storage order between the data Xm-1 in the (m-1)th storage order and the data Xm in the m-th storage order. do. Next, assign n to the parameter P that represents the storage order (Step) o Next, select CPUI (m
1) searches data memory 2 for data Xp in storage order P (Step 2), and then the CPU detects that there is an empty sector below the sector in which data Xp is stored in data memory 2. Judging Gadouga (St
ep3). If an empty sector exists here, the CPU
moves the data Xp to the empty sector that is lower and closest to the sector in which the data is stored (Step 4). When data is moved, the sector where the data was stored before it was moved becomes an empty sector.

また、5tep3で空セクタが存在しないと判断された
場合には、データ挿入不可エラーとなり(Step8)
処理を終了する。5tep4にてデータの移動が行われ
ると、次にパラメータPの値から“1″減じた値をパラ
メータPに代入する(Step5)。そして、パラメー
タPの値とmを比較する(Step6)。ここでパラメ
ータPの値がm以上の場合は5tep3から5tep6
までの処理を繰り返す。データメモリ2中の格納順位m
以上n以下の全てのデータの移動が終了すれば、即ち5
tep6にてPの値がm以下になれば、CPUIは、デ
ータYを、前記データXmが移動される前に存在してい
たセクタ(現在は空セクタとなっている)に挿入する(
Step7)。
Also, if it is determined in step 5 that there is no empty sector, a data insertion failure error will occur (step 8).
Finish the process. 5. When the data is moved in step 4, the value obtained by subtracting "1" from the value of parameter P is then assigned to parameter P (step 5). Then, the value of parameter P and m are compared (Step 6). Here, if the value of parameter P is m or more, 5tep3 to 5tep6
Repeat the process up to. Storage order m in data memory 2
If the movement of all data above n or below is completed, that is, 5
If the value of P becomes less than or equal to m in step 6, the CPUI inserts the data Y into the sector (currently an empty sector) that existed before the data Xm was moved (
Step 7).

以上の処理によってデータYがデータXm−1とデータ
Xmの間に挿入されたことになる。このときのデータY
の格納順序はm番目であり、このデータY以下に格納さ
れている各データの順序はそれぞれ1つずつ下位となる
Through the above processing, data Y is inserted between data Xm-1 and data Xm. Data Y at this time
The storage order is mth, and the order of each data stored below this data Y is lower by one.

上述したように、本実施例のICカードはデータメモリ
2内に格納されている各データを次々と空セクタに移動
させていくことによって、所望の位置に新たなデータを
書込むための空セクタを作り出すことができる。そして
、この空セクタに新たなデータを書込むことによって、
予め格納されていたデータを失うことなく、かっ、予め
格納されていた情報の順序を乱すことなく、新たな情報
を所望の位置に挿入することができる。そのため、デー
タメモリ2内に後から挿入する新たなデータを上書きす
るためのダミーデータを予め格納しておく必要がなく、
データメモリ2をを効に使用できる。
As described above, the IC card of this embodiment moves each piece of data stored in the data memory 2 to empty sectors one after another, thereby creating an empty sector for writing new data at a desired position. can be produced. Then, by writing new data to this empty sector,
New information can be inserted at a desired position without losing pre-stored data or disrupting the order of pre-stored information. Therefore, there is no need to store dummy data in advance in the data memory 2 to overwrite new data to be inserted later.
Data memory 2 can be used effectively.

〔発明の効果〕〔Effect of the invention〕

以」二詳述したように本発明によれば、メモリ内の所望
の位置に空セクタを確保することができるので、既に格
納されている情報の間に新たな情報を容易に挿入するこ
とのできる携帯可能記憶媒体を提供することができる。
As described in detail below, according to the present invention, empty sectors can be secured at desired locations in the memory, making it easy to insert new information between already stored information. A portable storage medium that can be used can be provided.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図乃至第4図は本発明の詳細な説明するためのもの
で、第1図はICカードの構成を示すブロック図、第2
図はデータメモリのフォーマットを説明するための図、
第3図(a)乃至(c)はデータメモリへのデータの挿
入を説明するための図、第4図はデータ挿入処理の流れ
を説明するフローチャート、第5図(a)乃至(b)は
従来例を説明するための図である。 1・・・制御素子   2・・・データメモリ5・・・
セクタ 代理人 弁理士 則 近 憲 佑 向       山  下 (a) (b) (c) 第 図 (a) 第 図
1 to 4 are for explaining the present invention in detail, and FIG. 1 is a block diagram showing the structure of an IC card, and FIG.
The figure is a diagram to explain the format of data memory.
Figures 3 (a) to (c) are diagrams for explaining the insertion of data into the data memory, Figure 4 is a flowchart for explaining the flow of data insertion processing, and Figures 5 (a) to (b) are diagrams for explaining the insertion of data into the data memory. FIG. 2 is a diagram for explaining a conventional example. 1... Control element 2... Data memory 5...
Sector agent Patent attorney Nori Chika Ken Yuki Yamashita (a) (b) (c) Figure (a) Figure

Claims (1)

【特許請求の範囲】[Claims]  複数のデータを記憶する記憶手段と、この記憶手段に
記憶されている各データの順序を認識する認識手段と、
この認識手段により認識されたデータの順序に従って指
定されたデータを前記記憶手段から検索する検索手段と
、前記記憶手段に格納されているデータのうち前記検索
手段により検索されたデータの順序よりも下位の順序に
格納されているデータを前記記憶手段内で移動させる移
動手段とを具備してなることを特徴とする携帯可能記憶
媒体。
a storage means for storing a plurality of data; a recognition means for recognizing the order of each data stored in the storage means;
a search means for searching the storage means for specified data according to the order of data recognized by the recognition means; and a search means for searching data stored in the storage means lower than the order of the data retrieved by the search means. a moving means for moving data stored in the order in the storage means.
JP2180412A 1990-07-10 1990-07-10 Portable storage medium Pending JPH0468487A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2180412A JPH0468487A (en) 1990-07-10 1990-07-10 Portable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2180412A JPH0468487A (en) 1990-07-10 1990-07-10 Portable storage medium

Publications (1)

Publication Number Publication Date
JPH0468487A true JPH0468487A (en) 1992-03-04

Family

ID=16082803

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2180412A Pending JPH0468487A (en) 1990-07-10 1990-07-10 Portable storage medium

Country Status (1)

Country Link
JP (1) JPH0468487A (en)

Similar Documents

Publication Publication Date Title
EP2306321B1 (en) Increasing memory performance in flash memory devices by performing simultaneous write operation to multiple devices
CN103150256B (en) Improve method and the device of USB flash memory write performance
US7404030B2 (en) Method of controlling a non-volatile memory device in which a data erase block is larger than a data write block
US7231383B2 (en) Search engine for large-width data
KR100914646B1 (en) Management Scheme for Flash Memory with the Multi-Plane Architecture
JP3850134B2 (en) Data retrieval device
JPH0468487A (en) Portable storage medium
JP2000357216A (en) Ic card
JP3472256B2 (en) Data processing device and data processing method
JP4211890B2 (en) How to change memory card data in a transaction
JPH0547189A (en) Memory card device
JP3471838B2 (en) How to manage circular sequential files
JPH05100961A (en) Data storage system
JP2835159B2 (en) Portable storage media
JPH1027225A (en) Memory management system for non-contact ic card
JP2798957B2 (en) Portable electronic devices
KR950027814A (en) Flash Cards for Digital Song Accompaniment Systems
JP3047845B2 (en) Synchronous access control device
JPH0430632B2 (en)
JP2005100469A (en) Alternative method of defective sector, information restoring method, and external storage device
JPS6127781B2 (en)
JPH0778228A (en) Memory card and its data managing method
KR19990012215A (en) Flash memory
JPH0468486A (en) Portable storage medium
JPH0693252B2 (en) Portable electronic device initialization device