JP6162454B2 - Information processing apparatus, information processing method, and information processing system - Google Patents

Information processing apparatus, information processing method, and information processing system Download PDF

Info

Publication number
JP6162454B2
JP6162454B2 JP2013071787A JP2013071787A JP6162454B2 JP 6162454 B2 JP6162454 B2 JP 6162454B2 JP 2013071787 A JP2013071787 A JP 2013071787A JP 2013071787 A JP2013071787 A JP 2013071787A JP 6162454 B2 JP6162454 B2 JP 6162454B2
Authority
JP
Japan
Prior art keywords
information processing
host device
state
card reader
endpoint
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2013071787A
Other languages
Japanese (ja)
Other versions
JP2014197254A (en
Inventor
正憲 木村
正憲 木村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nidec Sankyo Corp
Original Assignee
Nidec Sankyo Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nidec Sankyo Corp filed Critical Nidec Sankyo Corp
Priority to JP2013071787A priority Critical patent/JP6162454B2/en
Publication of JP2014197254A publication Critical patent/JP2014197254A/en
Application granted granted Critical
Publication of JP6162454B2 publication Critical patent/JP6162454B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Systems (AREA)

Description

本発明は、上位装置と非同期で通信を行うカードリーダ等の情報処理装置、情報処理方法、情報処理システム、およびプログラムに関するものである。   The present invention relates to an information processing device such as a card reader, an information processing method, an information processing system, and a program that communicate asynchronously with a host device.

通常、情報処理装置であるカードリーダ等は通信線を介して上位装置と接続され、上位装置からのコマンドに従って処理を実行するように構成されている。
このように、上位装置とカードリーダ(情報処理装置)との通信を確立するためには、USB(Universal Serial Bus)接続方式など種々の通信方式が採用されている。
Usually, a card reader or the like, which is an information processing apparatus, is connected to a host device via a communication line, and is configured to execute processing according to a command from the host device.
Thus, in order to establish communication between the host device and the card reader (information processing device), various communication methods such as a USB (Universal Serial Bus) connection method are employed.

一方、近年主流となっているUSB接続方式は、メーカを問わずに外部機器を接続可能なので外部機器接続のデファクトスタンダードとして手軽ではあるが、USB規格が電力供給とデータ交換に主眼を置いている。   On the other hand, the USB connection method that has become mainstream in recent years is easy as a de facto standard for external device connection because it can connect external devices regardless of manufacturer, but the USB standard focuses on power supply and data exchange. .

ところで、磁気情報等が記録されたカード(状媒体)を手動で走査してデータを読み取るカードリーダでは、一般的に、インタフェースにUSB通信システムが適用される(たとえば特許文献1参照)。
この種のカードリーダにおいては、検知したカード(状媒体)に記録されているデータを取得する方法として、カードリーダが非同期で上位装置へ通知するタイプと、上位装置がポーリング(カードリーダへ状態確認のコマンドを繰り返し実行)を行い、データのリードコマンドを実行するタイプの2通りがある。
Incidentally, in a card reader that manually scans a card (form medium) on which magnetic information or the like is recorded and reads data, a USB communication system is generally applied to the interface (see, for example, Patent Document 1).
In this type of card reader, as a method of acquiring data recorded on the detected card (form medium), a type in which the card reader asynchronously notifies the host device and a method in which the host device polls (confirms the status to the card reader). The command is repeatedly executed) and the data read command is executed.

特開2008−59409号公報JP 2008-59409 A

ところで、カードを走査した際、走査による静電気やノイズ等により、カードリーダのCPUリセットや暴走、通信障害等が発生した場合、上位装置へエラーを通知する必要がある。   By the way, when the card is scanned, if a card reader CPU reset, runaway, communication failure or the like occurs due to static electricity or noise due to scanning, it is necessary to notify the host device of an error.

ポーリングを行うタイプのカードリーダでは、ポーリングで定期的にカードリーダへコマンドを送信して状態を確認しているため、直ちに異常を検知することができる。   In a card reader that performs polling, a command is periodically transmitted to the card reader by polling to check the state, so that an abnormality can be detected immediately.

これに対して、非同期で上位装置へ通知するタイプのカードリーダでは、上位装置側はカードリーダからのレスポンスを待ち続けるため、上位装置がエラーを検出できずにカードリーダでデータをリードができない状態にある場合に、無応答となってしまう。   On the other hand, in a type of card reader that notifies the host device asynchronously, the host device continues to wait for a response from the card reader, so the host device cannot detect an error and the card reader cannot read data. If there is, there will be no response.

カードリーダは上位装置の指令により磁気リード可能状態に遷移し、磁気情報等が記録されたカード(状媒体)の情報を読み取り可能な状態となる。
ここで、静電気等でカードリーダの処理部であるCPUがリセットされデータをリード可能状態が解除された場合、非同期で上位装置へ通知するタイプではエラーの検出を行うことができなかった。
すなわち、CPUがリセットされると、カードリーダが磁気リード可能状態は解除されてしまうが、正常に動作している。
そのため、非同期で上位装置へ通知するタイプのカードリーダでは、上位装置側はカードリーダからのデータ待ち、カードリーダは上位装置からのコマンド待ち、カードを走査してもデータをリードせず、の状態となっている。
上位装置から見れば、カードリーダは無応答である。
The card reader transitions to a magnetic readable state in response to a command from the host device, and is ready to read information on a card (form medium) on which magnetic information or the like is recorded.
Here, when the CPU, which is the processing unit of the card reader, is reset due to static electricity or the like and the state where the data can be read is released, it is not possible to detect an error with the type that asynchronously notifies the host device.
That is, when the CPU is reset, the card reader is released from the magnetic readable state, but is operating normally.
Therefore, in a type of card reader that asynchronously notifies the host device, the host device waits for data from the card reader, the card reader waits for commands from the host device, and does not read data even after scanning the card. It has become.
When viewed from the host device, the card reader does not respond.

本発明の目的は、上位装置との間で非同期で通信を行う情報処理装置であって、上位装置が前記情報処理装置からの応答を待ち続ける待機状態である場合、情報処理装置の状態を確認することが可能な情報処理装置、情報処理方法、情報処理システム、およびプログラムを提供することにある。   An object of the present invention is an information processing apparatus that performs asynchronous communication with a host device, and checks the status of the information processing device when the host device is in a standby state that continues to wait for a response from the information processing device. An information processing apparatus, an information processing method, an information processing system, and a program are provided.

本発明の第1の観点は、上位装置との間で非同期で通信を行い、状況に応じた処理を実行して、当該上位装置に対して現在の状態と処理結果を送信する情報処理装置であって、前記上位装置との間でUSB通信を行うUSB通信部を有し、前記USB通信部は、前記上位装置が前記情報処理装置からの応答を待ち続ける待機状態である場合、前記情報処理装置の状態を確認するための双方向通信専用の、コントロール転送であり、制御用エンドポイントである第1のエンドポイントと、当該情報処理装置から前記上位装置に向かって応答を返すための片方向通信専用の第2のエンドポイントと、当該情報処理装置が前記上位装置からコマンドを受信するための片方向通信専用の第3のエンドポイントと、を含み、前記待機状態である場合、前記情報処理装置は前記情報処理装置の状態を自身のメモリの特定のアドレスに書き込み、前記上位装置から前記双方向通信専用の前記第1のエンドポイントを通して定期的に前記情報処理装置のメモリの特定のアドレスのデータを要求され、前記情報処理装置がイネーブルであることが確認される。
A first aspect of the present invention is an information processing apparatus that performs asynchronous communication with a host device, executes processing according to the situation, and transmits a current state and a processing result to the host device. A USB communication unit that performs USB communication with the host device, and the USB communication unit is in a standby state in which the host device continues to wait for a response from the information processing device. A first transfer, which is a control transfer dedicated to bidirectional communication for confirming the state of the device and is a control endpoint, and a one-way for returning a response from the information processing device to the host device A second endpoint dedicated to communication and a third endpoint dedicated to one-way communication for the information processing apparatus to receive a command from the host apparatus, and in the standby state, The information processing device writes the state of the information processing device to a specific address of its own memory, and periodically specifies the memory of the information processing device from the host device through the first endpoint dedicated to the bidirectional communication. Address data is requested and it is confirmed that the information processing apparatus is enabled.

これにより、本発明の情報処理装置は、(前記上位装置が前記情報処理装置からの応答を待ち続ける)待機状態である場合、前記上位装置から前記双方向通信専用のエンドポイントを通して前記情報処理装置の状態を確認することが可能となる。   Thus, when the information processing apparatus of the present invention is in a standby state (the host apparatus continues to wait for a response from the information processing apparatus), the information processing apparatus passes through the endpoint dedicated for bidirectional communication from the host apparatus. It becomes possible to confirm the state of.

前記情報処理装置は、手動で走査される情報記録媒体に記録された情報を読み取るように構成されてもよい。
The information processing apparatus may be configured to read manually recorded on the information recording medium to be scanned the information.

これにより、本発明の情報処理装置は、手動で情報記録媒体を走査するので、いつ装置に媒体が挿入されるか分からない、(前記上位装置が前記情報処理装置からの応答を待ち続ける)待機状態である場合であっても、情報処理装置の状態を監視することが可能となる。   As a result, the information processing apparatus of the present invention manually scans the information recording medium, so it does not know when the medium is inserted into the apparatus, and the standby (the host apparatus continues to wait for a response from the information processing apparatus) Even in the state, it is possible to monitor the state of the information processing apparatus.

前記情報処理装置は、情報が記録されたカード状媒体を処理するカードリーダであることが好ましい。   The information processing apparatus is preferably a card reader that processes a card-like medium on which information is recorded.

これにより、本発明の情報処理装置は、(手動で情報記録媒体を走査する)カードリーダであるので、新たな構成を追加することなく、待機状態でのカードリーダの状態を監視することが可能となる。   Thereby, since the information processing apparatus of the present invention is a card reader (scans the information recording medium manually), it is possible to monitor the state of the card reader in the standby state without adding a new configuration. It becomes.

本発明の第2の観点の情報処理システムは、上位装置と、前記上位装置との間で非同期で通信を行い、状況に応じた処理を実行して、当該上位装置に対して現在の状態と処理結果を送信する情報処理装置と、を有し、前記上位装置は、所定のエンドポイントを通して前記情報処理装置の状態を確認するための状態監視を行う機能を含み、前記情報処理装置は、前記上位装置との間でUSB通信を行うUSB通信部を有し、前記USB通信部は、前記上位装置が前記情報処理装置からの応答を待ち続ける待機状態である場合、前記情報処理装置の状態を確認するための双方向通信専用の、コントロール転送であり、制御用エンドポイントである第1のエンドポイントと、当該情報処理装置から前記上位装置に向かって応答を返すための片方向通信専用の第2のエンドポイントと、当該情報処理装置が前記上位装置からコマンドを受信するための片方向通信専用の第3のエンドポイントと、を含み、前記待機状態である場合、前記情報処理装置は前記情報処理装置の状態を自身のメモリの特定のアドレスに書き込み、前記上位装置は、前記双方向通信専用の前記第1のエンドポイントを通して定期的に前記情報処理装置のメモリの特定のアドレスのデータを要求し、前記情報処理装置がイネーブルであることを確認する
An information processing system according to a second aspect of the present invention performs asynchronous communication between a host device and the host device, executes processing according to the situation, and sets the current state for the host device. An information processing device that transmits a processing result, and the host device includes a function of performing state monitoring for confirming a state of the information processing device through a predetermined end point, and the information processing device includes: A USB communication unit that performs USB communication with a host device, and the USB communication unit displays a status of the information processing device when the host device is in a standby state in which it waits for a response from the information processing device. bidirectional communication only for checking, control is transferred, the first and the endpoint is a control endpoint, one-way communication for returning a response towards the information processing apparatus to the host apparatus A dedicated second endpoint and a third endpoint dedicated to one-way communication for the information processing device to receive a command from the host device, and in the standby state, the information processing device Writes the state of the information processing apparatus to a specific address of its own memory, and the upper apparatus periodically transmits the specific address of the memory of the information processing apparatus through the first endpoint dedicated to the bidirectional communication. Request data and confirm that the information processing device is enabled .

これにより、本発明の情報処理システムにおいて、情報処理装置は、(前記上位装置が前記情報処理装置からの応答を待ち続ける)待機状態である場合、前記上位装置から前記双方向通信専用のエンドポイントを通して前記情報処理装置の状態を確認することが可能となる。そして、情報処理システムは、状態監視が可能となったことから、その次の処理、たとえば、自動的に復帰することが可能となる。   Thus, in the information processing system of the present invention, when the information processing apparatus is in a standby state (the upper apparatus continues to wait for a response from the information processing apparatus), the end point dedicated to the bidirectional communication is transmitted from the upper apparatus. It is possible to check the state of the information processing apparatus through Since the information processing system can monitor the state, it can automatically return to the next processing, for example.

本発明の第3の観点は、上位装置との間で非同期で通信を行い、状況に応じた処理を実行して、当該上位装置に対して現在の状態と処理結果を送信する情報処理装置の情報処理方法であって、前記上位装置との間でUSB通信を行うUSB通信部に、少なくとも前記上位装置が前記情報処理装置からの応答を待ち続ける待機状態である場合、前記情報処理装置の状態を確認するための双方向通信専用の、コントロール転送であり、制御用エンドポイントである第1のエンドポイントを形成し、当該情報処理装置から前記上位装置に向かって応答を返すための片方向通信専用の第2のエンドポイントを形成し、当該情報処理装置が前記上位装置からコマンドを受信するための片方向通信専用の第3のエンドポイントを形成し、前記待機状態である場合、前記情報処理装置は前記情報処理装置の状態を自身のメモリの特定のアドレスに書き込み、前記上位装置から前記双方向通信専用の前記第1のエンドポイントを通して定期的に前記情報処理装置のメモリの特定のアドレスのデータを要求し、前記情報処理装置がイネーブルであることを確認する



According to a third aspect of the present invention, there is provided an information processing apparatus that asynchronously communicates with a host device, executes processing according to the situation, and transmits a current state and a processing result to the host device. In the information processing method, when the USB communication unit that performs USB communication with the host device is in a standby state in which at least the host device continues to wait for a response from the information processor, the state of the information processor One-way communication for forming a first endpoint that is a control transfer and is a control endpoint, and for returning a response from the information processing device to the host device. A dedicated second endpoint is formed, and the information processing apparatus forms a third endpoint dedicated to one-way communication for receiving a command from the host apparatus, and is in the standby state. In this case, the information processing device writes the state of the information processing device to a specific address of its own memory, and periodically transmits the memory of the information processing device from the host device through the first endpoint dedicated to the bidirectional communication. Requesting data at a specific address, and confirming that the information processing apparatus is enabled .



これにより、本発明の情報処理方法において、前記上位装置が前記情報処理装置からの応答を待ち続ける待機状態である場合、前記上位装置から前記双方向通信専用のエンドポイントを通して前記情報処理装置の状態を確認することが可能となる。そして、情報処理方法は、状態監視が可能となったことから、その次の処理、たとえば、自動的に復帰することが可能となる。   Thereby, in the information processing method of the present invention, when the host device is in a standby state where it waits for a response from the information processor, the state of the information processor from the host device through the dedicated endpoint for bidirectional communication Can be confirmed. Since the information processing method can monitor the state, it can automatically return to the next process, for example.

本発明の第4の観点は、上位装置との間で非同期で通信を行い、状況に応じた処理を実行して、当該上位装置に対して現在の状態と処理結果を送信する情報処理装置の情報処理をコンピュータに実行させるプログラムであって、前記上位装置との間でUSB通信を行うUSB通信部に、少なくとも前記上位装置が前記情報処理装置からの応答を待ち続ける待機状態である場合、前記情報処理装置の状態を確認するための双方向通信専用のエンドポイントを形成し、待機状態である場合、前記上位装置から前記双方向通信専用のエンドポイントを通して前記情報処理装置の状態を確認する状態監視処理を受け、前記双方向通信専用のエンドポイントを通して当該状態監視の応答として現在の状態を前記上位装置に送信する情報処理をコンピュータに実行させるプログラムである。   According to a fourth aspect of the present invention, there is provided an information processing apparatus that performs asynchronous communication with a host device, executes processing according to the situation, and transmits the current state and processing result to the host device. A program that causes a computer to execute information processing, and in a USB communication unit that performs USB communication with the host device, at least when the host device is in a standby state that continues to wait for a response from the information processing device, A state in which an end point dedicated to bidirectional communication for confirming the state of the information processing device is formed and the state of the information processing device is confirmed from the host device through the end point dedicated to bidirectional communication when in the standby state Information processing that receives a monitoring process and transmits the current state to the higher-level device as a response to the state monitoring through the endpoint dedicated for bidirectional communication. Is a program to be executed by the.

これにより、本発明のプログラムにおいて、前記上位装置が前記情報処理装置からの応答を待ち続ける待機状態である場合、前記上位装置から前記双方向通信専用のエンドポイントを通して前記情報処理装置の状態を確認することが可能となる。そして、本プログラムは、状態監視が可能となったことから、その次の処理、たとえば、自動的に復帰することが可能となる。   As a result, in the program of the present invention, when the host device is in a standby state where it waits for a response from the information processing device, the host device confirms the state of the information processing device through the dedicated endpoint for bidirectional communication. It becomes possible to do. Since this program can monitor the status, the next process, for example, can be automatically restored.

本発明によれば、上位装置との間で非同期で通信を行う情報処理装置であって、上位装置が前記情報処理装置からの応答を待ち続ける待機状態である場合、情報処理装置の状態を確認することが可能となる。   According to the present invention, when an information processing apparatus that communicates asynchronously with a host apparatus and is in a standby state in which the host apparatus continues to wait for a response from the information processing apparatus, the state of the information processing apparatus is confirmed. It becomes possible to do.

本発明の実施形態に係る情報処理システムの構成を示すブロック図である。It is a block diagram which shows the structure of the information processing system which concerns on embodiment of this invention. 本実施形態に係る上位装置の構成例を示すブロック図である。It is a block diagram which shows the structural example of the high-order apparatus which concerns on this embodiment. 本実施形態に係る上位装置とカードリーダ間の状態監視を実現するエンドポイントに関する構成を概念的に示す図である。It is a figure which shows notionally the structure regarding the endpoint which implement | achieves the state monitoring between the high-order apparatus which concerns on this embodiment, and a card reader. 本実施形態において、上位装置がカードリーダの状態をイネーブルにさせ磁気カード読み取り可能状態での処理について説明するためのフローチャートである。In this embodiment, it is a flowchart for demonstrating the process in a magnetic card readable state in which a high-order apparatus enables the state of a card reader. 図4の状態監視処理を説明するためのフローチャートである。It is a flowchart for demonstrating the state monitoring process of FIG. 本実施形態の情報処理システムにおいて、通信切断と静電気によるCPUリセットが発生した場合の効果を、状態監視処理を行わない構成を比較例と比較して示す図である。In the information processing system of this embodiment, it is a figure which shows the effect when the CPU reset by communication disconnection and static electricity generate | occur | produces comparing the structure which does not perform a state monitoring process with a comparative example.

以下、本発明の実施形態を図面に関連付けて説明する。
本実施形態においては、情報処理装置として、クレジットカード、プリペイドカードまたはキャッシュカード等のカード状媒体である磁気カードに形成された磁気ストライプに記録されている磁気データ(磁気情報)等の読み取りまたは書き込みを行うもカードリーダを例に説明する。
なお、本実施形態は、磁気カードリーダ等のカードリーダ以外に、非接触カードを装置にかざして情報のやりとりを行う非接触カードリーダやスーパー等のレジスターで使用するようなバーコード読取装置にも適用可能である。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
In this embodiment, the information processing apparatus reads or writes magnetic data (magnetic information) or the like recorded on a magnetic stripe formed on a magnetic card that is a card-like medium such as a credit card, prepaid card, or cash card. However, a card reader will be described as an example.
In addition to a card reader such as a magnetic card reader, this embodiment also applies to a barcode reader such as a contactless card reader that exchanges information by holding a contactless card over the device or a register such as a supermarket. Applicable.

図1は、本実施形態に係る情報処理システムの概要を示すブロック図である。また、図1は、情報処理装置としてのカードリーダの信号処理系の基本的な構成例をブロック図として示している。
図2は、本実施形態に係る上位装置の構成例を示すブロック図である。
FIG. 1 is a block diagram showing an overview of the information processing system according to the present embodiment. FIG. 1 is a block diagram illustrating a basic configuration example of a signal processing system of a card reader as an information processing apparatus.
FIG. 2 is a block diagram illustrating a configuration example of the host device according to the present embodiment.

[情報処理システム10の概要]
本実施形態に係る情報処理システム10は、図1に示すように、主として、上位装置(たとえばPOS端末用ホスト)20と、カードリーダ30とを主構成要素として構成されている。
[Outline of Information Processing System 10]
As shown in FIG. 1, the information processing system 10 according to the present embodiment mainly includes a host device (for example, a POS terminal host) 20 and a card reader 30 as main components.

まず、本実施形態の特徴的な構成および機能について説明し、その後、各部の具体的な構成および処理について説明する。   First, the characteristic configuration and function of the present embodiment will be described, and then the specific configuration and processing of each unit will be described.

上位装置20とカードリーダ30との間の通常の通信は、RS232CやUSB(Universal Serial Bus)などの専用線(有線の通信線)を用いた通信システムが適用され、本実施形態ではUSB通信システムが適用されている。
したがって、上位装置20とカードリーダ30とは、通常の通信経路としてUSBケーブル40により接続されている。
For normal communication between the host device 20 and the card reader 30, a communication system using a dedicated line (wired communication line) such as RS232C or USB (Universal Serial Bus) is applied. In this embodiment, the USB communication system is used. Has been applied.
Therefore, the host device 20 and the card reader 30 are connected by the USB cable 40 as a normal communication path.

本実施形態に係るカードリーダ30は、上位装置20との間でUSB通信システムを介して通信を行い、状況に応じた処理を実行して、上位装置20に対して現在の状態と処理結果を送信する機能を有している。
本実施形態の情報処理装置としてのカードリーダ30は上位装置20との間で非同期で通信を行う。
カードリーダ30は、USB通信部において、後述するように、たとえば3つのエンドポイントEP0〜EP2を含んで構成される。
カードリーダ30は、上位装置20との間で通信を行うUSB通信部(USBインタフェース)には、少なくとも、上位装置20との間における各種設定および制御のいずれか、あるいは両方を行うための双方向通信のコントロール転送専用のエンドポイントEP0を備えている。
換言すれば、このエンドポイントEP0は、上位装置20がカードリーダ30からの応答を待ち続ける待機状態である場合、カードリーダ30の状態を確認するための双方向通信専用のエンドポイントである。
待機状態である場合、上位装置20が双方向通信専用(コントロール転送)のエンドポイントEP0を用いてカードリーダ30の状態を確認する状態監視処理(疑似的なポーリング処理)を行う。
The card reader 30 according to the present embodiment communicates with the host device 20 via the USB communication system, executes processing according to the situation, and displays the current state and processing result for the host device 20. It has a function to transmit.
The card reader 30 as the information processing apparatus of the present embodiment communicates asynchronously with the host apparatus 20.
As will be described later, the card reader 30 includes, for example, three end points EP0 to EP2 in the USB communication unit.
The card reader 30 has a USB communication unit (USB interface) that communicates with the host device 20 at least in both directions for performing various settings and / or controls with the host device 20. An end point EP0 dedicated to communication control transfer is provided.
In other words, the end point EP0 is a dedicated end point for bidirectional communication for confirming the state of the card reader 30 when the host device 20 is in a standby state in which it waits for a response from the card reader 30.
In the standby state, the host device 20 performs state monitoring processing (pseudo polling processing) for checking the state of the card reader 30 using the end point EP0 dedicated to bidirectional communication (control transfer).

非同期通信を行うカードリーダ30について、エンドポイントを利用して状態監視を行うのは次の理由による。
非同期で上位装置へ通知するタイプのカードリーダでは、上位装置側はカードリーダからの応答を待ち続けるため、上位装置がエラーを検出できずにカードリーダで磁気リードができない状態にある場合に、無応答となってしまう。
そこで、本実施形態においては、非同期で上位装置20へ通知するタイプのカードリーダ30で、上位装置20へ状態を通知するために以下の特徴的な構成を有している。
1)データを上位装置20へ通知するエンドポイント以外のエンドポイント(本実施形態ではコントロール転送)を使用し、磁気カードMCが走査されるのを待っている待機状態の間に、上位装置20とカードリーダ30との双方向通信で状態監視処理(疑似的なポーリング処理)を行い、カードリーダ30の状態監視を行う。
2)状態監視でカードリーダの現在の状態を上位装置20に返し、上位装置20が、カードリーダ30が、磁気リードを可能な状態であるかを確認できるようしている。
Regarding the card reader 30 that performs asynchronous communication, the state is monitored using the end point for the following reason.
In a card reader that asynchronously notifies the host device, the host device continues to wait for a response from the card reader. It becomes a response.
Therefore, in this embodiment, the card reader 30 of the type that notifies the host device 20 asynchronously has the following characteristic configuration in order to notify the host device 20 of the status.
1) Using an endpoint (control transfer in this embodiment) other than the endpoint for notifying the host device 20 of data and waiting for the magnetic card MC to be scanned with the host device 20 Status monitoring processing (pseudo polling processing) is performed by bidirectional communication with the card reader 30 to monitor the status of the card reader 30.
2) The current state of the card reader is returned to the host device 20 by the state monitoring so that the host device 20 can check whether the card reader 30 is in a state capable of magnetic reading.

なお、エンドポイントとは、USBデバイスとしてのカードリーダ30とホスト機器である上位装置20との間を接続する論理的な通信経路の最小単位のことであり、USB規格により定められている。
換言すると、エンドポイントとは、USBデバイス(ここではカードリーダ30)においてホストである上位装置20と通信を行うためのリソース、具定的にはバッファ、FIFO(First-In First-Out)等をいう。
An end point is a minimum unit of a logical communication path that connects a card reader 30 as a USB device and a host device 20 as a host device, and is defined by the USB standard.
In other words, the endpoint is a resource for communicating with the host device 20 that is the host in the USB device (here, the card reader 30), specifically a buffer, a FIFO (First-In First-Out), and the like. Say.

本実施形態においては、たとえばエンドポイントが以下のように設定されるカードリーダ30として構成される。
第1のエンドポイントEP0:コントロール転送
第2のエンドポイントEP1:インタラプトIN
第3のエンドポイントEP2:インタラプトOUT
In the present embodiment, for example, the card reader 30 is configured such that the end point is set as follows.
First endpoint EP0: Control transfer Second endpoint EP1: Interrupt IN
Third endpoint EP2: Interrupt OUT

第1のエンドポイントEP0は、コントロール転送であり、制御用エンドポイントである。
第2のエンドポイントEP1は、インタラプトINで、上位装置20がカードリーダ30からのレスポンスを受信するためのものである。
第3のエンドポイントEP2は、インタラプトOUTで、上位装置20がカードリーダ30にコマンドを送信するものである。
3つのエンドポイントのうち、エンドポイントEP0のみが双方向通信可能である。
The first endpoint EP0 is a control transfer and is a control endpoint.
The second endpoint EP1 is an interrupt IN, and is used by the higher-level device 20 to receive a response from the card reader 30.
The third endpoint EP2 is an interrupt OUT, and the host device 20 transmits a command to the card reader 30.
Of the three end points, only the end point EP0 is capable of bidirectional communication.

状態監視にコントロール転送を使用する理由は以下の通りである。
コントロール転送は、コンフィギュレーションを行うために必ずサポートされており、双方向通信が可能である。
コントロール転送以外は、上位装置(ホスト)側からのデータ送信で一つ、受信で一つであることから、計2つのエンドポイントが必要である。
The reason for using control transfer for status monitoring is as follows.
Control transfer is always supported for configuration, and bi-directional communication is possible.
Other than the control transfer, two endpoints are required because one is for data transmission from the host device (host) side and one is for reception.

なお、エンドポイントの構成やこれに伴う状態監視を含むUSB通信処理については後でさらに説明する。   The USB communication process including the endpoint configuration and the state monitoring associated therewith will be further described later.

[上位装置(ホスト装置)20の具体的な構成および機能]
図2は、本実施形態に係る上位装置の構成例を示している。
上位装置20は、上述したように、基本的に、カードリーダ30との間で、主通信システムのUSB通信システムを通して通信制御を行い、コマンドの送信に対応したレスポンス(応答)を受信する等の各種情報の授受を行って、カードリーダ30からの情報を取得する。
[Specific Configuration and Function of Host Device (Host Device) 20]
FIG. 2 shows a configuration example of the host device according to the present embodiment.
As described above, the host device 20 basically performs communication control with the card reader 30 through the USB communication system of the main communication system, and receives a response corresponding to command transmission. Various information is exchanged and information from the card reader 30 is acquired.

図2の上位装置20は、基本的に、処理部であるCPU21、ROM22、RAM23、ストレージユニット24、および上位(ホスト)側USB通信部25を有している。
上位(ホスト)側USB通信部25は、USBケーブル40を介してカードリーダ30のUSB通信部と接続されている。
2 basically includes a CPU 21, a ROM 22, a RAM 23, a storage unit 24, and a host (host) side USB communication unit 25, which are processing units.
The upper (host) side USB communication unit 25 is connected to the USB communication unit of the card reader 30 via the USB cable 40.

本例においては、図中のストレージユニット24内に保存されたオペレーティングシステム(OS)、通信制御用等のミドルウェアMW、アプリケーション等のプログラムがソフトウェアシステムの一部をなし、実行時にいわゆるコンピュータ(電子計算機)のソフトウェアとしてRAM23上に展開される。   In this example, programs such as an operating system (OS), middleware MW for communication control, applications, and the like stored in the storage unit 24 in the figure form part of the software system, and a so-called computer (electronic computer) is executed during ) On the RAM 23 as software.

このように、上位装置20は、CPU21、ROM22、RAM23等の各種ハードウェアを有しており、上位装置20を統合的に制御する機能、カードリーダ30との通信機能、および磁気情報の読み取りを行う機能などを有している。   As described above, the host device 20 has various hardware such as the CPU 21, ROM 22, and RAM 23, and functions to control the host device 20 in an integrated manner, a communication function with the card reader 30, and reading of magnetic information. It has a function to perform.

上位装置20において、CPU21が全体の制御を行う。
上位装置20は、カードリーダ30とのUSB通信を行う場合に、CPU21の制御の下、上位(ホスト)側USB通信部25を通して、USBケーブル40により接続されたカードリーダ30のUSB通信部との間でUSB通信を行う。
In the host device 20, the CPU 21 performs overall control.
When the host device 20 performs USB communication with the card reader 30, the host device 20 communicates with the USB communication unit of the card reader 30 connected by the USB cable 40 through the host (host) side USB communication unit 25 under the control of the CPU 21. USB communication between them.

USB通信システムは、ホストである上位装置20とデバイスであるカードリーダ30間をシリアル通信で接続するものであって、たとえばプラグアンドプレイ機能(自動接続認識機能)、ホットインサーション機能(電源を入れたままでの抜き差しを可能にする機能)およびホストからデバイスへの電源(電力)供給機能など、ユーザの利便性を高める様々な機能を有している。
一般的に、USB通信で用いるUSBケーブル40は、5Vの電源ライン(V−BUSライン)、GND(グランド)ライン、およびデータ転送用のD+およびD−の信号ラインから構成される合計4本の配線を有している。
そして、カードリーダ30等のデバイス側では、V−BUSラインを通じて送信されるV−BUS信号の常時監視を行っている。つまり、このV−BUS信号の遷移状態を常時監視することで、USB通信の異常検出を行うこともできるようになっている。
たとえば、V−BUSラインの上位装置が故意にダウンさせることのないシステムにおいては、USB通信中に何らかの理由でUSBケーブルが外れた場合には、V−BUS信号がオンからオフへと遷移し、その結果、デバイスはUSB通信の物理的な接続が破断したと認識し、USB通信の異常が検出されることもできる。
The USB communication system connects the host device 20 as a host and the card reader 30 as a device by serial communication. For example, a plug-and-play function (automatic connection recognition function), a hot insertion function (power on) And the like, and a function for supplying power (electric power) from the host to the device.
In general, the USB cable 40 used for USB communication includes a total of four lines composed of a 5V power line (V-BUS line), a GND (ground) line, and D + and D- signal lines for data transfer. Has wiring.
On the device side such as the card reader 30, the V-BUS signal transmitted through the V-BUS line is constantly monitored. In other words, it is possible to detect abnormality in USB communication by constantly monitoring the transition state of the V-BUS signal.
For example, in a system in which the host device on the V-BUS line is not intentionally brought down, if the USB cable is disconnected for some reason during USB communication, the V-BUS signal transitions from on to off, As a result, the device recognizes that the physical connection of the USB communication is broken, and the abnormality of the USB communication can be detected.

上位装置20は、CPU21の制御の下、上位(ホスト)側USB通信部25を通して、カードリーダ30を磁気カード読み取り可能状態に遷移させ、上位装置20およびカードリーダ30が読み取り待ち状態(磁気情報(磁気データ)の入力待ちを示す待機状態)となると、エンドポイントEP0(コントロール転送)により定期的(たとえば1〜5秒間隔)に状態監視処理を行い、カードリーダ30の状態監視を行う。
上位装置20は、状態監視でカードリーダ30から送信されるべき現在の状態情報に基づいて磁気リードを可能な状態であるかを確認できるようしている。
上位装置20は、この状態監視で、カードリーダ30側が、磁気カードの走査等に伴う静電気等でリセットされて初期化されていない初期状態となっていることを確認すると、初期化コマンドを出してカードリーダ30を磁気カード読み取り可能状態に遷移(復帰)させるべく、カードリーダ30に対する復帰処理を行う。
Under the control of the CPU 21, the host device 20 causes the card reader 30 to transition to a magnetic card readable state through the host (host) side USB communication unit 25, and the host device 20 and the card reader 30 wait for reading (magnetic information ( In the standby state indicating waiting for input of magnetic data), state monitoring processing is performed periodically (for example, at intervals of 1 to 5 seconds) by the end point EP0 (control transfer), and the state of the card reader 30 is monitored.
The host device 20 can check whether or not the magnetic read is possible based on the current state information to be transmitted from the card reader 30 in the state monitoring.
When the host device 20 confirms that the card reader 30 is in an initial state that has not been initialized by resetting due to static electricity or the like due to scanning of the magnetic card or the like, the host device 20 issues an initialization command. In order to change (return) the card reader 30 to a magnetic card readable state, a return process for the card reader 30 is performed.

上位装置20は、エンドポイントEP1のインタラプトINでレスポンスを受信し、エンドポイントEP2のインタラプトOUTでコマンドを送信する。
上位装置20は、カードリーダ30を磁気リード可能状態へ遷移するようコマンドを送信し、インタラプトINにて非同期で磁気データが通知されるのを待つ。
状態監視は、双方向通信が必要なことから、コントロール転送を使用してカードリーダ30の状態確認を行う。
上位装置20は、この状態監視をカードリーダ30が磁気リード可能状態の期間のみ行う。
The host device 20 receives a response at the interrupt IN of the end point EP1 and transmits a command at the interrupt OUT of the end point EP2.
The host device 20 transmits a command to shift the card reader 30 to a magnetic readable state, and waits for notification of magnetic data asynchronously at the interrupt IN.
Since the status monitoring requires two-way communication, the status of the card reader 30 is confirmed using control transfer.
The host device 20 performs this state monitoring only during a period in which the card reader 30 is in a magnetic readable state.

この状態監視処理に伴いカードリーダ30の状態監視および復帰処理等はCPU21の制御に従って行われる。
本実施形態によれば、非同期で通信を行うカードリーダ30において、待機状態である場合、カードリーダ30の状態を監視することが可能である。
さらに、本実施形態では、カードリーダ30の状態監視が可能なので、エラーが生じた場合にはその結果を上位装置20にレスポンスし、自動的にカードリーダ30を復帰処理等をすることが可能となる。
Along with this state monitoring processing, the state monitoring and return processing of the card reader 30 are performed according to the control of the CPU 21.
According to this embodiment, when the card reader 30 that performs asynchronous communication is in a standby state, the state of the card reader 30 can be monitored.
Furthermore, in this embodiment, since the status of the card reader 30 can be monitored, if an error occurs, the result can be returned to the host device 20 and the card reader 30 can be automatically restored. Become.

なお、本実施形態における状態監視は、たとえばゲットインデックスストリング(Get Index String)というUSBコマンドを用いてカードリーダ30側のメモリの所定のアドレスのデータを要求してカードリーダの状態を取得することにより行われる。
すなわち、本実施形態における状態監視は、疑似的ポーリングということもできる。
The state monitoring in this embodiment is performed by requesting data at a predetermined address in the memory on the card reader 30 side using a USB command called Get Index String, for example, and acquiring the state of the card reader. Done.
That is, the state monitoring in this embodiment can also be called pseudo polling.

次に、カードリーダ30の構成および機能について説明する。   Next, the configuration and function of the card reader 30 will be described.

[カードリーダ30の構成および機能]
本実施形態では、カードリーダ30として、磁気ストライプを有するカード状媒体を走行基準面に沿って手動走行させるスワイプ式のものを採用している。すなわち、ここで説明するカードリーダ30は、手動で走査される磁気カードMCに記録された情報を読み取る機能を有する。
ただし、本発明はこれに限られない。
そして、カードリーダ30は、上位装置20との間で、非同期で通信を行う。
[Configuration and Function of Card Reader 30]
In this embodiment, the card reader 30 employs a swipe type card that manually runs a card-like medium having a magnetic stripe along the running reference plane. That is, the card reader 30 described here has a function of reading information recorded on the magnetic card MC that is manually scanned.
However, the present invention is not limited to this.
The card reader 30 communicates asynchronously with the host device 20.

前述したように、図1は、本実施形態に係る情報処理としてのカードリーダの信号処理系の構成例を示している。
図1のカードリーダ30は、カードリーダ30全体を統合的に制御する処理部としてのCPU31、カードリーダ30の動作プログラムや初期値、パラメータなどを格納するROM32、およびCPU31のワーキングエリアとして機能するRAM33を有している。
カードリーダ30は、上位装置20とUSB通信を行うI/F(インタフェース)デバイスとしての機能を含むUSB通信部34、および手動走行される磁気カードMCから磁気情報を読み取る磁気ヘッドを含む読み取り部35を有している。
As described above, FIG. 1 shows a configuration example of a signal processing system of a card reader as information processing according to the present embodiment.
The card reader 30 in FIG. 1 includes a CPU 31 as a processing unit that controls the card reader 30 as a whole, a ROM 32 that stores operation programs, initial values, parameters, and the like of the card reader 30, and a RAM 33 that functions as a working area of the CPU 31. have.
The card reader 30 includes a USB communication unit 34 including a function as an I / F (interface) device that performs USB communication with the host device 20, and a reading unit 35 including a magnetic head that reads magnetic information from the magnetic card MC that is manually run. have.

カードリーダ30は、USB通信部34さらにはUSBケーブル40を介して上位装置20と接続されている。
カードリーダ30は、上位装置20との間の通信規約に沿った情報列のコマンドに基づき動作する。
The card reader 30 is connected to the host device 20 via the USB communication unit 34 and the USB cable 40.
The card reader 30 operates based on an information string command in accordance with a communication protocol with the host device 20.

USB通信部34は、上位装置20からカードリーダ30へ送られた信号をTTLレベルの信号に変換し、それをCPU31に転送する機能を有する。
また、CPU31からの信号を逆変換して、上位装置20に転送する。
本実施形態において、上位装置20とカードリーダ30の間の通常の通信としては、上述したように、USB通信システムが採用されている。
The USB communication unit 34 has a function of converting a signal sent from the host device 20 to the card reader 30 into a TTL level signal and transferring it to the CPU 31.
Further, the signal from the CPU 31 is inversely converted and transferred to the host device 20.
In the present embodiment, as described above, the USB communication system is employed as the normal communication between the host device 20 and the card reader 30.

カードリーダ30は、CPU31の制御の下、USB通信部34を通して受信する上位装置20からの指令(コマンド)により磁気リード可能状態(待機状態)に遷移し、磁気カードMCの情報を読み取り可能な状態となる。
カードリーダ30は、CPU31の制御の下、カードリーダ30側で行った処理の結果を、USB通信部34を通して上位装置20に送信する。
カードリーダ30は、CPU31の制御の下、磁気リード可能状態の期間のみ上位装置20からのエンドポイントEP0を用いた状態監視に対して現在の状態に関するデータ(情報)を、USB通信部34を通して上位装置20に送信する。
カードリーダ30は、静電気等でカードリーダの処理部であるCPU31がリセットされ磁気リード可能状態が解除されると、上位装置20からのエンドポイントEP0を用いた状態監視に対して現在の状態が初期状態にあることを、USB通信部34を通して上位装置20に送信する。
カードリーダ30は、上位装置20から復帰指令(本実施形態では初期化コマンド)を受けると、初期状態から磁気リード可能状態に遷移する復帰処理を行い、磁気リード可能状態に復帰することが可能に構成されている。
Under the control of the CPU 31, the card reader 30 transitions to a magnetic readable state (standby state) in response to a command (command) received from the host device 20 through the USB communication unit 34, and can read information on the magnetic card MC. It becomes.
The card reader 30 transmits the result of processing performed on the card reader 30 side to the host device 20 through the USB communication unit 34 under the control of the CPU 31.
Under the control of the CPU 31, the card reader 30 sends data (information) related to the current state to the host via the USB communication unit 34 for the state monitoring using the endpoint EP 0 from the host device 20 only during the magnetic readable state. Transmit to device 20.
When the CPU 31 that is the processing unit of the card reader is reset due to static electricity or the like and the magnetic readable state is released, the card reader 30 is initially in the current state with respect to the state monitoring using the endpoint EP0 from the host device 20. The fact that it is in a state is transmitted to the host device 20 through the USB communication unit 34.
When the card reader 30 receives a return command (initialization command in the present embodiment) from the host device 20, the card reader 30 can perform a return process to transition from the initial state to the magnetic readable state and return to the magnetic readable state. It is configured.

前述したように、本実施形態においては、非同期で上位装置20へ通知するタイプのカードリーダ30で、上位装置20へ状態を通知するために以下の特徴的な構成を有している。
1)データを上位装置20へ通知するエンドポイント以外のエンドポイント(本実施形態ではコントロール転送)を使用し、磁気カードMCが走査されるのを待っている待機状態の間に、上位装置20とカードリーダ30との双方向通信で状態監視(疑似的なポーリング)を行い、カードリーダ30の状態監視を行う。
2)状態監視でカードリーダ30の現在の状態を上位装置20に返し、上位装置20が、カードリーダ30が、磁気リードを可能な状態かを確認できるようしている。
As described above, in the present embodiment, the card reader 30 of the type that notifies the host device 20 asynchronously has the following characteristic configuration to notify the host device 20 of the status.
1) Using an endpoint (control transfer in this embodiment) other than the endpoint for notifying the host device 20 of data and waiting for the magnetic card MC to be scanned with the host device 20 Status monitoring (pseudo polling) is performed by bidirectional communication with the card reader 30, and the status of the card reader 30 is monitored.
2) The current state of the card reader 30 is returned to the host device 20 by the state monitoring so that the host device 20 can check whether the card reader 30 is capable of magnetic reading.

図3は、本実施形態に係る上位装置とカードリーダ間の状態監視を実現するエンドポイントに関する構成を概念的に示す図である。
図3の例では、上位装置20側においては、たとえば上位側USB通信部25に各エンドポイントEP0,EP1,EP2に対応するバッファBF0,BF1,BF2,・・・が配置されているバッファ群250を有する。
また、カードリーダ30側においては、USB通信部34に各エンドポイントEP0,EP1,EP2に対応するFIFOにより構成されるバッファFIFO0,FIFO1,FIFO,・・・が配置されているバッファ群(FIFO群)340を有する。
FIG. 3 is a diagram conceptually illustrating a configuration related to an endpoint that realizes state monitoring between the host device and the card reader according to the present embodiment.
In the example of FIG. 3, on the host device 20 side, for example, a buffer group 250 in which buffers BF0, BF1, BF2,... Corresponding to the endpoints EP0, EP1, EP2 are arranged in the host USB communication unit 25. Have
On the card reader 30 side, a buffer group (FIFO group) in which buffers FIFO0, FIFO1, FIFO,... Constituted by FIFOs corresponding to the end points EP0, EP1, EP2 are arranged in the USB communication unit 34. 340.

図3に示すように、エンドポイントEP0のコントロール転送は、上位装置20とカードリーダ30間で双方向通信可能である。
エンドポイントEP1のインタラプトINは、カードリーダ30から上位装置20に向かってレスポンス(応答)を返す(上位装置20がレスポンスを受信する)ための片方向通信である。
エンドポイントEP2のインタラプトOUTは、上位装置20がカードリーダ30にコマンドを送信する(カードリーダ30がコマンドを受信する)ための片方向通信である。
As shown in FIG. 3, the control transfer of the end point EP <b> 0 can be bidirectionally communicated between the host device 20 and the card reader 30.
The interrupt IN of the end point EP1 is a one-way communication for returning a response (response) from the card reader 30 to the higher-level device 20 (the higher-level device 20 receives the response).
The interrupt OUT of the end point EP2 is a one-way communication for the host device 20 to transmit a command to the card reader 30 (the card reader 30 receives the command).

本実施形態においては、カードリーダ30は、USB通信部34およびCPU31で、第3のエンドポイントEP3を通して磁気カード読み取り可能状態に遷移するようコマンドを受け、第2のエンドポイントEPを通して非同期で処理実行により得られたデータを上位装置20に送信する。   In the present embodiment, the card reader 30 receives a command to make a transition to a magnetic card readable state through the third end point EP3 at the USB communication unit 34 and the CPU 31, and executes processing asynchronously through the second end point EP. The data obtained by the above is transmitted to the host device 20.

次に、上記構成を有する情報処理システム10の動作について説明する。
ここでは、上位装置20とカードリーダ30との状態監視を含む通信処理を含み、上位装置20が、カードリーダ30の状態をイネーブル(Enable)にさせ磁気カード読み取り可能状態での処理について説明する。
本実施形態において、状態監視とは前述したように、コマンドのやり取りではなく、カードリーダ30の状態を特定のメモリに書き込み、定期的にそのメモリにアクセスしてイネーブルであることを確認する処理(コントロール転送)をいう。
Next, the operation of the information processing system 10 having the above configuration will be described.
Here, communication processing including state monitoring between the host device 20 and the card reader 30 will be described, and processing in a state where the host device 20 enables the card reader 30 and enables the magnetic card to be read will be described.
In the present embodiment, as described above, the state monitoring is not a command exchange but a process of writing the state of the card reader 30 into a specific memory and periodically accessing the memory to confirm that it is enabled ( Control transfer).

[動作説明]
図4は、本実施形態において、上位装置がカードリーダの状態をイネーブルにさせ磁気カード読み取り可能状態での処理について説明するためのフローチャートである。
図5は、図4の状態監視処理を説明するためのフローチャートである。
[Description of operation]
FIG. 4 is a flowchart for explaining processing in a state in which the host device enables the card reader state and the magnetic card can be read in this embodiment.
FIG. 5 is a flowchart for explaining the state monitoring process of FIG.

上位装置20が、カードリーダ30に対してイネーブル状態とするためのコマンドを発行し、カードリーダ30の状態をイネーブル状態にさせる(ステップST0)。これにより、磁気カード読み取り可能状態(磁気カードの走査待ち状態)となる。
次に、上位装置20は、リードコマンドを発行し(ステップST1)、エラーがなければ(ステップST2:No)、処理はステップST3の磁界カードリーダ30の状態監視処理に移行される。
すなわち、上位装置20は、CPU21の制御の下、上位側USB通信部25を通して、カードリーダ30を磁気カード読み取り可能状態に遷移させ、上位装置20およびカードリーダ30が読み取り待ち状態(磁気情報(磁気データ)の入力待ちを示す待機状態)となると、エンドポイントEP0(コントロール転送)により定期的に状態監視処理を行い、カードリーダ30の状態監視を行う。
一方、初期化処理に失敗した場合、すなわちエラーがあった場合には(ステップST2:Yes)、初期化することができない異常が生じているとして、処理を終了する。
The host device 20 issues a command to enable the card reader 30 to enable the card reader 30 (step ST0). As a result, the magnetic card can be read (magnetic card scanning waiting state).
Next, the host device 20 issues a read command (step ST1), and if there is no error (step ST2: No), the process proceeds to the state monitoring process of the magnetic field card reader 30 in step ST3.
That is, under the control of the CPU 21, the host device 20 causes the card reader 30 to transition to a magnetic card readable state through the host-side USB communication unit 25, and the host device 20 and the card reader 30 are ready to read (magnetic information (magnetic information (Waiting for data) input), state monitoring processing is periodically performed by the end point EP0 (control transfer), and the state of the card reader 30 is monitored.
On the other hand, if the initialization process fails, that is, if there is an error (step ST2: Yes), it is determined that an abnormality that cannot be initialized has occurred, and the process ends.

ステップST3において、上位装置20は、磁気データ待ちとなり、状態監視(コントロール転送)を行う。
状態監視処理においては、データを上位装置20へ通知するエンドポイント以外のエンドポイント(本実施形態ではコントロール転送)が使用され、磁気カードMCが走査されるのを待っている待機状態の間に、上位装置20はカードリーダ30との双方向通信で状態監視を行い、カードリーダ30の状態監視を行う。
状態監視処理において、カードリーダ30は、現在の状態を上位装置20に返し、上位装置20が、カードリーダ30が、磁気リードを可能な状態かを確認する。
In step ST3, the host device 20 waits for magnetic data and performs state monitoring (control transfer).
In the state monitoring process, an endpoint (control transfer in this embodiment) other than the endpoint that notifies the host device 20 of data is used, and during the standby state waiting for the magnetic card MC to be scanned, The host device 20 monitors the state of the card reader 30 by bidirectional communication with the card reader 30.
In the state monitoring process, the card reader 30 returns the current state to the host device 20, and the host device 20 confirms whether the card reader 30 is capable of magnetic reading.

ここで、図5のステップST31のように、上位装置20は、カードリーダ30の状態監視処理を行うが、この状態監視通信でエラーがあり状態監視を失敗したと判断した場合には(ステップST32:Yes)、処理を終了する。
一方、状態監視通信でエラーがなく状態監視を成功したと判断した場合には(ステップST32:No)、上位装置20は待機状態となる(ステップST33)。
そして、ステップST34において、所定時間を経過してタイムアウトとなった場合には、ステップST31の処理に戻る。
一方、ステップST34において、タイムアウトでなく異常があると判断すると、状態監視の中断命令を発行して一連の処理の終了となる。
Here, as in step ST31 of FIG. 5, the host device 20 performs the state monitoring process of the card reader 30, but when it is determined that there is an error in the state monitoring communication and the state monitoring has failed (step ST32). : Yes), the process is terminated.
On the other hand, when it is determined that there is no error in the state monitoring communication and the state monitoring is successful (step ST32: No), the higher level apparatus 20 enters a standby state (step ST33).
In step ST34, when a predetermined time elapses and a time-out occurs, the process returns to step ST31.
On the other hand, if it is determined in step ST34 that there is an abnormality rather than a timeout, a state monitoring interruption command is issued, and the series of processing ends.

なお、上位装置20は、状態監視処理で、カードリーダ30側が、磁気カードの走査等に伴う静電気等でリセットされて初期化されていない初期状態となっていることを確認すると、初期化コマンドを出してカードリーダ30を磁気カード読み取り可能状態に遷移(復帰)させるべく、カードリーダ30に対する復帰処理を行う。   When the host device 20 confirms in the state monitoring process that the card reader 30 side is in an initial state that is not initialized by being reset due to static electricity or the like due to scanning of the magnetic card or the like, an initialization command is issued. The card reader 30 is returned to the magnetic card readable state so that the card reader 30 is restored.

図4において、ステップST3の状態監視処理の後、上位装置20は、磁気データエラーがあるまで待機する(ステップST4)。
そして、磁気データエラーがあると一連の処理を中断する(ステップST5)。
In FIG. 4, after the state monitoring process in step ST3, the host device 20 stands by until there is a magnetic data error (step ST4).
If there is a magnetic data error, the series of processing is interrupted (step ST5).

[実施形態の主な効果]
以上説明したように、本実施形態によれば、非同期で通信を行うカードリーダ30が静電気等によりリセットされて初期状態に陥ったとき、無応答状態となることなく、カードリーダ30を自動的に初期状態から待機状態へ確実に遷移させることができる。
その結果、本実施形態によれば、利便性を高めることができる。
[Main effects of the embodiment]
As described above, according to the present embodiment, when the card reader 30 that performs asynchronous communication is reset due to static electricity or the like and falls into the initial state, the card reader 30 is automatically set in a non-response state. It is possible to reliably transition from the initial state to the standby state.
As a result, according to the present embodiment, convenience can be improved.

なお、カードスワイプの静電気による影響は、デバイスのリセットだけでなく、デバイスが暴走する事例もある。デバイスが暴走した場合、電源を入れ直せば復帰させることができる。   Note that the effects of card swipes caused by static electricity include not only device resets but also cases where devices run away. If a device goes out of control, it can be restored by turning it on again.

図6は、本実施形態の情報処理システムにおいて、通信切断と静電気によるCPUリセットが発生した場合の効果を、状態監視処理を行わない構成を比較例と比較して示す図である。   FIG. 6 is a diagram showing the effect when the CPU is disconnected due to disconnection of communication and static electricity in the information processing system according to the present embodiment, in comparison with a comparative example in which the state monitoring process is not performed.

図6に示すように、通信が切断されれば、本実施形態および比較例の両方ともエラーが検出できた。
一方、静電気でカードリーダ30のCPU31がリセットされ磁気リード可能状態が解除された場合、状態監視無の比較例ではエラーの検出を行うことができなかった。
CPU31がリセットされると、カードリーダ30が磁気リード可能状態は解除されてしまうが、正常に動作している。
そのため、状態監視を行わない比較例では、上位装置側はカードリーダからの磁気データ待ち、カードリーダは上位装置からのコマンド待ち、カードを走査しても磁気リードせず、の状態となっている。
すなわち、上位装置から見れば、カードリーダは無応答である。
これに対して、状態監視を行う(状態監視有り)の本実施形態(本例)の場合では、磁気リード状態が解除されたことを上位装置20側は検出することができることから、再度カードリーダを磁気リード可能状態に遷移させれば、エラーの検出と復旧ができる。
As shown in FIG. 6, if communication is cut off, an error can be detected in both this embodiment and the comparative example.
On the other hand, when the CPU 31 of the card reader 30 is reset by static electricity and the magnetic readable state is released, an error cannot be detected in the comparative example without state monitoring.
When the CPU 31 is reset, the card reader 30 is released from the magnetic readable state, but is operating normally.
For this reason, in the comparative example in which state monitoring is not performed, the host device waits for magnetic data from the card reader, the card reader waits for commands from the host device, and does not magnetically read even when the card is scanned. .
That is, the card reader does not respond from the host device.
On the other hand, in the case of this embodiment (this example) in which state monitoring is performed (with state monitoring), since the host device 20 side can detect that the magnetic read state has been released, the card reader again. Can be detected and recovered by transitioning to a magnetic readable state.

[他の実施形態]
上述した実施形態では、エンドポイントを上記のように設定した例を示したが、エンドポイントの数や転送モードにより、種々の組み合わせで実現することが可能である。
[Other Embodiments]
In the above-described embodiment, an example in which the endpoints are set as described above has been described. However, the embodiment can be realized in various combinations depending on the number of endpoints and the transfer mode.

また、上述した実施形態では、カードリーダ30として、磁気ストライプを有するカード状媒体を走行基準面に沿って手動走行させるスワイプ式のものを採用しているが、本発明はこれに限られない。   In the above-described embodiment, the card reader 30 is a swipe type that manually drives a card-like medium having a magnetic stripe along the running reference plane. However, the present invention is not limited to this.

なお、以上詳細に説明した方法は、上記手順に応じたプログラムとして形成し、CPU等のコンピュータで実行するように構成することも可能である。
また、このようなプログラムは、半導体メモリ、磁気ディスク、光ディスク、フロッピー(登録商標)ディスク等の記録媒体、この記録媒体をセットしたコンピュータによりアクセスし上記プログラムを実行するように構成可能である。
Note that the method described above in detail can be formed as a program according to the above-described procedure and executed by a computer such as a CPU.
Further, such a program can be configured to be accessed by a recording medium such as a semiconductor memory, a magnetic disk, an optical disk, a floppy (registered trademark) disk, or the like, and to execute the program by a computer in which the recording medium is set.

10・・・情報処理システムは、20・・・上位装置、21・・・CPU(処理部)、22・・・ROM、23・・・RAM、24・・・ストレージユニット、25・・・上位(ホスト)側USB通信部、30・・・カードリーダ、31・・・CPU(処理部)、32・・・ROM、33・・・RAM、34・・・USB通信部、35・・・読み取り部、40・・・USBケーブル。   DESCRIPTION OF SYMBOLS 10 ... Information processing system is 20 ... Host apparatus, 21 ... CPU (processing part), 22 ... ROM, 23 ... RAM, 24 ... Storage unit, 25 ... Host (Host) side USB communication unit, 30 ... card reader, 31 ... CPU (processing unit), 32 ... ROM, 33 ... RAM, 34 ... USB communication unit, 35 ... reading 40, USB cable.

Claims (7)

上位装置との間で非同期で通信を行い、状況に応じた処理を実行して、当該上位装置に対して現在の状態と処理結果を送信する情報処理装置であって、
前記上位装置との間でUSB通信を行うUSB通信部を有し、
前記USB通信部は、
前記上位装置が前記情報処理装置からの応答を待ち続ける待機状態である場合、前記情報処理装置の状態を確認するための双方向通信専用の、コントロール転送であり、制御用エンドポイントである第1のエンドポイントと、
当該情報処理装置から前記上位装置に向かって応答を返すための片方向通信専用の第2のエンドポイントと、
当該情報処理装置が前記上位装置からコマンドを受信するための片方向通信専用の第3のエンドポイントと、を含み、
前記待機状態である場合、前記情報処理装置は前記情報処理装置の状態を自身のメモリの特定のアドレスに書き込み、
前記上位装置から前記双方向通信専用の前記第1のエンドポイントを通して定期的に前記情報処理装置のメモリの特定のアドレスのデータを要求され、
前記情報処理装置がイネーブルであることが確認される
ことを特徴とする情報処理装置。
An information processing device that performs asynchronous communication with a host device, executes processing according to the situation, and transmits the current state and processing result to the host device,
A USB communication unit for performing USB communication with the host device;
The USB communication unit
When the host device is in a standby state in which it waits for a response from the information processing device, it is a control transfer dedicated to bidirectional communication for confirming the state of the information processing device , and is a first control endpoint. and the end point of,
A second endpoint dedicated to one-way communication for returning a response from the information processing device to the host device;
A third endpoint dedicated to one-way communication for the information processing device to receive a command from the host device,
When in the standby state, the information processing device writes the state of the information processing device to a specific address of its own memory,
The host device is periodically requested for data at a specific address in the memory of the information processing device through the first endpoint dedicated to the bidirectional communication,
It is confirmed that the information processing apparatus is enabled .
前記情報処理装置は、手動で走査される情報記録媒体に記録された情報を読み取る
ことを特徴とする請求項1記載の情報処理装置。
The information processing apparatus, an information processing apparatus according to claim 1, wherein the reading the information recorded on the information recording medium to be scanned manually.
前記情報処理装置は、情報が記録されたカード状媒体を処理するカードリーダである
ことを特徴とする請求項1または2記載の情報処理装置。
The information processing apparatus according to claim 1, wherein the information processing apparatus is a card reader that processes a card-like medium on which information is recorded.
上位装置と、
前記上位装置との間で非同期で通信を行い、状況に応じた処理を実行して、当該上位装置に対して現在の状態と処理結果を送信する情報処理装置と、を有し、
前記上位装置は、
所定のエンドポイントを通して前記情報処理装置の状態を確認するための状態監視を行う機能を含み、
前記情報処理装置は、
前記上位装置との間でUSB通信を行うUSB通信部を有し、
前記USB通信部は、
前記上位装置が前記情報処理装置からの応答を待ち続ける待機状態である場合、前記情報処理装置の状態を確認するための双方向通信専用の、コントロール転送であり、制御用エンドポイントである第1のエンドポイントと、
当該情報処理装置から前記上位装置に向かって応答を返すための片方向通信専用の第2のエンドポイントと、
当該情報処理装置が前記上位装置からコマンドを受信するための片方向通信専用の第3のエンドポイントと、を含み、
前記待機状態である場合、前記情報処理装置は前記情報処理装置の状態を自身のメモリの特定のアドレスに書き込み、
前記上位装置は、
前記双方向通信専用の前記第1のエンドポイントを通して定期的に前記情報処理装置のメモリの特定のアドレスのデータを要求し、
前記情報処理装置がイネーブルであることを確認する
ことを特徴とする情報処理システム。
A host device;
An information processing device that performs asynchronous communication with the host device, executes processing according to the situation, and transmits the current state and processing result to the host device,
The host device is
Including a function of performing status monitoring for confirming the status of the information processing apparatus through a predetermined endpoint;
The information processing apparatus includes:
A USB communication unit for performing USB communication with the host device;
The USB communication unit
When the host device is in a standby state in which it waits for a response from the information processing device, it is a control transfer dedicated to bidirectional communication for confirming the state of the information processing device , and is a control endpoint. and the end point of,
A second endpoint dedicated to one-way communication for returning a response from the information processing device to the host device;
A third endpoint dedicated to one-way communication for the information processing device to receive a command from the host device,
When in the standby state, the information processing device writes the state of the information processing device to a specific address of its own memory,
The host device is
Periodically requesting data at a specific address in the memory of the information processing device through the first endpoint dedicated to the bidirectional communication;
An information processing system for confirming that the information processing apparatus is enabled .
前記情報処理装置は、手動で走査される情報記録媒体に記録された情報を読み取る
ことを特徴とする請求項4記載の情報処理システム。
The information processing apparatus, an information processing system according to claim 4, wherein the reading the information recorded on the information recording medium to be scanned manually.
前記情報処理装置は、情報が記録されたカード状媒体を処理するカードリーダである
ことを特徴とする請求項4または5記載の情報処理システム。
The information processing system according to claim 4, wherein the information processing apparatus is a card reader that processes a card-like medium on which information is recorded.
上位装置との間で非同期で通信を行い、状況に応じた処理を実行して、当該上位装置に対して現在の状態と処理結果を送信する情報処理装置の情報処理方法であって、
前記上位装置との間でUSB通信を行うUSB通信部に、少なくとも前記上位装置が前記情報処理装置からの応答を待ち続ける待機状態である場合、前記情報処理装置の状態を確認するための双方向通信専用の、コントロール転送であり、制御用エンドポイントである第1のエンドポイントを形成し、
当該情報処理装置から前記上位装置に向かって応答を返すための片方向通信専用の第2のエンドポイントを形成し、
当該情報処理装置が前記上位装置からコマンドを受信するための片方向通信専用の第3のエンドポイントを形成し、
前記待機状態である場合、前記情報処理装置は前記情報処理装置の状態を自身のメモリの特定のアドレスに書き込み、
前記上位装置から前記双方向通信専用の前記第1のエンドポイントを通して定期的に前記情報処理装置のメモリの特定のアドレスのデータを要求し、
前記情報処理装置がイネーブルであることを確認する
ことを特徴とする情報処理方法。
An information processing method for an information processing device that performs asynchronous communication with a host device, executes processing according to the situation, and transmits a current state and a processing result to the host device,
Bidirectional for confirming the state of the information processing device when the USB communication unit that performs USB communication with the upper device is in a standby state where at least the upper device waits for a response from the information processing device A communication-only control transfer, forming a first endpoint that is a control endpoint ,
Forming a second endpoint dedicated to one-way communication for returning a response from the information processing device to the host device;
Forming a third endpoint dedicated to one-way communication for the information processing device to receive a command from the host device;
When in the standby state, the information processing device writes the state of the information processing device to a specific address of its own memory,
Requesting data at a specific address in the memory of the information processing device periodically from the host device through the first endpoint dedicated to the bidirectional communication,
An information processing method comprising: confirming that the information processing apparatus is enabled .
JP2013071787A 2013-03-29 2013-03-29 Information processing apparatus, information processing method, and information processing system Expired - Fee Related JP6162454B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013071787A JP6162454B2 (en) 2013-03-29 2013-03-29 Information processing apparatus, information processing method, and information processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013071787A JP6162454B2 (en) 2013-03-29 2013-03-29 Information processing apparatus, information processing method, and information processing system

Publications (2)

Publication Number Publication Date
JP2014197254A JP2014197254A (en) 2014-10-16
JP6162454B2 true JP6162454B2 (en) 2017-07-12

Family

ID=52358007

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013071787A Expired - Fee Related JP6162454B2 (en) 2013-03-29 2013-03-29 Information processing apparatus, information processing method, and information processing system

Country Status (1)

Country Link
JP (1) JP6162454B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7448815B2 (en) * 2020-06-11 2024-03-13 株式会社バッファロー Information processing system, storage device, host device, and program

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001222503A (en) * 2000-02-08 2001-08-17 Ricoh Co Ltd Peripheral equipment control system
JP2002073520A (en) * 2000-08-31 2002-03-12 Canon Inc Information processor, data communication processing method, and storage medium
JP3884448B2 (en) * 2004-05-17 2007-02-21 株式会社東芝 Semiconductor memory device
JP2008107997A (en) * 2006-10-24 2008-05-08 Seiko Epson Corp Data communication method, data communication device and data communication system
JP5352794B2 (en) * 2008-09-30 2013-11-27 日本電産サンキョー株式会社 Driver module, magnetic information processing system, and magnetic information reader
US8332557B2 (en) * 2008-12-12 2012-12-11 Qualcomm, Incorporated System, apparatus, and method for broadcasting USB data streams
JP5504453B2 (en) * 2009-06-02 2014-05-28 日本電産サンキョー株式会社 Subordinate apparatus and information processing system

Also Published As

Publication number Publication date
JP2014197254A (en) 2014-10-16

Similar Documents

Publication Publication Date Title
JP5917069B2 (en) COMMUNICATION CONTROL DEVICE AND ITS CONTROL METHOD
CN100366029C (en) Communication controller, host-side controller, communication equipment, communication system and method
KR100968641B1 (en) Point-to-point link negotiation method and apparatus
EP1439453A2 (en) SAN/NAS integrated storage system
CN109558371B (en) Method for communicating with a microcontroller, and computing system
US7493422B2 (en) Loss of universal serial bus communication
JP5096905B2 (en) Server apparatus and link recovery processing method thereof
US6654843B1 (en) Hot swapping
US8862792B2 (en) Retrieving status information from a remote device and corresponding host system
EP2677439A2 (en) Active cable management
US7124235B2 (en) USB apparatus with switchable host/hub functions and control method thereof
JP6162454B2 (en) Information processing apparatus, information processing method, and information processing system
US7757016B2 (en) Data transfer device, semiconductor integrated circuit, and processing status notification method
CN110175146B (en) Hard disk information acquisition method and device for acquiring hard disk information
CN116126613A (en) Position detection method and device of PCIe (peripheral component interconnect express) equipment, electronic equipment and storage medium
US20100031087A1 (en) Method of control in a system having a media reader
US11334506B2 (en) Interface connection device, system and method thereof
JP5771927B2 (en) COMMUNICATION DEVICE, COMMUNICATION UNIT, COMMUNICATION SYSTEM, COMMUNICATION METHOD, AND PROGRAM
EP2851801B1 (en) Computer system, control method for computer system and coupling module
CN104123257A (en) Universal serial bus devices, communication method, and computer readable storage medium
US9513680B2 (en) Relaying device, relaying method, and power control system
JP5743484B2 (en) COMMUNICATION CONTROL DEVICE AND ITS CONTROL METHOD
JP5492844B2 (en) Interface connection method and computer
US20070050666A1 (en) Computer Network System and Related Method for Monitoring a Server
JP2009026165A (en) Controller, electronic apparatus, and method for controlling electronic apparatus

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20160205

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20161116

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20161220

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170220

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20170606

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170615

R150 Certificate of patent or registration of utility model

Ref document number: 6162454

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees