JP4038574B2 - Data transmission / reception processing program - Google Patents

Data transmission / reception processing program Download PDF

Info

Publication number
JP4038574B2
JP4038574B2 JP2004002234A JP2004002234A JP4038574B2 JP 4038574 B2 JP4038574 B2 JP 4038574B2 JP 2004002234 A JP2004002234 A JP 2004002234A JP 2004002234 A JP2004002234 A JP 2004002234A JP 4038574 B2 JP4038574 B2 JP 4038574B2
Authority
JP
Japan
Prior art keywords
data
real
time
buffer
processing unit
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
JP2004002234A
Other languages
Japanese (ja)
Other versions
JP2005198023A (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.)
National Institute of Advanced Industrial Science and Technology AIST
Original Assignee
National Institute of Advanced Industrial Science and Technology AIST
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 National Institute of Advanced Industrial Science and Technology AIST filed Critical National Institute of Advanced Industrial Science and Technology AIST
Priority to JP2004002234A priority Critical patent/JP4038574B2/en
Publication of JP2005198023A publication Critical patent/JP2005198023A/en
Application granted granted Critical
Publication of JP4038574B2 publication Critical patent/JP4038574B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Description

本発明は、第1データ処理部と、バッファ部と、第2データ処理部とを有し、データ受信時は、第1データ処理部、バッファ部、第2データ処理部の順番にデータが流れ、データ送信時は、第1データ処理部、バッファ部、第2データ処理部の順番にデータが流れるように構成されたリアルタイム通信装置において好適に用いられるデータ送受信処理プログラムに関するものである。 The present invention includes a first data processing unit, a buffer unit, and a second data processing unit. When data is received, data flows in the order of the first data processing unit, the buffer unit, and the second data processing unit. The present invention relates to a data transmission / reception processing program suitably used in a real-time communication apparatus configured to flow data in the order of a first data processing unit, a buffer unit, and a second data processing unit during data transmission.

インターネットにおいて行われている通信方式は、コネクション型と呼ばれるものであり、通信を行う際に通信セッションを確立してからデータのやり取りを行うようにしている。このようなコネクション型の通信は、通信相手の応答を待ってから通信を行う同期型であり、非リアルタイム通信と称する。非リアルタイム通信は、通信時間の予測を行うことが難しい。   A communication method used on the Internet is called a connection type, and data is exchanged after establishing a communication session when performing communication. Such connection-type communication is a synchronous type in which communication is performed after waiting for a response from a communication partner, and is referred to as non-real-time communication. In non-real-time communication, it is difficult to predict the communication time.

一方、リアルタイム通信と呼ばれるものがあり、この通信方式では、即時に通信処理を行い、要求された制限時間内にデータ通信を完了する。   On the other hand, there is what is called real-time communication. In this communication method, communication processing is performed immediately, and data communication is completed within a requested time limit.

このように、リアルタイム通信と非リアルタイム通信とがあり、既存のネットワーク環境であるインターネットで用いられているイーサネットTMを使用してリアルタイム通信を行おうとした場合、次のような問題がある。 Thus, there is a real-time communication and non-real-time communication, if an attempt is made to real-time communication using an Ethernet TM which is used in an existing network environment Internet, has the following problems.

図6は、従来技術に係る通信装置の構成を示す概念図である。バッファ部100は、FIFOバッファ(先入れ先出しバッファ)により構成される。バッファ部100にデータが滞留していなければ、実時間データ(リアルタイム通信で処理されるデータ)は遅延なく処理されるので、要求された制限時間内にデータ通信を完了することができる。しかしながら、リアルタイム通信と非リアルタイム通信とを同じタイミングで行っている場合には、次のような問題が生じる。   FIG. 6 is a conceptual diagram illustrating a configuration of a communication apparatus according to the related art. The buffer unit 100 is configured by a FIFO buffer (first-in first-out buffer). If no data stays in the buffer unit 100, real-time data (data processed by real-time communication) is processed without delay, so that data communication can be completed within the requested time limit. However, the following problems occur when real-time communication and non-real-time communication are performed at the same timing.

まず、データ受信時における動作を図6(a)により説明する。第1データ処理部101は、実時間データ(リアルタイム通信で処理されるデータ)と非実時間データ(非リアルタイム通信で処理されるデータ)とが混在した状態で受け取っている。実時間データは「a」「b」で示され、非実時間データは「1」「2」で示されている。これらのデータは、一旦バッファ部100に入れられた後、第2データ処理部102により上位にデータが出力される。この場合、実時間データは、これよりも先行している非実時間データが存在するために、実時間データの処理が遅れてしまうことになる。   First, the operation during data reception will be described with reference to FIG. The first data processing unit 101 receives real-time data (data processed by real-time communication) and non-real-time data (data processed by non-real-time communication) in a mixed state. Real time data is indicated by “a” and “b”, and non-real time data is indicated by “1” and “2”. These data are once stored in the buffer unit 100 and then output to the upper level by the second data processing unit 102. In this case, since real-time data has non-real-time data that precedes the real-time data, processing of the real-time data is delayed.

次に、データ受信時における動作を図6(b)により説明する。実時間データは「c」「d」で示され、非実時間データは「3」「4」で示される。データの流れは、図6(a)の場合とは逆になるが、実時間データは先行する非実時間データのために、通信ラインに遅れて出力されることはデータ送信時の場合と同じである。   Next, the operation at the time of data reception will be described with reference to FIG. Real time data is indicated by “c” and “d”, and non-real time data is indicated by “3” and “4”. Although the data flow is the reverse of the case of FIG. 6 (a), the real time data is output to the communication line late because of the preceding non-real time data, as in the case of data transmission. It is.

本発明は上記実情に鑑みてなされたものであり、その課題は、非リアルタイム通信とリアルタイム通信の両方を行うことが可能な環境下で、リアルタイム通信によるデータ通信に遅れが生じないようにすることができるリアルタイム通信装置に好適に用いられるデータ送受信処理プログラムを提供することである。 The present invention has been made in view of the above circumstances, and its problem is to prevent delay in data communication by real-time communication in an environment where both non-real-time communication and real-time communication can be performed. The present invention is to provide a data transmission / reception processing program suitably used for a real-time communication apparatus capable of performing the above.

<リアルタイム通信装置>
上記課題を解決するため本発明に係るリアルタイム通信装置は、
第1データ処理部と、バッファ部と、第2データ処理部とを有し、データ受信時は、第1データ処理部、バッファ部、第2データ処理部の順番にデータが流れ、データ送信時は、第2データ処理部、バッファ部、第1データ処理部の順番にデータが流れるように構成されたリアルタイム通信装置であって、
バッファ部は、
リアルタイム通信用の実時間データを受け入れる第1バッファと、
非リアルタイム通信用の非実時間データを受け入れる第2バッファとを備え、
第1データ処理部及び第2データ処理部は、
データが実時間データであるか非実時間データであるかを検出する手段と、
検出されたデータのタイプに応じて、データを第1バッファ又は第2バッファのいずれかに振り分け処理を行う手段と、
バッファ部から受け入れたデータを送出するに際して、実時間データを非実時間データよりも優先して送出する処理を行う手段と、を備えていることを特徴とするものである。
<Real-time communication device>
In order to solve the above problems, a real-time communication device according to the present invention provides:
It has a first data processing unit, a buffer unit, and a second data processing unit. When data is received, data flows in the order of the first data processing unit, the buffer unit, and the second data processing unit. Is a real-time communication device configured such that data flows in the order of the second data processing unit, the buffer unit, and the first data processing unit,
The buffer part
A first buffer that accepts real-time data for real-time communication;
A second buffer for accepting non-real time data for non-real time communication;
The first data processor and the second data processor are
Means for detecting whether the data is real-time data or non-real-time data;
Means for distributing data to either the first buffer or the second buffer according to the type of data detected;
And means for performing processing for sending the real-time data with priority over the non-real-time data when sending the data received from the buffer unit.

この構成によるリアルタイム通信装置の作用・効果は、以下の通りである。この通信装置は、バッファ部として第1バッファと第2バッファとを備えており、第1バッファはリアルタイム通信用の実時間データを受け入れることができ、第2バッファは非リアルタイム通信用の非実時間データを受け入れることができる。そして、第1データ処理部と第2データ処理部は、データのタイプに応じて次のような処理を行う。   The operation and effect of the real-time communication apparatus with this configuration is as follows. This communication apparatus includes a first buffer and a second buffer as buffer units, the first buffer can accept real-time data for real-time communication, and the second buffer is non-real-time for non-real-time communication. Can accept data. The first data processing unit and the second data processing unit perform the following processing according to the data type.

まず、データ受信時は、第1データ処理部は、受信しようとするデータが実時間データか非実時間データかを検出する。実時間データである場合は、これを第1バッファに入れ、非実時間データである場合には、これを第2バッファに入れる。第2データ処理部は、実時間データを非実時間データに対して優先的に送出する処理を行う。これにより、実時間データの方が先に送り出される。データ送信時は、上記と逆であり、第2データ処理部は、受け入れたデータが実時間データか非実時間データかを検出し、この検出結果に基づいて、データを第1バッファ又は第2バッファに入れる。そして、第1データ処理部は、実時間データを非実時間データに対して優先的に送出する処理を行う。これにより、実時間データの方が先に送り出される。すなわち、 先行する非実時間データにより実時間データの処理が遅れることがないように、実時間データの処理を行うことができる。その結果、非リアルタイム通信とリアルタイム通信の両方を行うことが可能な環境下で、リアルタイム通信によるデータ通信に遅れが生じないようにすることができるリアルタイム通信装置を提供することができる。   First, when receiving data, the first data processing unit detects whether the data to be received is real-time data or non-real-time data. If it is real-time data, it is put in the first buffer, and if it is non-real-time data, it is put in the second buffer. The second data processing unit performs processing for preferentially sending real-time data over non-real-time data. As a result, the real-time data is sent out first. At the time of data transmission, it is the reverse of the above, and the second data processing unit detects whether the received data is real-time data or non-real-time data, and based on this detection result, the data is stored in the first buffer or the second data. Put it in the buffer. The first data processing unit performs processing for preferentially transmitting real-time data over non-real-time data. As a result, the real-time data is sent out first. That is, real-time data processing can be performed so that real-time data processing is not delayed by preceding non-real-time data. As a result, it is possible to provide a real-time communication apparatus that can prevent delay in data communication by real-time communication in an environment where both non-real-time communication and real-time communication can be performed.

本発明に係るリアルタイム通信用データのフレームに、前記データのタイプを表わすフィールドが設けられていることが好ましい。   It is preferable that a field representing the data type is provided in the frame of data for real-time communication according to the present invention.

第1データ処理部と第2データ処理部は、このデータのタイプに基づいて、実時間データか非実時間データかを検出することができる。   The first data processing unit and the second data processing unit can detect whether the data is real-time data or non-real-time data based on the type of the data.

<データ送受信処理プログラム>
本発明に係るデータ送受信処理プログラムは、本発明に係るリアルタイム通信装置に好適であって、
アプリケーションが送信システムコールでカーネルを呼び出す処理と、
呼び出されたカーネルが割込ハンドラを呼び出す処理と、
この割込ハンドラがバッファ部からフレームを取り出す処理と、
この処理後、カーネルが送信ルーチンを呼び出す処理とをコンピュータに実行させることを特徴とするものである。
<Data transmission / reception processing program>
The data transmission / reception processing program according to the present invention is suitable for the real-time communication apparatus according to the present invention,
When the application calls the kernel with a send system call,
The called kernel calls the interrupt handler,
This interrupt handler takes out the frame from the buffer part,
After this processing, the computer causes the computer to execute processing for calling a transmission routine.

従来技術に係るデータ送受信処理は、データ送信時において、アプリケーションが送信システムコールでカーネルを呼出し、カーネルがデバイスドライバの送信ルーチンを呼び出すようにしていた。そして、データをバッファに入れようとするときに、バッファがフルの状態であれば、割込ハンドラを呼び出し、バッファからデータフレームを取り出すように処理を行っていた。しかしながら、このような処理手順では、アプリケーションによる送信システムコールの呼び出しが、割込ハンドラの実行周期よりも短かった場合、アプリケーションプログラムの実行周期が長くなってしまうという問題がある。   In the data transmission / reception processing according to the prior art, at the time of data transmission, the application calls the kernel with a transmission system call, and the kernel calls the transmission routine of the device driver. Then, when trying to put data into the buffer, if the buffer is full, an interrupt handler is called to perform processing so as to take out the data frame from the buffer. However, in such a processing procedure, there is a problem that the execution cycle of the application program becomes long when the call of the transmission system call by the application is shorter than the execution cycle of the interrupt handler.

すなわち、 割込ハンドラが呼び出された場合は、割込ハンドラの実行が行われるまで、バッファにデータを入れることができない。従って、その分データの送信が遅らされることになるという問題がある。   In other words, when an interrupt handler is called, data cannot be stored in the buffer until the interrupt handler is executed. Therefore, there is a problem that data transmission is delayed accordingly.

これに対して、本発明に係るデータ送受信処理は、送信システムコールでカーネルを呼び出し、カーネルが割込ハンドラを呼び出す。そして、この割込ハンドラがバッファ部からフレームを取り出すようにしている。このフレームを取り出した後、カーネルが送信ルーチンを呼び出す。このとき、バッファ部からは既にフレームが取り出されているので、バッファ部がフルになっていることがない。従って、送信ルーチンによりデータを確実にバッファ部に入れることができる。その結果、データの送信が遅らされることはない。   On the other hand, in the data transmission / reception processing according to the present invention, the kernel is called by the transmission system call, and the kernel calls the interrupt handler. The interrupt handler takes out the frame from the buffer unit. After fetching this frame, the kernel calls the send routine. At this time, since the frame has already been extracted from the buffer unit, the buffer unit is not full. Therefore, the data can be reliably put into the buffer unit by the transmission routine. As a result, data transmission is not delayed.

本発明に係るデータ送受信処理プログラムは、本発明に係るリアルタイム通信装置に好適であって、
アプリケーションが受信システムコールでカーネルでカーネルを呼び出す処理と、
呼び出されたカーネルが割込ハンドラを呼び出す処理と、
この割込ハンドラがバッファ部から受信済みのフレームを取り出す処理と、
この処理後、カーネルが受信ルーチンを呼び出す処理とをコンピュータに実行させることを特徴とするものである。
The data transmission / reception processing program according to the present invention is suitable for the real-time communication apparatus according to the present invention,
When the application calls the kernel in the kernel with a receive system call,
The called kernel calls the interrupt handler,
This interrupt handler takes out the received frame from the buffer part,
After this process, the computer causes the computer to execute a process of calling the reception routine.

従来技術に係るデータ送受信処理は、データ受信時において、アプリケーションが受信システムコールでカーネルを呼出し、カーネルがデバイスドライバの受信ルーチンを呼び出すようにしている。そして、フレームをバッファから受信済みの状態でなければ、割込ハンドラを呼び出し、バッファからデータフレームを取り出すように処理を行っていた。しかしながら、このような処理手順では、先ほどのデータ送信時と同様に、アプリケーションプログラムの実行周期が長くなってしまうという問題がある。   In the data transmission / reception processing according to the prior art, at the time of data reception, an application calls the kernel with a reception system call, and the kernel calls a reception routine of the device driver. If the frame has not been received from the buffer, the interrupt handler is called to perform processing so as to extract the data frame from the buffer. However, in such a processing procedure, there is a problem that the execution cycle of the application program becomes long as in the previous data transmission.

これに対して、本発明に係るデータ送受信処理は、送信システムコールでカーネルを呼び出し、カーネルが割込ハンドラを呼び出す。そして、この割込ハンドラがバッファ部からフレームを取り出すようにしている。このフレームを取り出した後、カーネルが受信ルーチンを呼び出す。このとき、バッファ部からは既に最上位のフレームが取り出されているので、バッファ部がフルになっていることがない。従って、受信ルーチンによりデータを確実にバッファ部に入れることができる。その結果、データの受信が遅らされることはない。   On the other hand, in the data transmission / reception processing according to the present invention, the kernel is called by the transmission system call, and the kernel calls the interrupt handler. The interrupt handler takes out the frame from the buffer unit. After fetching this frame, the kernel calls the receive routine. At this time, since the uppermost frame has already been extracted from the buffer unit, the buffer unit is not full. Therefore, the data can be reliably put into the buffer unit by the reception routine. As a result, data reception is not delayed.

本発明に係るデータ送受信処理プログラムは、リアルタイム通信に好適であるが、非リアルタイム通信の場合にも適用できるものである。   The data transmission / reception processing program according to the present invention is suitable for real-time communication, but can also be applied to non-real-time communication.

本発明に係るリアルタイム通信装置の好適な実施形態を図面を用いて説明する。 図1は、リアルタイム通信装置の構成を示す概念図である。   A preferred embodiment of a real-time communication apparatus according to the present invention will be described with reference to the drawings. FIG. 1 is a conceptual diagram showing a configuration of a real-time communication apparatus.

<リアルタイム通信装置(ハードウェアの構成)>
本発明に係るリアルタイム通信装置は、リアルタイム通信のみならず非リアルタイム通信にも用いることができる装置である。特に、インターネットで使用されているイーサネット環境を使用してリアルタイム通信を行おうとするものである。既に述べたように、インターネットはコネクション型の通信形式を採用しているため、希望する時間内に通信を完了することができない。すなわち、 インターネット環境における通信は非リアルタイム通信であり、このシステムを利用してリアルタイム通信を行おうとした場合に、通信処理時間に遅れが生じないようにする仕組みが要求される。
<Real-time communication device (hardware configuration)>
The real-time communication apparatus according to the present invention is an apparatus that can be used not only for real-time communication but also for non-real-time communication. In particular, real-time communication is attempted using the Ethernet environment used on the Internet. As already described, since the Internet uses a connection-type communication format, communication cannot be completed within a desired time. In other words, communication in the Internet environment is non-real-time communication, and when real-time communication is attempted using this system, a mechanism for preventing a delay in communication processing time is required.

図1において、(a)はデータ受信時の動作を示し、(b)はデータ送信時の動作を示す。バッファ部1として、第1FIFO(先入れ先出し)バッファ11と第2FIFOバッファ12とが設けられている。第1FIFOバッファ11は、実時間データ(リアルタイム通信を行うときのデータ)が出し入れされるバッファであり、第2FIFOバッファ12は、非実時間データ(非リアルタイム通信を行うときのデータ)が出し入れされるバッファである。実時間データのフレームは「a」「b」「c」「d」で示され、非実時間データのフレームは「1」「2」「3」「4」で示される。図1は、リアルタイム通信と非リアルタイム通信が同じタイミングで行われている状態を示している。もちろん、実際に行われる通信形態がこれに限定されるものではなく、リアルタイム通信のみが行われている状態、非リアルタイム通信のみが行われている状態も当然にありうるものである。   In FIG. 1, (a) shows the operation at the time of data reception, and (b) shows the operation at the time of data transmission. As the buffer unit 1, a first FIFO (first-in first-out) buffer 11 and a second FIFO buffer 12 are provided. The first FIFO buffer 11 is a buffer in which real-time data (data when performing real-time communication) is taken in and out, and the second FIFO buffer 12 is provided with non-real-time data (data when performing non-real-time communication). It is a buffer. The real-time data frames are indicated by “a”, “b”, “c”, and “d”, and the non-real-time data frames are indicated by “1”, “2”, “3”, and “4”. FIG. 1 shows a state where real-time communication and non-real-time communication are performed at the same timing. Of course, the form of communication actually performed is not limited to this, and naturally there may be a state in which only real-time communication is performed and a state in which only non-real-time communication is performed.

まず、データ受信時における動作を図1(a)により説明する。第1データ処理部2は、受信しようとするデータが実時間データであるか非実時間データであるかを検出する機能(手段)を有している。そのためのデータフレームの構成を図2に示す。   First, the operation at the time of data reception will be described with reference to FIG. The first data processing unit 2 has a function (means) for detecting whether data to be received is real-time data or non-real-time data. A data frame configuration for this purpose is shown in FIG.

図2は、フレームにおける各フィールド構成を示している。フィールドは「プリアンブル」「スタートフレームデリミタ」「送信先アドレス」「送信元アドレス」「タイプ」「データ領域」「フレームチェック」から構成されている。なお、このフィールド構成は、一例を示すものであり、これに限定されるものではない。上記のうち「タイプ」と名づけられたフィールドに基づいて、実時間データであるか非実時間データであるかを判別することができる。第1データ処理部2は、データタイプが実時間データであれば、これを第1バッファ11に入れる。データタイプが非実時間データであれば、これを第2バッファ12に入れる。このように、第1データ処理部2の機能に基づいて、データをいずれかに振り分けることができる。   FIG. 2 shows each field configuration in the frame. The field is composed of “preamble”, “start frame delimiter”, “destination address”, “source address”, “type”, “data area”, and “frame check”. Note that this field configuration shows an example, and the present invention is not limited to this. Based on the field named “type” among the above, it is possible to determine whether the data is real-time data or non-real-time data. If the data type is real-time data, the first data processing unit 2 puts this in the first buffer 11. If the data type is non-real time data, it is put into the second buffer 12. Thus, based on the function of the 1st data processing part 2, data can be distributed to either.

第2データ処理部3は、バッファ部1から受け入れたデータのうち、実時間データを優先的に上位(アプリケーション) に上げる機能(手段)を備えている。すなわち、 図1(a)の例では、実時間データと非実時間データの各フレームが混在した順番「1」「b」「2」「 a」 で入力されてくるが、上位にデータが出力されるときは、「b」「a」「1」「2」の順番で送出される。その結果、リアルタイム通信の通信時間が、非実時間データの処理時間に影響して遅れることがない。   The second data processing unit 3 has a function (means) for preferentially raising the real-time data among the data received from the buffer unit 1 to the higher rank (application). That is, in the example of FIG. 1A, the real time data and the non-real time data frames are input in the order of “1”, “b”, “2”, and “a”, but the data is output to the upper level. When sent, they are sent in the order of “b” “a” “1” “2”. As a result, the communication time of real-time communication is not delayed by affecting the processing time of non-real time data.

次に、データ送信時における動作を図1(b)により説明する。第2データ処理部3は、上位からデータ送信の要求がされた場合、送信しようとするデータが実時間データであるか非実時間データであるかを検出する機能(手段)を有している。   Next, the operation during data transmission will be described with reference to FIG. The second data processing unit 3 has a function (means) for detecting whether data to be transmitted is real-time data or non-real-time data when a data transmission request is issued from the upper level. .

先ほどと同様に、第2データ処理部3は、データタイプが実時間データであれば、これを第1バッファ11に入れる。データタイプが非実時間データであれば、これを第2バッファ12に入れる。このように、第2データ処理部3の機能に基づいて、データをいずれかに振り分けることができる。   Similarly to the above, if the data type is real-time data, the second data processing unit 3 puts this in the first buffer 11. If the data type is non-real time data, it is put into the second buffer 12. Thus, based on the function of the 2nd data processing part 3, data can be distributed to either.

第1データ処理部2は、バッファ部1から受け入れたデータのうち、実時間データを優先的に通信ラインに出力する機能(手段)を備えている。すなわち、 図1(b)の例では、実時間データと非実時間データの各フレームが混在した順番「4」「3」「c」「 d」 で入力されてくるが、通信線にデータが出力されるときは、「c」「d」「4」「3」の順番で送出される。その結果、リアルタイム通信の通信時間が、非実時間データの処理時間に影響して遅れることがない。   The first data processing unit 2 has a function (means) for preferentially outputting real time data to the communication line among the data received from the buffer unit 1. That is, in the example of FIG. 1B, the real time data and the non-real time data frames are input in the order of “4”, “3”, “c”, and “d”, but the data is transmitted to the communication line. When output, they are sent in the order of “c” “d” “4” “3”. As a result, the communication time of real-time communication is not delayed by affecting the processing time of non-real time data.

<データ送受信処理プログラム>
次に、データ送受信を速く行うことができるソフトウェアの処理について説明する。図4は、従来技術に係るデータ送受信処理の手順を示すフローチャートである。(a)はデータ送信時、(b)はデータ受信時の手順を示す。
<Data transmission / reception processing program>
Next, software processing that can perform data transmission and reception quickly will be described. FIG. 4 is a flowchart showing a procedure of data transmission / reception processing according to the prior art. (A) shows a procedure at the time of data transmission, and (b) shows a procedure at the time of data reception.

<従来技術における処理手順>
まず、送信時の処理手順を説明する。この例は、ART−Linux(リナックス)でのイーサネットによる送信手順である。データを送信しようとするとき、アプリケーション・プログラムが送信システムコールでカーネルを呼び出す(#21)。システムコールとは、OS(オペレーティングシステム)が備えている機能を呼び出して使用することを指し、ここではデータ送信を行うためのシステムコールを行う。カーネルとはOSの最も基本的な部分を指している。
<Processing procedure in the prior art>
First, a processing procedure at the time of transmission will be described. This example is a transmission procedure by Ethernet in ART-Linux. When trying to send data, the application program calls the kernel with a send system call (# 21). The system call refers to calling and using a function provided in an OS (operating system), and here, a system call for performing data transmission is performed. The kernel refers to the most basic part of the OS.

次に、呼び出されたカーネルがイーサネット・デバイスドライバの送信ルーチンを呼び出す(#22)。データの送信を行うためには、FIFOバッファに一旦データ(フレーム)を入れる必要があるので、FIFOバッファがフルに状態にあるか否かを判断する(#23)。FIFOバッファがフルでなければ、フレームを入れることができるので、ステップ#25に移行できるが、フルである場合には、割込ハンドラ(割り込みが起こった時に実行される小さなプログラムコードのことをいう)による割込み処理が終了するまで待つ(#24)。この割込ハンドラにより、一番先頭にあるフレームをFIFOバッファから取り出し、FIFOバッファに空きを生成させる。これにより、イーサネット・デバイスドライバは、FIFOバッファにフレームを入れることができる(#25)。ついで、イーサネット・コントロールデバイスに送信命令を出すと、このコントロールデバイスが、先ほどFIFOバッファから取り出したフレームを通信ラインに送出する(#26)。   Next, the called kernel calls the transmission routine of the Ethernet device driver (# 22). In order to transmit data, since it is necessary to temporarily store data (frames) in the FIFO buffer, it is determined whether or not the FIFO buffer is full (# 23). If the FIFO buffer is not full, a frame can be inserted, so that the process can proceed to step # 25. However, if it is full, an interrupt handler (a small program code executed when an interrupt occurs). ) Until the interruption process is completed (# 24). With this interrupt handler, the first frame is taken out from the FIFO buffer, and an empty space is generated in the FIFO buffer. As a result, the Ethernet device driver can put a frame into the FIFO buffer (# 25). Next, when a transmission command is issued to the Ethernet control device, the control device transmits the frame previously extracted from the FIFO buffer to the communication line (# 26).

次に、データ受信時の処理手順を説明する。同じようにアプリケーション・プログラムが受信システムコールでカーネルを呼び出す(#31)。呼び出されたカーネルが、デバイスドライバの受信ルーチンを呼び出す(#32)。フレームが既に受信済みの状態であれば(#33)、ステップ#35に移行するが、そうでなければ、割込ハンドラによる割込み処理が終了するのを待つ(#34)。すなわち、 割込ハンドラによりFIFOバッファからフレームを取り出す。これにより、FIFOバッファに空きが生じる。このフレームは、データ処理部により、上位のアプリケーションに対して出力されることになる(#35)。   Next, a processing procedure at the time of data reception will be described. Similarly, the application program calls the kernel by the reception system call (# 31). The called kernel calls the reception routine of the device driver (# 32). If the frame has already been received (# 33), the process proceeds to step # 35. If not, the process waits for completion of the interrupt processing by the interrupt handler (# 34). That is, the frame is taken out from the FIFO buffer by the interrupt handler. This creates a space in the FIFO buffer. This frame is output to the upper application by the data processing unit (# 35).

このような処理手順の場合、次のような問題が生じる。すなわち、 ART−Linuxでは割込ハンドラが周期的に実行されるが、アプリケーション・プログラムによる送信システムコールまたは受信システムコールの呼び出し周期が、割込ハンドラの実行周期よりも短かった場合、アプリケーション・プログラムの実行周期が長くなってしまうという問題が生じる。   In the case of such a processing procedure, the following problem occurs. That is, in ART-Linux, an interrupt handler is executed periodically, but if the calling cycle of a transmission system call or a receiving system call by an application program is shorter than the execution cycle of the interrupt handler, the application program There arises a problem that the execution cycle becomes long.

すなわち、 データ送信時では、割込ハンドラによりFIFOバッファからのフレームの取り出しが実行されないと、FIFOバッファにフレームが残ってしまうため、オーバーフローが生じる。従って、FIFOバッファに新たにデータフレームを入れることができないので、FIFOバッファに空きができる状態になるまで、アプリケーションの実行が中断される。その結果、アプリケーション・プログラムの実行周期が、割込ハンドラの実行周期まで長くなってしまうことになる。これにより、データ送信に要する処理時間も遅れてしまうことになる。   That is, at the time of data transmission, if a frame is not extracted from the FIFO buffer by the interrupt handler, the frame remains in the FIFO buffer, resulting in overflow. Accordingly, since a new data frame cannot be entered in the FIFO buffer, the execution of the application is suspended until the FIFO buffer becomes free. As a result, the execution cycle of the application program is extended to the execution cycle of the interrupt handler. As a result, the processing time required for data transmission is also delayed.

一方、データ受信時では、割込ハンドラによりFIFOバッファからフレームの取り出しが行われないと、上位にフレームが送出されず、FIFOバッファにデータを入れることもできない。従って、その後の処理が遅らされてしまい、やはりデータ受信に要する処理時間が遅れてしまうことになる。   On the other hand, at the time of data reception, if the frame is not taken out from the FIFO buffer by the interrupt handler, the frame is not sent to the upper level, and the data cannot be put into the FIFO buffer. Therefore, the subsequent processing is delayed, and the processing time required for data reception is also delayed.

<本発明における処理手順>
次に、本発明における処理手順を図3のフローチャートにより説明する。この例も、先ほどと同様に、ART−Linux(リナックス)でのイーサネットによる送受信手順を示す。ただし、本発明は、これに限定されるものではない。(a)が送信時のフローチャート、(b)が受信時のフローチャートを示す。
<Processing procedure in the present invention>
Next, the processing procedure in the present invention will be described with reference to the flowchart of FIG. This example also shows a transmission / reception procedure by Ethernet in ART-Linux (Linux) as before. However, the present invention is not limited to this. (A) is a flowchart at the time of transmission, and (b) is a flowchart at the time of reception.

まず、送信時の処理手順を説明する。アプリケーション・プログラムが送信システムコールでカーネルを呼び出す(#1)。このカーネルが割込ハンドラを呼び出す(#2)。この割込ハンドラにより、FIFOバッファからフレームを取り出してリターンする。これにより、FIFOバッファに空きが生じる。次に、カーネルがイーサネット・デバイスドライバの送信ルーチンを呼び出す(#3)。次に、デバイスドライバが新たなフレームをFIFOバッファに入れる(#5)。   First, a processing procedure at the time of transmission will be described. The application program calls the kernel with a transmission system call (# 1). This kernel calls the interrupt handler (# 2). By this interrupt handler, the frame is taken out from the FIFO buffer and returned. This creates a space in the FIFO buffer. Next, the kernel calls the transmission routine of the Ethernet device driver (# 3). Next, the device driver puts a new frame into the FIFO buffer (# 5).

ちなみに、ステップ#4においてFIFOバッファがフルか否かの判断処理があるが、ステップ#2で割込ハンドラを既に実行済み(フレームの取り出し完了済み)であるから、FIFOバッファがフルになっていることはない(#8)。よって、直ちにFIFOバッファへの新たなフレームの挿入がなされることになる。これは、図1(b)では、第2 データ処理部3の機能として示されている。次に、イーサネット・コントロールデバイスに送信指令を出し、シリアル通信ラインにフレームが送出される(#6)。図1(b)では、第1 データ処理部2の機能として示されている。   Incidentally, there is a process for determining whether or not the FIFO buffer is full in step # 4. However, since the interrupt handler has already been executed in step # 2 (frame extraction has been completed), the FIFO buffer is full. There is nothing (# 8). Therefore, a new frame is immediately inserted into the FIFO buffer. This is shown as a function of the second data processing unit 3 in FIG. Next, a transmission command is issued to the Ethernet control device, and a frame is transmitted to the serial communication line (# 6). FIG. 1B shows the function of the first data processing unit 2.

次に、受信時の処理手順を説明する。アプリケーション・プログラムが受信システムコールでカーネルを呼び出す(#11)。このカーネルが割込ハンドラを呼び出す(#12)。割込ハンドラがFIFOバッファからフレームを取り出してリターンする。これにより、FIFOバッファに空きが生じる。次に、カーネルがイーサネット・デバイスドライバの受信ルーチンを呼び出す(#13)。次に、FIFOバッファに受信した新たなフレームを入れる。これは図1(a)では第1データ処理部2の機能として示されている。次に、FIFOバッファから取り出したフレームを上位に送出する(#15)。これは、第2データ処理部3の機能として示されている。   Next, a processing procedure at the time of reception will be described. The application program calls the kernel by the receiving system call (# 11). This kernel calls the interrupt handler (# 12). The interrupt handler fetches the frame from the FIFO buffer and returns. This creates a space in the FIFO buffer. Next, the kernel calls the reception routine of the Ethernet device driver (# 13). Next, the received new frame is put into the FIFO buffer. This is shown as a function of the first data processing unit 2 in FIG. Next, the frame taken out from the FIFO buffer is sent to the upper level (# 15). This is shown as a function of the second data processing unit 3.

ちなみに、ステップ#14においてはNoと判断されることがないのは、先ほどと同様である。 従って、ステップ#4やステップ#14についての判断処理は省略することが可能である。ただし、既存のソフトウェアの互換性を保持するために、ソースコードを変更しない方が好ましいので、本発明の構成としては、ステップ#4やステップ#14についての判断処理を残しておくことが好ましい。   By the way, it is the same as before that it is not judged No in step # 14. Therefore, the determination process for step # 4 and step # 14 can be omitted. However, since it is preferable not to change the source code in order to maintain the compatibility of the existing software, it is preferable to leave the determination processing for step # 4 and step # 14 as the configuration of the present invention.

<タイミングチャート>
図5は、アプリケーションの実行周期と割込ハンドラの実行周期との関係を示すタイミングチャートである。図5(a)が従来技術を示し(b)が本発明を示す。なお送信時も受信時も同じ態様になる。アプリケーションの実行をAで示し、割込ハンドラの実行をIで示している。
<Timing chart>
FIG. 5 is a timing chart showing the relationship between the application execution cycle and the interrupt handler execution cycle. FIG. 5A shows the prior art and FIG. 5B shows the present invention. Note that the same manner is used at the time of transmission and at the time of reception. Application execution is indicated by A, and interrupt handler execution is indicated by I.

従来技術では、アプリケーションの実行周期は500μs、割込ハンドラの実行周期が1msとなっている。すなわち、 割込ハンドラの実行周期の方が長い。この場合、割込ハンドラの実行周期に合わせて、アプリケーションの実行に無駄な待ち時間が生じていることがわかる。すなわち、 実際にはアプリケーションの実行周期500μsを実現することができない。従って、データ処理時間も長くなることになり、その結果、データの送受信に要する時間も長くなることになる。   In the prior art, the application execution cycle is 500 μs, and the interrupt handler execution cycle is 1 ms. In other words, the interrupt handler execution cycle is longer. In this case, it can be seen that there is a wasteful waiting time for executing the application in accordance with the execution cycle of the interrupt handler. In other words, an application execution cycle of 500 μs cannot be realized in practice. Therefore, the data processing time is also increased, and as a result, the time required for data transmission / reception is also increased.

一方、本発明による場合、割込ハンドラの実行周期もアプリケーションの実行周期も共に500μsとしている。従って、図5(b)に示すように無駄な待ち時間が発生しない。アプリケーションの実行周期500μsを確実に実現することができる。   On the other hand, according to the present invention, both the interrupt handler execution cycle and the application execution cycle are set to 500 μs. Therefore, no unnecessary waiting time occurs as shown in FIG. An application execution cycle of 500 μs can be reliably realized.

なお、アプリケーションによるプログラムの実行としては、例えば、システムコールによりカーネルを呼び出す処理のほかに、受信したデータの加工や、送信するデータの作成等の種々のものが含まれる。   Note that execution of a program by an application includes, for example, various processes such as processing of received data and creation of data to be transmitted, in addition to processing for calling a kernel by a system call.

本発明に係るリアルタイム通信装置の構成を示す概念図The conceptual diagram which shows the structure of the real-time communication apparatus which concerns on this invention データフレームのフィールド構成を示す図Diagram showing field structure of data frame 本発明に係るデータ送受信処理の手順を示すフローチャートThe flowchart which shows the procedure of the data transmission / reception process based on this invention 従来技術に係るデータ送受信処理の手順を示すフローチャートThe flowchart which shows the procedure of the data transmission / reception process based on a prior art プログラム実行態様を示す図Diagram showing program execution mode 従来技術に係る通信装置の構成を示す概念図Conceptual diagram showing the configuration of a communication device according to the prior art

符号の説明Explanation of symbols

1 バッファ部
2 第1データ処理部
3 第2データ処理部
11 第1バッファ
12 第2バッファ
DESCRIPTION OF SYMBOLS 1 Buffer part 2 1st data processing part 3 2nd data processing part 11 1st buffer 12 2nd buffer

Claims (3)

第1データ処理部と、バッファ部と、第2データ処理部とを有し、データ受信時は、第1データ処理部、バッファ部、第2データ処理部の順番にデータが流れ、データ送信時は、第2データ処理部、バッファ部、第1データ処理部の順番にデータが流れるように構成されたリアルタイム通信装置であって、
バッファ部は、
リアルタイム通信用の実時間データを受け入れる第1バッファと、
非リアルタイム通信用の非実時間データを受け入れる第2バッファとを備え、
第1データ処理部及び第2データ処理部は、
データが実時間データであるか非実時間データであるかを検出する手段と、
検出されたデータのタイプに応じて、データを第1バッファ又は第2バッファのいずれかに振り分け処理を行う手段と、
バッファ部から受け入れたデータを送出するに際して、実時間データを非実時間データよりも優先して送出する処理を行う手段と、を備えているリアルタイム通信装置を用いて行われるデータ送受信処理プログラムであって、
アプリケーションが送信システムコールでカーネルを呼び出す処理と、
呼び出されたカーネルが割込ハンドラを呼び出す処理と、
この割込ハンドラがバッファ部からフレームを取り出す処理と、
この処理後、カーネルが送信ルーチンを呼び出す処理とをコンピュータに実行させることを特徴とするデータ送受信処理プログラム。
It has a first data processing unit, a buffer unit, and a second data processing unit. When data is received, data flows in the order of the first data processing unit, the buffer unit, and the second data processing unit. Is a real-time communication device configured such that data flows in the order of the second data processing unit, the buffer unit, and the first data processing unit,
The buffer part
A first buffer that accepts real-time data for real-time communication;
A second buffer for accepting non-real time data for non-real time communication;
The first data processor and the second data processor are
Means for detecting whether the data is real-time data or non-real-time data;
Means for distributing data to either the first buffer or the second buffer according to the type of data detected;
A data transmission / reception processing program executed using a real-time communication device having means for sending real-time data in preference to non-real-time data when sending data received from the buffer unit. And
When the application calls the kernel with a send system call,
The called kernel calls the interrupt handler,
This interrupt handler takes out the frame from the buffer part,
A data transmission / reception processing program for causing a computer to execute a process in which a kernel calls a transmission routine after this process.
第1データ処理部と、バッファ部と、第2データ処理部とを有し、データ受信時は、第1データ処理部、バッファ部、第2データ処理部の順番にデータが流れ、データ送信時は、第2データ処理部、バッファ部、第1データ処理部の順番にデータが流れるように構成されたリアルタイム通信装置であって、It has a first data processing unit, a buffer unit, and a second data processing unit. When data is received, data flows in the order of the first data processing unit, the buffer unit, and the second data processing unit. Is a real-time communication device configured such that data flows in the order of the second data processing unit, the buffer unit, and the first data processing unit,
バッファ部は、The buffer part
リアルタイム通信用の実時間データを受け入れる第1バッファと、A first buffer that accepts real-time data for real-time communication;
非リアルタイム通信用の非実時間データを受け入れる第2バッファとを備え、A second buffer for accepting non-real time data for non-real time communication;
第1データ処理部及び第2データ処理部は、The first data processor and the second data processor are
データが実時間データであるか非実時間データであるかを検出する手段と、Means for detecting whether the data is real-time data or non-real-time data;
検出されたデータのタイプに応じて、データを第1バッファ又は第2バッファのいずれかに振り分け処理を行う手段と、Means for distributing data to either the first buffer or the second buffer according to the type of data detected;
バッファ部から受け入れたデータを送出するに際して、実時間データを非実時間データよりも優先して送出する処理を行う手段と、を備えているリアルタイム通信装置を用いて行われるデータ送受信処理プログラムであって、A data transmission / reception processing program executed using a real-time communication device having means for sending real-time data in preference to non-real-time data when sending data received from the buffer unit. And
アプリケーションが受信システムコールでカーネルでカーネルを呼び出す処理と、When the application calls the kernel in the kernel with a receive system call,
呼び出されたカーネルが割込ハンドラを呼び出す処理と、The called kernel calls the interrupt handler,
この割込ハンドラがバッファ部からフレームを取り出す処理と、This interrupt handler takes out the frame from the buffer part,
この処理後、カーネルが受信ルーチンを呼び出す処理とをコンピュータに実行させることを特徴とするデータ送受信処理プログラム。A data transmission / reception processing program for causing a computer to execute a process in which a kernel calls a reception routine after this process.
データ送信時において、
アプリケーションが送信システムコールでカーネルを呼び出す処理と、
呼び出されたカーネルが割込ハンドラを呼び出す処理と、
この割込ハンドラがバッファ部からフレームを取り出す処理と、
この処理後、カーネルが送信ルーチンを呼び出す処理と、
データ受信時において、
アプリケーションが受信システムコールでカーネルでカーネルを呼び出す処理と、
呼び出されたカーネルが割込ハンドラを呼び出す処理と、
この割込ハンドラがバッファ部からフレームを取り出す処理と、
この処理後、カーネルが受信ルーチンを呼び出す処理とをコンピュータに実行させることを特徴とするデータ送受信処理プログラム。
When sending data,
When the application calls the kernel with a send system call,
The called kernel calls the interrupt handler,
This interrupt handler takes out the frame from the buffer part,
After this processing, the kernel calls the send routine,
When receiving data,
When the application calls the kernel in the kernel with a receive system call,
The called kernel calls the interrupt handler,
This interrupt handler takes out the frame from the buffer part,
A data transmission / reception processing program for causing a computer to execute a process in which a kernel calls a reception routine after this process.
JP2004002234A 2004-01-07 2004-01-07 Data transmission / reception processing program Expired - Fee Related JP4038574B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004002234A JP4038574B2 (en) 2004-01-07 2004-01-07 Data transmission / reception processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004002234A JP4038574B2 (en) 2004-01-07 2004-01-07 Data transmission / reception processing program

Publications (2)

Publication Number Publication Date
JP2005198023A JP2005198023A (en) 2005-07-21
JP4038574B2 true JP4038574B2 (en) 2008-01-30

Family

ID=34817517

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004002234A Expired - Fee Related JP4038574B2 (en) 2004-01-07 2004-01-07 Data transmission / reception processing program

Country Status (1)

Country Link
JP (1) JP4038574B2 (en)

Also Published As

Publication number Publication date
JP2005198023A (en) 2005-07-21

Similar Documents

Publication Publication Date Title
US7228410B2 (en) Network interface sharing methods and apparatuses that support kernel mode data traffic and user mode data traffic
US20170024309A1 (en) Managing software performance tests based on a distributed virtual machine system
US20120036230A1 (en) Message send queue reordering based on priority
US8737262B2 (en) Zero copy transmission with raw packets
JP3127523B2 (en) Communication control device and data transmission method
CA2503867C (en) Message send queue reordering based on priority
US7870257B2 (en) Enhancing real-time performance for java application serving
EP2846470B1 (en) A method of mobile terminal internal communications
CN116743317B (en) Data transmission method based on universal chip interconnection standard
CN106411778A (en) Data forwarding method and device
KR0147509B1 (en) Timeout process circuit and receiver including this timeout process circuit
JP2020080059A (en) Evaluation device, evaluation method and evaluation program
JP4038574B2 (en) Data transmission / reception processing program
WO2015176646A1 (en) Flit transmission method and device of network on chip
US10608863B2 (en) Transmission control application supporting TCP fast open
JPH1165623A (en) Programmable controller
JP5262329B2 (en) Scheduling program, scheduling method, and scheduling apparatus
JP5205789B2 (en) Data processing system, daemon program, and computer startup method
CN110149281B (en) Message forwarding method, device and storage medium
CN113316101B (en) Short message sending method, short message sending device, short message sending equipment and storage medium
CN115567459A (en) Flow control system and method based on buffer area
JPH07295839A (en) Inter-task communication system
JP2002055832A (en) Multitask system and inter-task communication method for multitask system
US20070081656A1 (en) Telecommunication server apparatus
CN113782028A (en) Voice stream data processing method, device and system

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050524

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20050525

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050825

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070524

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070531

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070626

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

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20071010

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20071011

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20071017

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20071010

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

Free format text: PAYMENT UNTIL: 20101116

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20101116

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20111116

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20111116

Year of fee payment: 4

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313117

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

Free format text: PAYMENT UNTIL: 20111116

Year of fee payment: 4

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees
S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R370 Written measure of declining of transfer procedure

Free format text: JAPANESE INTERMEDIATE CODE: R370