JP2014041480A - Data processor and program - Google Patents

Data processor and program Download PDF

Info

Publication number
JP2014041480A
JP2014041480A JP2012183503A JP2012183503A JP2014041480A JP 2014041480 A JP2014041480 A JP 2014041480A JP 2012183503 A JP2012183503 A JP 2012183503A JP 2012183503 A JP2012183503 A JP 2012183503A JP 2014041480 A JP2014041480 A JP 2014041480A
Authority
JP
Japan
Prior art keywords
thread
processing
data processing
processing unit
event
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
JP2012183503A
Other languages
Japanese (ja)
Other versions
JP6205689B2 (en
Inventor
Takashi Ishiguro
高詩 石黒
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.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry 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 Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP2012183503A priority Critical patent/JP6205689B2/en
Publication of JP2014041480A publication Critical patent/JP2014041480A/en
Application granted granted Critical
Publication of JP6205689B2 publication Critical patent/JP6205689B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To efficiently control a processing timing about a thread to perform the processing of media data.SOLUTION: A data processor for processing media data comprises media data processing means for performing the processing of the media data by using a thread in accordance with the control of application processing means. The thread comprises: data processing means to be periodically started for performing processing related to media data; and timer means for counting a time by using a counter in which a counter value is added each time the data processing means is started. The data processing means performs time measurement related to the processing to be performed by the data processing means by using the timer means in accordance with the control of the application processing means.

Description

本発明は、データ処理装置及びプログラムに関し、例えば、メディアデータをスレッド単位で処理するミドルウェアに適用し得る。   The present invention relates to a data processing apparatus and program, and can be applied to, for example, middleware that processes media data in units of threads.

SIP端末に係るメディアデータ(例えば、音声や映像等のデータ)のデータ処理を行うサーバは、リアルタイムなメディア通信を行うためのライブラリ(データ処理プログラム)を備えるミドルウェアを用いて構築される場合がある。   A server that performs data processing of media data (for example, data such as voice and video) related to a SIP terminal may be constructed using middleware including a library (data processing program) for performing real-time media communication. .

例えば、IVR(Interactive Voice Response)装置や、電話会議サーバ等のメディアサーバ機能を用いて動作するサーバを新たに開発する場合、どの製品でも、メディアデータのデータ処理(例えば、符号化方式の変換処理)や、メディアデータの中継処理の基本的な動作自体は共通する処理が多い。そのため、メディアデータのデータ処理については、メディアデータを処理するライブラリを備えたミドルウェアを用いて開発を行うことで、開発期間の短縮、開発コストの低減、開発製品の高品質化等のメリットが得られる。   For example, when newly developing a server that operates using an IVR (Interactive Voice Response) device or a media server function such as a conference call server, data processing of media data (for example, encoding conversion processing) ) And the basic operation of media data relay processing itself is common. Therefore, for media data processing, development using middleware equipped with a library for processing media data provides benefits such as shortening the development period, reducing development costs, and improving the quality of the developed product. It is done.

ところで、IVR等の電話音声のデータ処理を行うサーバでは、多数の呼について同時に処理する必要があるため、それぞれの呼にスレッドを割り当てて処理を行う構成が一般的である。スレッド単位で、電話音声のデータ処理を行う従来技術としては、例えば、特許文献1〜3の記載技術がある。   By the way, in a server that performs data processing of telephone voice data such as IVR, since it is necessary to process a large number of calls at the same time, a configuration in which a thread is assigned to each call and processing is generally performed. As conventional techniques for performing telephone voice data processing in units of threads, for example, there are techniques described in Patent Documents 1 to 3.

特許文献1では、呼ごとに生成される親スレッド内で生成される子スレッドの効率的な処理を容易に実現するために、子スレッド間で調整して処理を行い、親スレッドでの複雑な排他制御を行わないようにしている。   In Patent Document 1, in order to easily realize efficient processing of a child thread generated in a parent thread generated for each call, processing is performed by adjusting between child threads, and complicated processing in the parent thread is performed. Exclusive control is not performed.

特許文献2では、シングルCPUを用いたコンピュータにおいて、TSS(タイム・シェアリング・システム)を利用したマルチタスク環境を実現するOS上で、音声データの処理を効率的に行うことについて記載されている。特許文献2では、TSSが各タスクに割り当てるクォンタム(処理単位時間)に依存せず、1つのクォンタムに複数のタスクのデータ処理を混在させることにより、TSSの仕様(クォンタム)に依存せず、効率的な音声データ処理を行うことができる。   Japanese Patent Application Laid-Open No. 2004-228688 describes that a computer using a single CPU efficiently processes audio data on an OS that implements a multitasking environment using a TSS (Time Sharing System). . In Patent Document 2, the TSS does not depend on the quantum (processing unit time) assigned to each task, and by mixing the data processing of a plurality of tasks in one quantum, it does not depend on the TSS specification (quantum) and is efficient. Voice data processing can be performed.

特許文献3では、複数のスレッドが動作するプロセス内で、各スレッドが予め確保した所定の領域外のメモリ利用を行った場合でもプロセスの強制終了を回避することについて記載されている。特許文献3では、所定の領域外のメモリ利用を行うスレッドが発生した場合には、プロセス全体に影響がないと判断した場合のみ当該スレッドのみを削除している。   Japanese Patent Application Laid-Open No. 2004-228688 describes that the process is forcibly terminated even when a memory outside a predetermined area reserved in advance by each thread is used in a process in which a plurality of threads operate. In Patent Document 3, when a thread that uses a memory outside a predetermined area is generated, only the thread is deleted only when it is determined that there is no influence on the entire process.

特開2003−150391号公報JP 2003-150391 A 特開2006−185303号公報JP 2006-185303 A 特開2005−284630号公報JP 2005-284630 A

ところで、メディアデータを処理するミドルウェアを利用したサーバでは、当該ミドルウェアと、当該ミドルウェアを利用して動作するアプリケーションとの間で、処理タイミングは同期していることが望ましい。例えば、IVR等のサーバで、音声ファイルの再生タイミングを制御する場合には、アプリケーション側での処理待ち時間(実時間)と、ミドルウェア側のスレッドで処理した処理量(例えば、パケット数)が同期していることが望ましい。したがって、このような場合、従来のメディアサーバでは、ミドルウェア側の処理量に応じてアプリケーション側の待ち時間を補正する必要がある。このような問題を解決する方法としては、例えば、ミドルウェア内で動作する多数のスレッドとアプリケーションとで、共通の時計を用いて同期させることが考えられるが、その場合、ミドルウェアの利便性(アプリケーション開発の効率)や汎用性を低下させたり(アプリケーションの仕様を制限させる)、ミドルウェアの処理量の増大につながる。   By the way, in a server using middleware that processes media data, it is desirable that processing timing is synchronized between the middleware and an application that operates using the middleware. For example, when the playback timing of an audio file is controlled by a server such as IVR, the processing waiting time (actual time) on the application side and the processing amount (for example, the number of packets) processed by the thread on the middleware side are synchronized. It is desirable that Therefore, in such a case, in the conventional media server, it is necessary to correct the waiting time on the application side according to the processing amount on the middleware side. As a method for solving such a problem, for example, it is conceivable to synchronize a large number of threads and applications operating in the middleware using a common clock. In this case, the convenience of middleware (application development) Efficiency) and versatility (restricting application specifications), and increasing the amount of middleware processing.

また、特許文献1〜3の記載技術を、メディアサーバのミドルウェアに適用した場合でも、アプリケーションとミドルウェア内の多数のスレッドとの処理タイミングについて、効率的に同期させる構成については記載されていない。   Further, even when the techniques described in Patent Documents 1 to 3 are applied to the middleware of the media server, there is no description about a configuration for efficiently synchronizing the processing timings of the application and a large number of threads in the middleware.

そのため、メディアデータの処理を行うスレッドについて、処理タイミングを効率的に制御することができるデータ処理装置及びプログラムが望まれている。   Therefore, there is a demand for a data processing apparatus and program that can efficiently control the processing timing of threads that process media data.

第1の本発明のデータ処理装置は、(1)アプリケーション処理手段の制御に応じて、スレッドを用いたメディアデータの処理を行うメディアデータ処理手段を備え、(2)上記スレッドは、(2−1)周期的に起動して、メディアデータに係る処理を行うデータ処理手段と、(2−2)上記データ処理手段が起動する度にカウンタ値が加算されるカウンタを用いて時間の計時を行うタイマ手段とを備え、(2−3)上記データ処理手段は、上記アプリケーション処理手段の制御に応じて、当該データ処理手段が行う処理に係る時間計測を、上記タイマ手段を用いて行うことを特徴とする。   The data processing apparatus of the first aspect of the present invention comprises (1) media data processing means for processing media data using a thread in accordance with control of the application processing means, and (2) the thread is (2- 1) Time measurement is performed using a data processing unit that periodically starts and performs processing related to media data, and (2-2) a counter to which a counter value is added each time the data processing unit starts. (2-3) The data processing means performs time measurement related to processing performed by the data processing means using the timer means in accordance with control of the application processing means. And

第2の本発明のデータ処理プログラムは、コンピュータを、(1)アプリケーション処理手段の制御に応じて、スレッドを用いたメディアデータの処理を行うメディアデータ処理手段として機能させ、(2)上記スレッドは、(2−1)周期的に起動して、メディアデータに係る処理を行うデータ処理手段と、(2−2)上記データ処理手段が起動する度にカウンタ値が加算されるカウンタを用いて時間の計時を行うタイマ手段とを備え、(2−3)上記データ処理手段は、上記アプリケーション処理手段の制御に応じて、当該データ処理手段が行う処理に係る時間計測を、上記タイマ手段を用いて行うことを特徴とする。   The data processing program of the second aspect of the present invention causes a computer to function as (1) media data processing means for processing media data using threads in accordance with control of application processing means, and (2) the threads are (2-1) Data processing means that is periodically activated to perform processing relating to media data, and (2-2) Time using a counter to which a counter value is added each time the data processing means is activated. (2-3) The data processing means uses the timer means to measure the time associated with the processing performed by the data processing means in accordance with the control of the application processing means. It is characterized by performing.

本発明によれば、メディアデータの処理を行うスレッドについて、処理タイミングを効率的に制御することができる。   According to the present invention, it is possible to efficiently control the processing timing of a thread that processes media data.

実施形態に係るデータ処理装置の機能的構成について示したブロック図である。It is the block diagram shown about the functional structure of the data processor which concerns on embodiment. 実施形態に係る音声ファイルの再生スケジュールの例(その1)について示したタイミングチャートである。It is the timing chart shown about the example (the 1) of the reproduction | regeneration schedule of the audio | voice file which concerns on embodiment. 実施形態に係る音声ファイルの再生スケジュールの例(その2)について示したタイミングチャートである。It is the timing chart shown about the example (the 2) of the reproduction | regeneration schedule of the audio | voice file which concerns on embodiment. 実施形態に係るデータ処理装置の動作について示したシーケンス図(その1)である。It is the sequence diagram (the 1) shown about operation | movement of the data processor which concerns on embodiment. 実施形態に係るデータ処理装置の動作について示したシーケンス図(その2)である。It is the sequence diagram (the 2) shown about operation | movement of the data processor which concerns on embodiment. 実施形態に係るデータ処理装置の動作について示したシーケンス図(その3)である。It is the sequence diagram (the 3) shown about operation | movement of the data processor which concerns on embodiment.

(A)主たる実施形態
以下、本発明によるデータ処理装置及びプログラムの一実施形態を、図面を参照しながら詳述する。
(A) Main Embodiment Hereinafter, an embodiment of a data processing apparatus and a program according to the present invention will be described in detail with reference to the drawings.

(A−1)実施形態の構成
図1は、この実施形態のデータ処理装置1及び周辺装置との接続構成を示すブロック図である。
(A-1) Configuration of Embodiment FIG. 1 is a block diagram showing a connection configuration between the data processing device 1 and peripheral devices of this embodiment.

データ処理装置1は、ネットワーク6に接続する端末2(2−1、2−2)に対して、メディアデータ処理サービスを提供するメディアサーバである。この実施形態では、例として、データ処理装置1は、IVRとして機能するサーバ(メディアサーバ)であるものとして説明するが、データ処理装置1が提供するメディアデータ処理サービスの内容や、提供先については限定されないものである。   The data processing apparatus 1 is a media server that provides a media data processing service to the terminals 2 (2-1, 2-2) connected to the network 6. In this embodiment, as an example, the data processing apparatus 1 is described as a server (media server) that functions as an IVR. However, the contents of the media data processing service provided by the data processing apparatus 1 and the destinations of the services It is not limited.

図1に示すように、データ処理装置1は、例えば既存のPCやワークステーション等のハードウェア10上に汎用OS20を搭載したプラットフォーム上に構築されているものとする。汎用OS20は、例えば、Linux(登録商標)やWindows(登録商標)等の汎用的なOSを適用することができる。   As shown in FIG. 1, it is assumed that the data processing apparatus 1 is constructed on a platform in which a general-purpose OS 20 is mounted on hardware 10 such as an existing PC or workstation. As the general-purpose OS 20, for example, a general-purpose OS such as Linux (registered trademark) or Windows (registered trademark) can be applied.

そして、汎用OS20上には、シグナリング処理を行うシグナリング処理部50と、スレッド31を用いてメディアデータ処理を行うメディアデータ処理部30とが搭載されている。さらに、データ処理装置1には、メディアデータ処理部30及びシグナリング処理部50を利用したメディアデータ処理サービスを提供するアプリケーション40が搭載されている。   On the general-purpose OS 20, a signaling processing unit 50 that performs signaling processing and a media data processing unit 30 that performs media data processing using the thread 31 are mounted. In addition, the data processing apparatus 1 includes an application 40 that provides a media data processing service using the media data processing unit 30 and the signaling processing unit 50.

すなわち、アプリケーション40は、メディアデータ処理部30及びシグナリング処理部50を利用して、端末2(2−1、2−2)に対してIVRのサービスを提供するアプリケーションとして機能する。   That is, the application 40 functions as an application that provides the IVR service to the terminals 2 (2-1, 2-2) using the media data processing unit 30 and the signaling processing unit 50.

メディアデータ処理部30は、アプリケーション40の制御に応じて、ネットワーク6上の通信装置(端末2等)に対するメディアデータサービスを提供するミドルウェアである。メディアデータ処理部30は、アプリケーション40から1つの呼(セッション)について、メディアデータサービスが要求されると、当該呼に対するスレッド31を生成する。そして、メディアデータ処理部30には、スレッド31が実行するメディアデータ処理のライブラリ(処理プログラムの集合体)が備えられており、スレッド31はそれらのライブラリを利用して、アプリケーション40の制御に応じたメディアデータ処理を実行する。図1では、メディアデータ処理部30には、N個のスレッド31(31−1〜31−N)が生成された状態について示している。なお、メディアデータ処理部30で、同時に生成されるスレッド31の数は限定されないものである。   The media data processing unit 30 is middleware that provides a media data service to communication devices (such as the terminal 2) on the network 6 in accordance with the control of the application 40. When a media data service is requested for one call (session) from the application 40, the media data processing unit 30 generates a thread 31 for the call. The media data processing unit 30 is provided with a library of media data processing (collection of processing programs) executed by the thread 31, and the thread 31 uses these libraries to respond to the control of the application 40. Execute media data processing. FIG. 1 shows a state in which N threads 31 (31-1 to 31-N) are generated in the media data processing unit 30. Note that the number of threads 31 generated simultaneously in the media data processing unit 30 is not limited.

なお、メディアデータ処理部30は、プロセッサやメモリ等を有するコンピュータ(ハードウェア10)に、実施形態のデータ処理プログラムを実行させることにより実現することができる。   The media data processing unit 30 can be realized by causing a computer (hardware 10) having a processor, a memory, and the like to execute the data processing program of the embodiment.

API処理部32は、API(Application Program Interface)により、アプリケーション40からの制御指示を受付ける(機能呼出を受付ける)ためのインタフェースである。アプリケーション40は、API処理部32の仕様(APIの仕様)に基づいた制御指示を供給することにより、メディアデータ処理部30を利用したメディアデータ処理を実行することができる。APIの機能は、例えば、セッション開始/停止、音声ファイル再生開始/停止などがある。   The API processing unit 32 is an interface for accepting a control instruction from the application 40 (accepting a function call) by an API (Application Program Interface). The application 40 can execute media data processing using the media data processing unit 30 by supplying a control instruction based on the specification of the API processing unit 32 (API specification). API functions include, for example, session start / stop, audio file playback start / stop, and the like.

メディアデータ処理部30では、アプリケーション40からAPI処理部32にセッション開始が指示された場合に、当該セッションに対応するスレッド31が生成される。そして、アプリケーション40では、各セッションのIDと、各セッションに対応するスレッド31のIDが紐づけて管理されることになる。   In the media data processing unit 30, when a session start is instructed from the application 40 to the API processing unit 32, a thread 31 corresponding to the session is generated. In the application 40, the ID of each session and the ID of the thread 31 corresponding to each session are managed in association with each other.

そして、アプリケーション40から、いずれかのスレッド31に対する制御指示があった場合には、API処理部32は、その制御指示に対応するスレッド31(例えば、スレッドのID等により特定する)に、当該制御指示を伝達する。   When there is a control instruction for any one of the threads 31 from the application 40, the API processing unit 32 assigns the control to the thread 31 (for example, identified by the thread ID or the like) corresponding to the control instruction. Communicate instructions.

また、この実施形態では、API処理部32と各スレッド31との間は、直接通信する構成ではなく、共有メモリ36を媒体として情報伝達する構成となっている。これは、すべてのスレッド31が常に起動しているわけではないため、API処理部32と各スレッド31との間で、効率的に情報伝達するための構成である。したがって、アプリケーション40からの制御指示をいずれかのスレッド31に伝達する場合、API処理部32は、共有メモリ36にスレッドのIDを付した情報(指示内容を記述した情報)を共有メモリ36に格納する。そして、各スレッド31は、起動する度に共有メモリ36を確認して、自己への指示の情報が格納されていれば、その情報を取得して処理を行う。   In this embodiment, the API processing unit 32 and each thread 31 are not configured to communicate directly, but are configured to transmit information using the shared memory 36 as a medium. This is a configuration for efficiently transmitting information between the API processing unit 32 and each thread 31 because all threads 31 are not always activated. Therefore, when the control instruction from the application 40 is transmitted to any one of the threads 31, the API processing unit 32 stores in the shared memory 36 information (information describing the instruction content) with the thread ID attached to the shared memory 36. To do. Each thread 31 checks the shared memory 36 every time it is activated, and if information on an instruction to itself is stored, acquires that information and performs processing.

イベントキュー33は、各スレッド31で発生したイベント(例えば、セッション開始等)を一旦保持して、アプリケーション40に報告する処理を行うキューである。   The event queue 33 is a queue that temporarily holds an event (for example, session start or the like) that has occurred in each thread 31 and reports it to the application 40.

イベントキュー35は、スレッド31で所定時間を計時する処理(以下、「タイマ処理」と呼ぶ)によるタイムアウト(タイマ満了)に伴って発生するイベント(以下、「タイムアウトイベント」と呼ぶ)を一旦保持して、コールバックスレッド34に供給する処理を行うキューである。コールバックスレッド34は、スレッド31からのタイムアウトイベントの供給を受けると、アプリケーション40のコールバック処理部41に、当該スレッド31に対応するコールバック処理を実行させるものである。コールバック処理とは、スレッド31で、タイムアウトイベントが発生した場合に、アプリケーション40から当該スレッド31に対して実行されるべき次のステップの処理(例えば、音声ファイルの再生停止の制御指示等)について、メディアデータ処理部30側(コールバックスレッド34)から実行を促す処理である。   The event queue 35 temporarily holds an event (hereinafter referred to as a “timeout event”) that occurs due to a timeout (timer expiration) due to a process (hereinafter referred to as “timer processing”) for measuring a predetermined time by the thread 31. This is a queue for performing processing to be supplied to the callback thread 34. When the callback thread 34 is supplied with a timeout event from the thread 31, the callback thread 34 causes the callback processing unit 41 of the application 40 to execute a callback process corresponding to the thread 31. Callback processing refers to processing of the next step to be executed from the application 40 to the thread 31 when a timeout event occurs in the thread 31 (for example, a control instruction for stopping playback of an audio file). The media data processing unit 30 (callback thread 34) prompts execution.

そして、コールバックスレッド34は、タイムアウトイベントが供給されると、アプリケーション40のコールバック処理部41に、当該タイムアウトイベントに対応するコールバック処理(当該タイムアウトイベントの発行元のスレッド31に対する制御指示の処理)を実行させる。例えば、アプリケーション40では、スレッド31に対してタイマ処理を実行させる際に、当該タイマ処理に対応するコールバック処理を定義した情報をコールバック処理部41に設定しておくものとする。そして、コールバック処理部41は、当該スレッド31で、当該タイマ処理に対応するタイムアウトイベントが発行されると、予め設定されたコールバック処理(当該スレッド31に対する制御指示)をアプリケーション40本体に実行させるものとする。   Then, when a timeout event is supplied, the callback thread 34 notifies the callback processing unit 41 of the application 40 of a callback process corresponding to the timeout event (processing of a control instruction to the thread 31 that issued the timeout event). ) Is executed. For example, when the application 40 causes the thread 31 to execute a timer process, information defining a callback process corresponding to the timer process is set in the callback processing unit 41. When the thread 31 issues a timeout event corresponding to the timer process, the callback processing unit 41 causes the application 40 main body to execute a preset callback process (control instruction for the thread 31). Shall.

このように、データ処理装置1では、スレッド31からアプリケーション40へのタイマイベントに伴うコールバック処理専用の伝達経路(コールバックスレッド34及びイベントキュー35)が設定されているものとする。   As described above, in the data processing device 1, it is assumed that a transmission path (callback thread 34 and event queue 35) dedicated to callback processing accompanying a timer event from the thread 31 to the application 40 is set.

この実施形態では、API処理部32と、スレッド31とは、共有リソース(メモリや変数等)ヘのアクセスが生じるため、排他制御により、同時に動作することが出来ない構成となっているものとする。そのため、データ処理装置1では、API処理部32とスレッド31との処理が競合してデッドロックしないように、スレッド31とは別にコールバックスレッド34を追加している。   In this embodiment, it is assumed that the API processing unit 32 and the thread 31 are configured to be unable to operate simultaneously by exclusive control because access to a shared resource (memory, variable, etc.) occurs. . For this reason, in the data processing device 1, a callback thread 34 is added separately from the thread 31 so that processing between the API processing unit 32 and the thread 31 competes to prevent deadlock.

この実施形態では、メディアデータ処理部30において、各スレッド31は、定期的に起動(以下、「周期起動」と呼ぶ)して処理を行うものとする。この実施形態では、例として、スレッド31は、メディアデータ処理に係る呼(セッション)が起動すると、20ms周期で周期起動し、周期起動したときに、メディアデータ処理として、メディアデータの処理などを実行する。   In this embodiment, in the media data processing unit 30, each thread 31 is periodically activated (hereinafter referred to as “periodic activation”) to perform processing. In this embodiment, as an example, when a call (session) related to media data processing is activated, the thread 31 is periodically activated at a cycle of 20 ms, and when the cycle is activated, media data processing or the like is executed as media data processing. To do.

ここでは、各スレッド31は、周期起動した場合、その周期起動のインターバル分のメディアデータの処理を実行するものとする。例えば、スレッド31が音声データファイルから、音声データの符号化及びRTP(Real−time Transport Protocol)パケット生成・送信処理を行う場合を想定する。この場合、スレッド31は、周期起動する度に、20ms分の音声データについて符号化及びRTPパケットの生成・送信処理を行うことになる。   Here, when each thread 31 is periodically activated, it is assumed that the processing of media data for the period activation interval is executed. For example, it is assumed that the thread 31 performs audio data encoding and RTP (Real-time Transport Protocol) packet generation / transmission processing from an audio data file. In this case, the thread 31 performs encoding and RTP packet generation / transmission processing on the audio data for 20 ms each time the cycle is activated.

各スレッド31が処理するメディアデータの保存先は限定されないものであり、例えば、汎用サーバなどのハードディスクに保存されているものでも良いし、ネットワーク6で接続されている別サーバ上のファイルであっても良いし、メモリ上に展開されていても良い。各スレッド31は、セッション開始、セッション停止、音声ファイル再生開始、音声ファイル再生停止などの契機でイベント生成して、イベントキュー33に供給(アタッチ)する。この実施形態では、例として、各スレッド31は、アプリケーション40が保持している音声ファイルF1を取得し、音声ファイルF1の音声データを符号化(例えば、G.711などのCodecでエンコード)して、RTPパケットのペイロードに挿入し、端末2に向けて送出する処理を行うものとする。以下では、各スレッド31が音声ファイルF1からRTPパケット生成して送信する処理を「再生処理」とも呼ぶものとする。   The storage destination of the media data processed by each thread 31 is not limited. For example, it may be stored in a hard disk such as a general-purpose server, or may be a file on another server connected by the network 6. Or may be expanded on a memory. Each thread 31 generates an event in response to a session start, session stop, audio file playback start, audio file playback stop, and the like, and supplies (attaches) the event to the event queue 33. In this embodiment, as an example, each thread 31 acquires the audio file F1 held by the application 40, encodes the audio data of the audio file F1 (for example, encodes it with a Codec such as G.711), and so on. , It is assumed that a process of inserting into the payload of the RTP packet and sending it to the terminal 2 is performed. Hereinafter, a process in which each thread 31 generates and transmits an RTP packet from the audio file F1 is also referred to as a “reproduction process”.

各スレッド31は、周期起動する度にインクリメントされるカウンタを用いて時間計測を行うタイマ処理部311を有している。各スレッド31では、このタイマ処理部311に基づいたタイミングで、アプリケーション40から指示されたタイマ処理を行う。例えば、アプリケーション40から1秒間の音声ファイル再生処理(1秒間を計時するタイマ処理及び音声ファイルの再生処理)の制御指示があった場合には、50回の周期起動(20ms×50=1s)が行われたときに、1秒間分のメディアデータが処理されたものとして取り扱う。   Each thread 31 includes a timer processing unit 311 that performs time measurement using a counter that is incremented each time the cycle is activated. Each thread 31 performs a timer process instructed by the application 40 at a timing based on the timer processing unit 311. For example, when there is a control instruction from the application 40 for an audio file reproduction process for one second (a timer process for counting one second and an audio file reproduction process), 50 periodic activations (20 ms × 50 = 1 s) are performed. When performed, it is handled as one second of media data processed.

(A−2)実施形態の動作
次に、以上のような構成を有するこの実施形態のデータ処理装置1の動作を説明する。上述の通り、この実施形態では、データ処理装置1はIVRとして機能するものである。そして、ここでは、例として、データ処理装置1から、端末2−1に対して音声ファイルF1の再生処理(音声データを挿入したRTPパケットの送信処理)を行う場合について説明する。具体的には、スレッド31−1が、アプリケーション40からの制御指示(APIを用いた制御指示)に基づいて音声ファイルの再生処理を行うものとする。
(A-2) Operation | movement of embodiment Next, operation | movement of the data processor 1 of this embodiment which has the above structures is demonstrated. As described above, in this embodiment, the data processing device 1 functions as an IVR. Here, as an example, a case will be described in which the data processing device 1 performs a reproduction process of the audio file F1 (transmission processing of an RTP packet into which audio data is inserted) for the terminal 2-1. Specifically, it is assumed that the thread 31-1 performs an audio file reproduction process based on a control instruction (control instruction using an API) from the application 40.

図2では、タイミングT100からタイミングT101までの10秒間音声ファイルF1を再生した後、タイミングT101からタイミングT102までの5秒間無音状態とし、さらにタイミングT102からタイミングT103までの間音声ファイルF1を再度再生する処理を行うことについて示している。言い換えると、図2では、音声ファイルF1を再生する動作を2回行い、再生間隔(無音期間)を5秒としている。なお、音声ファイルF1の再生時間については、10secの音声ファイルを準備しておき再生完了を契機として制御するようにして良いが、この実施形態では、タイマ処理で制御するものとして説明する。   In FIG. 2, after reproducing the audio file F1 for 10 seconds from the timing T100 to the timing T101, the audio file F1 is reproduced again from the timing T102 to the timing T103. It shows about processing. In other words, in FIG. 2, the operation of reproducing the audio file F1 is performed twice, and the reproduction interval (silence period) is 5 seconds. Note that the playback time of the audio file F1 may be controlled by preparing a 10-sec audio file and completing the playback, but in this embodiment, it is described as being controlled by timer processing.

アプリケーション40内で、図2に示すような音声ファイルの再生タイミングを記述する形式(記述言語)については限定されないものであるが、例えば、MSCML(IETF RFC5022:(Media Server ControI Markup Language(MSCML)andProtocol))を利用するようにしてもよい。   The format (description language) for describing the playback timing of the audio file as shown in FIG. 2 in the application 40 is not limited. For example, MSCML (IETF RFC5022: (Media Server Control I Markup Language (MSCML) and Protocol) )) May be used.

MSCMLでは、delay、repeat、durationといったパラメータを用いて再生タイミングを記述することができる。「delay」は、ファイル再生前に指定の時間分再生を遅延させることを示すパラメータである(ただし、初回の再生前には適用されない)。また、delayの期間中は無音となる。「repeat」は、音声ファイルの再生回数を示すパラメータである。なお、「repeat」に所定のパラメータを設定することにより、無制限(∞)のリピート再生の指定も可能である。「duration」は、音声ファイルの再生する時間(位置)を示すパラメータである。セッション(呼)開始からdurationに示される時間に達したとき、自動的にセッション(呼)が切断され、音声ファイル再生も終了する。   In MSCML, playback timing can be described using parameters such as delay, repeat, and duration. “Delay” is a parameter indicating that playback is delayed by a specified time before file playback (however, it is not applied before the first playback). In addition, there is no sound during the delay period. “Repeat” is a parameter indicating the number of times an audio file is played. It is possible to specify unlimited (∞) repeat playback by setting a predetermined parameter in “repeat”. “Duration” is a parameter indicating the playback time (position) of the audio file. When the time indicated by duration is reached from the start of the session (call), the session (call) is automatically disconnected, and the audio file playback is also terminated.

したがって、図2のタイミングチャートに示されるタイミングをMSCMLのパラメータで記述すると、「音声ファイル再生時間:10sec、delay:5sec、repeat:2、duration:−(無し)」となる。   Therefore, when the timing shown in the timing chart of FIG. 2 is described by MSCML parameters, “audio file playback time: 10 sec, delay: 5 sec, repeat: 2, duration: − (none)”.

また、図3では、「音声ファイル再生時間:10sec、delay:5sec、repeat:無制限(∞)、duration:35sec」とした場合の再生タイミングについて示したタイミングチャートとなっている。   FIG. 3 is a timing chart showing the playback timing when “audio file playback time: 10 sec, delay: 5 sec, repeat: unlimited (∞), duration: 35 sec”.

この実施形態のアプリケーション40では、MSCMLにより記述された再生タイミングの制御情報に基づいて、スレッド31−1に対する制御内容(制御指示の内容や、次回のタイムアウトに伴うコールバック処理として設定する内容)の決定が行われる。   In the application 40 of this embodiment, based on the playback timing control information described in MSCML, the control content for the thread 31-1 (the content of the control instruction and the content set as the callback processing associated with the next timeout) is stored. A decision is made.

次に、上述の図3のようなタイミングで音声ファイル再生が行われた場合のデータ処理装置1内部の詳細な動作について、図4〜図6のシーケンス図を用いて説明する。   Next, the detailed operation inside the data processing apparatus 1 when the audio file is played back at the timing as shown in FIG. 3 will be described with reference to the sequence diagrams of FIGS.

図4〜図6では、スレッド31−1で20msec間隔で発生する各周期起動についてそれぞれB101〜B1351のいずれかの符号を付している。そして、図4〜図6において、各周期起動に係る破線の内部に図示されたステップの処理は、スレッド31−1において、当該周期起動で実行される処理であることを示している。   4 to 6, each of the periodic activations generated at intervals of 20 msec in the thread 31-1 is given any one of B <b> 101 to B <b> 1351. In FIGS. 4 to 6, the processing of the steps illustrated inside the broken line relating to each periodic activation indicates that the processing is executed in the periodic activation in the thread 31-1.

また、図4〜図6のフローチャートの初期状態として、アプリケーション40の制御指示(セッション開始)に基づいて、メディアデータ処理部30にスレッド31−1が生成されているものとして説明する。   Also, as an initial state of the flowcharts of FIGS. 4 to 6, description will be made assuming that the thread 31-1 is generated in the media data processing unit 30 based on the control instruction (session start) of the application 40.

そして、アプリケーション40から、API処理部32に対して、スレッド31−1に係る10secを計時するタイマ処理の起動、及び、音声ファイルF1の再生開始の制御指示があったものとする。そして、API処理部32は、その制御指示の内容を記述した制御指示を共有メモリ36に格納したものとする(S101、S102)。   Then, it is assumed that the application 40 gives a command to the API processing unit 32 to start a timer process that counts 10 seconds related to the thread 31-1 and to start reproduction of the audio file F1. Then, the API processing unit 32 stores the control instruction describing the contents of the control instruction in the shared memory 36 (S101, S102).

その後、スレッド31−1は、周期起動して周期起動B101の処理(ステップS103〜S106の処理)が実行される。   Thereafter, the thread 31-1 is periodically activated and the process of the periodic activation B101 (the processes of steps S103 to S106) is executed.

周期起動B101において、スレッド31−1は、まず、共有メモリ36の内容を確認して自己への制御指示が格納されていることを認識して、当該制御指示を取得する(S103)。   In the periodic activation B101, the thread 31-1 first confirms the content of the shared memory 36, recognizes that the control instruction to itself is stored, and acquires the control instruction (S103).

そして、スレッド31−1は、取得した制御指示の内容に基づいて、タイマ処理部311のカウンタ値を初期化(0)して起動し、10secの計時(カウンタ値が500となるまでの計時)を行うタイマ処理を開始させる(S104)。   Then, the thread 31-1 initializes (0) the counter value of the timer processing unit 311 based on the content of the acquired control instruction and starts it, and measures 10 seconds (time until the counter value reaches 500). The timer process for performing is started (S104).

そして、スレッド31−1は、取得した制御指示の内容に基づいて、音声ファイルF1の再生処理を開始する。スレッド31−1は、周期起動B101の段階では、音声ファイルF1の20msec分の音声の音声データについて再生処理を行う。また、スレッド31−1は、タイマ処理部311のカウンタ値をインクリメントする処理を行う(S105)。 そして、音声ファイルF1の再生処理を開始すると、スレッド31−1は、イベントキュー33に、再生処理を開始した旨のイベントを通知する(S106)。以上で、スレッド31−1による周期起動B101での処理が終了する。   Then, the thread 31-1 starts the reproduction process of the audio file F1 based on the content of the acquired control instruction. The thread 31-1 performs a reproduction process on the audio data of 20 msec of the audio file F1 in the stage of the periodic activation B101. Further, the thread 31-1 performs a process of incrementing the counter value of the timer processing unit 311 (S105). When the reproduction process of the audio file F1 is started, the thread 31-1 notifies the event queue 33 of an event indicating that the reproduction process has been started (S106). Thus, the process in the periodic activation B101 by the thread 31-1 is completed.

そして、再生開始処理のイベントが通知されたイベントキュー33は、そのイベントを保持して、アプリケーション40に通知する(S107)。   Then, the event queue 33 notified of the event of the reproduction start process holds the event and notifies the application 40 (S107).

そして、次の周期起動B102のタイミングを迎えると、スレッド31−1は、音声ファイルF1の次の20msec分の音声の音声データについて再生処理を行い、さらに、タイマ処理部311のカウンタ値をインクリメントする処理を行う(S108)。   Then, at the timing of the next periodic activation B102, the thread 31-1 performs reproduction processing on the audio data of the next 20 msec of the audio file F1, and further increments the counter value of the timer processing unit 311. Processing is performed (S108).

そして、スレッド31−1は、周期起動B102と同様の処理(ステップS106)の処理について繰り返し、タイマ処理部311のカウンタ値が499に達した状態で、周期起動B101から数えて500回目の周期起動B600を迎えたものとする。周期起動B600において、スレッド31−1は、後述するステップS202〜S203の処理を実行する。   Then, the thread 31-1 repeats the processing of the same processing (step S106) as the periodic activation B102, and the 500th periodic activation counted from the periodic activation B101 with the counter value of the timer processing unit 311 reaching 499. It is assumed that B600 is greeted. In the periodic activation B600, the thread 31-1 executes processing of steps S202 to S203 described later.

周期起動B600では、スレッド31−1は、音声ファイルF1の、次の20msec分の音声の音声データについて再生処理を行い、さらに、タイマ処理部311のカウンタ値をインクリメントする処理を行う(S201)。そして、この時点で、スレッド31−1において、タイマ処理部311のカウンタ値は500となり、タイマ処理部311のタイムアウトを検出することになる(S202)。そして、スレッド31−1は、タイマ処理部311のタイムアウトを検出すると、タイムアウトイベントを、イベントキュー35に供給する(S203)。以上で、スレッド31−1による周期起動B600での処理が終了する。   In the periodic activation B600, the thread 31-1 performs a reproduction process on the audio data of the next 20 msec of the audio file F1, and further performs a process of incrementing the counter value of the timer processing unit 311 (S201). At this time, in the thread 31-1, the counter value of the timer processing unit 311 becomes 500, and the timeout of the timer processing unit 311 is detected (S202). Then, when detecting a timeout of the timer processing unit 311, the thread 31-1 supplies a timeout event to the event queue 35 (S 203). Thus, the process in the periodic activation B600 by the thread 31-1 is completed.

そして、イベントキュー35は、供給されたタイムアウトイベントを、コールバックスレッド34に供給する(S203)。そして、コールバックスレッド34は、供給されたタイムアウトイベントに対応するコールバック処理を、アプリケーション40(コールバック処理部41)に要求する(S204)。ここでは、アプリケーション40(コールバック処理部41)には、スレッド31−1に対する次のコールバック処理として、音声ファイルの再生停止の制御、及び、5secを計時するタイマ処理の起動制御が設定されているものとする。   Then, the event queue 35 supplies the supplied timeout event to the callback thread 34 (S203). Then, the callback thread 34 requests a callback process corresponding to the supplied timeout event from the application 40 (callback processing unit 41) (S204). Here, in the application 40 (callback processing unit 41), as the next callback processing for the thread 31-1, the control for stopping the reproduction of the audio file and the start control for the timer processing for measuring 5 seconds are set. It shall be.

そして、アプリケーション40(コールバック処理部41)は、次のコールバック処理の定義に従って、API処理部32に対して、スレッド31−1に係る音声ファイルF1の再生停止、及び、5secを計時するタイマ処理の起動の制御指示を行う(S205、S207)。そして、API処理部32は、その制御指示の内容を記述した制御指示を共有メモリ36に格納する(S206、S208)。   The application 40 (callback processing unit 41) then stops the playback of the audio file F1 related to the thread 31-1, and counts 5 seconds with respect to the API processing unit 32 according to the definition of the next callback processing. A process start control instruction is issued (S205, S207). Then, the API processing unit 32 stores the control instruction describing the contents of the control instruction in the shared memory 36 (S206, S208).

その後、スレッド31−1は、周期起動して周期起動B601の処理(ステップS209〜S212の処理)を実行する。   Thereafter, the thread 31-1 is periodically activated to execute the process of the periodic activation B601 (the processes of steps S209 to S212).

周期起動B601において、スレッド31−1は、まず、共有メモリ36の内容を確認して自己への制御指示が格納されていることを認識し、当該制御指示を取得する(S209)。   In the periodic activation B601, the thread 31-1 first confirms the content of the shared memory 36, recognizes that the control instruction to itself is stored, and acquires the control instruction (S209).

そして、スレッド31−1は、取得した制御指示の内容に基づいて、音声ファイルF1の再生停止処理を行う(S210)。そして、音声ファイルF1の再生停止処理を行うと、スレッド31−1は、イベントキュー33に、再生停止処理を実行した旨のイベントを通知する(S211)。   Then, the thread 31-1 performs reproduction stop processing for the audio file F1 based on the content of the acquired control instruction (S210). When the playback stop process for the audio file F1 is performed, the thread 31-1 notifies the event queue 33 of an event indicating that the playback stop process has been executed (S211).

そして、スレッド31−1は、取得した制御指示の内容に基づいて、タイマ処理部311のカウンタ値を初期化(0)して起動し、5secの計時(カウンタ値が250となるまでの計時)を行うタイマ処理を開始させる(S212)。以上で、スレッド31−1による周期起動B601での処理が終了する。   The thread 31-1 initializes (0) the counter value of the timer processing unit 311 based on the content of the acquired control instruction and starts it up for 5 seconds (time until the counter value reaches 250). The timer process for performing is started (S212). Thus, the process in the periodic activation B601 by the thread 31-1 is completed.

そして、再生処理停止のイベントが通知されたイベントキュー33は、そのイベントを保持して、アプリケーション40に通知する(S213)。   Then, the event queue 33 notified of the reproduction process stop event holds the event and notifies the application 40 (S213).

そして、スレッド31−1は、その後周期起動を繰り返し、周期起動の度にタイマ処理部311のカウンタ値をインクリメントする。そして、スレッド31−1は、タイマ処理部311のカウンタ値が249に達した状態で、周期起動B601から数えて249回目の周期起動B850を迎えたものとする。周期起動B850において、スレッド31−1は、後述するステップS301、S302の処理を実行する。   Then, the thread 31-1 repeats cyclic activation thereafter, and increments the counter value of the timer processing unit 311 each time it is cyclically activated. Then, it is assumed that the thread 31-1 has reached the 249th periodic activation B850 counted from the periodic activation B601 in a state where the counter value of the timer processing unit 311 reaches 249. In the periodic activation B850, the thread 31-1 executes processing of steps S301 and S302 described later.

周期起動B850では、スレッド31−1は、タイマ処理部311のカウンタ値をインクリメントする処理を行う。そして、この時点で、スレッド31−1において、タイマ処理部311のカウンタ値は250となり、タイマ処理部311のタイムアウトを検出することになる(S301)。そして、スレッド31−1は、タイマ処理部311のタイムアウトを検出すると、タイムアウトイベントを、イベントキュー35に供給する(S302)。以上で、スレッド31−1による周期起動B850での処理が終了する。   In the periodic activation B850, the thread 31-1 performs a process of incrementing the counter value of the timer processing unit 311. At this time, in the thread 31-1, the counter value of the timer processing unit 311 becomes 250, and the timeout of the timer processing unit 311 is detected (S301). Then, when detecting the timeout of the timer processing unit 311, the thread 31-1 supplies a timeout event to the event queue 35 (S 302). Thus, the process in the periodic activation B850 by the thread 31-1 is completed.

なお、周期起動B601〜B850の間は、スレッド31−1は、無音の音声データの再生処理(周期起動ごとに20msec分の無音の音声データの再生処理)を行うようにしてもよい。ただし、端末2−1側で、RTPパケットが供給されない間無音の音声を出力する構成となっている場合には、上述のようなスレッド31−1からの無音の音声に係る再生処理は必要ない。   It should be noted that between the periodic activations B601 to B850, the thread 31-1 may perform silent audio data reproduction processing (reproduction processing of silent audio data for 20 msec for each periodic activation). However, when the terminal 2-1 is configured to output silent sound while the RTP packet is not supplied, the above-described reproduction processing related to the silent sound from the thread 31-1 is not necessary. .

そして、イベントキュー35は、供給されたタイムアウトイベントを、コールバックスレッド34に供給する。そして、コールバックスレッド34は、供給されたタイムアウトイベントに対応するコールバック処理を、アプリケーション40(コールバック処理部41)に要求する(S303)。ここでは、アプリケーション40(コールバック処理部41)には、スレッド31−1に対する次のコールバック処理として、音声ファイルF1の再生開始の制御、及び、10secを計時するタイマ処理の起動制御が設定されているものとする。   Then, the event queue 35 supplies the supplied timeout event to the callback thread 34. Then, the callback thread 34 requests a callback process corresponding to the supplied timeout event from the application 40 (callback processing unit 41) (S303). Here, in the application 40 (callback processing unit 41), as the next callback processing for the thread 31-1, the playback start control of the audio file F1 and the start control of the timer processing that counts 10 seconds are set. It shall be.

そして、アプリケーション40(コールバック処理部41)は、次のコールバック処理の設定に従って、API処理部32に対して、音声ファイルF1の再生開始の制御、及び、10secを計時するタイマ処理の起動制御の制御指示を行う(S304、S306)。そして、API処理部32は、その制御指示の内容を記述した制御指示を共有メモリ36に格納する(S305、S307)。   Then, the application 40 (callback processing unit 41) controls the start of reproduction of the audio file F1 and the start of the timer process that measures 10 seconds with respect to the API processing unit 32 according to the setting of the next callback processing. Is instructed (S304, S306). Then, the API processing unit 32 stores the control instruction describing the content of the control instruction in the shared memory 36 (S305, S307).

その後、スレッド31−1は、周期起動して周期起動B851の処理(ステップS308〜S310の処理)が実行される。   Thereafter, the thread 31-1 is periodically activated, and the process of periodic activation B851 (the processes of steps S308 to S310) is executed.

周期起動B851において、スレッド31−1は、まず、共有メモリ36の内容を確認して自己への制御指示が格納されていることを認識し、当該制御指示を取得する(S308)。   In the periodic activation B851, first, the thread 31-1 confirms the content of the shared memory 36, recognizes that the control instruction to itself is stored, and acquires the control instruction (S308).

そして、スレッド31−1は、取得した制御指示の内容に基づいて、タイマ処理部311のカウンタ値を初期化(0)して起動し、10secの計時(カウンタ値が500となるまでの計時)を行うタイマ処理を開始させる(S309)。   Then, the thread 31-1 initializes (0) the counter value of the timer processing unit 311 based on the content of the acquired control instruction and starts it, and measures 10 seconds (time until the counter value reaches 500). The timer process for performing is started (S309).

そして、スレッド31−1は、取得した制御指示の内容に基づいて、音声ファイルF1の再生処理を開始し、音声ファイルF1の最初の20msec分の音声の音声データについて再生処理を行う。また、スレッド31−1は、タイマ処理部311のカウンタ値をインクリメントする処理を行う(S310)。   Then, the thread 31-1 starts reproduction processing of the audio file F1 based on the content of the acquired control instruction, and performs reproduction processing on the audio data of the first 20 msec of the audio file F1. Further, the thread 31-1 performs a process of incrementing the counter value of the timer processing unit 311 (S310).

そして、音声ファイルF1の再生処理を開始すると、スレッド31−1は、イベントキュー33に、再生処理を開始した旨のイベントを通知する(S311)。以上で、スレッド31−1による周期起動B851での処理が終了する。   When the playback process of the audio file F1 is started, the thread 31-1 notifies the event queue 33 of an event indicating that the playback process has started (S311). Thus, the process in the periodic activation B851 by the thread 31-1 is completed.

そして、再生開始処理のイベントが通知されたイベントキュー33は、そのイベントを保持して、アプリケーション40に通知する(S312)。   Then, the event queue 33 notified of the reproduction start process event holds the event and notifies the application 40 (S312).

そして、スレッド31−1は、周期起動により再生処理を繰り返し、タイマ処理部311のカウンタ値が499に達した状態で、周期起動B851から数えて500回目の周期起動B1350を迎えたものとする。周期起動B1350において、スレッド31−1は、後述するステップS401〜S403の処理を実行する。   Then, it is assumed that the thread 31-1 repeats the reproduction process by periodic activation, and reaches the 500th periodic activation B1350 counted from the periodic activation B851 in a state where the counter value of the timer processing unit 311 reaches 499. In the periodic activation B1350, the thread 31-1 executes processing of steps S401 to S403 described later.

周期起動B1350では、スレッド31−1は、音声ファイルF1の、次の20msec分の音声の音声データについて再生処理を行い、さらに、タイマ処理部311のカウンタ値をインクリメントする処理を行う(S401)。そして、この時点で、スレッド31−1において、タイマ処理部311のカウンタ値は500となり、タイマ処理部311のタイムアウトを検出することになる(S402)。そして、スレッド31−1は、タイマ処理部311のタイムアウトを検出すると、タイムアウトイベントを、イベントキュー35に供給する(S403)。以上で、スレッド31−1による周期起動B1350での処理が終了する。   In periodic activation B1350, the thread 31-1 performs a reproduction process on the audio data of the next 20 msec of the audio file F1, and further performs a process of incrementing the counter value of the timer processing unit 311 (S401). At this time, in the thread 31-1, the counter value of the timer processing unit 311 becomes 500, and the timeout of the timer processing unit 311 is detected (S402). Then, when detecting a timeout of the timer processing unit 311, the thread 31-1 supplies a timeout event to the event queue 35 (S 403). Thus, the process in the periodic activation B1350 by the thread 31-1 is completed.

そして、イベントキュー35は、供給されたタイムアウトイベントを、コールバックスレッド34に供給する。そして、コールバックスレッド34は、供給されたタイムアウトイベントに対応するコールバック処理を、アプリケーション40(コールバック処理部41)に要求する(S404)。ここでは、アプリケーション40(コールバック処理部41)には、スレッド31−1に対する次のコールバック処理として、音声ファイルF1の再生停止の制御が設定されているものとする。   Then, the event queue 35 supplies the supplied timeout event to the callback thread 34. Then, the callback thread 34 requests a callback process corresponding to the supplied timeout event from the application 40 (callback processing unit 41) (S404). Here, it is assumed that control for stopping reproduction of the audio file F1 is set in the application 40 (callback processing unit 41) as the next callback processing for the thread 31-1.

そして、アプリケーション40(コールバック処理部41)は、次のコールバック処理の定義に従って、API処理部32に対して、音声ファイルF1の再生停止の制御指示を行う(S405)。そして、API処理部32は、その制御指示の内容を記述した制御指示を共有メモリ36に格納する(S406)。   Then, the application 40 (callback processing unit 41) instructs the API processing unit 32 to stop reproduction of the audio file F1 in accordance with the definition of the next callback processing (S405). Then, the API processing unit 32 stores the control instruction describing the content of the control instruction in the shared memory 36 (S406).

その後、スレッド31−1は、周期起動して周期起動B1351の処理(ステップS407〜S409の処理)が実行される。   Thereafter, the thread 31-1 is periodically activated, and the process of periodic activation B1351 (the processes of steps S407 to S409) is executed.

周期起動B1351において、スレッド31−1は、まず、共有メモリ36の内容を確認して自己への制御指示が格納されていることを認識し、当該制御指示を取得する(S407)。   In the periodic activation B1351, the thread 31-1 first confirms the contents of the shared memory 36, recognizes that the control instruction to itself is stored, and acquires the control instruction (S407).

そして、スレッド31−1は、取得した制御指示の内容に基づいて、音声ファイルF1の再生停止処理を行う(S408)。そして、音声ファイルF1の再生停止処理を行うと、スレッド31−1は、イベントキュー33に、再生停止処理を実行した旨のイベントを通知する(S409)。以上で、スレッド31−1による周期起動B601での処理が終了する。   Then, the thread 31-1 performs a reproduction stop process for the audio file F1 based on the content of the acquired control instruction (S408). When the playback stop process for the audio file F1 is performed, the thread 31-1 notifies the event queue 33 of an event indicating that the playback stop process has been executed (S409). Thus, the process in the periodic activation B601 by the thread 31-1 is completed.

そして、再生処理停止のイベントが通知されたイベントキュー33は、そのイベントを保持して、アプリケーション40に通知する(S410)。   Then, the event queue 33 notified of the reproduction process stop event holds the event and notifies the application 40 (S410).

(A−3)実施形態の効果
この実施形態によれば、以下のような効果を奏することができる。
(A-3) Effects of Embodiment According to this embodiment, the following effects can be achieved.

(A−3−1)データ処理装置1では、スレッド31の側で、タイマ処理部311のカウンタを用いたタイマ処理を実行するようにしたので、正確な再生タイミング制御が可能である。 (A-3-1) In the data processing apparatus 1, since the timer processing using the counter of the timer processing unit 311 is executed on the thread 31 side, accurate reproduction timing control is possible.

また、スレッド31のタイマ処理部311において、周期起動ごとにカウンタをインクリメントしていくだけでタイマ処理を行うことができる。すなわち、データ処理装置1では、アプリケーション40側で、タイマ処理に係る処理を実装する必要がなく、タイマ処理の追加による処理負荷増加はほとんど発生しない。   Further, the timer processing unit 311 of the thread 31 can perform the timer processing only by incrementing the counter for each period activation. That is, in the data processing apparatus 1, it is not necessary to implement processing related to timer processing on the application 40 side, and the processing load due to addition of timer processing hardly occurs.

(A−3−2)データ処理装置1では、スレッド31からアプリケーション40へのタイマイベントに伴うコールバック処理専用の伝達経路(コールバックスレッド34及びイベントキュー35)が設定されている。これにより、データ処理装置1では、シンプルな構成で迅速にタイムアウトイベントに伴うコールバック処理を実行することができる。すなわち、データ処理装置1では、効率的にタイムアウトイベントに伴うコールバック処理を実行することができる。 (A-3-2) In the data processing device 1, a transmission path (callback thread 34 and event queue 35) dedicated to callback processing associated with a timer event from the thread 31 to the application 40 is set. As a result, the data processing apparatus 1 can quickly execute a callback process associated with a timeout event with a simple configuration. That is, the data processing apparatus 1 can efficiently execute a callback process associated with a timeout event.

なお、データ処理装置1において、上述のコールバック処理専用の伝達経路を省略するようにしてもよいが、その場合、コールバック処理と同様の処理の効率が低下することになる。例えば、スレッド31から、イベントキュー33を介して、アプリケーション40にタイムアウトイベントの発生(例えば、音声ファイルの再生開始後にタイムアウトが発生した旨のイベント)を通知し、アプリケーション40側でそのイベントの内容を解析して次の処理(例えば、音声ファイル再生の停止の処理)を決定して、API処理部32経由でスレッド31に命令するようにしてもよい。しかし、この場合、アプリケーション40でのイベント解析や、判断処理が必要になるため、上述のコールバック処理に係る伝達経路の方が、少ない処理量で高速に次の処理を実行することが可能になる。   In the data processing device 1, the above-described transmission path dedicated to the callback process may be omitted, but in that case, the efficiency of the process similar to the callback process is lowered. For example, the thread 31 notifies the application 40 of the occurrence of a timeout event (for example, an event indicating that a timeout has occurred after the start of playback of the audio file) via the event queue 33, and the content of the event is indicated on the application 40 side. Analysis may be performed to determine the next process (for example, audio file playback stop process), and the thread 31 may be instructed via the API processing unit 32. However, in this case, since event analysis and determination processing in the application 40 are required, the transmission path related to the callback processing described above can execute the next processing at a high speed with a small processing amount. Become.

また、タイムアウトイベント以外のイベントについてもイベントキュー33に集中させる場合、イベントキュー33がボトルネックとなって処理が遅延する可能性がある。しかし、データ処理装置1のようにタイムアウトイベント専用の伝達経路を備えることにより、シンプルな構成で迅速にタイムアウトイベントに伴うコールバック処理を実行することができる。さらに、コールバック処理に対応する処理をメディアデータ処理部30内部だけで行う構成としてもよいが、アプリケーション40からAPIを用いてコールバックする伝達経路の方が、メディアデータ処理部30内の構成をシンプルにすることができる。   When events other than the timeout event are also concentrated in the event queue 33, the event queue 33 may become a bottleneck and processing may be delayed. However, by providing a transmission path dedicated to the timeout event as in the data processing apparatus 1, the callback process associated with the timeout event can be quickly executed with a simple configuration. Further, the processing corresponding to the callback processing may be performed only within the media data processing unit 30, but the transmission path for calling back from the application 40 using the API has a configuration within the media data processing unit 30. Can be simple.

言い換えると、データ処理装置1では、コールバックスレッド34を追加したことにより、コールバック処理部41からAPI制御を実行することができるので、アプリケーション40の実装が容易である。特に、メディアデータ処理部30をミドルウェアとして実現した場合、アプリケーション40に影響を与えずに、ミドルウェア(メディアデータ処理部30)のバージョンアップを行うことが容易となる。   In other words, in the data processing apparatus 1, the API 40 can be executed from the callback processing unit 41 by adding the callback thread 34, so that the application 40 can be easily implemented. In particular, when the media data processing unit 30 is realized as middleware, it is easy to upgrade the middleware (media data processing unit 30) without affecting the application 40.

(B)他の実施形態
本発明は、上記の実施形態に限定されるものではなく、以下に例示するような変形実施形態も挙げることができる。
(B) Other Embodiments The present invention is not limited to the above-described embodiments, and may include modified embodiments as exemplified below.

(B−1)上記の実施形態では、データ処理装置1において、音声ファイルの再生タイミングの制御を例として説明したがそれ以外のタイミング制御(例えば、動画像の再生タイミング等)に利用するようにしてもよい。 (B-1) In the above embodiment, in the data processing apparatus 1, the control of the playback timing of the audio file has been described as an example. However, it is used for other timing control (for example, the playback timing of a moving image). May be.

(B−2)上記の実施形態では、イベントキュー35は、タイムアウトイベント専用のキューとして説明したが、イベントキュー33とイベントキュー35の割り振りは異なるものであってもよい。例えば、イベントキュー33を省略した構成としてもよい。 (B-2) In the above embodiment, the event queue 35 has been described as a queue dedicated to a timeout event. However, the event queue 33 and the event queue 35 may be allocated differently. For example, the event queue 33 may be omitted.

また、上記の実施形態では、コールバックスレッド34は1つの構成として説明したが複数としてもよい。   In the above-described embodiment, the callback thread 34 is described as one configuration, but a plurality of callback threads 34 may be provided.

(B−3)上記の実施形態では、メディアデータ処理部30、アプリケーション40、及びシグナリング処理部50が同じコンピュータ上に構築された例について説明したが、それぞれ異なるコンピュータ上に構築するようにしてもよい。すなわち、データ処理装置1を構築する際の分散処理の構成は限定されないものである。 (B-3) In the above embodiment, the example in which the media data processing unit 30, the application 40, and the signaling processing unit 50 are constructed on the same computer has been described. However, the media data processing unit 30, the application 40, and the signaling processing unit 50 may be constructed on different computers. Good. That is, the configuration of the distributed processing when constructing the data processing device 1 is not limited.

1…データ処理装置、10…ハードウェア、20…汎用OS、30…メディアデータ処理部、31…スレッド、311…タイマ処理部、31、31−1〜31−N…スレッド、32…API処理部、33…イベントキュー、34…コールバックスレッド、35…イベントキュー、36…共有メモリ、40…アプリケーション、41…コールバック処理部、50…シグナリング処理部。   DESCRIPTION OF SYMBOLS 1 ... Data processing apparatus, 10 ... Hardware, 20 ... General purpose OS, 30 ... Media data processing part, 31 ... Thread, 311 ... Timer processing part, 31, 31-1 to 31-N ... Thread, 32 ... API processing part 33 ... Event queue 34 ... Callback thread 35 ... Event queue 36 ... Shared memory 40 ... Application 41 ... Callback processing unit 50 ... Signaling processing unit

Claims (4)

アプリケーション処理手段の制御に応じて、スレッドを用いたメディアデータの処理を行うメディアデータ処理手段を備え、
上記スレッドは、
周期的に起動して、メディアデータに係る処理を行うデータ処理手段と、
上記データ処理手段が起動する度にカウンタ値が加算されるカウンタを用いて時間の計時を行うタイマ手段とを備え、
上記データ処理手段は、上記アプリケーション処理手段の制御に応じて、当該データ処理手段が行う処理に係る時間計測を、上記タイマ手段を用いて行う
ことを特徴とするデータ処理装置。
Media data processing means for processing media data using threads according to the control of the application processing means,
The above thread
Data processing means that periodically starts and performs processing related to media data;
Timer means for measuring time using a counter to which a counter value is added each time the data processing means is activated,
The data processing apparatus, wherein the data processing means performs time measurement related to processing performed by the data processing means using the timer means under the control of the application processing means.
上記データ処理手段は、上記アプリケーション処理手段から、メディアデータ処理に係る処理時間の計時を指示された場合に、上記タイマ手段に当該処理時間をタイムアウト時間とする時間の計時を実行させ、上記タイマ手段でタイムアウトが発生した場合のタイムアウトイベントを出力し、
上記メディアデータ処理部は、
それぞれのスレッドで発生した、タイムアウトイベントのみを処理する第1のイベント処理部と、
それぞれのスレッドで発生したタイムアウトイベント以外のイベントを処理する第2のイベント処理部と
をさらに有する
ことを特徴とする請求項1に記載のデータ処理装置。
The data processing means, when instructed by the application processing means to measure the processing time related to media data processing, causes the timer means to execute the time measurement using the processing time as a timeout time, and the timer means Output a timeout event when a timeout occurs in
The media data processing unit
A first event processing unit that processes only a timeout event that has occurred in each thread;
The data processing apparatus according to claim 1, further comprising: a second event processing unit that processes an event other than a timeout event that has occurred in each thread.
上記メディアデータ処理手段は、上記第1のイベント処理部でタイムアウトイベントが保持されると、当該タイムアウトイベントに係るスレッドへの所定の処理を、上記アプリケーション処理手段に要求するコールバック要求処理部をさらに備えることを特徴とする請求項2に記載のデータ処理装置。   The media data processing unit further includes a callback request processing unit for requesting the application processing unit to perform predetermined processing on a thread related to the timeout event when the first event processing unit holds the timeout event. The data processing apparatus according to claim 2, further comprising: コンピュータを、
アプリケーション処理手段の制御に応じて、スレッドを用いたメディアデータの処理を行うメディアデータ処理手段として機能させ、
上記スレッドは、
周期的に起動して、メディアデータに係る処理を行うデータ処理手段と、
上記データ処理手段が起動する度にカウンタ値が加算されるカウンタを用いて時間の計時を行うタイマ手段とを備え、
上記データ処理手段は、上記アプリケーション処理手段の制御に応じて、当該データ処理手段が行う処理に係る時間計測を、上記タイマ手段を用いて行う
ことを特徴とするデータ処理プログラム。
Computer
According to the control of the application processing means, function as media data processing means for processing media data using threads,
The above thread
Data processing means that periodically starts and performs processing related to media data;
Timer means for measuring time using a counter to which a counter value is added each time the data processing means is activated,
A data processing program characterized in that the data processing means uses the timer means to perform time measurement related to processing performed by the data processing means under the control of the application processing means.
JP2012183503A 2012-08-22 2012-08-22 Data processing apparatus and program Active JP6205689B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012183503A JP6205689B2 (en) 2012-08-22 2012-08-22 Data processing apparatus and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012183503A JP6205689B2 (en) 2012-08-22 2012-08-22 Data processing apparatus and program

Publications (2)

Publication Number Publication Date
JP2014041480A true JP2014041480A (en) 2014-03-06
JP6205689B2 JP6205689B2 (en) 2017-10-04

Family

ID=50393690

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012183503A Active JP6205689B2 (en) 2012-08-22 2012-08-22 Data processing apparatus and program

Country Status (1)

Country Link
JP (1) JP6205689B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2022177955A (en) * 2021-05-19 2022-12-02 株式会社ユニバーサルエンターテインメント game machine

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH086819A (en) * 1994-06-17 1996-01-12 Hitachi Ltd Device and method for testing device driver program
JPH09319597A (en) * 1996-03-28 1997-12-12 Hitachi Ltd Scheduling method for cyclic process
JPH10333926A (en) * 1997-06-03 1998-12-18 N T T Data:Kk Program execution management method, device therefor and recording medium
JP2009230425A (en) * 2008-03-21 2009-10-08 Toyota Motor Corp Information processor
JP2011118867A (en) * 2009-12-03 2011-06-16 Korea Electronics Telecommun Remote plug-in device, engine device and system for executing robot plug-in

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH086819A (en) * 1994-06-17 1996-01-12 Hitachi Ltd Device and method for testing device driver program
JPH09319597A (en) * 1996-03-28 1997-12-12 Hitachi Ltd Scheduling method for cyclic process
JPH10333926A (en) * 1997-06-03 1998-12-18 N T T Data:Kk Program execution management method, device therefor and recording medium
JP2009230425A (en) * 2008-03-21 2009-10-08 Toyota Motor Corp Information processor
JP2011118867A (en) * 2009-12-03 2011-06-16 Korea Electronics Telecommun Remote plug-in device, engine device and system for executing robot plug-in

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2022177955A (en) * 2021-05-19 2022-12-02 株式会社ユニバーサルエンターテインメント game machine
JP7278632B2 (en) 2021-05-19 2023-05-22 株式会社ユニバーサルエンターテインメント game machine

Also Published As

Publication number Publication date
JP6205689B2 (en) 2017-10-04

Similar Documents

Publication Publication Date Title
CN110290180B (en) Distributed task scheduling method and device, computer equipment and storage medium
WO2020207264A1 (en) Network system, service provision and resource scheduling method, device, and storage medium
JP6571277B2 (en) Method and apparatus for loading terminal application
EP3607445B1 (en) System and method for timely and uniform distribution for real-time packet transmission
US7437275B2 (en) System for and method of multi-location test execution
Sojka et al. Modular software architecture for flexible reservation mechanisms on heterogeneous resources
US20070112463A1 (en) Robot server for controlling robot, system having the same for providing content, and method thereof
WO2019001074A1 (en) Remote process calling method and apparatus, and computer device
CN108255585B (en) SDK abnormal control and application program operation method, device and equipment thereof
CN105262911B (en) The processing method, system and device of system telephone in voice communication
WO2019201340A1 (en) Processor core scheduling method and apparatus, terminal, and storage medium
US7739368B2 (en) Method for interacting with user and terminal thereof
KR102331793B1 (en) Use structured audio output to detect playback and/or adapt to unaligned playback on wireless speakers
CN112068847B (en) Computing environment deployment method and device based on kubernets platform
CN111200606A (en) Deep learning model task processing method, system, server and storage medium
CN112104679B (en) Method, apparatus, device and medium for processing hypertext transfer protocol request
CN113556387A (en) Edge gateway control method, system, device, electronic equipment and storage medium
JP6205689B2 (en) Data processing apparatus and program
KR20070052641A (en) Robot server, content providing system and method comprising the same
CN109842590B (en) Processing method and device for survey task and computer readable storage medium
US11720089B2 (en) Decoupled load generation architecture
CN108228880B (en) Method, device, equipment and medium for database management system to call external function
US7925769B2 (en) Media flow converter for use in real-time delivery transactions
CN113472638A (en) Edge gateway control method, system, device, electronic equipment and storage medium
KR102230266B1 (en) Method and electronic device for sharing applications among a plurality of electronic devices

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150515

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20151119

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20151208

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160208

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160809

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20161011

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20170404

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170704

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20170712

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170821

R150 Certificate of patent or registration of utility model

Ref document number: 6205689

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150