JP4246560B2 - Information processing apparatus, information processing method, program, and recording medium - Google Patents

Information processing apparatus, information processing method, program, and recording medium Download PDF

Info

Publication number
JP4246560B2
JP4246560B2 JP2003199950A JP2003199950A JP4246560B2 JP 4246560 B2 JP4246560 B2 JP 4246560B2 JP 2003199950 A JP2003199950 A JP 2003199950A JP 2003199950 A JP2003199950 A JP 2003199950A JP 4246560 B2 JP4246560 B2 JP 4246560B2
Authority
JP
Japan
Prior art keywords
event
function
information processing
state
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.)
Expired - Fee Related
Application number
JP2003199950A
Other languages
Japanese (ja)
Other versions
JP2004164582A (en
Inventor
邦洋 秋吉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ricoh Co Ltd
Original Assignee
Ricoh Co 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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2003199950A priority Critical patent/JP4246560B2/en
Priority to US10/626,608 priority patent/US7554685B2/en
Priority to EP03254672A priority patent/EP1385089A3/en
Priority to CN 200510113871 priority patent/CN1818871B/en
Priority to CNB03160255XA priority patent/CN1273888C/en
Publication of JP2004164582A publication Critical patent/JP2004164582A/en
Application granted granted Critical
Publication of JP4246560B2 publication Critical patent/JP4246560B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Description

【0001】
【発明の属する技術分野】
この発明は、コピー、プリンタ、スキャナおよびファクシミリなどの画像形成処理にかかるユーザサービスを提供し、状態遷移モデルに基づいてアプリケーションを開発するための関数が登録されたユーティリティライブラリを備えた画像形成装置およびアプリケーション生成方法に関するものである。
【0002】
【従来の技術】
近年では、プリンタ、コピー、ファクシミリ、スキャナなどの各装置の機能を1つの筐体内に収納した画像形成装置(以下、「複合機」という。)が知られている。この複合機は、1つの筐体内に表示部、印刷部および撮像部などを設けるとともに、プリンタ、コピーおよびファクシミリ装置にそれぞれ対応した3種類のソフトウェア(アプリケーション)を設け、これらのソフトウェアを切り替えることによって、当該装置をプリンタ、コピー、スキャナまたはファクシミリ装置として動作させるものである。
【0003】
このような従来の複合機では、複合機上で動作するアプリケーションの開発は、複合機の開発元で一括して行い、開発されたアプリケーションをROMなどに焼き付けた状態で複合機を出荷し、出荷後は新たなアプリケーションの追加を行わないのが一般的である。
【0004】
ところで、このような従来の複合機では、プリンタ、コピー、スキャナおよびファクシミリ装置に対応するソフトウェアをそれぞれ別個に設けているため、各ソフトウェアの開発に多大の時間を要する。このため、出願人は、表示部、印刷部および撮像部などの画像形成処理で使用されるハードウェア資源を有し、プリンタ、コピーまたはファクシミリなどの各ユーザサービスにそれぞれ固有の処理を行うアプリケーションを複数搭載し、これらのアプリケーションとハードウェア資源との間に介在して、ユーザサービスを提供する際に、アプリケーションの少なくとも2つが共通的に必要とするハードウェア資源の管理、実行制御並びに画像形成処理を行う各種コントロールサービスからなるプラットホームを含む画像形成装置(複合機)を発明した(例えば、特許文献1参照)。
【0005】
【特許文献1】
特開2002−82806号公報
【0006】
【発明が解決しようとする課題】
このような新規な複合機は、アプリケーションの少なくとも2つが共通的に必要とするハードウェア資源の管理、実行制御並びに画像形成処理を行うプラットホームを備えた構成とすることによって、ソフトウェア開発の効率化を図るとともに、装置全体としての生産性を向上させることができる点で優れている。
【0007】
一方、このような新規な複合機では、アプリケーションと、ハードウェア資源にアクセスするような開発が難しい処理を行うコントロールサービスとが別個に設けられているため、複合機の出荷後にユーザもしくは第三者であるサードベンダが新規な外部アプリケーションを開発して複合機に搭載することができる構成となっている。
【0008】
このため、このような複合機では、複数のサードベンダによってそれぞれ別個に開発されたアプリケーションが複数搭載されて同時に動作する場合がある。また、一つのサードベンダが開発した一つのアプリケーションであっても、そのアプリケーション内部の複数のモジュールを別々の部署で自由に開発して一つのアプリケーションとして統合して提供する場合も考えられる。
【0009】
このように、アプリケーションの開発を複合機の開発メーカ以外のサードベンダ等に委ねた場合、各サードベンダが独自の手法でアプリケーション開発を行うこととなってしまうため、開発されたアプリケーション内部で障害が発生したり、出荷時に予め搭載されている既存のアプリケーションや複合機のシステムに悪影響を与えてしまうおそれがある。特に、アプリケーションプログラムで使用される共用変数や複合機独自のイベントについて全くその使用方法をサードベンダに委ねてしまうと、ソフトウェア障害によって複合機のシステムが不安定になってしまうおそれが高い。このような問題は、画像形成装置上で動作するアプリケーションのみならず、一般的な情報処理装置上で動作するアプリケーションにとっても問題となることである。
【0010】
この発明は上記に鑑みてなされたもので、システムの安定性を保持しつつアプリケーションの追加を容易に行うことができる情報処理装置およびアプリケーション生成方法を得ることを目的とする。
【0011】
【課題を解決するための手段】
上記目的を達成するため、請求項1にかかる発明は、イベントメッセージを送信する制御機能部を備えた情報処理装置であって、前記情報処理装置は、アプリケーションプログラムが当該情報処理装置により実行されることにより実現されるアプリケーション部を更に備え、前記アプリケーションプログラムは、ある状態においてイベントメッセージを受信したことに応じてイベント関数を実行し、前記状態から別の状態に遷移する状態遷移モデルに基づく処理を行うモジュールと、当該モジュールから所定のイベント関数呼び出しにより呼び出される、前記状態遷移モデルに基づく処理を行う別のモジュールとを少なくとも有し、前記アプリケーション部は、イベントメッセージとイベント関数とを対応付けて格納するイベント関数テーブルを状態ごとに備え、前記アプリケーション部は更に、前記制御機能部からのイベントメッセージの受信に応じて、各モジュールで共用する共用変数を、前記モジュールごとに別個のメモリ領域に割り当てる手段と、現在の状態に対応するイベント関数テーブルを参照することにより、前記受信したイベントメッセージに対応するイベント関数を実行する手段とを備えることを特徴とする情報処理装置である。
請求項2に記載された発明は、前記アプリケーション部は、前記状態とは無関係に発生する非同期イベントメッセージを受信したときに実行する標準関数と、当該非同期イベントメッセージとを対応付けて格納した標準関数テーブルと、前記標準関数テーブルを参照することにより、前記受信したイベントメッセージに対応する標準関数を実行する手段とを更に備えた請求項1に記載の情報処理装置である。
請求項3に記載された発明は、前記情報処理装置は、画像形成処理を実行する画像形成装置である請求項1又は2に記載の情報処理装置である。また、請求項4に記載された発明は、前記情報処理装置は、画像形成処理で使用されるハードウェア資源を備え、前記制御機能部は、前記アプリケーション部と前記ハードウェア資源との間に介在し、前記アプリケーション部からの要求に応じて前記ハードウェア資源を用いた処理の実行制御を行う機能部である請求項3に記載の情報処理装置である。
請求項5〜8に記載された発明は、上記情報処理装置に対応する情報処理方法の発明であり、請求項9〜12に記載された発明は、上記情報処理装置のアプリケーション部に対応するアプリケーションプログラムの発明であり、請求項13に記載された発明は、当該アプリケーションプログラムを記録したコンピュータ読み取り可能な記録媒体の発明である。
なお本発明は、プログラムの取り得る状態と、前記状態下で前記プログラムに対して生じうるイベントと、前記イベントが前記状態下で生じたときに実行されるイベント関数と、前記イベント関数の実行後の遷移先の状態とによって動作が決定される状態遷移モデルに基づいた複数のネスト構造のモジュールを含む前記プログラムに実装され、各モジュールで共用する共用変数に対し前記モジュールごとに別個の領域に割り当てる状態遷移モデル起動関数が登録されたユーティリティライブラリを備えたことを特徴とする情報処理装置として構成することもできる。
【0012】
この発明によれば、プログラムの取り得る状態と、前記状態下で前記プログラムに対して生じうるイベントと、前記イベントが前記状態下で生じたときに実行されるイベント関数と、前記イベント関数の実行後の遷移先の前記状態とによって動作が決定される状態遷移モデルに基づいた複数のネスト構造のモジュールを含む前記プログラムに実装され、各モジュールで共有する共用変数を前記モジュールごとに別個の領域に割り当てる状態遷移モデル起動関数が登録されたユーティリティライブラリを備えているので、プログラムを構成するモジュール間で共用変数を安全に使用することができ、変数の値に起因する障害を回避でき、情報処理装置に新規アプリケーションを搭載可能としながらも情報処理装置の安定性を維持することができる。
【0013】
また、上記情報処理装置において、前記ユーティリティライブラリの前記状態遷移モデル起動関数は、前記共用変数を、前記モジュールごとのスタック領域で指定された領域に割り当てることとしてもよい
【0014】
この発明によれば、状態遷移モデル起動関数は、前記共用変数を、前記モジュールごとのスタック領域で指定された領域に割り当てることで、関数呼び出しの際に使用されるスタック領域を利用してモジュールが呼び出しの際に効率的に共用変数の割り当てを行うことができる。
【0015】
また、前記ユーティリティライブラリの前記状態遷移モデル起動関数は、スレッド単位で共用される共用変数を前記スレッドごとに別個の領域に割り当てることとしてもよい
【0016】
この発明によれば、状態遷移モデル起動関数は、スレッド単位で共用される共用変数を前記スレッドごとに別個の領域に割り当てることで、プログラムのプロセス内部で動作するスレッド内部で共用変数を安全に使用することができ、変数の値に起因する障害を回避できる。
【0017】
また、前記ユーティリティライブラリの前記状態遷移モデル起動関数は、前記状態の遷移が生じたときに行う処理を定めた入場関数を実行することとしてもよい
【0018】
この発明によれば、状態遷移モデル起動関数は、前記状態の遷移が生じたときに行う処理を定めた入場関数を実行することで、モジュール呼び出しの際に定型的に行われる処理を実行することができ、プログラム開発を効率的に行える。
【0019】
また、前記ユーティリティライブラリの前記状態遷移モデル起動関数は、前記状態とは無関係に発生する非同期イベントを受信したときに行う処理を定めた標準関数を実行することとしてもよい
【0020】
この発明によれば、状態遷移モデル起動関数は、前記状態とは無関係に発生する非同期イベントを受信したときに行う処理を定めた標準関数を実行することで、現在の状態とは無関係に生じるシステム関連のイベントなどに他のプログラムに悪影響を与えずに対処することができ、画像形成装置の安定性を向上させることができる。
【0025】
【発明の実施の形態】
以下に添付図面を参照して、この発明にかかる情報処理装置およびアプリケーション生成方法の好適な実施の形態を詳細に説明する。以下、情報処理装置の例として画像形成装置について説明する。
(実施の形態1)
図1は、この発明の実施の形態1である画像形成装置(以下、「複合機」という。)の構成を示すブロック図である。
【0026】
図1に示すように、複合機100は、白黒レーザプリンタ(B&W LP)101と、カラーレーザプリンタ(Color LP)102とハードディスク装置(HDD)103と、ファクシミリ、メモリなどのハードウェアリソース104を有するとともに、プラットホーム120と、アプリケーション130とから構成されるソフトウェア群110とを備えている。
【0027】
プラットホーム120は、アプリケーションからの処理要求を解釈してハードウェア資源の獲得要求を発生させるコントロールサービスと、一または複数のハードウェア資源の管理を行い、コントロールサービスからの獲得要求を調停するシステムリソースマネージャ(SRM)123と、汎用OS121とを有する。
【0028】
コントロールサービスは、複数のサービスモジュールから形成され、SCS(システムコントロールサービス)122と、ECS(エンジンコントロールサービス)124と、MCS(メモリコントロールサービス)125と、OCS(オペレーションパネルコントロールサービス)126と、FCS(ファックスコントロールサービス)127と、NCS(ネットワークコントロールサービス)128とから構成される。このプラットホーム120は、あらかじめ定義された関数により前記アプリケーション130から処理要求を受信可能とするアプリケーションプログラムインタフェース(API)を有する。
【0029】
汎用OS121は、UNIX(登録商標)などの汎用オペレーティングシステムであり、プラットホーム120並びにアプリケーション130の各ソフトウェアをそれぞれプロセスとして並列実行する。
【0030】
SRM123のプロセスは、SCS122とともにシステムの制御およびリソースの管理を行うものである。SRM123のプロセスは、スキャナ部やプリンタ部などのエンジン、メモリ、HDDファイル、ホストI/O(セントロI/F、ネットワークI/F、IEEE1394 I/F、RS232C I/Fなど)のハードウェア資源を利用する上位層からの要求にしたがって調停を行い、実行制御する。
【0031】
具体的には、このSRM123は、要求されたハードウェア資源が利用可能であるか(他の要求により利用されていないかどうか)を判断し、利用可能であれば要求されたハードウェア資源が利用可能である旨を上位層に伝える。また、SRM123は、上位層からの要求に対してハードウェア資源の利用スケジューリングを行い、要求内容(例えば、プリンタエンジンにより紙搬送と作像動作、メモリ確保、ファイル生成など)を直接実施している。
【0032】
SCS122のプロセスは、アプリ管理、操作部制御、システム画面表示、LED表示、リソース管理、割り込みアプリ制御などを行う。
【0033】
ECS124のプロセスは、白黒レーザプリンタ(B&W LP)101、カラーレーザプリンタ(Color LP)102、HDD103、スキャナ、ファクシミリなどからなるハードウェアリソース104のエンジンの制御を行う。
【0034】
MCS125のプロセスは、画像メモリの取得および解放、ハードディスク装置(HDD)の利用、画像データの圧縮および伸張などを行う。
【0035】
FCS127のプロセスは、システムコントローラの各アプリ層からPSTN/ISDN網を利用したファクシミリ送受信、BKM(バックアップSRAM)で管理されている各種ファクシミリデータの登録/引用、ファクシミリ読みとり、ファクシミリ受信印刷、融合送受信を行うためのAPIを提供する。
【0036】
NCS128のプロセスは、ネットワークI/Oを必要とするアプリケーションに対して共通に利用できるサービスを提供するためのプロセスであり、ネットワーク側から各プロトコルによって受信したデータを各アプリケーションに振り分けたり、アプリケーションからデータをネットワーク側に送信する際の仲介を行う。
【0037】
OCS126のプロセスは、オペレータ(ユーザ)と本体制御間の情報伝達手段となるオペレーションパネル(操作パネル)の制御を行う。OCS126は、オペレーションパネルからキー押下(またはタッチ操作)をキーイベントとして取得し、取得したキーに対応したキーイベント関数をSCS122に送信するOCSプロセスである。また、オペレーションパネルの操作表示部に対する各種画面を描画出力やその他オペレーションパネルに対する制御は、OCS関数ライブラリに登録されている描画関数等の各種関数をアプリケーション130またはコントロールサービスから呼び出すことにより行われる。このOCS関数ライブラリは、アプリケーション130およびコントロールサービスの各モジュールに動的にリンクされている。なお、OCS126のすべてをプロセスとして動作させるように構成しても良く、あるいはOCS126のすべてをOCS関数ライブラリとして構成しても良い。
【0038】
アプリケーション130は、ページ記述言語(PDL)、PCLおよびポストスクリプト(PS)を有するプリンタ用のアプリケーションであるプリンタアプリ111と、コピー用アプリケーションであるコピーアプリ112と、ファクシミリ用アプリケーションであるファックスアプリ113と、スキャナ用アプリケーションであるスキャナアプリ114と、ネットワークファイル用アプリケーションであるネットファイルアプリ115と、工程検査用アプリケーションである工程検査アプリ116と、サードベンダなどの第三者が開発した外部アプリ117とを有している。外部アプリ117は、状態遷移モデルに従った開発手法により生成されており、状態遷移モデル起動関数が登録されたユーティリティライブラリをリンクしている。
【0039】
アプリケーション130の各プロセス、コントロールサービスの各プロセスは、関数呼び出しとその戻り値送信およびメッセージの送受信によってプロセス間通信を行いながら、コピー、プリンタ、スキャナ、ファクシミリなどの画像形成処理にかかるユーザサービスを実現している。
【0040】
このように、実施の形態1にかかる複合機100には、複数のアプリケーション130および複数のコントロールサービスが存在し、いずれもプロセスとして動作している。そして、これらの各プロセス内部には、一または複数のスレッドが生成されて、スレッド単位の並列実行が行われる。そして、コントロールサービスがアプリケーション130に対し共通サービスを提供しており、このため、これらの多数のプロセスが並列動作、およびスレッドの並列動作を行って互いにプロセス間通信を行って協調動作をしながら、コピー、プリンタ、スキャナ、ファクシミリなどの画像形成処理にかかるユーザサービスを提供するようになっている。
【0041】
また、複合機100には、複合機100の顧客、サードベンダなどの第三者がコントロールサービス層の上のアプリケーション層に外部アプリを開発して搭載することが可能となっている。
【0042】
なお、実施の形態1にかかる複合機100では、複数のアプリケーション130のプロセスと複数のコントロールサービスのプロセスとが動作しているが、アプリケーション130とコントロールサービスのプロセスがそれぞれ単一の構成とすることも可能である。また、各アプリケーション130は、アプリケーションごとに追加または削除することができる。
【0043】
図2に複合機100のハードウェア構成例を示す。
【0044】
複合機100は、コントローラ160と、オペレーションパネル175と、ファックスコントロールユニット(FCU)176と、プリンタ等の画像形成処理に特有のハードウェア資源であるエンジン部177とを含む。コントローラ160は、CPU161と、システムメモリ162と、ノースブリッジ(NB)163と、サウスブリッジ(SB)164と、ASIC166と、ローカルメモリ167と、HDD168と、ネットワークインターフェースカード(NIC)169と、SDカード用スロット170と、USBデバイス171と、IEEE1394デバイス172と、セントロニクス173とを含む。なお、メモリ162、167はRAM、ROM等を含む。FCU176およびエンジン部177は、コントローラ160のASIC166にPCIバス178で接続されている。
【0045】
CPU161が、複合機100にインストールされるアプリケーション、コントロールサービス等のプログラムを、メモリから読み出して実行する。
【0046】
次に、外部アプリ117が実行されている場合のプロセス内部の構造について説明する。図3は、外部アプリ117のプロセス内部の構造を示す説明図である。
【0047】
外部アプリ117のプロセスは、複数のスレッドが並列実行されたマルチスレッド環境となっている。図3に示すように、外部アプリ117のプロセスには、メインスレッド210とイメージライブラリスレッド200が並列実行されている。メインスレッド210は、外部アプリ117の主要な処理を実行するスレッドであり、このメインスレッド210がイメージライブラリスレッド200を呼び出すことにより、コントロールサービス140やVAS(仮想アプリケーションサービス)などの関数呼び出しとその戻り値の受信、メッセージの送受信を実現している。
【0048】
また、外部アプリ117のプロセスには、サブスレッド220、メールボックス211,212,214、イベント取得ハンドラ(スレッド)213が存在している。メインスレッド210には、状態遷移モデル起動関数が登録されたユーティリティライブラリ215が実装されている。
【0049】
メールボックス211は、メインスレッド210とイメージライブラリスレッド200およびイベント取得ハンドラ213との通信に使用される。メールボックス212は、メインスレッド210とイメージライブラリスレッド200の通信に使用される。イベント取得ハンドラ213は、ECS124,MCS125などのコントロールサービスまたはVASのプロセスからのイベントメッセージを受信し、メールボックス211に書き込むものである。
【0050】
メインスレッド210がコントロールサービスなどにアクセスするためには、メインスレッド310がメールボックス211,212,214を開設した後、イメージライブラリスレッドを起動する。
【0051】
メインスレッド310は、イメージライブラリスレッド200に対する関数呼び出しのコマンドを、送信元情報がMB_REQUESTとしてメールボックス211に入れる。また、コントロールサービス140などからのイベントメッセージも、送信元情報MB_CSのメールとしてメールボックス211に入る。
【0052】
イメージライブラリスレッド200は、メールボックス211に配信されるメールをrcv_msg()関数によって取得する。イメージライブラリスレッド200は、取得したメールに含まれる送信元情報とイベントまたは関数情報から、対応する関数の検索を行い、対応する関数が検索された場合にその関数を実行する。一方、対応する関数が検索されなかった場合には何も処理は行わない。
【0053】
取得したメールは対応する関数の実行に関係なく、メールボックス212に転送される。また、イメージライブラリスレッド200は、メインスレッドに対して、エラー情報、実行結果、途中経過などの通知を送信元情報MB_IMAGEのメールとして、メールボックス212に入れる。また、メインスレッド210は、サブスレッド220とメールボックス214,212を利用して同様にメッセージの送受信を行う。
【0054】
また、ユーティリティライブラリ215およびイメージライブラリは、複合機のアプリケーション開発のためのソフトウェア開発キット(SDK:Software Development Kit)などの開発用ツールキットの一部または全部として、CD−ROMまたはFDなどの記憶媒体にインストール可能な形式のファイルで提供される。また、ユーティリティライブラリ215およびイメージライブラリを、Webサイトからのダウンロード等、ネットワーク経由で取得可能な方法で提供するようにしても良い。
【0055】
このように提供された上記ユーティリティライブラリ215およびイメージライブラリを用いて外部アプリ117(複合機100の出荷後に第三者によって開発されて搭載されるアプリ)を生成するには、外部アプリのソースファイルをコンパイラによってコンパイルしてオブジェクトファイルを生成する。そして、リンカによって、生成されたオブジェクトファイルと、上記の方法で提供されたユーティリティライブラリ215およびイメージライブラリとをリンクして、外部アプリの実行形式ファイルを生成する。この外部アプリの実行形式ファイルをフラッシュカードなどに格納して、複合機100において、フラッシュカードから外部アプリをインストールすることにより、ユーティリティライブラリ215およびイメージライブラリを実装した外部アプリが複合機に搭載される。また、外部アプリをネットワークを介して外部のサーバからインストールすることもできる。
【0056】
次に、外部アプリ117が採用している状態遷移モデルについて説明する。図4は、外部アプリ117が状態1と状態2を有する場合の状態遷移の説明図である。図4に示すように、外部アプリ117のメインスレッド210が、状態1および状態2を有し、現在の状態が状態1であると仮定する。このメインスレッド210が状態1にある状態で外部からrcv_msg()関数によってイベント1を受信した場合、イベント関数1を実行して状態2に遷移し、入場関数2を実行する。メインスレッド210がこの状態2にあるときにイベント2を受信すると、イベント関数2を実行して状態1に戻り、入場関数1を実行する。一方、メインスレッド210が状態2にあるときにイベント3を受信すると、イベント関数3を実行し、状態2を維持する。
【0057】
ここで、状態とは、イベントを待機する状態をいい、イベントとは、状態遷移のトリガとなる事象である。また、入場関数とは、状態遷移の際に実行される関数であり、イベント関数とは、発生したイベントに対して実行される関数である。
【0058】
このような状態遷移モデルを利用してイベント処理を行う外部アプリ117を作成する際に、発生する全てのイベントを単一のモジュール、すなわち同じレベルの状態群で対応しようとすると、状態数の増大、一つの状態で処理するイベント数の増大が発生し、プログラムが複雑になり作業効率の低下、メンテナンス効率の低下という問題が生じる。
【0059】
このため、本実施の形態では、外部アプリ117の全体で発生するイベント群から相互関係のあるイベントのみを処理する状態遷移モデルのモジュール(サブモジュール)を個別に作成している。そして、全体を制御する状態遷移モデルのモジュールからは、必要に応じて上記サブモジュールを関数呼び出しの形式で実行する。呼び出しを受けたサブモジュールは、必要に応じてさらに状態遷移モデルのサブモジュールの関数呼び出しを行う。
【0060】
各モジュールは、外部アプリ117の全体で使用できるグローバル変数を使用せずに、起動時に共用するメモリを動的に確保することによって、同じモジュールが再帰的に呼び出されても正確に実行することが保証される。
【0061】
図5は、ネスト構造を有する状態遷移モデルのモジュールからなる外部アプリ117の一例を示す説明図である。図5に示す例では、3つのネスト構造を有しており、イベント関数sub1()によってネスト1のモジュールが呼び出され、イベント関数sub2()によってネスト2のモジュールが呼び出されている。
【0062】
次に、外部アプリ117のソースコードの具体的な記述について説明する。状態遷移モデルのモジュールで実行する入場関数、イベント関数において関数間で共用した変数がある場合、関数型の制約上、その変数を関数の引数として渡すことができない。また、このような変数をグローバル変数として定義すると、ネスト構造のモジュールやマルチスレッドの場合、予期せぬ変数の内容の変更が行われる可能性が高く、外部アプリ117の障害原因となる。
【0063】
本実施の形態の外部アプリ117では、単一の状態遷移モデルのモジュールおよびネストしているモジュールで変数を共用可能としている。図6は、外部アプリ117のソースコードの定義部の一例を示す説明図である。
【0064】
図6に示すように、外部アプリ117のソースコードでは、同一ファイルに記述された入場関数、イベント関数でグローバル変数のように扱う変数を集めて、共用変数として一つの構造体(demoCommonParm_t)を定義する。また、この共用変数に簡易にアクセスするためにCOMMON_STRUCTを定義している。
【0065】
また、図6の例では、外部アプリ117は、2つの状態DEMO_ST_IDLE,DEMO_ST_RUNを有し、各状態のイベント関数テーブルeventDemoIdle,eventDemoRunが定義されている。また、demoStTbl[]は、この状態遷移モデルのモジュールで使用する各状態の入場関数、イベント関数テーブルを定義した状態の順に記述している。また、THREAD_NOによってスレッド番号を指定することにより、このスレッド番号のスレッド内で有効な共用変数を使用することが可能となる。
【0066】
図7は、外部アプリ117のソースコードの関数定義部の一例を示す説明図である。execDemoFunc関数は、状態遷移モデルを起動する処理を行う。具体的には、共用変数の領域確保、設定の後、状態遷移モデル起動関数StMachine()関数呼び出しを行う。図7の例では、スレッド番号THREAD_NOのスレッドで、demoStTbleの状態情報テーブルに従い、状態番号DEMO_ST_IDLEから起動し、pComが示す領域を共用変数として使用することを指示して、状態遷移モデル起動関数StMachine()を呼び出している。図7では、さらに図6で記述したイベント関数、入場関数の処理を記述する。
【0067】
次に、状態遷移モデル起動関数StMachine()の処理について説明する。図8は、状態遷移モデル起動関数StMachine()の処理手順を示すフローチャートである。
【0068】
状態遷移モデル起動関数StMachine()では、メッセージ受信を行うと、まず共用変数の領域割り当てを行う(ステップS701)。図9は、共用変数の領域割り当ての状態を示す説明図である。図9に示すように、本実施の形態ではスタックポインタspの値がそのままネスト番号に相当するようになっており、各ネストのモジュールごと、すなわち各ネストのモジュールで状態遷移モデル起動関数StMachine()が実行されるたびに、共用変数群へのポインタがスタック領域に積まれるようになっている。従って、共用変数が下位モジュールで不用意に変更されることがなく、図9に示すように同じ変数名の共用変数を正確な値に維持しつつグローバル変数のように使用することができる。
【0069】
次に、状態遷移モデル起動関数StMachine()は、現在の状態のイベント関数テーブルを参照してその内容をチェックする(ステップS702)。そして、イベント関数テーブルに受信メッセージが定義されているか否かを判断する(ステップS703)。そして、受信メッセージが定義されている場合には、受信メッセージに対応するイベント関数を実行し(ステップS704)、さらに入場関数を実行する(ステップS705)。一方、イベント関数テーブルに受信メッセージが定義されていない場合には、イベント関数の実行は行わない。そして、このような処理をイベント関数テーブルの末尾に到達するまで繰り返し行う(ステップS706)。このようにして状態遷移モデルに基づいて作成された外部アプリ117の実行が行われる。
【0070】
このように実施の形態1の複合機では、外部アプリ117が、複数のネスト構造のモジュールを含む外部アプリ117に実装され、各モジュールで共有する共用変数をモジュールごとに別個の領域に割り当てる状態遷移モデル起動関数が登録されたユーティリティライブラリを215を有しているので、外部アプリ117を構成するモジュール間で共用変数を安全に使用することができ、変数の値に起因する障害を回避でき、複合機100に外部アプリ117を搭載可能としながらも複合機100の安定性を維持することができる。
【0071】
(実施の形態2)
実施の形態1の複合機100は、外部アプリ117が状態遷移モデルに基づいて作成されているため、状態に依存したイベント関数を実行するのみであったが、この実施の形態2の複合機100では、外部アプリ117が、さらに状態に依存しない標準処理を行うものである。なお、実施の形態2の複合機100および外部アプリ117のプロセス内部の構造は、実施の形態1と同様である。
【0072】
実施の形態2の複合機100では、ユーティリティライブラリの状態遷移モデル起動関数StMachine()が、標準処理を行うように構成されている。
【0073】
図10は、状態遷移モデル起動関数StMachine()の処理手順を示すフローチャートである。共用変数の割り当てから入場関数の実行までの処理(ステップS901〜S906)は、実施の形態1の状態遷移モデル起動関数StMachine()と同様である。
【0074】
本実施の形態の状態遷移モデル起動関数StMachine()では、さらに標準関数テーブルを参照し、その内容をチェックする(ステップS907)。ここで、標準関数とは、イベントを受信したときに現在の状態とは無関係、非依存に実行される処理の関数である。例えば、電源OFFのイベントに対する処理、アプリケーションのオーナ権限の問い合わせイベントに対し、オーナ権限の有無を通知する処理などがあげられる。なお、標準関数テーブルは、メッセージ(イベント)に対して実行される標準関数を定めたものであり、イベント関数テーブルと同様の構造を有している。
【0075】
そして、標準関数テーブルに受信メッセージが定義されているか否かを判断する(ステップS908)。そして、受信メッセージが定義されている場合には、受信メッセージに対応する標準関数を実行する(ステップS909)。一方、標準関数テーブルに受信メッセージが定義されていない場合には、標準関数の実行は行わない。そして、このような処理を標準関数テーブルの末尾に到達するまで繰り返し行う(ステップS910)。このようにして状態遷移モデルに基づいて作成された外部アプリ117において、現在の状態に無関係に非同期にくるイベントに対する標準処理の実行が行われる。
【0076】
このように実施の形態2の複合機100では、状態遷移モデル起動関数は、現在の状態とは無関係に発生する非同期イベントを受信したときに行う処理を定めた標準関数を実行しているので、現在の状態とは無関係に生じる電源OFFなどのシステム関連のイベントなどに他のアプリに悪影響を与えずに対処することができ、複合機100の安定性を向上させることができる。
【0077】
【発明の効果】
以上説明したように、本発明によれば、プログラムを構成するモジュール間で共用変数を安全に使用することができ、変数の値に起因する障害を回避でき、情報処理装置に新規アプリケーションを搭載可能としながらも情報処理装置の安定性を維持することができるという効果を奏する。
【図面の簡単な説明】
【図1】実施の形態1にかかる複合機の機能的構成を示すブロック図である。
【図2】複合機のハードウェア構成を示す図である。
【図3】外部アプリのプロセス内部の構造を示す説明図である。
【図4】外部アプリが状態1と状態2を有する場合の状態遷移の説明図である。
【図5】ネスト構造を有する状態遷移モデルのモジュールからなる外部アプリの一例を示す説明図である。
【図6】外部アプリのソースコードの定義部の一例を示す説明図である。
【図7】外部アプリのソースコードの関数定義部の一例を示す説明図である。
【図8】状態遷移モデル起動関数StMachine()の処理手順を示すフローチャートである。
【図9】共用変数の領域割り当ての状態を示す説明図である。
【図10】実施の形態2における状態遷移モデル起動関数StMachine()の処理手順を示すフローチャートである。
【符号の説明】
100 複合機
101 白黒レーザプリンタ
102 カラーレーザプリンタ
103 HDD
104 ハードウェアリソース
110 ソフトウェア群
111 プリンタアプリ
112 コピーアプリ
113 ファックスアプリ
114 スキャナアプリ
115 ネットファイルアプリ
116 工程検査アプリ
117 外部アプリ
120 プラットホーム
121 汎用OS
122 SCS
123 SRM
124 ECS
125 MCS
126 OCS
127 FCS
128 NCS
130 アプリケーション
140 コントロールサービス
200 イメージライブラリスレッド
210 メインスレッド
211,212,214 メールボックス
213 イベント取得ハンドラ
215 ユーティリティライブラリ
220 サブスレッド
[0001]
BACKGROUND OF THE INVENTION
The present invention provides an image forming apparatus including a utility library that provides a user service for image forming processing such as a copy, a printer, a scanner, and a facsimile, and that registers functions for developing an application based on a state transition model. The present invention relates to an application generation method.
[0002]
[Prior art]
In recent years, there has been known an image forming apparatus (hereinafter referred to as “multifunction machine”) in which functions of apparatuses such as a printer, a copy machine, a facsimile machine, and a scanner are housed in one casing. This multifunction device is provided with a display unit, a printing unit, an imaging unit, and the like in one casing, and three types of software (applications) respectively corresponding to a printer, a copying machine, and a facsimile machine, and switching these softwares The apparatus is operated as a printer, a copy, a scanner, or a facsimile apparatus.
[0003]
In such a conventional multifunction device, the application that runs on the multifunction device is developed at the same time by the developer of the multifunction device, and the multifunction device is shipped with the developed application burned to ROM, etc. After that, it is common not to add a new application.
[0004]
By the way, in such a conventional multi-function machine, software corresponding to a printer, a copy, a scanner, and a facsimile apparatus is provided separately, so that development of each software requires a lot of time. For this reason, the applicant has hardware resources used in image forming processing such as a display unit, a printing unit, and an imaging unit, and has an application that performs processing specific to each user service such as a printer, copy, or facsimile. When a user service is provided by interposing between these applications and hardware resources, hardware resource management, execution control, and image formation processing that are commonly required by at least two of the applications are provided. Invented an image forming apparatus (multifunction machine) including a platform including various control services (see, for example, Patent Document 1).
[0005]
[Patent Document 1]
JP 2002-82806 A
[0006]
[Problems to be solved by the invention]
Such a new multi-function peripheral has a platform that performs hardware resource management, execution control, and image formation processing that are commonly required by at least two of the applications, thereby improving the efficiency of software development. This is excellent in that the overall productivity of the apparatus can be improved.
[0007]
On the other hand, in such a new multifunction device, an application and a control service that performs processing that is difficult to develop such as access to hardware resources are provided separately. The third vendor can develop a new external application and install it in the multifunction peripheral.
[0008]
For this reason, in such a multi-function peripheral, a plurality of applications that are separately developed by a plurality of third vendors may be installed and operate simultaneously. In addition, even for one application developed by one third vendor, a plurality of modules inside the application may be freely developed in different departments and integrated and provided as one application.
[0009]
In this way, when application development is entrusted to a third vendor other than the MFP manufacturer, each third vendor will develop the application using its own method. May occur, or may adversely affect existing applications and multifunction peripheral systems that are preinstalled at the time of shipment. In particular, if a shared variable used in an application program or an event unique to the multifunction device is left to a third vendor, there is a high possibility that the system of the multifunction device becomes unstable due to a software failure. Such a problem is not only an application that operates on the image forming apparatus but also an application that operates on a general information processing apparatus.
[0010]
The present invention has been made in view of the above, and an object thereof is to obtain an information processing apparatus and an application generation method capable of easily adding an application while maintaining the stability of the system.
[0011]
[Means for Solving the Problems]
In order to achieve the above object, the invention according to claim 1 is a control function unit for transmitting an event message. An information processing apparatus comprising: the information processing apparatus, Application program By the information processing device The application part realized by executing In addition, The application program executes an event function in response to receiving an event message in a certain state, performs a process based on a state transition model for transitioning from the state to another state, and a predetermined event function from the module At least another module that performs processing based on the state transition model that is called by a call, and the application unit includes an event function table that stores event messages and event functions in association with each other, and The application unit further includes means for allocating a shared variable shared by each module to a separate memory area for each module in response to receiving an event message from the control function unit, and an event function table corresponding to the current state. Refer to Accordingly, an information processing apparatus, characterized in that it comprises a means for executing the event function corresponding to the event the received message.
The invention described in claim 2 is a standard function in which the application unit stores a standard function that is executed when an asynchronous event message generated regardless of the state is received and the asynchronous event message associated with each other. The information processing apparatus according to claim 1, further comprising a table and means for executing a standard function corresponding to the received event message by referring to the standard function table.
The invention described in claim 3 is the information processing apparatus according to claim 1 or 2, wherein the information processing apparatus is an image forming apparatus that executes an image forming process. According to a fourth aspect of the present invention, the information processing apparatus includes hardware resources used in image forming processing, and the control function unit is interposed between the application unit and the hardware resources. The information processing apparatus according to claim 3, wherein the information processing apparatus is a functional unit that performs execution control of processing using the hardware resources in response to a request from the application unit.
The invention described in claims 5 to 8 is an invention of an information processing method corresponding to the information processing apparatus, and the invention described in claims 9 to 12 is an application corresponding to an application section of the information processing apparatus. The invention according to claim 13 is an invention of a computer-readable recording medium in which the application program is recorded.
It should be noted that the present invention relates to a state that a program can take, an event that can occur to the program under the state, an event function that is executed when the event occurs under the state, and after execution of the event function Implemented in the program including a plurality of nested modules based on a state transition model whose operation is determined by the state of the transition destination of each of the modules, and assigns a shared variable shared by each module to a separate area for each module It can also be configured as an information processing apparatus including a utility library in which a state transition model activation function is registered.
[0012]
According to the present invention, a state that the program can take, an event that can occur to the program under the state, an event function that is executed when the event occurs under the state, and execution of the event function Implemented in the program including a plurality of nested modules based on a state transition model whose operation is determined by the state of the subsequent transition destination, and shared variables shared by each module in separate areas for each module Since it has a utility library in which the state transition model activation function to be assigned is registered, it is possible to safely use shared variables among modules that make up the program, avoid failures caused by variable values, and information processing devices Can maintain the stability of the information processing equipment .
[0013]
Also, the above In the information processing apparatus, the state transition model activation function of the utility library allocates the shared variable to an area specified in a stack area for each module. May be .
[0014]
According to the present invention, the state transition model start function allocates the shared variable to an area specified in the stack area for each module, so that the module can use the stack area used when the function is called. The shared variable can be allocated efficiently at the time of the call.
[0015]
Further, the state transition model start function of the utility library allocates a shared variable shared in units of threads to a separate area for each thread. May be .
[0016]
According to the present invention, the state transition model activation function can safely use the shared variable inside the thread that operates within the process of the program by allocating the shared variable shared by each thread to a separate area for each thread. And avoid failures caused by the value of the variable.
[0017]
The state transition model activation function of the utility library executes an entrance function that defines processing to be performed when the state transition occurs. May be .
[0018]
According to the present invention, the state transition model activation function executes a routinely performed process when calling a module by executing an admission function that defines a process to be performed when the state transition occurs. Can develop programs efficiently.
[0019]
Further, the state transition model start function of the utility library executes a standard function that defines processing to be performed when an asynchronous event that occurs regardless of the state is received. May be .
[0020]
According to the present invention, the state transition model activation function is a system that is generated regardless of the current state by executing a standard function that defines a process to be performed when an asynchronous event that occurs independently of the state is received. It is possible to deal with related events without adversely affecting other programs, and the stability of the image forming apparatus can be improved.
[0025]
DETAILED DESCRIPTION OF THE INVENTION
Exemplary embodiments of an information processing apparatus and an application generation method according to the present invention will be explained below in detail with reference to the accompanying drawings. Hereinafter, an image forming apparatus will be described as an example of the information processing apparatus.
(Embodiment 1)
FIG. 1 is a block diagram showing a configuration of an image forming apparatus (hereinafter referred to as “multifunction machine”) according to Embodiment 1 of the present invention.
[0026]
As shown in FIG. 1, the multi-function device 100 includes a monochrome laser printer (B & W LP) 101, a color laser printer (Color LP) 102, a hard disk device (HDD) 103, and hardware resources 104 such as a facsimile and a memory. In addition, a software group 110 including a platform 120 and an application 130 is provided.
[0027]
The platform 120 interprets a processing request from an application and generates a hardware resource acquisition request, and a system resource manager that manages one or a plurality of hardware resources and arbitrates the acquisition request from the control service. (SRM) 123 and a general-purpose OS 121.
[0028]
The control service is formed of a plurality of service modules, and includes an SCS (system control service) 122, an ECS (engine control service) 124, an MCS (memory control service) 125, an OCS (operation panel control service) 126, and an FCS. (Fax Control Service) 127 and NCS (Network Control Service) 128. The platform 120 has an application program interface (API) that enables a processing request to be received from the application 130 using a predefined function.
[0029]
The general-purpose OS 121 is a general-purpose operating system such as UNIX (registered trademark), and executes the software of the platform 120 and the application 130 in parallel as processes.
[0030]
The process of the SRM 123 performs system control and resource management together with the SCS 122. The SRM123 process uses hardware resources such as engines such as a scanner unit and printer unit, memory, HDD file, and host I / O (Centro I / F, network I / F, IEEE 1394 I / F, RS232C I / F, etc.). Arbitration is performed according to the request from the upper layer to be used, and execution control is performed.
[0031]
Specifically, the SRM 123 determines whether the requested hardware resource is available (whether it is not used by another request), and if it is available, the requested hardware resource is used. Tell the upper layer that it is possible. In addition, the SRM 123 performs use scheduling of hardware resources in response to a request from an upper layer, and directly executes request contents (for example, paper conveyance and image forming operation, memory allocation, file generation, etc. by a printer engine). .
[0032]
The process of the SCS 122 performs application management, operation unit control, system screen display, LED display, resource management, interrupt application control, and the like.
[0033]
The process of the ECS 124 controls an engine of a hardware resource 104 including a black and white laser printer (B & W LP) 101, a color laser printer (Color LP) 102, an HDD 103, a scanner, a facsimile, and the like.
[0034]
The MCS 125 process acquires and releases an image memory, uses a hard disk device (HDD), compresses and decompresses image data, and the like.
[0035]
The FCS 127 process includes facsimile transmission / reception using PSTN / ISDN network from each application layer of the system controller, registration / quotation of various facsimile data managed by BKM (backup SRAM), facsimile reading, facsimile reception printing, and fusion transmission / reception. Provides an API to do.
[0036]
The NCS 128 process is a process for providing a service that can be commonly used for applications that require network I / O. Data received from the network side according to each protocol is distributed to each application, and data from the application. Mediation when sending to the network side.
[0037]
The process of the OCS 126 controls an operation panel (operation panel) serving as information transmission means between the operator (user) and the main body control. The OCS 126 is an OCS process that acquires a key press (or touch operation) from the operation panel as a key event and transmits a key event function corresponding to the acquired key to the SCS 122. Further, various screens for the operation display unit of the operation panel are rendered and output, and other operations are controlled by calling various functions such as a drawing function registered in the OCS function library from the application 130 or the control service. This OCS function library is dynamically linked to each module of the application 130 and the control service. Note that all of the OCS 126 may be configured to operate as a process, or all of the OCS 126 may be configured as an OCS function library.
[0038]
The application 130 includes a printer application 111 that is a printer application having a page description language (PDL), PCL, and postscript (PS), a copy application 112 that is a copy application, and a fax application 113 that is a facsimile application. A scanner application 114 as a scanner application, a network file application 115 as a network file application, a process inspection application 116 as a process inspection application, and an external application 117 developed by a third party such as a third vendor. Have. The external application 117 is generated by a development method according to the state transition model, and links a utility library in which the state transition model activation function is registered.
[0039]
Each process of the application 130 and each process of the control service realize user services related to image forming processing such as copying, printers, scanners, and facsimiles while performing inter-process communication by calling functions, sending return values thereof, and sending and receiving messages. is doing.
[0040]
As described above, the MFP 100 according to the first embodiment includes a plurality of applications 130 and a plurality of control services, all of which operate as processes. In each of these processes, one or a plurality of threads are generated and parallel execution is performed in units of threads. The control service provides a common service to the application 130. For this reason, a large number of these processes perform a parallel operation and a parallel operation of threads to perform inter-process communication with each other. User services related to image forming processing such as copying, printers, scanners, and facsimiles are provided.
[0041]
Also, in the multifunction device 100, a third party such as a customer of the multifunction device 100 or a third vendor can develop and install an external application on the application layer above the control service layer.
[0042]
In the MFP 100 according to the first embodiment, a plurality of application 130 processes and a plurality of control service processes operate. However, the application 130 and the control service process have a single configuration. Is also possible. Each application 130 can be added or deleted for each application.
[0043]
FIG. 2 shows a hardware configuration example of the multifunction peripheral 100.
[0044]
The multi-function device 100 includes a controller 160, an operation panel 175, a fax control unit (FCU) 176, and an engine unit 177 that is a hardware resource unique to image forming processing such as a printer. The controller 160 includes a CPU 161, a system memory 162, a north bridge (NB) 163, a south bridge (SB) 164, an ASIC 166, a local memory 167, an HDD 168, a network interface card (NIC) 169, and an SD card. Slot 170, USB device 171, IEEE 1394 device 172, and Centronics 173. The memories 162 and 167 include RAM, ROM, and the like. The FCU 176 and the engine unit 177 are connected to the ASIC 166 of the controller 160 via the PCI bus 178.
[0045]
The CPU 161 reads programs such as applications and control services installed in the multifunction peripheral 100 from the memory and executes them.
[0046]
Next, the internal structure of the process when the external application 117 is executed will be described. FIG. 3 is an explanatory diagram showing the internal structure of the process of the external application 117.
[0047]
The process of the external application 117 is a multi-thread environment in which a plurality of threads are executed in parallel. As shown in FIG. 3, the main thread 210 and the image library thread 200 are executed in parallel in the process of the external application 117. The main thread 210 is a thread that executes main processing of the external application 117. When the main thread 210 calls the image library thread 200, function calls such as the control service 140 and VAS (virtual application service) and the return thereof are returned. Receives values and sends and receives messages.
[0048]
Further, the process of the external application 117 includes a sub thread 220, mail boxes 211, 212, 214, and an event acquisition handler (thread) 213. A utility library 215 in which a state transition model activation function is registered is installed in the main thread 210.
[0049]
The mailbox 211 is used for communication between the main thread 210, the image library thread 200, and the event acquisition handler 213. The mailbox 212 is used for communication between the main thread 210 and the image library thread 200. The event acquisition handler 213 receives an event message from a control service such as ECS 124 or MCS 125 or a VAS process, and writes it in the mailbox 211.
[0050]
In order for the main thread 210 to access the control service or the like, after the main thread 310 opens the mail boxes 211, 212, and 214, the image library thread is activated.
[0051]
The main thread 310 enters a function call command to the image library thread 200 in the mailbox 211 with the transmission source information as MB_REQUEST. An event message from the control service 140 or the like also enters the mail box 211 as a mail of the transmission source information MB_CS.
[0052]
The image library thread 200 acquires mail delivered to the mail box 211 using the rcv_msg () function. The image library thread 200 searches for the corresponding function from the transmission source information and the event or function information included in the acquired mail, and executes the function when the corresponding function is found. On the other hand, if no corresponding function is found, no processing is performed.
[0053]
The acquired mail is transferred to the mail box 212 regardless of the execution of the corresponding function. Further, the image library thread 200 puts notifications such as error information, execution results, and progress in the middle of the main thread in the mail box 212 as mail of the transmission source information MB_IMAGE. In addition, the main thread 210 transmits and receives messages in the same manner using the sub thread 220 and the mailboxes 214 and 212.
[0054]
In addition, the utility library 215 and the image library are a storage medium such as a CD-ROM or FD as a part or all of a development tool kit such as a software development kit (SDK) for developing an application of a multifunction device. Provided in a file that can be installed in Further, the utility library 215 and the image library may be provided by a method that can be acquired via a network, such as downloading from a website.
[0055]
In order to generate an external application 117 (an application developed and installed by a third party after shipment of the multifunction peripheral 100) using the utility library 215 and the image library provided in this way, a source file of the external application is generated. Compile by compiler to generate object file. Then, the object file generated by the linker is linked with the utility library 215 and the image library provided by the above-described method to generate an executable file of the external application. The external application execution format file is stored in a flash card or the like, and the multifunction device 100 installs the external application from the flash card, whereby the utility library 215 and the external application on which the image library is mounted are mounted on the multifunction device. . An external application can also be installed from an external server via a network.
[0056]
Next, the state transition model adopted by the external application 117 will be described. FIG. 4 is an explanatory diagram of state transition when the external application 117 has state 1 and state 2. As shown in FIG. 4, it is assumed that the main thread 210 of the external application 117 has a state 1 and a state 2 and the current state is the state 1. When the event 1 is received from the outside by the rcv_msg () function in a state where the main thread 210 is in the state 1, the event function 1 is executed to make a transition to the state 2, and the entrance function 2 is executed. When the main thread 210 is in this state 2 and receives the event 2, the event function 2 is executed, the state 1 is returned, and the entrance function 1 is executed. On the other hand, when the event 3 is received when the main thread 210 is in the state 2, the event function 3 is executed and the state 2 is maintained.
[0057]
Here, the state refers to a state waiting for an event, and the event is an event that triggers state transition. The admission function is a function that is executed at the time of state transition, and the event function is a function that is executed for an event that has occurred.
[0058]
When creating an external application 117 that performs event processing using such a state transition model, if all of the events that occur are handled by a single module, that is, a group of states at the same level, the number of states increases. The number of events to be processed in one state increases, and the program becomes complicated, resulting in problems such as a reduction in work efficiency and a decrease in maintenance efficiency.
[0059]
For this reason, in the present embodiment, a module (submodule) of a state transition model that processes only events having a mutual relationship from an event group that occurs in the entire external application 117 is created individually. Then, from the module of the state transition model that controls the whole, the sub-module is executed in the form of function call as necessary. The submodule that has received the call further calls a function of the submodule of the state transition model as necessary.
[0060]
Each module can execute accurately even if the same module is called recursively by dynamically allocating shared memory at startup without using global variables that can be used by the entire external application 117. Guaranteed.
[0061]
FIG. 5 is an explanatory diagram showing an example of the external application 117 including a state transition model module having a nested structure. The example shown in FIG. 5 has three nest structures, and the nest 1 module is called by the event function sub1 (), and the nest 2 module is called by the event function sub2 ().
[0062]
Next, a specific description of the source code of the external application 117 will be described. If there is a variable shared between functions in an entrance function or event function that is executed by a module of the state transition model, the variable cannot be passed as a function argument due to function type restrictions. In addition, when such a variable is defined as a global variable, in the case of a nested module or multithread, there is a high possibility that the contents of the variable will be unexpectedly changed, which causes a failure of the external application 117.
[0063]
In the external application 117 of this embodiment, a variable can be shared by a module of a single state transition model and a nested module. FIG. 6 is an explanatory diagram illustrating an example of a source code definition unit of the external application 117.
[0064]
As shown in FIG. 6, in the source code of the external application 117, variables that are handled like global variables in the entrance function and event function described in the same file are collected, and one structure (demoCommonParm_t) is defined as a shared variable. To do. Also, COMMON_STRUCT is defined to easily access this shared variable.
[0065]
In the example of FIG. 6, the external application 117 has two states DEMO_ST_IDLE and DEMO_ST_RUN, and event function tables eventDemoIdle and eventDemoRun for each state are defined. In addition, demoStTbl [] is described in the order of the states in which the entrance function of each state and the event function table used in the module of the state transition model are defined. Also, by specifying a thread number with THREAD_NO, it becomes possible to use a shared variable that is valid within the thread with this thread number.
[0066]
FIG. 7 is an explanatory diagram illustrating an example of a function definition unit of the source code of the external application 117. The execDemoFunc function performs processing for starting the state transition model. Specifically, after securing and setting the shared variable area, the state transition model activation function StMachine () function is called. In the example of FIG. 7, the thread with the thread number THREAD_NO is started from the state number DEMO_ST_IDLE according to the state information table of demoStTble, and indicates that the area indicated by pCom is used as a shared variable, and the state transition model start function StMachine ( ) Is calling. In FIG. 7, the processing of the event function and the entrance function described in FIG. 6 is further described.
[0067]
Next, processing of the state transition model activation function StMachine () will be described. FIG. 8 is a flowchart illustrating a processing procedure of the state transition model activation function StMachine ().
[0068]
In the state transition model activation function StMachine (), when a message is received, first, a shared variable area is allocated (step S701). FIG. 9 is an explanatory diagram showing the state of shared variable area allocation. As shown in FIG. 9, in the present embodiment, the value of the stack pointer sp corresponds to the nest number as it is, and the state transition model start function StMachine () for each nest module, that is, for each nest module. Each time is executed, a pointer to the shared variable group is stacked in the stack area. Therefore, the shared variable is not inadvertently changed in the lower module, and the shared variable having the same variable name can be used as a global variable while maintaining an accurate value as shown in FIG.
[0069]
Next, the state transition model activation function StMachine () refers to the event function table in the current state and checks its contents (step S702). Then, it is determined whether or not a received message is defined in the event function table (step S703). If a received message is defined, an event function corresponding to the received message is executed (step S704), and an entrance function is further executed (step S705). On the other hand, if the received message is not defined in the event function table, the event function is not executed. Such processing is repeated until the end of the event function table is reached (step S706). In this way, the external application 117 created based on the state transition model is executed.
[0070]
As described above, in the MFP according to the first embodiment, the external application 117 is mounted on the external application 117 including a plurality of nested modules, and the shared variable shared by each module is assigned to a separate area for each module. Since it has the utility library 215 in which the model activation function is registered, the shared variable can be safely used between the modules constituting the external application 117, the failure caused by the value of the variable can be avoided, and the composite While the external application 117 can be mounted on the machine 100, the stability of the multifunction machine 100 can be maintained.
[0071]
(Embodiment 2)
In the MFP 100 of the first embodiment, since the external application 117 is created based on the state transition model, only the event function depending on the state is executed. Then, the external application 117 performs standard processing that does not depend on the state. Note that the internal structures of the processes of the MFP 100 and the external application 117 of the second embodiment are the same as those of the first embodiment.
[0072]
In the MFP 100 of the second embodiment, the state transition model activation function StMachine () of the utility library is configured to perform standard processing.
[0073]
FIG. 10 is a flowchart illustrating a processing procedure of the state transition model activation function StMachine (). The processing from the allocation of the shared variable to the execution of the admission function (steps S901 to S906) is the same as the state transition model activation function StMachine () of the first embodiment.
[0074]
In the state transition model activation function StMachine () of the present embodiment, the standard function table is further referred to and the content is checked (step S907). Here, the standard function is a function of processing executed independently of the current state when an event is received. For example, there are a process for a power-off event, a process for notifying the owner authority of an application, and a process for notifying the owner authority. The standard function table defines standard functions to be executed for messages (events) and has the same structure as the event function table.
[0075]
Then, it is determined whether or not a received message is defined in the standard function table (step S908). If a received message is defined, a standard function corresponding to the received message is executed (step S909). On the other hand, when the received message is not defined in the standard function table, the standard function is not executed. Such processing is repeated until the end of the standard function table is reached (step S910). In the external application 117 created based on the state transition model in this way, standard processing is executed for an event that comes asynchronously regardless of the current state.
[0076]
As described above, in the MFP 100 according to the second embodiment, the state transition model activation function executes a standard function that defines processing to be performed when an asynchronous event that occurs regardless of the current state is received. A system-related event such as power OFF that occurs regardless of the current state can be dealt with without adversely affecting other applications, and the stability of the MFP 100 can be improved.
[0077]
【The invention's effect】
As described above, according to the present invention, a shared variable can be safely used between modules constituting a program, a failure caused by the value of the variable can be avoided, and a new application can be installed in the information processing apparatus. However, there is an effect that the stability of the information processing apparatus can be maintained.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a functional configuration of a multifunction peripheral according to a first embodiment.
FIG. 2 is a diagram illustrating a hardware configuration of a multifunction machine.
FIG. 3 is an explanatory diagram showing an internal structure of a process of an external application.
FIG. 4 is an explanatory diagram of state transition when an external application has state 1 and state 2;
FIG. 5 is an explanatory diagram illustrating an example of an external application including a state transition model module having a nested structure;
FIG. 6 is an explanatory diagram illustrating an example of a definition part of a source code of an external application.
FIG. 7 is an explanatory diagram illustrating an example of a function definition unit of a source code of an external application.
FIG. 8 is a flowchart showing a processing procedure of a state transition model activation function StMachine ().
FIG. 9 is an explanatory diagram illustrating a state of shared variable area allocation;
FIG. 10 is a flowchart showing a processing procedure of a state transition model activation function StMachine () according to the second embodiment.
[Explanation of symbols]
100 MFP
101 Black and white laser printer
102 color laser printer
103 HDD
104 Hardware resources
110 Software group
111 Printer app
112 Copy application
113 Fax application
114 Scanner app
115 Net file application
116 Process inspection application
117 External application
120 platform
121 General-purpose OS
122 SCS
123 SRM
124 ECS
125 MCS
126 OCS
127 FCS
128 NCS
130 applications
140 Control Service
200 Image library thread
210 Main thread
211, 212, 214 Mailbox
213 Event acquisition handler
215 Utility Library
220 sub-threads

Claims (13)

イベントメッセージを送信する制御機能部を備えた情報処理装置であって、前記情報処理装置は、アプリケーションプログラムが当該情報処理装置により実行されることにより実現されるアプリケーション部を更に備え、
前記アプリケーションプログラムは、ある状態においてイベントメッセージを受信したことに応じてイベント関数を実行し、前記状態から別の状態に遷移する状態遷移モデルに基づく処理を行うモジュールと、当該モジュールから所定のイベント関数呼び出しにより呼び出される、前記状態遷移モデルに基づく処理を行う別のモジュールとを少なくとも有し、
前記アプリケーション部は、イベントメッセージとイベント関数とを対応付けて格納するイベント関数テーブルを状態ごとに備え、
前記アプリケーション部は更に、
前記制御機能部からのイベントメッセージの受信に応じて、各モジュールで共用する共用変数を、前記モジュールごとに別個のメモリ領域に割り当てる手段と、
現在の状態に対応するイベント関数テーブルを参照することにより、前記受信したイベントメッセージに対応するイベント関数を実行する手段と
を備えることを特徴とする情報処理装置。
An information processing apparatus including a control function unit that transmits an event message , wherein the information processing apparatus further includes an application unit realized by an application program being executed by the information processing apparatus ,
The application program executes an event function in response to receiving an event message in a certain state, performs a process based on a state transition model for transitioning from the state to another state, and a predetermined event function from the module And at least another module that performs processing based on the state transition model that is called by a call,
The application unit is provided with an event function table storing event messages and event functions in association with each state,
The application part further includes
Means for allocating a shared variable shared by each module to a separate memory area for each module in response to receiving an event message from the control function unit;
An information processing apparatus comprising: means for executing an event function corresponding to the received event message by referring to an event function table corresponding to a current state.
前記アプリケーション部は、
前記状態とは無関係に発生する非同期イベントメッセージを受信したときに実行する標準関数と、当該非同期イベントメッセージとを対応付けて格納した標準関数テーブルと、
前記標準関数テーブルを参照することにより、前記受信したイベントメッセージに対応する標準関数を実行する手段と
を更に備えた請求項1に記載の情報処理装置。
The application part is
A standard function table that stores an asynchronous event message in association with a standard function that is executed when an asynchronous event message that occurs regardless of the state is received;
The information processing apparatus according to claim 1, further comprising: means for executing a standard function corresponding to the received event message by referring to the standard function table.
前記情報処理装置は、画像形成処理を実行する画像形成装置である請求項1又は2に記載の情報処理装置。  The information processing apparatus according to claim 1, wherein the information processing apparatus is an image forming apparatus that executes an image forming process. 前記情報処理装置は、画像形成処理で使用されるハードウェア資源を備え、
前記制御機能部は、前記アプリケーション部と前記ハードウェア資源との間に介在し、前記アプリケーション部からの要求に応じて前記ハードウェア資源を用いた処理の実行制御を行う機能部である請求項3に記載の情報処理装置。
The information processing apparatus includes hardware resources used in image forming processing,
The control function unit is a function unit that is interposed between the application unit and the hardware resource, and performs execution control of processing using the hardware resource in response to a request from the application unit. The information processing apparatus described in 1.
イベントメッセージを送信する制御機能部を備えた情報処理装置が実行する情報処理方法であって、前記情報処理装置は、アプリケーションプログラムが当該情報処理装置により実行されることにより実現されるアプリケーション部を更に備え、
前記アプリケーションプログラムは、ある状態においてイベントメッセージを受信したことに応じてイベント関数を実行し、前記状態から別の状態に遷移する状態遷移モデルに基づく処理を行うモジュールと、当該モジュールから所定のイベント関数呼び出しにより呼び出される、前記状態遷移モデルに基づく処理を行う別のモジュールとを少なくとも有し、
前記アプリケーション部は、イベントメッセージとイベント関数とを対応付けて格納するイベント関数テーブルを状態ごとに備え、前記情報処理方法は、
前記アプリケーション部が、前記制御機能部からのイベントメッセージの受信に応じて、各モジュールで共用する共用変数を、前記モジュールごとに別個のメモリ領域に割り当てるステップと、
前記アプリケーション部が、現在の状態に対応するイベント関数テーブルを参照することにより、前記受信したイベントメッセージに対応するイベント関数を実行するステップと
を備えることを特徴とする情報処理方法。
An information processing method executed by an information processing apparatus including a control function unit that transmits an event message , wherein the information processing apparatus further includes an application unit realized by an application program being executed by the information processing apparatus. Prepared,
The application program executes an event function in response to receiving an event message in a certain state, performs a process based on a state transition model for transitioning from the state to another state, and a predetermined event function from the module And at least another module that performs processing based on the state transition model that is called by a call,
The application unit includes an event function table that stores event messages and event functions in association with each state, and the information processing method includes:
The application unit assigns a shared variable shared by each module to a separate memory area for each module in response to receiving an event message from the control function unit;
The information processing method comprising: a step of executing an event function corresponding to the received event message by referring to an event function table corresponding to a current state.
前記アプリケーション部は、前記状態とは無関係に発生する非同期イベントメッセージを受信したとき実行する標準関数と、当該非同期イベントメッセージとを対応付けて格納した標準関数テーブルを更に備え、前記情報処理方法は、
前記アプリケーション部が、前記標準関数テーブルを参照することにより、前記受信したイベントメッセージに対応する標準関数を実行するステップを更に備えた請求項5に記載の情報処理方法。
The application unit further includes a standard function table that stores an asynchronous event message that is associated with a standard function that is executed when an asynchronous event message that occurs regardless of the state is received, and the information processing method includes:
The information processing method according to claim 5, further comprising the step of executing a standard function corresponding to the received event message by the application unit referring to the standard function table.
前記情報処理装置は、画像形成処理を実行する画像形成装置である請求項5又は6に記載の情報処理方法。  The information processing method according to claim 5, wherein the information processing apparatus is an image forming apparatus that executes an image forming process. 前記情報処理装置は、画像形成処理で使用されるハードウェア資源を備え、
前記制御機能部は、前記アプリケーション部と前記ハードウェア資源との間に介在し、前記アプリケーション部からの要求に応じて前記ハードウェア資源を用いた処理の実行制御を行う機能部である請求項7に記載の情報処理方法。
The information processing apparatus includes hardware resources used in image forming processing,
The control function unit is a function unit that is interposed between the application unit and the hardware resource, and controls execution of processing using the hardware resource in response to a request from the application unit. Information processing method described in 1.
イベントメッセージを送信する制御機能部を備えた情報処理装置を、アプリケーション部として機能させるアプリケーションプログラムであって、
前記アプリケーションプログラムは、ある状態においてイベントメッセージを受信したことに応じてイベント関数を実行し、前記状態から別の状態に遷移する状態遷移モデルに基づく処理を行うモジュールと、当該モジュールから所定のイベント関数呼び出しにより呼び出される、前記状態遷移モデルに基づく処理を行う別のモジュールとを少なくとも有し、
前記アプリケーション部は、イベントメッセージとイベント関数とを対応付けて格納するイベント関数テーブルを状態ごとに備え、
前記アプリケーション部は更に、
前記制御機能部からのイベントメッセージの受信に応じて、各モジュールで共用する共用変数を、前記モジュールごとに別個のメモリ領域に割り当てる手段と、
現在の状態に対応するイベント関数テーブルを参照することにより、前記受信したイベントメッセージに対応するイベント関数を実行する手段と
を備えることを特徴とするアプリケーションプログラム。
An application program that causes an information processing apparatus including a control function unit that transmits an event message to function as an application unit,
The application program executes an event function in response to receiving an event message in a certain state, performs a process based on a state transition model for transitioning from the state to another state, and a predetermined event function from the module And at least another module that performs processing based on the state transition model that is called by a call,
The application unit is provided with an event function table storing event messages and event functions in association with each state,
The application part further includes
Means for allocating a shared variable shared by each module to a separate memory area for each module in response to receiving an event message from the control function unit;
An application program comprising: means for executing an event function corresponding to the received event message by referring to an event function table corresponding to a current state.
前記アプリケーション部は、
前記状態とは無関係に発生する非同期イベントメッセージを受信したとき実行する標準関数と、当該非同期イベントメッセージとを対応付けて格納した標準関数テーブルと、
前記標準関数テーブルを参照することにより、前記受信したイベントメッセージに対応する標準関数を実行する手段と
を更に備えた請求項9に記載のアプリケーションプログラム。
The application part is
A standard function table that stores an asynchronous event message in association with a standard function that is executed when an asynchronous event message that occurs regardless of the state is received;
The application program according to claim 9, further comprising means for executing a standard function corresponding to the received event message by referring to the standard function table.
前記情報処理装置は、画像形成処理を実行する画像形成装置である請求項9又は10に記載のアプリケーションプログラム。  The application program according to claim 9 or 10, wherein the information processing apparatus is an image forming apparatus that executes an image forming process. 前記情報処理装置は、画像形成処理で使用されるハードウェア資源を備え、
前記制御機能部は、前記アプリケーション部と前記ハードウェア資源との間に介在し、前記アプリケーション部からの要求に応じて前記ハードウェア資源を用いた処理の実行制御を行う機能部である請求項11に記載のアプリケーションプログラム。
The information processing apparatus includes hardware resources used in image forming processing,
The control function unit is a function unit that is interposed between the application unit and the hardware resource, and performs execution control of processing using the hardware resource in response to a request from the application unit. Application program described in.
請求項9ないし12のうちいずれか1項に記載のアプリケーションプログラムを記録したコンピュータ読み取り可能な記録媒体。  A computer-readable recording medium in which the application program according to any one of claims 9 to 12 is recorded.
JP2003199950A 2002-07-26 2003-07-22 Information processing apparatus, information processing method, program, and recording medium Expired - Fee Related JP4246560B2 (en)

Priority Applications (5)

Application Number Priority Date Filing Date Title
JP2003199950A JP4246560B2 (en) 2002-09-24 2003-07-22 Information processing apparatus, information processing method, program, and recording medium
US10/626,608 US7554685B2 (en) 2002-07-26 2003-07-25 Image forming apparatus, information processing apparatus, program execution method and program producing method
EP03254672A EP1385089A3 (en) 2002-07-26 2003-07-25 Image forming apparatus, information processing apparatus, program execution method and program producing method
CN 200510113871 CN1818871B (en) 2002-07-26 2003-07-28 Information processing device
CNB03160255XA CN1273888C (en) 2002-07-26 2003-07-28 Imaging device, information processing device, program executive method and program generating method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2002276532 2002-09-24
JP2003199950A JP4246560B2 (en) 2002-09-24 2003-07-22 Information processing apparatus, information processing method, program, and recording medium

Publications (2)

Publication Number Publication Date
JP2004164582A JP2004164582A (en) 2004-06-10
JP4246560B2 true JP4246560B2 (en) 2009-04-02

Family

ID=32827711

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003199950A Expired - Fee Related JP4246560B2 (en) 2002-07-26 2003-07-22 Information processing apparatus, information processing method, program, and recording medium

Country Status (1)

Country Link
JP (1) JP4246560B2 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8438567B2 (en) 2007-11-07 2013-05-07 Ricoh Company, Ltd. Information processing device and image processing apparatus
JP2009134695A (en) * 2007-11-07 2009-06-18 Ricoh Co Ltd Information processor, image processor, application execution method and application execution program
JP5161643B2 (en) * 2008-04-23 2013-03-13 富士重工業株式会社 Safe driving support system
JP2008301484A (en) * 2008-05-19 2008-12-11 Canon Inc Structure of syndication data
US8539456B2 (en) * 2009-06-30 2013-09-17 Intel Corporation Automatic conversion of MPI source code programs into MPI thread-based programs
JP4653243B2 (en) * 2010-03-19 2011-03-16 キヤノン株式会社 Image processing apparatus and control method and program thereof

Also Published As

Publication number Publication date
JP2004164582A (en) 2004-06-10

Similar Documents

Publication Publication Date Title
US8305591B2 (en) Image forming apparatus and methods used in the image forming apparatus
JP3679349B2 (en) Image forming apparatus, image forming method, image forming program, and application program
JP4365148B2 (en) Image forming apparatus, wrapping processing method, and program
JP4344203B2 (en) Image forming apparatus and information display method
JP2016149805A (en) Image forming apparatus, image forming method, and program
JP4373742B2 (en) Image forming apparatus and application activation restriction method
JP4394740B2 (en) Image forming apparatus, method, and program
JP4246560B2 (en) Information processing apparatus, information processing method, program, and recording medium
JP4128506B2 (en) Image forming apparatus and application information acquisition method
JP4314178B2 (en) Image forming apparatus, service function division rule method, and service function division rule program
JP4676977B2 (en) Image forming apparatus, application information acquisition method, and program
JP2004127253A (en) Information processing apparatus and version check method
JP5036770B2 (en) Apparatus, wrapping processing method, and program
JP2005287042A (en) Apparatus, method and program for image formation
JP4677054B2 (en) Image forming apparatus, program, recording medium, and method
JP3977039B2 (en) Communication program generating method for image information processing apparatus and communication program generating apparatus for image information processing apparatus
JP2003330735A (en) Image forming apparatus and shared memory mediating method
JP4500326B2 (en) Inter-process communication program and image information processing apparatus
JP2004129220A (en) Image forming apparatus and version check method
JP2005229270A (en) Image forming device and method of interface
JP2004005504A (en) Image forming device having web service function
JP2004110751A (en) Image forming apparatus and application generation method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20051101

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080201

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080603

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080804

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080909

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20081110

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20090108

R150 Certificate of patent or registration of utility model

Ref document number: 4246560

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120116

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120116

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130116

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140116

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees