TW201207621A - Method for dispatching and transmitting data stream, memory controller and memory storage apparatus - Google Patents

Method for dispatching and transmitting data stream, memory controller and memory storage apparatus Download PDF

Info

Publication number
TW201207621A
TW201207621A TW99126950A TW99126950A TW201207621A TW 201207621 A TW201207621 A TW 201207621A TW 99126950 A TW99126950 A TW 99126950A TW 99126950 A TW99126950 A TW 99126950A TW 201207621 A TW201207621 A TW 201207621A
Authority
TW
Taiwan
Prior art keywords
logical block
memory
data
read
host system
Prior art date
Application number
TW99126950A
Other languages
Chinese (zh)
Other versions
TWI472927B (en
Inventor
Ching-Wen Chang
Original Assignee
Phison Electronics Corp
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 Phison Electronics Corp filed Critical Phison Electronics Corp
Priority to TW99126950A priority Critical patent/TWI472927B/en
Priority to US12/895,872 priority patent/US8812756B2/en
Publication of TW201207621A publication Critical patent/TW201207621A/en
Application granted granted Critical
Publication of TWI472927B publication Critical patent/TWI472927B/en

Links

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

A method for dispatching and transmitting data stream, which is used for a memory storage apparatus having a non-volatile memory module and a smart card chip, is provided. The method includes configuring a plurality of logical block addresses, wherein a plurality of specific logical block addresses are used for storing a specific file. The method also includes receiving a response data unit from the smart card chip and storing the response data unit in a buffer memory. The method also includes, when a logical block address corresponding to a read command from a host system belongs to the specific logical block addresses and there is a response data unit at the buffer memory, transmitting the response data unit stored at the buffer memory to the host system. Accordingly, the method can make the host system to correctly receive a response data unit from the smart card chip.

Description

201207621 10-0015 34915twf.doc/I 六、發明說明: 【發明所屬之技術領域】 是有關林料-,且特別 法及使用此方法的記憶趙控制器串的方 【先前技術】 數位相機、行動電話與MP3播放器在這幾 十分迅速,使得消費者對儲存媒體的需求也=成: 於非揮發性記舰(例如,㈣職 =電、體積小,以及無機械結構等特性, 合内建於上述所舉例的各種可攜式多舰裝置中。適 另方面隨者使用者逐漸接受使用電子錢包及 卡的使用曰益普及。智慧卡(s_c-d) 疋具有例如微處理器、卡操作系統、安全模 ) 組件的積體電路晶片(IC晶片),以允畔抟右隐體之 巧智慧卡k供计算、加密、雙向通信及安全功能 得這張卡ϋ除了贿㈣的功糾絲_對其所 資料加以保護的功能。使用全球行動通信系統(G 機 „式電話中所使用的用戶識別模組(Subscriber IdenUficatum Module,SIM )卡為智慧卡的其中一個應用範 例。然而,智慧卡本身受限於儲存容量,因此近年來開始 與大量儲躲置攸針作結合,_增智慧卡的儲存^201207621 10-0015 34915twf.doc/I VI. Description of the invention: [Technical field to which the invention pertains] It is a forest-related, and special method and a memory Zhao controller string using this method [Prior Art] Digital camera, action The speed of telephones and MP3 players is so rapid that the demand for storage media is also reduced to: for non-volatile record ships (for example, (four) jobs = electricity, small size, and no mechanical structure, etc. It is built into the various portable multi-ship devices exemplified above. It is suitable for users to gradually accept the use of electronic wallets and cards. Smart cards (s_c-d) have, for example, microprocessors and cards. Operating system, security module) The integrated circuit chip (IC chip) of the component, in order to allow the right-hand hidden smart card k for calculation, encryption, two-way communication and security functions, this card eliminates the bribe (four) Silk _ the function of protecting its data. The use of the Global Mobile Communication System (SIMT card) is one of the application examples of smart cards. However, the smart card itself is limited by the storage capacity, so in recent years Start to combine with a large number of storage and hiding needles, _ increase the storage of smart cards ^

201207621 --------⑽15 34915twtdoc/I 量。 然而’在同時配置非揮發性記憶體模組與智慧卡晶片 的記憶卡中’如何區分來自於主機系統的資料串是屬於智 慧卡晶片的指令資料單元以及將來自於智慧卡晶片的回應 資料單元傳遞給主機系統成為此領域技術人員所欲解決的 課題。 【發明内容】 本發明提供一種資料串分派與傳送方法、記憶體控制 器與S己憶體儲存裝置,其能夠有效地傳遞屬於智慧卡晶片 的資料單元。 本發明範例實施例提出一種資料串分派與傳送方 法,用於具有非揮發性記憶體模組與智慧卡晶片的記憶體 儲存裝置。本資料串分派與傳送方法包括’為非揮發性記體 模組配置多個邏輯區塊位址,其中此些邏輯區塊位址之中 的多個特定邏輯區塊位址被用以儲存特定㈣。本資料串 分派與傳送方法也包純智慧卡晶片巾接㈣應資料單 凡’並·1在緩衝記髓帽存細應資料單元。本資料串 分派與傳送方法還包括從主齡統中純棘指令;判斷 對應此讀取齡的邏輯紐位址衫屬於此雜絲輯區 鬼位址的其中之-並且判斷上述緩衝記憶體巾是否存此 =應資料單元。本資料串分派與傳送方法亦包括當對應此 2取指令的賴區塊仙^於此些狀賴區塊位址料 中之-且此緩衝記韻中存有回應單元時,傳送儲^ 201207621201207621 --------(10)15 34915twtdoc/I amount. However, 'how to distinguish the data string from the host system in the memory card of the non-volatile memory module and the smart card chip is the command data unit belonging to the smart card chip and the response data unit from the smart card chip. Passing to the host system has become a problem to be solved by those skilled in the art. SUMMARY OF THE INVENTION The present invention provides a data string assignment and transmission method, a memory controller, and a S memory storage device that can efficiently transfer data units belonging to a smart card chip. Exemplary embodiments of the present invention provide a data string assignment and transmission method for a memory storage device having a non-volatile memory module and a smart card chip. The data string assignment and delivery method includes 'configuring a plurality of logical block addresses for the non-volatile record module, wherein a plurality of specific logical block addresses among the logical block addresses are used to store the specific (4). This data string assignment and transmission method also includes pure smart card wafer towel (4) should be the information sheet Where ‘and·1 in the buffer memory cap storage fine data unit. The data string assignment and transmission method further includes a pure spine instruction from the master age system; determining that the logical button address corresponding to the read age belongs to the ghost address of the miscellaneous area - and determining the buffer memory towel Whether to save this = should be the data unit. The data string assignment and transmission method also includes when the response block of the block block corresponding to the 2 fetch instructions is in the block address material, and the buffer unit contains the response unit, the transfer storage unit 201207621

rar^OlO-0015 34915twf.doc/I 於此緩衝記憶體中的回應資料單元給主機系統。 在本發明之一實施例中,上述之資料串分派與傳送方 法更包括:當對應此讀取指令的邏輯區塊位址屬於此些特 定邏輯區塊位址的其中之一且上述緩衝記憶體中未存有回 應資料單元時,傳送第二資料串給主機系統,其中此第二 資料串的每個位元皆為零。 在本發明之一實施例中,上述之資料串分派與傳送方 參 法,更包括當對應此讀取指令的邏輯區塊位址不屬於此些 特定邏輯區塊位址的其中之一時,根據對應此讀取指令的 邏輯區塊位址從非揮發性記憶體模組中讀取對應此讀取指 令的第三資料串並且將對應此讀取指令的第三資料串傳 給主機系統。 、 在本發明之一實施例中,上述之資料串分派與傳送方 法更包括:從主機系統中接收寫入指令與對應此寫入指令 的第一資料串;判斷此第一資料串是否含有特定標記;^ 及當此第一資料串含有特定標記時,則將第一資料串之中 • 的指令資料單元傳送至智慧卡晶片並且清除儲存於緩衝記 憶體中的回應資料單元。 ^ 在本發明之一實施例中,上述之資料串分派與傳送方 法更包括:當此第一資料串不含有特定標記時,則依據對 應此寫入指令的邏輯區塊位址將第一資料串寫入至非揮發 性記憶體模組中。 本發明範例實施例提出一種資料串分派與傳送方 法,用於具有非揮發性記憶體模組與智慧卡晶片的記憶體 5Rar^OlO-0015 34915twf.doc/I The response data unit in this buffer memory is given to the host system. In an embodiment of the present invention, the data string assignment and transmission method further includes: when the logical block address corresponding to the read instruction belongs to one of the specific logical block addresses and the buffer memory When there is no response data unit, the second data string is transmitted to the host system, wherein each bit of the second data string is zero. In an embodiment of the present invention, the data string assignment and the transmission method are further included, and when the logical block address corresponding to the read instruction does not belong to one of the specific logical block addresses, according to Corresponding to the logical block address of the read command, the third data string corresponding to the read command is read from the non-volatile memory module and the third data string corresponding to the read command is transmitted to the host system. In an embodiment of the present invention, the data string assignment and transmission method further includes: receiving a write instruction from the host system and a first data string corresponding to the write instruction; determining whether the first data string contains a specific Mark; ^ and when the first data string contains a specific mark, the command data unit of the first data string is transferred to the smart card chip and the response data unit stored in the buffer memory is cleared. In an embodiment of the present invention, the data string assignment and transmission method further includes: when the first data string does not contain a specific tag, the first data is determined according to a logical block address corresponding to the write instruction. The string is written to the non-volatile memory module. An exemplary embodiment of the present invention provides a data string assignment and transmission method for a memory having a non-volatile memory module and a smart card chip.

34915twf.doc/I 201207621 -υ015 儲存裝置。本資料串分派與傳送方法包括為此非揮發性記 體模組配置多個邏輯區塊位址,其中此些邏輯區塊位址之 中的多個特定邏輯區塊位址被用以儲存特定檔案。本資料 串分派與傳送方法也包括從此智慧卡晶片中接收回應資料 單元’並且在緩衝記憶體中儲存此回應資料單元。本資料 串分派與傳送方法還包括從主機系統中接收讀取指令;判 斷對應此讀取指令的邏輯區塊位址是否屬於此些特定邏輯 區塊位址的其中之一並且判斷此緩衝記憶體中是否儲存有 回應資料單元。本資料串分派與傳送方法亦包括當對應此 讀取指令的邏輯區塊位址屬於此些特定邏輯區塊位址的其 中之一且此緩衝記憶體中存有回應資料單元時,判斷對應 此讀取指令的邏輯區塊位址是否對應存取位址單位。本資 料串分派與傳送方法更包括當對應此讀取指令的邏輯區塊 位址對應存取位址單位時,傳送儲存於此緩衝記憶體中 回應資料單元的至少一部分給主機系統。 “ 、 在本發明之一實施例中,上述之資料串分派與傳送方 法更包括:當對應此讀取指令的邏輯區塊位址未對應存 位址單位時,傳送儲存於緩衝記憶體中的回應資料^ 其中一部分給主機系統。 的 在本發明之一實施例中,上述之資料串分派與傳送 法更^括:當對應此讀取指令的邏輯區塊位址屬於此此 定邏輯區塊位址的其中之_且此緩衝記憶體中二 資料單元時,傳送第二資料串給主機系統。 °應 在本發明之一實施例中,上述之資料串分派與傳送方 20120762134915twf.doc/I 201207621 -υ015 Storage device. The data string assignment and delivery method includes configuring a plurality of logical block addresses for the non-volatile record block module, wherein a plurality of specific logical block addresses among the logical block addresses are used to store a specific file. The data distribution and delivery method also includes receiving a response data unit from the smart card chip and storing the response data unit in the buffer memory. The data string assignment and transmission method further includes receiving a read instruction from the host system; determining whether a logical block address corresponding to the read instruction belongs to one of the specific logical block addresses and determining the buffer memory Whether there is a response data unit stored in it. The data string assignment and transmission method also includes determining that when the logical block address corresponding to the read instruction belongs to one of the specific logical block addresses and the response data unit is stored in the buffer memory Whether the logical block address of the read instruction corresponds to the access address unit. The data string assignment and transfer method further includes transmitting at least a portion of the response data unit stored in the buffer memory to the host system when the logical block address corresponding to the read instruction corresponds to the access address unit. In an embodiment of the present invention, the data string assignment and transmission method further includes: when the logical block address corresponding to the read instruction does not correspond to the address unit, the transmission is stored in the buffer memory. In response to an embodiment of the present invention, in the embodiment of the present invention, the data string assignment and the transfer method are further included: when the logical block address corresponding to the read instruction belongs to the logical block In the case of one of the addresses and the two data units in the buffer memory, the second data string is transmitted to the host system. ° In one embodiment of the present invention, the above data string assignment and transmission party 201207621

FSFU-^010-0015 34915twf.doc/I 法更包括:當 對應此讀取指令的邏輯區塊位址不屬於 特定邏輯區塊錄中之-時,㈣對應此讀取指^ 邏輯區塊位址從非揮發性記憶體模組中讀取對應此^ 2:::料串並且將對應此讀取指令的第三資料串傳‘FSFU-^010-0015 34915twf.doc/I method further includes: when the logical block address corresponding to the read instruction does not belong to the - in the specific logical block record, (4) corresponds to the read finger ^ logical block bit The address is read from the non-volatile memory module corresponding to the ^ 2::: material string and the third data string corresponding to the read instruction is transmitted.

本發明範例實施例提出一種記憶體控制器,其包括 憶體介面、記憶體管理電路、主機介面與緩衝記憶體。:己 憶體介面耦接至記憶體管理電路,並且用以耦接至上述非 揮發性S己憶體模組。主機介面耦接至記憶體管理電路^且 用以輕接至主機系統。緩衝記憶體_至記憶體管理電 路’並且用以暫存資料。記憶體管理電路單元用以執行上 述之資料串分派與傳送方法。 本發明範例實施例提出一種記憶體儲存裝置,其包括 連接器、上述非揮發性記憶體模組與耦接至此非揮發性記 憶體模組的記憶體控制器。在此,此記憶體控制器用以執 行上述之資料串分派與傳送方法。 基於上述,本發明範例實施例的資料串分派與傳送方 法、§己憶體控制器與記憶體儲存系統能夠正確地傳遞智慧 卡晶片的指令資料單元與回應資料單元。 為讓本發明之上述特徵和優點能更明顯易懂,下文特 舉實施例,並配合所附圖式作詳細說明如下。 【實施方式】 [第一範例實施例] 201207621An exemplary embodiment of the present invention provides a memory controller including a memory interface, a memory management circuit, a host interface, and a buffer memory. The memory interface is coupled to the memory management circuit and coupled to the non-volatile S memory module. The host interface is coupled to the memory management circuit and is used to connect to the host system. Buffer memory_ to memory management circuit' and used to temporarily store data. The memory management circuit unit is configured to perform the above-described data string assignment and transmission method. An exemplary embodiment of the present invention provides a memory storage device including a connector, the non-volatile memory module, and a memory controller coupled to the non-volatile memory module. Here, the memory controller is configured to execute the above-described data string assignment and transmission method. Based on the above, the data string assignment and delivery method, the 己 memory controller and the memory storage system of the exemplary embodiment of the present invention can correctly transmit the instruction data unit and the response data unit of the smart card chip. The above described features and advantages of the present invention will become more apparent from the description of the appended claims. [Embodiment] [First Exemplary Embodiment] 201207621

---------U015 34915tw£doc/I 圖 吃情彻本發明第一範例實施例繪示的主機系統與 〃己隐體儲存裝置的概要方塊圖。 ”月參照圖1 ’主機系統麵包括微處理器麗、儲存 裝置蘭、快取記憶體聰與輸瑪出裝置腦。當主 機系統1_ _時,微處"魔錄行安裝於儲存裝 置11=4中的作業系統111G,以使主機系統⑺⑽根據使用 者之操作而提供對應的功能。例如,在主機系統丨獅為手 機系統並且作業系統i 1〇8為Symbian、Andr〇id或其他 作業系統的例子中,當主齡統_職後,使用者可透 過輸入/輸出裝置11〇8操作主機系統議以執行通訊、影 ,播放等魏。雜在本範㈣闕巾,域纟統刪 疋以手,系絲作朗’然而,在本發明另—範例實施例 中主機系統1GGG亦以是電腦、數位相機、攝影機、音訊播 放器或視訊播放器等系統。 記憶體儲存裝置卿是用以麵接至主機系統1000,以 根據來自於主機系統1000之作業系統1110的指令執行資 料的寫入與讀取。例如,在主機系統1000為手機系統的例 子中,記憶體儲存裝置100可為安全數位(Secure Digital, SD)卡、多媒體儲存卡(Multi Media Card,MMC)卡、記憶棒 (memory stick)、小型快閃(c〇mpact Flash,CF)卡或嵌入式 儲存裝置。嵌入式儲存裝置包括嵌入式多媒體卡 (Embedded MMC,eMMC)。值得一提的是,嵌入式多媒體 卡是直接耦接於主機系統的基板上。 記憶體儲存裝置100包括連接器1〇2、記憶體控制器 201207621---------U015 34915 tw£doc/I Figure A schematic block diagram of a host system and a cryptographic storage device according to a first exemplary embodiment of the present invention. "Monthly with reference to Figure 1 'The host system surface includes the microprocessor MN, the storage device blue, the cache memory and the smashing device brain. When the host system 1_ _, the micro-location " magic record line is installed in the storage device 11 The operating system 111G in =4, so that the host system (7) (10) provides a corresponding function according to the operation of the user. For example, in the host system, the lion is a mobile phone system and the operating system i 1 〇 8 is Symbian, Andr〇id or other operations. In the example of the system, after the master's degree, the user can operate the host system through the input/output device 11〇8 to perform communication, shadow, play, etc. Wei. Miscellaneous in this fan (four) wipes, domain system deleted However, in another exemplary embodiment of the present invention, the host system 1GGG is also a computer, a digital camera, a video camera, an audio player, or a video player. The memory storage device is used. The interface is connected to the host system 1000 to perform writing and reading of data according to an instruction from the operating system 1110 of the host system 1000. For example, in the example where the host system 1000 is a mobile phone system, the memory is stored. The device 100 can be a Secure Digital (SD) card, a Multi Media Card (MMC) card, a memory stick, a c〇mpact Flash (CF) card, or an embedded storage device. The embedded storage device includes an embedded multimedia card (EMMC). It is worth mentioning that the embedded multimedia card is directly coupled to the substrate of the host system. The memory storage device 100 includes the connector 1〇2. Memory controller 201207621

FSFD-2010-0015 34915twf.doc/I 104與非揮發性記憶體模組1〇6。 連接器102為符合SD標準的連接器。然而,必須瞭 解的是,本發明不限於此,連接器102亦可以是符合MS 標準、MMC標準、CF標準、電氣和電子工程師協會 (Institute of Electrical and Electronic Engineers, IEEE) 1394 標準、高速周邊零件連接介面(Peripheral Component Interconnect Express,PCI Express)標準、序列先進附件 ❿ (Serial Advanced Technology Attachment,SATA)標準、通用序 列匯流排(Universal Serial Bus,USB)標準、整合式驅動電子 介面(Integrated Device Electronics, IDE)標準或其他標準的 連接器。 記憶體控制器104用以執行以硬體型式或韌體型式實 作的多個邏輯閘或控制指令,並且根據主機系統1000的指 令在非揮發性記憶體模組106中進行資料的寫入、讀取與 抹除等運作。 ' 非揮發性記憶體模組106是輕接至記憶體控制器 • 丨〇4 ’並且用以儲存主機系統1000所寫入之資料。非揮發 性記憶體模組106包括多個實體區塊。各實體區塊分別具 有複數個實體頁面’其中屬於同一個實體區塊之實體頁面 可被獨立地寫入且被同時地抹除。更詳細來說,實體區塊 為抹除之最小單位。亦即,每一實體區塊含有最小數目之 一併被抹除之記憶胞。實體頁面為程式化的最小單元。即, 貫體頁面為寫入資料的最小卓元。然而,必須瞭解的是, 在本發明另一範例實施例中,寫入資料的最小單位亦可以FSFD-2010-0015 34915twf.doc/I 104 and non-volatile memory module 1〇6. The connector 102 is a connector conforming to the SD standard. However, it must be understood that the present invention is not limited thereto, and the connector 102 may also be an MS standard, an MMC standard, a CF standard, an Institute of Electrical and Electronic Engineers (IEEE) 1394 standard, and a high-speed peripheral component. Peripheral Component Interconnect Express (PCI Express) standard, Serial Advanced Technology Attachment (SATA) standard, Universal Serial Bus (USB) standard, Integrated Drive Electronics (Integrated Device Electronics, IDE) standard or other standard connector. The memory controller 104 is configured to execute a plurality of logic gates or control commands implemented in a hard type or a firmware type, and write data in the non-volatile memory module 106 according to an instruction of the host system 1000. Read and erase operations. The non-volatile memory module 106 is lightly connected to the memory controller • 丨〇 4 ' and is used to store data written by the host system 1000. The non-volatile memory module 106 includes a plurality of physical blocks. Each physical block has a plurality of physical pages respectively. Physical pages belonging to the same physical block can be independently written and erased simultaneously. In more detail, the physical block is the smallest unit of erasure. That is, each physical block contains a minimum number of memory cells that are erased. The entity page is the smallest unit that is stylized. That is, the intersecting page is the smallest element of the written data. However, it must be understood that in another exemplary embodiment of the present invention, the minimum unit of writing data may also be

2〇12〇m_ 34915twf.doc/I 是扇區(Sector)或其他大小。 在本發明第一範例實施例的記憶體管理方法中,記憶 體控制器104會將非揮發性記憶體模組1〇6的實體區塊邏 輯地分組為資料區、備用區、系統區與取代區,其中被分 組為資料區與備用區的實體區塊會輪替地來健存主機系統 1000所寫入之資料,系統區的實體區塊是用以儲存記憶體 儲存裝置100的系統資料’而取代區的實體區塊是用以取 代資料區與備用區中的壞實體區塊。此外,為了使主機系 統1000能夠方便地對以輪替方式儲存資料的實體區塊進 行存取’記憶體控制器104會配置邏輯區塊位址 LBA(O)〜LBA(N)來映射此些實體區塊,由此主機系統1〇〇〇 能夠直接地依據邏輯區塊位址來進行資料的寫入與讀取。 在本範例實施例中,非揮發性記憶體模組為可複 寫式非揮發性記憶體模組。例如,非揮發性記憶體模組 為多層記憶胞(Multi Level Cell, MLC)NAND快閃記憶體模 組。然而,本發明不限於此,非揮發性記憶體模組1〇ό亦 可是單層記憶胞(Single Level Cell, SLC)NAND快閃記憶 體模組、其他快閃記憶體模組或其他具有相同特性的記憶 體模組。 在本發明第一範例實施例中,記憶體儲存裝置100還 包括智慧卡晶片108。智慧卡晶片108是透過介面108a耦 接至記憶體控制器104,其中介面i〇8a是專門用以與智慧 卡晶片108進行通訊的介面。 2012076212〇12〇m_ 34915twf.doc/I is a sector or other size. In the memory management method of the first exemplary embodiment of the present invention, the memory controller 104 logically groups the physical blocks of the non-volatile memory modules 1〇6 into a data area, a spare area, a system area, and a replacement. The area, wherein the physical blocks grouped into the data area and the spare area are rotated to store the data written by the host system 1000, and the physical block of the system area is used to store the system data of the memory storage device 100. The physical block of the replacement area is used to replace the bad physical block in the data area and the spare area. In addition, in order to enable the host system 1000 to conveniently access physical blocks that store data in a rotating manner, the memory controller 104 configures the logical block addresses LBA(0) to LBA(N) to map these. The physical block, whereby the host system can directly write and read data according to the logical block address. In the exemplary embodiment, the non-volatile memory module is a rewritable non-volatile memory module. For example, the non-volatile memory module is a Multi Level Cell (MLC) NAND flash memory module. However, the present invention is not limited thereto, and the non-volatile memory module 1 may be a single level cell (SLC) NAND flash memory module, other flash memory modules, or the like. Characteristic memory module. In the first exemplary embodiment of the present invention, the memory storage device 100 further includes a smart card chip 108. The smart card chip 108 is coupled to the memory controller 104 via a interface 108a, wherein the interface i〇8a is an interface specifically for communicating with the smart card chip 108. 201207621

FSPD-2010-0015 34915twf.doc/I 智慧卡晶片108具有微處理器、安全模組、唯讀記憶 體(Read Only Memory, ROM)、隨機存取記憶體(Rand〇m Access Memory,RAM)、電子抹除式可編程唯讀記憶體 (Electrically Erasable Programmable Read-Only Memory, EEPROM)、震盪器等元件。微處理器用以控制智慧卡晶片 108的整體運作。安全模組用以對儲存至智慧卡晶片1〇8 中的資料進行加解密。震盪器用以產生智慧卡晶片1〇8運 _ 作時所需之時脈訊號。隨機存取記憶體用以暫存運算的資 料或韌體程式。電子抹除式可編程唯讀記憶體用以儲存使 用者資料。唯讀記憶體用以儲存智慧卡晶片1〇8的韌體程 式。具體來說,當智慧卡晶片1〇8運作時,智慧卡晶片1〇8 的微處理器會執行唯讀記憶體中的韌體程式來執行相關運 作。 特別是,智慧卡晶片108的安全模組會執行一安全機 制以防止欲竊取儲存於智慧卡晶片108中所儲存之資料的 攻擊。例如,此攻擊包括時間攻擊(timingattack)、單一電 鲁 力分析攻擊(shgle-power-analysis attack)或差異電力分析攻 擊(differential-power-analysis)。此外,智慧卡晶片 1〇8 所執 行的安全機制是符合聯邦資訊處理標準(Federal Informati〇nFSPD-2010-0015 34915twf.doc/I The smart card chip 108 has a microprocessor, a security module, a read only memory (ROM), a random access memory (RAM), and a random access memory (RAM). Electronically Erasable Programmable Read-Only Memory (EEPROM), oscillator and other components. The microprocessor is used to control the overall operation of the smart card chip 108. The security module is used to encrypt and decrypt the data stored in the smart card chip 1〇8. The oscillator is used to generate the clock signal required for the smart card chip. Random access memory is used to temporarily store the data or firmware of the operation. Electronic erasable programmable read-only memory is used to store user data. The read-only memory is used to store the firmware of the smart card chip 1〇8. Specifically, when the smart card chip 1 运作 8 is operated, the microprocessor of the smart card chip 1 会 8 executes the firmware program in the read-only memory to perform the related operations. In particular, the security module of smart card chip 108 performs a security mechanism to prevent attacks that would otherwise steal data stored in smart card chip 108. For example, this attack includes a timing attack, a single shgle-power-analysis attack, or a differential-power-analysis. In addition, the security mechanism implemented by the smart card chip 1〇8 is in compliance with federal information processing standards (Federal Informati〇n

Processing Standards,FIPS) 140-2的第三等級或更高等級或 者符合EMVEL的第三等級或更高等級❶也就是說,智慧 卡晶片108是通過FIPS 140-2之第四級以上的認證或者通 過EMVEL之第四級以上的認證。在此’ FIPS是美國聯邦 政府制定給所有軍事機構除外的政府機構及政府的承包商所 11Processing Standards, FIPS) The third level or higher of 140-2 or the third level or higher of EMVEL, that is, the smart card chip 108 is certified by Level 4 or higher of FIPS 140-2 or Passed the fourth level or higher certification of EMVEL. Here, FIPS is a contractor of the government agencies and governments that the US federal government has established for all military agencies.

34915tw£d〇c/I 201207621·咖 使用的公’準’其巾Fn>s 14()·2制定了_賴安全的等 級。此外’ EMV是國際金融業界對於智慧卡與可使用晶片卡 的銷售點(pomt-〇f-saie,P0S)終端機,以及銀行機構所廣泛設 置,自動櫃貞機等所峽的專業交胃無證的鮮規範。此規 範是針對晶#卡魏金卡的支倾祕㈣福System) 的相關軟硬體所設置的鮮。在本細實關巾,藉由智慧 卡晶片108的運作,記憶體儲存裝置1〇〇可提供具有身份 認證的服務,例如,小額付款服務、票證服務等。34915tw£d〇c/I 201207621· The public use of the 'French' FN>s 14()·2 has established a level of safety. In addition, 'EMV is the international financial industry for the smart card and the use of the chip card point of sale (pomt-〇f-saie, P0S) terminal, as well as the banking institutions are widely set up, the automatic counters and other gorges of the professional stomach The standard of the certificate. This specification is set for the related software and hardware of Crystal #卡魏金卡's supporting secret (four) Fu System). In the case of the smart card, the memory storage device 1 can provide an identity authentication service, such as a micropayment service, a ticket service, etc., by the operation of the smart card chip 108.

.圖2疋根據本發明第一範例實施例所繪示的記憶體控 制器的概要方塊圖。 請參照圖2,記憶體控制器1〇4包括記憶體管理電路 202、主機介面204、記憶體介面206與緩衝記憶體2〇8。Figure 2 is a schematic block diagram of a memory controller according to a first exemplary embodiment of the present invention. Referring to FIG. 2, the memory controller 1〇4 includes a memory management circuit 202, a host interface 204, a memory interface 206, and a buffer memory 2〇8.

記憶體管理電路202用以控制記憶體控制器1〇4的整 體運作。具體來說,記憶體管理電路2〇2具有多個控制指 7,並且在記憶體儲存裝置100運作時,此些控制指令會 被執行以根據第一範例實施例的資料串分派與傳送方法以 及纪憶體管理方法來管理非揮發性記憶體模組106。 在本範例實施例中,記憶體管理電路202的控制指令 是以韌體型式來實作。例如,記憶體管理電路2(^具 處理器單元(未繪示)與唯讀記憶體(未繪示),並且此^控制 指令是被燒錄至此唯讀記髓中。t記賴儲存裝^00 運作時,此些㈣齡會由微處理!I單元來執行^根 據本發明第一範例實施例的資料串分派與傳送方法=及記 憶體官理方法。 12 201207621The memory management circuit 202 is used to control the overall operation of the memory controller 1〇4. Specifically, the memory management circuit 2〇2 has a plurality of control fingers 7, and when the memory storage device 100 operates, such control commands are executed to perform the data string assignment and transmission method according to the first exemplary embodiment and The memory management method is used to manage the non-volatile memory module 106. In the present exemplary embodiment, the control commands of the memory management circuit 202 are implemented in a firmware version. For example, the memory management circuit 2 (with a processor unit (not shown) and read-only memory (not shown), and this control command is burned into this read-only memory. t depends on the storage When ^00 is in operation, such (four) ages are performed by the micro-processing! I unit. According to the first exemplary embodiment of the present invention, the data string assignment and transmission method = and the memory method. 12 201207621

PSPD-201〇^)〇i5 34915twf.doc/I 在本發明另一範例實施例中,記憶體管理電路2〇2的 控制指令亦可以程式碼型式儲存於非揮發性記憶體模袓 106的特定區域(例如,記憶體模組中專用於存放系統資料 的系統區)中。此外,記憶體管理電路202具有微處理器單 元(未繪示)、唯讀記憶體(未繪示)及隨機存取記憶體(未緣 示)特別疋,此唯讀記憶體具有驅動碼段,並且當情體 控制器1〇4被致能時,微處理器單元會先執行此ς動己^ • 來將儲存於非揮發性記憶體模組106中之控制指令載入至 體管理電路202的隨機存取記憶體中。之後,微處理 益單7C會運轉此些控制指令以執行本發明第一範例實施例 的資料串分派與傳送方法以及記憶體管理方法。此外,在 本發明另一範例實施例中,記憶體管理電路2〇2的控制指 令亦可以一硬體型式來實作。PSPD-201〇^)〇i5 34915twf.doc/I In another exemplary embodiment of the present invention, the control command of the memory management circuit 2〇2 may also be stored in the non-volatile memory module 106 in a code pattern. The area (for example, the system area in the memory module dedicated to storing system data). In addition, the memory management circuit 202 has a microprocessor unit (not shown), a read-only memory (not shown), and a random access memory (not shown). The read-only memory has a drive code segment. And when the modal controller 1 〇 4 is enabled, the microprocessor unit first performs the stimuli to load the control commands stored in the non-volatile memory module 106 into the body management circuit. 202 in random access memory. Thereafter, the microprocessor benefit 7C runs these control instructions to execute the data string assignment and transfer method and the memory management method of the first exemplary embodiment of the present invention. In addition, in another exemplary embodiment of the present invention, the control command of the memory management circuit 2〇2 can also be implemented in a hardware type.

主機介面204是耦接至記憶體管理電路2〇2並且用以 接收與識別主機系統1〇〇〇所傳送的指令與資料。也就是 說’主機系統1000所傳送的指令與資料會透過主機介面 2〇4來傳送至記憶體管理電路2〇2。在本範例實施例中,主 機”面204為符合SD標準的介面。然而,必須瞭解的是 本發明不限於此,主機介面2〇4亦可以是符合MS標準、 MMC #準、CF 標準、PATA 標準、IEEE 1394 標準、PCIThe host interface 204 is coupled to the memory management circuit 2〇2 and is configured to receive and identify the instructions and data transmitted by the host system. That is to say, the commands and data transmitted by the host system 1000 are transmitted to the memory management circuit 2〇2 through the host interface 2〇4. In the present exemplary embodiment, the host "face 204" is an interface conforming to the SD standard. However, it must be understood that the present invention is not limited thereto, and the host interface 2〇4 may also conform to the MS standard, MMC #准, CF standard, PATA. Standard, IEEE 1394 standard, PCI

Express標準、SATA標準、USB標準、標準或其他標 準的介面。 圮憶體介面206是耦接至記憶體管理電路2〇2並且用 以存取非揮發性記憶體模組106。也就是說,欲寫入至非 201207621Express standard, SATA standard, USB standard, standard or other standard interface. The memory interface 206 is coupled to the memory management circuit 2〇2 and is used to access the non-volatile memory module 106. In other words, want to write to non 201207621

--------U015 34915twf.doc/I 揮發性記憶體模組106的資料會經由記憶體介面206轉換 為非揮發性記憶體模組106所能接受的格式。 緩衝記憶體208是耦接至記憶體管理電路202並且用 以暫存來自於主機系統1000的資料與指令或來自於非揮 發性記憶體模組106的資料。 在本發明一範例實施例中’記憶體控制器1〇4還包括 電源管理電路254。電源管理電路254是耦接至記憶體管 理電路202並且用以控制記憶體儲存裝置1〇〇的電源。 在本發明一範例實施例中,記憶體控制器1〇4還包括 錯誤檢查與校正電路256 »錯誤檢查與校正電路256是搞 接至記憶體管理電路202並且用以執行錯誤檢查與校正程 序以確保資料的正確性。具體來說,當記憶體管理電路2〇2 從主機系統1000令接收到寫入指令時,錯誤檢查與校正電 路256會為對應此寫入指令的資料產生對應的錯誤檢查與 校正碼(Error Checking and Correcting Code, ECC Code),並 且s己憶體官理電路202會將對應此寫入指令的資料與對應 的錯誤檢查與校正碼寫入至非揮發性記憶體模組1〇6中。 之後,當記憶體官理電路202從非揮發性記憶體模組 中讀取資料時會同時讀取此資料對應的錯誤檢查與校正 碼,並且錯誤檢查與校正電路256會依據此錯誤檢查與校 正碼對所讀取的資料執行錯誤檢查與校正程序。 值得一提的是,智慧卡晶片1〇8是透過記憶體儲存裝 置1〇〇的連接器102接收來自於主機系統1000的指令與資 料與傳送資料至主機系統1000’而非直接透過智慧卡^面--------U015 34915twf.doc/I The data of the volatile memory module 106 is converted to a format acceptable to the non-volatile memory module 106 via the memory interface 206. The buffer memory 208 is coupled to the memory management circuit 202 and is used to temporarily store data and instructions from the host system 1000 or data from the non-volatile memory module 106. In an exemplary embodiment of the invention, the memory controller 1〇4 further includes a power management circuit 254. The power management circuit 254 is coupled to the memory management circuit 202 and is used to control the power of the memory storage device 1A. In an exemplary embodiment of the present invention, the memory controller 〇4 further includes an error checking and correcting circuit 256. The error checking and correcting circuit 256 is coupled to the memory management circuit 202 and configured to perform an error checking and correcting process. Ensure the correctness of the information. Specifically, when the memory management circuit 2〇2 receives a write command from the host system 1000, the error check and correction circuit 256 generates a corresponding error check and correction code for the data corresponding to the write command (Error Checking). And Correction Code, ECC Code), and the suffix system 202 writes the data corresponding to the write command and the corresponding error check and correction code into the non-volatile memory module 〇6. Thereafter, when the memory official circuit 202 reads the data from the non-volatile memory module, the error check and correction code corresponding to the data is simultaneously read, and the error check and correction circuit 256 checks and corrects according to the error. The code performs an error check and correction procedure on the data read. It is worth mentioning that the smart card chip 1 8 receives the command and data from the host system 1000 and transmits the data to the host system 1000' through the connector 102 of the memory storage device 1 instead of directly transmitting the smart card. surface

201207621 FSFU-2010-0015 34915twf.doc/I (即’介面l〇8a)與主機系統1000通訊。基此,在本發明第 一範例實施例中’應用程式112 0會被安裝在主機系統丨〇 〇 〇 中’以處理欲傳送給智慧卡晶片108的指令資料單元以及 識別智慧卡晶片108的回應資料單元。例如,在本範例實 施例中,傳送給智慧卡晶片108的指令資料單元稱為指令_ 應用程式協定資料單元(Command-Application Pfotoeol Data Unit,C-APDU)並且來自於智慧卡晶片ι〇8的回應資 料單元稱為回應-應用程式協定資料單元 (Response-Application Protocol Data Unit, R-APDU)。特別 疋,記憶體控制器104會根據第一範例實施例的資料串傳 送與分派方法來識別與傳送智慧卡晶片1〇8的C_APDU與 R-APDU。也就是說,當主機系統1〇〇〇對具有非揮發性記 憶體模組106與智慧卡晶片108之架構的記憶體儲存裝置 100進行操作時,記憶體控制器104會配合應用程式1120 的運作根據本發明第一範例實施例的資料串傳送與分派方 法來傳送與分派欲下達給智慧卡晶片的C-APDU以正 確地將屬於C-APDU的資料串傳送至智慧卡晶片ι〇8並且 將來自於智慧卡晶片108的R-APDU正確地回傳給主機系 統 1000。 在本範例實施例中’應用程式1120會在記憶體儲存裝 置100儲存一個或多個檔案,並且將用以儲存此一個或多 個檔案的邏輯區塊位址的資訊傳送給記憶體控制器104 ^ 例如’當應用程式1120下達在記憶體儲存裝置1〇〇中儲存 檔案RF的指令時,作業系統丨丨1〇會根據記憶體儲存裝置 15 2〇12〇7621 ---------U〇15201207621 FSFU-2010-0015 34915twf.doc/I (ie, 'interface l〇8a) communicates with host system 1000. Accordingly, in the first exemplary embodiment of the present invention, the 'application 112 0 will be installed in the host system' to process the command data unit to be transmitted to the smart card wafer 108 and the response to identify the smart card wafer 108. Data unit. For example, in the present exemplary embodiment, the command data unit transmitted to the smart card chip 108 is referred to as a Command-Application Pfotoeol Data Unit (C-APDU) and is derived from the smart card chip ι8. The response data unit is called a Response-Application Protocol Data Unit (R-APDU). In particular, the memory controller 104 recognizes and transmits the C_APDU and the R-APDU of the smart card chip 1 to 8 according to the data string transmission and assignment method of the first exemplary embodiment. That is, when the host system 1 operates the memory storage device 100 having the architecture of the non-volatile memory module 106 and the smart card chip 108, the memory controller 104 cooperates with the operation of the application 1120. A data string transfer and dispatch method according to a first exemplary embodiment of the present invention transmits and dispatches a C-APDU to be distributed to a smart card chip to correctly transfer a data string belonging to the C-APDU to the smart card chip ι 8 and The R-APDU from the smart card chip 108 is correctly transmitted back to the host system 1000. In the present exemplary embodiment, the application 1120 stores one or more files in the memory storage device 100 and transmits information for storing the logical block addresses of the one or more files to the memory controller 104. ^ For example, 'When the application 1120 issues an instruction to store the file RF in the memory storage device 1,, the operating system 丨丨1〇 will be based on the memory storage device 15 2〇12〇7621 -------- -U〇15

34915twf.doc/I 1⑻的棺案㈣(未♦示)使用部分的邏輯區塊位址(例如, 邏輯區塊位址LBA(O)〜LBA(K))來寫入檔案处。在此,用 以儲存棺案RF的邏輯區塊位址的被稱為特定邏輯區塊位 址(如圖3的斜線所示)。 特別是’在本範例實施例中,任何針對智慧卡晶片1〇8 的操作都是藉由應用程式1120對檔案奸進行存取來完 成。也就是說,應用程式1120會透過對檔案奸的寫入指 7將C-APDU傳送至§己憶體儲存裝置1〇〇並且透過對樓案 RF的讀取指令從記憶體儲存裝置丨⑽中讀 得-提的是’在其他作業系統中’應用程式⑽亦可直接 對對應檔案RF的特定邏輯區塊位址進行存取,來執行對 智慧卡晶片108的操作。 具體來說,記憶體控制器104的記憶體管理電路2〇2 會包括狀態機(state machine)並且根據主機系統1〇〇〇對智 慧卡晶片108賴作來更新此狀雜雜態。此外,當應 用程式1120對此财RF進行存取時,記憶體控制器^ 會根據此狀態機的狀態來判斷是否將來自於主機系統 1000的資料串魏給智慧卡晶片⑽或者㈣朗回應訊 息回傳給主機系統1〇〇〇。 一圖4是根據本發明第一範例實施例所繪示的狀態機的 不意圖。 請參照圖4,在記憶體儲存裝置1〇〇開始運作時,狀 態機會處於閒置(Idle)狀態401 〇在閒置狀態彻期間,記 憶體控制B 104會判斷來自於主機系統1〇〇〇的寫入指令是The 34915twf.doc/I 1(8) file (4) (not shown) uses a portion of the logical block address (eg, logical block addresses LBA(0) to LBA(K)) to write to the archive. Here, the logical block address used to store the file RF is referred to as a specific logical block address (as indicated by the slanted line in Fig. 3). In particular, in the present exemplary embodiment, any operation for the smart card chip 1-8 is performed by the application 1120 accessing the file. That is to say, the application 1120 transmits the C-APDU to the § memory storage device 1 through the write command 7 for the scam, and reads the instruction from the memory RF from the memory storage device (10). It is read that the 'in other operating system' application (10) can also directly access the specific logical block address of the corresponding file RF to perform operations on the smart card chip 108. Specifically, the memory management circuit 2〇2 of the memory controller 104 will include a state machine and update the heterogeneous state according to the host system 1 to the smart card wafer 108. In addition, when the application 1120 accesses the financial RF, the memory controller determines whether to send the data string from the host system 1000 to the smart card chip (10) or (4) to respond to the message according to the state of the state machine. Returned to the host system 1〇〇〇. Figure 4 is a schematic illustration of a state machine in accordance with a first exemplary embodiment of the present invention. Referring to FIG. 4, when the memory storage device 1 starts to operate, the state machine is in an idle state (Idle) state 401. During the idle state, the memory control B 104 determines the write from the host system 1〇〇〇. Entry instruction is

201207621 FbFD-2O10-0015 34915twf.doc/I 否為對應特定邏輯區塊位址並且對應此寫入指令的資料串 (以下稱為第一資料串)是否含有特定標記。具體來說當 應用程式1120傳送C-APDU給記憶體儲存裝置100時, 應用程式1120會將特定標記與C-APDU封裝為欲寫入至 檔案RF的資料串並且作業系統111〇會向記憶體儲存裝置 100下達寫入指令以將此資料串寫入至特定邏輯區塊位 址。例如,此特定標記是記錄在此資料串的標頭中。基此, 當記憶體儲存裝置100從主機系統1000中接收到寫入指令 與對應此些寫入指令的資料串時,記憶體管理電路2〇2會 識別出此寫入指令是對應特定邏輯區塊位址且對應此寫入 指令的資料串含有特定標記,由此將此資料串中的 C-APDU傳遞給智慧卡晶片1〇8。 在記憶體管理電路202傳送C-APDU給智慧卡晶片 108之後,狀態機會處於處理(in progress)狀態403。在處 理狀態403期間’記憶體控制器1〇4會等候來自於智慧卡 晶片108的R-APDU。也就是說,處理狀態403表示記憶 體管理電路202尚未從智慧卡晶片1〇8 .中接收到 R-APDU。倘若在處理狀態期間應用程式1120下達對應讀 取檔案RF的讀取指令時,記憶體管理電路202會回覆預 設資料串(以下稱為第二資料串)給主機系統1000。在本範 例實施例中,記憶體控制器104與應用程式1120皆會根據 存取位址單位來傳遞智慧卡晶片的指令資料單元。例如, 在本範例實施例中,此存取位址單位為8千位元組(kilobyte, KB),並且第二資料串會被設定為資料量為8KB且每一個 17 201207621 -υ015201207621 FbFD-2O10-0015 34915twf.doc/I No Is the data string corresponding to the specific logical block address and corresponding to this write command (hereinafter referred to as the first data string) contain a specific tag. Specifically, when the application 1120 transmits the C-APDU to the memory storage device 100, the application 1120 encapsulates the specific tag and the C-APDU into a data string to be written to the file RF and the operating system 111 is directed to the memory. The storage device 100 issues a write command to write the data string to a particular logical block address. For example, this particular tag is recorded in the header of this data string. Therefore, when the memory storage device 100 receives the write command and the data string corresponding to the write commands from the host system 1000, the memory management circuit 2〇2 recognizes that the write command corresponds to a specific logical region. The block address and the data string corresponding to the write command contain a specific tag, thereby transferring the C-APDU in the data string to the smart card chip 1〇8. After the memory management circuit 202 transmits the C-APDU to the smart card wafer 108, the state opportunity is in an in progress state 403. During the processing state 403, the memory controller 1〇4 will wait for the R-APDU from the smart card chip 108. That is, the processing state 403 indicates that the memory management circuit 202 has not received the R-APDU from the smart card chip. If the application 1120 issues a read command corresponding to the read file RF during the processing state, the memory management circuit 202 replies to the preset data string (hereinafter referred to as the second data string) to the host system 1000. In the exemplary embodiment, both the memory controller 104 and the application 1120 transfer the instruction data unit of the smart card chip according to the access address unit. For example, in this exemplary embodiment, the access address unit is 8 kilobytes (kilobyte, KB), and the second data string is set to a data volume of 8 KB and each 17 201207621 - υ 015

34915twf.doc/I 位元皆為0的資料串。特別是,當接收到第二資料串時, 應用程式1120會識別R-APDU未被成功接收並且藉由不 斷地輪詢(pulling)來嘗試從記憶體儲存裝置1〇〇中接收 R-APDU 〇 在接收到智慧卡晶片108的R-APDU之後,狀態機的 狀態會從處理狀態403變為資料可用(Data Available)狀態 405。在資料可用狀態405期間,記憶體控制器1〇4會等候 主機系統1000傳送對應特定邏輯區塊位址的讀取指令。具 體來說’記憶體管理電路202會將從智慧卡晶片1〇8中接 收到的R-APDU儲存在緩衝記憶體208中,並且當從主機 系統1000中接收到對應特定邏輯區塊位址的讀取指令時 將所儲存之R-APDU傳送給主機系統ι〇〇(^特別是,在將 所儲存之R-APDU傳送給主機系統ι〇0〇之後,狀態機的 狀態會從資料可用狀態405變回閒置狀態401。由此,記 憶體控制器104可從主機系統1〇〇〇接收下一個c_APDU 並且傳遞給智慧卡晶片108。 在本發明範例實施例中,記憶體儲存裝置1〇〇與主機 系統1000之間的資料傳遞會透過快取記憶體1106。具體 來說’當主機系統1〇〇〇從記憶體儲存裝置1〇〇中讀取資料 時,主機系統1 〇〇〇的作業系統丨丨丨0會以預讀取(Prefetch) 的方式來提升效能。例如,當主齡統1GGG的應用程式 112〇從記憶體儲存裝置丨⑻的邏輯區塊位址LBA(〇)開始 讀取資料量為8KB的資料時,主機系統丨_的作業系統 1110會從s己憶體儲存裝置1〇〇的邏輯區塊位址LBA(〇)開 201207621The 34915twf.doc/I bit is a data string of 0. In particular, upon receiving the second data string, the application 1120 will recognize that the R-APDU was not successfully received and attempt to receive the R-APDU from the memory storage device 1 by continuously polling. Upon receipt of the R-APDU of smart card wafer 108, the state of the state machine changes from processing state 403 to data available state 405. During the data available state 405, the memory controller 1〇4 will wait for the host system 1000 to transmit a read command corresponding to a particular logical block address. Specifically, the 'memory management circuit 202 stores the R-APDUs received from the smart card chip 1 在 8 in the buffer memory 208, and when receiving a corresponding logical block address from the host system 1000 When the command is read, the stored R-APDU is transmitted to the host system (ie, in particular, after the stored R-APDU is transmitted to the host system ι〇0, the state of the state machine is from the data available state. 405 changes back to idle state 401. Thus, memory controller 104 can receive the next c_APDU from host system 1 and pass it to smart card wafer 108. In an exemplary embodiment of the invention, memory storage device 1 The data transfer with the host system 1000 passes through the cache memory 1106. Specifically, when the host system 1 reads data from the memory storage device 1 , the host system 1 The system 丨丨丨0 will improve the performance by means of prefetch. For example, when the application program 112 of the host age 1GGG starts from the logical block address LBA (〇) of the memory storage device 8 (8) Take the amount of data 8KB When the host system Shu _ operating system 1110 will be open from LBA s own memory storage apparatus 1〇〇 of LBA (square) 201 207 621

PSPD-2010-0015 34915twf.docA 始讀取資料量為64KB的資料並儲存此資料於快 1106中。基此,當下-個讀取指令所欲讀取之資料已^ 於快取記憶體1106中時,主機系統〗〇〇〇的作業系統 將能夠直接地從快取記憶體11〇6中讀取此資料,由 存取速度β πPSPD-2010-0015 34915twf.docA Start reading data with a data volume of 64 KB and store this data in 1106. Therefore, when the data to be read by the next read command is already in the cache memory 1106, the operating system of the host system will be able to directly read from the cache memory 11〇6. This data, by access speed β π

值得一提的是,為了避免主機系統1〇〇〇的作業系統 1110直接地從快取記憶體il〇6中提供此資料給應用程式 1120而影響智慧卡晶片i〇8^R_APDU的傳遞,在本範例 實施例中,檔案RF的大小會被設計大於快取記憶體11〇6 的大小。基此,當應用程式1120每次讀取檔案Μ時,作 業系統1110皆必須重新至記憶體儲存裝置1〇〇中讀取資 料。 圖5是根據本發明第一範例實施例所繪示之預讀取的 資料流示意圖,其繪示在作業系統111〇下達讀取指令時記 憶體控制器104尚未從智慧卡晶片108中取得R_ApDU的 範例。 請參照圖5,應用程式1120會傳送指示從特定遠輯區 塊位址LBA(O)開始讀取資料量為8KB的資料之讀取請求 RR1給作業系統1110(資料流S501)。 假設快取記憶體1106未存有對應特定邏輯區塊位址 LBA(O)的資料’因此作業系統mo會以預讀取方式傳送 從特定邏輯區塊位址開始讀取資料量為64KB的資料之讀 取指令RC給記憶體控制器1〇4(資料流S503)。 由於此時記憶體控制器104尚未從智慧卡晶片1〇8中It is worth mentioning that, in order to prevent the host system 1's operating system 1110 from directly providing this data from the cache memory il〇6 to the application 1120 and affecting the transmission of the smart card chip i〇8^R_APDU, In this exemplary embodiment, the size of the file RF is designed to be larger than the size of the cache memory 11〇6. Accordingly, when the application 1120 reads the file each time, the job system 1110 must re-read the data in the memory storage device 1 . FIG. 5 is a schematic diagram of pre-read data flow according to the first exemplary embodiment of the present invention. The memory controller 104 has not obtained the R_ApDU from the smart card chip 108 when the read command is issued by the operating system 111. Example. Referring to Fig. 5, the application 1120 transmits a read request RR1 indicating that the data having a data amount of 8 KB is read from the specific remote block address LBA(O) to the operating system 1110 (data stream S501). It is assumed that the cache memory 1106 does not store the data corresponding to the specific logical block address LBA(O). Therefore, the operating system mo transmits the data of 64 KB from the specific logical block address in the pre-read mode. The read command RC is supplied to the memory controller 1〇4 (data stream S503). Since the memory controller 104 has not yet been taken from the smart card chip 1〇8

201207621 Α JU^-AV Ά v-0015 34915twf.doc/I 取得R-APDU,因此記憶體控制器104會將第二資料串DS2 傳送給主機系統1000(資料流S505)。值得一提的是,由於 第二資料串DS2的大小為8KB,因此為回應從特定邏輯區 塊位址LBA(O)開始讀取資料量為64KB的資料之讀取指令 RC,記憶體控制器1〇4會在第二資料串DS2之後填入資 料量為56KB的整墊位元pb,然後再將包含第二資料串 DS2與整墊位元PB的資料串傳送給主機系統1〇〇〇。基此, 包含第二資料串DS2與整墊位元pb的資料串會被儲存在 快取記憶體1106中。201207621 Α JU^-AV Ά v-0015 34915twf.doc/I The R-APDU is acquired, so the memory controller 104 transmits the second data string DS2 to the host system 1000 (data stream S505). It is worth mentioning that, since the size of the second data string DS2 is 8 KB, in response to the read command RC for reading data of 64 KB from the specific logical block address LBA(O), the memory controller 1〇4 will fill the whole pad bit pb with the data volume of 56KB after the second data string DS2, and then transfer the data string containing the second data string DS2 and the whole pad bit PB to the host system 1〇〇〇 . Accordingly, the data string containing the second data string DS2 and the whole pad bit pb is stored in the cache memory 1106.

之後’作業系統1110會將快取記憶體i 106中前面8KB 的資料(即’第二資料串DS2)傳送給應用程式Π20(資料流 S507)。 圖6是根據本發明第一範例實施例所繪示之預讀取的 資料流示意圖’其繪示在作業系統丨丨丨〇下達讀取指令時記 憶體控制器104已從智慧卡晶片1〇8中取得R_ApDU的範 例0 請參照圖6,在資料流S6〇1中智慧卡晶片1〇8將 R-APDU傳送給記憶體控制器丨〇4。 在資料流S603中應用程式112〇傳送指示從特定邏輯 區塊位址LBA(O)開始讀取資料量為8KB的資料之讀取 求RR1給作業系統111〇。 ° 假設快取記憶體聰未存有對應特定邏輯區塊位址 LBA(O)的資料,因此作業系統1UG會以預讀取方式傳送 從特定邏㈣塊㈣開始讀取f料量為6備的資料之讀 20 201207621Thereafter, the operating system 1110 transfers the data of the first 8 KB of the cache memory i 106 (i.e., the 'second data string DS2') to the application program 20 (data stream S507). FIG. 6 is a schematic diagram of a pre-read data stream according to a first exemplary embodiment of the present invention. FIG. 6 is a schematic diagram of the memory controller 104 having been read from the smart card chip when the read command is issued in the operating system. Example 8 of Obtaining R_ApDU in 8 Referring to FIG. 6, in the data stream S6〇1, the smart card chip 1〇8 transfers the R-APDU to the memory controller 丨〇4. In the data stream S603, the application 112 transmits a read request for reading the data of 8 KB from the specific logical block address LBA(O) to the operating system 111. ° Assume that the cache memory does not have data corresponding to the specific logical block address LBA(O), so the operating system 1UG will transmit in the pre-read mode from the specific logic (four) block (four) to read the f amount to 6 Reading of the information 20 201207621

PSPD-2010-0015 34915twf.doc/I 取指令RC給記憶體控制器104(資料流S605)。PSPD-2010-0015 34915twf.doc/I fetches the command RC to the memory controller 104 (data stream S605).

由於此時記憶體控制器104已從智慧卡晶片108中取 得R-APDU,因此記憶體控制器104會將R-APDU傳送給 主機系統1000(資料流S607)。值得一提的是,由於R-APDUSince the memory controller 104 has taken the R-APDU from the smart card chip 108 at this time, the memory controller 104 transmits the R-APDU to the host system 1000 (data stream S607). It is worth mentioning that due to R-APDU

的大小為8KB,因此為回應從特定邏輯區塊位址LBA(O) 開始讀取資料量為64KB的資料之讀取指令rc,記憶體控 制器104會在R-APDU之後填入資料量為56KB的整墊位 元PB ’然後再將包含R—APDU與整墊位元PB的資料串傳 送給主機系統1〇〇〇。基此,包含R ApDU與整墊位元pB 的資料串會被儲存在快取記憶體11〇6中。 之後’作業系統111〇會將快取記憶體丨1〇6中前面8KB 的資料(,,R-APDU)傳送給應用程式112〇(資料流S6〇9)。 妙ίΐ —提的是,儘管作業系統111G大部分是以一個讀 中,曰I:讀取預讀取的資料。然而,在本發明範例 實施例 令來執〜⑭㉙觸的作業系統UlG有時會以多個讀取指 從:Μ以。二系統_的應用程式 讀取資料量為8ΚΒ的資料時的ft塊位址LBA(〇)開始 1110會以兩個讀取指令來^取j系統1000的作業系統 如,作業系統uω會^、^貝料量為64KB的資料。例 置10〇的邏輯二達固讀取指令從記憶體儲存裝The size is 8 KB, so in response to the read command rc of the data having a data volume of 64 KB from the specific logical block address LBA(O), the memory controller 104 fills in the data amount after the R-APDU. The 56KB full pad bit PB 'and then transmits the data string containing the R-APDU and the whole pad bit PB to the host system 1〇〇〇. Accordingly, the data string including the R ApDU and the whole pad pB is stored in the cache memory 11〇6. Thereafter, the operating system 111 transmits the first 8 KB of data (, R-APDU) in the cache memory 1 to 6 to the application 112 (data stream S6〇9). Miaoίΐ—Improve that although the operating system 111G is mostly in one reading, 曰I: reads pre-read data. However, in the exemplary embodiment of the present invention, the operating system U1G of the ~1429 touch is sometimes referred to by a plurality of readings. When the application of the second system_ reads the data of 8ΚΒ, the ft block address LBA (〇) starts 1110 and takes two read commands to obtain the operating system of the j system 1000. For example, the operating system uω will be ^, ^ The amount of material is 64KB. Example 10 〇 logical two-dimensional read command from memory storage

的資料,然開始讀取資料量為〇.财 的資料。冉下心—個餘料來讀取_之63.5KB 圖7是根據本發明第一範例實施例所繪示之預讀取的 21The information, but began to read the amount of information for the money.冉下心—A remaining material to read _63.5KB FIG. 7 is a pre-read according to the first exemplary embodiment of the present invention.

34915twf.doc/I 201207621_ * wa mw λ v —0013 資料流示意圖,其繪示記憶體控制器1〇4於作業系統iii〇 以預讀取方式運作讀取資料_從智慧卡晶片⑽中接收 到R-APDU的範例。 清參照圖7,在資料流S701中應用程式^2(3傳送指 示從特定邏輯區塊位址LBA(G)_讀取·量為⑽^ 資料之讀取請求RR1給作業系統111〇。 假没快取s己憶體1106未存有對應特定邏輯區塊位址 LBA(O)的資料’因此作業系統111G會以預讀取方式傳送 從特定邏輯區塊位址開始讀取資料量為64KB的資料之讀 取才曰令給§己憶體控制器104 ’其中在資料流s7〇3中作業系 統liio會先以讀取指令rci讀取前面〇 5KB的資料。、 由於此時記憶體控制器104尚未從智慧卡晶片1〇8中 取得R-APDU,因此記憶體控制器丨04會將第二資料串Μ2 傳送給主機系統1000(資料流S705)。值得一提的是,由於 第二資料串的大小為8KB,因此為回應從特定邏輯區塊位 址LBA(O)開始讀取資料量為〇.5KB的資料之讀取指令 RC1 ’ &己憶體控制器1〇4會僅傳送第二資料串ds2之中前 面0.5KB的資料給主機系統1〇〇〇。 在資料流S707中記憶體控制器1〇4從智慧卡晶片1〇8 中接收到R-APDU。 之後,在資料流S709中作業系統mo會再以讀取指 令RC2讀取後續之63.5KB的資料。 由於此時記憶體控制器104已從智慧卡晶片1〇8中取 得R-APDU,因此記憶體控制器104會將r_apdij傳送給 22 20120762134915twf.doc/I 201207621_ * wa mw λ v — 0013 A data flow diagram showing that the memory controller 〇4 operates in a pre-read mode to read data from the operating system iii _ received from the smart card chip (10) An example of an R-APDU. Referring to Fig. 7, in the data stream S701, the application program 2 (3 transmits a read request RR1 indicating that the data is read from the specific logical block address LBA(G)_ is (10)^ to the operating system 111. The data of the corresponding logical block address LBA(O) is not stored in the memory file 1106. Therefore, the operating system 111G transfers the data amount from the specific logical block address to 64 KB in the pre-read mode. The reading of the data is given to the § memory controller 104. In the data stream s7 〇 3, the operating system liio will first read the data of the previous KB 5 KB with the read command rci. The processor 104 has not yet obtained the R-APDU from the smart card chip 1〇8, so the memory controller 丨04 transmits the second data string Μ2 to the host system 1000 (data stream S705). It is worth mentioning that, due to the second The size of the data string is 8 KB, so in response to reading the data from the specific logical block address LBA(O), the read command RC1 ' & the memory controller 1〇4 will only read data. The first 0.5 KB of the data in the second data string ds2 is transmitted to the host system 1〇〇〇. In the data stream S707 The memory controller 1〇4 receives the R-APDU from the smart card chip 1〇8. Thereafter, in the data stream S709, the operating system mo reads the subsequent 63.5 KB of data by the read command RC2. The memory controller 104 has taken the R-APDU from the smart card chip 1〇8, so the memory controller 104 will transmit r_apdij to 22 201207621

PSPD-2010-0015 34915twf.doc/IPSPD-2010-0015 34915twf.doc/I

主機系統1000(資料流S711)。值得一提的是,由於R-ApDU 的大小為8KB,因此為回應從特定邏輯區塊位址lba(〇) 開始讀取資料量為63.5KB的資料之讀取指令RC2,記憶 體控制器104會在R-APDU之後填入資料量為55 5KB的 整墊位元PB,然後再將包含R-APDU與整墊位元pB的資 料串傳送給主機系統1 〇〇〇。基此,包含部分第二資料串、 R APDU與整塾位元ρβ的資料串會被儲存在快取記憶體 φ 1106 中。 之後’作業系統1110會將快取記憶體中前面8ΚΒ 的資料傳送給應用程式1120(資料流S713)。 值得一提的是,由於快取記憶體1106中前面8KB的 資料之中則面0.5KB的資料為部分之第二資料串ds2並且 後續7.5KB的資料為部分之R-APDU,因此應用程式1120 將接收到不元整之R-APDU。特別是,依據圖4所示,在 記憶體控制器104的記憶體管理電路2〇2傳送R_ApDU給 主機系統1000之後,狀態機的狀態會變為閒置狀態,由此 * 表示已完成傳遞應用程式1120所傳送之c_APDlJ及智慧 卡晶片108所回應之R-APDU。然而,此時應用程式112〇 會藉由錯誤偵測技術而識別所接收之r_APDu不完整而再 次發送讀取R-APDU的請求。 為了處理上述之錯誤傳遞,在本發明範例實施例中, 在將所儲存之R-APDU傳送給主機系統1〇〇〇之後,記憶 體管理電路2〇2不會立即地清除儲存在緩衝記憶體2〇8中 的R-APDU。例如,記憶體管理電路2〇2會在接收到下一 23Host system 1000 (data stream S711). It is worth mentioning that since the size of the R-ApDU is 8 KB, the memory controller 104 responds to the read command RC2 of the data having a data volume of 63.5 KB from the specific logical block address lba(〇). A full pad PB of 55 5 KB is filled in after the R-APDU, and then the data string containing the R-APDU and the whole pad pB is transmitted to the host system 1 〇〇〇. Accordingly, the data string including the partial second data string, the R APDU and the integer bit ρβ is stored in the cache memory φ 1106. Thereafter, the operating system 1110 transmits the data of the first 8 pages of the cache memory to the application 1120 (data stream S713). It is worth mentioning that, since the 0.5 KB data in the first 8 KB of the cache memory 1106 is part of the second data string ds2 and the subsequent 7.5 KB data is part of the R-APDU, the application 1120 The R-APDU will be received. In particular, according to FIG. 4, after the memory management circuit 2〇2 of the memory controller 104 transfers the R_ApDU to the host system 1000, the state of the state machine becomes an idle state, whereby * indicates that the transfer application has been completed. The R_APDU that is transmitted by the c_APD1J and the smart card chip 108 transmitted by the 1120. However, at this time, the application 112 识别 recognizes that the received r_APDu is incomplete and resends the request to read the R-APDU by the error detection technology. In order to deal with the above error transmission, in the exemplary embodiment of the present invention, after the stored R-APDU is transmitted to the host system 1 , the memory management circuit 2〇2 does not immediately clear the buffer memory. R-APDU in 2〇8. For example, the memory management circuit 2〇2 will receive the next 23

34915twf.doc/I 201207621 ____ »υ015 個C-APDU時’才將所儲存之R_ApDU清除。此外,在閒 置狀態401期間’當記憶體儲存裝置100從主機系統1_ 中接收到對應特定邏輯區塊位址的讀取指令時,記憶體管 理電路202會再次將儲存在緩衝記憶體2〇8中的r_a醜 傳送給主機系統1000。 请再參照圖7,在資料流s715中應用程式112〇會再 次傳送指碰特^賴區塊他LBA⑼Μ始讀取資料量 為8ΚΒ的資料之讀取請求RR2給作業系統1100。在資料 流S717中作業系統111〇會以讀取指令RC3來讀取 為64KB的資料。 由於R-APDU已儲存於記憶體控制器1〇4的緩衝記憶 體208中’因此記憶體控制器1〇4會將R_ApDl^資料量 =)6KB的整墊位a PB傳送給主機系統聊(資料流 之後’作業系統111〇會將快取記憶體丨1〇6中前面8κβ 的資料傳送給應用程式112〇(資料流S721)。基此,當作業 系統1 _㈣相-個讀取指令純行預棘運作時,應 用程式1120就可取得正確的r_APDu。 〜 圖8是根據本發明第一範例實施例所繪示的資料串分 派與傳送方法的流程圖,其繪示接收到寫入指令的處理步 驟。 ’ 請參照圖8 ’在步驟S8〇1中,記憶體控制器1〇4的記 憶體管理電路202會從主機系統1〇〇〇中接收寫入指令與^ 應此寫入指令的第一資料串。 24 20120762134915twf.doc/I 201207621 ____ »υ015 C-APDUs will be cleared by the stored R_ApDU. In addition, during the idle state 401, when the memory storage device 100 receives a read command corresponding to a specific logical block address from the host system 1_, the memory management circuit 202 will again store the buffer memory 2〇8. The r_a ugly is transferred to the host system 1000. Referring to FIG. 7, in the data stream s715, the application program 112 transmits the read request RR2 of the data having the data volume of 8 给 to the operating system 1100 again by the LBA (9). In the stream S717, the operating system 111 reads 64 KB of data by the read command RC3. Since the R-APDU has been stored in the buffer memory 208 of the memory controller 1〇4, the memory controller 1〇4 will transfer the R_ApDl^ data amount=6KB full pad a PB to the host system chat ( After the data stream, the operating system 111 transmits the data of the first 8 kappa in the cache memory 1 to 6 to the application 112 (data stream S721). Based on this, when the operating system 1_(4) phase-read command is pure When the pre-spinning operation is performed, the application 1120 can obtain the correct r_APDu. FIG. 8 is a flowchart of the data string assignment and transmission method according to the first exemplary embodiment of the present invention, which shows that the write instruction is received. Please refer to FIG. 8 'In step S8〇1, the memory management circuit 202 of the memory controller 1〇4 receives the write command and the write command from the host system 1A. The first data string. 24 201207621

FSFU-2010-0015 34915twf.doc/I 在步驟S803中,記憶體管理電路202會判斷對應此 寫入指令的邏輯區塊位址是否屬於特定邏輯區塊位址。 倘若對應此寫入指令的邏輯區塊位址不屬於特定邏輯 區塊位址時’則在步驟S805中記憶體管理電路202會依 據此寫入指令將第一資料串寫入至非發性記憶體模組1〇6 中。倘若對應此寫入指令的邏輯區塊位址屬於特定邏輯區 塊位址時’則在步驟S807中記憶體管理電路202會判斷 φ 第一資料串是否包含特定標記》 倘若第一資料串包含特定標記時,則在步驟S809中 記憶體管理電路202會將第一資料串中的C-APDU(即,第 一資料串中不包含特定標記的部分)傳送給智慧卡晶片 108,並且在步驟S811中記憶體管理電路202會清除儲存 於緩衝記憶體208中的R-APDU。特別是,此時,狀態機 會從閒置狀態401變為處理狀態403。倘若在步驟S807中 判斷第一資料串未包含特定標記時’則圖8的流程會被結 束。 籲. 圖9是根據本發明第一範例實施例所繪示的資料串分 派與傳送方法的流程圖,其繪示接收到讀取指令的處理步 驟。. 請參照圖9 ’在步驟S9〇i中’記憶體控制器1()4的記 憶體管理電路202會從主機系統1〇〇〇中接收讀取指令。 在步驟S903中,記憶體管理電路202會判斷對應此 讀取指令的邏輯區塊位址是否屬於特定邏輯區塊位址。 倘若對應此讀取指令的邏輯區塊位址不屬於特定邏輯 25FSFU-2010-0015 34915twf.doc/I In step S803, the memory management circuit 202 determines whether the logical block address corresponding to the write instruction belongs to a specific logical block address. If the logical block address corresponding to the write command does not belong to a specific logical block address, then the memory management circuit 202 writes the first data string to the non-volatile memory according to the write command in step S805. Body module 1〇6. If the logical block address corresponding to the write command belongs to a specific logical block address, then the memory management circuit 202 determines in step S807 whether the first data string contains a specific tag or not. When marking, the memory management circuit 202 transmits the C-APDU in the first data string (ie, the portion of the first data string that does not contain the specific mark) to the smart card wafer 108 in step S809, and in step S811. The middle memory management circuit 202 clears the R-APDUs stored in the buffer memory 208. In particular, at this time, the state machine changes from the idle state 401 to the processing state 403. If it is judged in step S807 that the first data string does not contain a specific flag, then the flow of Fig. 8 is ended. 9 is a flow chart of a data string assignment and transmission method according to a first exemplary embodiment of the present invention, which illustrates a processing step of receiving a read instruction. Referring to Fig. 9' in step S9〇i, the memory management circuit 202 of the memory controller 1() 4 receives the read command from the host system 1A. In step S903, the memory management circuit 202 determines whether the logical block address corresponding to the read instruction belongs to a specific logical block address. If the logical block address corresponding to this read instruction does not belong to a specific logic 25

201207621 U015 34915twf.doc/I 區塊位址時’則在步驟_5中記憶體管理電路2⑽會依 據此讀取指令從非發性記憶體模組1〇6中讀取資料(以下 稱為第三資料串)並且將第三資料串傳送給主機系統 1000。倘若對應此讀取指令的輯區塊位址屬於特定邏輯 區塊位址時,則在步驟S907中記憶體管理電路2〇2會判 斷狀態機是否處於資料可用狀態4〇5或閒置狀態4〇1。 倘若狀態機非處於資料可用狀態4〇5或間置狀態4〇1 時,在步驟S909中記憶體管理電路2〇2會將第二資料串 傳送給主機系統1000。 _ 倘若狀態機處於資料可用狀態405或閒置狀態401 時,在步驟S9U中記憶體管理電路202會判斷在緩衝記 憶體208中是否存有R-APDU。 倘若在緩衝記憶體208中未存有R-APDU時,步驟 S909會被執行。倘若在緩衝記憶體2〇8中存有R-APdu 時,則在步驟S913中記憶體管理電路202會將R-APDU 傳送給主機系統1000。傳送第二資料串與R_APDU的方式 已配合圖5、6與7描述如上,在此不重複描述。 鲁 [第二範例實施例] 本發明第二範例實施例的記憶體儲存裝置與主機系 統本質上是相同於第一範例實施例的記憶體儲存裝置與主 機系統,其中差異在於第二範例實施例的記憶體控制器使 用不同的方法來分派與傳送智慧卡晶片的R-APDU。以下 將使用圖1〜圖3的裝置結構來描述第二範例實施例。 在第二範例實施例中,當來自於主機系統1000之讀 26 201207621201207621 U015 34915twf.doc/I Block Address] 'In step _5, the memory management circuit 2 (10) reads data from the non-volatile memory module 1〇6 according to the read command (hereinafter referred to as the first The three data strings are transmitted to the host system 1000. If the block address corresponding to the read command belongs to a specific logical block address, the memory management circuit 2〇2 determines whether the state machine is in the data available state 4〇5 or the idle state 4〇 in step S907. 1. If the state machine is not in the data available state 4〇5 or the intervening state 4〇1, the memory management circuit 2〇2 transmits the second data string to the host system 1000 in step S909. If the state machine is in the data available state 405 or the idle state 401, the memory management circuit 202 determines in step S9U whether or not there is an R-APDU in the buffer memory 208. If there is no R-APDU in the buffer memory 208, step S909 is executed. If R-APdu is stored in the buffer memory 202, the memory management circuit 202 transfers the R-APDU to the host system 1000 in step S913. The manner of transmitting the second data string and the R_APDU has been described above in conjunction with Figs. 5, 6 and 7, and the description will not be repeated here. [Second exemplary embodiment] The memory storage device and the host system of the second exemplary embodiment of the present invention are essentially the same as the memory storage device and the host system of the first exemplary embodiment, wherein the difference lies in the second exemplary embodiment. The memory controller uses different methods to dispatch and transmit R-APDUs for smart card chips. The second exemplary embodiment will be described below using the apparatus structure of Figs. 1 to 3. In the second exemplary embodiment, when reading from the host system 1000 26 201207621

^0-2010-0015 34915twf.doc/I 取指令所對應的邏輯區塊位址屬於特定邏輯區塊位址時, S己,體控制1 1G4 |判斷此讀取指令所對應的邏輯區塊位 址是否為上述存取位址單位的倍數。並且,當來自於主機 系,1000之讀取指令所對應的邏輯區塊位址非為存取位 址單位的倍數時’記憶體控制器1〇4會識別主機系統1〇〇〇 疋以多個讀取指令來執行預讀取。基此,記憶體控制器1〇4 會將R-APDU分段來傳送給主機系統1〇〇〇。 參 圖10是根據本發明第二範例實施例所繪示之預讀取 的資料流示意圖,其繪示在作業系統111〇下達讀取指令時 記憶體控制器104已從智慧卡晶片1〇8中取得R_APDU的 範例。 請參照圖10 ’在資料流S1001中智慧卡晶片1〇8將 R-APDU傳送給記憶體控制器1〇4。 在資料流S1003中應用程式1120傳送指示從特定邏 輯區塊位址LBA(O)開始讀取資料量為8KB的資料之讀取 請求RR1給作業系統1110。 鲁 假設快取記憶體Π06未存有對應特定邏辑區塊位址 LBA(O)的資料,因此作業系統1110會以預讀取方式傳送 從特定邏輯區塊位址開始讀取資料量為64KB的資料之讀 取指令給記憶體控制器104,其中在資料流S1005中作業 系統1110會先以讀取指令RC1讀取前面0.5KB的資料。 由於此時R-APDU已儲存於緩衝記憶體208中,因此 記憶體控制器104會將R-APDU之中前面0.5KB的資料傳 送給主機系統1000(資料流S1007)。 27 201207621 .0015^0-2010-0015 34915twf.doc/I When the logical block address corresponding to the fetch instruction belongs to a specific logical block address, S1, body control 1 1G4 | determine the logical block bit corresponding to the read instruction Whether the address is a multiple of the above-mentioned access address unit. Moreover, when the logical block address corresponding to the read command of the host system 1000 is not a multiple of the access address unit, the memory controller 1〇4 will recognize the host system 1 Read instructions to perform prefetching. Based on this, the memory controller 1〇4 segments the R-APDUs to the host system 1〇〇〇. 10 is a schematic diagram of a pre-read data stream according to a second exemplary embodiment of the present invention, which shows that the memory controller 104 has been slaved from the smart card chip when the operating system 111 has issued a read command. Get an example of R_APDU. Referring to Fig. 10', in the data stream S1001, the smart card chip 1〇8 transfers the R-APDU to the memory controller 1〇4. In the data stream S1003, the application 1120 transmits a read request RR1 indicating that the data having a data amount of 8 KB is read from the specific logical block address LBA(0) to the operating system 1110. Lu assumes that the cache memory Π06 does not have data corresponding to the specific logical block address LBA(O), so the operating system 1110 will transfer the read data from the specific logical block address to 64 KB in pre-read mode. The data read command is sent to the memory controller 104, wherein in the data stream S1005, the operating system 1110 first reads the first 0.5 KB of data with the read command RC1. Since the R-APDU is already stored in the buffer memory 208 at this time, the memory controller 104 transfers the first 0.5 KB of data in the R-APDU to the host system 1000 (data stream S1007). 27 201207621 .0015

34915twf.doc/I 之後’在資料流S1009中作業系統ΐπ〇會再以讀取 指令RC2讀取後續之63.5KB的資料。 此時記憶體控制器104會識別讀取指令RC2的邏輯區 塊位址非為存取位址單位的倍數,基此,記憶體控制器1〇4 會將R-APDU之中後續7.5KB的資料傳送給主機系統 1000(資料流S1011)。類似地’記憶體控制器1〇4會在 R-APDU之後填入資料量為56KB的整墊位元pb,以回應 讀取63.5KB的讀取指令RC2。 之後’作業系統1110會將快取記憶體1106中前面8KB 的資料(即,R-APDU)傳送給應用程式1120(資料流S1013)。 基此,在第二範例實施例中,記憶體控制器104能夠 根據讀取指令所對應的邏輯區塊位址將快取記憶體U〇6 之中對應R-APDU的部分傳送給主機系統1000,由此防止 當作業系統1110使用多個讀取指令來執行預讀取運作時 而使應用程式1120無法接收到正確之R-APDU的問題。 圖11是根據本發明第二範例實施例所繪示的資料串 分派與傳送方法的流程圖,其繪示接收到讀取指令的處理 步驟。 請參照圖11,在步驟S1101中,記憶體控制器104的 記憶體管理電路202會從主機系統1〇〇〇中接收讀取指令。 在步驟S1103中,記憶體管理電路202會判斷對應此 讀取指令的邏輯區塊位址是否屬於特定邏輯區塊位址。 倘若對應此讀取指令的邏輯區塊位址不屬於特定邏輯 區塊位址時,則在步驟S1105中記憶體管理電路202會依 28 201207621After 34915twf.doc/I, the operating system ΐπ〇 in the data stream S1009 will read the next 63.5 KB of data with the read command RC2. At this time, the memory controller 104 recognizes that the logical block address of the read command RC2 is not a multiple of the access address unit, and accordingly, the memory controller 1〇4 will follow the next 7.5 KB of the R-APDU. The data is transferred to the host system 1000 (data stream S1011). Similarly, the memory controller 1〇4 fills the entire pad level pb with a data volume of 56 KB after the R-APDU in response to reading the 63.5 KB read command RC2. Thereafter, the operating system 1110 transfers the first 8 KB of data (i.e., R-APDU) in the cache memory 1106 to the application 1120 (data stream S1013). Therefore, in the second exemplary embodiment, the memory controller 104 can transmit the portion of the cache memory U 〇 6 corresponding to the R-A PDU to the host system 1000 according to the logical block address corresponding to the read command. Thus, the problem of the application system 1120 being unable to receive the correct R-APDU when the operating system 1110 uses a plurality of read commands to perform the pre-read operation is thereby prevented. FIG. 11 is a flowchart of a data string assignment and transmission method according to a second exemplary embodiment of the present invention, which illustrates a processing step of receiving a read instruction. Referring to Fig. 11, in step S1101, the memory management circuit 202 of the memory controller 104 receives a read command from the host system 1A. In step S1103, the memory management circuit 202 determines whether the logical block address corresponding to the read instruction belongs to a specific logical block address. If the logical block address corresponding to the read instruction does not belong to a specific logical block address, the memory management circuit 202 will comply with the process in step S1105.

raru-^O 10-0015 34915twf.doc/I 據此讀取指令從非發性記憶體模組l〇6中讀取資料(以下 稱為第三資料串)並且將第三資料串傳送給主機系統 1000。倘若對應此讀取指令的邏輯區塊位址屬於特定邏輯 區塊位址時,則在步驟S1107中記憶體管理電路2〇2會判 斷在緩衝記憶體208中是否存有r_apdu。 倘若在緩衝記憶體208中未存有R_APDlJ時,在步驟 S1109中記憶體管理電路202會將第二資料串傳送給主機 • 系統丨〇⑻。倘若緩衝記憶體208中存有R-APDU時,在步 驟S1111中記憶體管理電路202會判斷對應此讀取指令的 邏輯區塊位址是否對應存取位址單位(即,對應此讀取指令 的邏輯區塊位址是否為存取位址單位的倍數)。 倘若對應此讀取指令的邏輯區塊位址對應存取位址單 位時,在步驟S1113中記憶體管理電路202會依據對應讀 取指令的資料讀取量將至少部分的R_APDU傳送給主機系 統1000並且記錄已傳送的部分。 倘若對應此讀取指令的邏輯區塊位址未對應存取位址 單位時,在步驟S1115中記憶體管理電路202會依據前次 已傳送之部分以及對應此讀取指令的資料讀取量接續地將 其他部分的R-APDU傳送給主機系統1〇〇〇並且記錄所傳 送之部分。值得一提的是,在第二範例實施例中,在完整 的R-APDU都已傳送給主機系統1〇〇〇後,狀態機的狀態 才會從資料可用狀態變為閒置狀態。 综上所述’本發明範例實施例的資料串分派與傳送方 法是將智慧卡晶片的回應資料單元儲存於緩衝記憶體中。 29 201207621 ►-O015Raru-^O 10-0015 34915twf.doc/I According to this read command, data is read from the non-volatile memory module 16 (hereinafter referred to as a third data string) and the third data string is transmitted to the host. System 1000. If the logical block address corresponding to the read command belongs to a specific logical block address, the memory management circuit 2〇2 judges whether or not r_apdu exists in the buffer memory 208 in step S1107. If R_APD1J is not stored in the buffer memory 208, the memory management circuit 202 transmits the second data string to the host system (8) in step S1109. If the R-APDU is stored in the buffer memory 208, the memory management circuit 202 determines in step S1111 whether the logical block address corresponding to the read instruction corresponds to the access address unit (ie, corresponds to the read instruction). Whether the logical block address is a multiple of the access address unit). If the logical block address corresponding to the read instruction corresponds to the access address unit, the memory management circuit 202 transmits at least part of the R_APDU to the host system 1000 according to the data read amount of the corresponding read command in step S1113. And record the part that has been transferred. If the logical block address corresponding to the read command does not correspond to the access address unit, the memory management circuit 202 continues in accordance with the previously transmitted portion and the data read amount corresponding to the read command in step S1115. The other part of the R-APDU is transferred to the host system 1 and the transmitted part is recorded. It is worth mentioning that in the second exemplary embodiment, after the complete R-APDU has been transmitted to the host system, the state of the state machine changes from the data available state to the idle state. In summary, the data string assignment and delivery method of the exemplary embodiment of the present invention stores the response data unit of the smart card chip in the buffer memory. 29 201207621 ►-O015

34915twf.doc/I 此外’在狀態機處於閒置狀態下接收到讀取回應資料單元 的指令時,本發明範例實施例的資料串分派與傳送方法將 儲存於緩衝記憶體中的回應資料單元來傳遞給主機系統, 由此允許主機系統重複的讀取回應資料單元。此外,本發 明範例實施例的資料串分派與傳送方法會根據讀取回應資 料單元之讀取指令的邏輯區塊位址來識別主機系統的分段 讀取行為,由此將回應資料單元之中對應的部分傳送給主 機系統。 雖然本發明已以實施例揭露如上,然其並非用以限定 本發明,任何所屬技術領域中具有通常知識者,在不脫離 本發明之精神和範圍内,當可作些許之更動與潤飾,故本 發明之保護範圍當視後附之申請專利範圍所界定者為準。 【圖式簡單說明】 圖1疋根據本發明第一範例實施例繪示的主機系統與 δ己憶體儲存裝置的概要方塊圖。 圖2疋根據本發明第一範例實施例所纟會示的記憶體控 制器的概要方塊圖。 圖3是根據本發明第一範例實施例所繪示之應用程式 的存取示意圖。 圖4是根據本發明第一範例實施例所繪示的狀態機的 示意圖。 圖5是根據本發明第一範例實施例所繪示之預讀取的 資料流示意圖。 201207621 r^wOlO-00,5 34915twf.doc^ - 圖6是根據本發明第一範例實施例所繪示之預讀取 資料流示意圖。 _ 圖7疋根據本發明第一範例實施例所繪示之預讀取 資料流示意圖。 圖8疋根據本發明第一範例實施例所緣示之八 派與傳送方法之中對應寫入指令的流程圖。 77 派與:發明第一範例實施例所繪示之資料串分 ' 令對應讀取指令的流程圖。 的資C發明第二範例實施例所緣示之預讀取 第二範例實施例所緣示的資料串 【主要元件符號說明】 100 102 104 106 108 記憶體儲存裝置 連接器 記憶體控制器 非揮發性記憶體模組 智慧卡晶片 108a ·介面 1〇〇〇 :主機系統 11〇2 :微處理器 1104:儲存裝置 1106 :快取記憶體 3134915 twf.doc/I In addition, when the state machine is in an idle state and receives an instruction to read the response data unit, the data string assignment and transfer method of the exemplary embodiment of the present invention transmits the response data unit stored in the buffer memory. To the host system, thereby allowing the host system to repeatedly read the response data unit. In addition, the data string assignment and transfer method of the exemplary embodiment of the present invention identifies the segment read behavior of the host system according to the logical block address of the read command of the read response data unit, thereby being included in the response data unit. The corresponding part is transmitted to the host system. Although the present invention has been disclosed in the above embodiments, it is not intended to limit the invention, and any one of ordinary skill in the art can make some modifications and refinements without departing from the spirit and scope of the invention. The scope of the invention is defined by the scope of the appended claims. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a schematic block diagram of a host system and a delta memory storage device according to a first exemplary embodiment of the present invention. Fig. 2 is a schematic block diagram of a memory controller according to a first exemplary embodiment of the present invention. FIG. 3 is a schematic diagram of accessing an application according to a first exemplary embodiment of the present invention. 4 is a schematic diagram of a state machine according to a first exemplary embodiment of the present invention. FIG. 5 is a schematic diagram of a pre-read data flow according to a first exemplary embodiment of the present invention. 201207621 r^wOlO-00,5 34915twf.doc^ - Figure 6 is a schematic diagram of a pre-read data stream according to a first exemplary embodiment of the present invention. Figure 7 is a schematic diagram of a pre-read data stream according to a first exemplary embodiment of the present invention. Figure 8 is a flow chart showing a corresponding write command among the eight-party and transfer methods according to the first exemplary embodiment of the present invention. 77 派和: The data string shown in the first exemplary embodiment is invented to make a flow chart corresponding to the read instruction. The second embodiment of the present invention is a pre-reading data string as shown in the second exemplary embodiment. [Main component symbol description] 100 102 104 106 108 Memory storage device connector memory controller is non-volatile Memory module smart card chip 108a · interface 1〇〇〇: host system 11〇2: microprocessor 1104: storage device 1106: cache memory 31

34915twf.doc/I 201207621 _________υ〇ΐ5 1108 :輸入/輸出裝置 1110 :作業系統 1120 :應用程式 202 :記憶體管理電路 204 :主機介面 206 :記憶體介面 208 :緩衝記憶體 254 :電源管理電路 256 :錯誤檢查與校正電路 LBA(O)〜LBA(N):邏輯區塊位址 401 :閒置狀態 403 :處理狀態 405 :資料可用狀態 S5(H、S503、S505、S507、S601、S603、S605、S607、 S609、S7(H、S703、S705、S707、S709、S711、S713、S715、 S717、S719、S721 :資料流 S801、S803、S805、S807、S809、S8U、S901、S903、 S905、S907、S909、S9U、S913 :資料串分派與傳送的步 驟 S10(H、S1003、S1005、S1007、S1009、S1011、S1013 : 資料流 S1101、S1103、S1105、S1107、S1109、S1111、S1113、 S1115 :資料串分派與傳送的步驟 3234915twf.doc/I 201207621 _________υ〇ΐ5 1108: Input/output device 1110: Operating system 1120: Application 202: Memory management circuit 204: Host interface 206: Memory interface 208: Buffer memory 254: Power management circuit 256: Error checking and correction circuit LBA(0) to LBA(N): logical block address 401: idle state 403: processing state 405: data available state S5 (H, S503, S505, S507, S601, S603, S605, S607 , S609, S7 (H, S703, S705, S707, S709, S711, S713, S715, S717, S719, S721: data stream S801, S803, S805, S807, S809, S8U, S901, S903, S905, S907, S909 , S9U, S913: Step S10 of data string assignment and transmission (H, S1003, S1005, S1007, S1009, S1011, S1013: data stream S1101, S1103, S1105, S1107, S1109, S1111, S1113, S1115: data string assignment and Step 32 of the transfer

Claims (1)

201207621 ^JJ-2U10-0015 34915twf.doc/I 七、申請專利範圍: 1. 一種資料串分派與傳送方法,用於具有一非揮發性 記憶體模組與一智慧卡晶片的一記憶體儲存裝置,該資料 串分派與傳送方法包括: 為該非揮發性記憶體模組配置多個邏輯區塊位址,其 中該些邏輯區塊位址之中的多個特定邏輯區塊位址被用以 儲存一特定檔案; .Φ 從該智慧卡晶片中接收一回應資料單元,並且在一緩 衝記憶體中儲存該回應資料單元; 從一主機系統中接收一讀取指令; 判斷對應該讀取指令的一邏輯區塊位址是否屬於該 些特定邏輯區塊位址的其中之一並且判斷該緩衝記憶體中 是否存有該回應資料單元;以及 當對應該讀取指令的該邏輯區塊位址屬於該些特定 邏輯區塊位址的其中之一且該緩衝記憶體中存有該回應資 料單元時,傳送儲存於該緩衝記憶體中的該回應資料單元 • 給該主機系統》 2. 如申請專利範圍第1項所述之資料串分派與傳送 方法,更包括: 當對應該讀取指令的該邏輯區塊位址屬於該些特定 邏輯區塊位址的其中之一且該缓衝記憶體中未存有該回應 資料單元時,傳送一第二資料串給該主機系統,其中該第 二資料串的每個位元皆為零。 3. 如申請專利範圍第1項所述之資料串分派與傳送 33 201207621 -u015 34915twf.doc/I 方法,更包括: 當對應該讀取指令的該邏輯區塊 定邏輯區塊位址的其中之一時,根據4址不屬於該些特 邏輯區塊位址從該非揮發性記憶體模該讀取指令的該 指令的一第三資料串並且將對應該讀取讀取對應該讀取 串傳送給該主機系統。 ° 指令的該第三資料 4.如申請專利範圍第丨項所述之 方法,更包括: 貢料串分派與傳送 從該主機系統中接收一寫入指 的一第一資料串; 、手應該寫入指令 是否含有一特定標記;以及 备該第-資料串含有該特定標記及 之中的-指令資料單讀送至該 二第―資料串 於該緩衝記龍巾_回射料單^且清除儲存 方法5,.更W糾制帛4項崎之資料衫派與傳送 m 宜一資料串不含有該特定標記時,則依據對應該 寫入才”的-邏輯區塊位址將該第―資料 發性記憶體模組中。 6. —種資料串分派與傳送方法,用於具有一非揮發性 記憶體模組與一智慧卡晶片的一記憶體儲存裝置,該資料 串分派與傳送方法包括: 為該非揮發性記憶體模組配置多個邏輯區塊位址,其 中該些邏輯區塊位址之中的多個特定邏輯區塊位址被用以 34 201207621 n r^rwOlO-0015 34915twf.doc/l 儲存一特定檔案; 從該智慧卡晶片中接收一回應資料單元,並且在一緩 衝記憶體中儲存該回應資料單元; 從一主機系統中接收一讀取指令; 判斷對應該讀取指令的一邏輯區塊位址是否屬於該 些特定邏輯區塊位址的其中之一並且判斷該緩衝記憶體中 是否儲存有該回應資料單元; ' 當對應該讀取指令的該邏輯區塊位址屬於該些特定 邏輯區塊錄的其巾之H魏記紐巾財該回 料單元時’觸對賴軌指令㈣賴區塊位址是^ 應一存取位址單位;以及 _當對應該讀取指令的該邏鄕塊位址對應該存取位 址單位時’傳送儲存於該緩衝記憶體巾_回應資 的至少一部分給該主機系統。 方法範㈣6賴述之資料分派與傳送 上對?該讀取指令的該邏輯區塊位址未對應該存取 由二t時’傳送該緩衝記憶體中的該回應資料單元的其 中一部份給該主機系統。 扪其 方法專利範圍第6柄述之資料分派與傳送 邏輯===_邏倾齡址屬㈣些特定 資料單元時m該緩衝記憶體中未存有該回應 得廷第二資料串給該主機系統,其中該第 35 34915tw£d〇c/I 201207621.υ015 二資料串的每個位元皆為零。 9.如申請專利範圍第6 方法,更包括: 項所述之資料串分派與傳送 當對應該讀取指令的該邏輯區塊位址 定邏輯區塊位址的其中之-時,根據對场些特 ,輯區塊位址從該非揮發性記憶體模組;;忒=二^ #曰令的-第二資料串並且將對應該讀取指第二 串傳送給該主機系統。 MU資料 方法1〇更^請專利顧第6項所述之_串分派與傳送 ,該主機系統中接彳卜寫人指令_應該寫入 的一第一資料串; 7 判斷該第-資料串是否含有—特定標記;以及 倘若該資料串含有該特定標記,則將該第一資料串之 中的-指令資料單元傳送至騎慧卡晶片並且清除儲存於 該緩衝記憶體中的該回應資料單元。 11·如申請專利範圍第1〇項所述之資料串分派與 送方法,更包括: 當該第一資料串不含有該特定標記時,則依據對應該 寫入指令的一邏輯區塊位址將該第一資料串寫入至該非揮 發性記憶體模組中。 12. —種記憶體控制器,用於配置在具有一非揮發性 記憶體模組與一智慧卡晶片的一記憶體儲存裝置中,該記 憶體控制器包括: 36 201207621 r;sri^-ziJ10-0015 34915twf.doc/I 一主機介面,用以耦接至一主機系統; -記憶體介面,心触轉轉紐 一緩衝記憶體;以及 ^瓶供、.且, -記憶體管理電路,輕接該緩衝記憶體、該主機介面 與該記憶體介面,其巾該記憶财理電路用 列程序: W丁王V > 之 案;201207621 ^JJ-2U10-0015 34915twf.doc/I VII. Patent Application Range: 1. A data string assignment and transmission method for a memory storage device having a non-volatile memory module and a smart card chip The data string assignment and transmission method includes: configuring a plurality of logical block addresses for the non-volatile memory module, wherein a plurality of specific logical block addresses among the logical block addresses are used for storing a specific file; .Φ receives a response data unit from the smart card chip, and stores the response data unit in a buffer memory; receives a read command from a host system; and determines a corresponding read command Whether the logical block address belongs to one of the specific logical block addresses and determines whether the response data unit exists in the buffer memory; and when the logical block address corresponding to the read instruction belongs to the Transmitting the response data unit stored in the buffer memory when one of the specific logical block addresses and the response data unit are stored in the buffer memory 2. For the host system, 2. The data string assignment and transmission method as described in claim 1 further includes: when the logical block address corresponding to the read instruction belongs to the specific logical block address When one of the buffer data stores does not have the response data unit, a second data string is transmitted to the host system, wherein each bit of the second data string is zero. 3. The method of assigning and transmitting the data string as described in item 1 of the scope of patent application 33 201207621 -u015 34915twf.doc/I method, further comprising: determining the logical block address of the logical block corresponding to the read instruction In one case, according to the fourth address, the third data string of the instruction that reads the instruction from the non-volatile memory modulo does not belong to the special logical block address and will correspond to the read read corresponding to the read string transfer Give the host system. The third data of the instruction 4. The method of claim 2, further comprising: assigning and transmitting a first data string from the host system to receive a write finger; Whether the write command contains a specific mark; and the first data string containing the specific mark and the - command data sheet are read to the second data string in the buffered dragon towel_return material list Clear the storage method 5, the more W rectification 帛 4 items of the article and the transmission m. If the data string does not contain the specific tag, then the logical block address corresponding to the corresponding ― Data-based memory module. 6. A data string assignment and transmission method for a memory storage device having a non-volatile memory module and a smart card chip, the data string assignment and transmission The method includes: configuring a plurality of logical block addresses for the non-volatile memory module, wherein a plurality of specific logical block addresses among the logical block addresses are used for 34 201207621 nr^rwOlO-0015 34915twf .doc/l stores a specific file Receiving a response data unit from the smart card chip, and storing the response data unit in a buffer memory; receiving a read command from a host system; determining a logical block address corresponding to the read command Whether it belongs to one of the specific logical block addresses and determines whether the response data unit is stored in the buffer memory; 'When the logical block address corresponding to the read instruction belongs to the specific logical block Recording the towel of the H Wei Kee Newton, the returning unit, the 'touching the track' command (four), the block address is ^ should be an access address unit; and _ when the corresponding instruction is read When the block address corresponds to the address unit, the at least part of the response memory is transmitted to the host system. The method (4) 6 refers to the data distribution and transmission of the pair. The logical block address is not corresponding to the transfer of one part of the response data unit in the buffer memory to the host system by the second time. And the transfer logic ===_Logo ages (4) some specific data units, the buffer memory does not have the second data string to the host system, wherein the 35 34915 tw I 201207621.υ015 Two bits of the data string are all zero. 9. If the sixth method of the patent application scope, the method further includes: the data string assignment and the transmission are in the logical block position corresponding to the read instruction. When the address of the logical block address is located, according to the corresponding field, the block address is from the non-volatile memory module; 忒=二^#曰令-the second data string and will be It should be read that the second string is transmitted to the host system. MU data method 1 〇^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Whether or not the specific tag is included; and if the data string contains the specific tag, transmitting the -instruction data unit in the first data string to the hi-fi card and clearing the response data unit stored in the buffer memory . 11. The data string assignment and delivery method according to the first aspect of the patent application scope, further comprising: when the first data string does not contain the specific identifier, according to a logical block address corresponding to the write instruction The first data string is written into the non-volatile memory module. 12. A memory controller for use in a memory storage device having a non-volatile memory module and a smart card chip, the memory controller comprising: 36 201207621 r; sri^-ziJ10 -0015 34915twf.doc/I A host interface for coupling to a host system; - Memory interface, heart-to-turn-to-buffer memory; and ^ bottle supply, and, - memory management circuit, light Connect the buffer memory, the host interface and the memory interface, and the memory program circuit program: W Ding Wang V > 巧多個邏輯區塊位址,其中該些邏輯區塊位址 中的多個特定邏輯區塊位址被用以儲存一特定標 ,從該智慧卡晶片巾接收—回應資料單元,並且在 該緩衝記憶體中儲存該回應資料單元; 從該主機系統接收一讀取指令; 判斷對應該讀取指令的—邏輯區塊位址是否屬 於該些特定邏輯區塊位址的其中之一並且判斷該緩 衝記憶體中是否存有該回應資料單元; 备對應該讀取指令的該邏輯區塊位址屬於該些 特定邏輯區塊位址的其中之一且該緩衝記憶體中存 有該回應資料單元時,判斷對應該讀取指令的該邏輯 區塊位址是否對應一存取位址單位;以及 當對應該讀取指令的該邏輯區塊位址對應該存 取位址單位時’傳送儲存於該緩衝記憶體中的該回應 資料單元的至少一部分給該主機系統。 13.如申請專利範圍第12項所述之記憶體控制器,其 中當對應該讀取指令的該邏輯區塊位址未對應該存取位址 37 /015 34915twf. doc/I 201207621 單位時,觀M管理更㈣傳雜存_緩衝 體中的該回應倾單元的其中—部份給魅齡統。… 丨4.如申請專利範圍第12項所述之記憶體控制器, 中當對應該讀取指令的該邏輯區塊位址屬於該些特定邏輯 =塊:址的其中之—且該緩衝記憶體中未存㈣回應資料 皁70時,該記憶體管理電路更用以傳送-第二資料串給該 主機系統’其中該第二資料串的每個位元皆為零。" K如申請專利範圍帛12項所述之記憶體控制器,其 中备對應該讀取指令的該邏輯區塊位料屬於該些特定= 專利範圍第12項所述之記憶體控制器,其 中該^憶體管理電路用以執行至少下列程序: 再 一第ίΐίΓ系統接收一寫入指令與對應該寫入指令的 該第-資料串是否含有—特定標記;以及 中的::::::含:該特定標記,則將該第-資料串之 該緩衝記“二卡晶片並且清除儲存於 中當:第It利範圍第16項所述之記憶體控制器,其 路更用以依有該特狀記時,該記憶體管理電 據對應該寫人指令的—邏輯區塊位址將該第一 38 201207621 010-0015 34915twf.doc/I 資料串寫入至該非揮發性記憶體模組中。 18. —種記憶體儲存裝置,包括: 一連接器,用以耦接至一主機系統; 一非揮發性記憶體模組; 一智慧卡晶片,以及 一記憶體控制器,耦接至該連接器、該非揮發性記憶 體模組與該智慧卡晶片,並且具有一緩衝記憶體, 其中該記憶體控制器用以執行至少下列程序: ® 為該非揮發性記體模組配置多個邏輯區塊位 址,其中該些邏輯區塊位址之中的多個特定邏輯區塊 位址被用以儲存一特定檔案; 從該智慧卡晶片中接收一回應資料單元,並且在 該緩衝記憶體中儲存該回應資料單元; 從該主機系統中接收一讀取指令; 判斷對應該讀取指令的一邏輯區塊位址是否屬 於該些特定邏輯區塊位址的其中之一並且判斷該緩 • 衝記憶體中是否存有該回應資料單元;以及 當對應該讀取指令的該邏輯區塊位址屬於該些 特定邏輯區塊位址的其中之一且該緩衝記憶體中存 有該回應資料單元時,傳送儲存於該緩衝記憶體中的 該回應資料單元給該主機系統。 39Multiple logical block addresses, wherein a plurality of specific logical block addresses in the logical block addresses are used to store a specific target, receive-response data unit from the smart card wafer, and Storing the response data unit in the buffer memory; receiving a read command from the host system; determining whether the logical block address corresponding to the read instruction belongs to one of the specific logical block addresses and determining the Whether the response data unit exists in the buffer memory; the logical block address corresponding to the read instruction belongs to one of the specific logical block addresses and the response data unit is stored in the buffer memory Determining whether the logical block address corresponding to the read instruction corresponds to an access address unit; and when the logical block address corresponding to the read instruction corresponds to the access address unit, the transfer is stored in At least a portion of the response data unit in the buffer memory is provided to the host system. 13. The memory controller of claim 12, wherein when the logical block address corresponding to the read instruction does not correspond to the address 37 / 015 34915 twf. doc / I 201207621 unit, View M management more (four) pass the memory _ buffer in the response to the unit of the unit - part of the charm.丨4. The memory controller according to claim 12, wherein the logical block address corresponding to the read instruction belongs to the specific logical=block: address thereof - and the buffer memory When the body does not save (4) in response to the data soap 70, the memory management circuit is further configured to transmit a second data string to the host system, wherein each bit of the second data string is zero. " K is the memory controller described in claim 12, wherein the logical block material corresponding to the read instruction belongs to the memory controller of the specific = patent range, item 12, The memory management circuit is configured to execute at least the following program: further receiving, by the system, a write command and the first data string corresponding to the write command include a specific tag; and the :::::: : Contains: the specific mark, the buffer of the first data string is recorded as "two card wafers and the memory controller stored in the middle: the 16th item of the range of the benefit range is used. In the case of the special case, the memory management data is written to the non-volatile memory model by the logical block address corresponding to the write instruction of the first 38 201207621 010-0015 34915twf.doc/I data string. 18. A memory storage device comprising: a connector for coupling to a host system; a non-volatile memory module; a smart card chip, and a memory controller coupled To the connector, the non-volatile Recovering the body module and the smart card chip, and having a buffer memory, wherein the memory controller is configured to execute at least the following program:: configuring a plurality of logical block addresses for the non-volatile memory module, wherein the A plurality of specific logical block addresses among the logical block addresses are used to store a specific file; a response data unit is received from the smart card chip, and the response data unit is stored in the buffer memory; Receiving a read command in the host system; determining whether a logical block address corresponding to the read command belongs to one of the specific logical block addresses and determining whether the buffer memory exists in the buffer memory Responding to the data unit; and when the logical block address corresponding to the read instruction belongs to one of the specific logical block addresses and the response data unit is stored in the buffer memory, the transfer is stored in the buffer The response data unit in the memory is given to the host system.
TW99126950A 2008-06-13 2010-08-12 Method for dispatching and transmitting data stream, memory controller and memory storage apparatus TWI472927B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
TW99126950A TWI472927B (en) 2010-08-12 2010-08-12 Method for dispatching and transmitting data stream, memory controller and memory storage apparatus
US12/895,872 US8812756B2 (en) 2008-06-13 2010-10-01 Method of dispatching and transmitting data streams, memory controller and storage apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW99126950A TWI472927B (en) 2010-08-12 2010-08-12 Method for dispatching and transmitting data stream, memory controller and memory storage apparatus

Publications (2)

Publication Number Publication Date
TW201207621A true TW201207621A (en) 2012-02-16
TWI472927B TWI472927B (en) 2015-02-11

Family

ID=46762244

Family Applications (1)

Application Number Title Priority Date Filing Date
TW99126950A TWI472927B (en) 2008-06-13 2010-08-12 Method for dispatching and transmitting data stream, memory controller and memory storage apparatus

Country Status (1)

Country Link
TW (1) TWI472927B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI459202B (en) * 2012-12-05 2014-11-01 Phison Electronics Corp Data processing method, memory controller and memory storage device
TWI506642B (en) * 2012-12-07 2015-11-01 Phison Electronics Corp Memory repairing method, and memory controller and memory storage apparatus using the same
TWI508099B (en) * 2013-01-28 2015-11-11 Phison Electronics Corp Clock switching meyhod, memory controller and memory storage apparatus
US9257204B2 (en) 2013-06-28 2016-02-09 Phison Electronics Corp. Read voltage setting method, and control circuit, and memory storage apparatus using the same
CN106469019A (en) * 2015-08-18 2017-03-01 群联电子股份有限公司 Storage management method, memorizer control circuit unit and memorizer memory devices
CN106873901A (en) * 2015-12-11 2017-06-20 群联电子股份有限公司 Storage management method, memorizer control circuit unit and memory storage apparatus
US9690490B2 (en) 2014-02-21 2017-06-27 Phison Electronics Corp. Method for writing data, memory storage device and memory control circuit unit
US10409525B2 (en) 2015-08-11 2019-09-10 Phison Electronics Corp. Memory management method, memory control circuit unit and memory storage device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI596612B (en) * 2015-12-04 2017-08-21 群聯電子股份有限公司 Memory management method, memory control circuit unit, and memory storage apparatus

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4071706A (en) * 1976-09-13 1978-01-31 Rca Corporation Data packets distribution loop
US7367503B2 (en) * 2002-11-13 2008-05-06 Sandisk Corporation Universal non-volatile memory card used with various different standard cards containing a memory controller
WO2004086363A2 (en) * 2003-03-27 2004-10-07 M-Systems Flash Disk Pioneers Ltd. Data storage device with full access by all users
US8307131B2 (en) * 2007-11-12 2012-11-06 Gemalto Sa System and method for drive resizing and partition size exchange between a flash memory controller and a smart card

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI459202B (en) * 2012-12-05 2014-11-01 Phison Electronics Corp Data processing method, memory controller and memory storage device
TWI506642B (en) * 2012-12-07 2015-11-01 Phison Electronics Corp Memory repairing method, and memory controller and memory storage apparatus using the same
TWI508099B (en) * 2013-01-28 2015-11-11 Phison Electronics Corp Clock switching meyhod, memory controller and memory storage apparatus
US9424177B2 (en) 2013-01-28 2016-08-23 Phison Electronics Corp. Clock switching method, memory controller and memory storage apparatus
US9257204B2 (en) 2013-06-28 2016-02-09 Phison Electronics Corp. Read voltage setting method, and control circuit, and memory storage apparatus using the same
US9690490B2 (en) 2014-02-21 2017-06-27 Phison Electronics Corp. Method for writing data, memory storage device and memory control circuit unit
US10409525B2 (en) 2015-08-11 2019-09-10 Phison Electronics Corp. Memory management method, memory control circuit unit and memory storage device
CN106469019A (en) * 2015-08-18 2017-03-01 群联电子股份有限公司 Storage management method, memorizer control circuit unit and memorizer memory devices
CN106873901A (en) * 2015-12-11 2017-06-20 群联电子股份有限公司 Storage management method, memorizer control circuit unit and memory storage apparatus
CN106873901B (en) * 2015-12-11 2020-02-07 群联电子股份有限公司 Memory management method, memory control circuit unit and memory storage device

Also Published As

Publication number Publication date
TWI472927B (en) 2015-02-11

Similar Documents

Publication Publication Date Title
TW201207621A (en) Method for dispatching and transmitting data stream, memory controller and memory storage apparatus
TWI596486B (en) Memory storage apparatus, memory controller, and method for transmitting and identifying data stream
TWI436372B (en) Flash memory storage system, and controller and method for anti-falsifying data thereof
KR101395778B1 (en) Memory card and memory system including the same and operating method thereof
TWI451248B (en) Data protecting method, memory controller and memory storage apparatus
TWI447583B (en) Data protecting method, memory controller and memory storage device
US8296466B2 (en) System, controller, and method thereof for transmitting data stream
JP2014513484A (en) Cryptographic transport solid state disk controller
TW201106354A (en) Object oriented memory in solid state devices
TWI454912B (en) Data processing method, memory controller and memory storage device
TW200915080A (en) Flash memory controller for electronic data flash card
CN110176267A (en) Storage system and its operating method
US20130080787A1 (en) Memory storage apparatus, memory controller and password verification method
TW201217968A (en) Data writing method, memory controller and memory storage apparatus
CN110046506A (en) Store equipment and including the storage system for storing equipment and the method operated using it
TW201135462A (en) Method of dynamically switching partitions, memory card controller and memory card storage system
CN110069426A (en) Memory Controller and storage system with Memory Controller
CN110929261A (en) Memory system and operating method thereof
US20110022746A1 (en) Method of dispatching and transmitting data streams, memory controller and memory storage apparatus
TW200915339A (en) Electronic data flash card with various flash memory cells
TWI430104B (en) Method for dispatching and transmitting data stream, memory controller and memory storage apparatus
KR20210041158A (en) Operating method of memory system and host recovering data with write error
TW201214111A (en) Data writing method, memory controller and memory storage apparatus
US11550906B2 (en) Storage system with separated RPMB sub-systems and method of operating the same
KR20220087297A (en) Storage device executing processing code, and operating method thereof