JP6217344B2 - Method and apparatus for controlling access to shared memory - Google Patents
Method and apparatus for controlling access to shared memory Download PDFInfo
- Publication number
- JP6217344B2 JP6217344B2 JP2013244350A JP2013244350A JP6217344B2 JP 6217344 B2 JP6217344 B2 JP 6217344B2 JP 2013244350 A JP2013244350 A JP 2013244350A JP 2013244350 A JP2013244350 A JP 2013244350A JP 6217344 B2 JP6217344 B2 JP 6217344B2
- Authority
- JP
- Japan
- Prior art keywords
- access
- shared memory
- tag
- time
- memory
- 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.)
- Active
Links
Images
Description
本発明は、共有メモリに対するアクセス制御方法および装置に関する。 The present invention relates to an access control method and apparatus for a shared memory.
従来、複数のインターフェースから共有メモリに対してアクセスするデバイスが、デバイスに組み込まれている場合は、各デバイスのメモリアクセスは、デバイス内で管理されていた。そのため、メモリアクセスのタイミングの管理は容易であった。一方、例えば、ICタグのリーダライタのように、組み込みではないデバイスとメモリを共有する場合においても、従来は組み込みデバイス、組み込みではないデバイス間のメモリアクセスを行うタイミングが明確に異なっていたため、共有メモリへの同時アクセスによるコリジョンを考慮する必要が少なかった。 Conventionally, when a device that accesses a shared memory from a plurality of interfaces is incorporated in the device, the memory access of each device is managed in the device. Therefore, the management of the memory access timing is easy. On the other hand, for example, when a memory is shared with a non-embedded device such as an IC tag reader / writer, the timing for performing memory access between the embedded device and the non-embedded device has been clearly different. There was less need to consider collisions due to simultaneous access to memory.
しかしながら、近年、接触型または非接触型のICタグのように、リーダライタ等の外部機器から送信される信号の受信に起因してメモリアクセスを行うようなデバイスが増加している。例えば、接触型または非接触型のICタグは、リーダライタ等の外部機器と通信を行い、搬送波にのせられたデータ、クロック信号を取り出し、ICカードのメモリにデータを書き込む。近年では、さらに、ICタグに保持されている情報の一部を可視表示させるべく、表示デバイス等のデバイスを搭載する構成が知られている(例えば、特許文献1参照)。 However, in recent years, devices such as contact-type or non-contact-type IC tags that perform memory access due to reception of signals transmitted from external devices such as reader / writers are increasing. For example, a contact-type or non-contact-type IC tag communicates with an external device such as a reader / writer, takes out data and a clock signal placed on a carrier wave, and writes the data to the memory of the IC card. In recent years, a configuration in which a device such as a display device is mounted so that a part of information held in an IC tag can be displayed visually is known (for example, see Patent Document 1).
このような構成においては、CPUと、アンテナ等を介して受信したデータの書き込みを行うICタグのコントローラーが、ICタグのメモリを共有し、ICタグのメモリにそれぞれ書き込みおよび読み出しを行う。 In such a configuration, the CPU and the controller of the IC tag that writes the data received via the antenna share the memory of the IC tag, and write and read to the memory of the IC tag, respectively.
例えば、他デバイスが表示装置である場合、リーダライタから搬送波を受信し、CPUが起動すると、ICタグのメモリから表示のためのハードウェア制御プログラムや表示用の情報(例えば、課金情報等)を読み出して表示制御を行う。一方、リーダライタ等の外部機器との通信においては、アンテナまたは電気的接点を介して受信されたコマンド等に基づき、ICタグのコントローラーがICタグ内のメモリへの書き込み、または、読み取りを行う。かかる構成においては、CPUとICタグのコントローラーのアクセスを行うタイミングが同時であるため、適切な制御をしないとメモリに対する同時書き込みが発生してしまう。 For example, when the other device is a display device, a carrier wave is received from the reader / writer and the CPU is activated. Then, a hardware control program for display and display information (for example, billing information) are displayed from the memory of the IC tag. Read and perform display control. On the other hand, in communication with an external device such as a reader / writer, the controller of the IC tag performs writing to or reading from the memory in the IC tag based on a command received via an antenna or an electrical contact. In such a configuration, the timing for accessing the controller of the CPU and the IC tag is the same, so simultaneous writing to the memory occurs unless appropriate control is performed.
したがって、共有メモリに対する同時書き込みを回避する必要があるが、従来、以下の方法により、共有メモリへの同時アクセスによる競合を回避していた。
a)先にアクセスしたデバイスのメモリアクセスを優先させ、先にアクセスしたデバイスによるメモリアクセスが完了するまで他のデバイスのアクセスを受け付けない(例えば、特許文献2参照)。
b)どちらか一方のデバイスからのアクセスを常に優先させる。例えば、デバイスBがアクセスしている間、デバイスAからのアクセスがあった場合、デバイスBのアクセスを切断し、デバイスAからのアクセスを優先的に開始させる(例えば、特許文献3参照)。
Therefore, it is necessary to avoid simultaneous writing to the shared memory, but conventionally, contention due to simultaneous access to the shared memory has been avoided by the following method.
a) Prioritize the memory access of the previously accessed device, and do not accept the access of other devices until the memory access by the previously accessed device is completed (see, for example, Patent Document 2).
b) Always give priority to access from either device. For example, when there is an access from the device A while the device B is accessing, the access from the device B is disconnected and the access from the device A is preferentially started (see, for example, Patent Document 3).
上記特許文献2及び3のように、排他的なアクセスを実現するための制御回路を別途設けることにより、いずれかの入出力インターフェースからのアクセスを禁止または優先させることは、回路構成を変更しなくてはならず、必要部品が増加し構成が複雑となる。また、外部機器の構成上の理由などから、外部機器側でアクセスを行うタイミングを調整することが難しいこともある。例えば、ICタグの例においては、リーダライタ機能を有するデバイスは、スマートフォン等であることが多いが、OSI参照モデルにおける、低レイヤに位置するファームウェアによって通信制御が行われることが多く、通信動作の改変は困難である。 As in Patent Documents 2 and 3, by separately providing a control circuit for realizing exclusive access, prohibiting or giving priority to access from any of the input / output interfaces does not change the circuit configuration. In other words, the number of necessary parts increases and the configuration becomes complicated. Further, it may be difficult to adjust the access timing on the external device side due to the configuration of the external device. For example, in an example of an IC tag, a device having a reader / writer function is often a smartphone or the like, but communication control is often performed by firmware located in a lower layer in the OSI reference model, and communication operation is performed. Modification is difficult.
本発明は、このような問題に鑑みてなされたもので、その目的とするところは、メモリアクセスの排他制御機構を有さないメモリ(複数の入出力インターフェースを有することが前提である)であっても、簡易且つ確実な手段により、複数の異なる対象からのアクセス要求のコリジョンを避ける方法および装置を提供することにある。 The present invention has been made in view of such problems, and the object of the present invention is a memory that does not have a memory access exclusive control mechanism (assuming that it has a plurality of input / output interfaces). However, an object of the present invention is to provide a method and apparatus that avoids collision of access requests from a plurality of different objects by simple and reliable means.
本発明は、このような目的を達成するために、請求項1に記載の発明は、第1の入出力インターフェースおよび第2の入出力インターフェースを有する共有メモリと、前記共有メモリの前記第1の入出力インターフェースに接続される第1のデバイスと、前記共有メモリの前記第2の入出力インターフェースに接続される第2のデバイスとを有し、電力供給がされると、前記第2のデバイスおよび前記第1のデバイスが起動され、その後、前記第2のデバイスおよび前記第1のデバイスが、前記共有メモリへのアクセスを開始する装置において、前記第1のデバイスおよび前記第2のデバイスが起動した後、待機時間設定としての所定時間だけ前記第1のデバイスを待機させ、前記所定時間の経過後に前記第1のデバイスに前記共有メモリにアクセスさせることにより前記共有メモリへの同時アクセスを回避するアクセス調整手段を備えたことを特徴とする。 In order to achieve the above object, the present invention provides a shared memory having a first input / output interface and a second input / output interface, and the first of the shared memories. A first device connected to the input / output interface; and a second device connected to the second input / output interface of the shared memory. When the power is supplied, the second device and The first device is activated, and then the first device and the second device are activated in an apparatus in which the second device and the first device start accessing the shared memory. Thereafter, the first device is made to wait for a predetermined time as a standby time setting, and after the predetermined time elapses, the first device is stored in the shared memory. Characterized by comprising an access adjustment means for avoiding simultaneous access to the shared memory by access.
請求項2に記載の発明は、請求項1に記載の発明に対してさらに、前記所定時間の経過後に前記第1のデバイスが前記共有メモリへのアクセスを行い、コリジョンの発生を検知すると、前記待機時間設定を更新する手段をさらに備えたことを特徴とする。 According to a second aspect of the present invention, in addition to the first aspect of the invention, when the first device accesses the shared memory after the predetermined time has elapsed and detects the occurrence of a collision, The apparatus further comprises means for updating the waiting time setting.
請求項3に記載の発明は、請求項1に記載の発明に対してさらに、前記第1のデバイスが前記待機時間設定で指定された時間待機した後に、前記共有メモリへのアクセスを行いコリジョンの発生を検知すると、予め定められたリトライ間隔時間さらに待機した後に、前記共有メモリへのアクセスをリトライし、前記共有メモリへのアクセスが成功したことを検知すると、前記待機時間設定に、前記リトライ間隔時間を加算することによって、前記待機時間設定を更新する手段をさらに備えたことを特徴とする。 According to a third aspect of the present invention, in addition to the first aspect of the present invention, the first device waits for a time designated by the standby time setting, and then accesses the shared memory to perform collision. When the occurrence is detected, after waiting further for a predetermined retry interval time, the access to the shared memory is retried. When the access to the shared memory is detected successfully, the retry interval is set in the wait time setting. The apparatus further comprises means for updating the waiting time setting by adding the time.
請求項4に記載の発明は、請求項1に記載の発明に対してさらに、前記第1のデバイスが前記待機時間設定で指定された時間待機した後に、前記共有メモリへのアクセスを行い前記共有メモリへのアクセスが成功したことを検知すると、前記待機時間設定から、予め定められた調整時間を減算することによって、前記待機時間設定を更新する手段をさらに備えたことを特徴とする。 According to a fourth aspect of the present invention, in addition to the first aspect of the present invention, after the first device waits for a time specified by the standby time setting, the shared memory is accessed and the shared memory is accessed. When detecting that the access to the memory is successful, the apparatus further comprises means for updating the standby time setting by subtracting a predetermined adjustment time from the standby time setting.
請求項5に記載の発明は、請求項1に記載の発明に対してさらに、アクセス調整手段は、前記待機時間設定で指定された時間に、1回の前記共有メモリへのアクセスにおける、最初にコリジョンが発生してからのリトライ回数と予め定められたリトライ間隔時間とを乗算した時間を加算することによって、前記待機時間設定を更新する手段をさらに備えたことを特徴とする。 According to a fifth aspect of the present invention, in addition to the first aspect of the present invention, the access adjusting means is the first in the access to the shared memory at a time specified by the standby time setting. The apparatus further comprises means for updating the waiting time setting by adding a time obtained by multiplying the number of retries after the collision has occurred and a predetermined retry interval time.
請求項6に記載の発明は、請求項1に記載の発明に対してさらに、前記第1のデバイスが前記待機時間設定としての所定時間待機した後に、前記共有メモリへのアクセスを行い前記共有メモリへのアクセスが成功したことを検知すると、前記待機時間設定から、予め定められた調整時間を減算し、前記待機時間設定を更新させ、前記アクセス調整手段が、前記更新された待機時間設定で指定された時間だけ、前記第1のデバイスを待機させた後に、前記共有メモリへのアクセスを行い前記共有メモリへのアクセスが成功したことを検知すると、再び前記待機時間設定から、前記予め定められた調整時間を減算することにより、前記待機時間設定を更新する手段をさらに備えたことを特徴とする。 According to a sixth aspect of the present invention, in addition to the first aspect of the present invention, after the first device waits for a predetermined time as the standby time setting, the shared memory is accessed and the shared memory is accessed. When it is detected that the access to the network is successful, a predetermined adjustment time is subtracted from the standby time setting, the standby time setting is updated, and the access adjusting means is designated by the updated standby time setting. After the first device is made to wait for a predetermined time, the access to the shared memory is detected and it is detected that the access to the shared memory is successful. The apparatus further comprises means for updating the waiting time setting by subtracting the adjustment time.
請求項7に記載の発明は、請求項1ないし6いずれかに記載された発明に対してさらに、前記アクセス調整手段は、更新された前記待機時間設定で指定された時間、前記第1のデバイスを待機させることを特徴とする。 According to a seventh aspect of the present invention, in addition to the first aspect of the present invention, the access adjusting means is configured to provide the first device for a time specified by the updated waiting time setting. It is characterized by making it wait.
請求項8に記載の発明は、リーダライタからの受信信号を受信し、または、リーダライタへの送信信号を送信するアンテナと、第1の入出力インターフェースおよび第2の入出力インターフェースを有するICタグメモリと、組み込みデバイスと、前記アンテナを介して前記リーダライタと送受信される信号の読み書きのために、前記ICタグメモリにアクセスするICタグコントローラーと、前記組み込みデバイスと接続され、前記組み込みデバイスを制御するための制御プログラムおよびデータの読み書きのために、前記ICタグメモリにアクセスするCPUと、前記リーダライタからのウェイクアップ信号を受信すると、前記ICタグコントローラーと前記CPUとを起動させる起動手段とを有し、前記ICタグメモリの第1の入出力インターフェースに前記CPUを、第2の入出力インターフェースに前記ICタグコントローラーを接続させたICタグ装置において、前記起動手段により前記ICタグコントローラーと前記CPUとが起動した後、待機時間設定としての所定時間だけ前記CPUを待機させ、前記所定時間の経過後に、前記CPUにメモリアクセスさせることにより前記ICタグメモリへの同時アクセスを回避するアクセス調整手段を備えたことを特徴とする。 According to an eighth aspect of the present invention, there is provided an IC tag having an antenna for receiving a reception signal from a reader / writer or transmitting a transmission signal to the reader / writer, a first input / output interface, and a second input / output interface A memory, an embedded device, and an IC tag controller that accesses the IC tag memory for reading and writing signals transmitted to and received from the reader / writer via the antenna, and the embedded device are connected to control the embedded device A CPU for accessing the IC tag memory for reading and writing a control program and data, and an activation means for activating the IC tag controller and the CPU when receiving a wake-up signal from the reader / writer A first input / output of the IC tag memory In the IC tag device in which the CPU is connected to the interface and the IC tag controller is connected to the second input / output interface, after the IC tag controller and the CPU are activated by the activation means, a predetermined standby time setting is set. It is characterized by comprising an access adjusting means for avoiding simultaneous access to the IC tag memory by causing the CPU to wait for a certain time and allowing the CPU to access the memory after the predetermined time has elapsed.
請求項9に記載の発明は、請求項8に記載の発明に対してさらに、アクセス調整手段は、前記CPUが前記待機時間設定で指定された時間待機した後に、前記ICタグメモリへのアクセスを行いコリジョンの発生を検知すると、予め定められたリトライ間隔時間さらに待機した後に、前記ICタグメモリへのアクセスをリトライし、前記ICタグメモリへのアクセスが成功したことを検知すると、前記待機時間設定に、前記リトライ間隔時間を加算することによって、前記待機時間設定を更新することを特徴とする。 According to a ninth aspect of the present invention, in addition to the eighth aspect of the invention, the access adjustment means may access the IC tag memory after the CPU waits for a time specified by the standby time setting. When the occurrence of collision is detected, after waiting further for a predetermined retry interval time, the access to the IC tag memory is retried, and when the access to the IC tag memory is detected, the waiting time setting is performed. Further, the standby time setting is updated by adding the retry interval time.
請求項10に記載の発明は、請求項8に記載の発明に対してさらに、前記CPUが前記待機時間設定で指定された時間待機した後に、前記ICタグメモリへのアクセスを行い前記ICタグメモリへのアクセスが成功したことを検知すると、前記待機時間設定から、予め定められた調整時間を減算することによって、前記待機時間設定を更新することを特徴とする。 According to a tenth aspect of the present invention, in addition to the eighth aspect of the invention, after the CPU waits for a time designated by the standby time setting, the IC tag memory is accessed and the IC tag memory is accessed. When it is detected that the access to is successful, the standby time setting is updated by subtracting a predetermined adjustment time from the standby time setting.
請求項11に記載の発明は、第1の入出力インターフェースおよび第2の入出力インターフェースを有する共有メモリと、前記共有メモリの前記第1の入出力インターフェースに接続される第1のデバイスと、前記共有メモリの前記第2の入出力インターフェースに接続される第2のデバイスとを有し、電力供給がされると、前記第2のデバイスおよび前記第1のデバイスが起動され、その後、前記第2のデバイスおよび前記第1のデバイスが、前記共有メモリへのアクセスを開始する装置における、前記共有メモリへの同時アクセスを回避する方法であって、前記第1のデバイスおよび前記第2のデバイスが起動した後、待機時間設定としての所定時間だけ前記第1のデバイスを待機させ、前記所定時間の経過後に前記第1のデバイスに前記共有メモリにアクセスさせることを特徴とする。
The invention according to
共有メモリの複数のインターフェースのうちの1に接続される一方のデバイス側を一定時間待機させることで、コリジョンを回避させる構成である。この構成によれば、メモリアクセスの排他制御機構を有さないメモリであっても、簡単且つ確実な構成で、共有メモリへのアクセスのコリジョンを避けるための構成を実現することができる。 In this configuration, one device connected to one of the plurality of interfaces of the shared memory waits for a certain period of time to avoid collision. According to this configuration, even a memory that does not have an exclusive control mechanism for memory access can realize a configuration for avoiding access collision to the shared memory with a simple and reliable configuration.
また、本発明の第2の実施形態によれば、一方のデバイス側に学習モードを備え、最適な待ち時間を学習させる。学習モードの一例として、一方のデバイス側が、例えば、T1+T2時間待った後、共有メモリにアクセスしたとき、コリジョンが起こらなければ、待機時間設定である、Variable Wait TimeをT1+T2に設定する。その後、Variable Wait Time=T1+T2より短い時間で、共有メモリにアクセスし、コリジョンが起こらなければ、Variable Wait Timeを再設定する。その繰り返しを行い、最適なVariable Wait Timeを決定する。この構成によれば、機種、環境等に依存してアクセス時間が異なるデバイスであっても、待ち時間を最適な時間に設定し、コリジョンを回避することができる。 In addition, according to the second embodiment of the present invention, a learning mode is provided on one device side, and an optimal waiting time is learned. As an example of the learning mode, for example, when one device side waits for T 1 + T 2 hours and then accesses the shared memory, if collision does not occur, the variable wait time, which is a waiting time setting, is set to T 1 + T 2 To do. Thereafter, the shared memory is accessed in a shorter time than Variable Wait Time = T 1 + T 2 , and if no collision occurs, the Variable Wait Time is reset. The process is repeated to determine the optimum variable wait time. According to this configuration, even if the device has a different access time depending on the model, environment, etc., the waiting time can be set to an optimum time and collision can be avoided.
以下、図面を参照しながら本発明の実施形態について詳細に説明する。なお、本明細書において、メモリアクセスとは、メモリへの書込み、読み出し、消去等を意味する。また、コリジョンとは、複数の通信の衝突を意味し、ウェイクアップアクションとは、ICタグがコマンドも受け付けない状態(スリープ状態)から、コマンドを受け付け可能な状態(ウェイクアップ状態)へ遷移させる、デバイス内のCPUを起動させるためのトリガーであって、センサー等に検知される動作を意味する。例えば、ICタグの例においては、コントローラー及びCPUを起動させるためのトリガー信号(搬送波)を検知することを意味する。入出力インターフェースとは、I2C、SPI、UART等のシリアルインターフェースに加え、無線通信により得たデータ等を入出力するための、RFインターフェース等も含む。なお、本明細書においては、ICタグデバイスの筐体中に配置されたCPUと、ICタグデバイスに読書きを行うリーダライタとが、メモリアクセスを行う構成を例に挙げて説明しているが、共有メモリに読書きを行うデバイスであれば、どのような形態のデバイスでも良い。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. In this specification, memory access means writing, reading, erasing, etc. to the memory. Collision means a collision of a plurality of communications, and a wakeup action is a transition from a state where the IC tag does not accept commands (sleep state) to a state where commands can be accepted (wakeup state). It is a trigger for starting up the CPU in the device, and means an operation detected by a sensor or the like. For example, in the case of an IC tag, this means that a trigger signal (carrier wave) for starting the controller and the CPU is detected. The input / output interface includes, in addition to a serial interface such as I 2 C, SPI, and UART, an RF interface for inputting / outputting data and the like obtained by wireless communication. Note that, in this specification, a configuration in which a CPU arranged in a housing of an IC tag device and a reader / writer that reads from and writes to the IC tag device performs memory access is described as an example. Any type of device may be used as long as the device reads and writes to the shared memory.
[第1実施形態]
図1は、複数の入出力インターフェースを有する共有メモリに対するアクセスを概念的に説明する図である。複数の入出力インターフェースとして、2つの入出力ポートを介して入出力を行う構成を挙げているが、入出力ポートは2つに限らない。また、共有メモリに対してアクセスを行うデバイスは、ICタグの例に限定されず、どのようなデバイスであっても構わない。
[First Embodiment]
FIG. 1 is a diagram conceptually illustrating access to a shared memory having a plurality of input / output interfaces. As the plurality of input / output interfaces, a configuration is described in which input / output is performed via two input / output ports, but the number of input / output ports is not limited to two. Further, the device that accesses the shared memory is not limited to the example of the IC tag, and any device may be used.
図1において、共有メモリを1つの部屋とし、それぞれのインターフェースをドアに例える。共有メモリには、基本的に、片方のドアからしか入ることができない仕様となっている。例えば、インターフェースAから共有メモリの書き換え動作を行っている間、インターフェースBからも共有メモリの情報を書き換えようとした場合、コリジョンが発生し、書き換え動作が正常に完了されない可能性がある。ここで、図1のインターフェースAに接続されるデバイスに、アクセス調整手段を設け、所定時間共有メモリへのアクセスを待機させる。それにより、インターフェースBとの間の同時メモリアクセスによるコリジョンを回避する。図1の概念的な複数の入出力インターフェースを利用する例として、図2において、ICタグを例に挙げてより具体的に説明する。 In FIG. 1, the shared memory is one room, and each interface is like a door. Basically, the shared memory can only be entered from one door. For example, if the shared memory information is also rewritten from the interface B while the shared memory is being rewritten from the interface A, a collision may occur and the rewrite operation may not be completed normally. Here, the device connected to the interface A in FIG. 1 is provided with an access adjustment means, and waits for access to the shared memory for a predetermined time. Thereby, collision due to simultaneous memory access with the interface B is avoided. As an example of using a plurality of conceptual input / output interfaces shown in FIG. 1, an IC tag is taken as an example in FIG.
図2は、本発明の一実施形態にかかる、ICタグ10の内部構成例を示す。ICタグメモリ102は、不揮発性または揮発性のメモリであって、例えば、RAM、FRAM(登録商標)、EEPROM等で構成される。本発明におけるICタグメモリ102は、複数の入出力インターフェース(入出力インターフェース1および2)を有し、入出力インターフェース1は、CPU101に接続され、入出力インターフェース2は、アンテナ110を介して受信したコマンド等をICタグメモリ102に読書きする、コントローラー104に接続されている。CPU101は、表示装置111または、音声出力装置等のデバイスを制御する構成としてもよい。
FIG. 2 shows an internal configuration example of the
アンテナ110は、所定周波数(例えばUHF帯等の高周波やHF帯等の低周波)を用いて非接触で信号の送受信を行う。アンテナ110には、整流回路108及び電源回路109が接続され、整流回路108は、アンテナ110により受信された搬送波を整流し、電源回路109は整流された搬送波のエネルギーを蓄積し、復調回路106、CPU101等の駆動電源とする。
The
クロック信号生成回路105は、受信された搬送波からクロック信号を抽出して、コントローラー104に供給する。復調回路106は変調された搬送波を復調して、コントローラー104に供給する。コントローラー104は、前述のように、デジタルデータをICタグメモリ102に入出力インターフェース2を介して読み書きする。変調回路107は、コントローラー104からの信号を変調してアンテナ110を介して搬送波を送信する。リーダライタA122及びリーダライタB123は、ICタグ10へのコマンド、データの送受信を行うもので、制御部113、アンテナ112、図示しない変調回路、復調回路等を有している。
The clock
図3は、本発明の一実施形態にかかる、ICタグ装置におけるコリジョン回避処理のフローチャートである。 FIG. 3 is a flowchart of collision avoidance processing in the IC tag device according to the embodiment of the present invention.
ステップS201において、リーダライタA122またはB123から、タグをスリープ状態から復帰させるコマンドであるウェイクアップ信号がICタグ10に送信される。ICタグ10は、ウェイクアップ信号を受信すると、電源回路109が電力を供給して、ステップS203でスリープ状態からウェイクアップ状態に移行する。なお、CPU101の起動時には、メモリの特定領域(例えば、リセットベクタ)にアクセスし、起動プログラムを読み込みにいく。この特定領域は、他のデバイスが参照する領域とは異なるため、この際コリジョンは発生しないものと考える。
In step S201, the reader / writer A122 or B123 transmits a wake-up signal, which is a command for returning the tag from the sleep state, to the
ステップS204でリーダライタA122またはB123が、アクセス要求するためのリクエストコマンドを送信する。すると、ステップS205において、ICタグ装置のコントローラー104は、自身のUID等を伝え、これに応答する。その後、ステップS207でリーダライタA122またはB123とICタグ10(コントローラー104)は、通信速度等の条件を相互に交換をする。一方、ICタグ10内のCPU101は、ステップS206において待機を開始する。
In step S204, the reader / writer A122 or B123 transmits a request command for requesting access. Then, in step S205, the
ICタグ10との条件の相互交換により、コマンドを送信する状態に移行すると、リーダライタA122またはB123は、ステップS208でコマンドを送信する。ステップS209で、リーダライタA122またはB123から受信したコマンドやデータに基づき、ICタグ10内のコントローラー104は、ステップS209でメモリアクセスを開始する。ステップS210でメモリアクセスを終了する。その後、ステップS211でCPU101は、待機状態を解消し、ステップS212でメモリアクセスを開始する。
When a transition is made to a state in which a command is transmitted by mutual exchange of conditions with the
本実施の形態においては、CPU101が起動後、待機時間設定(Variable Wait Time)として予め定められた所定時間(T1+T2)待機した後に、ICタグメモリ102にアクセスすることにより、ICタグメモリへの同時書き込みを回避する。ここで、T1は、CPUが待機を開始してからコントローラー104がメモリアクセスを開始するまでの時間であり、T2は、メモリアクセスを開始してからメモリアクセスを終了するまでの時間である。
In the present embodiment, after the
なお、リーダライタの機種によっては、T1は、より短い時間T11であるかもしれないし、また、T2は、より短い時間T22かもしれない。そのようなケースにおいては、実際のメモリアクセス開始からメモリアクセス終了までの時間を待機時間とすると、コリジョンが起こり得る。よって、実際のアクセス開始からアクセス終了までの時間T2より長い時間(T1+T2)を待機時間として予めCPU101側に設定しておくことにより、リーダライタの機種による、ウェイクアップ信号送信後からメモリへのアクセスがなされるまでの時間(T0+T1)の違いを吸収することができる。
Depending on the type of reader / writer, T 1 may be a shorter time T 11 , and T 2 may be a shorter time T 22 . In such a case, if the time from the actual memory access start to the memory access end is the waiting time, a collision may occur. Therefore, a time (T 1 + T 2 ) longer than the time T 2 from the actual start of access to the end of access is set as the standby time in advance in the
[第2実施形態]
図4は、第2実施形態に係るICタグ装置の内部構成を示す構成図である。第1実施形態に係るICタグ装置の内部構成と異なる点は、CPU101にメモリ301を接続させ、Variable Wait Time302を記録する点である。なお、本実施形態においても、ICタグの例を具体例として説明しているが、ICタグにかかわらず、複数の入出力インターフェースを有する共有メモリに対してアクセスするデバイス全般を含む。すなわち、共有メモリに対してアクセスする複数のデバイスのうち、いずれか一方に、Variable Wait Time302で設定された値の間、待機させることでメモリアクセスのコリジョンを回避する。
[Second Embodiment]
FIG. 4 is a configuration diagram showing an internal configuration of the IC tag device according to the second embodiment. The difference from the internal configuration of the IC tag device according to the first embodiment is that a
なお、本実施形態において、第1実施形態と同様の構成については、同様の参照番号を付与するものとする。 In the present embodiment, the same reference numerals are assigned to the same configurations as those in the first embodiment.
図5は、第2実施形態における、Variable Wait Time302に基づき、共有メモリに対してアクセスする複数のデバイスのうち、いずれか一方の動作を待機させる際のフローチャートである。ICタグ10内のCPU101が、ステップS206において待機を開始するまでの動作は、第1実施形態と同じであるので省略する。
FIG. 5 is a flowchart when waiting for the operation of one of a plurality of devices accessing the shared memory based on the variable wait time 302 in the second embodiment. Since the operation until the
CPU101は、メモリ301に記録された、Variable Wait Time302の値を参照し、T1+T2時間の待機を開始する。ステップS211でCPU101が待機を終了し、ステップS212でICタグメモリ102にアクセスを行う。すると、リーダライタA122またはB123から受信する信号に基づく、コントローラー104のアクセスがまだ完了しておらず、コリジョンが発生する。次にCPU101は、ステップS213において、予め定められたリトライ間隔時間(T3)待機した後、メモリアクセスをリトライする。この時点においてもコリジョンが発生する。CPU101は引き続き、ステップS214において、リトライ間隔時間(T3)待機した後、メモリアクセスをリトライする。すると、コントローラー104のアクセスがその時点では完了されているため、コリジョンが発生せず、メモリアクセスが成功する。ステップS215において、CPU101は、待機終了後、リトライ時間(T3+T3)を足して、Variable Wait Time302をT1+T2+T3+T3に更新するべく、メモリ301の内容を書き換える。なお、次回、Variable Wait Time302の設定時間(T1+T2+T3+T3)待機しても、コリジョンが発生する場合は、再びリトライ間隔時間(T3)後にアクセスし、その後、アクセスが成功すれば、Variable Wait Time302をT1+T2+T3+T3+T3に更新する。
The
すなわち、CPU101は、1回のメモリアクセスにおける、最初にコリジョンが発生してからのリトライ回数とリトライ間隔時間(T3)を乗算した時間を、Variable Wait Time302に足すことにより、Variable Wait Time302の新たな値とする。
In other words, the
なお、リトライ間隔時間(T3)の計測開始のタイミングを、CPU101がアクセスを開始した時点としても、コリジョンを検知してメモリアクセスを中断した時点としてもどちらでも良い。例えば、リトライ間隔時間(T3)が1秒であれば、CPU101がアクセスを開始した時点から1秒経過した際、または、CPU101がメモリアクセスを中断した時点から1秒経過した際にリトライをする。
Note that the timing for starting the retry interval time (T 3 ) may be either the time when the
これとは逆の動作として、最初に、CPU101が、待機時間(T1+T2)待機後、ICタグメモリ102にアクセスした時、コリジョンが発生しなければ、Variable Wait Time302をT1+T2に設定する。その後、Variable Wait Time=T1+T2より短い時間、例えば、予め設定された調整時間(例えば、T22)を減じた時間、Variable Wait Time=T1+T2―T22で、メモリ102にアクセスし、コリジョンが起こらなければ、Variable Wait Time302を、T1+T2―T22に再設定する。その繰り返しを行い、最適なVariable Wait Time302を決定する。
As an operation opposite to this, first, when the
本実施形態によれば、共有メモリにアクセスする他方のデバイス(ICタグの例であれば、リーダライタA122またはB123)との通信状況、他方のデバイスの仕様等に準じて、コリジョンを回避するための最適な待ち時間を設定することができる。 According to the present embodiment, in order to avoid collision according to the communication status with the other device accessing the shared memory (in the case of an IC tag, reader / writer A122 or B123), the specification of the other device, and the like. The optimal waiting time can be set.
1 複数の入出力インターフェースを有するメモリ
10 ICタグ
11 入出力インターフェース1
22 入出力インターフェース2
101 CPU
102 ICタグメモリ
104 コントローラー
105 クロック信号生成回路
106 復調回路
107 変調回路
108 整流回路
109 電源回路
110 アンテナ
111 表示装置等その他デバイス
112 アンテナ
113 制御部
122 リーダライタA
123 リーダライタB
301 メモリ
302 Variable Wait Time
1 Memory having a plurality of input /
22 I / O interface 2
101 CPU
102
123 Reader / Writer B
301 Memory 302 Variable Wait Time
Claims (11)
前記共有メモリの前記第1の入出力インターフェースに接続される第1のデバイスと、
前記共有メモリの前記第2の入出力インターフェースに接続される第2のデバイスとを有し、
電力供給がされると、前記第2のデバイスおよび前記第1のデバイスが起動され、その後、前記第2のデバイスおよび前記第1のデバイスが、前記共有メモリへのアクセスを開始する装置において、
前記第1のデバイスおよび前記第2のデバイスが起動した後、待機時間設定としての所定時間だけ前記第1のデバイスを待機させ、前記所定時間の経過後に前記第1のデバイスに前記共有メモリにアクセスさせることにより前記共有メモリへの同時アクセスを回避するアクセス調整手段
を備えたことを特徴とする装置。 A shared memory having a first input / output interface and a second input / output interface;
A first device connected to the first input / output interface of the shared memory;
A second device connected to the second input / output interface of the shared memory,
In the apparatus in which when the power is supplied, the second device and the first device are activated, and then the second device and the first device start access to the shared memory.
After the first device and the second device are activated, the first device waits for a predetermined time as a standby time setting, and the first device accesses the shared memory after the predetermined time has elapsed. An access adjusting means for avoiding simultaneous access to the shared memory.
をさらに備えたことを特徴とする請求項1に記載の装置。 The said 1st device accesses the said shared memory after progress of the said predetermined time, and when the generation | occurrence | production of a collision is detected, the said standby time setting is further updated, The means for updating is further provided. Equipment.
をさらに備えたことを特徴とする請求項1に記載の装置。 When the first device waits for the time specified by the waiting time setting and then accesses the shared memory and detects the occurrence of a collision, the first device waits for a predetermined retry interval time and then waits for the shared memory. And a means for updating the waiting time setting by adding the retry interval time to the waiting time setting when detecting that the access to the shared memory is successful. The apparatus according to claim 1, wherein the apparatus is characterized.
をさらに備えたことを特徴とする請求項1に記載の装置。 After the first device waits for the time specified in the standby time setting and detects that the access to the shared memory is successful by accessing the shared memory, a predetermined time is determined from the standby time setting. The apparatus of claim 1, further comprising means for updating the waiting time setting by subtracting the adjusted time.
をさらに備えたことを特徴とする請求項1に記載の装置。 The access adjusting means multiplies the time specified in the standby time setting by the number of retries after the first collision occurs in a single access to the shared memory and a predetermined retry interval time. The apparatus according to claim 1, further comprising means for updating the waiting time setting by adding the determined times.
前記アクセス調整手段が、前記更新された待機時間設定で指定された時間だけ、前記第1のデバイスを待機させた後に、前記共有メモリへのアクセスを行い前記共有メモリへのアクセスが成功したことを検知すると、再び前記待機時間設定から、前記予め定められた調整時間を減算することにより、前記待機時間設定を更新する手段
をさらに備えたことを特徴とする請求項1に記載の装置。 After the first device waits for a predetermined time as the standby time setting and detects that the access to the shared memory is successful by accessing the shared memory, a predetermined time is set from the standby time setting. Subtract the adjustment time, update the waiting time setting,
The access adjusting means waits for the first device for the time specified in the updated waiting time setting, and then accesses the shared memory and succeeds in accessing the shared memory. The apparatus according to claim 1, further comprising means for updating the waiting time setting by subtracting the predetermined adjustment time from the waiting time setting again when detected.
ことを特徴とする請求項1ないし6いずれか1項に記載の装置。 The apparatus according to any one of claims 1 to 6, wherein the access adjustment unit causes the first device to wait for a time specified by the updated waiting time setting.
第1の入出力インターフェースおよび第2の入出力インターフェースを有するICタグメモリと、
組み込みデバイスと、
前記アンテナを介して前記リーダライタと送受信される信号の読み書きのために、前記ICタグメモリにアクセスするICタグコントローラーと、
前記組み込みデバイスと接続され、前記組み込みデバイスを制御するための制御プログラムおよびデータの読み書きのために、前記ICタグメモリにアクセスするCPUと、
前記リーダライタからのウェイクアップ信号を受信すると、前記ICタグコントローラーと前記CPUとを起動させる起動手段とを有し、
前記ICタグメモリの第1の入出力インターフェースに前記CPUを、第2の入出力インターフェースに前記ICタグコントローラーを接続させたICタグ装置において、
前記起動手段により前記ICタグコントローラーと前記CPUとが起動した後、待機時間設定としての所定時間だけ前記CPUを待機させ、前記所定時間の経過後に、前記CPUに前記ICタグメモリにアクセスさせることにより前記ICタグメモリへの同時アクセスを回避するアクセス調整手段
を備えたことを特徴とする、ICタグ装置。 An antenna for receiving a signal from the reader / writer or transmitting a signal to the reader / writer;
An IC tag memory having a first input / output interface and a second input / output interface;
An embedded device,
An IC tag controller that accesses the IC tag memory for reading and writing signals transmitted to and received from the reader / writer via the antenna;
A CPU connected to the embedded device and accessing the IC tag memory for reading and writing a control program and data for controlling the embedded device;
Upon receiving a wake-up signal from the reader / writer, the IC tag controller and an activation unit for activating the CPU are included.
In the IC tag device in which the CPU is connected to the first input / output interface of the IC tag memory and the IC tag controller is connected to the second input / output interface.
After the IC tag controller and the CPU are activated by the activation means, the CPU is made to wait for a predetermined time as a standby time setting, and after the predetermined time has elapsed, the CPU is made to access the IC tag memory. An IC tag device comprising access adjusting means for avoiding simultaneous access to the IC tag memory.
ことを特徴とする請求項8に記載のICタグ装置。 The access adjustment means, after the CPU waits for the time specified in the waiting time setting, detects the occurrence of collision by accessing the IC tag memory, and after waiting further for a predetermined retry interval time, When the access to the IC tag memory is retried and it is detected that the access to the IC tag memory is successful, the waiting time setting is updated by adding the retry interval time to the waiting time setting. The IC tag device according to claim 8.
ことを特徴とする請求項8に記載のICタグ装置。 After the CPU waits for the time specified in the standby time setting and detects that the access to the IC tag memory is successful, the predetermined time is set from the standby time setting. The IC tag device according to claim 8, wherein the waiting time setting is updated by subtracting an adjustment time.
前記共有メモリの前記第1の入出力インターフェースに接続される第1のデバイスと、
前記共有メモリの前記第2の入出力インターフェースに接続される第2のデバイスとを有し、
電力供給がされると、前記第2のデバイスおよび前記第1のデバイスが起動され、その後、前記第2のデバイスおよび前記第1のデバイスが、前記共有メモリへのアクセスを開始する装置における、前記共有メモリへの同時アクセスを回避する方法であって、
前記第1のデバイスおよび前記第2のデバイスが起動した後、待機時間設定としての所定時間だけ前記第1のデバイスを待機させ、前記所定時間の経過後に前記第1のデバイスに前記共有メモリにアクセスさせること
を備えた方法。 A shared memory having a first input / output interface and a second input / output interface;
A first device connected to the first input / output interface of the shared memory;
A second device connected to the second input / output interface of the shared memory,
When the power is supplied, the second device and the first device are activated, and then the second device and the first device start an access to the shared memory in the apparatus A method of avoiding simultaneous access to shared memory,
After the first device and the second device are activated, the first device waits for a predetermined time as a standby time setting, and the first device accesses the shared memory after the predetermined time has elapsed. A method with letting.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013244350A JP6217344B2 (en) | 2013-11-26 | 2013-11-26 | Method and apparatus for controlling access to shared memory |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013244350A JP6217344B2 (en) | 2013-11-26 | 2013-11-26 | Method and apparatus for controlling access to shared memory |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2015103107A JP2015103107A (en) | 2015-06-04 |
JP6217344B2 true JP6217344B2 (en) | 2017-10-25 |
Family
ID=53378741
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013244350A Active JP6217344B2 (en) | 2013-11-26 | 2013-11-26 | Method and apparatus for controlling access to shared memory |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6217344B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP7137437B2 (en) * | 2018-10-30 | 2022-09-14 | 京セラ株式会社 | RFID tag and RFID tag system |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5541000B2 (en) * | 2010-08-25 | 2014-07-02 | 富士通株式会社 | Wireless communication system, wireless communication method, and wireless communication program |
-
2013
- 2013-11-26 JP JP2013244350A patent/JP6217344B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2015103107A (en) | 2015-06-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4578139B2 (en) | Information processing apparatus, program, storage medium, and method for receiving predetermined information | |
JP4685926B2 (en) | Improved transponder | |
JP6388375B2 (en) | Information processing apparatus and control method thereof | |
US10963654B2 (en) | Electronic device for transmitting data and method for controlling the same | |
US20110256832A1 (en) | Apparatus and method for controlling smart card comprised of multi sensor | |
EP3614570A1 (en) | Near filed communication (nfc) device and system | |
EP2704021A1 (en) | SRAM handshake | |
JP2015023450A (en) | Method and electronic apparatus for short distance radio communication | |
KR100801647B1 (en) | Method and apparatus for providing proper information in mobile communication terminal | |
JP6217344B2 (en) | Method and apparatus for controlling access to shared memory | |
JP2009251916A5 (en) | ||
EP3676936B1 (en) | Electronic apparatus and method for controlling thereof | |
JP5138741B2 (en) | Non-contact wireless tag system, apparatus, and power consumption reduction method | |
JP2003281477A (en) | Electronic appliance, electronic card, and method for card identification | |
JP5433358B2 (en) | Portable electronic device | |
US20160183190A1 (en) | Storage medium having stored communication program, information processing apparatus, communication system, and communication method | |
JP2010066794A (en) | Ic card communication system | |
JP5022972B2 (en) | External communication apparatus and centralized control apparatus for performing wireless communication with information recording medium | |
JP4597022B2 (en) | Wireless communication apparatus and wireless communication method | |
JP5979721B2 (en) | Communication device and program | |
JP2012033019A (en) | Information processor and rfid tag | |
JP5214510B2 (en) | Wireless tag with display | |
JP5541000B2 (en) | Wireless communication system, wireless communication method, and wireless communication program | |
JP2009187495A (en) | Information processing unit, information processing method, and program | |
JP2015184936A (en) | Rfid system, rfid media and information writing/reading device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20161020 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20170731 |
|
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: 20170829 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20170911 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6217344 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |