TWI718601B - Card reader, data reading and writing system, and reading and writing method thereof - Google Patents

Card reader, data reading and writing system, and reading and writing method thereof Download PDF

Info

Publication number
TWI718601B
TWI718601B TW108126198A TW108126198A TWI718601B TW I718601 B TWI718601 B TW I718601B TW 108126198 A TW108126198 A TW 108126198A TW 108126198 A TW108126198 A TW 108126198A TW I718601 B TWI718601 B TW I718601B
Authority
TW
Taiwan
Prior art keywords
host
protocol
controller
communication protocol
data reading
Prior art date
Application number
TW108126198A
Other languages
Chinese (zh)
Other versions
TW202105235A (en
Inventor
胡耀中
Original Assignee
創惟科技股份有限公司
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 創惟科技股份有限公司 filed Critical 創惟科技股份有限公司
Priority to TW108126198A priority Critical patent/TWI718601B/en
Publication of TW202105235A publication Critical patent/TW202105235A/en
Application granted granted Critical
Publication of TWI718601B publication Critical patent/TWI718601B/en

Links

Images

Landscapes

  • Storage Device Security (AREA)

Abstract

A card reader, a data reading and writing system, and a reading and writing method thereof are provided. The data reading and writing system is adapted to be connected to a host, so that the host can read and write data to an memory card through the data reading and writing system. The host uses one of a first type of communication protocol or a second type of communication protocol. The data reading and writing system includes a protocol determination controller, a communication interface controller, and a memory card controller. The protocol determination controller obtains a determination message of the host to determine that the host uses the first type of communication protocol or the second type of communication protocol.

Description

讀卡機、資料讀寫系統及其讀寫方法 Card reader, data reading and writing system and reading and writing method thereof

本揭示是關於一種記憶裝置讀寫系統,特別是關於一種可自動判斷通訊協定的讀卡機、資料讀寫系統及其讀寫方法。The present disclosure relates to a reading and writing system for a memory device, in particular to a card reader, a data reading and writing system and a reading and writing method that can automatically determine the communication protocol.

隨著電腦技術的發展,目前許多的電子裝置或非電子裝置均內建運算系統以提供更多的功能與效能。為了擴充運算系統的資料儲存容量或便於資料的轉移與保存,運算系統除了內建的資料儲存裝置之外,也能外接可攜式的儲存媒體。運算系統通常透過一個內建或外接的讀寫系統來對資料儲存裝置進行讀寫。With the development of computer technology, many current electronic devices or non-electronic devices have built-in computing systems to provide more functions and performance. In order to expand the data storage capacity of the computing system or to facilitate the transfer and storage of data, the computing system can also be connected to a portable storage medium in addition to the built-in data storage device. The computing system usually reads and writes to the data storage device through a built-in or external read-write system.

目前存在多種不同的運算系統,在運算系統中運行各自的作業系統,並且使用不同的通訊協定。以往,不同的運算系統也會使用不同的通訊硬體介面,因此,資料讀寫系統只要針對不同的通訊介面提供對應的通訊協定即可。但是,為了提高便利性,通訊介面會進行整合或統一。如此便無法再以通訊硬體介面的不同來辨別所使用的通訊協定。At present, there are many different computing systems, which run their own operating systems and use different communication protocols. In the past, different computing systems also used different communication hardware interfaces. Therefore, the data reading and writing system only needs to provide corresponding communication protocols for different communication interfaces. However, in order to improve convenience, the communication interface will be integrated or unified. In this way, it is no longer possible to distinguish the used communication protocol by the difference of the communication hardware interface.

為解決上述習知技術之問題,本揭示之目的在於提供一種讀卡機、一種資料讀寫系統及其讀寫方法,其可有效地解決現有技術中無法分辨通訊協定的問題。In order to solve the above-mentioned problems of the conventional technology, the purpose of the present disclosure is to provide a card reader, a data reading and writing system and a reading and writing method thereof, which can effectively solve the problem that the communication protocol cannot be distinguished in the prior art.

為達成上述目的,本揭示提供一種資料讀寫系統,適於與一主機連接,以讓該主機透過該資料讀寫系統對一外部記憶卡進行資料讀寫,其中該主機使用一第一種通訊協定或一第二種通訊協定其中之一,該資料讀寫系統包括一協定判斷控制器、一通訊介面控制器以及一記憶卡控制器。該通訊介面控制器電連接至該協定判斷控制器,並適於與該主機通訊。該記憶卡控制器電連接至該協定判斷控制器與該通訊介面控制器,並控制該主機對該外部記憶卡的資料讀寫。其中該協定判斷控制器取得該主機的一判定資訊,以判斷該主機使用該第一種通訊協定或該第二種通訊協定。In order to achieve the above object, the present disclosure provides a data reading and writing system suitable for connecting with a host so that the host can read and write data to an external memory card through the data reading and writing system, wherein the host uses a first type of communication Protocol or one of a second type of communication protocol, the data reading and writing system includes a protocol judgment controller, a communication interface controller, and a memory card controller. The communication interface controller is electrically connected to the protocol judgment controller and is suitable for communicating with the host. The memory card controller is electrically connected to the protocol judgment controller and the communication interface controller, and controls the host to read and write data on the external memory card. The protocol determination controller obtains determination information of the host to determine whether the host uses the first communication protocol or the second communication protocol.

於本揭示其中之一實施例中,該協定判斷控制器包括一微處理單元。該微處理單元透過該通訊介面控制器接收該判定資訊。當該主機的該判定資訊為一第一取得說明指令,則該協定判斷控制器判斷該主機使用該第一種通訊協定。該微處理單元列舉該第一通訊協定來與該主機通訊。當該主機的該判定資訊不是該第一取得說明指令,則該協定判斷控制器判斷該主機使用該第二種通訊協定。該微處理單元列舉該第二通訊協定來與該主機通訊。In one of the embodiments of the present disclosure, the protocol judgment controller includes a micro-processing unit. The micro-processing unit receives the determination information through the communication interface controller. When the determination information of the host is a first obtaining description command, the protocol determination controller determines that the host uses the first communication protocol. The micro-processing unit enumerates the first communication protocol to communicate with the host. When the determination information of the host is not the first obtaining description command, the protocol determination controller determines that the host uses the second communication protocol. The micro-processing unit enumerates the second communication protocol to communicate with the host.

於本揭示其中之一實施例中,當該資料讀寫系統自該主機依序接收該第一取得說明指令、一設定位址指令與一第二取得說明指令時。該判定資訊為該第一取得說明指令。該協定判斷控制器依據該判定資訊判斷該主機使用該第一種通訊協定。當該資料讀寫系統自該主機依序接收該設定位址指令與該第二取得說明指令時。該判定資訊為該設定位址指令。該協定判斷控制器依據該判定資訊預設該主機使用該第二種通訊協定。In one of the embodiments of the present disclosure, when the data read-write system sequentially receives the first get description command, a set address command, and a second get description command from the host. The determination information is the first acquisition instruction. The protocol determination controller determines that the host uses the first communication protocol according to the determination information. When the data read-write system sequentially receives the set address command and the second get description command from the host. The determination information is the setting address command. The protocol determination controller presets the host to use the second communication protocol according to the determination information.

於本揭示其中之一實施例中,該資料讀寫系統與該主機連接後,依序接收該主機發送的初始化指令與排線重置指令,且該協定判斷控制器認定該主機於該排線重置指令後所發送的一指令為該判定資訊。In one of the embodiments of the present disclosure, after the data read-write system is connected to the host, it sequentially receives the initialization command and the cable reset command sent by the host, and the protocol determines that the controller determines that the host is connected to the cable A command sent after the reset command is the determination information.

於本揭示其中之一實施例中,當該協定判斷控制器判斷該主機使用該第二種通訊協定進行通訊時,該協定判斷控制器預設會在接收該主機的該第二取得說明指令後,接收一設定組態指令及一協定執行認證指令。當該協定判斷控制器等待該主機的該協定執行認證指令超過一預設時間後,該微處理單元改以列舉該第一種通訊協定與該主機進行通訊。In one of the embodiments of the present disclosure, when the protocol determining controller determines that the host uses the second communication protocol for communication, the protocol determining controller defaults to receiving the second obtaining instruction command from the host , Receive a configuration command and a protocol execution authentication command. When the protocol judges that the controller waits for the protocol execution authentication command of the host for more than a preset time, the micro-processing unit changes to list the first communication protocol to communicate with the host.

於本揭示其中之一實施例中,該資料讀寫系統更包括一USB收發器單元介面電連接至該通訊介面控制器、一高速/全速傳輸實體層電連接至該USB收發器單元介面、一緩衝單元電連接至該記憶卡控制器以及該通訊介面控制器、一超高速傳輸實體層、一超高速裝置電連接於該超高速傳輸實體層及該緩衝單元,以及一第一快閃儲存單元電連接至該微處理單元且儲存一用以判斷該主機通訊協定的程序。其中該通訊介面控制器透過該USB收發器單元介面、該高速/全速傳輸實體層、該超高速裝置以及該超高速傳輸實體層來與該主機通訊。該主機透過該微處理單元的控制來讀寫該外部記憶卡。In one of the embodiments of the present disclosure, the data reading and writing system further includes a USB transceiver unit interface electrically connected to the communication interface controller, a high-speed/full-speed transmission physical layer electrically connected to the USB transceiver unit interface, and The buffer unit is electrically connected to the memory card controller and the communication interface controller, an ultra-high-speed transmission physical layer, an ultra-high-speed device is electrically connected to the ultra-high-speed transmission physical layer and the buffer unit, and a first flash storage unit It is electrically connected to the micro-processing unit and stores a program for determining the communication protocol of the host. The communication interface controller communicates with the host through the USB transceiver unit interface, the high-speed/full-speed transmission physical layer, the ultra-high-speed device, and the ultra-high-speed transmission physical layer. The host reads and writes the external memory card through the control of the micro-processing unit.

於本揭示其中之一實施例中,該協定判斷控制器包括一微處理單元以及一電力傳送微處理單元。當該資料讀寫系統連接該主機後,該電力傳送微處理單元要求該主機提供該判定資訊。該判定資訊為該主機的產品識別資料與供應商識別資料。微處理單元並藉以判斷該主機是使用該第一種通訊協定或該第二種通訊協定。In one of the embodiments of the present disclosure, the protocol judgment controller includes a micro processing unit and a power transmission micro processing unit. When the data reading and writing system is connected to the host, the power transmission micro-processing unit requests the host to provide the determination information. The determination information is the product identification data and supplier identification data of the host. The micro-processing unit determines whether the host uses the first communication protocol or the second communication protocol.

於本揭示其中之一實施例中,當該微處理單元判斷該主機使用該第一種通訊協定時,該微處理單元控制該介面控制單元列舉該第一種通訊協定與該主機進行通訊。當該微處理單元判斷該主機使用該第二種通訊協定時,該微處理單元控制該介面控制單元列舉該第二種通訊協定與該主機進行通訊。而該主機的產品識別資料與供應商識別資料包括產品資料或作業系統資料。In one of the embodiments of the present disclosure, when the micro-processing unit determines that the host uses the first communication protocol, the micro-processing unit controls the interface control unit to list the first communication protocol to communicate with the host. When the micro-processing unit determines that the host uses the second communication protocol, the micro-processing unit controls the interface control unit to list the second communication protocol to communicate with the host. The product identification data and supplier identification data of the host include product data or operating system data.

於本揭示其中之一實施例中,該資料讀寫系統還包括一電力傳送模組,該電力傳送模組包括該電力傳送微處理單元、一C型及雙向標記碼實體層以及一第二快閃儲存單元儲存一用以要求該主機提供該判定資訊以決定供電電壓的程序。其中該電力傳送微處理單元用以控制 該C型及雙向標記碼實體層與該主機通訊。該資料讀寫系統更包括一USB收發器單元介面電連接至該通訊介面控制器、一高速/全速傳輸實體層電連接至該USB收發器單元介面、一緩衝單元電連接至該記憶卡控制器以及該通訊介面控制器、一超高速傳輸實體層、一超高速裝置電連接於該超高速傳輸實體層及該緩衝單元以及一第一快閃儲存單元電連接至該微處理單元儲存一用以判斷該主機通訊協定的程序。其中該通訊介面控制器透過該微處理單元的控制 來與該主機通訊。該主機透過該超高速裝置與該超高速傳輸實體層讀寫該外部記憶卡。In one of the embodiments of the present disclosure, the data reading and writing system further includes a power transmission module. The power transmission module includes the power transmission micro-processing unit, a C-type and two-way marking code physical layer, and a second fast The flash storage unit stores a program for requesting the host to provide the determination information to determine the power supply voltage. The power transmission micro-processing unit is used to control the C-type and two-way marking code physical layer to communicate with the host. The data reading and writing system further includes a USB transceiver unit interface electrically connected to the communication interface controller, a high-speed/full-speed transmission physical layer electrically connected to the USB transceiver unit interface, and a buffer unit electrically connected to the memory card controller And the communication interface controller, an ultra-high-speed transmission physical layer, an ultra-high-speed device electrically connected to the ultra-high-speed transmission physical layer and the buffer unit, and a first flash storage unit electrically connected to the micro-processing unit to store a Procedure to determine the communication protocol of the host. The communication interface controller communicates with the host through the control of the micro-processing unit. The host reads and writes the external memory card through the ultra-high-speed device and the ultra-high-speed transmission physical layer.

於本揭示其中之一實施例中,該協定判斷控制器包括一微處理單元,以於該資料讀寫系統連接該主機後,判斷該資料讀寫系統是否具有電力傳送模組。當該資料讀寫系統具有該電力傳送模組時,該微處理單元要求該電力傳送模組提供取得的產品識別資料與供應商識別資料,藉以判斷該主機是使用該第一種通訊協定或該第二種通訊協定。當該資料讀寫系統不具有該電力傳送模組時,該微處理單元直接接收並判斷該主機的該判定資訊。In one of the embodiments of the present disclosure, the protocol determining controller includes a micro-processing unit to determine whether the data reading and writing system has a power transmission module after the data reading and writing system is connected to the host. When the data read-write system has the power transmission module, the micro-processing unit requires the power transmission module to provide the obtained product identification data and supplier identification data, so as to determine whether the host uses the first communication protocol or the The second communication protocol. When the data reading and writing system does not have the power transmission module, the micro-processing unit directly receives and determines the determination information of the host.

於本揭示其中之一實施例中,當該資料讀寫系統不具有該電力傳送模組時,該微處理單元透過該通訊介面控制器直接接收該主機的該判定資訊。當該主機的該判定資訊為一第一取得說明指令,則該微處理單元判斷該主機使用該第一種通訊協定。當該主機的該判定資訊不是該第一取得說明指令,則該微處理單元判斷該主機使用該第二種通訊協定進行通訊。In one of the embodiments of the present disclosure, when the data reading and writing system does not have the power transmission module, the micro-processing unit directly receives the determination information of the host through the communication interface controller. When the determination information of the host is a first obtaining description command, the micro-processing unit determines that the host uses the first communication protocol. When the determination information of the host is not the first obtaining description command, the micro-processing unit determines that the host uses the second communication protocol for communication.

於本揭示其中之一實施例中,該通訊介面控制器透過一USB通訊介面與該主機通訊。In one of the embodiments of the present disclosure, the communication interface controller communicates with the host through a USB communication interface.

本揭示還提供一種讀卡機,適於與一主機連接以讓該主機透過該讀卡機對一外部記憶卡進行資料讀寫,其中該主機使用一第一種通訊協定或一第二種通訊協定其中之一。該讀卡機包括一協定判斷控制器、一通訊介面控制器、一記憶卡控制器以及一USB通訊介面。該通訊介面控制器電連接至該協定判斷控制器並與該主機通訊。該記憶卡控制器電連接至該協定判斷控制器與該通訊介面控制器並控制該主機對該外部記憶卡進行資料讀寫。該USB通訊介面電連接至該通訊介面控制器。其中該協定判斷控制器取得該主機的一判定資訊,以判斷該主機使用該第一種通訊協定或該第二種通訊協定。The present disclosure also provides a card reader suitable for connecting with a host so that the host can read and write data to an external memory card through the card reader, wherein the host uses a first communication protocol or a second communication One of the agreements. The card reader includes a protocol judgment controller, a communication interface controller, a memory card controller and a USB communication interface. The communication interface controller is electrically connected to the protocol judgment controller and communicates with the host. The memory card controller is electrically connected to the protocol judgment controller and the communication interface controller and controls the host to read and write data on the external memory card. The USB communication interface is electrically connected to the communication interface controller. The protocol determination controller obtains determination information of the host to determine whether the host uses the first communication protocol or the second communication protocol.

於本揭示其中之一實施例的讀卡機,其中該協定判斷控制器包括一微處理單元,用以列舉該第一通訊協定或該第二通訊協定而與該主機通訊。當該主機的該判定資訊為一第一取得說明指令時,該協定判斷控制器判斷該主機使用該第一種通訊協定。當該主機的該判定資訊不是該第一取得說明指令時,則該協定判斷控制器判斷該主機使用該第二種通訊協定。In the card reader of one of the embodiments of the present disclosure, the protocol determining controller includes a micro-processing unit for enumerating the first communication protocol or the second communication protocol to communicate with the host. When the determination information of the host is a first obtaining description command, the protocol determination controller determines that the host uses the first communication protocol. When the determination information of the host is not the first obtaining description command, the protocol determination controller determines that the host uses the second communication protocol.

於本揭示其中之一實施例的讀卡機,其中該協定判斷控制器包括一微處理單元以及一電力傳送微處理單元。當該讀卡機連接該主機後,該電力傳送微處理單元要求該主機提供該判定資訊以決定供電電壓。該微處理單元並藉以判斷該主機是使用該第一種通訊協定或該第二種通訊協定。該判定資訊為該主機的產品識別資料與供應商識別資料至少其中之一。In the card reader of one of the embodiments of the present disclosure, the protocol determination controller includes a micro-processing unit and a power transmission micro-processing unit. When the card reader is connected to the host, the power transmission micro-processing unit requires the host to provide the determination information to determine the power supply voltage. The micro-processing unit determines whether the host uses the first communication protocol or the second communication protocol. The determination information is at least one of product identification data and supplier identification data of the host.

本揭示還提供一種資料讀寫系統的讀寫方法,用以對一外部記憶卡進行資料讀寫。該方法包括:提供一資料讀寫系統,該資料讀寫系統包括一協定判斷控制器、一通訊介面控制器以及一記憶卡控制器,該通訊介面控制器電連接至該協定判斷控制器,且該記憶卡控制器電連接至該協定判斷控制器與該通訊介面控制器;使該資料讀寫系統與一主機電性連接,並使該通訊介面控制器與該主機通訊,其中該主機使用第一種通訊協定或第二種通訊協定其中之一;該協定判斷控制器取得該主機的一判定資訊;該協定判斷控制器依據該判定資訊判斷該主機使用該第一種通訊協定或該第二種通訊協定;以及該協定判斷控制器列舉該主機使用的該第一種通訊協定或該第二種通訊協定,以使該主機對該外部記憶卡進行資料讀寫。The present disclosure also provides a reading and writing method of a data reading and writing system, which is used for reading and writing data on an external memory card. The method includes: providing a data reading and writing system, the data reading and writing system includes a protocol judgment controller, a communication interface controller, and a memory card controller, the communication interface controller is electrically connected to the protocol judgment controller, and The memory card controller is electrically connected to the protocol judgment controller and the communication interface controller; the data reading and writing system is electrically connected to a host, and the communication interface controller communicates with the host, wherein the host uses the first One of a communication protocol or a second communication protocol; the protocol determination controller obtains a determination information of the host; the protocol determination controller determines that the host uses the first communication protocol or the second communication protocol based on the determination information A communication protocol; and the protocol judgment controller enumerates the first communication protocol or the second communication protocol used by the host, so that the host can read and write data on the external memory card.

於本揭示其中之一實施例中,該協定判斷控制器包括一微處理單元,而判斷該主機使用該第一種通訊協定或該第二種通訊協定包括多個步驟。該些步驟包括:判斷該判定資訊是否為一第一取得說明指令;若該判定資訊為該第一取得說明指令,則判斷該主機使用該第一種通訊協定,且該微處理單元列舉該第一通訊協定與該主機通訊;以及若該判定資訊不是該第一取得說明指令,則判斷該主機使用該第二種通訊協定,且該微處理單元列舉該第二通訊協定與該主機通訊。In one of the embodiments of the present disclosure, the protocol determining controller includes a micro-processing unit, and determining that the host uses the first communication protocol or the second communication protocol includes multiple steps. The steps include: determining whether the determination information is a first obtaining description command; if the determining information is the first obtaining description command, determining that the host uses the first communication protocol, and the micro-processing unit lists the first communication protocol A communication protocol communicates with the host; and if the determination information is not the first acquisition instruction command, it is determined that the host uses the second communication protocol, and the micro-processing unit lists the second communication protocol to communicate with the host.

於本揭示其中之一實施例的資料讀寫系統的讀寫方法,其中若該資料讀寫系統自該主機依序接收該第一取得說明指令、一設定位址指令與一第二取得說明指令時。則該協定判斷控制器依據所接收的該第一取得說明指令判斷該主機使用該第一種通訊協定,且該主機以該第一種通訊協定讀寫電連接於該資料讀寫系統的該外部記憶卡。若該資料讀寫系統自該主機依序接收該設定位址指令與該第二取得說明指令。則該協定判斷控制器依據所接收的該設定位址指令預設該主機使用該第二種通訊協定。In the method for reading and writing a data reading and writing system in one of the embodiments of the present disclosure, if the data reading and writing system sequentially receives the first obtaining description command, a setting address command and a second obtaining description command from the host Time. Then the protocol judgment controller judges that the host uses the first communication protocol according to the received first acquisition instruction command, and the host uses the first communication protocol to read and write and is electrically connected to the external of the data reading and writing system Memory card. If the data read-write system sequentially receives the set address command and the second get description command from the host. Then the protocol judgment controller presets the host to use the second communication protocol according to the received address setting instruction.

於本揭示其中之一實施例的資料讀寫系統的讀寫方法,其中該協定判斷控制器判斷該主機使用該第二種通訊協定後更包括多個步驟,該些步驟包括:是否於一預設時間內接收到該主機發送的一協定執行認證指令;若於該預設時間內接收到該主機發送的該協定執行認證指令,則確認該主機使用該第二種通訊協定,該主機並以該第二種通訊協定讀寫該外部記憶卡;若於該預設時間內未接收到該主機發送的該協定執行認證指令,則該資料讀寫系統改以列舉該第一種通訊協定與該主機進行通訊。In the reading and writing method of the data reading and writing system in one of the embodiments of the present disclosure, the protocol determining controller further includes a plurality of steps after determining that the host uses the second communication protocol, and these steps include: It is assumed that a protocol execution authentication command sent by the host is received within the preset time; if the protocol execution authentication command sent by the host is received within the preset time, it is confirmed that the host uses the second communication protocol, and the host uses The second communication protocol reads and writes the external memory card; if the protocol execution authentication command sent by the host is not received within the preset time, the data reading and writing system will instead list the first communication protocol and the The host communicates.

於本揭示其中之一實施例的資料讀寫系統的讀寫方法,其中該資料讀寫系統自該主機接收該第二取得說明指令之後,該協定判斷控制器接收該主機的一設定組態指令。In the reading and writing method of the data reading and writing system in one of the embodiments of the present disclosure, after the data reading and writing system receives the second obtaining instruction command from the host, the protocol determining controller receives a setting configuration command from the host .

於本揭示其中之一實施例的資料讀寫系統的讀寫方法,其中取得 該主機的該判定資訊之前更包括多個步驟,該些步驟包括:該協定判斷控制器接收該主機的一初始化指令;以及該協定判斷控制器接收該主機的一排線重置指令。其中該協定判斷控制器認定該排線重置指令後所接收的該主機的指令為該判定資訊。In the reading and writing method of the data reading and writing system in one of the embodiments of the present disclosure, it further includes a plurality of steps before obtaining the determination information of the host. The steps include: the protocol determination controller receives an initialization command from the host ; And the agreement determines that the controller receives a cable reset command from the host. The protocol judgment controller recognizes that the command from the host received after the cable reset command is the judgment information.

於本揭示其中之一實施例中,該資料讀寫系統改以列舉該第一種通訊協定與該主機進行通訊的步驟包括:該協定判斷控制器重新接收該主機的該排線重置指令;該協定判斷控制器重新接收該主機的設定位址指令;該協定判斷控制器重新接收該主機的取得說明指令;該協定判斷控制器重新接收該主機的設定組態指令;以及該主機以該第一種通訊協定(MSC)讀寫該外部記憶卡。In one of the embodiments of the present disclosure, the step of changing the data reading and writing system to enumerate the first communication protocol to communicate with the host includes: the protocol determines that the controller receives the cable reset command from the host again; The protocol determines that the controller re-receives the host’s setting address command; the protocol determines that the controller re-receives the host’s acquisition instruction; the protocol determines that the controller re-receives the host’s setting configuration command; and the host uses the A communication protocol (MSC) reads and writes the external memory card.

於本揭示其中之一實施例的資料讀寫系統的讀寫方法,其中該協定判斷控制器包括一微處理單元以及一電力傳送微處理單元。該協定判斷控制器取得該主機的該判定資訊的步驟包括:該電力傳送微處理單元向該主機要求該判定資訊,其中該判定資訊為該主機的產品識別資料與供應商識別資料,而該主機的產品識別資料與供應商識別資料包括產品資料或是作業系統資料。In the read-write method of the data read-write system in one of the embodiments of the present disclosure, the protocol determination controller includes a micro-processing unit and a power transmission micro-processing unit. The step of obtaining the determination information of the host by the protocol determination controller includes: the power transmission micro-processing unit requests the determination information from the host, wherein the determination information is the product identification data and supplier identification data of the host, and the host The product identification data and supplier identification data of includes product data or operating system data.

於本揭示其中之一實施例的資料讀寫系統的讀寫方法,其中取得該主機的該判定資訊之前更包括:該協定判斷控制器判斷該資料讀寫系統是否具有一電力傳送模組。In the read-write method of the data read-write system in one of the embodiments of the present disclosure, before obtaining the determination information of the host, it further includes: the protocol determination controller determines whether the data read-write system has a power transmission module.

於本揭示其中之一實施例的資料讀寫系統的讀寫方法,其中若判斷該資料讀寫系統具有該電力傳送模組,則該協定判斷控制器透過該電力傳送模組向該主機取得該判定資訊,而該判定資訊為該主機的產品識別資料與供應商識別資料。若判斷該資料讀寫系統不具有該電力傳送模組,則該協定判斷控制器直接取得該主機的該判定資訊,以判斷該主機使用該第一種通訊協定或該第二種通訊協定。In the reading and writing method of a data reading and writing system in one of the embodiments of the present disclosure, if it is determined that the data reading and writing system has the power transmission module, the protocol judgment controller obtains the data from the host through the power transmission module Judgment information, and the judgment information is the product identification data and supplier identification data of the host. If it is determined that the data reading and writing system does not have the power transmission module, the protocol determination controller directly obtains the determination information of the host to determine whether the host uses the first communication protocol or the second communication protocol.

於本揭示其中之一實施例中,若判斷該資料讀寫系統不具有該電力傳送模組,則該協定判斷控制器執行多個步驟。該些步驟包括:判斷該判定資訊是否為該第一取得說明指令;若該判定資訊為一第一取得說明指令,則判斷該主機使用該第一種通訊協定,且該微處理單元列舉該第一通訊協定與該主機通訊;以及若該判定資訊不是該第一取得說明指令,則判斷該主機使用該第二種通訊協定,且該微處理單元列舉該第二通訊協定與該主機通訊。In one of the embodiments of the present disclosure, if it is determined that the data reading and writing system does not have the power transmission module, the protocol determination controller executes multiple steps. The steps include: determining whether the determination information is the first acquisition instruction; if the determination information is a first acquisition instruction instruction, determining that the host uses the first communication protocol, and the micro-processing unit lists the first acquisition instruction A communication protocol communicates with the host; and if the determination information is not the first acquisition instruction command, it is determined that the host uses the second communication protocol, and the micro-processing unit lists the second communication protocol to communicate with the host.

於本揭示其中之一實施例的資料讀寫系統的讀寫方法,其中若該資料讀寫系統自該主機依序接收該第一取得說明指令、一設定位址指令與一第二取得說明指令。則該協定判斷控制器依據所接收的該第一取得說明指令判斷該主機使用該第一種通訊協定,且該主機以該第一種通訊協定讀寫電連接於該資料讀寫系統的外部記憶卡。若該資料讀寫系統自該主機依序接收一設定位址指令與該第二取得說明指令。則該協定判斷控制器依據所接收的該設定位址指令預設該主機使用該第二種通訊協定。In the method for reading and writing a data reading and writing system in one of the embodiments of the present disclosure, if the data reading and writing system sequentially receives the first obtaining description command, a setting address command and a second obtaining description command from the host . Then the protocol judgment controller judges that the host uses the first communication protocol according to the received first acquisition instruction command, and the host uses the first communication protocol to read and write and is electrically connected to the external memory of the data reading and writing system card. If the data read-write system sequentially receives a set address command and the second get description command from the host. Then the protocol judgment controller presets the host to use the second communication protocol according to the received address setting instruction.

於本揭示其中之一實施例的資料讀寫系統的讀寫方法,其中若該協定判斷控制器於判斷該主機使用該第二種通訊協定後一預設時間內接收到該主機發送的該協定執行認證指令,則該主機以該第二種通訊協定讀寫該外部記憶卡。若該協定判斷控制器於判斷該主機使用該第二種通訊協定後該預設時間內未接收到該主機發送的該協定執行認證指令,則該資料讀寫系統改以列舉該第一種通訊協定與該主機進行通訊。In the reading and writing method of the data reading and writing system in one of the embodiments of the present disclosure, if the protocol determining controller receives the protocol sent by the host within a predetermined time after determining that the host uses the second communication protocol When the authentication command is executed, the host uses the second communication protocol to read and write to the external memory card. If the protocol judging controller does not receive the protocol execution authentication command sent by the host within the preset time after judging that the host uses the second communication protocol, the data reading and writing system changes to list the first communication Protocol to communicate with the host.

於本揭示其中之一實施例的資料讀寫系統的讀寫方法,其中該資料讀寫系統更包括一USB通訊介面。而該資料讀寫系統與該主機透過該通訊介面電性連接。In the reading and writing method of the data reading and writing system in one of the embodiments of the present disclosure, the data reading and writing system further includes a USB communication interface. The data read-write system and the host are electrically connected through the communication interface.

相較於先前技術,本揭示的讀卡機、資料讀寫系統及其讀寫方法藉由該協定判斷控制器取得該主機的一判定資訊,以判斷該主機使用該第一種通訊協定或該第二種通訊協定,並列舉該第一種通訊協定或該第二種通訊協定來與該主機通訊。如此可自動判斷通訊協定並進行通訊,不需要使用者進行選擇通訊協定的動作,亦避免使用者選擇錯誤的通訊協定。Compared with the prior art, the card reader, data reading and writing system and the reading and writing method of the present disclosure obtain a determination information of the host through the protocol determination controller to determine whether the host uses the first communication protocol or the The second communication protocol, and enumerate the first communication protocol or the second communication protocol to communicate with the host. In this way, the communication protocol can be automatically determined and the communication can be carried out, without the user having to select the communication protocol, and the user is also prevented from selecting the wrong communication protocol.

為了讓本揭示的上述及其他目的、特徵、優點能更明顯易懂,下文將特舉本揭示優選實施例,並配合所附圖式,作詳細說明如下。再者,本揭示所提到的方向用語,例如上、下、頂、底、前、後、左、右、內、外、側層、周圍、中央、水平、橫向、垂直、縱向、軸向、徑向、最上層或最下層等,僅是參考附加圖式的方向。因此,使用的方向用語是用以說明及理解本揭示,而非用以限制本揭示。In order to make the above and other objectives, features, and advantages of the present disclosure more obvious and understandable, the following will specifically illustrate the preferred embodiments of the present disclosure, in conjunction with the accompanying drawings, and describe in detail as follows. Furthermore, the directional terms mentioned in this disclosure, such as up, down, top, bottom, front, back, left, right, inside, outside, side layer, surrounding, center, horizontal, horizontal, vertical, vertical, axial , Radial, uppermost or lowermost layers, etc., are only the direction of reference to the attached drawings. Therefore, the directional terms used are used to illustrate and understand the present disclosure, rather than to limit the present disclosure.

在圖中,結構相似的單元是以相同標號表示。In the figure, units with similar structures are indicated by the same reference numerals.

圖1顯示根據本揭示的一實施例中資料讀寫系統與讀卡機的結構示意圖。請參照圖1,本揭示提供一種讀卡機(Card Reader, CR)1000,其適於與一主機400連接,以讓該主機400透過該讀卡機1000對一外部記憶卡300進行資料讀寫。在本實施例中,讀卡機1000包括一資料讀寫系統100以及一USB通訊介面200。其中,資料讀寫系統100包括一協定判斷控制器120、一通訊介面控制器110以及一記憶卡控制器130,而該USB通訊介面200係電連接至該通訊介面控制器110。此外,該通訊介面控制器110電連接至該協定判斷控制器120,並適於透過USB通訊介面200與該主機400通訊。該記憶卡控制器130則電連接至該協定判斷控制器120與該通訊介面控制器110。如此一來,該主機400可透過該記憶卡控制器130對該外部記憶卡300進行資料讀寫。值得一提的是,在本實施例中,該主機400係使用一第一種通訊協定或一第二種通訊協定其中之一,而該協定判斷控制器120可用以取得該主機400的一判定資訊,以判斷該主機400使用該第一種通訊協定或該第二種通訊協定。FIG. 1 shows a schematic diagram of the structure of a data reading and writing system and a card reader according to an embodiment of the present disclosure. 1, the present disclosure provides a card reader (Card Reader, CR) 1000, which is suitable for connecting with a host 400, so that the host 400 can read and write data to an external memory card 300 through the card reader 1000 . In this embodiment, the card reader 1000 includes a data reading and writing system 100 and a USB communication interface 200. The data reading and writing system 100 includes a protocol judgment controller 120, a communication interface controller 110, and a memory card controller 130, and the USB communication interface 200 is electrically connected to the communication interface controller 110. In addition, the communication interface controller 110 is electrically connected to the protocol judgment controller 120, and is suitable for communicating with the host 400 through the USB communication interface 200. The memory card controller 130 is electrically connected to the protocol judgment controller 120 and the communication interface controller 110. In this way, the host 400 can read and write data to the external memory card 300 through the memory card controller 130. It is worth mentioning that, in this embodiment, the host 400 uses one of a first communication protocol or a second communication protocol, and the protocol determination controller 120 can be used to obtain a determination of the host 400 Information to determine whether the host 400 uses the first communication protocol or the second communication protocol.

請繼續參照圖1,在一較佳實施例中,資料讀寫系統100亦可直接或是以其他適當的方式來與主機400連接,以讓該主機400透過該資料讀寫系統100對外部記憶卡300進行資料讀寫。舉例來說,資料讀寫系統100可以直接地嵌設於主機內部,並直接地與主機內部元件電性連接,未額外再透過例如是USB通訊介面200的架構自主機外部來與主機連接。當然,在其他較佳實施例中,資料讀寫系統100亦可應用USB通訊介面200以外的其他通訊介面自主機外部來與主機400連接。亦即,關於資料讀寫系統100與主機400的連接方式,本揭示在此並不做任何限制。Please continue to refer to FIG. 1. In a preferred embodiment, the data reading and writing system 100 can also be directly connected to the host 400 or in other suitable ways, so that the host 400 can access external memory through the data reading and writing system 100. The card 300 performs data reading and writing. For example, the data reading and writing system 100 can be directly embedded in the host and directly electrically connected to the internal components of the host, without additional connection to the host from the outside of the host through a structure such as the USB communication interface 200. Of course, in other preferred embodiments, the data reading and writing system 100 can also use other communication interfaces other than the USB communication interface 200 to connect to the host 400 from outside the host. That is, the present disclosure does not impose any restrictions on the connection method between the data reading and writing system 100 and the host 400.

在資料讀寫系統100直接或是以其他適當的方式來與主機400連接的實施架構下,主機400亦是使用一第一種通訊協定或一第二種通訊協定其中之一。同樣地,該實施例的資料讀寫系統100包括一協定判斷控制器120、一通訊介面控制器110以及一記憶卡控制器130。而該通訊介面控制器110係電連接至該協定判斷控制器120,並適於與該主機400通訊。該記憶卡控制器130則電連接至該協定判斷控制器120與該通訊介面控制器110。如此一來,該主機400可透過該記憶卡控制器130對該外部記憶卡300進行資料讀寫。值得一提的是,在本實施例中,該協定判斷控制器120亦用以取得該主機400的一判定資訊,以判斷該主機400使用該第一種通訊協定或該第二種通訊協定。In an implementation architecture in which the data reading and writing system 100 is directly connected to the host 400 or in other appropriate ways, the host 400 also uses one of a first communication protocol or a second communication protocol. Similarly, the data reading and writing system 100 of this embodiment includes a protocol judgment controller 120, a communication interface controller 110, and a memory card controller 130. The communication interface controller 110 is electrically connected to the protocol judgment controller 120 and is suitable for communicating with the host 400. The memory card controller 130 is electrically connected to the protocol judgment controller 120 and the communication interface controller 110. In this way, the host 400 can read and write data to the external memory card 300 through the memory card controller 130. It is worth mentioning that in this embodiment, the protocol determination controller 120 is also used to obtain determination information of the host 400 to determine whether the host 400 uses the first communication protocol or the second communication protocol.

圖2顯示根據本揭示的一實施例中資料讀寫系統的讀寫方法的流程示意圖。請參照圖1及圖2,本揭示還提供一種資料讀寫系統100的讀寫方法,用以對一外部記憶卡300進行資料讀寫。該方法包括步驟S100至步驟S500。首先,如步驟S100所示:提供一資料讀寫系統100。在本實施例中,該資料讀寫系統100包括一協定判斷控制器120、一通訊介面控制器110以及一記憶卡控制器130。該通訊介面控制器110電連接至該協定判斷控制器120,且該記憶卡控制器130電連接至該協定判斷控制器120與該通訊介面控制器110。接著,如步驟S200所示:使該資料讀寫系統100與一主機400電性連接,並使該通訊介面控制器110與該主機400通訊。在本實施例中,該主機400是使用第一種通訊協定或第二種通訊協定其中之一。接著,如步驟S300所示:該協定判斷控制器120取得該主機400的一判定資訊。之後,如步驟S400所示:該協定判斷控制器120依據該判定資訊判斷該主機400使用該第一種通訊協定或該第二種通訊協定。最後,如步驟S500所示:該協定判斷控制器120列舉(Emulate)該主機400使用的該第一種通訊協定或該第二種通訊協定,以使該主機400對該外部記憶卡300進行資料讀寫。FIG. 2 shows a schematic flowchart of a reading and writing method of the data reading and writing system according to an embodiment of the present disclosure. Please refer to FIG. 1 and FIG. 2, the present disclosure also provides a reading and writing method of the data reading and writing system 100 for reading and writing data on an external memory card 300. The method includes step S100 to step S500. First, as shown in step S100: a data reading and writing system 100 is provided. In this embodiment, the data reading and writing system 100 includes a protocol judgment controller 120, a communication interface controller 110, and a memory card controller 130. The communication interface controller 110 is electrically connected to the protocol determination controller 120, and the memory card controller 130 is electrically connected to the protocol determination controller 120 and the communication interface controller 110. Then, as shown in step S200: the data reading and writing system 100 is electrically connected to a host 400, and the communication interface controller 110 is allowed to communicate with the host 400. In this embodiment, the host 400 uses one of the first communication protocol or the second communication protocol. Then, as shown in step S300: the protocol determination controller 120 obtains a determination information of the host 400. Then, as shown in step S400: the protocol determination controller 120 determines that the host 400 uses the first communication protocol or the second communication protocol according to the determination information. Finally, as shown in step S500: the protocol determination controller 120 enumerates (emulates) the first communication protocol or the second communication protocol used by the host 400, so that the host 400 performs data on the external memory card 300 Read and write.

圖3顯示根據本揭示的一實施例中資料讀寫系統與讀卡機的結構示意圖。請參照圖3,於本揭示其中之一實施例的讀卡機1000或資料讀寫系統100中,該協定判斷控制器120包括一微處理單元(Microprocessor Control Unit, MCU)121以及一電力傳送(Power Delivery, PD)微處理單元122a。說明書中提到的「包括」可以是上位的元件分類,並不意味被包含的元件必然具有物理的限制,例如位於實體的框架、或外殼裏,或是位於同一晶片上,除非特別提到,本發明對此不加以限制。即本實施例中,微處理單元121以及電力傳送微處理單元122a合稱為協定判斷控制器120。當該資料讀寫系統100連接該主機400後,該電力傳送微處理單元122a要求該主機400提供該判定資訊。該判定資訊為該主機400的產品識別資料(Production Identification, PID)與供應商識別資料(Vendor Identification, VID)。微處理單元121並藉以判斷該主機400是使用該第一種通訊協定或該第二種通訊協定。FIG. 3 shows a schematic diagram of the structure of the data reading and writing system and the card reader according to an embodiment of the present disclosure. 3, in the card reader 1000 or the data reading and writing system 100 of one embodiment of the present disclosure, the protocol judgment controller 120 includes a microprocessor control unit (MCU) 121 and a power transmission ( Power Delivery, PD) micro-processing unit 122a. The "include" mentioned in the specification can be a higher-level component classification, and does not mean that the included components must have physical limitations, such as being located in a physical frame or housing, or on the same chip, unless specifically mentioned, The present invention does not impose restrictions on this. That is, in this embodiment, the micro-processing unit 121 and the power transmission micro-processing unit 122a are collectively referred to as the agreement judgment controller 120. When the data reading and writing system 100 is connected to the host 400, the power transmission micro-processing unit 122a requests the host 400 to provide the determination information. The determination information is the product identification data (PID) and vendor identification data (Vendor Identification, VID) of the host 400. The micro-processing unit 121 determines whether the host 400 uses the first communication protocol or the second communication protocol.

於本揭示其中之一實施例中,在實體結構上,讀卡機1000包括一電力傳送模組122,該電力傳送模組122包括該電力傳送微處理單元122a、一C型及雙向標記碼(type-C and Bi-phase Mark Coding Physics, type-C & BMC PHY)實體層122b以及一第二快閃儲存單元(Flash Memory)152。即,在實體結構上,該電力傳送微處理單元122a位於該電力傳送模組122中。另外,第二快閃儲存單元152用以儲存一計算機程序,而該計算機程序用來要求該主機400提供該判定資訊以決定供電電壓。而該電力傳送微處理單元122a用以控制該C型及雙向標記碼實體層122b與該主機400通訊。在一些實施例中,該讀卡機1000更包括一USB收發器單元介面(Universal Serial Bus 2.0 Transceiver Macrocell Interface, UTMI)211、一高速/全速傳輸實體層(High Speed/Full Speed Physical layer, HS/FS PHY)212、一緩衝單元140、一超高速傳輸實體層(Super Speed Physical layer)222、一超高速裝置(Super Speed Device, SSDEV)221以及一第一快閃儲存單元151。In one of the embodiments of the present disclosure, in terms of physical structure, the card reader 1000 includes a power transmission module 122, and the power transmission module 122 includes the power transmission micro-processing unit 122a, a C-type and two-way marking code ( type-C and Bi-phase Mark Coding Physics, type-C & BMC PHY) physical layer 122b and a second flash memory unit (Flash Memory) 152. That is, in terms of physical structure, the power transmission micro-processing unit 122 a is located in the power transmission module 122. In addition, the second flash storage unit 152 is used to store a computer program, and the computer program is used to request the host 400 to provide the determination information to determine the power supply voltage. The power transmission micro-processing unit 122a is used to control the C-type and bidirectional marking code physical layer 122b to communicate with the host 400. In some embodiments, the card reader 1000 further includes a USB transceiver unit interface (Universal Serial Bus 2.0 Transceiver Macrocell Interface, UTMI) 211, a high speed/full speed physical layer (High Speed/Full Speed Physical layer, HS/ FS PHY) 212, a buffer unit 140, a Super Speed Physical layer (Super Speed Physical layer) 222, a Super Speed Device (SSDEV) 221, and a first flash storage unit 151.

該USB收發器單元介面211電連接至該通訊介面控制器110。該高速/全速傳輸實體層212電連接至該USB收發器單元介面211。該緩衝單元140電連接至該記憶卡控制器130以及該通訊介面控制器110。該超高速裝置221電連接於該超高速傳輸實體層222及該緩衝單元140。該第一快閃儲存單元151電連接至該微處理單元121,且儲存一計算機程序。該計算機程序是用來判斷該主機400的通訊協定。其中,該微處理單元121透過該通訊介面控制器110及USB通訊介面200該來與該主機400通訊。進一步地,通訊介面控制器110透過USB收發器單元介面211、高速/全速傳輸實體層212、超高速裝置221以及超高速傳輸實體層222來與主機400通訊。該主機400透過該超高速裝置221與該超高速傳輸實體層222,或是該USB收發器單元介面211與該高速/全速傳輸實體層212讀寫該外部記憶卡300。亦即,該主機400透過該微處理單元121的控制來讀寫該外部記憶卡300。The USB transceiver unit interface 211 is electrically connected to the communication interface controller 110. The high-speed/full-speed transmission physical layer 212 is electrically connected to the USB transceiver unit interface 211. The buffer unit 140 is electrically connected to the memory card controller 130 and the communication interface controller 110. The ultra-high-speed device 221 is electrically connected to the ultra-high-speed transmission physical layer 222 and the buffer unit 140. The first flash storage unit 151 is electrically connected to the micro-processing unit 121 and stores a computer program. The computer program is used to determine the communication protocol of the host 400. Wherein, the micro-processing unit 121 communicates with the host 400 through the communication interface controller 110 and the USB communication interface 200. Further, the communication interface controller 110 communicates with the host 400 through the USB transceiver unit interface 211, the high-speed/full-speed transmission physical layer 212, the super-high-speed device 221, and the super-high-speed transmission physical layer 222. The host 400 reads and writes to the external memory card 300 through the ultra-high-speed device 221 and the ultra-high-speed transmission physical layer 222, or the USB transceiver unit interface 211 and the high-speed/full-speed transmission physical layer 212. That is, the host 400 reads and writes the external memory card 300 through the control of the micro-processing unit 121.

具體的,該電力傳送微處理單元122a透過序列周邊介面(Serial Peripheral Interface, SPI)控制器122c存取該第二快閃儲存單元152。Specifically, the power transmission micro-processing unit 122a accesses the second flash storage unit 152 through a Serial Peripheral Interface (SPI) controller 122c.

圖4顯示根據本揭示的一實施例中資料讀寫系統的讀寫方法的流程示意圖。請參照圖4,在該協定判斷控制器120包括該微處理單元121以及該電力傳送微處理單元122a的實施架構下,於本揭示其中之一實施例的資料讀寫系統的讀寫方法中,該協定判斷控制器120取得該主機400的該判定資訊之前更包括如步驟S210所示:該電力傳送微處理單元122a向該主機400要求該判定資訊。其中該判定資訊為該主機400的產品識別資料與供應商識別資料,而該主機400的產品識別資料與供應商識別資料包括產品資料或是作業系統資料。在本實施例中,資料讀寫系統100與主機400電性連接,並與主機400通訊之後,由電力傳送微處理單元122a向主機400要求判定資訊,進而協定判斷控制器120中的電力傳送微處理單元122a取得主機400的判定資訊並傳遞給微處理單元121,由微處理單元121判斷主機400使用的是第一種通訊協定或是第二種通訊協定。FIG. 4 shows a schematic flowchart of a reading and writing method of the data reading and writing system according to an embodiment of the present disclosure. Please refer to FIG. 4, under the implementation architecture in which the protocol determination controller 120 includes the micro-processing unit 121 and the power transmission micro-processing unit 122a, in the reading and writing method of the data reading and writing system according to one of the embodiments of the present disclosure, Before the protocol determination controller 120 obtains the determination information of the host 400, it further includes as shown in step S210: the power transmission micro-processing unit 122a requests the host 400 for the determination information. The determination information is the product identification data and supplier identification data of the host 400, and the product identification data and supplier identification data of the host 400 include product data or operating system data. In this embodiment, the data reading and writing system 100 is electrically connected to the host 400, and after communicating with the host 400, the power transmission micro-processing unit 122a requests the host 400 for determination information, and then the power transmission microcomputer in the judgment controller 120 is negotiated. The processing unit 122a obtains the determination information of the host 400 and transmits it to the micro-processing unit 121, and the micro-processing unit 121 determines whether the host 400 uses the first communication protocol or the second communication protocol.

具體的,請再參照圖3,第二快閃儲存單元152內可儲存一預設的查找表,用以將主機400的產品識別資料與供應商識別資料對照該主機400的種類,第一快閃儲存單元151內可儲存一查找表,用以將主機400的種類對照使用的傳輸協定的種類,以便協定判斷控制器120中的微處理單元121判斷主機400使用的通訊協定種類。Specifically, please refer to FIG. 3 again. The second flash storage unit 152 can store a preset lookup table for comparing the product identification data of the host 400 with the supplier identification data for the type of the host 400. The first flash storage unit 152 The flash storage unit 151 can store a look-up table for comparing the type of the host 400 with the type of the used transmission protocol, so that the micro-processing unit 121 in the protocol determination controller 120 can determine the type of communication protocol used by the host 400.

具體的,請再參照圖2及圖4,協定判斷控制器120列舉主機400使用的第一種通訊協定或第二種通訊協定,以使該主機400對該外部記憶卡300進行資料讀寫(步驟S500)的方式包括:當協定判斷控制器120的該微處理單元121判斷該主機400使用該第一種通訊協定時,該微處理單元121控制該介面控制單元110向主機400列舉該第一種通訊協定以與該主機400進行通訊。當該微處理單元121判斷該主機400使用該第二種通訊協定時,該微處理單元121控制該介面控制單元110向主機400列舉該第二種通訊協定以與該主機400進行通訊。Specifically, referring to FIGS. 2 and 4 again, the protocol judgment controller 120 lists the first communication protocol or the second communication protocol used by the host 400 so that the host 400 can read and write data to the external memory card 300 ( The method of step S500) includes: when the micro-processing unit 121 of the protocol determination controller 120 determines that the host 400 uses the first communication protocol, the micro-processing unit 121 controls the interface control unit 110 to list the first communication protocol to the host 400 A communication protocol to communicate with the host 400. When the micro-processing unit 121 determines that the host 400 uses the second communication protocol, the micro-processing unit 121 controls the interface control unit 110 to list the second communication protocol to the host 400 to communicate with the host 400.

具體的,第一種通訊協定例如是大容量儲存類別(Mass Storage Class, MSC)協定。使用第一種通訊協定的主機400例如是運行視窗7(Window 7)作業系統、視窗10(Window 10)作業系統、麥金塔(MacOS)作業系統的電腦、或是運行安卓(Android)作業系統的手持通訊裝置、智慧型手機等。具體的,第二種通訊協定例如是外部附件原生傳輸(External Accessory Native Transport, EAN)協定。使用第二種通訊協定的主機400例如是使用iOS作業系統的平板電腦、手持通訊裝置、智慧型手機等。EAN協定是iAP2通訊協定下的一個外部傳輸協定。通訊協定種類的發展與電子設備之間的配合視資訊技術的發展而定,本揭示不限定主機的種類與通訊協定的種類。Specifically, the first communication protocol is, for example, the Mass Storage Class (MSC) protocol. The host 400 using the first communication protocol is, for example, a computer running Windows 7 (Window 7) operating system, Windows 10 (Window 10) operating system, Macintosh (MacOS) operating system, or running Android (Android) operating system Handheld communication devices, smart phones, etc. Specifically, the second communication protocol is, for example, the External Accessory Native Transport (EAN) protocol. The host 400 using the second communication protocol is, for example, a tablet computer, a handheld communication device, and a smart phone using the iOS operating system. The EAN protocol is an external transmission protocol under the iAP2 communication protocol. The development of the types of communication protocols and the cooperation between electronic devices depend on the development of information technology, and this disclosure does not limit the types of hosts and types of communication protocols.

圖5顯示根據本揭示的一實施例中資料讀寫系統的讀寫方法的時序示意圖。具體的,請參照圖5,於本揭示其中之一實例中,以第一種通訊協定例如為MSC協定,第二種通訊協定例如為EAN協定為例。主機400可能為運行視窗7(Window 7)作業系統、視窗10(Window 10)作業系統、或麥金塔(MacOS)作業系統的電腦、或是運行安卓(Android)作業系統的手持通訊裝置、智慧型手機;主機400亦可以是使用iOS作業系統的平板電腦、手持通訊裝置、智慧型手機等。主機400、電力傳送模組122及微處理單元121之間的訊號傳輸時序如圖5所示。於資料讀寫系統100與主機400電連接之後,主機400會對電力傳送模組122進行供電。電力傳送模組122接著向主機400發送一取得製造資訊指令(GetMfgInfo)。主機400收到指令後,回覆產品識別資料PID與供應商識別資料VID。電力傳送模組122便依此資料識別主機400。之後,電力傳送模組122主動或依要求而將主機資訊(HostInfo)傳送給微處理單元121。微處理單元121依此主機資訊選擇適當的通訊協定並列舉(Emulate)該通訊協定。FIG. 5 shows a timing diagram of a reading and writing method of the data reading and writing system according to an embodiment of the present disclosure. Specifically, please refer to FIG. 5. In one of the examples of the present disclosure, the first communication protocol is for example the MSC protocol, and the second communication protocol is for example the EAN protocol. The host 400 may be a computer running Windows 7 (Window 7) operating system, Windows 10 (Window 10) operating system, or Macintosh (MacOS) operating system, or a handheld communication device running Android (Android) operating system, smart A mobile phone; the host 400 can also be a tablet computer, a handheld communication device, a smart phone, etc. using the iOS operating system. The signal transmission sequence between the host 400, the power transmission module 122, and the micro-processing unit 121 is shown in FIG. 5. After the data reading and writing system 100 is electrically connected to the host 400, the host 400 will supply power to the power transmission module 122. The power transmission module 122 then sends a get manufacturing information command (GetMfgInfo) to the host 400. After receiving the instruction, the host 400 replies with the product identification data PID and the supplier identification data VID. The power transmission module 122 identifies the host 400 based on this data. After that, the power transmission module 122 transmits the host information (HostInfo) to the micro-processing unit 121 actively or upon request. The micro-processing unit 121 selects an appropriate communication protocol according to the host information and enumerates (emulates) the communication protocol.

請繼續參照圖5,上述列舉的過程如下:於電力傳送模組122將主機資訊(HostInfo)傳送給微處理單元121之後,會由主機400向資料讀寫系統100發送排線重置指令(USB Bus Reset)。資料讀寫系統100如果有支援高速(High Speed)傳輸的話,會回傳訊號並與主機400進行傳輸速度協商(handshake)。接著,主機400發送設定位址指令(SET_ADDRESS)設定讀卡機1000中的相關位址。再來,主機400發送取得說明指令(GET_DESCRIPTOR),而資料讀寫系統100便依指令回覆相關的資訊。最後,主機400發送設定組態指令(SET_CONFIGURATION)對資料讀寫系統100進行組態設定。列舉動作完成後,接下來主機400即可透過資料讀寫系統100對外部記憶卡300進行讀寫。Please continue to refer to FIG. 5, the above enumerated process is as follows: After the power transmission module 122 transmits the host information (HostInfo) to the micro-processing unit 121, the host 400 sends a cable reset command (USB Bus Reset). If the data reading and writing system 100 supports high speed transmission, it will send back a signal and negotiate a transmission speed with the host 400 (handshake). Then, the host 400 sends a set address command (SET_ADDRESS) to set the relevant address in the card reader 1000. Then, the host 400 sends a get description command (GET_DESCRIPTOR), and the data reading and writing system 100 responds to relevant information according to the command. Finally, the host 400 sends a setting configuration command (SET_CONFIGURATION) to configure the data reading and writing system 100. After the enumeration operation is completed, the host 400 can then read and write to the external memory card 300 through the data reading and writing system 100.

圖6顯示根據本揭示的一實施例中資料讀寫系統的讀寫方法的流程示意圖。具體的,請再一併參照圖6,於本揭示其中之一實施例,其讀卡機的讀寫方法的實例如圖6所示。讀卡機的讀寫方法說明如下:首先,如步驟A10所示:主機對讀卡機供電。步驟A10即是使讀卡機與主機電性連接。因此,在讀卡機與主機電性連接後,主機即會對讀卡機供電。接著,如步驟A20所示:讀卡機確認主機是否連接,若無連接則重新確認。確認讀卡機與主機電性連接後,如步驟A30所示:電力傳送模組向主機發送取得製造資訊指令(GetMfgInfo)。主機接著便會依製造資訊指令回覆其本身的製造資訊。再來,如步驟A40所示:讀卡機由製造資訊判斷主機是否使用EAN協定。若主機使用EAN協定,則讀卡機會以EAN協定與主機建立通訊(如步驟A51所示)。若主機不是使用EAN協定,則讀卡機以MSC協定與主機建立通訊(如步驟A52所示)。FIG. 6 shows a schematic flowchart of a reading and writing method of the data reading and writing system according to an embodiment of the present disclosure. Specifically, please refer to FIG. 6 together. In one of the embodiments of the present disclosure, an example of the reading and writing method of the card reader is shown in FIG. 6. The reading and writing method of the card reader is described as follows: First, as shown in step A10: the host supplies power to the card reader. Step A10 is to electrically connect the card reader with the host. Therefore, after the card reader is electrically connected to the host, the host will supply power to the card reader. Then, as shown in step A20: the card reader confirms whether the host is connected, and reconfirms if there is no connection. After confirming that the card reader is electrically connected to the host, as shown in step A30: the power transmission module sends a manufacturing information command (GetMfgInfo) to the host. The host will then reply its own manufacturing information according to the manufacturing information command. Next, as shown in step A40: the card reader judges whether the host uses the EAN protocol from the manufacturing information. If the host uses the EAN protocol, the card reader will establish communication with the host using the EAN protocol (as shown in step A51). If the host does not use the EAN protocol, the card reader establishes communication with the host using the MSC protocol (as shown in step A52).

請繼續參照圖6,在本揭示中,如步驟A40所示,係將「主機是否使用EAN協定」作為判斷條件,而不是將「主機是否使用MSC協定」作為判斷條件,其原因在於:有些主機雖同時適用EAN及MSC兩種協定,但是使用EAN協定或使用MSC協定會有不同的結果。該類主機例如是使用iOS作業系統的New iPad pro。詳細地說,在與這類同時適用EAN及MSC兩種協定的主機連接後,若協定判斷控制器120以主機是否使用MSC協定作為判斷條件,協定判斷控制器120即會判斷主機可使用MSC協定而使後續讀卡機完成MSC協定的列舉。然而,由於例如是New iPad pro的主機在使用MSC協定下僅有讀取功能並無寫入功能,因此協定判斷控制器120在使讀卡機完成MSC協定的列舉後,例如是使用iOS作業系統的New iPad pro主機並無法透過讀卡機對外部記憶卡執行寫入功能。所以,為讓New iPad pro這一類的產品能透過讀卡機進行讀和寫的功能,本實施例中將「主機是否使用EAN協定」作為判斷條件。如此一來,在該主機同時適用EAN協定及MSC協定且以主機是否使用EAN協定作為判斷條件的情況下,協定判斷控制器120即會判斷主機可使用EAN協定而使後續讀卡機完成EAN協定的列舉以與主機通訊,進而執行讀和寫的功能。上述兩種通訊協定僅以舉例之用,本發明不以此為限。其他較佳實施方式若有多種通訊協定,亦可以使用適當的判斷步驟,本發明在此亦不做任何限制。Please continue to refer to FIG. 6, in the present disclosure, as shown in step A40, "whether the host uses the EAN protocol" is used as the judgment condition instead of "whether the host uses the MSC protocol" as the judgment condition. The reason is that: some hosts Although both EAN and MSC protocols are applicable, using the EAN protocol or the MSC protocol will have different results. This type of host is, for example, New iPad pro using the iOS operating system. In detail, after connecting to such a host that simultaneously applies both EAN and MSC protocols, if the protocol determining controller 120 uses the MSC protocol as the determination condition, the protocol determining controller 120 will determine that the host can use the MSC protocol. And make the subsequent card reader complete the enumeration of the MSC agreement. However, because, for example, the host of the New iPad pro only has a read function and no write function when using the MSC protocol, the protocol determination controller 120 uses the iOS operating system after enabling the card reader to complete the enumeration of the MSC protocol. The New iPad pro host cannot write to an external memory card through a card reader. Therefore, in order to allow products such as New iPad pro to perform reading and writing functions through a card reader, in this embodiment, "whether the host uses the EAN protocol" is used as the judgment condition. In this way, when the host applies both the EAN protocol and the MSC protocol, and whether the host uses the EAN protocol as the judgment condition, the protocol judgment controller 120 will determine that the host can use the EAN protocol, and the subsequent card reader will complete the EAN protocol. Enumerate to communicate with the host, and then perform read and write functions. The above two communication protocols are only used as examples, and the present invention is not limited thereto. In other preferred embodiments, if there are multiple communication protocols, appropriate determination steps can also be used, and the present invention does not impose any limitation here.

請繼續參照圖6,在本揭示中,步驟A51及步驟A52中提到與主機建立通訊。其中與主機建立通訊的方式請參照圖5及其說明,即微處理單元121依主機資訊選擇適當的通訊協定後列舉該通訊協定。列舉的細節如前段說明,於此不再贅述。最後,於步驟A51之後會執行如步驟A61所示:主機以EAN協定存取SD記憶卡(或稱安全數位卡:Secure Digital Memory Card)。或是於步驟A52之後執行如步驟A62所示:主機以MSC協定存取SD記憶卡。以上僅舉兩種通訊協定為例,本揭示不限制通訊協定的數目與種類。三種以上的通訊協定亦可依本揭示的精神進行簡單的適當修飾。另外,以上讀卡機的讀寫方法可以計算機程式語言等方式記錄在讀卡機的第一快閃儲存單元151中,使得微處理單元121可以讀取第一快閃儲存單元151中的程序而執行上述讀卡機的讀寫方法。Please continue to refer to FIG. 6. In the present disclosure, steps A51 and A52 refer to establishing communication with the host. For the method of establishing communication with the host, please refer to FIG. 5 and its description. That is, the micro-processing unit 121 selects an appropriate communication protocol according to the host information and lists the communication protocol. The enumerated details are as explained in the previous paragraph and will not be repeated here. Finally, after step A51, it will be executed as shown in step A61: the host uses the EAN protocol to access the SD memory card (or called Secure Digital Memory Card: Secure Digital Memory Card). Or after step A52, it is executed as shown in step A62: the host accesses the SD memory card using the MSC protocol. The above only cited two communication protocols as examples, and the present disclosure does not limit the number and types of communication protocols. Three or more communication protocols can also be simply and appropriately modified in accordance with the spirit of the present disclosure. In addition, the above reading and writing methods of the card reader can be recorded in the first flash storage unit 151 of the card reader in a computer programming language, etc., so that the micro-processing unit 121 can read the program in the first flash storage unit 151 and execute it. The reading and writing method of the above-mentioned card reader.

圖7顯示根據本揭示的另一實施例的資料讀寫系統與讀卡機的結構示意圖。請參照圖7,於本揭示的讀卡機1000'或資料讀寫系統100'中,該協定判斷控制器120包括一微處理單元121。該微處理單元121透過該通訊介面控制器110接收該判定資訊。與前述實施例的主要差異在於:本實施例的讀卡機1000'不具有電力傳送模組及其電力傳送微處理單元。因此,本實施例並不是透過電力傳送模組來取得該判定資訊。對應地,本發明於此實施例所定義之判定資訊的內容亦與前述實施例不同。FIG. 7 shows a structural diagram of a data reading and writing system and a card reader according to another embodiment of the present disclosure. Please refer to FIG. 7, in the card reader 1000 ′ or the data reading and writing system 100 ′ of the present disclosure, the protocol determination controller 120 includes a micro-processing unit 121. The micro-processing unit 121 receives the determination information through the communication interface controller 110. The main difference from the foregoing embodiment is that the card reader 1000' of this embodiment does not have a power transmission module and its power transmission micro-processing unit. Therefore, in this embodiment, the determination information is not obtained through the power transmission module. Correspondingly, the content of the determination information defined in this embodiment of the present invention is also different from the foregoing embodiment.

圖8顯示根據本揭示的另一實施例中資料讀寫系統的讀寫方法的部分流程示意圖。請同時參照圖7與圖8,於此實施例中,當該主機400的該判定資訊為一第一取得說明指令(GET_DESCRIPTOR),則該協定判斷控制器120判斷該主機400使用該第一種通訊協定。該微處理單元121列舉該第一通訊協定來與該主機400通訊。當該主機400的該判定資訊不是該第一取得說明指令,則該協定判斷控制器120判斷該主機400使用該第二種通訊協定。該微處理單元121列舉該第二通訊協定來與該主機400通訊。亦即,在此實施例中,讀卡機1000'或資料讀寫系統100'的協定判斷控制器120是用以依據主機傳送到讀卡機1000'或資料讀寫系統100'的指令或是訊息的不同而決定主機使用的通訊協定。FIG. 8 shows a partial flow diagram of a reading and writing method of a data reading and writing system according to another embodiment of the present disclosure. 7 and 8 at the same time, in this embodiment, when the determination information of the host 400 is a first get description command (GET_DESCRIPTOR), the protocol determination controller 120 determines that the host 400 uses the first type Communication protocol. The micro-processing unit 121 lists the first communication protocol to communicate with the host 400. When the determination information of the host 400 is not the first obtaining description command, the protocol determination controller 120 determines that the host 400 uses the second communication protocol. The micro-processing unit 121 lists the second communication protocol to communicate with the host 400. That is, in this embodiment, the protocol determining controller 120 of the card reader 1000' or the data reading and writing system 100' is used to determine whether the controller 120 is used to send a command from the host to the card reader 1000' or the data reading and writing system 100' or The difference of the message determines the communication protocol used by the host.

如圖8所示,於本實施例的讀寫系統100'的讀寫方法中,於取得該主機400的該判定資訊(步驟S300)之前更包括多個步驟。其中,圖8係省略繪示步驟S100以簡化圖式,並不意味本實施例不需步驟S100。此外,步驟S100、S200、S300與前述實施例相同,於此不再贅述。本實施例在步驟S200後係執行步驟S220:該協定判斷控制器120接收該主機400的一初始化指令。接著,如步驟S230所示:該協定判斷控制器120接收該主機400的一排線重置指令(Bus Reset)。As shown in FIG. 8, in the reading and writing method of the reading and writing system 100' of this embodiment, multiple steps are further included before obtaining the determination information of the host 400 (step S300). Wherein, step S100 is omitted in FIG. 8 to simplify the drawing, which does not mean that step S100 is not required in this embodiment. In addition, the steps S100, S200, and S300 are the same as the foregoing embodiment, and will not be repeated here. In this embodiment, step S220 is executed after step S200: the protocol judgment controller 120 receives an initialization command from the host 400. Then, as shown in step S230, the protocol determination controller 120 receives a bus reset command (Bus Reset) from the host 400.

值得一提的是,在本實施例中,該協定判斷控制器120認定該排線重置指令後所接收的該主機400的指令即為該判定資訊。所以,於步驟S300中,該協定判斷控制器120即取得該主機400的一判定資訊。亦即,於本實施例的資料讀寫系統的讀寫方法中,於該協定判斷控制器120接收該主機400的一排線重置指令(Bus Reset) (步驟S230)之後,若該資料讀寫系統100'自該主機400依序接收該第一取得說明指令、一設定位址指令與一第二取得說明指令,則該協定判斷控制器120以該第一取得說明指令作為該判定資訊,並據此判斷該主機400使用該第一種通訊協定。接著,該資料讀寫系統100'以該第一種通訊協定與該主機400建立通訊後,該主機400以該第一種通訊協定讀寫電連接於該資料讀寫系統100'的該外部記憶卡300。另一方面,若於步驟S230之後,該資料讀寫系統100'自該主機400依序接收該設定位址指令與該第二取得說明指令,則該協定判斷控制器120以該設定位址指令作為該判定資訊並據此預設該主機400使用該第二種通訊協定。It is worth mentioning that, in this embodiment, the protocol determination controller 120 determines that the command from the host 400 received after the cable reset command is the determination information. Therefore, in step S300, the protocol determination controller 120 obtains a determination information of the host 400. That is, in the reading and writing method of the data reading and writing system of this embodiment, after the protocol determining controller 120 receives a bus reset command (Bus Reset) from the host 400 (step S230), if the data is read The writing system 100' sequentially receives the first obtaining description command, a setting address command, and a second obtaining description command from the host 400, and the protocol judgment controller 120 uses the first obtaining description command as the judgment information, Based on this, it is determined that the host 400 uses the first communication protocol. Then, after the data reading and writing system 100' establishes communication with the host 400 using the first communication protocol, the host 400 uses the first communication protocol to read and write to the external memory electrically connected to the data reading and writing system 100' Card 300. On the other hand, if after step S230, the data reading and writing system 100' sequentially receives the setting address command and the second obtaining description command from the host 400, the protocol determines that the controller 120 uses the setting address command As the determination information, the host 400 is preset to use the second communication protocol based on this.

請再同時參照圖2及圖8,於圖2中判斷該主機400使用該第一種通訊協定或該第二種通訊協定(步驟S400)的方法包括多個步驟。該些步驟如圖8所示,包括:在步驟S300之後,判斷該判定資訊是否為一第一取得說明指令(步驟S410)。若該判定資訊為該第一取得說明指令,則判斷該主機400使用該第一種通訊協定而執行步驟S511,即該微處理單元121列舉該第一通訊協定與該主機400通訊。若該判定資訊不是該第一取得說明指令,則預設該主機400使用該第二種通訊協定,執行步驟S512,即該微處理單元121列舉該第二通訊協定與該主機400通訊。Please refer to FIG. 2 and FIG. 8 at the same time. In FIG. 2, the method of judging that the host 400 uses the first communication protocol or the second communication protocol (step S400) includes multiple steps. These steps are shown in FIG. 8 and include: after step S300, determining whether the determination information is a first obtaining instruction command (step S410). If the determination information is the first acquisition instruction, it is determined that the host 400 uses the first communication protocol and executes step S511, that is, the micro-processing unit 121 lists the first communication protocol to communicate with the host 400. If the determination information is not the first obtaining instruction command, the host 400 is preset to use the second communication protocol, and step S512 is executed, that is, the micro-processing unit 121 lists the second communication protocol to communicate with the host 400.

圖10顯示根據本揭示的一實施例中資料讀寫系統的讀寫方法的時序示意圖。圖11顯示根據本揭示的又一實施例中資料讀寫系統的讀寫方法的時序示意圖。圖12顯示根據本揭示的再一實施例中資料讀寫系統的讀寫方法的時序示意圖。其中,圖10是以主機400運行視窗7(Window 7)作業系統為例的時序示意圖。於此狀態下,該主機400是使用第一種通訊協定,即MSC協定。此外,圖11是以主機400使用iOS作業系統的平板電腦、手持通訊裝置、智慧型手機等為例的時序示意圖。於此狀態下,該主機400是使用第二種通訊協定,即EAN協定。再者,圖12是以主機400運行視窗10(Window 10)作業系統、或麥金塔(MacOS)作業系統的電腦、或是運行安卓(Android)作業系統的手持通訊裝置、智慧型手機為例的時序示意圖。於此狀態下該主機400亦是使用第一種通訊協定,即MSC協定。FIG. 10 shows a timing diagram of the reading and writing method of the data reading and writing system according to an embodiment of the present disclosure. FIG. 11 shows a timing diagram of a reading and writing method of the data reading and writing system according to another embodiment of the present disclosure. FIG. 12 shows a timing diagram of a reading and writing method of the data reading and writing system according to still another embodiment of the present disclosure. Wherein, FIG. 10 is a timing diagram of an example in which the host 400 runs the Window 7 operating system. In this state, the host 400 uses the first communication protocol, namely the MSC protocol. In addition, FIG. 11 is a timing diagram of an example of a tablet computer, a handheld communication device, a smart phone, etc., where the host 400 uses the iOS operating system. In this state, the host 400 uses the second communication protocol, namely the EAN protocol. Furthermore, FIG. 12 is an example of a computer running a Windows 10 (Window 10) operating system or a Macintosh (MacOS) operating system, or a handheld communication device or a smart phone running an Android operating system on the host 400 Schematic diagram of the timing sequence. In this state, the host 400 also uses the first communication protocol, namely the MSC protocol.

由圖10、圖11及圖12這三種不同的例子中可以看到,在供電後的初始幾個步驟是相同的。即該資料讀寫系統100'與該主機400連接後,依序接收該主機400發送的初始化指令與排線重置指令(如圖2的步驟S100、S200及圖8的步驟S220及S230)。回到圖10、圖11及圖12,在初始幾個步驟之後,應用不同的作業系統的主機400即可能會有不同的時序步驟。進一步地,比較圖10、圖11、圖12可知,圖10的主機於執行供電、初始化指令、排線重置指令,並與資料讀寫系統進行傳輸速度協商之後係接著發送第一取得說明指令。與圖10之時序示意圖不同的是,於圖11及圖12之時序示意圖中,主機於執行供電、初始化指令、排線重置指令,並與資料讀寫系統進行傳輸速度協商之後則是發送設定位址指令。因此,為有效判斷該主機所使用的通訊協定,本實施例係定義於該排線重置指令後所發送的一指令為該判定資訊。換言之,在主機發送排線重置指令之後,本實施例的協定判斷控制器120即認定該主機400於該排線重置指令後所發送的一指令為該判定資訊。From the three different examples shown in Figure 10, Figure 11 and Figure 12, it can be seen that the initial steps after power supply are the same. That is, after the data reading and writing system 100' is connected to the host 400, it sequentially receives the initialization command and the cable reset command sent by the host 400 (steps S100 and S200 in FIG. 2 and steps S220 and S230 in FIG. 8). Returning to FIG. 10, FIG. 11, and FIG. 12, after the first few steps, the host 400 using different operating systems may have different timing steps. Further, comparing Figure 10, Figure 11, Figure 12, it can be seen that the host in Figure 10 executes the power supply, initialization command, cable reset command, and negotiates the transmission speed with the data reading and writing system, and then sends the first acquisition instruction command. . Different from the timing diagram of Figure 10, in the timing diagrams of Figures 11 and 12, the host sends settings after executing power supply, initialization commands, and cable reset commands, and after negotiating transmission speed with the data reading and writing system. Address instructions. Therefore, in order to effectively determine the communication protocol used by the host, this embodiment defines a command sent after the cable reset command as the determination information. In other words, after the host sends the cable reset command, the protocol determination controller 120 of this embodiment recognizes that a command sent by the host 400 after the cable reset command is the determination information.

請再一併參照圖8與圖10,於本揭示其中之一實施例中,於該主機400發送該排線重置指令後,當該資料讀寫系統100'自該主機400依序接收該第一取得說明指令、一設定位址指令與一第二取得說明指令時,而該協定判斷控制器120會以該排線重置指令後的該第一取得說明指令作為該判定資訊,隨即該協定判斷控制器120依據該判定資訊判斷該主機400使用該第一種通訊協定(如圖8之步驟S410與步驟S511)。由上文可知,圖10所示的主機400使用例如是MSC協定的第一種通訊協定。換言之,本實施例的資料讀寫系統100'即可辨識本實施例的主機400係運行視窗7(Window 7)作業系統的設備。Please refer to FIGS. 8 and 10 together. In one of the embodiments of the present disclosure, after the host 400 sends the cable reset command, when the data reading and writing system 100' sequentially receives the data from the host 400 When the first obtaining description command, a setting address command, and a second obtaining description command, the protocol judgment controller 120 will use the first obtaining description command after the cable reset command as the judgment information, and then the The protocol determination controller 120 determines that the host 400 uses the first communication protocol according to the determination information (step S410 and step S511 in FIG. 8). It can be seen from the above that the host 400 shown in FIG. 10 uses the first communication protocol, such as the MSC protocol. In other words, the data reading and writing system 100' of this embodiment can recognize that the host 400 of this embodiment is a device running a Window 7 operating system.

另外,請再參照圖8、圖11及12,由上文可知,相較於圖10之時序示意圖,於圖11及圖12之時序示意圖中,主機於執行供電、初始化指令、排線重置指令,並與資料讀寫系統進行傳輸速度協商之後則是發送設定位址指令與該第二取得說明指令。亦即,圖11及12的實施例於該主機400發送該排線重置指令後,該資料讀寫系統100'係自該主機400依序接收該設定位址指令與該第二取得說明指令。因此,該協定判斷控制器120會以該排線重置指令後的該設定位址指令為該判定資訊,隨即該協定判斷控制器120依據該判定資訊預設該主機400使用該第二種通訊協定(如圖8之步驟S410與步驟S512)。亦即,在以設定位址指令為該判定資訊的判斷過程中,使用iOS作業系統的裝置、運行視窗10(Window 10)作業系統、或麥金塔(MacOS)作業系統的電腦、或是運行安卓(Android)作業系統的裝置都會暫時被認定是使用第二種通訊協定的裝置。In addition, please refer to Figures 8, 11 and 12 again. As can be seen from the above, compared to the timing diagram of Figure 10, in the timing diagrams of Figures 11 and 12, the host performs power supply, initialization commands, and cable reset. After the transmission speed is negotiated with the data read-write system, the address setting instruction and the second acquisition instruction are sent. That is, in the embodiment of FIGS. 11 and 12, after the host 400 sends the cable reset command, the data reading and writing system 100' receives the set address command and the second get description command from the host 400 in sequence . Therefore, the protocol determination controller 120 uses the setting address command after the cable reset command as the determination information, and then the protocol determination controller 120 presets the host 400 to use the second type of communication based on the determination information. Agreement (step S410 and step S512 in FIG. 8). That is, in the judgment process using the setting address command as the judgment information, the device using the iOS operating system, the computer running the Windows 10 (Window 10) operating system, or the Macintosh (MacOS) operating system, or running Android operating system devices will be temporarily recognized as devices using the second communication protocol.

進一步地說,在以該設定位址指令為該判定資訊的情況下,該主機400可能是運行iOS作業系統的平板電腦、手持通訊裝置、智慧型手機等裝置,其與資料讀寫系統間的作業時序即如圖11所示,該些裝置係使用該第二種通訊協定。當然,該主機400亦可能是運行視窗10(Window 10)作業系統、或麥金塔(MacOS)作業系統的電腦、或是運行安卓(Android)作業系統的手持通訊裝置、智慧型手機,其與資料讀寫系統間的作業時序即如圖12所示,該些裝置係使用該第一種通訊協定。值得一提的是,雖資料讀寫系統以該設定位址指令為該判定資訊而暫時判斷該主機400使用該第二種通訊協定。然而,該些運行視窗10(Window 10)作業系統、或麥金塔(MacOS)作業系統的電腦、或是運行安卓(Android)作業系統的手持通訊裝置、智慧型手機係使用該第一種通訊協定。也就是說,圖11所繪示的作業時序與圖12所繪示的作業時序係分別屬於不同的通訊協定。關於如何進一步依據圖11所繪示的作業時序與圖12所繪示的作業時序分別判斷其使用的通訊協定,本揭示會在下文中作詳細說明。Furthermore, in the case where the address setting command is the determination information, the host 400 may be a tablet computer, a handheld communication device, a smart phone, etc. running the iOS operating system, which is connected to the data reading and writing system. The operation sequence is shown in Fig. 11, and these devices use the second communication protocol. Of course, the host 400 may also be a computer running Windows 10 (Window 10) operating system, or Macintosh (MacOS) operating system, or a handheld communication device or smart phone running Android (Android) operating system, which is compatible with The operation sequence between the data reading and writing systems is shown in FIG. 12, and these devices use the first communication protocol. It is worth mentioning that although the data read-write system uses the setting address command as the determination information to temporarily determine that the host 400 uses the second communication protocol. However, these computers running Windows 10 (Window 10) operating system, or MacOS (MacOS) operating system, or handheld communication devices and smart phones running Android (Android) operating system use this first type of communication. agreement. In other words, the operation sequence shown in FIG. 11 and the operation sequence shown in FIG. 12 belong to different communication protocols. Regarding how to further determine the communication protocol used according to the operation sequence shown in FIG. 11 and the operation sequence shown in FIG. 12, the disclosure will be described in detail below.

承上所述,在本揭示中該判定資訊為該設定位址指令的情況下,主機400與資料讀寫系統100'之間會有圖11及圖12這兩類的作業時序,一類為例如是前述之使用iOS作業系統的主機400與資料讀寫系統100'間的作業時序(如圖11所示),另一類則為前述之使用視窗10(Window 10)等作業系統的主機400與資料讀寫系統100'間的的作業時序(如圖12所示)。考量主機400與資料讀寫系統100'之間會有圖11及圖12這兩類的作業時序,因此本發明的協定判斷控制器120會在此先預設該主機400使用該第二種通訊協定而列舉第二種通訊協定以嘗試與主機通訊(如步驟S512所示),而在後續再對主機400所使用的通訊協定種類作進一步地判別。在此預設該主機400使用該第二種通訊協定(EAN協定)而不是第一種通訊協定(MSC協定)的理由類似於前述說明,本文在此即不再贅述。Based on the above, in the case where the determination information is the address setting command in the present disclosure, there will be two types of operation timings shown in FIG. 11 and FIG. 12 between the host 400 and the data reading and writing system 100'. One type is, for example, It is the operation sequence between the aforementioned host 400 using the iOS operating system and the data reading and writing system 100' (as shown in Figure 11), and the other is the aforementioned host 400 and data using operating systems such as Window 10 (Window 10) The operation sequence between the reading and writing system 100' (as shown in FIG. 12). Considering that there are two types of operation timings shown in FIGS. 11 and 12 between the host 400 and the data reading and writing system 100', the protocol determination controller 120 of the present invention will first preset the host 400 to use the second type of communication here. Protocols list the second communication protocol to try to communicate with the host (as shown in step S512), and then the type of communication protocol used by the host 400 will be further judged later. Here, it is assumed that the reason why the host 400 uses the second communication protocol (EAN protocol) instead of the first communication protocol (MSC protocol) is similar to the foregoing description, and will not be repeated here.

由圖11與圖12可知,當該協定判斷控制器120預設主機400使用第二種通訊協定而嘗試進行通訊後,基於圖11所示的主機400是定義使用iOS作業系統,而主機400於此狀態下即是使用第二種通訊協定(即EAN協定),因此該協定判斷控制器120會在接收該主機400的該第二取得說明指令後,接收一設定組態指令及一協定執行認證指令(RequestAuthenticationCertificate)。對應地,如圖12所示,若該主機400實際上並非使用該第二種通訊協定,則該主機400不會發送該協定執行認證指令。所以,本發明係利用這項差異來分辨主機使用的通訊協定。上述之分辨主機使用的通訊協定的步驟即圖8的步驟S520所示:該微處理單元121判斷是否於一預設時間內接收到該主機400發送的一協定執行認證指令。It can be seen from FIGS. 11 and 12 that when the protocol determines that the controller 120 presets the host 400 to use the second communication protocol to try to communicate, based on the definition of the host 400 shown in FIG. 11 that the iOS operating system is used, and the host 400 is used In this state, the second communication protocol (ie EAN protocol) is used. Therefore, the protocol judgment controller 120 will receive a setting configuration command and a protocol execution authentication after receiving the second obtaining instruction command from the host 400 Command (RequestAuthenticationCertificate). Correspondingly, as shown in FIG. 12, if the host 400 does not actually use the second communication protocol, the host 400 will not send the protocol execution authentication command. Therefore, the present invention uses this difference to distinguish the communication protocol used by the host. The above-mentioned step of identifying the communication protocol used by the host is shown in step S520 in FIG. 8: the micro-processing unit 121 determines whether a protocol execution authentication command sent by the host 400 is received within a preset time.

如圖8所示,若於該預設時間內接收到該主機400發送的該協定執行認證指令,則確認該主機400使用該第二種通訊協定且執行步驟S540,即該主機400以該第二種通訊協定讀寫該外部記憶卡300。上述細節亦可參照圖11,資料讀寫系統收到該主機400發送的該協定執行認證指令後,回覆認證序號。如此即完成第二種通訊協定,即EAN協定的列舉步驟,主機可以開始在EAN協定架構下讀寫記憶卡。同樣地,於圖8亦可清楚得知,若於該預設時間內未接收到該主機400發送的該協定執行認證指令,則該主機400並非使用該第二種通訊協定,此時執行如步驟S530所示:該資料讀寫系統100'改以列舉該第一種通訊協定與該主機400進行通訊。即當該協定判斷控制器120等待該主機400的該協定執行認證指令超過一預設時間後,例如300毫秒(ms),該微處理單元121會中斷與主機400的連線,並重新連接。接著,該微處理單元121會直接改以列舉該第一種通訊協定與該主機400進行通訊。上述細節亦可由圖12得知,本文在此不再贅述。As shown in FIG. 8, if the protocol execution authentication command sent by the host 400 is received within the preset time, it is confirmed that the host 400 uses the second communication protocol and step S540 is executed, that is, the host 400 uses the first communication protocol. Two communication protocols read and write the external memory card 300. Refer to FIG. 11 for the above details. After receiving the protocol execution authentication command sent by the host 400, the data reading and writing system responds with the authentication serial number. In this way, the second communication protocol, the enumeration step of the EAN protocol, is completed, and the host can start to read and write the memory card under the EAN protocol framework. Similarly, it can be clearly seen in FIG. 8 that if the protocol execution authentication command sent by the host 400 is not received within the preset time, the host 400 does not use the second communication protocol, and executes such as In step S530, the data reading and writing system 100' is changed to list the first communication protocol to communicate with the host 400. That is, when the protocol determination controller 120 waits for the protocol execution authentication command of the host 400 for more than a preset time, such as 300 milliseconds (ms), the micro-processing unit 121 will interrupt the connection with the host 400 and reconnect. Then, the micro-processing unit 121 directly enumerates the first communication protocol to communicate with the host 400. The above-mentioned details can also be known from FIG. 12, which will not be repeated here.

承上所述,該資料讀寫系統100'改以列舉該第一種通訊協定與該主機400進行通訊的方式如圖9所示。詳細地說,若於該預設時間內未接收到該主機400發送的該協定執行認證指令,會如步驟S531所示:該資料讀寫系統100'中斷與該主機400的通訊。接著,該資料讀寫系統100'便重新列舉該第一種通訊協定與該主機400通訊。該資料讀寫系統100'列舉該第一種通訊協定與該主機400通訊包括多個步驟。請一併參照圖12,這些步驟包括如步驟S532所示:該協定判斷控制器120重新接收該主機400的該排線重置指令。接著如步驟S533所示:該協定判斷控制器120重新接收該主機400的設定位址指令。由於此時已確認主機是使用第一種通訊協定,即MSC協定且是運行視窗10(Window 10)作業系統、或麥金塔(MacOS)作業系統的電腦、或是運行安卓(Android)作業系統的手持通訊裝置、智慧型手機,因此接下來便沒有判斷的必要,而直接執行如步驟S534所示:該協定判斷控制器120重新接收該主機400的第二取得說明指令。接著,後續再執行步驟S535:該協定判斷控制器120重新接收該主機400的設定組態指令;最後,如步驟S536所示:該主機400以該第一種通訊協定讀寫該外部記憶卡300。需說明的是,圖9係省略步驟S520之前的步驟以簡化流程,所省略的步驟可參照圖2、圖8及其說明,於此不再贅述。另外,圖12所示之主機400與資料讀寫系統100'間的作業時序係說明於等待該協定執行認證指令超過一預設時間後,中斷通訊並重新改以列舉該第一種通訊協定來與該主機400進行通訊。資料讀寫系統100'列舉該第一種通訊協定與該主機400進行通訊的步驟已於上文作詳細說明,本發明在此亦不再贅述。Based on the foregoing, the data reading and writing system 100' is modified to list the first communication protocol to communicate with the host 400, as shown in FIG. 9. In detail, if the protocol execution authentication command sent by the host 400 is not received within the preset time, as shown in step S531: the data reading and writing system 100' interrupts the communication with the host 400. Then, the data reading and writing system 100' re-enumerates the first communication protocol to communicate with the host 400. The data reading and writing system 100' enumerates that the communication between the first communication protocol and the host 400 includes multiple steps. Please also refer to FIG. 12, these steps include as shown in step S532: the protocol determination controller 120 receives the cable reset command from the host 400 again. Then, as shown in step S533: the protocol judgment controller 120 receives the address setting instruction of the host 400 again. At this time, it has been confirmed that the host uses the first communication protocol, that is, the MSC protocol and is a computer running Windows 10 (Window 10) operating system, or Macintosh (MacOS) operating system, or running Android (Android) operating system As shown in step S534, the protocol determination controller 120 receives the second obtaining instruction from the host 400 again. Then, step S535 is subsequently executed: the protocol judgment controller 120 receives the configuration command of the host 400 again; finally, as shown in step S536: the host 400 reads and writes the external memory card 300 using the first communication protocol . It should be noted that FIG. 9 omits the steps before step S520 to simplify the process. For the omitted steps, please refer to FIG. 2 and FIG. 8 and the description thereof, which will not be repeated here. In addition, the operation sequence between the host 400 and the data reading and writing system 100' shown in FIG. 12 illustrates that after waiting for the protocol to execute the authentication command for more than a preset time, the communication is interrupted and changed to enumerate the first communication protocol. Communicate with the host 400. The steps of the data reading and writing system 100' enumerating the first communication protocol to communicate with the host 400 have been described in detail above, and the present invention will not be repeated here.

請參照圖13,圖13揭示本實施例中一讀卡機的讀寫方法的流程實例。其中,第一種通訊協定例如為MSC協定,第二種通訊協定例如為EAN協定。主機400可能為運行視窗7(Window 7)作業系統、視窗10(Window 10)作業系統、或麥金塔(MacOS)作業系統的電腦;或是運行安卓(Android)作業系統的手持通訊裝置、智慧型手機;亦或是使用iOS作業系統的平板電腦、手持通訊裝置、智慧型手機等。本實施例的讀卡機的讀寫方法說明如下:首先,如步驟B10所示:主機對讀卡機供電。接著,如步驟B20所示:主機向資料讀寫系統發送初始化指令。再來,如步驟B30所示:讀卡機由接收指令的種類與順序判斷主機是否使用MSC協定。即是否依序於接到一排線重置指令後接收第一取得說明指令,若依序於接到一排線重置指令後接收到第一取得說明指令,則可判定主機是運行視窗7(Window 7)作業系統的電腦系統且使用MSC協定。若主機使用MSC協定,則進行如步驟B42所示:讀卡機以MSC協定與主機建立通訊,並接著執行如步驟B62所示:主機以MSC協定存取SD記憶卡。若主機不是使用MSC協定,則進行步驟B41,即讀卡機以EAN協定與主機建立通訊。Please refer to FIG. 13. FIG. 13 shows an example of the flow of the reading and writing method of a card reader in this embodiment. Among them, the first type of communication protocol is, for example, the MSC protocol, and the second type of communication protocol is, for example, the EAN protocol. The host 400 may be a computer running Windows 7 (Window 7) operating system, Windows 10 (Window 10) operating system, or Macintosh (MacOS) operating system; or a handheld communication device running Android (Android) operating system, smart Mobile phones; or tablets, handheld communication devices, smart phones, etc. that use the iOS operating system. The reading and writing method of the card reader in this embodiment is described as follows: First, as shown in step B10: the host supplies power to the card reader. Then, as shown in step B20: the host sends an initialization command to the data reading and writing system. Next, as shown in step B30: the card reader judges whether the host uses the MSC protocol according to the type and order of the received instructions. That is, whether to receive the first get description command after receiving a cable reset command in sequence, if the first get description command is received after receiving a cable reset command in sequence, it can be determined that the host is running Windows 7 (Window 7) The computer system of the operating system and uses the MSC protocol. If the host uses the MSC protocol, proceed as shown in step B42: the card reader establishes communication with the host using the MSC protocol, and then executes as shown in step B62: the host accesses the SD memory card using the MSC protocol. If the host does not use the MSC protocol, proceed to step B41, that is, the card reader establishes communication with the host using the EAN protocol.

在此是預設主機是使用EAN協定,但就如前述說明,由於在這個步驟時仍可能存在使用不同通訊協定的主機,因此,此處先嘗試以EAN協定來建立通訊。接著讀卡機便進行確認列舉EAN協定是否成功(步驟B51)。若列舉成功,則可確定主機是使用iOS作業系統的平板電腦、手持通訊裝置、或智慧型手機,接著執行如步驟B61所示:主機以EAN協定存取SD記憶卡。若列舉失敗,則可確定主機是運行視窗10(Window 10)作業系統、或麥金塔(MacOS)作業系統的電腦;或是運行安卓(Android)作業系統的手持通訊裝置、或智慧型手機,接著執行如步驟B52所示:讀卡機中斷通訊後執行排線重置指令,並回到步驟B42,即讀卡機以MSC協定與主機建立通訊。Here, the default host uses the EAN protocol, but as described above, since there may still be hosts that use different communication protocols at this step, we will try to establish communication with the EAN protocol first. The card reader then confirms whether the enumeration of the EAN protocol is successful (step B51). If the enumeration is successful, it can be determined that the host is a tablet computer, a handheld communication device, or a smart phone using the iOS operating system, and then perform step B61: the host accesses the SD memory card using the EAN protocol. If the listing fails, it can be determined that the host is a computer running Window 10 operating system or MacOS operating system; or a handheld communication device or smart phone running Android operating system. Then execute step B52: the card reader interrupts the communication and executes the cable reset command, and returns to step B42, that is, the card reader establishes communication with the host through the MSC protocol.

以上僅舉兩種通訊協定為例,本揭示不限制通訊協定的數目與種類。三種以上的通訊協定亦可依本揭示的精神進行簡單的適當修飾。The above only cited two communication protocols as examples, and the present disclosure does not limit the number and types of communication protocols. Three or more communication protocols can also be simply and appropriately modified in accordance with the spirit of the present disclosure.

於本揭示其中之另一實施例中,電力傳送模組是可選配的模組。詳細地說,該協定判斷控制器包括一微處理單元,以於該資料讀寫系統連接該主機後,判斷該資料讀寫系統是否具有電力傳送模組。當該資料讀寫系統具有該電力傳送模組時,請參照圖3至圖6及上述說明,該微處理單元要求該電力傳送模組提供取得的產品識別資料與供應商識別資料,藉以判斷該主機是使用該第一種通訊協定或該第二種通訊協定。當該資料讀寫系統不具有該電力傳送模組時,請參照圖7至圖13及對應的說明,該微處理單元以該主機的指令種類與順序為該判定資訊,該微處理單元直接接收並判斷該主機的該判定資訊。In another embodiment of the present disclosure, the power transmission module is an optional module. In detail, the protocol judgment controller includes a micro-processing unit for judging whether the data reading and writing system has a power transmission module after the data reading and writing system is connected to the host. When the data read-write system has the power transmission module, please refer to Figures 3 to 6 and the above description. The micro-processing unit requires the power transmission module to provide the obtained product identification data and supplier identification data to determine the The host uses the first communication protocol or the second communication protocol. When the data reading and writing system does not have the power transmission module, please refer to Figure 7 to Figure 13 and the corresponding description. The micro processing unit uses the command type and sequence of the host as the determination information, and the micro processing unit directly receives And determine the determination information of the host.

請參照圖14,圖14顯示根據本揭示的一實施例中資料讀寫系統的讀寫方法的部分流程示意圖,需說明的是,圖14係省略步驟S200之前的步驟、步驟S210之後的步驟以及步驟S220之後的步驟以簡化流程圖。所省略的步驟可參照圖2、圖4、圖8及圖9及說明,於此不再贅述。本實施例的資料讀寫系統的讀寫方法,與前述實施例不同的是:相較於圖2的實施方法,本實施例在使該資料讀寫系統與主機電性連接(步驟S200)之後更包括如步驟S201所示:該協定判斷控制器判斷該資料讀寫系統是否具有一電力傳送模組。其中,若判斷該資料讀寫系統具有該電力傳送模組,則執行如步驟S210所示:該電力傳送微處理單元122a向該主機400要求該判定資訊及後續步驟。若判斷該資料讀寫系統不具有該電力傳送模組,則執行如步驟S220所示:該協定判斷控制器120接收該主機400的一初始化指令及後續步驟。相關說明如前所述,於此不再贅述。Please refer to FIG. 14. FIG. 14 shows a partial flow diagram of the reading and writing method of the data reading and writing system according to an embodiment of the present disclosure. It should be noted that FIG. 14 omits the steps before step S200, the steps after step S210, and The steps after step S220 are to simplify the flowchart. For the omitted steps, please refer to FIG. 2, FIG. 4, FIG. 8 and FIG. 9 and description, and will not be repeated here. The reading and writing method of the data reading and writing system of this embodiment is different from the previous embodiment: Compared with the implementation method of FIG. 2, this embodiment electrically connects the data reading and writing system to the host (step S200). It further includes step S201: the protocol judgment controller judges whether the data reading and writing system has a power transmission module. Wherein, if it is determined that the data reading and writing system has the power transmission module, the execution is as shown in step S210: the power transmission micro-processing unit 122a requests the host 400 for the determination information and subsequent steps. If it is determined that the data reading and writing system does not have the power transmission module, the process is performed as shown in step S220: the protocol determination controller 120 receives an initialization command from the host 400 and subsequent steps. Relevant descriptions are as mentioned before, and will not be repeated here.

具體的,請參照圖15,圖15揭示本實施例中一讀卡機的讀寫方法的流程實例。其中第一種通訊協定例如為MSC協定,第二種通訊協定例如為EAN協定。主機400可能為運行視窗7(Window 7)作業系統、視窗10(Window 10)作業系統、或麥金塔(MacOS)作業系統的電腦;或是運行安卓(Android)作業系統的手持通訊裝置、智慧型手機;亦或是使用iOS作業系統的平板電腦、手持通訊裝置、智慧型手機等。與圖6及圖13不同的是,本實例的讀卡機包括如步驟C30所示:判斷讀卡機是否具有電力傳送模組。其他步驟則與圖6或圖13類似,若具有電力傳送模組,則執行如步驟C40所示:電力傳送模組向主機發送取得製造資訊指令等步驟,相關說明可參照圖6及其說明,於此不再贅述。若不具有電力傳送模組,則執行如步驟C62所示:讀卡機由接收指令種類與順序判斷主機是否使用MSC協定等步驟,相關說明可參照圖13及其說明,於此不再贅述。Specifically, please refer to FIG. 15. FIG. 15 discloses an example of a flow of a method for reading and writing of a card reader in this embodiment. The first communication protocol is, for example, the MSC protocol, and the second communication protocol is, for example, the EAN protocol. The host 400 may be a computer running Windows 7 (Window 7) operating system, Windows 10 (Window 10) operating system, or Macintosh (MacOS) operating system; or a handheld communication device running Android (Android) operating system, smart Mobile phones; or tablets, handheld communication devices, smart phones, etc. that use the iOS operating system. Different from FIG. 6 and FIG. 13, the card reader of this example includes step C30: determining whether the card reader has a power transmission module. The other steps are similar to Fig. 6 or Fig. 13. If there is a power transmission module, perform the steps shown in step C40: the power transmission module sends a command to obtain manufacturing information to the host. For related description, please refer to Fig. 6 and its description. I will not repeat them here. If it does not have a power transmission module, perform steps as shown in step C62: the card reader judges whether the host uses the MSC protocol according to the type and sequence of received commands. For related descriptions, please refer to FIG. 13 and its description, which will not be repeated here.

相較於先前技術,本揭示的讀卡機、資料讀寫系統及其讀寫方法藉由該協定判斷控制器取得該主機的一判定資訊,以判斷該主機使用該第一種通訊協定或該第二種通訊協定,並列舉該第一種通訊協定或該第二種通訊協定來與該主機通訊。如此可自動判斷通訊協定並進行通訊,不需要使用者進行選擇通訊協定的動作,亦避免使用者選擇錯誤的通訊協定。Compared with the prior art, the card reader, data reading and writing system and the reading and writing method of the present disclosure obtain a determination information of the host through the protocol determination controller to determine whether the host uses the first communication protocol or the The second communication protocol, and enumerate the first communication protocol or the second communication protocol to communicate with the host. In this way, the communication protocol can be automatically determined and the communication can be carried out, without the user having to select the communication protocol, and the user is also prevented from selecting the wrong communication protocol.

儘管已經相對於一個或多個實現方式顯示並描述了本揭示,但是本領域技術人員基於對本說明書和附圖的閱讀和理解將會想到等價變型和修改。本揭示包括所有這樣的修改和變型,並且僅由所附發明申請專利範圍限制。特別地關於由上述元件執行的各種功能,用於描述這樣的元件的術語旨在對應於執行所述元件的指定功能(例如其在功能上是等價的)的任意元件(除非另外指示),即使在結構上與執行本文所示的本說明書的示範性實現方式中的功能的公開結構不等同。此外,儘管本說明書的特定特徵已經相對於若干實現方式中的僅一個被公開,但是這種特徵可以與如可以對給定或特定應用而言是期望和有利的其他實現方式的一個或多個其他特徵組合。而且,就術語"包括"、"具有"、"含有"或其變形被用在具體實施方式或權利要求中而言,這樣的術語旨在以與術語"包含"相似的方式包括。Although the present disclosure has been shown and described with respect to one or more implementation manners, those skilled in the art will think of equivalent variations and modifications based on the reading and understanding of the specification and the drawings. The present disclosure includes all such modifications and variations, and is only limited by the scope of the appended invention application patent. Especially with regard to the various functions performed by the above-mentioned elements, the terms used to describe such elements are intended to correspond to any element (unless otherwise indicated) that performs the specified function of the element (for example, it is functionally equivalent), Even if the structure is not equivalent to the disclosed structure that performs the functions in the exemplary implementation of the present specification shown herein. In addition, although a specific feature of this specification has been disclosed with respect to only one of several implementations, this feature can be combined with one or more of other implementations that may be desirable and advantageous for a given or specific application. Other feature combinations. Moreover, as far as the terms "including", "having", "containing" or their variants are used in specific embodiments or claims, such terms are intended to be included in a similar manner to the term "comprising".

以上僅是本揭示的優選實施方式,應當指出,對於本領域普通技術人員,在不脫離本揭示原理的前提下,還可以做出若干改進和潤飾,這些改進和潤飾也應視為本揭示的保護範圍。The above are only the preferred embodiments of the present disclosure. It should be pointed out that for those of ordinary skill in the art, without departing from the principles of the present disclosure, several improvements and modifications can be made, and these improvements and modifications should also be regarded as the present disclosure. protected range.

100、100’ 資料讀寫系統                               110 通訊介面控制器 120 協定判斷控制器                                         121 微處理單元 130 記憶卡控制器                                             140 緩衝單元 151 第一快閃儲存單元                                     152第二快閃儲存單元 122 電力傳送模組                                             122a 電力傳送微處理單元 122b C型及雙向標記碼實體層                         122c 序列周邊介面控制器 200 USB通訊介面                                             211 USB收發器單元介面 212 高速/全速傳輸實體層                                221 超高速裝置 222 超高速傳輸實體層                                     300 外部記憶卡 400 主機                                                            1000、1000’ 讀卡機 S100~S540、A10~A62、B10~B62、C10~C82 步驟方塊 100, 100' data reading and writing system 110 communication interface controller 120 Agreement judgment controller 121 Micro-processing unit 130 Memory card controller 140 Buffer unit 151 First flash storage unit 152 Second flash storage unit 122 Power Transmission Module 122a Power Transmission Microprocessing Unit 122b Type C and two-way mark code entity layer 122c serial peripheral interface controller 200 USB communication interface 211 USB transceiver unit interface 212 High-speed/full-speed transmission entity layer 221 Ultra-high-speed devices 222 Ultra-high-speed transmission entity layer 300 external memory cards 400 host 1000, 1000 card reader S100~S540, A10~A62, B10~B62, C10~C82 step block

圖1顯示根據本揭示的一實施例中資料讀寫系統與讀卡機的結構示意圖;FIG. 1 shows a schematic diagram of the structure of a data reading and writing system and a card reader according to an embodiment of the present disclosure;

圖2顯示根據本揭示的一實施例中資料讀寫系統的讀寫方法的流程示意圖;2 shows a schematic flow chart of a reading and writing method of the data reading and writing system according to an embodiment of the present disclosure;

圖3顯示根據本揭示的一實施例中資料讀寫系統與讀卡機的結構示意圖;FIG. 3 shows a schematic diagram of the structure of a data reading and writing system and a card reader according to an embodiment of the present disclosure;

圖4顯示根據本揭示的一實施例中資料讀寫系統的讀寫方法的流程示意圖;4 shows a schematic flow chart of a reading and writing method of a data reading and writing system according to an embodiment of the present disclosure;

圖5顯示根據本揭示的一實施例中資料讀寫系統的讀寫方法的時序示意圖;FIG. 5 shows a timing diagram of a reading and writing method of the data reading and writing system according to an embodiment of the present disclosure;

圖6顯示根據本揭示的一實施例中資料讀寫系統的讀寫方法的流程示意圖;FIG. 6 shows a schematic flow chart of a reading and writing method of the data reading and writing system according to an embodiment of the present disclosure;

圖7顯示根據本揭示的一實施例的資料讀寫系統與讀卡機的結構示意圖;FIG. 7 shows a schematic diagram of the structure of a data reading and writing system and a card reader according to an embodiment of the present disclosure;

圖8顯示根據本揭示的一實施例中資料讀寫系統的讀寫方法的部分流程示意圖;FIG. 8 shows a schematic diagram of a partial flow of a reading and writing method of the data reading and writing system according to an embodiment of the present disclosure;

圖9顯示根據本揭示的一實施例中資料讀寫系統的讀寫方法的部分流程示意圖;FIG. 9 shows a schematic diagram of a partial flow of a reading and writing method of a data reading and writing system according to an embodiment of the present disclosure;

圖10顯示根據本揭示的一實施例中資料讀寫系統的讀寫方法的時序示意圖;FIG. 10 shows a timing diagram of a reading and writing method of the data reading and writing system according to an embodiment of the present disclosure;

圖11顯示根據本揭示的又一實施例中資料讀寫系統的讀寫方法的時序示意圖;FIG. 11 shows a timing diagram of a reading and writing method of a data reading and writing system according to another embodiment of the present disclosure;

圖12顯示根據本揭示的再一實施例中資料讀寫系統的讀寫方法的時序示意圖;FIG. 12 shows a timing diagram of a reading and writing method of a data reading and writing system according to still another embodiment of the present disclosure;

圖13顯示根據本揭示的一實施例中資料讀寫系統的讀寫方法的流程示意圖;FIG. 13 shows a schematic flow chart of a reading and writing method of a data reading and writing system according to an embodiment of the present disclosure;

圖14顯示根據本揭示的一實施例中資料讀寫系統的讀寫方法的部分流程示意圖;FIG. 14 shows a schematic diagram of a partial flow of a reading and writing method of a data reading and writing system in an embodiment of the present disclosure;

圖15顯示根據本揭示的一實施例中資料讀寫系統的讀寫方法的流程示意圖。FIG. 15 shows a schematic flowchart of a reading and writing method of the data reading and writing system according to an embodiment of the present disclosure.

100:資料讀寫系統 100: Data reading and writing system

110:通訊介面控制器 110: Communication interface controller

120:協定判斷控制器 120: Protocol Judgment Controller

130:記憶卡控制器 130: memory card controller

300:外部記憶卡 300: External memory card

200:USB通訊介面 200: USB communication interface

400:主機 400: host

1000:讀卡機 1000: card reader

Claims (29)

一種資料讀寫系統,適於與一主機連接,以讓該主機透過該資料讀寫系統對一外部記憶卡進行資料讀寫,其中該主機使用一第一種通訊協定或一第二種通訊協定其中之一,該資料讀寫系統包括: 一協定判斷控制器; 一通訊介面控制器,電連接至該協定判斷控制器,並適於與該主機通訊;以及 一記憶卡控制器,電連接至該協定判斷控制器與該通訊介面控制器,並控制該主機對該外部記憶卡的資料讀寫; 其中該協定判斷控制器取得該主機的一判定資訊,以判斷該主機使用該第一種通訊協定或該第二種通訊協定。 A data reading and writing system suitable for connecting with a host so that the host can read and write data to an external memory card through the data reading and writing system, wherein the host uses a first communication protocol or a second communication protocol One of them, the data reading and writing system includes: A protocol judgment controller; A communication interface controller, electrically connected to the protocol judgment controller, and suitable for communicating with the host; and A memory card controller, electrically connected to the protocol judgment controller and the communication interface controller, and controls the host to read and write data on the external memory card; The protocol determination controller obtains determination information of the host to determine whether the host uses the first communication protocol or the second communication protocol. 如申請專利範圍第1項之資料讀寫系統,其中該協定判斷控制器包括一微處理單元,該微處理單元透過該通訊介面控制器接收該判定資訊,當該主機的該判定資訊為一第一取得說明指令,則該協定判斷控制器判斷該主機使用該第一種通訊協定,該微處理單元列舉該第一通訊協定來與該主機通訊;當該主機的該判定資訊不是該第一取得說明指令,則該協定判斷控制器判斷該主機使用該第二種通訊協定,該微處理單元列舉該第二通訊協定來與該主機通訊。For example, the data reading and writing system of item 1 of the scope of patent application, wherein the protocol determination controller includes a micro-processing unit, and the micro-processing unit receives the determination information through the communication interface controller. When the determination information of the host is a first Upon obtaining a description command, the protocol judgment controller judges that the host uses the first communication protocol, and the micro-processing unit enumerates the first communication protocol to communicate with the host; when the judgment information of the host is not the first obtained Specify the command, the protocol determination controller determines that the host uses the second communication protocol, and the micro-processing unit enumerates the second communication protocol to communicate with the host. 如申請專利範圍第2項之資料讀寫系統,其中當該資料讀寫系統自該主機依序接收該第一取得說明指令、一設定位址指令與一第二取得說明指令時,該判定資訊為該第一取得說明指令,該協定判斷控制器依據該判定資訊判斷該主機使用該第一種通訊協定;當資料讀寫系統自該主機依序接收該設定位址指令與該第二取得說明指令時,該判定資訊為該設定位址指令,該協定判斷控制器依據該判定資訊預設該主機使用該第二種通訊協定。For example, the data reading and writing system of item 2 of the scope of patent application, wherein when the data reading and writing system receives the first obtaining instruction, a setting address instruction, and a second obtaining instruction from the host in sequence, the determination information For the first acquisition instruction, the protocol determination controller determines that the host uses the first communication protocol based on the determination information; when the data reading and writing system sequentially receives the set address instruction and the second acquisition instruction from the host When commanding, the judgment information is the address setting command, and the protocol judgment controller presets the host to use the second communication protocol according to the judgment information. 如申請專利範圍第3項之資料讀寫系統,其中該資料讀寫系統與該主機連接後,依序接收該主機發送的初始化指令與排線重置指令,且該協定判斷控制器認定該主機於該排線重置指令後所發送的一指令為該判定資訊。For example, the data reading and writing system of item 3 of the scope of patent application, wherein after the data reading and writing system is connected to the host, it sequentially receives the initialization command and the cable reset command sent by the host, and the agreement determines that the controller recognizes the host A command sent after the cable reset command is the determination information. 如申請專利範圍第3項之資料讀寫系統,其中當該協定判斷控制器判斷該主機使用該第二種通訊協定進行通訊時,該協定判斷控制器預設會在接收該主機的該第二取得說明指令後,接收一設定組態指令及一協定執行認證指令,當該協定判斷控制器等待該主機的該協定執行認證指令超過一預設時間後,該微處理單元改以列舉該第一種通訊協定與該主機進行通訊。For example, in the data reading and writing system of item 3 of the scope of patent application, when the protocol determining controller determines that the host uses the second communication protocol for communication, the protocol determining controller defaults to receiving the second communication protocol from the host. After obtaining the description command, it receives a configuration command and a protocol execution authentication command. When the protocol judges that the controller waits for the host's protocol execution authentication command for more than a preset time, the micro-processing unit changes to list the first A communication protocol to communicate with the host. 如申請專利範圍第3項之資料讀寫系統,更包括: 一USB收發器單元介面電連接至該通訊介面控制器; 一高速/全速傳輸實體層電連接至該USB收發器單元介面; 一緩衝單元,電連接至該記憶卡控制器以及該通訊介面控制器; 一超高速傳輸實體層; 一超高速裝置,電連接於該超高速傳輸實體層及該緩衝單元;以及 一第一快閃儲存單元,電連接至該微處理單元,且儲存一用以判斷該主機通訊協定的程序, 其中該通訊介面控制器透過該USB收發器單元介面、該高速/全速傳輸實體層、該超高速裝置以及該超高速傳輸實體層來與該主機通訊; 該主機透過該微處理單元的控制來讀寫該外部記憶卡。 For example, the data reading and writing system of item 3 of the scope of patent application includes: A USB transceiver unit interface is electrically connected to the communication interface controller; A high-speed/full-speed transmission physical layer is electrically connected to the USB transceiver unit interface; A buffer unit electrically connected to the memory card controller and the communication interface controller; An ultra-high-speed transmission physical layer; An ultra-high-speed device electrically connected to the ultra-high-speed transmission physical layer and the buffer unit; and A first flash storage unit, electrically connected to the micro-processing unit, and storing a program for determining the communication protocol of the host, The communication interface controller communicates with the host through the USB transceiver unit interface, the high-speed/full-speed transmission physical layer, the ultra-high-speed device, and the ultra-high-speed transmission physical layer; The host reads and writes the external memory card through the control of the micro-processing unit. 如申請專利範圍第1項之資料讀寫系統,其中該協定判斷控制器包括一微處理單元以及一電力傳送微處理單元,當該資料讀寫系統連接該主機後,該電力傳送微處理單元要求該主機提供該判定資訊,該判定資訊為該主機的產品識別資料與供應商識別資料,微處理單元並藉以判斷該主機是使用該第一種通訊協定或該第二種通訊協定。For example, the data read-write system of item 1 of the scope of patent application, wherein the agreement judgment controller includes a micro-processing unit and a power transmission micro-processing unit. When the data read-write system is connected to the host, the power transmission micro-processing unit requires The host provides the determination information, which is the product identification data and supplier identification data of the host, and the micro-processing unit determines whether the host uses the first communication protocol or the second communication protocol. 如申請專利範圍第7項之資料讀寫系統,其中當該微處理單元判斷該主機使用該第一種通訊協定時,該微處理單元控制該介面控制單元列舉該第一種通訊協定與該主機進行通訊;當該微處理單元判斷該主機使用該第二種通訊協定時,該微處理單元控制該介面控制單元列舉該第二種通訊協定與該主機進行通訊,而該主機的產品識別資料與供應商識別資料包括產品資料或作業系統資料。For example, the data reading and writing system of item 7 of the scope of patent application, wherein when the micro-processing unit determines that the host uses the first communication protocol, the micro-processing unit controls the interface control unit to list the first communication protocol and the host To communicate; when the micro-processing unit determines that the host uses the second communication protocol, the micro-processing unit controls the interface control unit to list the second communication protocol to communicate with the host, and the product identification data of the host is Supplier identification information includes product information or operating system information. 如申請專利範圍第7項之資料讀寫系統,還包括一電力傳送模組,該電力傳送模組包括: 該電力傳送微處理單元; 一C型及雙向標記碼實體層;以及 一第二快閃儲存單元,儲存一用以要求該主機提供該判定資訊以決定供電電壓的程序; 其中該電力傳送微處理單元用以控制該C型及雙向標記碼實體層與該主機通訊,該資料讀寫系統更包括: 一USB收發器單元介面電連接至該通訊介面控制器; 一高速/全速傳輸實體層電連接至該USB收發器單元介面; 一緩衝單元,電連接至該記憶卡控制器以及該通訊介面控制器; 一超高速傳輸實體層; 一超高速裝置,電連接於該超高速傳輸實體層及該緩衝單元;以及 一第一快閃儲存單元電連接至該微處理單元,儲存一用以判斷該主機通訊協定的程序, 其中該通訊介面控制器透過該微處理單元的控制來與該主機通訊; 該主機透過該超高速裝置與該超高速傳輸實體層讀寫該外部記憶卡。 For example, the data reading and writing system of item 7 of the scope of patent application also includes a power transmission module, which includes: The power transmission micro-processing unit; A C-type and two-way marking code physical layer; A second flash storage unit, storing a program for requesting the host to provide the determination information to determine the power supply voltage; The power transmission micro-processing unit is used to control the C-type and two-way marking code physical layer to communicate with the host, and the data reading and writing system further includes: A USB transceiver unit interface is electrically connected to the communication interface controller; A high-speed/full-speed transmission physical layer is electrically connected to the USB transceiver unit interface; A buffer unit electrically connected to the memory card controller and the communication interface controller; An ultra-high-speed transmission physical layer; An ultra-high-speed device electrically connected to the ultra-high-speed transmission physical layer and the buffer unit; and A first flash storage unit is electrically connected to the micro-processing unit, and stores a program for determining the host communication protocol, The communication interface controller communicates with the host through the control of the micro-processing unit; The host reads and writes the external memory card through the ultra-high-speed device and the ultra-high-speed transmission physical layer. 如申請專利範圍第1項之資料讀寫系統,其中該協定判斷控制器包括一微處理單元,以於該資料讀寫系統連接該主機後,判斷該資料讀寫系統是否具有一電力傳送模組,當該資料讀寫系統具有該電力傳送模組時,該微處理單元要求該電力傳送模組提供取得的產品識別資料與供應商識別資料,藉以判斷該主機是使用該第一種通訊協定或該第二種通訊協定;當該資料讀寫系統不具有該電力傳送模組時,該微處理單元直接接收並判斷該主機的該判定資訊。For example, the data reading and writing system of item 1 of the scope of patent application, wherein the agreement judgment controller includes a micro-processing unit to judge whether the data reading and writing system has a power transmission module after the data reading and writing system is connected to the host When the data read-write system has the power transmission module, the micro-processing unit requires the power transmission module to provide the obtained product identification data and supplier identification data to determine whether the host uses the first communication protocol or The second communication protocol; when the data reading and writing system does not have the power transmission module, the micro-processing unit directly receives and determines the determination information of the host. 如申請專利範圍第10項之資料讀寫系統,其中當該資料讀寫系統不具有該電力傳送模組時,該微處理單元透過該通訊介面控制器直接接收該主機的該判定資訊,當該主機的該判定資訊為一第一取得說明指令,則該微處理單元判斷該主機使用該第一種通訊協定;當該主機的該判定資訊不是該第一取得說明指令,則該微處理單元判斷該主機使用該第二種通訊協定進行通訊。For example, the data read-write system of item 10 of the scope of patent application, when the data read-write system does not have the power transmission module, the micro-processing unit directly receives the determination information of the host through the communication interface controller. If the determination information of the host is a first acquisition instruction, the micro-processing unit determines that the host uses the first communication protocol; when the determination information of the host is not the first acquisition instruction, the micro-processing unit determines The host uses the second communication protocol to communicate. 如申請專利範圍第1項之資料讀寫系統,其中該通訊介面控制器透過一USB通訊介面與該主機通訊。For example, the data reading and writing system of the first item of the patent application, in which the communication interface controller communicates with the host through a USB communication interface. 一種讀卡機,適於與一主機連接,以讓該主機透過該讀卡機對一外部記憶卡進行資料讀寫,其中該主機使用一第一種通訊協定或一第二種通訊協定其中之一,該讀卡機包括: 一協定判斷控制器; 一通訊介面控制器,電連接至該協定判斷控制器,並適於與該主機通訊; 一記憶卡控制器,電連接至該協定判斷控制器與該通訊介面控制器,並控制該主機對該外部記憶卡的資料讀寫;以及 一USB通訊介面,電連接至該通訊介面控制器,其中該協定判斷控制器取得該主機的一判定資訊,以判斷該主機使用該第一種通訊協定或該第二種通訊協定。 A card reader suitable for connecting with a host so that the host can read and write data to an external memory card through the card reader, wherein the host uses a first communication protocol or a second communication protocol. 1. The card reader includes: A protocol judgment controller; A communication interface controller, electrically connected to the protocol judgment controller, and suitable for communicating with the host; A memory card controller, electrically connected to the protocol judgment controller and the communication interface controller, and controls the host to read and write data on the external memory card; and A USB communication interface is electrically connected to the communication interface controller, wherein the protocol determination controller obtains a determination information of the host to determine whether the host uses the first communication protocol or the second communication protocol. 如申請專利範圍第13項之讀卡機,其中該協定判斷控制器包括一微處理單元,用以列舉該第一通訊協定或該第二通訊協定而與該主機通訊;當該主機的該判定資訊為一第一取得說明指令時,該協定判斷控制器判斷該主機使用該第一種通訊協定;當該主機的該判定資訊不是該第一取得說明指令時,則該協定判斷控制器判斷該主機使用該第二種通訊協定。For example, the card reader of item 13 of the scope of patent application, wherein the protocol judgment controller includes a micro-processing unit for enumerating the first communication protocol or the second communication protocol to communicate with the host; When the information is a first acquisition instruction, the protocol determination controller determines that the host uses the first communication protocol; when the determination information of the host is not the first acquisition instruction instruction, the protocol determination controller determines the The host uses this second communication protocol. 如申請專利範圍第13項之讀卡機,其中該協定判斷控制器包括一微處理單元以及一電力傳送微處理單元,當該讀卡機連接該主機後,該電力傳送微處理單元要求該主機提供該判定資訊以決定供電電壓,該微處理單元並藉以判斷該主機是使用該第一種通訊協定或該第二種通訊協定,該判定資訊為該主機的產品識別資料與供應商識別資料至少其中之一。For example, the card reader of item 13 of the scope of patent application, wherein the agreement judgment controller includes a micro processing unit and a power transmission micro processing unit. When the card reader is connected to the host, the power transmission micro processing unit requests the host The determination information is provided to determine the power supply voltage, and the micro-processing unit determines whether the host uses the first communication protocol or the second communication protocol. The determination information is that the product identification data and supplier identification data of the host are at least one of them. 一種資料讀寫系統的讀寫方法,用以對一外部記憶卡進行資料讀寫,該方法包括: 提供一資料讀寫系統,該資料讀寫系統包括一協定判斷控制器、一通訊介面控制器以及一記憶卡控制器,該通訊介面控制器電連接至該協定判斷控制器,且該記憶卡控制器電連接至該協定判斷控制器與該通訊介面控制器; 使該資料讀寫系統與一主機電性連接,並使該通訊介面控制器與該主機通訊,其中該主機使用第一種通訊協定或第二種通訊協定其中之一; 該協定判斷控制器取得該主機的一判定資訊; 該協定判斷控制器依據該判定資訊判斷該主機使用該第一種通訊協定或該第二種通訊協定;以及 該協定判斷控制器列舉該主機使用的該第一種通訊協定或該第二種通訊協定,以使該主機對該外部記憶卡進行資料讀寫。 A reading and writing method of a data reading and writing system is used for reading and writing data on an external memory card. The method includes: A data reading and writing system is provided. The data reading and writing system includes a protocol judgment controller, a communication interface controller, and a memory card controller. The communication interface controller is electrically connected to the protocol judgment controller, and the memory card controls The device is electrically connected to the protocol judgment controller and the communication interface controller; Electrically connecting the data reading and writing system with a host, and allowing the communication interface controller to communicate with the host, wherein the host uses one of the first communication protocol or the second communication protocol; The protocol judgment controller obtains a judgment information of the host; The protocol determination controller determines that the host uses the first communication protocol or the second communication protocol according to the determination information; and The protocol determining controller enumerates the first communication protocol or the second communication protocol used by the host, so that the host can read and write data on the external memory card. 如申請專利範圍第16項之資料讀寫系統的讀寫方法,其中該協定判斷控制器包括一微處理單元,而判斷該主機使用該第一種通訊協定或該第二種通訊協定包括多個步驟,該些步驟包括: 判斷該判定資訊是否為一第一取得說明指令; 若該判定資訊為該第一取得說明指令,則判斷該主機使用該第一種通訊協定,且該微處理單元列舉該第一通訊協定與該主機通訊;以及 若該判定資訊不是該第一取得說明指令,則判斷該主機使用該第二種通訊協定,且該微處理單元列舉該第二通訊協定與該主機通訊。 For example, the method for reading and writing a data reading and writing system in the scope of the patent application, wherein the protocol determining controller includes a micro-processing unit, and determining whether the host uses the first type of communication protocol or the second type of communication protocol includes a plurality of Steps, these steps include: Determine whether the determination information is a first obtaining instruction; If the determination information is the first acquisition instruction, it is determined that the host uses the first communication protocol, and the micro-processing unit enumerates the first communication protocol to communicate with the host; and If the determination information is not the first obtaining instruction command, it is determined that the host uses the second communication protocol, and the micro-processing unit lists the second communication protocol to communicate with the host. 如申請專利範圍第17項之資料讀寫系統的讀寫方法,其中若該資料讀寫系統自該主機依序接收該第一取得說明指令、一設定位址指令與一第二取得說明指令時,該協定判斷控制器依據所接收的該第一取得說明指令判斷該主機使用該第一種通訊協定,且該主機以該第一種通訊協定讀寫電連接於該資料讀寫系統的該外部記憶卡;若該資料讀寫系統自該主機依序接收該設定位址指令與該第二取得說明指令,該協定判斷控制器依據所接收的該設定位址指令預設該主機使用該第二種通訊協定。For example, the reading and writing method of the data reading and writing system of item 17 of the scope of patent application, where if the data reading and writing system receives the first obtaining instruction, a setting address instruction and a second obtaining instruction from the host in sequence , The protocol determining controller determines that the host uses the first communication protocol according to the received first acquisition instruction command, and the host uses the first communication protocol to read and write and is electrically connected to the external of the data reading and writing system Memory card; if the data read-write system receives the set address command and the second get description command from the host in sequence, the protocol determines that the controller presets the host to use the second command based on the received set address command Kind of communication protocol. 如申請專利範圍第18項之資料讀寫系統的讀寫方法,其中該協定判斷控制器判斷該主機使用該第二種通訊協定後更包括多個步驟,該些步驟包括: 判斷是否於一預設時間內接收到該主機發送的一協定執行認證指令; 若於該預設時間內接收到該主機發送的該協定執行認證指令,則確認該主機使用該第二種通訊協定,該主機並以該第二種通訊協定讀寫該外部記憶卡;以及 若於該預設時間內未接收到該主機發送的該協定執行認證指令,則該資料讀寫系統改以列舉該第一種通訊協定與該主機進行通訊。 For example, the method for reading and writing a data reading and writing system in the scope of the patent application, wherein the protocol determination controller further includes a plurality of steps after determining that the host uses the second communication protocol, and these steps include: Determining whether a protocol execution authentication command sent by the host is received within a preset time; If the protocol execution authentication command sent by the host is received within the preset time, it is confirmed that the host uses the second communication protocol, and the host uses the second communication protocol to read and write to the external memory card; and If the protocol execution authentication command sent by the host is not received within the preset time, the data reading and writing system will instead list the first communication protocol to communicate with the host. 如申請專利範圍第19項之資料讀寫系統的讀寫方法,其中該資料讀寫系統自該主機接收該第二取得說明指令之後,該協定判斷控制器接收該主機的一設定組態指令。For example, the method for reading and writing a data reading and writing system of item 19 of the scope of patent application, wherein after the data reading and writing system receives the second obtaining instruction from the host, the protocol judges that the controller receives a configuration command of the host. 如申請專利範圍第19項之資料讀寫系統的讀寫方法,其中取得該主機的該判定資訊之前,更包括多個步驟,該些步驟包括: 該協定判斷控制器接收該主機的一初始化指令;以及 該協定判斷控制器接收該主機的一排線重置指令,其中該協定判斷控制器認定該排線重置指令後所接收的該主機的指令為該判定資訊。 For example, the reading and writing method of the data reading and writing system of item 19 of the scope of patent application, before obtaining the determination information of the host, it further includes multiple steps, and these steps include: The protocol judgment controller receives an initialization command from the host; and The protocol determination controller receives a cable reset command from the host, and the protocol determination controller recognizes the host's command received after the cable reset command as the determination information. 如申請專利範圍第19項之資料讀寫系統的讀寫方法,其中該資料讀寫系統改以列舉該第一種通訊協定與該主機進行通訊的步驟包括: 該協定判斷控制器接重新收該主機的該排線重置指令; 該協定判斷控制器接重新收該主機的設定位址指令; 該協定判斷控制器接重新收該主機的取得說明指令; 該協定判斷控制器接重新收該主機的設定組態指令;以及 該主機以該第一種通訊協定(MSC)讀寫該外部記憶卡。 For example, the reading and writing method of the data reading and writing system of item 19 of the scope of patent application, wherein the data reading and writing system is changed to enumerate the steps of communicating with the host by the first communication protocol including: The protocol determines that the controller receives and re-receives the cable reset command from the host; The protocol determines that the controller receives and re-receives the host's setting address command; The protocol judges that the controller receives and re-acquires the instruction to obtain the description of the host; The protocol determines that the controller receives and re-receives the configuration command of the host; and The host uses the first communication protocol (MSC) to read and write to the external memory card. 如申請專利範圍第16項之資料讀寫系統的讀寫方法,其中該協定判斷控制器包括一微處理單元以及一電力傳送微處理單元,該協定判斷控制器取得該主機的該判定資訊的步驟包括: 該電力傳送微處理單元向該主機要求該判定資訊,其中該判定資訊為該主機的產品識別資料與供應商識別資料,而該主機的產品識別資料與供應商識別資料包括產品資料或是作業系統資料。 For example, the method for reading and writing a data reading and writing system of the 16th patent application, wherein the protocol determination controller includes a micro-processing unit and a power transmission micro-processing unit, and the protocol determination controller obtains the determination information of the host include: The power transmission micro-processing unit requests the determination information from the host, where the determination information is the product identification data and supplier identification data of the host, and the product identification data and supplier identification data of the host include product data or operating system data. 如申請專利範圍第16項之資料讀寫系統的讀寫方法,其中取得該主機的該判定資訊之前更包括:該協定判斷控制器判斷該資料讀寫系統是否具有一電力傳送模組。For example, the method for reading and writing a data reading and writing system of the 16th patent application, before obtaining the determination information of the host, further includes: the protocol judgment controller judges whether the data reading and writing system has a power transmission module. 如申請專利範圍第24項之資料讀寫系統的讀寫方法,其中若判斷該資料讀寫系統具有該電力傳送模組,則該協定判斷控制器透過該電力傳送模組向該主機取得該判定資訊,而該判定資訊為該主機的產品識別資料與供應商識別資料; 若判斷該資料讀寫系統不具有該電力傳送模組,則該協定判斷控制器直接取得該主機的該判定資訊,以判斷該主機使用該第一種通訊協定或該第二種通訊協定。 For example, the method for reading and writing a data reading and writing system of item 24 of the scope of patent application, wherein if it is judged that the data reading and writing system has the power transmission module, the agreement judgment controller obtains the judgment from the host through the power transmission module Information, and the determination information is the product identification data and supplier identification data of the host; If it is determined that the data reading and writing system does not have the power transmission module, the protocol determination controller directly obtains the determination information of the host to determine whether the host uses the first communication protocol or the second communication protocol. 如申請專利範圍第25項之資料讀寫系統的讀寫方法,其中若判斷該資料讀寫系統不具有該電力傳送模組,則該協定判斷控制器執行多個步驟,該些步驟包括: 判斷該判定資訊是否為該第一取得說明指令; 若該判定資訊為一第一取得說明指令,則判斷該主機使用該第一種通訊協定,且該微處理單元列舉該第一通訊協定與該主機通訊;以及 若該判定資訊不是該第一取得說明指令,則判斷該主機使用該第二種通訊協定,且該微處理單元列舉該第二通訊協定與該主機通訊。 For example, in the method for reading and writing a data reading and writing system of the 25th patent application, if it is judged that the data reading and writing system does not have the power transmission module, the agreement judges that the controller executes multiple steps, and these steps include: Determine whether the determination information is the first obtaining instruction; If the determination information is a first acquisition instruction command, it is determined that the host uses the first communication protocol, and the micro-processing unit lists the first communication protocol to communicate with the host; and If the determination information is not the first obtaining instruction command, it is determined that the host uses the second communication protocol, and the micro-processing unit lists the second communication protocol to communicate with the host. 如申請專利範圍第26項之資料讀寫系統的讀寫方法,其中若該資料讀寫系統自該主機依序接收該第一取得說明指令、一設定位址指令與一第二取得說明指令,則該協定判斷控制器依據所接收的指令是該第一取得說明指令判斷該主機使用該第一種通訊協定,且該主機以該第一種通訊協定讀寫電連接於該資料讀寫系統的外部記憶卡;若該資料讀寫系統自該主機依序接收一設定位址指令與該第二取得說明指令,則該協定判斷控制器依據所接收的該設定位址指令預設該主機使用該第二種通訊協定。For example, the reading and writing method of the data reading and writing system of item 26 of the scope of patent application, wherein if the data reading and writing system receives the first obtaining description command, a setting address command and a second obtaining description command from the host in sequence, Then the protocol judgment controller judges that the host uses the first communication protocol according to the received command is the first get description command, and the host uses the first communication protocol to read and write and is electrically connected to the data read/write system External memory card; if the data read-write system receives a set address command and the second get description command from the host in sequence, the protocol judges that the controller presets the host to use the host according to the received set address command The second communication protocol. 如申請專利範圍第26項之資料讀寫系統的讀寫方法,其中若該協定判斷控制器於判斷該主機使用該第二種通訊協定後一預設時間內接收到該主機發送的該協定執行認證指令,則該主機以該第二種通訊協定讀寫該外部記憶卡; 若該協定判斷控制器於判斷該主機使用該第二種通訊協定後該預設時間內未接收到該主機發送的該協定執行認證指令,則該資料讀寫系統改以列舉該第一種通訊協定與該主機進行通訊。 For example, the method for reading and writing the data reading and writing system of item 26 of the scope of patent application, wherein if the protocol determining controller receives the protocol execution sent by the host within a preset time after determining that the host uses the second communication protocol Authentication command, the host uses the second communication protocol to read and write the external memory card; If the protocol judging controller does not receive the protocol execution authentication command sent by the host within the preset time after judging that the host uses the second communication protocol, the data reading and writing system changes to list the first communication Protocol to communicate with the host. 如申請專利範圍第16項之資料讀寫系統的讀寫方法,其中該資料讀寫系統更包括一USB通訊介面,而該資料讀寫系統與該主機透過該通訊介面電性連接。For example, the data reading and writing system of the 16th item of the scope of patent application, wherein the data reading and writing system further includes a USB communication interface, and the data reading and writing system and the host are electrically connected through the communication interface.
TW108126198A 2019-07-24 2019-07-24 Card reader, data reading and writing system, and reading and writing method thereof TWI718601B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW108126198A TWI718601B (en) 2019-07-24 2019-07-24 Card reader, data reading and writing system, and reading and writing method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW108126198A TWI718601B (en) 2019-07-24 2019-07-24 Card reader, data reading and writing system, and reading and writing method thereof

Publications (2)

Publication Number Publication Date
TW202105235A TW202105235A (en) 2021-02-01
TWI718601B true TWI718601B (en) 2021-02-11

Family

ID=75745123

Family Applications (1)

Application Number Title Priority Date Filing Date
TW108126198A TWI718601B (en) 2019-07-24 2019-07-24 Card reader, data reading and writing system, and reading and writing method thereof

Country Status (1)

Country Link
TW (1) TWI718601B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201235862A (en) * 2011-02-16 2012-09-01 Skymedi Corp External bridge system
TW201310349A (en) * 2011-08-26 2013-03-01 Jrsys Internat Corp Data security authentication system and related multi-function memory card and computer program product
TW201407361A (en) * 2012-08-08 2014-02-16 Acer Inc Expansion module
TWM591654U (en) * 2019-07-24 2020-03-01 創惟科技股份有限公司 Card reader and data reading and writing system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201235862A (en) * 2011-02-16 2012-09-01 Skymedi Corp External bridge system
TW201310349A (en) * 2011-08-26 2013-03-01 Jrsys Internat Corp Data security authentication system and related multi-function memory card and computer program product
TW201407361A (en) * 2012-08-08 2014-02-16 Acer Inc Expansion module
TWM591654U (en) * 2019-07-24 2020-03-01 創惟科技股份有限公司 Card reader and data reading and writing system

Also Published As

Publication number Publication date
TW202105235A (en) 2021-02-01

Similar Documents

Publication Publication Date Title
JP5065297B2 (en) Method of booting host device from MMC / SD device, host device bootable from MMC / SD device, and MMC / SD device capable of booting host device
US8725909B2 (en) Method for identifying host operating system by universal serial bus (USB) device
US20130007289A1 (en) Remote control system and remote control method of the same
WO2012034524A1 (en) Method for identifying version type of windows operation system of host by usb device
JP2010506242A (en) Communication method with multi-function memory card
JPWO2006035738A1 (en) Host controller
US20110191499A1 (en) USB to SD Bridge
US8850086B2 (en) SD switch box in a cellular handset
US7793004B2 (en) Computer peripheral device implemented as optic storage device or/and removable disk by software emulation and implementing method thereof
KR100440972B1 (en) Apparatus and method for establishing data transfer mode by card insertion identification
US8799542B2 (en) System and method for providing remote device driver
US8527667B2 (en) Apparatuses and methods for transferring data
TWI416418B (en) Controllers, apparatuses, and methods for transferring data
TWI718601B (en) Card reader, data reading and writing system, and reading and writing method thereof
TWM591654U (en) Card reader and data reading and writing system
CN116431546B (en) Parameter configuration method, electronic device, storage medium, and program product
US20160314086A1 (en) Secure digital host controller virtualization
JP2003281477A (en) Electronic appliance, electronic card, and method for card identification
CN108008854B (en) Method, device and terminal equipment for avoiding antenna carrier interference
US20050144336A1 (en) Method and apparatus for data sharing
TWI525440B (en) A data latching device for starting an electronic device and a method of starting the electronic device
KR101172298B1 (en) Memory card for wireless communications and sd controller
CN103186812B (en) Intelligent memory card and the method accessing intelligent memory card
TWI635411B (en) Storage device with biometric module
JP2006350881A (en) Memory card controller and memory card control system