JP2014160484A - Control method for controller - Google Patents

Control method for controller Download PDF

Info

Publication number
JP2014160484A
JP2014160484A JP2014076708A JP2014076708A JP2014160484A JP 2014160484 A JP2014160484 A JP 2014160484A JP 2014076708 A JP2014076708 A JP 2014076708A JP 2014076708 A JP2014076708 A JP 2014076708A JP 2014160484 A JP2014160484 A JP 2014160484A
Authority
JP
Japan
Prior art keywords
request
device driver
initialization
processing
application
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.)
Granted
Application number
JP2014076708A
Other languages
Japanese (ja)
Other versions
JP5954353B2 (en
Inventor
Nobuhiko Nishimura
信彦 西村
Toshihiro Hagiwara
敏浩 萩原
Eiji Ito
英二 伊東
Atsushi Sakai
淳 酒井
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson 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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2014076708A priority Critical patent/JP5954353B2/en
Publication of JP2014160484A publication Critical patent/JP2014160484A/en
Application granted granted Critical
Publication of JP5954353B2 publication Critical patent/JP5954353B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide the control method of a controller and the controller capable of simplifying the development of an application, and improving processing performance on device control.SOLUTION: A method for controlling a controller includes: a step of receiving a processing request from an application 1; a step of, when the received processing request is an initialization request, determining whether or not the request is a first initialization request after the activation of the application 1; a step of, when the received processing request is the first initialization request, transmitting the request to a device driver 3; a step of storing initialization setting information indicating the state after the initialization processing of the device driver 3; a step of detecting the state of the device driver 3; a step of, when an error is generated in the device driver 3, performing restoration processing based on the state; and a step of, when the device driver 3 is restored, making a request for setting the state of the device driver 3 to the state based on the initialization setting information.

Description

本発明は、アプリケーションとデバイスドライバーとの間に介在し、デバイスドライバーを制御するためのソフトウェアモジュールとして機能するコントローラーの制御方法およびコントローラーに関するものである。   The present invention relates to a controller control method and a controller that are interposed between an application and a device driver and function as a software module for controlling the device driver.

従来、コンピューターに接続されたデバイス(例えば、プリンター等)を制御する場合、そのデバイスに対応するデバイスドライバーを用いて制御を行う(例えば、特許文献1参照)。一般的に、このようなデバイスドライバーは、対応するデバイスを制御するための数多くのインターフェイスを提供しており、アプリケーションプログラム(以下、アプリケーション)を開発する場合、このデバイスドライバーが提供するインターフェイスを利用してプログラムを作成することで、デバイスの基本的な動作制御をはじめ、デバイスの状態に応じた繊細なエラー処理を実行することができる。   Conventionally, when a device (for example, a printer) connected to a computer is controlled, control is performed using a device driver corresponding to the device (for example, see Patent Document 1). In general, such a device driver provides a number of interfaces for controlling the corresponding device. When an application program (hereinafter referred to as an application) is developed, the interface provided by the device driver is used. By creating a program, it is possible to execute delicate error processing according to the state of the device, including basic operation control of the device.

特開平11−265267号公報JP-A-11-265267

しかしながら、上記のようにデバイスを制御する場合、一般的には、当該デバイスを制御するために非常に多数の関数と、デバイスに起因する多種類のエラー処理等が定義されているため、デバイスドライバーを利用して繊細なエラー処理を行う場合、アプリケーションの処理フローが複雑になるという問題がある。このため、アプリケーション開発にかかるコストが高くなる問題がある。
一方、アプリケーションの処理フローが複雑になることを避けるため一括処理等を行うようにし、エラーが発生した場合は、そのエラーの原因やデバイスドライバーの状態を無視し、常にデバイスドライバーを完全に初期化するというエラー処理を行う場合がある。しかしながら、一般的にデバイスドライバーの初期化処理には時間がかかるため、エラー処理として毎回初期化処理を行うことによりデバイスドライバーの処理パフォーマンスの低下を招くという問題がある。
However, in the case of controlling a device as described above, in general, a large number of functions and various types of error handling caused by the device are defined to control the device. When delicate error processing is performed using, there is a problem that the processing flow of the application becomes complicated. For this reason, there is a problem that the cost for application development becomes high.
On the other hand, batch processing is performed to avoid complicating the processing flow of the application, and when an error occurs, the cause of the error and the state of the device driver are ignored, and the device driver is always initialized completely. There are cases where error handling is performed. However, since the initialization process of the device driver generally takes time, there is a problem that the performance of the device driver is deteriorated by performing the initialization process every time as an error process.

本発明は、上記の問題に鑑み、アプリケーションの開発を簡素化でき、且つデバイスを制御するための処理パフォーマンスの向上を図ることができるコントローラーの制御方法およびコントローラーを提供することを目的とする。   In view of the above problems, an object of the present invention is to provide a controller control method and a controller that can simplify the development of an application and can improve the processing performance for controlling a device.

本発明のコントローラーの制御方法は、アプリケーションとデバイスドライバーとの間に介在し、アプリケーションからの処理要求をデバイスドライバーに転送すると共に、デバイスドライバーからの処理要求に対する応答をアプリケーションに転送するためのソフトウェアモジュールであるコントローラーの制御方法であって、アプリケーションから処理要求を受信する処理要求受信ステップと、受信した処理要求が初期化要求である場合、当該初期化要求がアプリケーションの起動後における最初の初期化要求か否かを判別する初期化要求判別ステップと、初期化要求判別ステップにおける判別の結果、初期化要求が最初の初期化要求である場合、デバイスドライバーへ当該最初の初期化要求を送信する初期化要求送信ステップと、最初の初期化要求に基づくデバイスドライバーの初期化処理後の状態を示す初期化設定情報をデバイスドライバーから取得し、当該初期化設定情報を記憶する初期化設定情報記憶ステップと、デバイスドライバーの状態を検出する状態検出ステップと、状態検出ステップにおいて、デバイスドライバーでエラーが発生したことを検出した場合、当該デバイスドライバーの状態に基づく復帰処理を実行する復帰処理ステップと、復帰処理によりデバイスドライバーがエラーから復帰した場合、デバイスドライバーの状態を、記憶した初期化設定情報に基づく状態に設定するための要求をデバイスドライバーに送信する初期化設定要求ステップと、を備えたことを特徴とする。   The controller control method of the present invention is a software module that is interposed between an application and a device driver, transfers a processing request from the application to the device driver, and transfers a response to the processing request from the device driver to the application. In the controller control method, a processing request reception step for receiving a processing request from an application, and when the received processing request is an initialization request, the initialization request is the first initialization request after the application is started If the initialization request is the first initialization request as a result of the determination in the initialization request determination step and the initialization request determination step, the initialization request is transmitted to the device driver. Send request step and first Initialization setting information indicating a state after initialization processing of the device driver based on the initialization request is acquired from the device driver, and an initialization setting information storing step for storing the initialization setting information and a state of the device driver are detected. In the state detection step and the state detection step, when it is detected that an error has occurred in the device driver, the return processing step for executing the return processing based on the state of the device driver, and the device driver returned from the error by the return processing In this case, there is provided an initialization setting request step for transmitting a request for setting the state of the device driver to a state based on the stored initialization setting information to the device driver.

また、本発明のコントローラーは、アプリケーションとデバイスドライバーとの間に介在し、アプリケーションからの処理要求をデバイスドライバーに転送すると共に、デバイスドライバーからの処理要求に対する応答をアプリケーションに転送するためのソフトウェアモジュールであるコントローラーであって、アプリケーションから処理要求を受信する処理要求受信手段と、受信した処理要求が初期化要求である場合、当該初期化要求がアプリケーションの起動後における最初の初期化要求か否かを判別する初期化要求判別手段と、初期化要求判別手段における判別の結果、初期化要求が最初の初期化要求である場合、デバイスドライバーへ当該最初の初期化要求を送信する初期化要求処理手段と、最初の初期化要求に基づくデバイスドライバーの初期化処理後の状態を示す初期化設定情報をデバイスドライバーから取得する初期化設定情報取得手段と、取得した初期化設定情報を記憶する初期化設定情報記憶手段と、デバイスドライバーの状態を検出する状態検出手段と、状態検出手段において、デバイスドライバーでエラーが発生したことを検出した場合、当該デバイスドライバーの状態に基づく復帰処理を実行する復帰処理手段と、復帰処理によりデバイスドライバーがエラーから復帰した場合、デバイスドライバーの状態を、記憶した初期化設定情報に基づく状態に設定するための要求をデバイスドライバーに送信する初期化設定要求手段と、を備えたことを特徴とする。   The controller of the present invention is a software module that is interposed between an application and a device driver, and transfers a processing request from the application to the device driver, and transfers a response to the processing request from the device driver to the application. If a certain controller is a processing request receiving means for receiving a processing request from an application, and the received processing request is an initialization request, whether or not the initialization request is the first initialization request after the application is started An initialization request determining means for determining, and an initialization request processing means for transmitting the first initialization request to the device driver when the initialization request is the first initialization request as a result of the determination in the initialization request determining means. Device device based on initial initialization request Initialization setting information acquisition means for acquiring initialization setting information indicating a state after initialization processing of the device from the device driver, initialization setting information storage means for storing the acquired initialization setting information, and the status of the device driver. When the state detection means for detecting and the state detection means detect that an error has occurred in the device driver, the return processing means for executing the return processing based on the state of the device driver, and the device driver from the error by the return processing Initialization setting requesting means for transmitting a request for setting the state of the device driver to a state based on the stored initialization setting information when returning, to the device driver.

これらの構成によれば、デバイスドライバーにエラーが発生した場合は、コントローラーにより、そのデバイスドライバーの状態に応じた(エラー内容に応じた)適切な復帰処理(エラー処理)を実行することができる。これにより、アプリケーション側では、繊細なエラー処理を行う必要がなくなるため、アプリケーションの処理フローを簡素化することができ、アプリケーション開発にかかるコストを低減させることができる。
また、コントローラー側で、最初の初期化処理後のデバイスドライバーの状態(初期化設定情報)を記憶しておき、デバイスドライバーがエラーから復帰した後、この初期化設定情報に基づいてデバイスドライバーの状態を初期化処理後と同等の状態にすることができる。これにより、通信やインスタンスの初期化など長時間を要する初期化処理を不要とすることができ、例えば、エラー処理で初期化処理を行うようなアプリケーションに本発明のコントローラーを導入することで処理パフォーマンスを向上することができる。
According to these configurations, when an error occurs in the device driver, the controller can execute an appropriate return process (error process) according to the state of the device driver (according to the error content). This eliminates the need for delicate error processing on the application side, thereby simplifying the application processing flow and reducing the cost of application development.
Also, the controller stores the device driver status (initialization setting information) after the initial initialization process, and after the device driver recovers from the error, the device driver status based on this initialization setting information Can be brought into a state equivalent to that after the initialization process. This eliminates the need for long-time initialization processing such as communication and instance initialization.For example, by introducing the controller of the present invention into an application that performs initialization processing by error processing, processing performance can be improved. Can be improved.

本発明のコントローラーの制御方法において、初期化要求判別ステップにおける判別の結果、受信した初期化要求が最初の初期化要求ではない場合、当該初期化要求をデバイスドライバーに送信せず、デバイスドライバーの状態に応じて、アプリケーションに初期化要求に対する応答を返すことが好ましい。   In the controller control method of the present invention, if the received initialization request is not the first initialization request as a result of the determination in the initialization request determination step, the initialization request is not transmitted to the device driver, and the device driver status In response, it is preferable to return a response to the initialization request to the application.

また、本発明のコントローラーにおいて、初期化要求処理手段は、初期化要求判別手段における判別の結果、受信した初期化要求が最初の初期化要求ではない場合、当該初期化要求をデバイスドライバーに送信せず、デバイスドライバーの状態に応じて、アプリケーションに初期化要求に対する応答を返すことが好ましい。   In the controller of the present invention, the initialization request processing means may send the initialization request to the device driver when the received initialization request is not the first initialization request as a result of the determination by the initialization request determining means. First, it is preferable to return a response to the initialization request to the application according to the state of the device driver.

これらの構成によれば、コントローラーは、アプリケーションからの初期化要求をデバイスドライバーにブリッジせず、自身で当該初期化要求に対する応答を返す。つまり、デバイスドライバーが提供する初期化処理(通信やインスタンスを実際に初期化する処理)を実行しない。これにより、例えば、毎回同様のデバイス制御処理を実行するために所定のタイミングで初期化処理を要求するようなアプリケーションや、エラー処理で初期化処理を行うアプリケーションに対し、本発明のコントローラーを導入することで、処理パフォーマンスを向上させることができる。   According to these configurations, the controller does not bridge the initialization request from the application to the device driver, and returns a response to the initialization request by itself. That is, the initialization process provided by the device driver (the process of actually initializing communication and instances) is not executed. Thus, for example, the controller of the present invention is introduced to an application that requires initialization processing at a predetermined timing in order to execute the same device control processing every time or an application that performs initialization processing by error processing. As a result, the processing performance can be improved.

本発明のコントローラーにおいて、コントローラーの入出力インターフェイスは、デバイスドライバーの入出力インターフェイスと同一の仕様、およびデバイスドライバーの入出力インターフェイスを拡張した仕様のいずれかであることが好ましい。   In the controller of the present invention, it is preferable that the input / output interface of the controller has either the same specification as the input / output interface of the device driver or a specification that extends the input / output interface of the device driver.

この構成によれば、コントローラーは、デバイスドライバーの入出力インターフェイスと同一仕様、あるいは拡張した仕様の入出力インターフェイスを提供する。これにより、アプリケーション開発者は、新たな仕様の入出力インターフェイスを覚える必要がなく、従来からあるデバイスドライバーにより提供されている入出力インターフェイスを利用するのと同様の感覚で開発を行うことができるため、アプリケーションの開発効率を低下させることない。   According to this configuration, the controller provides an input / output interface having the same specification as the input / output interface of the device driver or an expanded specification. As a result, application developers do not need to learn input / output interfaces with new specifications, and can develop with the same feeling as using the input / output interfaces provided by existing device drivers. , Without reducing application development efficiency.

本発明のコントローラーにおいて、処理要求は、複数の処理要求をまとめて定義したものであることが好ましい。   In the controller of the present invention, the processing request is preferably a definition of a plurality of processing requests collectively.

また、本発明のコントローラーにおいて、複数の処理要求は、マークアップ言語で定義されていることが好ましい。   In the controller of the present invention, it is preferable that the plurality of processing requests are defined in a markup language.

これらの構成によれば、例えば、XML(Extensible Markup Language)で複数の処理要求をまとめて定義し、一括処理するアプリケーションのように、エラー処理(エラーハンドリング)を繊細に行うことができないアプリケーションでも、本発明のコントローラーを導入することで適切なエラー処理を行うことができるため、このような一括処理を行うアプリケーションの実現が容易になる。   According to these configurations, for example, even in an application that cannot define error processing (error handling) delicately, such as an application that collectively defines a plurality of processing requests in XML (Extensible Markup Language) and performs batch processing, By introducing the controller of the present invention, it is possible to perform appropriate error processing, so that it is easy to realize an application that performs such batch processing.

本実施形態にかかるコンポーネントモデルの構成を示すブロック図である。It is a block diagram which shows the structure of the component model concerning this embodiment. コントローラーの機能ブロック図である。It is a functional block diagram of a controller. 大まかなエラー処理を行うアプリケーションを対象とした場合のコントローラーの処理の一例を説明するシーケンス図である。It is a sequence diagram explaining an example of the processing of the controller when targeting an application that performs rough error processing. エラー処理を行わないアプリケーションを対象とした場合のコントローラーの処理の一例を説明するシーケンス図である。It is a sequence diagram explaining an example of the processing of the controller when targeting an application that does not perform error processing. 一定の処理毎にデバイスドライバーの初期化を行うアプリケーションを対象とした場合のコントローラーの処理の一例を説明するシーケンス図である。FIG. 10 is a sequence diagram for explaining an example of a process of a controller when an application that initializes a device driver for each fixed process is targeted.

以下、添付の図面を参照して、本発明のコントローラーを含むコンポーネントモデルについて説明する。図1は本実施形態のコンポーネントモデルCMの構成を示すブロック図である。同図に示すように、コンポーネントモデルCMは、アプリケーション1と、コントローラー2と、デバイスドライバー3とにより構成されている。なお、これらアプリケーション1、コントローラー2およびデバイスドライバー3は、コンピューターに搭載されたOS(Operating System)上で動作するソフトウェアモジュール(プログラム)として実現される。   Hereinafter, a component model including a controller of the present invention will be described with reference to the accompanying drawings. FIG. 1 is a block diagram showing the configuration of the component model CM of this embodiment. As shown in the figure, the component model CM includes an application 1, a controller 2, and a device driver 3. The application 1, the controller 2, and the device driver 3 are realized as software modules (programs) that operate on an OS (Operating System) installed in the computer.

アプリケーション1は、コンピューターに接続されたデバイス(例えば、プリンター等,図示省略)に所定の動作を実行させるための処理要求や、デバイスドライバー3の処理でエラーが発生した場合のエラー処理に関する処理要求などを行うプログラムである。これら処理要求は、コントローラー2が提供する入出力インターフェイス(第1入出力インターフェイス11)を用いて定義されており、アプリケーション1は、コントローラー2に対して各処理要求を送信すると共に、コントローラー2から当該各処理要求に対する応答(処理の成功/失敗等)を受信する。   The application 1 is a processing request for causing a device (for example, a printer, not shown) connected to a computer to execute a predetermined operation, a processing request for error processing when an error occurs in the processing of the device driver 3, etc. It is a program that performs. These processing requests are defined using an input / output interface (first input / output interface 11) provided by the controller 2, and the application 1 transmits each processing request to the controller 2 and the controller 2 A response to each processing request (success / failure of processing, etc.) is received.

コントローラー2は、アプリケーション1とデバイスドライバー3との間に介在するソフトウェアモジュールであり、アプリケーション1からの処理要求をデバイスドライバー3に転送する(ブリッジする)と共に、デバイスドライバー3からの処理要求に対する応答をアプリケーション1に転送する(ブリッジする)ものである。具体的には、コントローラー2は、アプリケーション1に対して上記の第1入出力インターフェイス11を提供しており、この第1入出力インターフェイス11を利用することで、アプリケーション1からの処理要求の受信、およびアプリケーション1への処理要求に対する応答を行なう。また、コントローラー2は、デバイスドライバー3が提供する入出力インターフェイス(第2入出力インターフェイス12)を用いて、アプリケーション1からの処理要求をデバイスドライバー3に転送、およびデバイスドライバー3から処理要求に対する応答を受信する。   The controller 2 is a software module interposed between the application 1 and the device driver 3, and transfers (bridges) a processing request from the application 1 to the device driver 3 and sends a response to the processing request from the device driver 3. It is transferred (bridged) to the application 1. Specifically, the controller 2 provides the first input / output interface 11 to the application 1. By using the first input / output interface 11, the controller 2 receives a processing request from the application 1, In addition, a response to the processing request to the application 1 is performed. Further, the controller 2 uses the input / output interface (second input / output interface 12) provided by the device driver 3 to transfer the processing request from the application 1 to the device driver 3 and to respond to the processing request from the device driver 3. Receive.

デバイスドライバー3は、対象となるデバイスを制御するためのプログラムであり、各デバイスの仕様に基づいて作成される。デバイスドライバー3は、コントローラー2に対して、上記の第2入出力インターフェイス12を提供しており、この第2入出力インターフェイス12を利用して、コントローラー2からの処理要求を受信すると共に、コントローラー2に対して当該処理要求に対する応答を行う。   The device driver 3 is a program for controlling a target device, and is created based on the specifications of each device. The device driver 3 provides the second input / output interface 12 to the controller 2, receives a processing request from the controller 2 using the second input / output interface 12, and In response to the processing request.

なお、コントローラー2が提供する第1入出力インターフェイス11の仕様は、デバイスドライバー3が提供する第2入出力インターフェイス12の仕様と同一、あるいは第2入出力インターフェイス12を拡張した仕様(例えば、XMLに対応するように拡張した仕様)であることが好ましい。これにより、アプリケーション開発者は、新たな入出力インターフェイスの仕様を覚える必要がなく、従来からあるデバイスドライバー3により提供されている入出力インターフェイスを利用するのと同様の感覚で開発を行うことができるため、アプリケーション1の開発効率を低下させることない。   Note that the specification of the first input / output interface 11 provided by the controller 2 is the same as the specification of the second input / output interface 12 provided by the device driver 3 or a specification obtained by extending the second input / output interface 12 (for example, in XML). It is preferable that the specification is extended so as to correspond. As a result, the application developer does not need to learn the specifications of the new input / output interface, and can develop with the same feeling as using the input / output interface provided by the conventional device driver 3. Therefore, the development efficiency of the application 1 is not reduced.

次に、図2の機能ブロック図を参照して、コントローラー2の機能構成について説明する。コントローラー2は、処理要求受信手段21、要求処理手段22、応答処理手段23、初期化設定情報取得手段24、初期化設定情報記憶手段25、状態検出手段26、復帰処理手段27、および初期化設定要求手段28を有している。   Next, the functional configuration of the controller 2 will be described with reference to the functional block diagram of FIG. The controller 2 includes a processing request receiving unit 21, a request processing unit 22, a response processing unit 23, an initialization setting information acquisition unit 24, an initialization setting information storage unit 25, a state detection unit 26, a return processing unit 27, and an initialization setting. Request means 28 is provided.

処理要求受信手段21は、アプリケーション1から処理要求を受信する手段として機能する。要求処理手段22は、アプリケーション1から受信した処理要求の内容およびデバイスドライバー3の状態に基づいて、適切な処理を行う手段として機能する。具体的には、アプリケーション1からの処理要求が初期化要求であった場合、当該初期化要求がアプリケーション1起動後の最初の初期化要求か否かを判別する(初期化要求判別手段)。この判別の結果、最初の初期化要求である場合、当該最初の初期化要求をデバイスドライバー3に送信する(初期化要求処理手段)。一方、最初の初期化要求で無い場合、当該初期化要求をデバイスドライバー3にブリッジ(送信)せず、デバイスドライバー3の状態に応じてアプリケーション1に初期化要求に対する応答を返す(初期化要求処理手段)。   The processing request receiving unit 21 functions as a unit that receives a processing request from the application 1. The request processing unit 22 functions as a unit that performs appropriate processing based on the content of the processing request received from the application 1 and the state of the device driver 3. Specifically, when the processing request from the application 1 is an initialization request, it is determined whether or not the initialization request is the first initialization request after the application 1 is activated (initialization request determination means). If the result of this determination is the first initialization request, the first initialization request is transmitted to the device driver 3 (initialization request processing means). On the other hand, if it is not the first initialization request, the initialization request is not bridged (transmitted) to the device driver 3 and a response to the initialization request is returned to the application 1 according to the state of the device driver 3 (initialization request processing) means).

また、処理要求が一連の処理を終了するための終了処理要求である場合、当該終了処理要求をデバイスドライバー3にブリッジせず、アプリケーション1に対して処理の成功を示す応答を返す。さらに、処理要求が上記初期化要求および終了処理要求以外のもの(以下、「通常処理要求」と称す。)の場合であって、デバイスドライバー3が正常動作している場合は、当該通常処理要求をデバイスドライバー3にブリッジし、デバイスドライバー3にエラーが発生している場合は、当該通常処理要求をデバイスドライバー3にブリッジせず、アプリケーション1に対して通常処理要求の失敗を示す応答を返す。   When the processing request is an end processing request for finishing a series of processing, the end processing request is not bridged to the device driver 3 and a response indicating the success of the processing is returned to the application 1. Further, when the processing request is other than the above-described initialization request and end processing request (hereinafter referred to as “normal processing request”) and the device driver 3 is operating normally, the normal processing request When the device driver 3 is bridged and an error has occurred in the device driver 3, the normal processing request is not bridged to the device driver 3, and a response indicating failure of the normal processing request is returned to the application 1.

応答処理手段23は、デバイスドライバー3から処理要求に対する応答を受信し、これをアプリケーション1に送信する手段として機能する。つまり、デバイスドライバー3からの応答をアプリケーション1にブリッジする手段として機能する。   The response processing unit 23 functions as a unit that receives a response to the processing request from the device driver 3 and transmits it to the application 1. That is, it functions as a means for bridging the response from the device driver 3 to the application 1.

初期化設定情報取得手段24は、デバイスドライバー3から初期化設定情報を取得する手段として機能する。この初期化設定情報は、デバイスドライバー3がアプリケーション1からの最初の初期化要求により初期化処理(実際に通信やインスタンスの初期化をする処理)を実行した後の状態(以下、この状態を「初期化状態」と称す。)を示す情報である。初期化設定情報記憶手段25は、取得した初期化設定情報を記憶(保存)する手段として機能する。   The initialization setting information acquisition unit 24 functions as a unit for acquiring initialization setting information from the device driver 3. This initialization setting information is a state after the device driver 3 executes an initialization process (a process for actually initializing communication and instances) in response to an initial initialization request from the application 1 (hereinafter, this state is referred to as “ This is information indicating “initialized state”. The initialization setting information storage unit 25 functions as a unit that stores (saves) the acquired initialization setting information.

状態検出手段26は、デバイスドライバー3の状態を検出する手段として機能するものであり、デバイスドライバー3からの処理要求に対する応答に基づいて自身(コントローラー2)の状態を設定し、この状態を確認することで、間接的にデバイスドライバー3の状態を検出する。具体的には、デバイスドライバー3からの処理要求に対する応答が処理の成功を示す応答であれば、自身の状態を正常状態に設定し、この状態(正常状態)を確認することでデバイスドライバー3は正常な状態であると検出する。一方、処理の失敗を示す応答であれば、自身の状態をエラー復帰待ち状態に設定し、この状態(エラー復帰待ち状態)を確認することでデバイスドライバー3にエラーが発生したことを検出する。   The state detection unit 26 functions as a unit for detecting the state of the device driver 3, sets the state of itself (controller 2) based on a response to the processing request from the device driver 3, and confirms this state. Thus, the state of the device driver 3 is indirectly detected. Specifically, if the response to the processing request from the device driver 3 is a response indicating the success of the processing, the device driver 3 sets the own state to a normal state and confirms this state (normal state). Detects normal state. On the other hand, if it is a response indicating a processing failure, it sets its own state to an error recovery waiting state and confirms this state (error recovery waiting state) to detect that an error has occurred in the device driver 3.

復帰処理手段27は、上記の状態検出手段26によりデバイスドライバー3にエラーが発生したことを検出した場合、デバイスドライバー3の状態(エラーの内容)に基づいて、適切な復帰処理(例えば、エラーを修復するためのコマンドを送る等)を行う手段として機能する。   When the state detection unit 26 detects that an error has occurred in the device driver 3, the return processing unit 27 performs an appropriate return process (for example, an error message) based on the state (error content) of the device driver 3. It functions as a means for sending a command for restoration, etc.).

初期化設定要求手段28は、復帰処理手段27によりデバイスドライバー3がエラーから復帰した場合、デバイスドライバー3の状態を、記憶した初期化設定情報に基づく状態に設定するための手段として機能する。これにより、実際に通信やインスタンスの初期化処理を行うことなく、デバイスドライバー3の状態を初期化状態(初期化処理後と同様の状態)に設定することができる。   The initialization setting request unit 28 functions as a unit for setting the state of the device driver 3 to a state based on the stored initialization setting information when the device driver 3 returns from an error by the return processing unit 27. Thereby, the state of the device driver 3 can be set to the initialization state (the same state as after the initialization processing) without actually performing communication or instance initialization processing.

ここで、図3ないし図5のシーケンス図を参照して、コントローラー2の処理について具体例を挙げて説明する。図3は、大まかなエラー処理を行うアプリケーション1を対象とした場合のコントローラー2の処理について説明するシーケンスの一例である。なお、大まかなエラー処理とは、デバイスドライバー3でエラーが発生した場合、アプリケーション1はエラーの内容やデバイスドライバー3の状態に関係なく終了処理要求および初期化要求を行う処理を言う。   Here, with reference to the sequence diagrams of FIGS. 3 to 5, the processing of the controller 2 will be described with a specific example. FIG. 3 is an example of a sequence for explaining the processing of the controller 2 when the application 1 that performs rough error processing is targeted. The rough error process is a process in which, when an error occurs in the device driver 3, the application 1 makes a termination process request and an initialization request regardless of the content of the error and the state of the device driver 3.

まず、アプリケーション1は、コントローラー2に対して、デバイスドライバー3を初期化するための初期化要求を行う(S01)。コントローラー2は、この初期化要求が、アプリケーション1起動後の最初の初期化要求か否か(つまり、アプリケーション1から受けた最初の初期化要求か否か)を判別する。ここでは、最初の初期化要求であるため、コントローラー2は、当該初期化要求をデバイスドライバー3へブリッジする(S02)。初期化要求を受けたデバイスドライバー3は、当該初期化要求に基づいて初期化処理(通信やインスタンスの初期化)を実行し(S03)、初期化処理が成功した旨を示す応答(以下、「成功応答」と称す。)をコントローラー2に返す(S04)。   First, the application 1 issues an initialization request for initializing the device driver 3 to the controller 2 (S01). The controller 2 determines whether or not this initialization request is the first initialization request after the application 1 is activated (that is, whether or not it is the first initialization request received from the application 1). Here, since it is the first initialization request, the controller 2 bridges the initialization request to the device driver 3 (S02). Upon receiving the initialization request, the device driver 3 executes initialization processing (communication and instance initialization) based on the initialization request (S03), and a response (hereinafter, “ "Success response" is returned to the controller 2 (S04).

続いて、初期化要求に対する成功応答を受けたコントローラー2は、デバイスドライバー3の現在の状態、つまり初期化処理直後の状態を取得し、初期化設定情報として記憶する(S05)。そして、コントローラー2は、デバイスドライバー3からの初期化要求に対する成功応答を、アプリケーション1にブリッジする(S06)。   Subsequently, the controller 2 that has received the success response to the initialization request acquires the current state of the device driver 3, that is, the state immediately after the initialization process, and stores it as initialization setting information (S05). Then, the controller 2 bridges the success response to the initialization request from the device driver 3 to the application 1 (S06).

続いて、アプリケーション1は、コントローラー2に対して、デバイスドライバー3に所定の処理Aを実行させるための処理要求(処理要求A)を行う(S07)。処理要求Aを受けたコントローラー2は、自身の状態(正常状態かエラー復帰待ち状態か)を確認する。つまり、デバイスドライバー3にエラーが発生しているか否かを確認する。ここでは、自身の状態は正常状態であるため(つまり、デバイスドライバー3は正常動作しているため)、コントローラー2は、当該処理要求Aをデバイスドライバー3にブリッジする(S08)。   Subsequently, the application 1 makes a processing request (processing request A) for causing the device driver 3 to execute the predetermined processing A to the controller 2 (S07). The controller 2 that has received the processing request A checks its own state (normal state or error recovery waiting state). That is, it is confirmed whether or not an error has occurred in the device driver 3. Here, the controller 2 bridges the processing request A to the device driver 3 (S08) because its own state is a normal state (that is, the device driver 3 is operating normally).

処理要求Aを受けたデバイスドライバー3は、当該処理要求Aに基づいて処理Aを実行し(S09)、処理Aが成功した旨を示す成功応答をコントローラー2に返す(S10)。そして、コントローラー2は、デバイスドライバー3からの処理要求Aに対する成功応答を、アプリケーション1にブリッジする(S11)。   The device driver 3 that has received the processing request A executes processing A based on the processing request A (S09), and returns a success response indicating that the processing A has been successful to the controller 2 (S10). Then, the controller 2 bridges the success response to the processing request A from the device driver 3 to the application 1 (S11).

続いて、アプリケーション1は、デバイスドライバー3に所定の処理Bを実行させるための処理要求(処理要求B)を行う(S12)。処理要求Bを受けたコントローラー2は、自身の状態(正常状態かエラー復帰待ち状態か)を確認する。ここでは、自身の状態は正常状態であるため(つまり、デバイスドライバー3は正常動作しているため)、コントローラー2は、当該処理要求Bをデバイスドライバー3にブリッジする(S13)。   Subsequently, the application 1 makes a processing request (processing request B) for causing the device driver 3 to execute the predetermined processing B (S12). The controller 2 that has received the processing request B checks its own state (normal state or waiting for error recovery). Here, the controller 2 bridges the processing request B to the device driver 3 (S13) because its own state is a normal state (that is, the device driver 3 is operating normally).

処理要求Bを受けたデバイスドライバー3は、処理要求Bに基づいて処理Bを実行する(S14)。この時、処理Bが失敗すると、デバイスドライバー3は、処理Bが失敗した旨を示す応答(以下、「失敗応答」と称す。)をコントローラー2に返す(S15)。コントローラー2は、デバイスドライバー3から処理要求Bに対する失敗応答を受けると、これをトリガーとしてデバイスドライバー3でエラーが発生したことを検出すると共に、自身の状態をエラー復帰待ち状態に遷移する(S16)。そして、コントローラー2は、処理要求Bに対する失敗応答をアプリケーション1にブリッジする(S17)。   Upon receiving the processing request B, the device driver 3 executes processing B based on the processing request B (S14). At this time, if the process B fails, the device driver 3 returns a response indicating that the process B has failed (hereinafter referred to as “failure response”) to the controller 2 (S15). Upon receiving a failure response to the processing request B from the device driver 3, the controller 2 detects that an error has occurred in the device driver 3 using this as a trigger, and changes its own state to an error recovery waiting state (S16). . Then, the controller 2 bridges the failure response to the processing request B to the application 1 (S17).

次に、コントローラー2は、デバイスドライバー3の状態(エラー内容)を確認し、この状態に基づいた復帰処理を実行する(例えば、デバイスドライバー3のエラー内容に応じた所定の復帰命令を出す;S18)。   Next, the controller 2 confirms the state (error content) of the device driver 3 and executes a return process based on this state (for example, issues a predetermined return command according to the error content of the device driver 3; S18). ).

ここで、処理要求Bに対する失敗応答を受けたアプリケーション1が、エラー処理を行うべく、コントローラー2に対して、一連の処理を終了するための処理要求(終了処理要求)を行うと(S19)、コントローラー2は、当該処理終了要求をデバイスドライバー3にブリッジせず、アプリケーション1に対して終了処理要求が成功した旨を示す成功応答を返す(S20)。   Here, when the application 1 that has received the failure response to the processing request B performs a processing request (end processing request) for ending a series of processing to the controller 2 to perform error processing (S19), The controller 2 does not bridge the process end request to the device driver 3, and returns a success response indicating that the end process request is successful to the application 1 (S20).

続いて、S18の復帰処理により、デバイスドライバー3がエラーから復帰すると、デバイスドライバー3は、コントローラー2に対してその旨(エラーから復帰した旨)を通知(エラー復帰通知)する(S21)。エラー復帰通知を受けたコントローラー2は、デバイスドライバー3の状態を、記憶した初期化設定情報に基づく状態に設定するように要求する(S22)。これにより、デバイスドライバー3は、自身の状態を初期化状態(S03の初期化処理を実行した直後の状態と同様の状態)に設定する(S23)。そして、コントローラー2は、デバイスドライバー3から当該設定が成功した旨を示す成功応答を受け(S24)、自身の状態をエラー復帰待ち状態から正常状態に遷移する(S25)。   Subsequently, when the device driver 3 recovers from the error by the recovery process of S18, the device driver 3 notifies the controller 2 (that has recovered from the error) (error recovery notification) (S21). Upon receiving the error return notification, the controller 2 requests to set the state of the device driver 3 to a state based on the stored initialization setting information (S22). Thereby, the device driver 3 sets its own state to the initialization state (the same state as the state immediately after the initialization process of S03 is executed) (S23). Then, the controller 2 receives a success response indicating that the setting is successful from the device driver 3 (S24), and changes its own state from the error recovery waiting state to the normal state (S25).

ここで、アプリケーション1からエラー処理の一環として初期化要求が行われると(S26)、コントローラー2は、当該初期化要求をデバイスドライバー3にブリッジすることなく、アプリケーション1に対して当該初期要求に対する成功応答を返す(S27)。つまり、アプリケーション1からの初期化要求があっても、実際にはデバイスドライバー3の初期化処理を実行しない。そして、初期化要求に対する成功応答を受けたアプリケーション1は、デバイスドライバー3のエラー処理が完了したと判断し、処理要求Aのリトライを行う(S28)。   Here, when an initialization request is made from the application 1 as part of error processing (S26), the controller 2 succeeds to the initial request for the application 1 without bridging the initialization request to the device driver 3. A response is returned (S27). That is, even if there is an initialization request from the application 1, the initialization process of the device driver 3 is not actually executed. Then, the application 1 that has received the success response to the initialization request determines that the error processing of the device driver 3 has been completed, and retries the processing request A (S28).

処理要求Aを受けたコントローラー2は、自身の状態(正常状態かエラー復帰待ち状態か)を確認する。ここでは、自身の状態は正常状態であるため(つまり、デバイスドライバー3はエラーから復帰し、正常動作しているため)、コントローラー2は、当該処理要求Aをデバイスドライバー3にブリッジする(S29)。そして、処理要求Aを受けたデバイスドライバー3は、処理要求Aに基づいて処理Aを実行し(S30)、処理Aが成功した旨を示す成功応答をコントローラー2に返す(S31)。そして、コントローラー2は、デバイスドライバー3からの処理要求Aに対する成功応答を、アプリケーション1にブリッジする(S32)。以降、アプリケーション1は、処理要求Aに続く処理要求(処理要求B)を行う。   The controller 2 that has received the processing request A checks its own state (normal state or error recovery waiting state). Here, the controller 2 bridges the processing request A to the device driver 3 because its own state is normal (that is, the device driver 3 has recovered from the error and is operating normally) (S29). . The device driver 3 that has received the processing request A executes the processing A based on the processing request A (S30), and returns a success response indicating that the processing A is successful to the controller 2 (S31). Then, the controller 2 bridges the success response to the processing request A from the device driver 3 to the application 1 (S32). Thereafter, the application 1 makes a processing request (processing request B) following the processing request A.

このように、エラー処理として、デバイスドライバー3の状態やエラー内容にかかわらず初期化処理(初期化要求)をするアプリケーション1に対して本発明のコントローラー2を導入することにより、アプリケーション1がエラー処理として行う初期化要求に対してデバイスドライバー3の初期化処理行わないため、処理全体のパフォーマンスの向上を図ることができる。   As described above, by introducing the controller 2 of the present invention to the application 1 that performs the initialization process (initialization request) regardless of the state of the device driver 3 and the error content as the error process, the application 1 performs the error process. Since the initialization process of the device driver 3 is not performed in response to the initialization request made as described above, the performance of the entire process can be improved.

次に、図4について説明する。図4は、エラー処理を行わないアプリケーション1を対象とした場合のコントローラー2の処理について説明するシーケンスの一例である。この図4のシーケンスは、アプリケーション1が、デバイスドライバー3のエラー発生時にエラー処理を行わず、処理要求のリトライを行う点で図3のシーケンスと異なる。以下、異なる部分について説明する。   Next, FIG. 4 will be described. FIG. 4 is an example of a sequence for explaining the processing of the controller 2 when the application 1 that does not perform error processing is targeted. The sequence in FIG. 4 is different from the sequence in FIG. 3 in that the application 1 does not perform error processing when an error of the device driver 3 occurs and retries a processing request. Hereinafter, different parts will be described.

アプリケーション1は、S57の処理で、処理要求Bに対する失敗応答を受けると、コントローラー2に処理要求Aのリトライを行う(S59)。処理要求Aを受けたコントローラー2は、自身の状態(正常状態かエラー復帰待ち状態か)を確認する(S60)。ここでは、自身の状態はエラー復帰待ち状態であるため(つまり、デバイスドライバー3にエラーが発生しているため)、コントローラー2は、当該処理要求Aをデバイスドライバー3にブリッジせず、アプリケーション1に対して処理要求Bの失敗応答を返す(S61)。   When the application 1 receives a failure response to the process request B in the process of S57, the application 1 retries the process request A to the controller 2 (S59). The controller 2 that has received the processing request A checks its own state (normal state or error recovery waiting state) (S60). Here, the controller 2 does not bridge the processing request A to the device driver 3 but to the application 1 because its own state is an error recovery waiting state (that is, an error has occurred in the device driver 3). A failure response of the processing request B is returned (S61).

つまり、コントローラー2は、S58の復帰処理によりデバイスドライバー3がエラーから復帰するまでは(デバイスドライバー3にエラーが発生している間は)、アプリケーション1からの処理要求をデバイスドライバー3にブリッジすることなく、アプリケーション1に対して失敗応答を返す処理を行う。このように、コントローラー2側でエラー処理を行うため、処理要求が失敗した場合、繊細なエラー処理を行なわずに処理要求をリトライするようなアプリケーション1にも対応することできる。   That is, the controller 2 bridges the processing request from the application 1 to the device driver 3 until the device driver 3 recovers from the error by the return processing of S58 (while the error occurs in the device driver 3). Instead, a process of returning a failure response to the application 1 is performed. As described above, since the error processing is performed on the controller 2 side, when the processing request fails, it is possible to deal with the application 1 in which the processing request is retried without performing the delicate error processing.

次に、図5について説明する。図5は、一定の処理毎にデバイスドライバー3の初期化を行うアプリケーション1を対象とした場合のコントローラー2の処理について説明するシーケンスの一例である。ここでは、処理要求A、処理要求B、終了処理要求および初期化要求を続けて行う処理を1セットとし、この処理セットを繰り返し行うアプリケーション1を例示する。なお、S81からS86までの処理は、図3のS01からS06までの処理と同様であるため、説明を省略する。   Next, FIG. 5 will be described. FIG. 5 is an example of a sequence for explaining the process of the controller 2 when the application 1 that initializes the device driver 3 for each fixed process is targeted. Here, an application 1 that repeats this processing set is illustrated as a set of processing that continuously performs processing request A, processing request B, end processing request, and initialization request. Note that the processing from S81 to S86 is the same as the processing from S01 to S06 in FIG.

S81からS86の処理完了後、アプリケーション1は、コントローラー2に対して、デバイスドライバー3に所定の処理Aを実行させるための処理要求(処理要求A)を行う(S87)。処理要求Aを受けたコントローラー2は、デバイスドライバー3の状態を確認する。ここでは、デバイスドライバー3は正常動作しているため、コントローラー2は、処理要求Aをデバイスドライバー3にブリッジする(S88)。処理要求Aを受けたデバイスドライバー3は、当該処理要求Aに基づいて処理Aを実行し(S89)、処理Aが成功した旨を示す成功応答をコントローラー2に返す(S90)。そして、コントローラー2は、デバイスドライバー3からの処理要求Aに対する成功応答を、アプリケーション1にブリッジする(S91)。   After completing the processing from S81 to S86, the application 1 makes a processing request (processing request A) for causing the device driver 3 to execute the predetermined processing A to the controller 2 (S87). The controller 2 that has received the processing request A confirms the state of the device driver 3. Here, since the device driver 3 is operating normally, the controller 2 bridges the processing request A to the device driver 3 (S88). The device driver 3 that has received the processing request A executes the processing A based on the processing request A (S89), and returns a success response indicating that the processing A is successful to the controller 2 (S90). Then, the controller 2 bridges the success response to the processing request A from the device driver 3 to the application 1 (S91).

続いて、アプリケーション1は、コントローラー2に対して、デバイスドライバー3に所定の処理Bを実行させるための処理要求(処理要求B)を行う(S92)。処理要求Bを受けたコントローラー2は、デバイスドライバー3の状態を確認する。ここでは、デバイスドライバー3は正常動作しているため、コントローラー2は、当該処理要求Bをデバイスドライバー3にブリッジする(S93)。処理要求Bを受けたデバイスドライバー3は、当該処理要求Bに基づいて処理Bを実行し(S94)、処理Bが成功した旨を示す成功応答をコントローラー2に返す(S95)。そして、コントローラー2は、デバイスドライバー3からの処理要求Bに対する成功応答を、アプリケーション1にブリッジする(S96)。   Subsequently, the application 1 makes a processing request (processing request B) for causing the device driver 3 to execute the predetermined processing B to the controller 2 (S92). The controller 2 that has received the processing request B checks the state of the device driver 3. Here, since the device driver 3 is operating normally, the controller 2 bridges the processing request B to the device driver 3 (S93). Upon receiving the processing request B, the device driver 3 executes processing B based on the processing request B (S94), and returns a success response indicating that the processing B is successful to the controller 2 (S95). Then, the controller 2 bridges the success response to the processing request B from the device driver 3 to the application 1 (S96).

続いて、アプリケーション1は、コントローラー2に対して、一連の処理を終了するための処理要求(終了処理要求)を行うと(S97)、コントローラー2は、当該処理終了要求をデバイスドライバー3にブリッジせず、アプリケーション1に対して終了処理要求が成功した旨を示す成功応答を返す(S98)。続いて、アプリケーション1は、コントローラー2に対して初期化要求を行うと(S99)、コントローラー2は、当該初期化要求をデバイスドライバー3にブリッジせず、アプリケーション1に対して初期化要求が成功した旨を示す成功応答を返す(S100)。この後、アプリケーション1は、S87からS100までの処理(一点鎖線で囲った範囲の処理)を繰り返す。   Subsequently, when the application 1 makes a process request (end process request) for ending a series of processes to the controller 2 (S97), the controller 2 bridges the process end request to the device driver 3. First, a success response indicating that the termination processing request has been successful is returned to the application 1 (S98). Subsequently, when the application 1 makes an initialization request to the controller 2 (S99), the controller 2 does not bridge the initialization request to the device driver 3, and the initialization request to the application 1 succeeds. A success response indicating this is returned (S100). Thereafter, the application 1 repeats the processing from S87 to S100 (processing in a range surrounded by a one-dot chain line).

このように、本発明のコントローラー2は、アプリケーション1が一定の処理毎に(所定のタイミングで)初期化処理を要求したとしても、デバイスドライバー3に初期化要求をブリッジしない。つまり、デバイスドライバー3の初期化処理を実行しない。これにより、一定の処理毎に初期化処理を要求するようなアプリケーション1に対し、本発明のコントローラー2を導入することで、処理パフォーマンスを向上させることができる。   As described above, the controller 2 of the present invention does not bridge the initialization request to the device driver 3 even if the application 1 requests the initialization process for every fixed process (at a predetermined timing). That is, the initialization process of the device driver 3 is not executed. Thereby, the processing performance can be improved by introducing the controller 2 of the present invention to the application 1 that requires the initialization process for every fixed process.

以上のように、本実施形態によれば、デバイスドライバー3にエラーが発生した場合は、コントローラー2がそのデバイスドライバー3の状態に応じた(エラー内容に応じた)適切な復帰処理(エラー処理)を実行する。これにより、アプリケーション1では、繊細なエラー処理を行う必要がなくなるため、アプリケーション1の処理フローを簡素化することができ、アプリケーション開発にかかるコストを低減させることができる。   As described above, according to the present embodiment, when an error occurs in the device driver 3, the controller 2 performs an appropriate return process (error process) according to the state of the device driver 3 (according to the error content). Execute. As a result, the application 1 does not need to perform delicate error processing, so the processing flow of the application 1 can be simplified, and the cost for application development can be reduced.

また、コントローラー2で、最初の初期化処理後のデバイスドライバー3の状態(初期化設定情報)を記憶しておき、デバイスドライバー3がエラーから復帰した後、この初期化設定情報に基づいてデバイスドライバー3の状態を初期化処理後と同等の状態にすることができる。これにより、通信やインスタンスの初期化など長時間を要する初期化処理を不要とすることができ、処理パフォーマンスを向上することができる。   In addition, the controller 2 stores the state (initialization setting information) of the device driver 3 after the initial initialization process, and after the device driver 3 recovers from the error, the device driver is based on the initialization setting information. The state 3 can be made equivalent to that after the initialization process. This eliminates the need for initialization processing that requires a long time, such as communication and instance initialization, and improves processing performance.

なお、アプリケーション1は、コントローラー2が提供する第1入出力インターフェイス11を用いてデバイス制御を行うものであれば良く、例えば、処理要求毎にその処理が成功したか失敗したかを判断し、判断結果に基づいて次の処理要求を確定する逐次処理を行うものであっても良いし、複数の処理要求をまとめて実行した後、処理の成功/失敗を判断し、この判断結果に基づいて次の処理要求を確定する一括処理を行うものであっても良い。   The application 1 only needs to perform device control using the first input / output interface 11 provided by the controller 2. For example, the application 1 determines whether the processing has succeeded or failed for each processing request. Sequential processing for determining the next processing request based on the result may be performed, or after a plurality of processing requests are collectively executed, the success / failure of the processing is determined, and the next based on the determination result It is also possible to perform batch processing for determining the processing request.

後者の例として、例えば、マークアップ言語の一種であるXMLで複数の処理要求をまとめて定義し、一括処理するアプリケーション1が考えられる。このアプリケーション1のように、一括処理するがために、エラー処理(エラーハンドリング)を繊細に行うことができないアプリケーション1であっても、本発明のコントローラー2を導入することで適切なエラー処理を行うことができるため、このような一括処理を行うアプリケーション1の実現が容易になる。   As an example of the latter, for example, an application 1 that collectively defines a plurality of processing requests in XML, which is a kind of markup language, and performs batch processing can be considered. Even in the case of the application 1 that cannot perform error processing (error handling) delicately because of batch processing like the application 1, appropriate error processing is performed by introducing the controller 2 of the present invention. Therefore, the application 1 that performs such batch processing can be easily realized.

また、本実施形態のコントローラー2は、UPOS(Unified POS)の規格に則った仕様を実現するデバイスドライバー3(UPOS準拠ドライバー)にも適用することができる。この場合、コントローラー2とUPOS準拠ドライバーとの間の入出力インターフェイス(第2入出力インターフェイス12)を、UPOSの仕様に準拠した入出力インターフェイスとすることで実現することができる。   The controller 2 of the present embodiment can also be applied to a device driver 3 (UPOS-compliant driver) that realizes specifications conforming to the UPOS (Unified POS) standard. In this case, the input / output interface (second input / output interface 12) between the controller 2 and the UPOS-compliant driver can be realized by an input / output interface compliant with the UPOS specification.

1…アプリケーション 2…コントローラー 3…デバイスドライバー 21…処理要求受信手段 22…要求処理手段 23…応答処理手段 24…初期化設定情報取得手段 25…初期化設定情報記憶手段 26…状態検出手段 27…復帰処理手段 28…初期化設定要求手段 CM…コンポーネントモデル   DESCRIPTION OF SYMBOLS 1 ... Application 2 ... Controller 3 ... Device driver 21 ... Processing request receiving means 22 ... Request processing means 23 ... Response processing means 24 ... Initialization setting information acquisition means 25 ... Initialization setting information storage means 26 ... Status detection means 27 ... Return Processing means 28 ... Initialization setting request means CM ... Component model

本発明は、処理要求に対する応答を行うためのコントローラーの制御方法に関するものである。 The present invention relates a response to the processing request to the control how the controllers of the line Utame.

本発明は、上記の問題に鑑み、アプリケーションの開発を簡素化でき、且つデバイスを制御するための処理パフォーマンスの向上を図ることができるコントローラーの制御方法を提供することを目的とする。 In view of the above problems, it can simplify the development of applications, and an object thereof to provide a control how the controller can improve the processing performance for controlling the device.

本発明のコントローラーの制御方法は、理要求に対する応答を行うコントローラーの制御方法であって、処理要求を受信、受信した処理要求が初期化要求である場合、当該初期化要求が最初の初期化要求か否かを判別受信した初期化要求が最初の初期化要求であると判別した場合、初期化処理を行い、受信した初期化要求が最初の初期化要求ではないと判別した場合、初期化処理を行わないことを特徴とする。 The method of the controller of the present invention is a control method of the row Uco Controller responses to treatment requirements, when receiving a processing request, the received processing request is an initialization request, the initialization request it is determined whether or not the first initialization request, if the received initialization request is determined to be the first initialization request, performs an initialization process, the received initialization request is not the first initialization request If it is discriminated, the initialization process is not performed .

この場合、受信した初期化要求が最初の初期化要求ではないと判別した場合、初期化処理を行わずに、初期化要求に対する応答を返すことが好ましい。In this case, when it is determined that the received initialization request is not the first initialization request, it is preferable to return a response to the initialization request without performing the initialization process.

この場合、受信した初期化要求が最初の初期化要求であると判別した場合、初期化処理を行った後、さらに、初期化処理後の状態を示す初期化設定情報を記憶し、動作状態を検出し、動作状態を検出する際に、エラーが発生したことを検出した場合、当該エラーに基づく復帰処理を実行し、復帰処理によりエラーから復帰した場合、動作状態を、記憶した初期化設定情報に基づく状態に設定することが好ましい。In this case, when it is determined that the received initialization request is the first initialization request, after performing the initialization process, the initialization setting information indicating the state after the initialization process is further stored, and the operation state is changed. When detecting that an error has occurred when detecting and detecting the operation state, a recovery process based on the error is executed, and when the error is recovered from the error recovery process, the operation state is stored as initialization setting information. It is preferable to set to a state based on.

本発明の他のコントローラーの制御方法は、処理要求に対する応答を行うコントローラーの制御方法であって、処理要求を受信し、受信した処理要求が初期化要求である場合、初期化要求に基づく初期化処理後の状態を示す初期化設定情報を記憶し、動作状態を検出し、動作状態を検出する際に、エラーが発生したことを検出した場合、当該エラーに基づく復帰処理を実行し、復帰処理によりエラーから復帰した場合、動作状態を、記憶した初期化設定情報に基づく状態に設定することを特徴とする。 Another controller control method of the present invention is a controller control method for responding to a processing request. When a processing request is received and the received processing request is an initialization request, initialization based on the initialization request is performed. Initialization setting information indicating the state after processing is stored, the operation state is detected, and when the operation state is detected, when the occurrence of an error is detected, the return process based on the error is executed, and the return process When returning from the error by the above, the operation state is set to a state based on the stored initialization setting information.

この場合、エラーが発生したことを検出した場合において、復帰処理によりエラーから復帰する前に、処理要求を受信した場合、処理要求に基づく処理を実行せずに、処理要求の失敗応答を返すことが好ましい。In this case, if an error has been detected and a processing request is received before returning from the error by return processing, a failure response to the processing request is returned without executing processing based on the processing request. Is preferred.

この場合、処理要求は、複数の処理要求をまとめて定義したものであることが好ましい。 In this case , the processing request is preferably a definition of a plurality of processing requests collectively.

また、この場合、複数の処理要求は、マークアップ言語で定義されていることが好ましい。
In this case , the plurality of processing requests are preferably defined in a markup language.

Claims (7)

アプリケーションとデバイスドライバーとの間に介在し、前記アプリケーションからの処理要求を前記デバイスドライバーに転送すると共に、前記デバイスドライバーからの前記処理要求に対する応答を前記アプリケーションに転送するためのソフトウェアモジュールであるコントローラーの制御方法であって、
前記アプリケーションから前記処理要求を受信する処理要求受信ステップと、
受信した前記処理要求が初期化要求である場合、当該初期化要求が前記アプリケーションの起動後における最初の初期化要求か否かを判別する初期化要求判別ステップと、
前記初期化要求判別ステップにおける判別の結果、前記初期化要求が前記最初の初期化要求である場合、前記デバイスドライバーへ当該最初の初期化要求を送信する初期化要求送信ステップと、
前記最初の初期化要求に基づく前記デバイスドライバーの初期化処理後の状態を示す初期化設定情報を前記デバイスドライバーから取得し、当該初期化設定情報を記憶する初期化設定情報記憶ステップと、
前記デバイスドライバーの状態を検出する状態検出ステップと、
前記状態検出ステップにおいて、前記デバイスドライバーでエラーが発生したことを検出した場合、当該デバイスドライバーの状態に基づく復帰処理を実行する復帰処理ステップと、
前記復帰処理により前記デバイスドライバーがエラーから復帰した場合、前記デバイスドライバーの状態を、記憶した前記初期化設定情報に基づく状態に設定するための要求を前記デバイスドライバーに送信する初期化設定要求ステップと、を備えたことを特徴とするコントローラーの制御方法。
A controller that is a software module that is interposed between an application and a device driver and transfers a processing request from the application to the device driver and a response to the processing request from the device driver to the application. A control method,
A process request receiving step for receiving the process request from the application;
If the received processing request is an initialization request, an initialization request determination step for determining whether the initialization request is the first initialization request after the application is started,
As a result of determination in the initialization request determination step, if the initialization request is the first initialization request, an initialization request transmission step of transmitting the initial initialization request to the device driver;
An initialization setting information storage step for acquiring initialization setting information indicating a state after the initialization process of the device driver based on the initial initialization request from the device driver, and storing the initialization setting information;
A state detection step of detecting a state of the device driver;
In the state detection step, when it is detected that an error has occurred in the device driver, a return processing step for executing a return process based on the state of the device driver;
An initialization setting request step for transmitting, to the device driver, a request for setting the state of the device driver to a state based on the stored initialization setting information when the device driver returns from an error by the return processing; A method for controlling a controller, comprising:
前記初期化要求判別ステップにおける判別の結果、受信した前記初期化要求が前記最初の初期化要求ではない場合、当該初期化要求を前記デバイスドライバーに送信せず、前記デバイスドライバーの状態に応じて、前記アプリケーションに前記初期化要求に対する応答を返すことを特徴とする請求項1に記載のコントローラーの制御方法。   As a result of determination in the initialization request determination step, if the received initialization request is not the first initialization request, the initialization request is not transmitted to the device driver, depending on the state of the device driver, The controller control method according to claim 1, wherein a response to the initialization request is returned to the application. アプリケーションとデバイスドライバーとの間に介在し、前記アプリケーションからの処理要求を前記デバイスドライバーに転送すると共に、前記デバイスドライバーからの前記処理要求に対する応答を前記アプリケーションに転送するためのソフトウェアモジュールであるコントローラーであって、
前記アプリケーションから前記処理要求を受信する処理要求受信手段と、
受信した前記処理要求が初期化要求である場合、当該初期化要求が前記アプリケーションの起動後における最初の初期化要求か否かを判別する初期化要求判別手段と、
前記初期化要求判別手段における判別の結果、前記初期化要求が前記最初の初期化要求である場合、前記デバイスドライバーへ当該最初の初期化要求を送信する初期化要求処理手段と、
前記最初の初期化要求に基づく前記デバイスドライバーの初期化処理後の状態を示す初期化設定情報を前記デバイスドライバーから取得する初期化設定情報取得手段と、
取得した前記初期化設定情報を記憶する初期化設定情報記憶手段と、
前記デバイスドライバーの状態を検出する状態検出手段と、
前記状態検出手段において、前記デバイスドライバーでエラーが発生したことを検出した場合、当該デバイスドライバーの状態に基づく復帰処理を実行する復帰処理手段と、
前記復帰処理により前記デバイスドライバーがエラーから復帰した場合、前記デバイスドライバーの状態を、記憶した前記初期化設定情報に基づく状態に設定するための要求を前記デバイスドライバーに送信する初期化設定要求手段と、を備えたことを特徴とするコントローラー。
A controller that is a software module that is interposed between an application and a device driver and transfers a processing request from the application to the device driver and a response to the processing request from the device driver to the application. There,
Processing request receiving means for receiving the processing request from the application;
If the received processing request is an initialization request, initialization request determination means for determining whether the initialization request is the first initialization request after the application is started, and
As a result of the determination in the initialization request determination means, if the initialization request is the first initialization request, an initialization request processing means for transmitting the initial initialization request to the device driver;
Initialization setting information acquisition means for acquiring initialization setting information indicating the state after initialization processing of the device driver based on the initial initialization request from the device driver;
Initialization setting information storage means for storing the acquired initialization setting information;
State detection means for detecting the state of the device driver;
In the state detection unit, when it is detected that an error has occurred in the device driver, a return processing unit that executes a return process based on the state of the device driver;
An initialization setting requesting means for transmitting to the device driver a request for setting the state of the device driver to a state based on the stored initialization setting information when the device driver recovers from an error by the return processing; The controller characterized by having.
前記初期化要求処理手段は、
前記初期化要求判別手段における判別の結果、受信した前記初期化要求が前記最初の初期化要求ではない場合、当該初期化要求を前記デバイスドライバーに送信せず、前記デバイスドライバーの状態に応じて、前記アプリケーションに前記初期化要求に対する応答を返すことを特徴とする請求項3に記載のコントローラー。
The initialization request processing means includes:
If the received initialization request is not the first initialization request as a result of the determination in the initialization request determination means, the initialization request is not transmitted to the device driver, depending on the state of the device driver, The controller according to claim 3, wherein a response to the initialization request is returned to the application.
前記コントローラーの入出力インターフェイスは、前記デバイスドライバーの入出力インターフェイスと同一の仕様、および前記デバイスドライバーの入出力インターフェイスを拡張した仕様のいずれかであることを特徴とする請求項3または4に記載のコントローラー。   The input / output interface of the controller has any one of the same specification as the input / output interface of the device driver and a specification obtained by extending the input / output interface of the device driver. controller. 前記処理要求は、複数の処理要求をまとめて定義したものであることを特徴とする請求項3ないし5のいずれかに記載のコントローラー。   6. The controller according to claim 3, wherein the processing request is a definition of a plurality of processing requests collectively. 前記複数の処理要求は、マークアップ言語で定義されていることを特徴とする請求項6に記載のコントローラー。   The controller according to claim 6, wherein the plurality of processing requests are defined in a markup language.
JP2014076708A 2014-04-03 2014-04-03 Control method of controller Expired - Fee Related JP5954353B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014076708A JP5954353B2 (en) 2014-04-03 2014-04-03 Control method of controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014076708A JP5954353B2 (en) 2014-04-03 2014-04-03 Control method of controller

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2013056523A Division JP5516782B2 (en) 2013-03-19 2013-03-19 Controller control method and controller

Publications (2)

Publication Number Publication Date
JP2014160484A true JP2014160484A (en) 2014-09-04
JP5954353B2 JP5954353B2 (en) 2016-07-20

Family

ID=51612086

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014076708A Expired - Fee Related JP5954353B2 (en) 2014-04-03 2014-04-03 Control method of controller

Country Status (1)

Country Link
JP (1) JP5954353B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017059161A (en) * 2015-09-18 2017-03-23 セイコーエプソン株式会社 Pos terminal and pos driver installed to the same

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09307587A (en) * 1996-05-09 1997-11-28 Fujitsu Ltd Exchange
JP2000168196A (en) * 1998-12-02 2000-06-20 Ricoh Co Ltd Initializing method for image forming apparatus
JP2001282394A (en) * 2000-03-30 2001-10-12 Seiko Epson Corp Communication terminal equipment, its control method and its recording medium
JP2004139492A (en) * 2002-10-21 2004-05-13 Hitachi Ltd Computer system
US20060129971A1 (en) * 2004-11-24 2006-06-15 Rojer Alan S Object-oriented processing of markup
US20060242402A1 (en) * 2005-04-06 2006-10-26 University Of Washington Recovering device drivers
JP2008243235A (en) * 2002-09-06 2008-10-09 Canon Inc Information processor, information processing method, and print control program
JP2008305298A (en) * 2007-06-11 2008-12-18 Canon Inc Information processor, print setting method, storage medium and program

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09307587A (en) * 1996-05-09 1997-11-28 Fujitsu Ltd Exchange
JP2000168196A (en) * 1998-12-02 2000-06-20 Ricoh Co Ltd Initializing method for image forming apparatus
JP2001282394A (en) * 2000-03-30 2001-10-12 Seiko Epson Corp Communication terminal equipment, its control method and its recording medium
JP2008243235A (en) * 2002-09-06 2008-10-09 Canon Inc Information processor, information processing method, and print control program
JP2004139492A (en) * 2002-10-21 2004-05-13 Hitachi Ltd Computer system
US20060129971A1 (en) * 2004-11-24 2006-06-15 Rojer Alan S Object-oriented processing of markup
US20060242402A1 (en) * 2005-04-06 2006-10-26 University Of Washington Recovering device drivers
JP2008305298A (en) * 2007-06-11 2008-12-18 Canon Inc Information processor, print setting method, storage medium and program

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JPN6015019948; Jorrit N. Herder、他4名: 'Failure Resilience for Device Drivers' Dependable Systems and Networks, 2007. DSN '07. 37th Annual IEEE/IFIP International Conference on , 200706, IEEE *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017059161A (en) * 2015-09-18 2017-03-23 セイコーエプソン株式会社 Pos terminal and pos driver installed to the same

Also Published As

Publication number Publication date
JP5954353B2 (en) 2016-07-20

Similar Documents

Publication Publication Date Title
JP5229112B2 (en) Controller control method and controller
US20220179682A1 (en) Task processing method, apparatus, and system based on distributed system
US20210311724A1 (en) Updating system, electronic control unit, updating management device, and updating management method
US9983791B2 (en) System management controller and method of configuration file backup and recovery
RU2614569C2 (en) Rack with automatic recovery function and method of automatic recovery for this rack
US9971557B2 (en) Information processing apparatus, control method, and storage medium
US9436491B1 (en) Computer system and method for testing hardware device based on virtual machine
KR101593163B1 (en) Apparatus and method of analyzing malicious code in actual environment
CN104395879A (en) Auto-update while running client interface with handshake
JP7345921B2 (en) OTA differential update method and system for master-slave architecture
JP4646859B2 (en) USB device and USB connection system
JP2016009400A (en) Monitoring device, information processing system and monitoring method
JP5954353B2 (en) Control method of controller
CN107678891B (en) Double control method and device of storage system and readable storage medium
KR101714522B1 (en) Method and apparatus for providing linking service between vehicle audio video nevigation and smartphone based on virtualization framework
US9432545B2 (en) Information processing apparatus, method of controlling the same, and storage medium for controlling transition to a sleep mode and setting of an interrupt setting in accordance with reception of data
JP2006235992A (en) Firmware rewriting system of printer, firmware rewriting method, and printer
JP5516782B2 (en) Controller control method and controller
JP5674730B2 (en) Communication error between data card and host and method for recovery of data card error
US11650794B2 (en) Electronic control apparatus
JP2007172186A (en) Data update device, and data update method
JP6221972B2 (en) Firmware update system and update control method
CN114237722A (en) System starting method, device, equipment and engineering vehicle
CN112241279A (en) Self-adaptive electronic control unit software upgrading method and system and automobile
JP2017049874A (en) Information processing device, information processing system, control method, and control program

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150526

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150721

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20151006

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20151204

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: 20160517

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160530

R150 Certificate of patent or registration of utility model

Ref document number: 5954353

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees