JP2011186857A - Host device and device control method - Google Patents

Host device and device control method Download PDF

Info

Publication number
JP2011186857A
JP2011186857A JP2010052361A JP2010052361A JP2011186857A JP 2011186857 A JP2011186857 A JP 2011186857A JP 2010052361 A JP2010052361 A JP 2010052361A JP 2010052361 A JP2010052361 A JP 2010052361A JP 2011186857 A JP2011186857 A JP 2011186857A
Authority
JP
Japan
Prior art keywords
unit
host
information
correspondence information
port
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2010052361A
Other languages
Japanese (ja)
Inventor
Masanori Inoue
正則 井上
Takahiro Oe
隆弘 大江
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.)
Glory Ltd
Original Assignee
Glory Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Glory Ltd filed Critical Glory Ltd
Priority to JP2010052361A priority Critical patent/JP2011186857A/en
Priority to PCT/JP2011/055468 priority patent/WO2011111731A1/en
Publication of JP2011186857A publication Critical patent/JP2011186857A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/102Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver

Abstract

<P>PROBLEM TO BE SOLVED: To reduce the time required to recover the communication between a device and a host device when the device is temporarily disconnected or recognized again after reconnection, and also to eliminate the necessity for correcting an application even if a device configuration is changed. <P>SOLUTION: A device control method is configured so that: a host device acquires correspondence information in which a device identifier identifying a device and a pseudo-address showing a virtual address which is released to an application operating on the host device or a device higher than the host device are correlated to each other; the host device acquires a device identifier from a device connected to a port thereof; if the acquired device identifier is included in the correspondence information, the port which is the source of the acquired device identifier is connected to the pseudo-address corresponding to the device identifier in the correspondence information and to the host device. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

この発明は、上位装置から一旦切断されたり、また、再接続されたデバイスを再認識する際、通信の復旧にかかる時間を短縮するとともに、デバイスの構成に変更があった場合であってもアプリケーションの修正を不要とする上位装置およびデバイス制御方法に関する。   The present invention reduces the time required for communication recovery when a device once disconnected from a host device or re-recognizes a reconnected device, and can be applied even when the device configuration is changed. The present invention relates to a host apparatus and a device control method that do not require correction of the above.

従来から、OS(Operating System)が搭載されており、OS上で動作するアプリケーションが組み込まれている装置(以下、「上位装置」と記載する)には、通信ケーブル等によって周辺機器であるデバイスが接続されている。   2. Description of the Related Art Conventionally, an OS (Operating System) is installed, and a device (hereinafter referred to as a “higher level device”) in which an application operating on the OS is installed includes a device that is a peripheral device by a communication cable or the like. It is connected.

たとえば、パソコンを上位装置とした場合、パソコンには、ディスプレイ、キーボードおよびプリンタ等のデバイスが接続されており、ワープロや表計算のアプリケーションとデバイスとの間の通信を行っている。   For example, when a personal computer is a host device, devices such as a display, a keyboard, and a printer are connected to the personal computer, and communication is performed between a word processor or a spreadsheet application and the device.

近年では、通信ケーブルとして、上位装置の電源が入ったままでもケーブルの挿抜が可能であるホットプラグ機能を有するUSB(Universal Serial Bus)ケーブルが普及してきている。   In recent years, as a communication cable, a USB (Universal Serial Bus) cable having a hot plug function that can be inserted / removed even when the power of the host device is turned on has become widespread.

そして、USBケーブルで上位装置と接続されているデバイスとの通信が切断され、再び接続された場合に、上位装置は、デバイスを再認識するために、上位装置に備える所定の機能を再起動する等の復旧処理を行っていた。   Then, when communication with the device connected to the host device is disconnected and reconnected using the USB cable, the host device restarts a predetermined function provided in the host device in order to re-recognize the device. The recovery process was performed.

たとえば、特許文献1には、上位装置とデバイスとの通信が切断され、再接続された際に、上位装置内のデバイスを制御する機能(以下、「デバイス制御モジュール」と記載する)を再起動して、デバイスとの通信の復旧を行う上位装置が開示されている。   For example, Patent Document 1 restarts a function (hereinafter referred to as “device control module”) that controls a device in a host device when communication between the host device and the device is disconnected and reconnected. Thus, a host device that restores communication with the device is disclosed.

また、上位装置内のアプリケーションが、接続されている全てのデバイスと再通信を行うことによって、いずれのデバイスが再接続されたのかを判断し、通信の復旧処理を行う上位装置もある。   In addition, there is a host device that performs communication recovery processing by determining which device has been reconnected by re-communication with all connected devices by an application in the host device.

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

しかしながら、特許文献1の上位装置は、一旦切断されたデバイスを再認識するには、デバイス制御モジュールを再起動し、初期処理を行う必要があるため、デバイスとの通信の復旧処理に時間がかかってしまうという問題があった。   However, since the host device of Patent Document 1 needs to restart the device control module and perform initial processing in order to re-recognize a once disconnected device, it takes time to recover communication with the device. There was a problem that.

また、アプリケーションが、再接続されたデバイスの再認識処理を行っている場合には、上位装置と接続されるデバイスの構成に変更があるたびにアプリケーション側も変更をする必要がある。すなわち、デバイスの構成の変更をアプリケーションにも反映させるために、アプリケーションプログラムの変更を行わなくてはならない。   In addition, when the application is performing re-recognition processing of the reconnected device, the application side needs to change whenever the configuration of the device connected to the higher-level device is changed. That is, the application program must be changed in order to reflect the change in the device configuration in the application.

アプリケーションの変更を行う場合には、アプリケーションの開発および再インストール作業等、作業負担がかかる。また、アプリケーションを利用する側にとってもデバイスの構成に変更があった場合、アプリケーションの変更が反映されるまでアプリケーションを利用できなくなることによって不便さを感じてしまう。   When an application is changed, a work load such as application development and reinstallation work is applied. Also, if there is a change in the configuration of the device for the user who uses the application, the application cannot be used until the change of the application is reflected, which is inconvenient.

さらに、上位装置に接続されるデバイスが増えた場合には、従来の上位装置は、接続される全てのデバイスに対して通信状態を確認する必要があるため、デバイスの数が増えれば増えるほど再認識処理の時間がかかるという問題があった。   Furthermore, when the number of devices connected to the host device increases, the conventional host device needs to confirm the communication state with respect to all connected devices. Therefore, the number of devices increases as the number of devices increases. There was a problem that it took time for recognition processing.

これらのことから、上位装置から一旦切断されたり、また、再接続されたデバイスを再認識する際、通信の復旧にかかる時間を短縮するとともに、デバイスの構成に変更があった場合であってもアプリケーションの修正を不要とするデバイス制御方法をいかにして実現するかが大きな課題となっている。   Therefore, when disconnecting from the host device or re-recognizing the reconnected device, the time required for recovery of communication is shortened and the device configuration is changed. A major issue is how to realize a device control method that does not require application modification.

本発明は、上述した従来技術による問題点を解消するためになされたものであって、上位装置から一旦切断されたり、また、再接続されたデバイスを再認識する際、通信の復旧にかかる時間を短縮するとともに、デバイスの構成に変更があった場合であってもアプリケーションの修正を不要とするデバイス制御方法を提供することを目的とする。   The present invention has been made to solve the above-described problems caused by the prior art, and it takes time to restore communication when a device once disconnected from a higher-level device or re-recognizes a reconnected device. It is an object of the present invention to provide a device control method that makes it unnecessary to modify an application even when the device configuration is changed.

上述した課題を解決し、目的を達成するため、本発明は、デバイス接続用のポートへ接続されたデバイスと通信する上位装置であって、前記デバイスを識別するデバイス識別子と、前記上位装置上または該上位装置の上位装置上で動作するアプリケーションに対して公開される仮想的な宛先を示す疑似宛先とを対応付けた対応情報を取得する対応情報取得部と、前記ポートに接続された前記デバイスから前記デバイス識別子を取得する取得部と、前記取得部によって取得された前記デバイス識別子が前記対応情報に含まれる場合に、当該デバイス識別子の取得元となった前記ポートを、前記対応情報において当該デバイス識別子と対応付けられている前記疑似宛先と接続する接続部とを備えたことを特徴とする。このように、予め対応情報に記憶されるデバイス識別子に対して、かかるデバイス識別子と疑似宛先を接続することによって上位装置から一旦切断されたり、また、再接続されたデバイスを再認識する際、通信の復旧にかかる時間を短縮するとともに、デバイスの構成に変更があった場合であってもアプリケーションの修正を不要とするという効果を奏する。   In order to solve the above-described problems and achieve the object, the present invention provides a host device that communicates with a device connected to a device connection port, the device identifier for identifying the device, and the host device or From the device connected to the port, a correspondence information acquisition unit that acquires correspondence information that associates a pseudo-destination that indicates a virtual destination that is disclosed to an application that operates on the host device of the host device, and the device connected to the port When the correspondence information includes the acquisition unit that acquires the device identifier and the device identifier acquired by the acquisition unit, the port that is the acquisition source of the device identifier is the device identifier in the correspondence information. And a connection unit for connecting to the pseudo-destination associated with the. As described above, when the device identifier stored in the correspondence information in advance is disconnected from the host device by connecting the device identifier and the pseudo destination, or when re-recognizing the reconnected device, communication is performed. In addition to shortening the time required for restoration, there is an effect that it is not necessary to modify the application even when the device configuration is changed.

また、本発明は、上記の発明において、前記接続部によって接続された前記ポートと前記疑似宛先との接続状態を接続情報として作成する接続情報作成部をさらに備えたことを特徴とする。このように、接続状態を記憶することによって上位装置が接続状態を把握することができるとともに、誤送信することなくデバイスと疑似宛先との通信を中継することができるという効果を奏する。   Further, the present invention is characterized in that, in the above-mentioned invention, a connection information creating unit that creates a connection state between the port connected by the connecting unit and the pseudo destination as connection information is provided. Thus, by storing the connection state, the higher-level apparatus can grasp the connection state, and it is possible to relay the communication between the device and the pseudo destination without erroneous transmission.

また、本発明は、上記の発明において、前記対応情報は、接続する前記ポートが固定化されていない前記デバイスのみを含むことを特徴とする。このように、挿抜が可能なデバイス、すなわち動的デバイスのみに対して接続情報が作成されることによって上位装置の立ち上げ時に、固定的に接続されるデバイスに対しては接続情報を作成する必要がないので、起動時間を短縮することができるという効果を奏する。   In the present invention according to the present invention, the correspondence information includes only the device to which the port to be connected is not fixed. In this way, it is necessary to create connection information for devices that are fixedly connected when the host device is started up by creating connection information only for devices that can be inserted and removed, that is, dynamic devices. As a result, there is an effect that the activation time can be shortened.

また、本発明は、上記の発明において、前記接続情報作成部は、前記ポートと前記デバイスとの接続が切断された場合に、当該ポートに関する前記接続情報を削除することを特徴とする。このように、動的デバイスのみに対して接続状態の監視対象とすることによって上位装置は挿抜不可のデバイスに対してはデバイスファイルの更新を行わなくてよく、通信の復旧にかかる時間を短縮することができるという効果を奏する。   Further, the present invention is characterized in that, in the above-mentioned invention, the connection information creating unit deletes the connection information regarding the port when the connection between the port and the device is disconnected. In this way, by setting the connection state monitoring target for only the dynamic device, the host device does not need to update the device file for the device that cannot be inserted / removed, thereby reducing the time required for communication restoration. There is an effect that can be.

また、本発明は、上記の発明において、前記対応情報取得部は、紙幣を処理する紙幣ユニットおよび硬貨を処理する硬貨ユニットについての前記対応情報を取得することを特徴とする。このように、紙幣処理および貨幣処理を行うアプリケーションが組み込まれている貨幣処理機に適用することによって紙幣処理が硬貨ユニットへ出金指示を送信したり、紙幣ユニットからの入金結果を硬貨処理で受け付けるといった誤動作を防止することができるという効果を奏する。   Moreover, this invention is characterized by the said correspondence information acquisition part acquiring said correspondence information about the banknote unit which processes a banknote, and the coin unit which processes a coin in said invention. In this way, the banknote processing transmits a withdrawal instruction to the coin unit by applying it to a money handling machine in which an application for performing banknote processing and money processing is incorporated, or accepts a deposit result from the banknote unit by coin processing. It is possible to prevent such a malfunction.

本発明によれば、デバイス接続用のポートへ接続されたデバイスと通信する上位装置であって、デバイスを識別するデバイス識別子と、上位装置上または該上位装置の上位装置上で動作するアプリケーションに対して公開される仮想的な宛先を示す疑似宛先とを対応付けた対応情報を上位装置が取得し、ポートに接続されたデバイスからデバイス識別子を上位装置が取得し、取得されたデバイス識別子が対応情報に含まれる場合に、当該デバイス識別子の取得元となったポートを、対応情報において当該デバイス識別子と対応付けられている疑似宛先と上位装置が接続することとしたので、上位装置から一旦切断されたり、また、再接続されたデバイスを再認識する際、通信の復旧にかかる時間を短縮するとともに、デバイスの構成に変更があった場合であってもアプリケーションの修正を不要とすることができるという効果を奏する。   According to the present invention, for a host device that communicates with a device connected to a device connection port, a device identifier that identifies the device and an application that operates on the host device or the host device of the host device The host device acquires correspondence information that associates a pseudo-destination that indicates a virtual destination that is publicly displayed, the host device acquires a device identifier from the device connected to the port, and the acquired device identifier is the correspondence information. The host from which the device identifier was acquired is connected to the pseudo-destination associated with the device identifier in the correspondence information and the host device. In addition, when re-recognizing a reconnected device, the communication recovery time is reduced and the device configuration is changed. Even when Tsu advantageously possible to eliminate the need to modify the application.

図1は、本発明に係るデバイス制御手法の概要を示す図である。FIG. 1 is a diagram showing an outline of a device control method according to the present invention. 図2は、本実施例に係る上位装置およびデバイスの構成を示すブロック図である。FIG. 2 is a block diagram illustrating the configurations of the host device and the device according to the present embodiment. 図3は、エントリ情報の一例を示す図である。FIG. 3 is a diagram illustrating an example of entry information. 図4は、デバイス対応情報の一例を示す図である。FIG. 4 is a diagram illustrating an example of device correspondence information. 図5は、デバイスファイルの一例を示す図である。FIG. 5 is a diagram illustrating an example of a device file. 図6は、リンク情報の一例を示す図である。FIG. 6 is a diagram illustrating an example of link information. 図7は、動的デバイスを説明する図である。FIG. 7 is a diagram illustrating a dynamic device. 図8は、リンク情報の更新例を示す図である。FIG. 8 is a diagram illustrating an example of updating link information. 図9は、上位装置が実行するデバイス起動処理手順を示すフローチャートである。FIG. 9 is a flowchart illustrating a device activation processing procedure executed by the host apparatus. 図10は、上位装置が実行するデバイス監視処理手順を示すフローチャートである。FIG. 10 is a flowchart illustrating a device monitoring processing procedure executed by the host apparatus.

以下に添付図面を参照して、本発明に係る上位装置およびデバイス制御方法の実施例を詳細に説明する。まず、実施例の詳細な説明に先立って、本発明に係るデバイス制御手法の概要について図1を用いて説明する。なお、上位装置には、紙幣ユニットおよび硬貨ユニットがUSBケーブルによって接続されている貨幣処理機を一例に挙げて説明する。   Exemplary embodiments of a host device and a device control method according to the present invention will be described below in detail with reference to the accompanying drawings. First, prior to detailed description of the embodiments, an outline of a device control method according to the present invention will be described with reference to FIG. As an example of the host device, a money handling machine in which a banknote unit and a coin unit are connected by a USB cable will be described.

図1は、本発明に係るデバイス制御手法の概要を示す図である。以下では、まず、同図の(A)を用いて従来のデバイス制御手法の概要を説明し、同図の(B)を用いて本発明に係るデバイス制御手法の概要を説明する。   FIG. 1 is a diagram showing an outline of a device control method according to the present invention. In the following, first, an outline of a conventional device control method will be described using (A) of the figure, and an outline of a device control technique according to the present invention will be explained using (B) of the figure.

まず、図1の(A)に示したように、従来のデバイス制御手法では、アプリケーションとデバイスとの間で通信を行う際、制御部では通信の節点であるデバイスノードおよびデバイスノードの物理宛先を管理していた。   First, as shown in FIG. 1A, in the conventional device control method, when communication is performed between an application and a device, the control unit determines the device node that is a communication node and the physical destination of the device node. I was managing.

ここで、紙幣処理を行うアプリケーション(以下、「紙幣アプリ」と記載する)とデバイスの一つである紙幣ユニットとは、デバイスノード0を介してホットプラグ機能を有するUSBケーブルで接続されているとする(図1(A−1)参照)。   Here, an application that performs banknote processing (hereinafter referred to as “banknote application”) and a banknote unit that is one of the devices are connected via a device node 0 with a USB cable having a hot plug function. (See FIG. 1A-1).

また、硬貨処理を行うアプリケーション(以下、「硬貨アプリ」と記載する)と硬貨ユニットとは、デバイスノード1を介してUSBケーブルで接続されているとする。図1の(A−1)では、USBケーブルの差し替えが行われる前の接続状態を、実線の矢印で示している。   Further, it is assumed that an application for performing coin processing (hereinafter referred to as “coin application”) and a coin unit are connected via a device node 1 with a USB cable. In FIG. 1A-1, the connection state before the USB cable is replaced is indicated by a solid arrow.

この場合、従来のデバイス制御手法では、紙幣アプリは紙幣ユニットへデータの送信を行う際、デバイスノード0に対して送信指示を出し、硬貨アプリは硬貨ユニットへデータの送信を行う際、デバイスノード1に対して送信指示を出す。   In this case, in the conventional device control method, when the banknote application transmits data to the banknote unit, it issues a transmission instruction to the device node 0, and when the coin application transmits data to the coin unit, the device node 1 A transmission instruction is issued.

ここで、USBケーブルは上位装置の電源が入ったままでもケーブルの挿抜が可能である。そして、紙幣ユニットと硬貨ユニットとに接続されているUSBケーブルが差し替えられたとする(図1(A−2)参照)。この場合、破線の矢印で示したように、USBケーブルの差し替え後は、デバイスノード0には硬貨ユニットが、デバイスノード1には紙幣ユニットが接続される場合がある。   Here, the USB cable can be inserted and removed even when the host device is powered on. Then, it is assumed that the USB cable connected to the bill unit and the coin unit has been replaced (see FIG. 1A-2). In this case, as indicated by the dashed arrow, a coin unit may be connected to the device node 0 and a bill unit may be connected to the device node 1 after the USB cable is replaced.

この場合、紙幣アプリはデバイスノード0に対して紙幣ユニットへの送信指示を出されると、デバイスノード0には硬貨ユニットが接続されているので、硬貨ユニットへ誤送信されてしまう(図1(A−3)参照)。   In this case, when the bill application issues a transmission instruction to the bill unit to the device node 0, since the coin unit is connected to the device node 0, the bill app is erroneously transmitted to the coin unit (FIG. 1A). -3))).

また、従来のデバイス制御手法では、アプリケーションが、デバイスノードとデバイスとの接続状態を確認しながら制御部へ送信指示を出す手法もあった。たとえば、アプリケーションが接続されている全てのデバイスノード(ここでは、デバイスノード0およびデバイスノード1)に対して接続状態の問合せを行い、送信処理を開始していた。しかし、接続される全てのデバイスに対して接続状態を確認する必要があるため、デバイスの数が増えれば増えるほど再認識処理が複雑になり時間がかかってしまう。   In the conventional device control method, there is also a method in which an application issues a transmission instruction to the control unit while confirming the connection state between the device node and the device. For example, all device nodes to which the application is connected (here, device node 0 and device node 1) are inquired about the connection state, and transmission processing is started. However, since it is necessary to check the connection state for all connected devices, the re-recognition process becomes more complicated and takes longer as the number of devices increases.

そこで、本発明に係るデバイス制御手法では、図1の(B)に示したように、デバイスごとに固定に設定された仮想的宛先として疑似ノードを設け、疑似ノードをアプリケーションに対して公開するようにした。そして、アプリケーション側が所望のデバイスへ送信指示を出す際には、仮想的宛先へ送信指示を出すことになる。   Therefore, in the device control method according to the present invention, as shown in FIG. 1B, a pseudo node is provided as a virtual destination fixed for each device, and the pseudo node is disclosed to the application. I made it. When the application side issues a transmission instruction to a desired device, the transmission instruction is issued to a virtual destination.

また、本発明に係るデバイス制御手法では、デバイスの接続が行われた際、デバイスノードに接続されているデバイスがいずれのユニットであるかを認識した上で、各疑似ノードに対応するデバイスに接続されるよう切換えることとした。   In the device control method according to the present invention, when a device is connected, the device connected to the device node is recognized and then connected to the device corresponding to each pseudo node. It was decided to switch so that

具体的には、図1(B−1)の実線の矢印で示したように、USBケーブルの差し替えが行われる前の接続状態は、紙幣ユニットとデバイスノード0とが接続されており、硬貨ユニットとデバイスノード1とが接続されているとする。   Specifically, as shown by the solid line arrow in FIG. 1 (B-1), the banknote unit and the device node 0 are connected in the connection state before the USB cable is replaced, and the coin unit And device node 1 are connected.

また、図1(B−2)の実線の矢印で示したように、紙幣ユニットが接続されているデバイスノード0と疑似ノード0とを対応付けることによって疑似ノード0はデバイスノード0を介して紙幣ユニットに接続される。疑似ノード1も同様にデバイスノード1を介して硬貨ユニットに接続される。   Further, as indicated by the solid line arrow in FIG. 1 (B-2), by associating the device node 0 to which the bill unit is connected with the pseudo node 0, the pseudo node 0 is connected to the bill unit via the device node 0. Connected to. Similarly, the pseudo node 1 is connected to the coin unit via the device node 1.

ここで、紙幣ユニットと硬貨ユニットとに接続されているUSBケーブルが差し替えられたとする(図1(B−3)参照)。この場合、破線の矢印で示したように、USBケーブルの差し替え後は、デバイスノード0には硬貨ユニットが、デバイスノード1には紙幣ユニットが接続される。   Here, it is assumed that the USB cable connected to the banknote unit and the coin unit has been replaced (see FIG. 1B-3). In this case, as indicated by the dashed arrow, the coin unit is connected to the device node 0 and the bill unit is connected to the device node 1 after the replacement of the USB cable.

そこで、本発明に係るデバイス制御手法では、各デバイスノードに接続されていたデバイスがケーブルの差し替えによって入れ替わったことを認識し、疑似ノード0には、紙幣ユニットが接続されているデバイスノード1へ対応付けるよう切換える(図1(B−4)参照)。これにより、本発明に係るデバイス制御手法では、常に疑似ノード0は紙幣ユニットに接続され、疑似ノード1は硬貨ユニットに接続されることとなる。   Therefore, in the device control method according to the present invention, it is recognized that the device connected to each device node has been replaced by the replacement of the cable, and the pseudo node 0 is associated with the device node 1 to which the bill unit is connected. (See FIG. 1 (B-4)). Thereby, in the device control method according to the present invention, the pseudo node 0 is always connected to the banknote unit, and the pseudo node 1 is connected to the coin unit.

また、紙幣アプリは、紙幣ユニットへ送信指示を出す際には、常に紙幣ユニットの仮想的宛先である疑似ノード0に対して送信指示を出せばよく、紙幣ユニットが接続されているデバイスノードの物理宛先を認識する必要がない。   Further, when issuing a transmission instruction to the banknote unit, the banknote application may always issue a transmission instruction to the pseudo node 0 that is a virtual destination of the banknote unit, and the physicality of the device node to which the banknote unit is connected. There is no need to recognize the destination.

したがって、本発明に係るデバイス制御手法では、他のデバイスが増設され、接続されるデバイスの構成に変更があった場合であっても、アプリケーション側は、各デバイスに対応する仮想的宛先である疑似ノードさえ解っていればよい。そして、本発明に係るデバイス制御手法では、アプリケーションの変更を行うことなく、所望のデバイスへ送信指示が送信されることが担保される。   Therefore, in the device control method according to the present invention, even when another device is added and the configuration of the connected device is changed, the application side is a pseudo destination that is a virtual destination corresponding to each device. You only need to understand the node. In the device control method according to the present invention, it is ensured that a transmission instruction is transmitted to a desired device without changing an application.

また、本発明に係るデバイス制御手法では、接続または切断されたデバイスに対して接続状態を確認し、アプリケーション側で接続される全てのデバイスに対して接続状態を確認する必要がない。アプリケーションからのデバイスノードの認識処理が不要となるので、アプリケーションが送信指示をデバイスへ送信するまでの処理時間を短縮することができる。   In the device control method according to the present invention, it is not necessary to confirm the connection state with respect to a connected or disconnected device and to confirm the connection state with respect to all devices connected on the application side. Since the process for recognizing the device node from the application becomes unnecessary, it is possible to shorten the processing time until the application transmits a transmission instruction to the device.

なお、本発明に係るデバイス制御手法は、上位装置内のデバイスノードに近い部分、たとえば、OSの中核部分であるカーネルからのデバイスに関する情報を参照することで挿抜機能を有する紙幣ユニットや硬貨ユニット等の貨幣処理機に対し、信頼性の高い認識処理を提供することができる。   The device control method according to the present invention is a bill unit or a coin unit having an insertion / extraction function by referring to information about a device from a kernel that is a core part of an OS, for example, a part close to a device node in a host device. It is possible to provide a highly reliable recognition process for the money handling machine.

以下では、図1を用いて説明したデバイス制御手法を適用した上位装置についての実施例を詳細に説明する。まず、本実施例に係る上位装置10およびデバイス20の構成について図2を用いて説明する。   Below, the Example about the high-order apparatus to which the device control method demonstrated using FIG. 1 is applied is described in detail. First, the configurations of the host device 10 and the device 20 according to the present embodiment will be described with reference to FIG.

図2は、本実施例に係る上位装置10およびデバイス20の構成を示すブロック図である。なお、図2では、上位装置10およびデバイス20の特徴点を説明するために必要な構成要素のみを抜粋して示している。   FIG. 2 is a block diagram illustrating the configuration of the host device 10 and the device 20 according to the present embodiment. In FIG. 2, only constituent elements necessary for explaining the characteristic points of the host device 10 and the device 20 are extracted and shown.

まず、上位装置10は、アプリケーション11と、デバイスドライバ12と、記憶部13と、制御部14とを備えている。また、記憶部13は、エントリ情報13aと、デバイス対応情報13bと、デバイスファイル13cと、リンク情報13dとを記憶し、制御部14は、デバイス起動部14aと、デバイスファイル作成部14bと、デバイス監視部14cと、デバイスファイル更新部14dと、中継部14eとをさらに備えている。   First, the host device 10 includes an application 11, a device driver 12, a storage unit 13, and a control unit 14. The storage unit 13 stores entry information 13a, device correspondence information 13b, a device file 13c, and link information 13d. The control unit 14 includes a device activation unit 14a, a device file creation unit 14b, a device information A monitoring unit 14c, a device file update unit 14d, and a relay unit 14e are further provided.

アプリケーション11は、ある特定の目的のために設計されたソフトウエアであり、たとえば、紙幣ユニット20aや硬貨ユニット20bを統括するソフトウエアや画面表示を行うソフトウエアなどで構成される。   The application 11 is software designed for a specific purpose, and includes, for example, software that controls the banknote unit 20a and the coin unit 20b, software that displays a screen, and the like.

なお、アプリケーション11は、上位装置10に備えることとしたが、上位装置10の上位装置を備える構成として、アプリケーション11は、上位装置10の上位装置に備えることとしてもよい。すなわち、上位装置10とアプリケーション11と紙幣ユニット20aや硬貨ユニット20bとの間に介在する中間装置とする構成も可能である。   Although the application 11 is provided in the host device 10, the application 11 may be provided in the host device of the host device 10 as a configuration including the host device of the host device 10. That is, a configuration in which the intermediate device is interposed between the host device 10, the application 11, and the banknote unit 20a or the coin unit 20b is also possible.

送受信部11aは、アプリケーション11からデバイスドライバ12を介してデバイス20へ貨幣計数指示等の各処理指示を、アプリケーション11に備える疑似ノード11bに対して送信する処理を行う処理部である。なお、アプリケーション11に備える疑似ノード11bは、デバイス対応情報13bで定義される疑似ノードと一致しているものとする。また、送受信部11aは、デバイス20からの応答情報を受信する処理を併せて行う。   The transmission / reception unit 11a is a processing unit that performs processing of transmitting each processing instruction such as a money counting instruction from the application 11 to the device 20 via the device driver 12 to the pseudo node 11b included in the application 11. It is assumed that the pseudo node 11b included in the application 11 matches the pseudo node defined in the device correspondence information 13b. The transmission / reception unit 11a also performs processing for receiving response information from the device 20.

デバイスドライバ12は、周辺機器であるデバイス20との通信をつかさどるソフトウエアであり、アプリケーション11が各デバイスを制御する際に、デバイスドライバ12を介して行う。   The device driver 12 is software that controls communication with the device 20 that is a peripheral device, and is performed via the device driver 12 when the application 11 controls each device.

記憶部13は、不揮発性メモリやハードディスクドライブといった記憶デバイスであり、エントリ情報13a、デバイス対応情報13b、デバイスファイル13cおよびリンク情報13dを記憶する。   The storage unit 13 is a storage device such as a nonvolatile memory or a hard disk drive, and stores entry information 13a, device correspondence information 13b, a device file 13c, and link information 13d.

エントリ情報13aは、デバイス対応情報13bを記憶しているファイル名であり、また、挿抜が可能であるホットプラグ機能を有するUSBケーブルで接続されているデバイス20(以下、「動的デバイス」と記載する)と関連付けられるデバイスファイル13cのファイル名であり、予め記憶させておく。   The entry information 13a is a file name in which the device correspondence information 13b is stored, and a device 20 (hereinafter referred to as “dynamic device”) connected by a USB cable having a hot plug function that can be inserted and removed. The file name of the device file 13c associated with the device file 13c is stored in advance.

デバイス対応情報13bは、デバイスの仮想的宛先である疑似ノード名と疑似ノードに対応する動的デバイスを一意に識別する識別子(以下、「デバイスID」と記載する)である。いずれの疑似ノードとデバイスIDとが接続されることを担保するかをデバイス対応情報13bに予め記憶させておく。   The device correspondence information 13b is a pseudo node name that is a virtual destination of the device and an identifier that uniquely identifies a dynamic device corresponding to the pseudo node (hereinafter referred to as “device ID”). Which pseudo node and device ID are guaranteed to be connected is stored in advance in the device correspondence information 13b.

デバイスファイル13cは、上位装置10に接続されるデバイス20ごとに設定され、上位装置10がデバイス20を制御する際に必要とする詳細情報である。なお、デバイスファイル13cの詳細な説明については後述することとする。   The device file 13c is set for each device 20 connected to the higher level device 10 and is detailed information required when the higher level device 10 controls the device 20. The detailed description of the device file 13c will be described later.

リンク情報13dは、デバイスファイル名に対応するデバイスIDおよび疑似ノードである。具体的には、リンク情報13dは、デバイス対応情報13bに記憶されるデバイスIDとデバイス20から取得したデバイスIDとを対応付けることで得られたデバイスファイル名と疑似ノードとの関係付けを表す情報である。   The link information 13d is a device ID and a pseudo node corresponding to the device file name. Specifically, the link information 13d is information indicating the association between the device file name obtained by associating the device ID stored in the device correspondence information 13b with the device ID acquired from the device 20, and the pseudo node. is there.

制御部14は、上位装置10の全体制御を行う制御部である。デバイス起動部14aは、エントリ情報13aとデバイス対応情報13bとに基づいて接続されるデバイス20を認識する処理を行う処理部である。   The control unit 14 is a control unit that performs overall control of the host device 10. The device activation unit 14a is a processing unit that performs processing for recognizing the connected device 20 based on the entry information 13a and the device correspondence information 13b.

また、デバイス起動部14aは、動的デバイスのデバイスファイル13cを作成するよう、デバイスファイル作成部14bへデバイスファイル13cの作成を指示する処理を併せて行う。   The device activation unit 14a also performs a process of instructing the device file creation unit 14b to create the device file 13c so as to create the device file 13c of the dynamic device.

デバイス監視部14cは、上位装置10の電源が入った状態でケーブルが挿抜され、デバイス20が切断または接続されたか否かを監視する処理を行う処理部である。具体的には、デバイス監視部14cは、デバイス20の接続状態の変化をデバイスドライバ12を介して取得すると、いずれかのデバイス20が切断または接続されたと判定する。   The device monitoring unit 14c is a processing unit that performs processing to monitor whether or not the device 20 is disconnected or connected while the power of the host device 10 is turned on. Specifically, when the device monitoring unit 14c acquires a change in the connection state of the device 20 via the device driver 12, the device monitoring unit 14c determines that any one of the devices 20 is disconnected or connected.

また、デバイス監視部14cは、デバイス20が切断または接続されたと判定した場合に、デバイスファイル更新部14dへ、デバイスファイル13cの更新を指示する処理を併せて行う。   In addition, when the device monitoring unit 14c determines that the device 20 is disconnected or connected, the device monitoring unit 14c also performs processing for instructing the device file update unit 14d to update the device file 13c.

デバイスファイル更新部14dは、デバイス20が切断または接続された旨をデバイス監視部14cから受け付けると、接続状態に変化のあったデバイス20のデバイスファイル13cおよびリンク情報13dを更新する。   Upon receiving from the device monitoring unit 14c that the device 20 has been disconnected or connected, the device file update unit 14d updates the device file 13c and link information 13d of the device 20 whose connection state has changed.

中継部14eは、送受信部11aから受け付けた疑似ノードに対する各処理指示を、リンク情報13dに基づき、デバイスドライバ12を介して疑似ノードに対応するデバイス20へ送信する処理を行う処理部である。   The relay unit 14e is a processing unit that performs processing of transmitting each processing instruction for the pseudo node received from the transmission / reception unit 11a to the device 20 corresponding to the pseudo node via the device driver 12 based on the link information 13d.

また、中継部14eは、リンク情報13dに基づき、デバイスドライバ12を介してデバイス20から受け付けた応答情報をデバイス20に対応する疑似ノードへ渡す処理を併せて行う。   Further, the relay unit 14e also performs a process of passing response information received from the device 20 via the device driver 12 to the pseudo node corresponding to the device 20 based on the link information 13d.

つづいて、デバイス20の構成について説明する。デバイス20は、上位装置10と接続される周辺機器であり、本実施例に係るデバイス20は、紙幣ユニット20aと、硬貨ユニット20bとから構成される。   Next, the configuration of the device 20 will be described. The device 20 is a peripheral device connected to the host device 10, and the device 20 according to the present embodiment includes a bill unit 20a and a coin unit 20b.

紙幣ユニット20aは、アプリケーション11から受信した処理指示に従って所定の紙幣を投出したり、挿入された紙幣を計数し、計数値を応答情報としてアプリケーション11へ送信する等、紙幣に関する処理を行う周辺機器である。   The banknote unit 20a is a peripheral device that performs processing related to banknotes such as throwing out predetermined banknotes according to processing instructions received from the application 11, counting the inserted banknotes, and transmitting the counted value to the application 11 as response information. is there.

硬貨ユニット20bは、アプリケーション11から受信した処理指示に従って所定の硬貨を投出したり、挿入された硬貨を計数し、計数値を応答情報としてアプリケーション11へ送信する等、硬貨に関する処理を行う周辺機器である。   The coin unit 20b is a peripheral device that performs processing related to coins, such as throwing out predetermined coins according to processing instructions received from the application 11, counting the inserted coins, and transmitting the counted value to the application 11 as response information. is there.

つぎに、記憶部13に記憶されるエントリ情報13a、デバイス対応情報13b、デバイスファイル13cおよびリンク情報13dの一例について図3〜図6を用いて説明する。図3は、エントリ情報13aの一例を示す図であり、図4は、デバイス対応情報13bの一例を示す図であり、図5は、デバイスファイル13cの一例を示す図であり、図6は、リンク情報13dの一例を示す図である。   Next, an example of entry information 13a, device correspondence information 13b, device file 13c, and link information 13d stored in the storage unit 13 will be described with reference to FIGS. 3 is a diagram illustrating an example of the entry information 13a, FIG. 4 is a diagram illustrating an example of the device correspondence information 13b, FIG. 5 is a diagram illustrating an example of the device file 13c, and FIG. It is a figure which shows an example of the link information 13d.

まず、図3に示すように、エントリ情報13aの1レコードには、動的デバイスの「デバイスファイル名」項目を含んでいる。エントリ情報13aには、デバイス20(紙幣ユニット20aおよび硬貨ユニット20b)と対応付けられるデバイスファイル名を予め記憶させる。ここで、動的デバイスは紙幣ユニット20aおよび硬貨ユニット20bであるので、それぞれの「デバイスファイル名」として、エントリ情報13aには、「DEV_0」と「DEV_1」との2レコード分を順不同で予め記憶させることとする。   First, as shown in FIG. 3, one record of the entry information 13a includes a “device file name” item of a dynamic device. In the entry information 13a, a device file name associated with the device 20 (the banknote unit 20a and the coin unit 20b) is stored in advance. Here, since the dynamic devices are the bill unit 20a and the coin unit 20b, two records of “DEV — 0” and “DEV — 1” are stored in advance in random order as the “device file name” in the entry information 13a. I will let you.

つぎに、図4に示すように、デバイス対応情報13bの1レコードには、「疑似ノード」項目と疑似ノードに対応付ける「デバイスID」項目とを含んでいる。デバイス対応情報13bには、いずれの疑似ノードとデバイスIDとが接続されることを担保するかを予め記憶させる。ここでは、「fix_紙幣」にはデバイスID「dID_紙幣」が、「fix_硬貨」にはデバイスID「dID_硬貨」が接続されるよう対応付けておくこととする。   Next, as shown in FIG. 4, one record of the device correspondence information 13 b includes a “pseudo node” item and a “device ID” item associated with the pseudo node. The device correspondence information 13b stores in advance which pseudo node and device ID are guaranteed to be connected. Here, the device ID “dID_banknote” is associated with “fix_banknote”, and the device ID “dID_coin” is associated with “fix_coin”.

つぎに、図5に示すように、デバイスファイル13cは、「デバイスファイル名」項目と、「メジャー番号」項目と、「マイナー番号」項目とを含んでいる。なお、同図で示す1行分が、1つのファイルとして構成される。   Next, as shown in FIG. 5, the device file 13 c includes a “device file name” item, a “major number” item, and a “minor number” item. Note that one line shown in the figure is configured as one file.

「メジャー番号」項目は、デバイスの種類で識別され、デバイスドライバ12の種類に対応する番号である。また、「マイナー番号」項目は、同じメジャー番号のデバイス同士を識別するための番号である。   The “major number” item is a number identified by the device type and corresponding to the type of the device driver 12. The “minor number” item is a number for identifying devices having the same major number.

つぎに、図6に示すように、リンク情報13dの1レコードには、「デバイスファイル名」項目と、デバイスファイル名に対応付けられた「デバイスID」項目と、デバイス対応情報13bに基づいてデバイスIDに接続される「疑似ノード」項目とを含んでいる。   Next, as shown in FIG. 6, one record of the link information 13d includes a “device file name” item, a “device ID” item associated with the device file name, and the device correspondence information 13b. And a “pseudo node” item connected to the ID.

具体的に、デバイスファイル13cおよびリンク情報13dがどのように作成されるかを、以下に説明する。まず、デバイス起動部14aは、上位装置10の電源が入れられた際に、エントリ情報13aとデバイス対応情報13bとに基づいてUSBケーブルに接続される2つのデバイス、ここでは、紙幣ユニット20aおよび硬貨ユニット20bを認識する。デバイス起動部14aは、エントリ情報13aのデバイスファイル名(ここではDEV_0とする)をキーとして制御部14はデバイスの情報を検索し、このキーと対応付いているいずれかのデバイス(紙幣ユニット20aまたは硬貨ユニット20b)を一意に識別するデバイスID(ここではdID_紙幣とする)を取得する。   Specifically, how the device file 13c and link information 13d are created will be described below. First, when the host apparatus 10 is turned on, the device activation unit 14a has two devices connected to the USB cable based on the entry information 13a and the device correspondence information 13b, here, the banknote unit 20a and the coins. Recognize unit 20b. The device activation unit 14a searches the device information using the device file name (here, DEV_0) of the entry information 13a as a key, and searches for any device (the banknote unit 20a or A device ID (in this case, dID_banknote) that uniquely identifies the coin unit 20b) is acquired.

そして、デバイスファイル作成部14bは、紙幣ユニット20aを認識する際に、デバイスファイル名が「DEV_0」であるデバイスファイル13cを作成する(図5の1行目参照)。   Then, when recognizing the banknote unit 20a, the device file creation unit 14b creates a device file 13c whose device file name is “DEV — 0” (see the first line in FIG. 5).

ここでは、USBケーブルで接続されるドライバの種類、すなわち、メジャー番号が「2」、接続されるマイナー番号が「0」の場合のデバイスファイル13cを示した。   Here, the type of the driver connected by the USB cable, that is, the device file 13c when the major number is “2” and the connected minor number is “0” is shown.

さらに、デバイスファイル作成部14bは、リンク情報13dに、デバイスIDとともに、デバイスIDが「dID_紙幣」である紙幣ユニット20aに対応付けられるデバイスファイル名「DEV_0」を登録する(図6の1行目参照)。なお、リンク情報13dの「デバイスID」項目はなくてもよく、「デバイスファイル名」項目とデバイスファイル名に対応付けられる「デバイスID」項目とを含む情報を別にもつこととしてもよい。   Furthermore, the device file creation unit 14b registers, in the link information 13d, the device file name “DEV_0” associated with the bill unit 20a having the device ID “dID_banknote” together with the device ID (first line in FIG. 6). reference). Note that the “device ID” item of the link information 13d may not be present, and information including a “device file name” item and a “device ID” item associated with the device file name may be provided separately.

また、デバイスファイル作成部14bは、デバイス起動部14aで取得されたデバイスID(dID_紙幣)をキーとして予めデバイス対応情報13bに登録されるデバイスIDに対応付けられる疑似ノードを取得する。   Further, the device file creation unit 14b acquires a pseudo node associated with the device ID registered in advance in the device correspondence information 13b using the device ID (dID_banknote) acquired by the device activation unit 14a as a key.

同時に、デバイスファイル作成部14bは、リンク情報13dに、デバイス対応情報13bに基づいてデバイスIDが「dID_紙幣」と接続される疑似ノード「fix_紙幣」とがリンクされている情報として登録する(図6の1行目参照)。   At the same time, the device file creation unit 14b registers in the link information 13d as information linked to the pseudo node “fix_banknote” connected to the device ID “dID_banknote” based on the device correspondence information 13b (FIG. (Refer to the first line of 6).

このようにすることによって、中継部14eでは、デバイスID、デバイスファイル13cおよび疑似ノードに基づいて紙幣ユニット20aと疑似ノードとの情報の送受信を行うことができる。   By doing in this way, in the relay part 14e, transmission / reception of information with the banknote unit 20a and a pseudo node can be performed based on device ID, the device file 13c, and a pseudo node.

なお、デバイス起動部14aは、エントリ情報13aに基づいてデバイス20を認識し、アプリケーション11の送受信部11aは、リンク情報13dに登録された疑似ノードと一致する疑似ノード11bに対して各処理指示を送信することとした。   The device activation unit 14a recognizes the device 20 based on the entry information 13a, and the transmission / reception unit 11a of the application 11 sends each processing instruction to the pseudo node 11b that matches the pseudo node registered in the link information 13d. I decided to send it.

つぎに、動的デバイスについて図7〜図8を用いて説明する。図7は、動的デバイスを説明する図であり、図8は、リンク情報13dの更新例を示す図である。   Next, the dynamic device will be described with reference to FIGS. FIG. 7 is a diagram illustrating a dynamic device, and FIG. 8 is a diagram illustrating an example of updating link information 13d.

まず、図7の(A)に示すように、上位装置10には、ディスプレイやキーボード等のように、電源が入った状態では挿抜しないケーブルで接続されるデバイス(以下、「静的デバイス」と記載する)が接続されているとする。   First, as shown in FIG. 7A, the host device 10 is connected to a device (hereinafter referred to as “static device”), such as a display or a keyboard, that is connected with a cable that is not inserted or removed when the power is turned on. Is described) is connected.

また、上位装置10には、紙幣ユニット20aや硬貨ユニット20bのように、ホットプラグ機能を有するケーブル、たとえばUSBケーブルで接続されている動的デバイスが接続されているとする。   Further, it is assumed that a dynamic device connected by a cable having a hot plug function, for example, a USB cable, is connected to the host device 10 like the banknote unit 20a and the coin unit 20b.

ここで、上位装置10の電源が入れられた際に、静的デバイスについては、制御部14は、予め作成されているデバイスファイルに基づいて接続されるデバイスを認識する(図7の(1)参照)。   Here, when the host apparatus 10 is turned on, for the static device, the control unit 14 recognizes the connected device based on the device file created in advance ((1) in FIG. 7). reference).

一方、動的デバイスについては、上位装置10の電源が入れられた際に、デバイスファイル作成部14bは、上述してきたように、エントリ情報13a、デバイス対応情報13bおよびデバイス20からの情報に基づいてデバイスファイル13cおよびリンク情報13dを新規に作成する(図7の(2)参照)。   On the other hand, for the dynamic device, when the host apparatus 10 is turned on, the device file creation unit 14b, as described above, is based on the entry information 13a, the device correspondence information 13b, and the information from the device 20. A device file 13c and link information 13d are newly created (see (2) in FIG. 7).

ここで、デバイスファイル作成部14bによって作成されたリンク情報13dを、図8の(A)に示す。デバイスIDが「dID_紙幣」に対応するデバイスファイル名を「DEV_0」とすると、デバイスファイル名が「DEV_0」のデバイスファイル13cが紙幣ユニット20aに対応付けられて作成されたことを示す。   Here, the link information 13d created by the device file creation unit 14b is shown in FIG. If the device file name corresponding to the device ID “dID_banknote” is “DEV_0”, it indicates that the device file 13c having the device file name “DEV_0” is created in association with the banknote unit 20a.

そして、デバイス起動部14aは、デバイスファイル作成部14bによって作成されたデバイスファイル13cおよびリンク情報13dに基づいて接続されるデバイス20を認識する(図7の(3)参照)。ここで、図7の(B)に示すように、紙幣ユニット20aと硬貨ユニット20bのUSBケーブルが差し替えられた場合について説明する(図7の(4)参照)。   Then, the device activation unit 14a recognizes the device 20 to be connected based on the device file 13c created by the device file creation unit 14b and the link information 13d (see (3) in FIG. 7). Here, the case where the USB cables of the banknote unit 20a and the coin unit 20b are replaced as shown in FIG. 7B will be described (see (4) of FIG. 7).

デバイス監視部14cは、紙幣ユニット20aおよび硬貨ユニット20bが再接続されたと判定し、デバイスファイル更新部14dでは、紙幣ユニット20aと硬貨ユニット20bに対応するデバイスファイル13cおよびリンク情報13dを更新する(図7の(5)参照)。   The device monitoring unit 14c determines that the bill unit 20a and the coin unit 20b are reconnected, and the device file update unit 14d updates the device file 13c and the link information 13d corresponding to the bill unit 20a and the coin unit 20b (FIG. 7 (5)).

ここで、デバイスファイル更新部14dによって更新されたリンク情報13dを、図8の(B)に示す。デバイスIDが「dID_硬貨」に対応するデバイスファイル名を「DEV_0」とすると、デバイスファイル名が「DEV_0」のデバイスファイル13cが硬貨ユニット20bに対応付けられて更新されたことを示す。   Here, the link information 13d updated by the device file update unit 14d is shown in FIG. If the device file name corresponding to the device ID “dID_coin” is “DEV_0”, it indicates that the device file 13c having the device file name “DEV_0” is updated in association with the coin unit 20b.

そして、デバイス監視部14cは、デバイスファイル更新部14dによって更新されたデバイスファイル13cおよびリンク情報13dに基づいて再接続されたデバイス20を再認識する(図7の(6)参照)。   Then, the device monitoring unit 14c re-recognizes the reconnected device 20 based on the device file 13c updated by the device file update unit 14d and the link information 13d (see (6) in FIG. 7).

このように、静的デバイスについては、新たにデバイスファイルを作成することなくデバイスを認識することによって上位装置10の起動時間を短縮することができる。また、デバイス監視部14cは、リンク情報13dに記憶される疑似ノード、すなわち、動的デバイスについてのみ監視すればよい。また、デバイス20の構成に変更があった場合には、記憶部13のエントリ情報13aおよびデバイス対応情報13bに変更内容を記憶させておけばよい。   As described above, with respect to a static device, the activation time of the host device 10 can be shortened by recognizing the device without creating a new device file. Further, the device monitoring unit 14c only needs to monitor the pseudo node stored in the link information 13d, that is, the dynamic device. Further, when there is a change in the configuration of the device 20, the change content may be stored in the entry information 13a and the device correspondence information 13b in the storage unit 13.

これにより、上位装置10から一旦切断されたり、また、再接続されたデバイス20を再認識する際、通信の復旧にかかる時間を短縮するとともに、デバイス20の構成に変更があった場合であってもアプリケーションの修正を不要とすることができる。   As a result, when disconnecting from the host device 10 or re-recognizing the reconnected device 20, the time required for communication restoration is shortened and the configuration of the device 20 is changed. Even application modifications can be made unnecessary.

つぎに、上記した上位装置10が実行する処理手順について図9〜図10を用いて説明する。なお、図9ではデバイス起動処理手順について、図10ではデバイス監視処理手順について、それぞれ説明する。   Next, the processing procedure executed by the higher-level device 10 will be described with reference to FIGS. In FIG. 9, the device activation processing procedure is described, and in FIG. 10, the device monitoring processing procedure is described.

図9は、上位装置が実行するデバイス起動処理手順を示すフローチャートである。同図に示すように、上位装置10に電源が入れられたならば、制御部14は、リンク情報13dを削除して初期化を行う(ステップS101)。   FIG. 9 is a flowchart illustrating a device activation processing procedure executed by the host apparatus. As shown in the figure, when the host device 10 is powered on, the control unit 14 deletes the link information 13d and performs initialization (step S101).

そして、デバイス起動部14aは、エントリ情報13aの最初のレコードの読み込みを行い(ステップS102)、ステップS102で読み込んだデバイスファイル名からデバイスIDを取得し、取得したデバイスIDに対応するデバイス対応情報13bを取得する(ステップS103)。   Then, the device activation unit 14a reads the first record of the entry information 13a (step S102), acquires a device ID from the device file name read in step S102, and device correspondence information 13b corresponding to the acquired device ID. Is acquired (step S103).

つづいて、デバイスファイル作成部14bは、ステップS103で取得したデバイス対応情報13bのデバイスIDに対応するデバイスファイル13cを作成するとともに(ステップS104)、かかるデバイスIDのリンク情報13dを追加する(ステップS105)。   Subsequently, the device file creation unit 14b creates a device file 13c corresponding to the device ID of the device correspondence information 13b acquired in step S103 (step S104), and adds link information 13d of the device ID (step S105). ).

そして、デバイス起動部14aは、エントリ情報13aの次のレコードの読み込みを行い(ステップS106)、エントリ情報13aの次のレコードがあるか否かを判定する(ステップS107)。   The device activation unit 14a reads the next record of the entry information 13a (step S106), and determines whether there is a next record of the entry information 13a (step S107).

そして、デバイス起動部14aによって次のエントリ情報13aありと判定された場合(ステップS107,No)、エントリ情報13aがなくなるまでステップS103〜ステップS106までの処理を繰り返す。一方、次のエントリ情報13aなしと判定された場合(ステップS107,Yes)、処理を終了する。つづいて、デバイス監視処理手順について図10を用いて説明する。   If the device activation unit 14a determines that the next entry information 13a is present (step S107, No), the processing from step S103 to step S106 is repeated until there is no more entry information 13a. On the other hand, if it is determined that the next entry information 13a is not present (step S107, Yes), the process ends. Next, the device monitoring processing procedure will be described with reference to FIG.

図10は、上位装置10が実行するデバイス監視処理手順を示すフローチャートである。同図に示すように、デバイス監視部14cは、上位装置10の電源が入った状態でケーブルが挿抜され、デバイス20が切断または接続されたか否かを監視している際に、いずれかのデバイス20が切断されたか否かを判定する(ステップS201)。   FIG. 10 is a flowchart illustrating a device monitoring processing procedure executed by the higher-level device 10. As shown in the figure, when the device monitoring unit 14c monitors whether the device 20 is disconnected or connected while the power of the host device 10 is turned on and the device 20 is disconnected or connected, It is determined whether or not 20 has been disconnected (step S201).

デバイス20が切断されたと判定された場合(ステップS201,Yes)、デバイス監視部14cは、制御部14からの情報伝達により切断されたデバイスIDを取得する(ステップS202)。   When it is determined that the device 20 has been disconnected (step S201, Yes), the device monitoring unit 14c acquires the device ID that has been disconnected by the information transmission from the control unit 14 (step S202).

そして、デバイスファイル更新部14dは、ステップS202で取得したデバイスIDのリンク情報13dを削除するとともに(ステップS203)、かかるデバイスIDのデバイスファイル13cを削除する(ステップS204)。そして、ステップS201へ移行し、デバイス監視部14cは、デバイス20の接続状態の監視を続ける。   Then, the device file update unit 14d deletes the link information 13d of the device ID acquired in step S202 (step S203) and deletes the device file 13c of the device ID (step S204). Then, the process proceeds to step S201, and the device monitoring unit 14c continues to monitor the connection state of the device 20.

一方、ステップS201でデバイス20が切断されていないと判定された場合(ステップS201,No)、デバイス監視部14cは、いずれかのデバイス20が接続されたか否かを判定する(ステップS205)。   On the other hand, when it is determined in step S201 that the device 20 is not disconnected (No in step S201), the device monitoring unit 14c determines whether any device 20 is connected (step S205).

デバイス20が接続されたと判定された場合(ステップS205,Yes)、デバイス監視部14cは、制御部14からの情報伝達により接続されたデバイスIDを取得する(ステップS206)。そして、デバイスファイル更新部14dは、ステップS206で取得したデバイスIDに対応する疑似ノードをデバイス対応情報13bから取得する(ステップS207)。   If it is determined that the device 20 is connected (step S205, Yes), the device monitoring unit 14c acquires the connected device ID by information transmission from the control unit 14 (step S206). Then, the device file update unit 14d acquires the pseudo node corresponding to the device ID acquired in step S206 from the device correspondence information 13b (step S207).

その後、デバイスファイル更新部14dは、取得したデバイス対応情報13bのデバイスIDに対応するデバイスファイル13cを作成するとともに(ステップS208)、かかるデバイスIDのリンク情報13dを追加する(ステップS209)。そして、ステップS201へ移行し、デバイス監視部14cは、デバイス20の接続状態の監視を続ける。   Thereafter, the device file update unit 14d creates a device file 13c corresponding to the device ID of the acquired device correspondence information 13b (step S208), and adds link information 13d of the device ID (step S209). Then, the process proceeds to step S201, and the device monitoring unit 14c continues to monitor the connection state of the device 20.

一方、ステップS205でデバイス20が接続されていないと判定された場合(ステップS205,No)、ステップS201へ移行し、デバイス監視部14cは、デバイス20の接続状態の監視を続ける。   On the other hand, when it is determined in step S205 that the device 20 is not connected (No in step S205), the process proceeds to step S201, and the device monitoring unit 14c continues to monitor the connection state of the device 20.

上述してきたように、本実施例では、上位装置10の電源が入れられた際に、静的デバイスについては、予め作成されているデバイスファイルに基づいて接続されるデバイスを認識する。また、動的デバイスについては、制御部14からの情報伝達を契機としてエントリ情報13aとデバイス対応情報13bとに基づいて接続される動的デバイスを認識し、動的デバイスに対応するデバイスファイル13cおよびリンク情報13dを作成する。そして、デバイス20の切断情報を受信するとリンク情報13dに基づいて接続情報を削除する。つまり、デバイス20の接続状態に基づいてデバイスファイル13cおよびリンク情報13dを更新する。また、アプリケーション11およびデバイス20との中継処理を、リンク情報13dに基づいてデバイス20に対応するデバイスファイル13cからデバイスドライバ12を介して中継することとした。   As described above, in this embodiment, when the host device 10 is turned on, the static device recognizes a connected device based on a previously created device file. As for the dynamic device, it recognizes the dynamic device connected based on the entry information 13a and the device correspondence information 13b triggered by the information transmission from the control unit 14, and the device file 13c corresponding to the dynamic device and The link information 13d is created. When the disconnection information of the device 20 is received, the connection information is deleted based on the link information 13d. That is, the device file 13c and the link information 13d are updated based on the connection state of the device 20. Further, the relay process between the application 11 and the device 20 is relayed from the device file 13c corresponding to the device 20 via the device driver 12 based on the link information 13d.

したがって、本発明に係るデバイス制御方法では、上位装置から一旦切断されたり、また、再接続されたデバイスを再認識する際、通信の復旧にかかる時間を短縮するとともに、デバイスの構成に変更があった場合であってもアプリケーションの修正を不要とすることができる。   Therefore, when the device control method according to the present invention is disconnected from the host device or re-recognizes the reconnected device, the communication recovery time is reduced and the device configuration is changed. Even in such a case, it is not necessary to modify the application.

なお、本発明の請求項に記載の上位装置は上位装置10、対応情報はエントリ情報13aおよびデバイス対応情報13b、対応情報取得部はデバイス起動部14a、接続部はデバイスファイル作成部14b、接続情報はデバイスファイル13cおよびリンク情報13d、接続情報作成部はデバイスファイル作成部14bおよびデバイスファイル更新部14dの一例として挙げられる。   The host device described in the claims of the present invention is the host device 10, the correspondence information is the entry information 13a and the device correspondence information 13b, the correspondence information acquisition unit is the device activation unit 14a, the connection unit is the device file creation unit 14b, and the connection information. Is an example of the device file 13c and the link information 13d, and the connection information creation unit is an example of the device file creation unit 14b and the device file update unit 14d.

なお、上述した実施例では、デバイス20を紙幣ユニットおよび硬貨ユニットに適用する例を説明したが、同一のメジャー番号に属する3つまたはそれ以上の周辺機器を対象とした場合にも同様に適用することができる。   In the above-described embodiment, the example in which the device 20 is applied to the bill unit and the coin unit has been described. However, the same applies to the case where three or more peripheral devices belonging to the same major number are targeted. be able to.

また、上述した実施例では、上位装置10に接続されたデバイス20を制御することとした。しかし、複数の上位装置10と上位装置10を管理する管理装置とがLAN(Local Area Network)等のネットワーク経由で接続されているような構成としてもよい。   In the above-described embodiment, the device 20 connected to the higher-level device 10 is controlled. However, a configuration in which a plurality of higher-level devices 10 and a management device that manages the higher-level devices 10 are connected via a network such as a LAN (Local Area Network) may be employed.

この場合、各上位装置10に記憶されるリンク情報13dを管理装置へ送信することで、管理装置によって各上位装置10に接続されるデバイス20の状態を一括して表示し、監視することができる。   In this case, by transmitting the link information 13d stored in each host device 10 to the management device, the state of the devices 20 connected to each host device 10 can be collectively displayed and monitored by the management device. .

以上のように、本発明に係る上位装置は、上位装置から一旦切断されたり、また、再接続されたデバイスを再認識する際、通信の復旧にかかる時間を短縮するとともに、デバイスの構成に変更があった場合であってもアプリケーションの修正を不要とする場合に有用である。   As described above, when the host device according to the present invention is disconnected from the host device or re-recognizes the reconnected device, the time required for recovery of communication is shortened and the device configuration is changed. This is useful when there is no need to modify the application even if there is a problem.

10 上位装置
11 アプリケーション
11a 送受信部
11b 疑似ノード
12 デバイスドライバ
13 記憶部
13a エントリ情報
13b デバイス対応情報
13c デバイスファイル
13d リンク情報
14 制御部
14a デバイス起動部
14b デバイスファイル作成部
14c デバイス監視部
14d デバイスファイル更新部
14e 中継部
20 デバイス
20a 紙幣ユニット
20b 硬貨ユニット
DESCRIPTION OF SYMBOLS 10 Host apparatus 11 Application 11a Transmission / reception part 11b Pseudo node 12 Device driver 13 Storage part 13a Entry information 13b Device correspondence information 13c Device file 13d Link information 14 Control part 14a Device starting part 14b Device file creation part 14c Device monitoring part 14d Device file update Part 14e relay part 20 device 20a banknote unit 20b coin unit

Claims (6)

デバイス接続用のポートへ接続されたデバイスと通信する上位装置であって、
前記デバイスを識別するデバイス識別子と、前記上位装置上または該上位装置の上位装置上で動作するアプリケーションに対して公開される仮想的な宛先を示す疑似宛先とを対応付けた対応情報を取得する対応情報取得部と、
前記ポートに接続された前記デバイスから前記デバイス識別子を取得する取得部と、
前記取得部によって取得された前記デバイス識別子が前記対応情報に含まれる場合に、当該デバイス識別子の取得元となった前記ポートを、前記対応情報において当該デバイス識別子と対応付けられている前記疑似宛先と接続する接続部と
を備えたことを特徴とする上位装置。
A host device that communicates with a device connected to a device connection port,
Correspondence that obtains correspondence information in which a device identifier that identifies the device is associated with a pseudo-destination that indicates a virtual destination that is disclosed to an application that operates on the host device or a host device of the host device An information acquisition unit;
An acquisition unit for acquiring the device identifier from the device connected to the port;
When the device identifier acquired by the acquisition unit is included in the correspondence information, the port from which the device identifier is acquired is assigned to the pseudo destination associated with the device identifier in the correspondence information. A host device comprising: a connecting portion for connection.
前記接続部によって接続された前記ポートと前記疑似宛先との接続状態を接続情報として作成する接続情報作成部
をさらに備えたことを特徴とする請求項1に記載の上位装置。
The host apparatus according to claim 1, further comprising: a connection information creation unit that creates a connection state between the port connected by the connection unit and the pseudo destination as connection information.
前記対応情報は、
接続する前記ポートが固定化されていない前記デバイスのみを含むことを特徴とする請求項1または2に記載の上位装置。
The correspondence information is
3. The host apparatus according to claim 1, wherein only the device to which the port to be connected is not fixed is included.
前記接続情報作成部は、
前記ポートと前記デバイスとの接続が切断された場合に、当該ポートに関する前記接続情報を削除することを特徴とする請求項2または3に記載の上位装置。
The connection information creation unit
4. The host apparatus according to claim 2, wherein when the connection between the port and the device is disconnected, the connection information regarding the port is deleted.
前記対応情報取得部は、
紙幣を処理する紙幣ユニットおよび硬貨を処理する硬貨ユニットについての前記対応情報を取得することを特徴とする請求項1〜4のいずれか一つに記載の上位装置。
The correspondence information acquisition unit
The upper apparatus according to any one of claims 1 to 4, wherein the correspondence information about a banknote unit that processes banknotes and a coin unit that processes coins is acquired.
デバイス接続用のポートへ接続されたデバイスと通信する上位装置に適用されるデバイス制御方法であって、
上位装置が前記デバイスを識別するデバイス識別子と、前記上位装置上または該上位装置の上位装置上で動作するアプリケーションに対して公開される仮想的な宛先を示す疑似宛先とを対応付けた対応情報を取得する対応情報取得工程と、
上位装置が前記ポートに接続された前記デバイスから前記デバイス識別子を取得する取得工程と、
上位装置が前記取得部によって取得された前記デバイス識別子が前記対応情報に含まれる場合に、当該デバイス識別子の取得元となった前記ポートを、前記対応情報において当該デバイス識別子と対応付けられている前記疑似宛先と接続する接続工程と
を含んだことを特徴とするデバイス制御方法。
A device control method applied to a host device that communicates with a device connected to a device connection port,
Correspondence information in which a higher-level device associates a device identifier that identifies the device with a pseudo-destination that indicates a virtual destination that is disclosed to an application that operates on the higher-level device or on the higher-level device. A corresponding information acquisition process to be acquired;
An acquisition step in which a host device acquires the device identifier from the device connected to the port;
When the device identifier acquired by the acquisition unit by the acquisition unit is included in the correspondence information, the port that is the acquisition source of the device identifier is associated with the device identifier in the correspondence information. A device control method comprising a connection step of connecting to a pseudo destination.
JP2010052361A 2010-03-09 2010-03-09 Host device and device control method Pending JP2011186857A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2010052361A JP2011186857A (en) 2010-03-09 2010-03-09 Host device and device control method
PCT/JP2011/055468 WO2011111731A1 (en) 2010-03-09 2011-03-09 Host device and device control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010052361A JP2011186857A (en) 2010-03-09 2010-03-09 Host device and device control method

Publications (1)

Publication Number Publication Date
JP2011186857A true JP2011186857A (en) 2011-09-22

Family

ID=44563531

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010052361A Pending JP2011186857A (en) 2010-03-09 2010-03-09 Host device and device control method

Country Status (2)

Country Link
JP (1) JP2011186857A (en)
WO (1) WO2011111731A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108027994A (en) * 2015-09-17 2018-05-11 富士通先端科技株式会社 Paper processing apparatus and the method for controlling paper processing apparatus

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04322348A (en) * 1991-04-23 1992-11-12 Casio Comput Co Ltd Data processing controller
JP2002268707A (en) * 2001-03-12 2002-09-20 Omron Corp Controller and tool, and system constituted of the same
JP2003196224A (en) * 2001-12-28 2003-07-11 Star Micronics Co Ltd Usb port driver and port designation applying method
JP2003281072A (en) * 2002-03-26 2003-10-03 Fuji Photo Film Co Ltd Method and device for controlling device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002123380A (en) * 2000-10-17 2002-04-26 Ricoh Co Ltd Network printing system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04322348A (en) * 1991-04-23 1992-11-12 Casio Comput Co Ltd Data processing controller
JP2002268707A (en) * 2001-03-12 2002-09-20 Omron Corp Controller and tool, and system constituted of the same
JP2003196224A (en) * 2001-12-28 2003-07-11 Star Micronics Co Ltd Usb port driver and port designation applying method
JP2003281072A (en) * 2002-03-26 2003-10-03 Fuji Photo Film Co Ltd Method and device for controlling device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108027994A (en) * 2015-09-17 2018-05-11 富士通先端科技株式会社 Paper processing apparatus and the method for controlling paper processing apparatus
US10275973B2 (en) 2015-09-17 2019-04-30 Fujitsu Frontech Limited Paper sheet handling apparatus and method for controlling paper sheet handling apparatus

Also Published As

Publication number Publication date
WO2011111731A1 (en) 2011-09-15

Similar Documents

Publication Publication Date Title
JP4805116B2 (en) Information processing system, information processing system control method, service using device, and service providing device
JP5034109B2 (en) License management apparatus, license management method, and license authentication program
JP5333579B2 (en) Management server, boot server, network boot system, and network boot method
CN103488498A (en) Computer booting method and computer
US20080198411A1 (en) Image forming apparatus and activating method thereof
CN102238093A (en) Service interruption prevention method and device
US10235048B2 (en) Data processing method and smart device
CN112100005A (en) Redis copy set implementation method and device
JP2010219725A (en) Network device and method of releasing external storage device on network
CN102880478B (en) Oftware updating method
WO2020113478A1 (en) Address information processing method and apparatus, electronic device, and storage medium
US20170199733A1 (en) Method for terminal to update operating system, terminal and system
US20180338007A1 (en) System and method for providing extensible communication gateway with session pooling
JP2011186857A (en) Host device and device control method
US11947948B2 (en) Information processing apparatus, information processing method, and storage medium
JP2010238168A (en) Execution control program and information processing system
CN114968386A (en) Equipment information management method, device and equipment of electronic equipment
CN111736859B (en) Version updating method of operating system, server and terminal
JP6064755B2 (en) Electronic apparatus, image forming apparatus, control apparatus, and program
JP2010049643A (en) Information processing system, information processing method, and program
JP5168348B2 (en) Control device and control program
JP6015850B2 (en) Information processing system, server device, program, and information processing method
JP6773533B2 (en) Operating environment synchronization device, operating environment synchronization system, operating environment synchronization method, and operating environment synchronization program
JP2010171887A (en) Program management system, terminal unit, management server, program, and network physical address setting method
US20240031220A1 (en) Communication device, method for controlling communication device, and recording medium having control program recorded thereon

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130228

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130903

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20140415