JP2021071929A - Api call handling system and api call handling program - Google Patents

Api call handling system and api call handling program Download PDF

Info

Publication number
JP2021071929A
JP2021071929A JP2019198265A JP2019198265A JP2021071929A JP 2021071929 A JP2021071929 A JP 2021071929A JP 2019198265 A JP2019198265 A JP 2019198265A JP 2019198265 A JP2019198265 A JP 2019198265A JP 2021071929 A JP2021071929 A JP 2021071929A
Authority
JP
Japan
Prior art keywords
throttling
message
api call
api
queue
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.)
Pending
Application number
JP2019198265A
Other languages
Japanese (ja)
Inventor
武史 新谷
Takeshi Shintani
武史 新谷
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.)
Kyocera Document Solutions Inc
Original Assignee
Kyocera Document Solutions Inc
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 Kyocera Document Solutions Inc filed Critical Kyocera Document Solutions Inc
Priority to JP2019198265A priority Critical patent/JP2021071929A/en
Publication of JP2021071929A publication Critical patent/JP2021071929A/en
Pending legal-status Critical Current

Links

Images

Abstract

To provide a technique for reducing the possibility of interference occurring with operation of an API call handling system itself when use of an API is limited.SOLUTION: In an API call handling system, a front end server 30 comprises a control unit 35 including: a call response unit 35a that returns a response based on data corresponding to an API call; a slot ring execution unit 35b that executes a slot ring on the basis of slot ring information indicating a content of the slot ring as utilization limitation on an API; an API call message enqueue unit 35c that enqueues the API call message into an API call queue for holding the API call message as a message for API call when the API is called; and a slot ring information updating unit 35d that updates the slot ring information based directly or indirectly on API call message held in the API call queue.SELECTED DRAWING: Figure 2

Description

本発明は、API(Application Program Interface)の呼び出しに対する処理を実行するAPI呼び出し処理システムおよびAPI呼び出し処理プログラムに関する。 The present invention relates to an API call processing system and an API call processing program that execute processing for an API (Application Program Interface) call.

従来のAPI呼び出し処理システムとして、短時間に多数のAPIの呼び出しが生じることによってAPI呼び出し処理システム自体の動作に支障が生じることを防止するために、過去のAPIの利用の回数に応じて新たなAPIの利用を制限するものが知られている(例えば、特許文献1、2参照。)。 As a conventional API call processing system, in order to prevent the operation of the API call processing system itself from being hindered by a large number of API calls occurring in a short period of time, new API calls are made according to the number of times the API has been used in the past. Some are known to limit the use of APIs (see, for example, Patent Documents 1 and 2).

特開2015−095056号公報Japanese Unexamined Patent Publication No. 2015-05056 特開2018−097837号公報Japanese Unexamined Patent Publication No. 2018-097837

しかしながら、従来のAPI呼び出し処理システムにおいては、新たなAPIの利用を制限するために、過去のAPIの利用の回数や履歴を管理するテーブルやデータベースにアクセスする必要があるので、これらのテーブルやデータベースに対する負荷が上がり、その結果、API呼び出し処理システム自体の動作に支障が生じるという問題がある。 However, in the conventional API call processing system, in order to limit the use of a new API, it is necessary to access a table or database that manages the number of times and history of past API use. Therefore, these tables and databases As a result, there is a problem that the operation of the API call processing system itself is hindered.

そこで、本発明は、APIの利用を制限する場合にAPI呼び出し処理システム自体の動作に支障が生じる可能性を低減することができるAPI呼び出し処理システムおよびAPI呼び出し処理プログラムを提供することを目的とする。 Therefore, an object of the present invention is to provide an API call processing system and an API call processing program that can reduce the possibility that the operation of the API call processing system itself is hindered when the use of API is restricted. ..

本発明のAPI呼び出し処理システムは、APIの呼び出しに応じたデータに基づいた応答を返す呼び出し応答部と、前記APIの利用の制限であるスロットリングの内容を示すスロットリング情報に基づいて前記スロットリングを実行するスロットリング実行部と、前記APIの呼び出し毎のメッセージであるAPI呼び出しメッセージを保持するためのAPI呼び出しキューと、前記APIが呼び出された場合に前記API呼び出しメッセージを前記API呼び出しキューにエンキューするAPI呼び出しメッセージエンキュー部と、前記API呼び出しキューに保持された前記API呼び出しメッセージに直接または間接的に基づいて前記スロットリング情報を更新するスロットリング情報更新部とを備えることを特徴とする。 The API call processing system of the present invention has a call response unit that returns a response based on data in response to an API call, and the throttling based on throttling information indicating the content of throttling that is a restriction on the use of the API. The throttling execution unit that executes the above, the API call queue for holding the API call message that is the message for each API call, and the API call message are enqueued to the API call queue when the API is called. It is characterized by including an API call message enqueue unit to be used, and a throttling information update unit that updates the throttling information directly or indirectly based on the API call message held in the API call queue.

この構成により、本発明のAPI呼び出し処理システムは、APIが呼び出された場合にAPI呼び出しメッセージをAPI呼び出しキューにエンキューし、API呼び出しキューに保持されたAPI呼び出しメッセージに直接または間接的に基づいてスロットリング情報を更新するので、過去のAPIの利用の回数や履歴を管理するテーブルやデータベースを備える必要がなく、APIの利用を制限する場合にAPI呼び出し処理システム自体の動作に支障が生じる可能性を低減することができる。 With this configuration, the API call processing system of the present invention enqueues an API call message into the API call queue when the API is called, and the slot is directly or indirectly based on the API call message held in the API call queue. Since the ring information is updated, it is not necessary to have a table or database that manages the number of times and history of API usage in the past, and if the API usage is restricted, the operation of the API call processing system itself may be hindered. It can be reduced.

本発明のAPI呼び出し処理システムは、前記スロットリングを指示するメッセージであるスロットリング指示メッセージを保持するためのスロットリング指示キューと、前記スロットリング指示メッセージを前記スロットリング指示キューにエンキューするスロットリング指示メッセージエンキュー部とを備え、前記呼び出し応答部、前記スロットリング実行部、前記API呼び出しメッセージエンキュー部および前記スロットリング情報更新部は、フロントエンドサーバーによって実現され、前記スロットリング指示メッセージエンキュー部は、バックエンドサーバーによって実現され、前記スロットリング指示メッセージエンキュー部は、前記API呼び出しキューに保持された前記API呼び出しメッセージに直接または間接的に基づいて前記スロットリング指示メッセージを生成し、生成した前記スロットリング指示メッセージを前記スロットリング指示キューにエンキューし、前記スロットリング情報更新部は、前記スロットリング指示キューに保持された前記スロットリング指示メッセージに基づいて前記スロットリング情報を更新しても良い。 The API call processing system of the present invention includes a throttling instruction queue for holding a throttling instruction message, which is a message instructing the throttling, and a throttling instruction for encuing the throttling instruction message into the throttling instruction queue. The call response unit, the throttling execution unit, the API call message enqueue unit, and the throttling information update unit are realized by a front-end server, and the throttling instruction message enqueue unit is backed up. The throttling instruction message enqueue unit realized by the end server generates the throttling instruction message directly or indirectly based on the API call message held in the API call queue, and the generated throttling instruction. The message may be enqueued to the throttling instruction queue, and the throttling information update unit may update the throttling information based on the throttling instruction message held in the throttling instruction queue.

この構成により、本発明のAPI呼び出し処理システムは、API呼び出しキューに保持されたAPI呼び出しメッセージに直接または間接的に基づいてバックエンドサーバーがスロットリング指示メッセージを生成し、スロットリング指示メッセージに基づいてフロントエンドサーバーがスロットリング情報を更新するので、API呼び出しキューに保持されたAPI呼び出しメッセージに直接基づいてフロントエンドサーバーがスロットリング情報を更新する場合と比較して、APIの利用を制限するフロントエンドサーバーの負担を軽減することができ、その結果、APIの利用を制限する場合にAPI呼び出し処理システム自体の動作に支障が生じる可能性を低減することができる。 With this configuration, the API call processing system of the present invention allows the backend server to generate a throttling instruction message based directly or indirectly on the API call message held in the API call queue, based on the throttling instruction message. Because the front-end server updates the throttling information, it limits the use of the API compared to when the front-end server updates the throttling information directly based on the API call messages held in the API call queue. The load on the server can be reduced, and as a result, the possibility that the operation of the API call processing system itself is hindered when the use of the API is restricted can be reduced.

本発明のAPI呼び出し処理システムは、前記APIの呼び出しの回数の集計結果を示すメッセージである集計結果メッセージを保持するための集計結果キューと、前記集計結果メッセージを前記集計結果キューにエンキューする集計結果メッセージエンキュー部とを備え、前記集計結果メッセージエンキュー部は、前記バックエンドサーバーによって実現され、前記集計結果メッセージエンキュー部は、前記API呼び出しキューに保持された前記API呼び出しメッセージに基づいて前記集計結果メッセージを生成し、生成した前記集計結果メッセージを前記集計結果キューにエンキューし、前記スロットリング指示メッセージエンキュー部は、前記集計結果キューに保持された前記集計結果メッセージに基づいて前記スロットリング指示メッセージを生成し、生成した前記スロットリング指示メッセージを前記スロットリング指示キューにエンキューし、前記スロットリング指示メッセージエンキュー部が前記スロットリング指示メッセージを生成する間隔は、前記集計結果メッセージエンキュー部が前記集計結果メッセージを生成する間隔より長くても良い。 The API call processing system of the present invention includes an aggregation result queue for holding an aggregation result message, which is a message indicating the aggregation result of the number of times the API is called, and an aggregation result that enqueues the aggregation result message into the aggregation result queue. The aggregation result message enqueue unit is realized by the back-end server, and the aggregation result message enqueue unit includes the aggregation result message based on the API call message held in the API call queue. Is generated, the generated aggregation result message is enqueued to the aggregation result queue, and the throttling instruction message enqueue unit generates the throttling instruction message based on the aggregation result message held in the aggregation result queue. Then, the generated throttling instruction message is enqueued to the throttling instruction queue, and the aggregation result message enqueue unit sets the aggregation result message at intervals at which the throttling instruction message enqueue unit generates the throttling instruction message. It may be longer than the generation interval.

この構成により、本発明のAPI呼び出し処理システムは、API呼び出しキューに保持されたAPI呼び出しメッセージに基づいてバックエンドサーバーが集計結果メッセージを生成し、集計結果メッセージを生成する間隔より長い間隔で、集計結果メッセージに基づいてバックエンドサーバーがスロットリング指示メッセージを生成するので、API呼び出しキューに保持されたAPI呼び出しメッセージに直接基づいてバックエンドサーバーがスロットリング指示メッセージを生成する場合と比較して、バックエンドサーバーに一時的に大きな負荷がかかる可能性を低減することができ、その結果、APIの利用を制限する場合にAPI呼び出し処理システム自体の動作に支障が生じる可能性を低減することができる。 With this configuration, the API call processing system of the present invention aggregates at intervals longer than the interval at which the back-end server generates the aggregation result message based on the API call message held in the API call queue and generates the aggregation result message. The back-end server generates a throttling instruction message based on the result message, so it is back compared to when the back-end server generates a throttling instruction message based directly on the API call message held in the API call queue. It is possible to reduce the possibility that a large load is temporarily applied to the end server, and as a result, it is possible to reduce the possibility that the operation of the API call processing system itself is hindered when the use of API is restricted.

本発明のAPI呼び出し処理プログラムは、APIの呼び出しに応じたデータに基づいた応答を返す呼び出し応答部と、前記APIの利用の制限であるスロットリングの内容を示すスロットリング情報に基づいて前記スロットリングを実行するスロットリング実行部と、前記APIの呼び出し毎のメッセージであるAPI呼び出しメッセージを保持するためのAPI呼び出しキューに、前記API呼び出しメッセージを、前記APIが呼び出された場合にエンキューするAPI呼び出しメッセージエンキュー部と、前記API呼び出しキューに保持された前記API呼び出しメッセージに直接または間接的に基づいて前記スロットリング情報を更新するスロットリング情報更新部とをコンピューターに実現させることを特徴とする。 The API call processing program of the present invention has a call response unit that returns a response based on data in response to an API call, and the throttling information that indicates the content of throttling that is a restriction on the use of the API. API call message that enqueues the API call message when the API is called in the throttling execution unit that executes the API and the API call queue for holding the API call message that is the message for each API call. It is characterized in that a computer realizes an enqueue unit and a throttling information update unit that updates the throttling information directly or indirectly based on the API call message held in the API call queue.

この構成により、本発明のAPI呼び出し処理プログラムを実行するコンピューターは、APIが呼び出された場合にAPI呼び出しメッセージをAPI呼び出しキューにエンキューし、API呼び出しキューに保持されたAPI呼び出しメッセージに直接または間接的に基づいてスロットリング情報を更新するので、過去のAPIの利用の回数や履歴を管理するテーブルやデータベースを備える必要がなく、APIの利用を制限する場合にAPI呼び出し処理システム自体の動作に支障が生じる可能性を低減することができる。 With this configuration, the computer executing the API call processing program of the present invention enqueues the API call message into the API call queue when the API is called, and directly or indirectly to the API call message held in the API call queue. Since the throttling information is updated based on, it is not necessary to have a table or database that manages the number of times and history of API usage in the past, and when restricting API usage, the operation of the API call processing system itself is hindered. The possibility of occurrence can be reduced.

本発明のAPI呼び出し処理システムおよびAPI呼び出し処理プログラムは、APIの利用を制限する場合にAPI呼び出し処理システム自体の動作に支障が生じる可能性を低減することができる。 The API call processing system and the API call processing program of the present invention can reduce the possibility that the operation of the API call processing system itself will be hindered when the use of the API is restricted.

本発明の一実施の形態に係るAPI呼び出し処理システムのブロック図である。It is a block diagram of the API call processing system which concerns on one Embodiment of this invention. 1台のコンピューターによって構成される場合の図1に示すフロントエンドサーバーのブロック図である。It is a block diagram of the front-end server shown in FIG. 1 in the case of being composed of one computer. 図2に示すスロットリング情報の一例を示す図である。It is a figure which shows an example of the throttling information shown in FIG. 1台のコンピューターによって構成される場合の図1に示すバックエンドサーバーのブロック図である。It is a block diagram of the back-end server shown in FIG. 1 in the case of being composed of one computer. 図4に示す実行条件情報の一例を示す図である。It is a figure which shows an example of the execution condition information shown in FIG. 外部からAPIが呼び出された場合の図2に示すフロントエンドサーバーの動作のフローチャートである。It is a flowchart of the operation of the front-end server shown in FIG. 2 when API is called from the outside. 図6に示す動作において生成されるAPI呼び出しメッセージの一例を示す図である。It is a figure which shows an example of the API call message generated in the operation shown in FIG. 特定の時間の間のAPIの呼び出しの回数を集計する場合の図4に示すバックエンドサーバーの動作のフローチャートである。It is a flowchart of the operation of the back-end server shown in FIG. 4 in the case of totaling the number of API calls during a specific time. 図8に示す動作において生成される集計結果メッセージの一例を示す図である。It is a figure which shows an example of the aggregation result message generated in the operation shown in FIG. スロットリング指示メッセージを生成する場合の図4に示すバックエンドサーバーの動作のフローチャートである。It is a flowchart of the operation of the back-end server shown in FIG. 4 in the case of generating a throttling instruction message. 図10に示す動作において生成されるスロットリング指示メッセージの一例を示す図である。It is a figure which shows an example of the throttling instruction message generated in the operation shown in FIG. スロットリング情報を更新する場合の図2に示すフロントエンドサーバーの動作のフローチャートである。It is a flowchart of the operation of the front-end server shown in FIG. 2 when the throttling information is updated.

以下、本発明の実施の形態について、図面を用いて説明する。 Hereinafter, embodiments of the present invention will be described with reference to the drawings.

まず、本発明の一実施の形態に係るAPI呼び出し処理システムの構成について説明する。 First, the configuration of the API call processing system according to the embodiment of the present invention will be described.

図1は、本実施の形態に係るAPI呼び出し処理システム10のブロック図である。 FIG. 1 is a block diagram of the API call processing system 10 according to the present embodiment.

図1に示すように、API呼び出し処理システム10は、データベース20と、外部からのAPIの呼び出しに応じてデータベース20からデータを収集し、収集したデータに基づいた応答を外部に返すフロントエンドサーバー30と、API呼び出し処理システム10の内部で処理を実行するバックエンドサーバー40と、APIの呼び出し毎のメッセージ(以下「API呼び出しメッセージ」という。)を保持するためのAPI呼び出しキュー51と、1分間などの特定の時間の間のAPIの呼び出しの回数の集計結果を示すメッセージ(以下「集計結果メッセージ」という。)を保持するための集計結果キュー52と、APIの利用の制限であるスロットリングを指示するメッセージ(以下「スロットリング指示メッセージ」という。)を保持するためのスロットリング指示キュー53とを備えている。API呼び出し処理システム10は、1台のコンピューターによって構成されても良いし、複数台のコンピューターによって構成されても良い。 As shown in FIG. 1, the API call processing system 10 collects data from the database 20 and the database 20 in response to an API call from the outside, and returns a response based on the collected data to the outside. And the back-end server 40 that executes processing inside the API call processing system 10, the API call queue 51 for holding a message for each API call (hereinafter referred to as "API call message"), 1 minute, etc. Instructs the aggregation result queue 52 for holding the aggregation result indicating the aggregation result of the number of API calls during a specific time (hereinafter referred to as "aggregation result message"), and throttling, which is a restriction on the use of API. It is provided with a throttling instruction queue 53 for holding a message to be sent (hereinafter referred to as “slotting instruction message”). The API call processing system 10 may be configured by one computer or may be configured by a plurality of computers.

API呼び出し処理システム10は、外部から利用されるためのAPIを公開している。API呼び出し処理システム10は、例えば、遠隔地に存在するMFP(Multifunction Peripheral)、プリンター専用機などの画像形成装置から累計印刷枚数、トナーの残量、エラーの発生状況などの各種の情報を取得して、データベース20に記憶するものである。API呼び出し処理システム10は、例えば、画像形成装置の印刷枚数に応じた金額の請求書を作成する外部のシステムからのAPIの呼び出しに応じて画像形成装置の印刷枚数を返したり、画像形成装置のトナーの残量に応じてトナーを発注する外部のシステムからのAPIの呼び出しに応じて画像形成装置のトナーの残量を返したりするものである。 The API call processing system 10 discloses an API to be used from the outside. The API call processing system 10 acquires various information such as the cumulative number of prints, the remaining amount of toner, and the error occurrence status from an image forming apparatus such as an MFP (Multifunction Peripheral) or a dedicated printer that exists in a remote location. It is stored in the database 20. The API call processing system 10 returns, for example, the number of prints of the image forming apparatus in response to an API call from an external system that creates an invoice for the amount of money corresponding to the number of prints of the image forming apparatus, or the image forming apparatus. The remaining amount of toner in the image forming apparatus is returned in response to an API call from an external system that orders toner according to the remaining amount of toner.

図2は、1台のコンピューターによって構成される場合のフロントエンドサーバー30のブロック図である。 FIG. 2 is a block diagram of the front-end server 30 when it is composed of one computer.

図2に示すように、フロントエンドサーバー30は、種々の操作が入力される例えばキーボード、マウスなどの操作デバイスである操作部31と、種々の情報を表示する例えばLCD(Liquid Crystal Display)などの表示デバイスである表示部32と、LAN、インターネットなどのネットワーク経由で、または、ネットワークを介さずに有線または無線によって直接に、外部の装置と通信を行う通信デバイスである通信部33と、各種の情報を記憶する例えば半導体メモリー、HDD(Hard Disk Drive)などの不揮発性の記憶デバイスである記憶部34と、フロントエンドサーバー30全体を制御する制御部35とを備えている。 As shown in FIG. 2, the front-end server 30 includes an operation unit 31 which is an operation device such as a keyboard and a mouse into which various operations are input, and an LCD (Liquid Crystal Display) which displays various information. Various types of display unit 32, which is a display device, and communication unit 33, which is a communication device that directly communicates with an external device via a network such as a LAN or the Internet, or directly by wire or wirelessly without a network. It includes a storage unit 34, which is a non-volatile storage device such as a semiconductor memory or an HDD (Hard Disk Drive) for storing information, and a control unit 35 that controls the entire front-end server 30.

記憶部34は、フロントエンドサーバー30用のプログラムであるフロントエンドサーバー用プログラム34aを記憶している。フロントエンドサーバー用プログラム34aは、例えば、フロントエンドサーバー30の製造段階でフロントエンドサーバー30にインストールされていても良いし、CD(Compact Disk)、DVD(Digital Versatile Disk)、USB(Universal Serial Bus)メモリーなどの外部の記憶媒体からフロントエンドサーバー30に追加でインストールされても良いし、ネットワーク上からフロントエンドサーバー30に追加でインストールされても良い。フロントエンドサーバー用プログラム34aは、本発明のAPI呼び出し処理プログラムの一部を構成している。 The storage unit 34 stores the front-end server program 34a, which is a program for the front-end server 30. The front-end server program 34a may be installed on the front-end server 30 at the manufacturing stage of the front-end server 30, for example, a CD (Compact Disk), a DVD (Digital Versaille Disk), or a USB (Universal Serial Bus). It may be additionally installed on the front-end server 30 from an external storage medium such as a memory, or may be additionally installed on the front-end server 30 from the network. The front-end server program 34a constitutes a part of the API call processing program of the present invention.

記憶部34は、スロットリングの内容を示すスロットリング情報34bを記憶している。 The storage unit 34 stores throttling information 34b indicating the contents of throttling.

図3は、スロットリング情報34bの一例を示す図である。 FIG. 3 is a diagram showing an example of throttling information 34b.

図3に示すように、スロットリング情報34bは、スロットリングの対象であるAPIの呼び出し元の識別情報としてのユーザー名と、スロットリングの対象であるAPIの識別情報としてのAPI名と、スロットリングの実行の期限とを、ユーザー名およびAPI名の組み合わせ毎に示している。 As shown in FIG. 3, the throttling information 34b includes a user name as identification information of the caller of the API that is the target of throttling, an API name as identification information of the API that is the target of throttling, and throttling. The deadline for execution of is shown for each combination of user name and API name.

図2に示す制御部35は、例えば、CPU(Central Processing Unit)と、プログラムおよび各種のデータを記憶しているROM(Read Only Memory)と、制御部35のCPUの作業領域として用いられるメモリーとしてのRAM(Random Access Memory)とを備えている。制御部35のCPUは、記憶部34または制御部35のROMに記憶されているプログラムを実行する。 The control unit 35 shown in FIG. 2 includes, for example, a CPU (Central Processing Unit), a ROM (Read Only Memory) that stores programs and various data, and a memory used as a work area of the CPU of the control unit 35. RAM (Random Access Memory) is provided. The CPU of the control unit 35 executes the program stored in the storage unit 34 or the ROM of the control unit 35.

制御部35は、フロントエンドサーバー用プログラム34aを実行することによって、APIの呼び出しに応じたデータに基づいた応答を返す呼び出し応答部35aと、スロットリングを実行するスロットリング実行部35bと、API呼び出しメッセージをエンキューするAPI呼び出しメッセージエンキュー部35cと、スロットリング情報34bを更新するスロットリング情報更新部35dとを実現する。 The control unit 35 executes the front-end server program 34a to return a response based on the data corresponding to the API call, the call response unit 35a, the throttling execution unit 35b that executes throttling, and the API call. The API call message enqueue unit 35c for enqueuing the message and the throttling information update unit 35d for updating the throttling information 34b are realized.

図4は、1台のコンピューターによって構成される場合のバックエンドサーバー40のブロック図である。 FIG. 4 is a block diagram of the back-end server 40 when it is configured by one computer.

図4に示すように、バックエンドサーバー40は、種々の操作が入力される例えばキーボード、マウスなどの操作デバイスである操作部41と、種々の情報を表示する例えばLCDなどの表示デバイスである表示部42と、LAN、インターネットなどのネットワーク経由で、または、ネットワークを介さずに有線または無線によって直接に、外部の装置と通信を行う通信デバイスである通信部43と、各種の情報を記憶する例えば半導体メモリー、HDDなどの不揮発性の記憶デバイスである記憶部44と、バックエンドサーバー40全体を制御する制御部45とを備えている。 As shown in FIG. 4, the back-end server 40 is an operation unit 41 which is an operation device such as a keyboard and a mouse into which various operations are input, and a display which is a display device such as an LCD which displays various information. For example, the unit 42 stores various information with the communication unit 43, which is a communication device that directly communicates with an external device via a network such as a LAN or the Internet, or directly by wire or wirelessly without a network. It includes a storage unit 44 which is a non-volatile storage device such as a semiconductor memory and an HDD, and a control unit 45 which controls the entire back-end server 40.

記憶部44は、バックエンドサーバー40用のプログラムであるバックエンドサーバー用プログラム44aを記憶している。バックエンドサーバー用プログラム44aは、例えば、バックエンドサーバー40の製造段階でバックエンドサーバー40にインストールされていても良いし、CD、DVD、USBメモリーなどの外部の記憶媒体からバックエンドサーバー40に追加でインストールされても良いし、ネットワーク上からバックエンドサーバー40に追加でインストールされても良い。バックエンドサーバー用プログラム44aは、本発明のAPI呼び出し処理プログラムの一部を構成している。 The storage unit 44 stores the back-end server program 44a, which is a program for the back-end server 40. The back-end server program 44a may be installed on the back-end server 40 at the manufacturing stage of the back-end server 40, or is added to the back-end server 40 from an external storage medium such as a CD, DVD, or USB memory. It may be installed by, or it may be additionally installed on the backend server 40 from the network. The back-end server program 44a constitutes a part of the API call processing program of the present invention.

記憶部44は、スロットリングの実行の条件を示す実行条件情報44bを記憶している。 The storage unit 44 stores the execution condition information 44b indicating the execution condition of throttling.

図5は、実行条件情報44bの一例を示す図である。 FIG. 5 is a diagram showing an example of execution condition information 44b.

図5に示すように、実行条件情報44bは、スロットリングの対象であるAPIの呼び出し元のユーザー名と、スロットリングの対象であるAPIのAPI名と、スロットリングの実行の条件と、スロットリングの実行の期間とを、ユーザー名およびAPI名の組み合わせ毎に示している。スロットリングの実行の条件は、例えば、「呼び出しの回数が5分間で50回を超える」、「呼び出しの回数が10分間で100回を超える」などである。 As shown in FIG. 5, the execution condition information 44b includes the user name of the caller of the API that is the target of throttling, the API name of the API that is the target of throttling, the conditions for executing throttling, and throttling. The execution period of is shown for each combination of user name and API name. The conditions for executing throttling are, for example, "the number of calls exceeds 50 times in 5 minutes", "the number of calls exceeds 100 times in 10 minutes", and the like.

図4に示す制御部45は、例えば、CPUと、プログラムおよび各種のデータを記憶しているROMと、制御部45のCPUの作業領域として用いられるメモリーとしてのRAMとを備えている。制御部45のCPUは、記憶部44または制御部45のROMに記憶されているプログラムを実行する。 The control unit 45 shown in FIG. 4 includes, for example, a CPU, a ROM for storing programs and various data, and a RAM as a memory used as a work area of the CPU of the control unit 45. The CPU of the control unit 45 executes a program stored in the storage unit 44 or the ROM of the control unit 45.

制御部45は、バックエンドサーバー用プログラム44aを実行することによって、集計結果メッセージをエンキューする集計結果メッセージエンキュー部45aと、スロットリング指示メッセージをエンキューするスロットリング指示メッセージエンキュー部45bとを実現する。 By executing the back-end server program 44a, the control unit 45 realizes the aggregation result message enqueue unit 45a that enqueues the aggregation result message and the throttling instruction message enqueue unit 45b that enqueues the throttling instruction message.

次に、API呼び出し処理システム10の動作について説明する。 Next, the operation of the API call processing system 10 will be described.

まず、外部からAPIが呼び出された場合のフロントエンドサーバー30の動作について説明する。 First, the operation of the front-end server 30 when the API is called from the outside will be described.

図6は、外部からAPIが呼び出された場合のフロントエンドサーバー30の動作のフローチャートである。 FIG. 6 is a flowchart of the operation of the front-end server 30 when the API is called from the outside.

フロントエンドサーバー30の制御部35は、外部からAPIが呼び出される度に、図6に示す動作を実行する。 The control unit 35 of the front-end server 30 executes the operation shown in FIG. 6 each time the API is called from the outside.

図6に示すように、制御部35のスロットリング実行部35bは、対象のAPIの呼び出し元が、このAPIに対して、現時点で、スロットリングの対象であるか否かをスロットリング情報34bに基づいて判断する(S101)。 As shown in FIG. 6, the throttling execution unit 35b of the control unit 35 tells the throttling information 34b whether or not the caller of the target API is currently the target of throttling with respect to this API. Judgment is made based on (S101).

スロットリング実行部35bは、対象のAPIの呼び出し元が、このAPIに対して、現時点で、スロットリングの対象であるとS101において判断すると、例えば503エラーを返すなど、スロットリングを実行して(S102)、図6に示す動作を終了する。 When the caller of the target API determines in S101 that the target API is currently the target of throttling, the throttling execution unit 35b executes throttling, for example, returns a 503 error (for example, returns a 503 error). S102), the operation shown in FIG. 6 is terminated.

制御部35のAPI呼び出しメッセージエンキュー部35cは、対象のAPIの呼び出し元が、このAPIに対して、現時点で、スロットリングの対象ではないとS101において判断されると、今回のAPIの呼び出しに関するAPI呼び出しメッセージを生成する(S103)。 When the API call message enqueue unit 35c of the control unit 35 determines in S101 that the caller of the target API is not the target of throttling with respect to this API at the present time, the API regarding the current API call Generate a call message (S103).

図7は、図6に示す動作において生成されるAPI呼び出しメッセージの一例を示す図である。 FIG. 7 is a diagram showing an example of an API call message generated in the operation shown in FIG.

図7に示すように、API呼び出しメッセージは、対象のAPIの呼び出しの時刻を示す「timeStamp」と、対象のAPIの呼び出し元のユーザー名を示す「userName」と、対象のAPIのAPI名を示す「apiName」とを含んでいる。図7に示す例では、「timeStamp」、「userName」、「apiName」のそれぞれの値は、「2019/09/10 20:00:10」、「User 1」、「API A」である。 As shown in FIG. 7, the API call message indicates "timeStamp" indicating the time when the target API is called, "userName" indicating the user name of the caller of the target API, and the API name of the target API. Includes "apiName". In the example shown in FIG. 7, the respective values of "timeStamp", "userName", and "apiName" are "2019/09/10 20:00:10", "User 1", and "API A".

図6に示すように、制御部35のAPI呼び出しメッセージエンキュー部35cは、S103の処理の後、S103において生成したAPI呼び出しメッセージをAPI呼び出しキュー51にエンキューする(S104)。 As shown in FIG. 6, the API call message enqueue unit 35c of the control unit 35 enqueues the API call message generated in S103 into the API call queue 51 after the processing of S103 (S104).

次いで、制御部35の呼び出し応答部35aは、今回のAPIの呼び出しに応じてデータベース20からデータを収集する(S105)。 Next, the call response unit 35a of the control unit 35 collects data from the database 20 in response to the current API call (S105).

次いで、呼び出し応答部35aは、S105において収集したデータに基づいた応答を、今回のAPIの呼び出し元に返して(S106)、図6に示す動作を終了する。 Next, the call response unit 35a returns the response based on the data collected in S105 to the caller of the API this time (S106), and ends the operation shown in FIG.

次に、特定の時間の間のAPIの呼び出しの回数を集計する場合のバックエンドサーバー40の動作について説明する。 Next, the operation of the back-end server 40 when counting the number of API calls during a specific time will be described.

図8は、特定の時間の間のAPIの呼び出しの回数を集計する場合のバックエンドサーバー40の動作のフローチャートである。 FIG. 8 is a flowchart of the operation of the back-end server 40 when the number of API calls during a specific time is totaled.

バックエンドサーバー40の制御部45は、例えば1分毎など、特定の時間毎に図8に示す動作を実行する。 The control unit 45 of the back-end server 40 executes the operation shown in FIG. 8 at specific time intervals, for example, every minute.

図8に示すように、制御部45の集計結果メッセージエンキュー部45aは、API呼び出しキュー51からのAPI呼び出しメッセージのデキューを試みる(S121)。 As shown in FIG. 8, the aggregation result message enqueue unit 45a of the control unit 45 attempts to dequeue the API call message from the API call queue 51 (S121).

次いで、集計結果メッセージエンキュー部45aは、S121における試みの結果、API呼び出しキュー51からAPI呼び出しメッセージをデキューしたか否かを判断する(S122)。 Next, the aggregation result message enqueue unit 45a determines whether or not the API call message has been dequeued from the API call queue 51 as a result of the attempt in S121 (S122).

集計結果メッセージエンキュー部45aは、API呼び出しキュー51からAPI呼び出しメッセージをデキューしたとS122において判断すると、S121においてデキューしたAPI呼び出しメッセージに基づいて、APIの呼び出しの回数を、ユーザー名およびAPI名の組み合わせ毎に集計する(S123)。 When the aggregation result message enqueue unit 45a determines in S122 that the API call message has been dequeued from the API call queue 51, the number of API calls is determined by combining the user name and the API name based on the API call message dequeued in S121. Aggregate for each (S123).

次いで、集計結果メッセージエンキュー部45aは、S123における集計の結果を示す集計結果メッセージを、ユーザー名およびAPI名の組み合わせ毎に生成する(S124)。 Next, the aggregation result message enqueue unit 45a generates an aggregation result message indicating the aggregation result in S123 for each combination of the user name and the API name (S124).

図9は、図8に示す動作において生成される集計結果メッセージの一例を示す図である。 FIG. 9 is a diagram showing an example of an aggregation result message generated in the operation shown in FIG.

図9に示すように、集計結果メッセージは、対象のAPIの呼び出しの回数の集計の開始時刻を示す「timeStamp」と、対象のAPIの呼び出し元のユーザー名を示す「userName」と、対象のAPIのAPI名を示す「apiName」と、対象のAPIの呼び出しの回数を示す「count」とを含んでいる。図9に示す例では、「timeStamp」、「userName」、「apiName」、「count」のそれぞれの値は、「2019/09/10 20:00」、「User 1」、「API A」、「80」である。すなわち、図9に示す例では、「2019/09/10 20:00」以降の1分間の間に、API名「API A」のAPIがユーザー名「User 1」の読み出し元から「80」回呼び出されたことを示している。 As shown in FIG. 9, the aggregation result message includes "timeStamp" indicating the aggregation start time of the number of calls of the target API, "userName" indicating the user name of the caller of the target API, and the target API. It includes "apiName" indicating the API name of the target API and "count" indicating the number of calls of the target API. In the example shown in FIG. 9, the respective values of "timeStamp", "userName", "apiName", and "count" are "2019/09/10 20:00", "User 1", "API A", and " 80 ". That is, in the example shown in FIG. 9, the API of the API name “API A” is “80” times from the reading source of the user name “User 1” during one minute after “2019/09/10 20:00”. Indicates that it has been called.

図8に示すように、集計結果メッセージエンキュー部45aは、S124の処理の後、S124において生成した集計結果メッセージを集計結果キュー52にエンキューする(S125)。 As shown in FIG. 8, the aggregation result message enqueue unit 45a enqueues the aggregation result message generated in S124 into the aggregation result queue 52 after the processing of S124 (S125).

集計結果メッセージエンキュー部45aは、API呼び出しキュー51からAPI呼び出しメッセージをデキューしなかったとS122において判断するか、S125の処理を実行すると、図8に示す動作を終了する。 When the aggregation result message enqueue unit 45a determines in S122 that the API call message has not been dequeued from the API call queue 51 or executes the process of S125, the operation shown in FIG. 8 ends.

次に、スロットリング指示メッセージを生成する場合のバックエンドサーバー40の動作について説明する。 Next, the operation of the back-end server 40 when generating the throttling instruction message will be described.

図10は、スロットリング指示メッセージを生成する場合のバックエンドサーバー40の動作のフローチャートである。 FIG. 10 is a flowchart of the operation of the back-end server 40 when generating a throttling instruction message.

バックエンドサーバー40の制御部45は、例えば5分毎など、特定の時間毎に図10に示す動作を実行する。なお、図10に示す動作の実行の間隔は、図8に示す動作の実行の間隔より長い。 The control unit 45 of the back-end server 40 executes the operation shown in FIG. 10 at specific time intervals, for example, every 5 minutes. The execution interval of the operation shown in FIG. 10 is longer than the execution interval of the operation shown in FIG.

図10に示すように、制御部45のスロットリング指示メッセージエンキュー部45bは、集計結果キュー52からの集計結果メッセージのデキューを試みる(S141)。 As shown in FIG. 10, the throttling instruction message enqueue unit 45b of the control unit 45 attempts to dequeue the aggregation result message from the aggregation result queue 52 (S141).

次いで、スロットリング指示メッセージエンキュー部45bは、S141における試みの結果、集計結果キュー52から集計結果メッセージをデキューしたか否かを判断する(S142)。 Next, the throttling instruction message enqueue unit 45b determines whether or not the aggregation result message has been dequeued from the aggregation result queue 52 as a result of the attempt in S141 (S142).

スロットリング指示メッセージエンキュー部45bは、集計結果キュー52から集計結果メッセージをデキューしたとS142において判断すると、S141においてデキューした集計結果メッセージに基づいて、APIの呼び出しの回数を、ユーザー名およびAPI名の組み合わせ毎に集計する(S143)。 When the throttling instruction message enqueue unit 45b determines in S142 that the aggregation result message has been dequeued from the aggregation result queue 52, the number of API calls is determined by the user name and the API name based on the aggregation result message dequeued in S141. Aggregate for each combination (S143).

次いで、スロットリング指示メッセージエンキュー部45bは、今回の図10に示す動作において未だ対象にしていない、ユーザー名およびAPI名の組み合わせの1つのみを対象にする(S144)。 Next, the throttling instruction message enqueue unit 45b targets only one combination of the user name and the API name, which has not yet been targeted in the operation shown in FIG. 10 this time (S144).

次いで、スロットリング指示メッセージエンキュー部45bは、S143において集計した回数が実行条件情報44bに示される、スロットリングの実行の条件を満たすか否かを、現在の対象の組み合わせに関して判断する(S145)。 Next, the throttling instruction message enqueue unit 45b determines whether or not the number of times aggregated in S143 satisfies the condition of execution of throttling indicated in the execution condition information 44b with respect to the current target combination (S145).

スロットリング指示メッセージエンキュー部45bは、スロットリングの実行の条件を満たすとS145において判断すると、現在の対象の組み合わせに対するスロットリング指示メッセージを生成する(S146)。 When the throttling instruction message enqueue unit 45b determines in S145 that the condition for executing throttling is satisfied, it generates a throttling instruction message for the current target combination (S146).

図11は、図10に示す動作において生成されるスロットリング指示メッセージの一例を示す図である。 FIG. 11 is a diagram showing an example of a throttling instruction message generated in the operation shown in FIG.

図11に示すように、スロットリング指示メッセージは、対象のAPIの呼び出し元のユーザー名を示す「userName」と、対象のAPIのAPI名を示す「apiName」と、スロットリングの実行の期限を示す「timeStamp」とを含んでいる。図11に示す例では、「userName」、「apiName」、「timeStamp」のそれぞれの値は、「User 1」、「API A」、「2019/09/10 21:05:00」である。すなわち、図11に示す例では、「2019/09/10 21:05:00」まで、ユーザー名「User 1」の読み出し元からのAPI名「API A」のAPIの呼び出しをスロットリングする指示を示している。ここで、スロットリング指示メッセージエンキュー部45bは、現在の対象の組み合わせに関して実行条件情報44bに示される、スロットリングの実行の期間を、現在の日時に加算することによって、スロットリングの実行の期限を算出する。 As shown in FIG. 11, the throttling instruction message indicates "userName" indicating the user name of the caller of the target API, "apiName" indicating the API name of the target API, and the deadline for executing throttling. Includes "timeStamp". In the example shown in FIG. 11, the respective values of "userName", "apiName", and "timeStamp" are "User 1", "API A", and "2019/09/10 21:05: 00". That is, in the example shown in FIG. 11, the instruction for throttling the API call of the API name "API A" from the reading source of the user name "User 1" is instructed until "2019/09/10 21:05: 00". Shown. Here, the throttling instruction message enqueue unit 45b sets the deadline for throttling execution by adding the throttling execution period shown in the execution condition information 44b with respect to the current target combination to the current date and time. calculate.

図10に示すように、スロットリング指示メッセージエンキュー部45bは、S146の処理の後、S146において生成したスロットリング指示メッセージをスロットリング指示キュー53にエンキューする(S147)。 As shown in FIG. 10, the throttling instruction message enqueue unit 45b enqueues the throttling instruction message generated in S146 into the throttling instruction queue 53 after the processing of S146 (S147).

制御部45の集計結果メッセージエンキュー部45aは、スロットリングの実行の条件を満たさないとS145において判断されるか、S147の処理が終了すると、S141において集計結果キュー52からデキューした、現在の対象の組み合わせの集計結果メッセージのうち、集計結果キュー52に再度エンキューする必要がある集計結果メッセージが存在するか否かを、現在の対象の組み合わせに関して実行条件情報44bに示される、スロットリングの実行の条件に基づいて判断する(S148)。具体的には、集計結果メッセージエンキュー部45aは、図10に示す動作の実行の間隔が、現在の対象の組み合わせに関して実行条件情報44bに示される、スロットリングの実行の条件における対象の期間(以下「実行条件期間」という。)より短い場合、次回の図10に示す動作の実行の予定時刻から実行条件期間前までの「timeStamp」を含む集計結果メッセージを、集計結果キュー52に再度エンキューする必要があると判断する。例えば、図10に示す動作の実行の間隔が5分であり、実行条件期間が10分である場合、集計結果メッセージエンキュー部45aは、次回の図10に示す動作の実行の予定時刻から10分前までの「timeStamp」を含む集計結果メッセージを、集計結果キュー52に再度エンキューする必要があると判断する。 The aggregation result message enqueue unit 45a of the control unit 45 is determined in S145 that the condition for executing throttling is not satisfied, or when the processing of S147 is completed, it is dequeued from the aggregation result queue 52 in S141, and is the current target. Among the aggregation result messages of the combination, whether or not there is an aggregation result message that needs to be re-queued to the aggregation result queue 52 is indicated in the execution condition information 44b for the current target combination. Judgment is made based on (S148). Specifically, in the aggregation result message enqueue unit 45a, the execution interval of the operation shown in FIG. 10 is the target period under the execution condition of throttling, which is shown in the execution condition information 44b with respect to the current target combination (hereinafter, If it is shorter than the "execution condition period"), it is necessary to re-enqueue the aggregation result message including "timeStamp" from the scheduled execution time of the next operation shown in FIG. 10 to before the execution condition period in the aggregation result queue 52. Judge that there is. For example, when the execution interval of the operation shown in FIG. 10 is 5 minutes and the execution condition period is 10 minutes, the aggregation result message enqueue unit 45a is 10 minutes from the scheduled execution time of the next operation shown in FIG. It is determined that the aggregation result message including the previous "timeStamp" needs to be requeued to the aggregation result queue 52.

集計結果メッセージエンキュー部45aは、S141において集計結果キュー52からデキューした、現在の対象の組み合わせの集計結果メッセージのうち、集計結果キュー52に再度エンキューする必要がある集計結果メッセージが存在するとS148において判断すると、S141において集計結果キュー52からデキューした、現在の対象の組み合わせの集計結果メッセージのうち、集計結果キュー52に再度エンキューする必要がある集計結果メッセージを、集計結果キュー52に再度エンキューする(S149)。 The aggregation result message enqueue unit 45a determines in S148 that among the aggregation result messages of the current target combination dequeued from the aggregation result queue 52 in S141, there is an aggregation result message that needs to be enqueued again in the aggregation result queue 52. Then, among the aggregation result messages of the current target combination dequeued from the aggregation result queue 52 in S141, the aggregation result message that needs to be requeued to the aggregation result queue 52 is requeued to the aggregation result queue 52 (S149). ).

制御部45のスロットリング指示メッセージエンキュー部45bは、S141において集計結果キュー52からデキューした、現在の対象の組み合わせの集計結果メッセージのうち、集計結果キュー52に再度エンキューする必要がある集計結果メッセージが存在しないとS148において判断するか、S149の処理が終了すると、今回の図10に示す動作において未だ対象にしていない、ユーザー名およびAPI名の組み合わせが存在するか否かを判断する(S150)。 The throttling instruction message enqueue unit 45b of the control unit 45 has a total result message that needs to be requeued to the total result queue 52 among the total result messages of the current target combination dequeued from the total result queue 52 in S141. It is determined in S148 that it does not exist, or when the process of S149 is completed, it is determined whether or not there is a combination of the user name and the API name that has not yet been targeted in the operation shown in FIG. 10 this time (S150).

スロットリング指示メッセージエンキュー部45bは、今回の図10に示す動作において未だ対象にしていない、ユーザー名およびAPI名の組み合わせが存在するとS150において判断すると、S144の処理を実行する。 When the throttling instruction message enqueue unit 45b determines in S150 that there is a combination of a user name and an API name that has not yet been targeted in the operation shown in FIG. 10 this time, it executes the process of S144.

スロットリング指示メッセージエンキュー部45bは、集計結果キュー52から集計結果メッセージをデキューしなかったとS142において判断するか、今回の図10に示す動作において未だ対象にしていない、ユーザー名およびAPI名の組み合わせが存在しないとS150において判断すると、図10に示す動作を終了する。 The throttling instruction message enqueue unit 45b determines in S142 that the aggregation result message has not been dequeued from the aggregation result queue 52, or a combination of a user name and an API name that has not yet been targeted in the operation shown in FIG. If it is determined in S150 that it does not exist, the operation shown in FIG. 10 ends.

次に、スロットリング情報34bを更新する場合のフロントエンドサーバー30の動作について説明する。 Next, the operation of the front-end server 30 when updating the throttling information 34b will be described.

図12は、スロットリング情報34bを更新する場合のフロントエンドサーバー30の動作のフローチャートである。 FIG. 12 is a flowchart of the operation of the front-end server 30 when the throttling information 34b is updated.

フロントエンドサーバー30の制御部35は、例えば5分毎など、特定の時間毎に図12に示す動作を実行する。 The control unit 35 of the front-end server 30 executes the operation shown in FIG. 12 at specific time intervals, for example, every 5 minutes.

図12に示すように、制御部35のスロットリング情報更新部35dは、スロットリング指示キュー53からのスロットリング指示メッセージのデキューを試みる(S161)。 As shown in FIG. 12, the throttling information updating unit 35d of the control unit 35 attempts to dequeue the throttling instruction message from the throttling instruction queue 53 (S161).

次いで、スロットリング情報更新部35dは、S161における試みの結果、スロットリング指示キュー53からスロットリング指示メッセージをデキューしたか否かを判断する(S162)。 Next, the throttling information update unit 35d determines whether or not the throttling instruction message has been dequeued from the throttling instruction queue 53 as a result of the attempt in S161 (S162).

スロットリング情報更新部35dは、スロットリング指示キュー53からスロットリング指示メッセージをデキューしたとS162において判断すると、S161においてデキューしたスロットリング指示メッセージに基づいてスロットリング情報34bを更新する(S163)。 When the throttling information updating unit 35d determines in S162 that the throttling instruction message has been dequeued from the throttling instruction queue 53, the throttling information updating unit 35d updates the throttling information 34b based on the throttling instruction message dequeued in S161 (S163).

スロットリング情報更新部35dは、スロットリング指示キュー53からスロットリング指示メッセージをデキューしなかったとS162において判断するか、S163の処理を終了すると、図12に示す動作を終了する。 When the throttling information update unit 35d determines in S162 that the throttling instruction message has not been dequeued from the throttling instruction queue 53, or ends the process of S163, the operation shown in FIG. 12 ends.

以上に説明したように、API呼び出し処理システム10は、APIが呼び出された場合にAPI呼び出しメッセージをAPI呼び出しキュー51にエンキューし(S104)、API呼び出しキュー51に保持されたAPI呼び出しメッセージに間接的に基づいてスロットリング情報34bを更新する(S163)ので、過去のAPIの利用の回数や履歴を管理するテーブルやデータベースを備える必要がなく、APIの利用を制限する場合にAPI呼び出し処理システム10自体の動作に支障が生じる可能性を低減することができる。 As described above, the API call processing system 10 enqueues the API call message into the API call queue 51 (S104) when the API is called, and indirectly to the API call message held in the API call queue 51. Since the throttling information 34b is updated based on (S163), it is not necessary to provide a table or database for managing the number of times and history of API usage in the past, and the API call processing system 10 itself is used when restricting API usage. It is possible to reduce the possibility of interfering with the operation of.

API呼び出し処理システム10は、API呼び出しキュー51に保持されたAPI呼び出しメッセージに間接的に基づいてバックエンドサーバー40がスロットリング指示メッセージを生成し(S146)、スロットリング指示メッセージに基づいてフロントエンドサーバー30がスロットリング情報34bを更新する(S163)ので、API呼び出しキュー51に保持されたAPI呼び出しメッセージに直接基づいてフロントエンドサーバー30がスロットリング情報34bを更新する場合と比較して、APIの利用を制限するフロントエンドサーバー30の負担を軽減することができ、その結果、APIの利用を制限する場合にAPI呼び出し処理システム10自体の動作に支障が生じる可能性を低減することができる。 In the API call processing system 10, the back-end server 40 generates a throttling instruction message indirectly based on the API call message held in the API call queue 51 (S146), and the front-end server is based on the throttling instruction message. Since 30 updates the throttling information 34b (S163), the use of the API is compared with the case where the front-end server 30 updates the throttling information 34b directly based on the API call message held in the API call queue 51. It is possible to reduce the load on the front-end server 30 that limits the number of API calls, and as a result, it is possible to reduce the possibility that the operation of the API call processing system 10 itself will be hindered when the use of the API is restricted.

API呼び出し処理システム10は、API呼び出しキュー51に保持されたAPI呼び出しメッセージに基づいてバックエンドサーバー40が集計結果メッセージを生成し(S124)、集計結果メッセージを生成する間隔より長い間隔で、集計結果メッセージに基づいてバックエンドサーバー40がスロットリング指示メッセージを生成する(S146)ので、API呼び出しキュー51に保持されたAPI呼び出しメッセージに直接基づいてバックエンドサーバー40がスロットリング指示メッセージを生成する場合と比較して、バックエンドサーバー40に一時的に大きな負荷がかかる可能性を低減することができ、その結果、APIの利用を制限する場合にAPI呼び出し処理システム10自体の動作に支障が生じる可能性を低減することができる。 In the API call processing system 10, the back-end server 40 generates an aggregation result message based on the API call message held in the API call queue 51 (S124), and the aggregation result is at an interval longer than the interval for generating the aggregation result message. Since the back-end server 40 generates a throttling instruction message based on the message (S146), there is a case where the back-end server 40 generates a throttling instruction message directly based on the API call message held in the API call queue 51. In comparison, the possibility that the back-end server 40 is temporarily heavily loaded can be reduced, and as a result, the operation of the API call processing system 10 itself may be hindered when the use of the API is restricted. Can be reduced.

バックエンドサーバー40は、本実施の形態において、API呼び出しキュー51に保持されたAPI呼び出しメッセージに基づいて集計結果メッセージを生成し(S124)、集計結果キュー52に保持された集計結果メッセージに基づいてスロットリング指示メッセージを生成する(S146)。すなわち、バックエンドサーバー40は、本実施の形態において、API呼び出しキュー51に保持されたAPI呼び出しメッセージに間接的に基づいてスロットリング指示メッセージを生成する。しかしながら、バックエンドサーバー40は、API呼び出しキュー51に保持されたAPI呼び出しメッセージに直接基づいてスロットリング指示メッセージを生成しても良い。 In the present embodiment, the back-end server 40 generates an aggregation result message based on the API call message held in the API call queue 51 (S124), and based on the aggregation result message held in the aggregation result queue 52. Generate a throttling instruction message (S146). That is, in the present embodiment, the back-end server 40 generates a throttling instruction message indirectly based on the API call message held in the API call queue 51. However, the backend server 40 may generate a throttling instruction message based directly on the API call message held in the API call queue 51.

API呼び出し処理システム10は、本実施の形態において、API呼び出しキュー51に保持されたAPI呼び出しメッセージに基づいてバックエンドサーバー40が集計結果メッセージを生成し(S124)、集計結果キュー52に保持された集計結果メッセージに基づいてバックエンドサーバー40がスロットリング指示メッセージを生成し(S146)、スロットリング指示キュー53に保持されたスロットリング指示メッセージに基づいてフロントエンドサーバー30がスロットリング情報34bを更新する(S163)。すなわち、API呼び出し処理システム10は、本実施の形態において、API呼び出しキュー51に保持されたAPI呼び出しメッセージに間接的に基づいてスロットリング情報34bを更新する。しかしながら、API呼び出し処理システム10は、API呼び出しキュー51に保持されたAPI呼び出しメッセージに直接基づいてスロットリング情報34bを更新しても良い。すなわち、API呼び出し処理システム10は、API呼び出しキュー51に保持されたAPI呼び出しメッセージと、実行条件情報とに基づいてフロントエンドサーバー30がスロットリング情報34bを更新しても良い。 In the API call processing system 10, in the present embodiment, the back-end server 40 generates an aggregation result message based on the API call message held in the API call queue 51 (S124), and the API call processing system 10 is held in the aggregation result queue 52. The back-end server 40 generates a throttling instruction message based on the aggregation result message (S146), and the front-end server 30 updates the throttling information 34b based on the throttling instruction message held in the throttling instruction queue 53. (S163). That is, in the present embodiment, the API call processing system 10 updates the throttling information 34b indirectly based on the API call message held in the API call queue 51. However, the API call processing system 10 may update the throttling information 34b directly based on the API call message held in the API call queue 51. That is, in the API call processing system 10, the front-end server 30 may update the throttling information 34b based on the API call message held in the API call queue 51 and the execution condition information.

APIの呼び出し元の識別情報は、本実施の形態において、ユーザー名であるが、例えばIP(Internet Protocol)アドレスなど、ユーザー名以外の識別情報でも良い。 In the present embodiment, the identification information of the caller of the API is a user name, but identification information other than the user name such as an IP (Internet Protocol) address may be used.

10 API呼び出し処理システム
30 フロントエンドサーバー
34a フロントエンドサーバー用プログラム(API呼び出し処理プログラムの一部)
34b スロットリング情報
35a 呼び出し応答部
35b スロットリング実行部
35c API呼び出しメッセージエンキュー部
35d スロットリング情報更新部
40 バックエンドサーバー
44a バックエンドサーバー用プログラム(API呼び出し処理プログラムの一部)
45a 集計結果メッセージエンキュー部
45b スロットリング指示メッセージエンキュー部
51 API呼び出しキュー
52 集計結果キュー
53 スロットリング指示キュー
10 API call processing system 30 Front-end server 34a Front-end server program (part of API call processing program)
34b Throttling information 35a Call response unit 35b Throttling execution unit 35c API call message enqueue unit 35d Throttling information update unit 40 Back-end server 44a Back-end server program (part of API call processing program)
45a Aggregation result message enqueue section 45b Throttling instruction message enqueue section 51 API call queue 52 Aggregation result queue 53 Throttling instruction queue

Claims (4)

APIの呼び出しに応じたデータに基づいた応答を返す呼び出し応答部と、
前記APIの利用の制限であるスロットリングの内容を示すスロットリング情報に基づいて前記スロットリングを実行するスロットリング実行部と、
前記APIの呼び出し毎のメッセージであるAPI呼び出しメッセージを保持するためのAPI呼び出しキューと、
前記APIが呼び出された場合に前記API呼び出しメッセージを前記API呼び出しキューにエンキューするAPI呼び出しメッセージエンキュー部と、
前記API呼び出しキューに保持された前記API呼び出しメッセージに直接または間接的に基づいて前記スロットリング情報を更新するスロットリング情報更新部と
を備えることを特徴とするAPI呼び出し処理システム。
A call response unit that returns a response based on the data corresponding to the API call, and
A throttling execution unit that executes the throttling based on the throttling information indicating the contents of the throttling that is a restriction on the use of the API, and
An API call queue for holding an API call message, which is a message for each API call, and
An API call message enqueue unit that enqueues the API call message to the API call queue when the API is called, and
An API call processing system including a throttling information update unit that updates the throttling information directly or indirectly based on the API call message held in the API call queue.
前記スロットリングを指示するメッセージであるスロットリング指示メッセージを保持するためのスロットリング指示キューと、
前記スロットリング指示メッセージを前記スロットリング指示キューにエンキューするスロットリング指示メッセージエンキュー部と
を備え、
前記呼び出し応答部、前記スロットリング実行部、前記API呼び出しメッセージエンキュー部および前記スロットリング情報更新部は、フロントエンドサーバーによって実現され、
前記スロットリング指示メッセージエンキュー部は、バックエンドサーバーによって実現され、
前記スロットリング指示メッセージエンキュー部は、前記API呼び出しキューに保持された前記API呼び出しメッセージに直接または間接的に基づいて前記スロットリング指示メッセージを生成し、生成した前記スロットリング指示メッセージを前記スロットリング指示キューにエンキューし、
前記スロットリング情報更新部は、前記スロットリング指示キューに保持された前記スロットリング指示メッセージに基づいて前記スロットリング情報を更新することを特徴とする請求項1に記載のAPI呼び出し処理システム。
A throttling instruction queue for holding the throttling instruction message, which is a message instructing throttling, and
It is provided with a throttling instruction message enqueue unit that enqueues the throttling instruction message into the throttling instruction queue.
The call response unit, the throttling execution unit, the API call message enqueue unit, and the throttling information update unit are realized by a front-end server.
The throttling instruction message enqueue unit is realized by the back-end server.
The throttling instruction message enqueue unit generates the throttling instruction message directly or indirectly based on the API call message held in the API call queue, and the generated throttling instruction message is used as the throttling instruction. Enqueue to the queue,
The API call processing system according to claim 1, wherein the throttling information updating unit updates the throttling information based on the throttling instruction message held in the throttling instruction queue.
前記APIの呼び出しの回数の集計結果を示すメッセージである集計結果メッセージを保持するための集計結果キューと、
前記集計結果メッセージを前記集計結果キューにエンキューする集計結果メッセージエンキュー部と
を備え、
前記集計結果メッセージエンキュー部は、前記バックエンドサーバーによって実現され、
前記集計結果メッセージエンキュー部は、前記API呼び出しキューに保持された前記API呼び出しメッセージに基づいて前記集計結果メッセージを生成し、生成した前記集計結果メッセージを前記集計結果キューにエンキューし、
前記スロットリング指示メッセージエンキュー部は、前記集計結果キューに保持された前記集計結果メッセージに基づいて前記スロットリング指示メッセージを生成し、生成した前記スロットリング指示メッセージを前記スロットリング指示キューにエンキューし、
前記スロットリング指示メッセージエンキュー部が前記スロットリング指示メッセージを生成する間隔は、前記集計結果メッセージエンキュー部が前記集計結果メッセージを生成する間隔より長いことを特徴とする請求項2に記載のAPI呼び出し処理システム。
An aggregation result queue for holding an aggregation result message, which is a message indicating the aggregation result of the number of API calls, and
It is provided with an aggregation result message enqueue unit that enqueues the aggregation result message into the aggregation result queue.
The aggregation result message enqueue unit is realized by the back-end server.
The aggregation result message enqueue unit generates the aggregation result message based on the API call message held in the API call queue, and enqueues the generated aggregation result message into the aggregation result queue.
The throttling instruction message enqueue unit generates the throttling instruction message based on the aggregation result message held in the aggregation result queue, enqueues the generated throttling instruction message to the throttling instruction queue, and then enqueues the generated throttling instruction message into the throttling instruction queue.
The API call process according to claim 2, wherein the interval at which the throttling instruction message enqueue unit generates the throttling instruction message is longer than the interval at which the aggregation result message enqueue unit generates the aggregation result message. system.
APIの呼び出しに応じたデータに基づいた応答を返す呼び出し応答部と、
前記APIの利用の制限であるスロットリングの内容を示すスロットリング情報に基づいて前記スロットリングを実行するスロットリング実行部と、
前記APIの呼び出し毎のメッセージであるAPI呼び出しメッセージを保持するためのAPI呼び出しキューに、前記API呼び出しメッセージを、前記APIが呼び出された場合にエンキューするAPI呼び出しメッセージエンキュー部と、
前記API呼び出しキューに保持された前記API呼び出しメッセージに直接または間接的に基づいて前記スロットリング情報を更新するスロットリング情報更新部と
をコンピューターに実現させることを特徴とするAPI呼び出し処理プログラム。
A call response unit that returns a response based on the data corresponding to the API call, and
A throttling execution unit that executes the throttling based on the throttling information indicating the throttling content that is a restriction on the use of the API, and a throttling execution unit.
In the API call queue for holding the API call message, which is a message for each API call, the API call message enqueue unit that enqueues the API call message when the API is called, and an API call message enqueue unit.
An API call processing program, characterized in that a computer realizes a throttling information update unit that updates the throttling information directly or indirectly based on the API call message held in the API call queue.
JP2019198265A 2019-10-31 2019-10-31 Api call handling system and api call handling program Pending JP2021071929A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019198265A JP2021071929A (en) 2019-10-31 2019-10-31 Api call handling system and api call handling program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019198265A JP2021071929A (en) 2019-10-31 2019-10-31 Api call handling system and api call handling program

Publications (1)

Publication Number Publication Date
JP2021071929A true JP2021071929A (en) 2021-05-06

Family

ID=75713993

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019198265A Pending JP2021071929A (en) 2019-10-31 2019-10-31 Api call handling system and api call handling program

Country Status (1)

Country Link
JP (1) JP2021071929A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113885902A (en) * 2021-08-23 2022-01-04 北京房江湖科技有限公司 Application program interface updating method
CN115296942A (en) * 2022-07-22 2022-11-04 中电信数智科技有限公司 Combined API (application program interface) counting charging device based on weighted response

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113885902A (en) * 2021-08-23 2022-01-04 北京房江湖科技有限公司 Application program interface updating method
CN113885902B (en) * 2021-08-23 2022-10-11 贝壳找房(北京)科技有限公司 Application program interface updating method
CN115296942A (en) * 2022-07-22 2022-11-04 中电信数智科技有限公司 Combined API (application program interface) counting charging device based on weighted response

Similar Documents

Publication Publication Date Title
US11651312B2 (en) Combining batch and queueable technologies in a platform for large volume parallel processing
US20170054808A1 (en) Rapid client-side component processing based on component relationships
JP6532385B2 (en) INFORMATION PROCESSING SYSTEM, CONTROL METHOD THEREOF, AND PROGRAM
JPWO2006100752A1 (en) Distributed processing management apparatus, distributed processing management method, distributed processing management program
JP2021071929A (en) Api call handling system and api call handling program
JP4555145B2 (en) Batch scheduling program, batch scheduling method, and batch scheduling apparatus
EP3816906A2 (en) Method and device for processing transaction request in blockchain, electronic apparatus and storage medium
US9049164B2 (en) Dynamic message retrieval by subdividing a message queue into sub-queues
US7523361B2 (en) Error condition handling
Miyamae et al. Performance improvement of the consortium blockchain for financial business applications
JP2008090798A (en) Backup-control device of data-processing system, and system therefor
CN110381150B (en) Data processing method and device on block chain, electronic equipment and storage medium
JP5870642B2 (en) Information processing apparatus, management method, and management program
JP6179200B2 (en) Information processing apparatus, device, information processing system, information processing method, and information processing program
JP2013066123A (en) Image forming apparatus and job control program
JP5884566B2 (en) Batch processing system, progress confirmation device, progress confirmation method, and program
US20210149726A1 (en) Scheduling device, scheduling system, scheduling method, and non-transitory computer-readable medium
JP2015094976A (en) Information processing apparatus, information processing method, and program
JP2017037469A (en) Information processing system, priority processing method, information processor and program
US20200136802A1 (en) QoS Assisted AES Engine for SSD Controller
JP6226666B2 (en) Batch processing control program, batch processing system
US20240045633A1 (en) Image forming apparatus, information processing method, and storage medium
JP2015109049A (en) Electronic device and workflow generation program
JP2012185610A (en) Information processor, work significance calculation method and work significance calculation program
JP2009129376A (en) Request control method in client server system, request control program, and server device