JP7059757B2 - API processing method, terminal, API processing program - Google Patents

API processing method, terminal, API processing program Download PDF

Info

Publication number
JP7059757B2
JP7059757B2 JP2018068058A JP2018068058A JP7059757B2 JP 7059757 B2 JP7059757 B2 JP 7059757B2 JP 2018068058 A JP2018068058 A JP 2018068058A JP 2018068058 A JP2018068058 A JP 2018068058A JP 7059757 B2 JP7059757 B2 JP 7059757B2
Authority
JP
Japan
Prior art keywords
program
api
processing
function
description
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
Application number
JP2018068058A
Other languages
Japanese (ja)
Other versions
JP2019179383A (en
Inventor
功作 木村
シュリダル チョーダリー
敦二 関口
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2018068058A priority Critical patent/JP7059757B2/en
Publication of JP2019179383A publication Critical patent/JP2019179383A/en
Application granted granted Critical
Publication of JP7059757B2 publication Critical patent/JP7059757B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、API処理方法、端末、API処理プログラムに関する。 The present invention relates to an API processing method, a terminal, and an API processing program.

従来より、プログラムの処理を効率よく実行するための技術が提案されている。 Conventionally, techniques for efficiently executing program processing have been proposed.

例えば、プログラム中の同期処理を非同期メッセージ、非同期に処理を実行させる命令列およびライブラリ待ち合わせを行わせる命令列を出力して分散配置可能にすると共に複数のCPUに分散配置する技術がある。 For example, there is a technique of outputting an asynchronous message for synchronous processing in a program, an instruction sequence for performing processing asynchronously, and an instruction sequence for waiting for a library so that they can be distributed and distributed to a plurality of CPUs.

また、ソフトウェアのソースコードを変換する技術であって、変換された中間形式を抽象化するステップで記憶された逆変換ルールを用いて、抽象化された中間形式を抽象化される前の中間形式に変換する技術がある。また、この技術では、ソースコードを中間形式に変換するステップで記憶された逆変換ルールを用いて、抽象化される前の中間形式をソースコードである抽象化ソースコードに変換する。 In addition, it is a technique for converting software source code, and the intermediate form before the abstracted intermediate form is abstracted by using the inverse conversion rule stored in the step of abstracting the converted intermediate form. There is a technology to convert to. Further, in this technique, the intermediate format before abstraction is converted into the abstracted source code which is the source code by using the inverse conversion rule stored in the step of converting the source code into the intermediate format.

また、ルール定義言語でルールを記述し、翻訳器を介してこれらのルールを渡してランタイムエンジンに送り、ランタイムエンジンを使用して翻訳された命令をスケジュールし、同時に処理する技術がある。 There is also a technique for writing rules in a rule definition language, passing these rules through a translator, sending them to the runtime engine, and using the runtime engine to schedule translated instructions and process them at the same time.

特開2001-184320号公報Japanese Unexamined Patent Publication No. 2001-184320 特開2013-120491号公報Japanese Unexamined Patent Publication No. 2013-120491 特開2007-519075号公報Japanese Unexamined Patent Publication No. 2007-51907

しかし、API(Application Programming Interface)の関数を呼び出してプログラムの処理を実行する場合において、プログラムが非効率な記述となっていることがある。例えば、プログラムが、同期的にAPIの関数を呼び出し、順次実行するように記述されていることがある。プログラムが同期的な記述になっていると、非同期に並行して実行してもよい関数がある場合であっても、同期的に順次実行されることになるため、時間効率がよくない、という問題があった。 However, when the API (Application Programming Interface) function is called to execute the program processing, the program may be described inefficiently. For example, a program may be written to call API functions synchronously and execute them sequentially. If the program is written synchronously, even if there are functions that can be executed asynchronously in parallel, they will be executed synchronously and sequentially, which is not time-efficient. There was a problem.

本発明は、一つの側面として、並列性を考慮して効率よくプログラムを実行することを目的とする。 One aspect of the present invention is to efficiently execute a program in consideration of parallelism.

一つの態様として、第一の形式で記載されたプログラムであって、当該プログラムにて定義された複数のAPI呼び出し処理を実行する端末を有するAPI処理方法である。また、前記複数のAPI呼び出し処理に応じて、当該API呼び出し処理に対応する処理を実行するよう第二の形式で記載されたプログラムを動作させる複数のサーバー装置を有するAPI処理方法である。前記端末は、前記第二の形式で記載されたプログラムに関する情報を取得し、取得したプログラムに関する情報に基づいて前記複数のAPI呼び出し処理のうち並行して実行可能なAPI呼び出し処理を特定する。特定されたAPI呼び出し処理に関する情報をサーバー装置に送信する。 One embodiment is an API processing method which is a program described in the first form and has a terminal for executing a plurality of API call processes defined in the program. Further, it is an API processing method having a plurality of server devices for operating a program described in the second format so as to execute a process corresponding to the API call process in response to the plurality of API call processes. The terminal acquires information about the program described in the second form, and identifies an API call process that can be executed in parallel among the plurality of API call processes based on the acquired information about the program. Sends information about the identified API call process to the server device.

一つの側面として、並列性を考慮して効率よくプログラムを実行することができる、という効果を有する。 As one aspect, it has the effect that the program can be executed efficiently in consideration of parallelism.

非同期関数のコールバックの記述の一例を示す図である。It is a figure which shows an example of the description of the callback of an asynchronous function. Promiseのパターンを用いた非同期関数の記述の一例を示す図である。It is a figure which shows an example of the description of the asynchronous function using the pattern of Promise. async/awaitのパターンを用いた非同期関数の記述の一例を示す図である。It is a figure which shows an example of the description of the asynchronous function using the pattern of async / await. 本発明の実施形態に係るAPI処理システムの概略構成を示すブロック図である。It is a block diagram which shows the schematic structure of the API processing system which concerns on embodiment of this invention. 第1実施形態の端末の概略構成を示すブロック図である。It is a block diagram which shows the schematic structure of the terminal of 1st Embodiment. 変換対象のプログラムであって、同期的な記述、及び非同期的な記述が混在して書かれた形式のプログラムの一例を示す図である。It is a figure which shows an example of the program of the format which is the program to be converted and is written in a mixture of synchronous description and asynchronous description. プログラムに対する前処理による変換の一例を示す図である。It is a figure which shows an example of conversion by the preprocessing for a program. プログラムに対する前処理による変換の一例を示す図である。It is a figure which shows an example of conversion by the preprocessing for a program. プログラムに対する前処理による変換の一例を示す図である。It is a figure which shows an example of conversion by the preprocessing for a program. プログラムに対する前処理による変換の一例を示す図である。It is a figure which shows an example of conversion by the preprocessing for a program. 前処理部の変換により得られた同期的な記述のプログラムの一例を示す図である。It is a figure which shows an example of the program of the synchronous description obtained by the conversion of the preprocessing part. 関数リストの一例を示す図である。It is a figure which shows an example of a function list. プログラムに対する変換処理の一例を示す図である。It is a figure which shows an example of the conversion process for a program. プログラムに対する変換処理の一例を示す図である。It is a figure which shows an example of the conversion process for a program. プログラムに対する変換処理の一例を示す図である。It is a figure which shows an example of the conversion process for a program. プログラムに対する変換処理の一例を示す図である。It is a figure which shows an example of the conversion process for a program. プログラムに対する変換処理の一例を示す図である。It is a figure which shows an example of the conversion process for a program. 第1実施形態の端末として機能するコンピュータの概略構成を示すブロック図である。It is a block diagram which shows the schematic structure of the computer which functions as the terminal of 1st Embodiment. 第1実施形態の端末の変換処理の一例を示すフローチャートである。It is a flowchart which shows an example of the conversion process of the terminal of 1st Embodiment. 第2実施形態の端末の概略構成を示すブロック図である。It is a block diagram which shows the schematic structure of the terminal of 2nd Embodiment. 表作成部によって作成された表の一例を示す図である。It is a figure which shows an example of the table created by the table making part. 表更新部によって更新された表の一例を示す図である。It is a figure which shows an example of the table updated by the table update part. 動詞表の一例を示す図である。It is a figure which shows an example of a verb table. 表更新部によって更新された表の一例を示す図である。It is a figure which shows an example of the table updated by the table update part. 表更新部によって更新された表の一例を示す図である。It is a figure which shows an example of the table updated by the table update part. 並列性に基づく実行順序のプログラムへの反映の一例を示す図である。It is a figure which shows an example of the reflection in the program of the execution order based on parallelism. 並列性に基づく実行順序のプログラムへの反映の一例を示す図である。It is a figure which shows an example of the reflection in the program of the execution order based on parallelism. 並列性に基づく実行順序のプログラムへの反映の一例を示す図である。It is a figure which shows an example of the reflection in the program of the execution order based on parallelism. 並列性に基づく実行順序のプログラムへの反映の一例を示す図である。It is a figure which shows an example of the reflection in the program of the execution order based on parallelism. 並列性に基づく実行順序のプログラムへの反映の一例を示す図である。It is a figure which shows an example of the reflection in the program of the execution order based on parallelism. 並列性に基づく実行順序のプログラムへの反映の一例を示す図である。It is a figure which shows an example of the reflection in the program of the execution order based on parallelism. 並列性に基づく実行順序のプログラムへの反映の一例を示す図である。It is a figure which shows an example of the reflection in the program of the execution order based on parallelism. 並列性に基づく実行順序のプログラムへの反映の一例を示す図である。It is a figure which shows an example of the reflection in the program of the execution order based on parallelism. 第2実施形態の端末として機能するコンピュータの概略構成を示すブロック図である。It is a block diagram which shows the schematic structure of the computer which functions as the terminal of 2nd Embodiment. 第2実施形態の端末の変換処理の一例を示すフローチャートである。It is a flowchart which shows an example of the conversion process of the terminal of 2nd Embodiment. 第3実施形態の端末の概略構成を示すブロック図である。It is a block diagram which shows the schematic structure of the terminal of 3rd Embodiment. 前処理部の変換により得られた同期的な記述のプログラムの一例を示す図である。It is a figure which shows an example of the program of the synchronous description obtained by the conversion of the preprocessing part. 関数リストの一例を示す図である。It is a figure which shows an example of a function list. 表作成部によって作成された表の一例を示す図である。It is a figure which shows an example of the table created by the table making part. 関数HTTPリクエスト対応表の一例を示す図である。It is a figure which shows an example of the function HTTP request correspondence table. 表更新部によって更新された表の一例を示す図である。It is a figure which shows an example of the table updated by the table update part. 並列性に基づく実行順序のプログラムへの反映の一例を示す図である。It is a figure which shows an example of the reflection in the program of the execution order based on parallelism. 第3実施形態の端末として機能するコンピュータの概略構成を示すブロック図である。It is a block diagram which shows the schematic structure of the computer which functions as the terminal of 3rd Embodiment. 第3実施形態の端末の変換処理の一例を示すフローチャートである。It is a flowchart which shows an example of the conversion process of the terminal of 3rd Embodiment. 第4実施形態の端末の概略構成を示すブロック図である。It is a block diagram which shows the schematic structure of the terminal of 4th Embodiment. 前処理部の変換により得られた同期的な記述のプログラムの一例を示す図である。It is a figure which shows an example of the program of the synchronous description obtained by the conversion of the preprocessing part. 関数リストの一例を示す図である。It is a figure which shows an example of a function list. 表作成部によって作成された表の一例を示す図である。It is a figure which shows an example of the table created by the table making part. 管理表作成部の処理の一例を示す図である。It is a figure which shows an example of the process of a management table creation part. 並列不可ペア管理表の一例を示す図である。It is a figure which shows an example of the non-parallel pair management table. 表更新部によって更新された表の一例を示す図である。It is a figure which shows an example of the table updated by the table update part. 並列性に基づく実行順序のプログラムへの反映の一例を示す図である。It is a figure which shows an example of the reflection in the program of the execution order based on parallelism. 第4実施形態の端末として機能するコンピュータの概略構成を示すブロック図である。It is a block diagram which shows the schematic structure of the computer which functions as the terminal of 4th Embodiment. 第4実施形態の端末の変換処理の一例を示すフローチャートである。It is a flowchart which shows an example of the conversion process of the terminal of 4th Embodiment. 第2~第4実施形態の適用先の一例を示す図である。It is a figure which shows an example of application destination of 2nd to 4th Embodiment.

以下、図面を参照して本発明に係る実施形態の一例を詳細に説明する。 Hereinafter, an example of the embodiment according to the present invention will be described in detail with reference to the drawings.

まず、本発明の実施形態の前提となる背景について説明する。 First, the background that is the premise of the embodiment of the present invention will be described.

API(Application Programming Interface)は、ブラックボックス化された有用なリソース(データ,機能など)にプログラムからアクセスするためのインターフェースである。ここでいうAPIは、ローカル環境でライブラリが提供するAPI、ネットワーク越しにアクセスするためのWebAPIを含むものとして説明する。 API (Application Programming Interface) is an interface for programmatically accessing useful blackboxed resources (data, functions, etc.). The API referred to here will be described as including the API provided by the library in the local environment and the Web API for accessing over the network.

APIは、プログラムからは関数やオブジェクトのインスタンスメソッドの呼び出しで実現される。 API is realized by calling an instance method of a function or an object from a program.

APIをラップするクライアントライブラリの関数呼び出し方式には同期的又は非同期的の二種類があるが、基本は非同期的に記述する必要がある。同期的とは処理を順次実行する方式(API呼び出し処理を並行して実行しない方式)であり、非同期的とは処理を実行状況に応じて並列的に実行する方式(API呼び出し処理を並行して実行可能な方式)である。例えば、Node.js(JavaScript(登録商標))のプログラムでは、非同期関数の最後の引数にコールバック関数(Error-first Callbackと呼ばれる)を指定する。例えば、以下のプログラムのようにコールバック関数を指定する。 There are two types of function call methods in the client library that wrap the API, synchronous and asynchronous, but the basics need to be described asynchronously. Synchronous is a method of executing processes sequentially (API call processing is not executed in parallel), and asynchronous is a method of executing processes in parallel according to the execution status (API call processing is executed in parallel). An executable method). For example, in a Node.js (JavaScript (registered trademark)) program, a callback function (called Error-first Callback) is specified as the last argument of the asynchronous function. For example, specify the callback function as in the following program.

// ファイルを開く
fs.open(‘file.txt’, ‘r’, (err, data) => { … });
// Open the file
fs.open ('file.txt','r', (err, data) =>{…});

また、同期的及び非同期的な記述の両方に対応する関数もあるが、あくまで一部である。例えば下記のプログラムのようにSyncの記述により同期的な記述に対応する。 There are also functions that support both synchronous and asynchronous descriptions, but they are only a part. For example, as in the program below, the description of Sync corresponds to the synchronous description.

data = fs.openSync(‘file.txt’, ‘r’); // fs.openの同期版 data = fs.openSync (‘file.txt’, ‘r’); // Synchronized version of fs.open

上記のように非同期関数ではコールバックを記述するが、従来よりコールバックの入れ子が続く、いわゆるコールバック地獄が知られている。図1に示すようにコールバックが入れ子に記述されるため、コードの管理が煩雑になるという問題がある。図1では、(err,b)、(err,c)、(err,d)が入れ子に記述されている。 As mentioned above, the asynchronous function describes the callback, but the so-called callback hell, in which the nesting of callbacks continues, is known. Since the callbacks are nested as shown in FIG. 1, there is a problem that the code management becomes complicated. In FIG. 1, (err, b), (err, c), and (err, d) are nested.

このようなコールバック地獄を緩和する従来手法の例としては、以下の二つのパターン(記述方式)が挙げられる。 The following two patterns (description methods) are examples of conventional methods for alleviating such callback hell.

従来手法(1)はPromiseのパターンを用いる。Promiseでは、図2の下線部で示すコードのように非同期呼び出しを関数の数珠繋ぎで表すことができる、これにより入れ子が平坦化されコールバック地獄を軽減することができ、非同期呼び出しプログラムの理解及び保守が容易となる。なお、PromiseはECMAScript標準ES6の仕様で利用可能なパターンである。なお、以下、プログラムのコードを記載する図面において、着目するコードの部分には下線を付与しておくものとする。 The conventional method (1) uses the Promise pattern. In Promise, asynchronous calls can be represented by a string of functions as shown in the underlined code in Figure 2, which can flatten nesting and mitigate callback hell, and understand and maintain asynchronous call programs. Becomes easier. Promise is a pattern that can be used in the ECMAScript standard ES6 specifications. In the following drawings that describe the code of the program, the part of the code of interest shall be underlined.

従来手法(2)はasync/awaitのパターンを用いる。async/awaitでは、図3の下線部に示すようにPromiseを返す非同期関数の呼び出しをあたかも同期関数の呼び出しであるかのように記述することができる。これにより非同期な呼び出しプログラムの理解及び保守が容易となる。なお、async/awaitはECMAScript標準 ES2017の仕様で利用可能なパターンである。 The conventional method (2) uses the async / await pattern. In async / await, as shown in the underlined part of FIG. 3, a call of an asynchronous function that returns a promise can be described as if it were a call of a synchronous function. This facilitates the understanding and maintenance of asynchronous calling programs. Note that async / await is a pattern that can be used in the ECMAScript standard ES2017 specifications.

また、上記特許文献1は、逐次処理を非同期メッセージ送受信による分散処理に書き換える技術ではあるものの、複数CPUを利用する場合の効率化が目的であり、APIの呼び出しによる非同期処理の記述を容易にするための技術ではなかった。 Further, although Patent Document 1 is a technique for rewriting sequential processing into distributed processing by sending and receiving asynchronous messages, the purpose is to improve efficiency when a plurality of CPUs are used, and it is easy to describe asynchronous processing by calling API. It wasn't a technique for.

従来より、上述した非同期的に記述されたプログラムは、統合開発環境やライブラリ、APIクライアントなどのツールを用いて開発していた。統合開発環境は、IDE(Integrated Development Environment)と呼ばれ、言語処理系(コンパイラ、スクリプトエンジン等)も含むものである。ライブラリは、非同期処理を書きやすくする表記方法を備えた関数を格納するためのものである。APIクライアントは、コールバックのインターフェースを備えたものである。 Conventionally, the above-mentioned asynchronously written program has been developed by using tools such as an integrated development environment, a library, and an API client. The integrated development environment is called an IDE (Integrated Development Environment) and includes a language processing system (compiler, script engine, etc.). The library is for storing functions with a notation that makes asynchronous processing easier to write. The API client is equipped with a callback interface.

もっとも、非同期処理の記述は直感的でないため、記述性、可読性、保守性が低いという問題がある。また、開発者が、非同期処理のコードの書き方や、非同期処理に対応した関数を含む非同期処理ライブラリの使い方を習得するのに時間が掛かるという問題がある。 However, since the description of asynchronous processing is not intuitive, there is a problem that the description, readability, and maintainability are low. In addition, there is a problem that it takes time for a developer to learn how to write code for asynchronous processing and how to use an asynchronous processing library including functions corresponding to asynchronous processing.

そのため、本発明の実施形態では、同期的な記述のプログラムを非同期的な記述に変換して、非同期処理することが可能な手法を提供する場合を例に説明する。これにより、開発者は、従来から用いているツールをそのまま利用し、平易なプログラミングにより逐次処理的なプログラムを記述して、非同期処理を実現できる。 Therefore, in the embodiment of the present invention, a case where a program having a synchronous description is converted into an asynchronous description to provide a method capable of performing asynchronous processing will be described as an example. As a result, the developer can realize asynchronous processing by using the tools that have been used conventionally as they are and writing a sequential processing program by simple programming.

また、プログラムを実行する前に本手法を適用してプログラムを変換する場合を想定する。変換の際に、並列実行が可能な関数については、並列性を考慮して変換することにより、より時間効率のよいプログラムの実行が可能となる。 In addition, it is assumed that this method is applied to convert the program before executing the program. For functions that can be executed in parallel at the time of conversion, it is possible to execute a program more time-efficiently by converting in consideration of parallelism.

以下、上記背景に基づく各実施形態を説明する。なお、以下の各実施形態の説明では、Node.jsのJavaScript(登録商標)の環境を前提に説明するが、これに限定されるものではなく、同様の手法を同期的、及び非同期的に記述された他のプログラムの環境に対しても適用することも可能である。 Hereinafter, each embodiment based on the above background will be described. In the following description of each embodiment, the description is based on the environment of JavaScript (registered trademark) of Node.js, but the description is not limited to this, and the same method is described synchronously and asynchronously. It can also be applied to the environment of other programs that have been created.

[第1実施形態]
本実施形態は、同期的に記述されたプログラムを、非同期的に記述されたプログラムに変換して自動生成し、実行する場合を例として説明する。非同期的に記述されたプログラムに変換することは、並列性を考慮したプログラムに変換するにあたって前提となる手法である。非同期処理のプログラムの変換には、非同期処理ライブラリを用いる。なお、同期的に記述されたプログラムが、第一の形式で記載されたプログラムの一例である。非同期的に記述されたプログラムが、第二の形式で記載されたプログラムの一例である。
[First Embodiment]
In this embodiment, a case where a program described synchronously is converted into a program described asynchronously, automatically generated, and executed will be described as an example. Converting to a program written asynchronously is a prerequisite method for converting to a program considering parallelism. Asynchronous processing library is used for conversion of asynchronous processing program. The program described synchronously is an example of the program described in the first format. A program written asynchronously is an example of a program written in the second format.

以下、変換の概要について説明する。変換では、同期的に記述されたプログラムを入力とする。あるいは同期的記述及び非同期的記述の混在したプログラムを入力とする。 The outline of the conversion will be described below. In the conversion, the program written synchronously is input. Alternatively, input a program in which synchronous description and asynchronous description are mixed.

同期的な記述及び非同期的な記述の混在したプログラムを入力とする場合には、入力されたプログラムをパーズ(構文解析)して抽象構文木(AST(Abstract Syntax Tree))を生成し、次に示すような方法で同期的な記述に書き換える。 When inputting a program with a mixture of synchronous and asynchronous descriptions, the input program is parsed (syntactic analysis) to generate an abstract syntax tree (AST), and then Rewrite the description in a synchronous manner as shown.

関数定義ブロックにてコールバック関数定義を引数に含む関数の呼び出し文を深さ優先で探索する。また、コールバック関数定義の第二引数の名前をユニークなものへ変更する。変更は、プリフィクス(_)や通し番号を付ける等である。また、関数呼び出し文の引数からコールバック関数定義を削除する。また、コールバック関数内でコールバック第二引数が操作されている場合、関数呼び出し文を関数呼び出しの戻り値を初期値とするような変数宣言文に変換する。変数宣言文へは例えば以下のように変換する。 In the function definition block, search for the call statement of the function that includes the callback function definition as an argument with depth-first priority. Also, change the name of the second argument of the callback function definition to a unique one. Changes include prefixes (_) and serial numbers. Also, delete the callback function definition from the argument of the function call statement. Also, when the second callback argument is operated in the callback function, the function call statement is converted into a variable declaration statement whose initial value is the return value of the function call. Convert to a variable declaration statement as follows, for example.

foo(a,b,(err,data)=>{…}) → let _data0 = foo(a,b) foo (a, b, (err, data) => {…}) → let _data0 = foo (a, b)

また、変数宣言文の直後にコールバック関数内で通常時に実行されるコード片を挿入する。以上により、同期的記述及び非同期的記述の混在したプログラムが、同期的な記述のプログラムに書き換えられる。 Also, immediately after the variable declaration statement, insert a piece of code that is normally executed in the callback function. As described above, the program in which the synchronous description and the asynchronous description are mixed is rewritten into the program with the synchronous description.

そして、同期的な記述のプログラムを、次に示すような方法で、非同期的な記述に書き換える。 Then, the program of the synchronous description is rewritten into the asynchronous description by the following method.

まず、APIクライアントライブラリのソースコードから関数名を参照し、ライブラリ関数呼び出し文を特定する。また、ライブラリの公開している関数リストをAPIクライアントライブラリのソースコードから抽出する。また、特定された関数呼び出し文の関数名が、抽出された関数リスト内に含まれ、オブジェクト変数が当該関数のライブラリモジュールそのもの、またはモジュールに由来するものである場合、その文を関数呼び出し文リストに追加する。また、所定の変換ルールを用いて、非同期処理ライブラリを用いた非同期処理プログラムを生成し出力する。 First, the function name is referenced from the source code of the API client library, and the library function call statement is specified. Also, the function list published by the library is extracted from the source code of the API client library. Also, if the function name of the specified function call statement is included in the extracted function list and the object variable is derived from the library module itself of the function or the module, that statement is included in the function call statement list. Add to. In addition, an asynchronous processing program using an asynchronous processing library is generated and output using a predetermined conversion rule.

図4に示すように、本実施形態に係るAPI処理システム100は、端末10と、複数のサーバー装置12とを含み、端末10と、複数のサーバー装置12とが、インターネット等のネットワーク3を介して接続される。 As shown in FIG. 4, the API processing system 100 according to the present embodiment includes a terminal 10 and a plurality of server devices 12, and the terminal 10 and the plurality of server devices 12 are connected to each other via a network 3 such as the Internet. Is connected.

端末10は、プログラムの変換を行い、変換したプログラムを実行する情報処理装置である。 The terminal 10 is an information processing device that converts a program and executes the converted program.

サーバー装置12は、プログラムで呼び出されるAPIを提供する装置である。サーバー装置12は、端末10で実行されたプログラムのAPIの関数呼び出しに応じて適宜、呼び出された関数に対応する必要な処理(呼び出された関数に対応するプログラム)を実行して処理結果を端末10に返却する。サーバー装置12で提供されるAPIは、例えば、AWS(Amazon Web Services)S3や、他社APIである。なお、端末10側は、サーバー装置12から提供されるAPIを呼び出すためのAPIクライアントを導入して、APIを呼び出すプログラムを実装する。また、サーバー装置12の構成は、APIの提供態様によって様々であるため、具体的な構成についての説明は省略する。 The server device 12 is a device that provides an API that is called by a program. The server device 12 appropriately executes necessary processing (program corresponding to the called function) corresponding to the called function according to the function call of the API of the program executed by the terminal 10, and outputs the processing result to the terminal. Return to 10. The API provided by the server device 12 is, for example, AWS (Amazon Web Services) S3 or another company's API. The terminal 10 side introduces an API client for calling the API provided by the server device 12, and implements a program for calling the API. Further, since the configuration of the server device 12 varies depending on the mode in which the API is provided, the description of the specific configuration will be omitted.

端末10は、図5に示すように、機能的には、APIクライアントライブラリ14と、変換ルール16と、前処理部22と、関数特定部24と、変換部26と、実行部28と、通信部30とを含む。 As shown in FIG. 5, the terminal 10 functionally communicates with the API client library 14, the conversion rule 16, the preprocessing unit 22, the function specifying unit 24, the conversion unit 26, and the execution unit 28. Including part 30.

APIクライアントライブラリ14は、APIの関数名の一覧を格納したライブラリである。ライブラリにはソースコードが含まれる。 The API client library 14 is a library that stores a list of API function names. The library contains the source code.

変換ルール16は、同期的に記述されたプログラムを非同期的な記述に変換するためのルールである。ルールの詳細については後述する。 The conversion rule 16 is a rule for converting a program described synchronously into an asynchronous description. The details of the rules will be described later.

前処理部22は、変換対象のプログラムが同期的な記述、及び非同期的な記述が混在して書かれた形式である場合に、前処理としてプログラムを同期的な記述に書き換えるように変換する。前処理が必要なのは、変換部26で用いる変換ルール16が、同期的な記述から変換することを前提としているからである。なお、プログラムが同期的な記述のみで書かれた形式である場合には、前処理部22の処理は省略可能である。 When the program to be converted is in a format in which a synchronous description and an asynchronous description are mixed, the preprocessing unit 22 converts the program into a synchronous description as preprocessing. Preprocessing is required because the conversion rule 16 used in the conversion unit 26 is premised on conversion from the synchronous description. If the program is written only in a synchronous description, the processing of the preprocessing unit 22 can be omitted.

以下、前処理部22の具体的な書き換え内容について説明する。 Hereinafter, specific rewriting contents of the preprocessing unit 22 will be described.

図6に変換対象のプログラムの一例を示す。図6のプログラムの処理概要は、file.txtにorgDataの中身を書き込み保存し、AWSのS3バケットに‘file.txt’をキーとしてfile.txtの中身をアップロードする、という内容である。なお、各コールバック第二引数dataは各々の関数ブロック内でのみ有効となる。ここで、同期関数はfs.writeFileSync、fs.readFileSyncである。非同期関数はs3.createBucket、s3.putObjectである。 FIG. 6 shows an example of the program to be converted. The processing outline of the program of FIG. 6 is that the contents of orgData are written and saved in file.txt, and the contents of file.txt are uploaded to the AWS S3 bucket using ‘file.txt’ as a key. Note that each callback second argument data is valid only in each function block. Here, the synchronization functions are fs.writeFileSync and fs.readFileSync. Asynchronous functions are s3.createBucket and s3.putObject.

次に、図7に示すように、関数定義ブロックの中身をtry-catchで囲む。catchブロックにはcatchされたerrのコンソール出力のみ記述する。 Next, as shown in FIG. 7, the contents of the function definition block are surrounded by try-catch. Only the console output of the caught err is described in the catch block.

次に、図8に示すように、同期関数を同期的記述に変換する。例えば、Node.jsの場合、Object.keys(fs)でAPIクライアントライブラリ14からモジュールの提供する関数名一覧を取得する。次に、関数名一覧から各関数の同期、及び非同期の対応を特定する。JavaScript(登録商標)の場合、末尾のSyncの有無が同期、非同期の対応とみなせる。次に、APIクライアントライブラリ14のモジュールそのもの、またはモジュール由来のオブジェクト変数について関数名一覧に含まれる関数が呼び出されているコードを探索する。例えば、モジュール、及びモジュール由来のオブジェクト変数は、fs、AWS、s3である。探索されるコードは、fs.writeFileSync、s3.createBucket、fs.readFileSync、s3.putObject、s3.getObjectである。このうち、同期関数の名前を非同期関数のものと同じにする。JavaScript(登録商標)の場合はSyncを削除することで非同期関数のものと同じになる。ここでいう非同期関数のものと同じにすることが同期的な記述への変換である。 Next, as shown in FIG. 8, the synchronization function is converted into a synchronous description. For example, in the case of Node.js, Object.keys (fs) gets a list of function names provided by the module from API client library 14. Next, the synchronous and asynchronous correspondence of each function is specified from the function name list. In the case of JavaScript (registered trademark), the presence or absence of Sync at the end can be regarded as a synchronous or asynchronous correspondence. Next, the code in which the function included in the function name list is called is searched for the module itself of the API client library 14 or the object variable derived from the module. For example, modules and object variables derived from modules are fs, AWS, and s3. The code to be searched is fs.writeFileSync, s3.createBucket, fs.readFileSync, s3.putObject, s3.getObject. Of these, the name of the synchronous function should be the same as that of the asynchronous function. In the case of JavaScript (registered trademark), it becomes the same as that of the asynchronous function by deleting Sync. Making it the same as that of the asynchronous function here is the conversion to a synchronous description.

次に、図9に示すように、非同期関数を同期的記述に変換する。ここでは、コールバック関数を引数に持つ非同期関数の呼び出し文について以下を実施する。まずコールバック関数定義を抜き出す。また、コールバック第二引数の名前マングリングを行う。名前マングリングとは、プリフィクスを付けると共に末尾に同一名での通し番号を付けることである。第二引数dataを_data0とする。次に、コールバック第二引数の変数宣言に変換する。例えば、s3.getObject({…})を、(err, data)の第二引数の変数宣言として、(1)let _data0 = s3.getObject({…})と変換する。次に、図10に示すコードから、err != null(通常時)で実行されるコード片を抽出する。図10の例では、(2)foo(_data0)、console.log('done')が抽出される。(1)のコードの直後に(2)のコードを配置する。 Next, as shown in FIG. 9, the asynchronous function is converted into a synchronous description. Here, the following is executed for the call statement of the asynchronous function that has the callback function as an argument. First, extract the callback function definition. In addition, the name mangling of the second argument of the callback is performed. Name mangling is to add a prefix and a serial number with the same name at the end. Let the second argument data be _data0. Next, it is converted into a variable declaration of the second argument of the callback. For example, s3.getObject ({…}) is converted to (1) let _data0 = s3.getObject ({…}) as the variable declaration of the second argument of (err, data). Next, from the code shown in FIG. 10, a code piece executed with err! = Null (normal time) is extracted. In the example of FIG. 10, (2) foo (_data0) and console.log ('done') are extracted. Place the code of (2) immediately after the code of (1).

以上の前処理部22の処理により、プログラムは、図11に示すような同期的に記述されたプログラムに変換される。 By the above processing of the preprocessing unit 22, the program is converted into a program described synchronously as shown in FIG.

次に、関数特定部24の処理を説明する。 Next, the processing of the function specifying unit 24 will be described.

関数特定部24は、前処理部22で変換されたプログラムから、APIクライアントライブラリ14を参照して関数の呼び出し文を特定し、プログラムでAPIを呼び出している関数名を一覧にした関数リストを作成する。 The function specifying unit 24 identifies the function call statement from the program converted by the preprocessing unit 22 with reference to the API client library 14, and creates a function list listing the names of the functions calling the API in the program. do.

関数特定部24は、例えば、Node.jsの場合、Object.keys(fs)でAPIクライアントライブラリ14からモジュールの提供する関数名一覧を取得する。次に、変換されたプログラムに含まれる、APIクライアントライブラリ14のモジュールそのもの、またはモジュール由来のオブジェクト変数を取得する。取得したモジュールそのもの、またはモジュール由来のオブジェクト変数について、関数名一覧に含まれる関数が呼び出されている関数のリストを特定する。例えば、変換されたプログラムに含まれるモジュール、及びモジュール由来のオブジェクト変数は、fs、AWS、s3である。これらに対して特定される関数のリストは、fs.writeFile、s3.createBucket、fs.readFile、s3.putObject、s3.getObjectである。以上の関数特定部24の処理によって特定された関数リスト24Aを図12に示す。関数リスト24Aには、オブジェクトの変数名と関数名との組がリストとして格納される。 For example, in the case of Node.js, the function specifying unit 24 acquires a list of function names provided by the module from the API client library 14 with Object.keys (fs). Next, the module itself of the API client library 14 or the object variable derived from the module, which is included in the converted program, is acquired. For the acquired module itself or the object variable derived from the module, specify the list of functions for which the function included in the function name list is called. For example, the modules included in the converted program and the object variables derived from the modules are fs, AWS, and s3. The list of functions specified for these is fs.writeFile, s3.createBucket, fs.readFile, s3.putObject, s3.getObject. FIG. 12 shows the function list 24A specified by the above processing of the function specifying unit 24. In the function list 24A, the set of the variable name and the function name of the object is stored as a list.

変換部26は、前処理部22で同期的な記述に変換したプログラムを、関数特定部24で特定した関数リスト24Aと、変換ルール16とに基づいて、非同期的に記述されたプログラムに変換する。 The conversion unit 26 converts the program converted into the synchronous description by the preprocessing unit 22 into the program described asynchronously based on the function list 24A specified by the function specifying unit 24 and the conversion rule 16. ..

以下、変換ルール16に基づく変換部26の処理について説明する。関数の呼び出し文については関数リスト24Aを参照する。 Hereinafter, the processing of the conversion unit 26 based on the conversion rule 16 will be described. See function list 24A for function call statements.

まず、図13に示すように、tryブロックの中身を抜き出す。 First, as shown in FIG. 13, the contents of the try block are extracted.

次に、図14に示すように、抜き出したブロック中の最初のライブラリ関数呼び出し文をawait new Promiseで囲んだものに置き換える。また、関数呼び出し文の引数にコールバック関数を追加する。関数の中身は第二引数をresolveの引数とし、第一引数が指定されていればrejectの引数とするような定型文とする。また、図15に別のコードの場合の例を示す。以上の置き換え、追加をブロック内の関数の呼び出し文ごとに繰り返し、全ての関数について処理する。 Next, as shown in FIG. 14, the first library function call statement in the extracted block is replaced with the one enclosed by await new Promise. Also, add a callback function to the argument of the function call statement. The content of the function is a fixed phrase in which the second argument is the argument of resolve, and if the first argument is specified, it is the argument of reject. Further, FIG. 15 shows an example in the case of another code. The above replacement and addition are repeated for each function call statement in the block, and all functions are processed.

次に、図16に示すように、関数定義にasyncを付ける。 Next, async is added to the function definition as shown in FIG.

以上が変換ルール16に基づく変換部26の変換処理である。最終的に、非同期的な記述に変換されたプログラムの例を図17に示す。 The above is the conversion process of the conversion unit 26 based on the conversion rule 16. Finally, FIG. 17 shows an example of a program converted into an asynchronous description.

実行部28は、変換部26で変換された非同期的な記述のプログラムを実行する。実行部28は、非同期的に記述されたプログラムの関数呼び出し文に応じて、非同期的に、サーバー装置12のAPIの関数を呼び出して処理する。 The execution unit 28 executes the program of the asynchronous description converted by the conversion unit 26. The execution unit 28 asynchronously calls and processes the API function of the server device 12 in response to the function call statement of the program written asynchronously.

通信部30は、実行部28で実行されたプログラムの処理においてAPIの関数の呼び出しによって、ネットワーク3を介してサーバー装置12のAPIを呼び出す。通信部30は、サーバー装置12からAPIの処理結果を取得し、実行部28に受け渡す。なお、上述した本実施形態の手法では、関数の並列性を考慮したプログラムの変換がされているわけではない。もっとも、非同期的な記述でプログラムは記載されているため、同期的な記述の場合のように全てが逐次実行されるわけではなく、コールバックを用いた関数については並列的な順序によってプログラムは実行されることになる。関数の並列性を考慮し、更に効率良く処理を実行する場合については、第2実施形態以降の各実施形態において説明する。 The communication unit 30 calls the API of the server device 12 via the network 3 by calling the API function in the processing of the program executed by the execution unit 28. The communication unit 30 acquires the API processing result from the server device 12 and delivers it to the execution unit 28. In the method of the present embodiment described above, the program is not converted in consideration of the parallelism of the functions. However, since the program is described in asynchronous description, not everything is executed sequentially as in the case of synchronous description, and the program is executed in parallel order for functions using callbacks. Will be done. A case where the processing is executed more efficiently in consideration of the parallelism of the functions will be described in each of the second and subsequent embodiments.

端末10は、例えば図18に示すコンピュータ50で実現することができる。コンピュータ50は、Central Processing Unit(CPU)51と、一時記憶領域としてのメモリ52と、不揮発性の記憶部53とを備える。また、コンピュータ50は、インターフェース(I/F)54と、記憶媒体59に対するデータの読み込み及び書き込みを制御するRead/Write(R/W)部55と、インターネット等のネットワークに接続される通信インターフェース(I/F)56とを備える。CPU51、メモリ52、記憶部53、入出力I/F54、R/W部55、及び通信I/F56は、バス57を介して互いに接続される。なお、通信I/F56は、図5に示す通信部30として機能する。 The terminal 10 can be realized by, for example, the computer 50 shown in FIG. The computer 50 includes a Central Processing Unit (CPU) 51, a memory 52 as a temporary storage area, and a non-volatile storage unit 53. Further, the computer 50 includes an interface (I / F) 54, a Read / Write (R / W) unit 55 that controls reading and writing of data to the storage medium 59, and a communication interface (communication interface) connected to a network such as the Internet. I / F) 56 is provided. The CPU 51, the memory 52, the storage unit 53, the input / output I / F 54, the R / W unit 55, and the communication I / F 56 are connected to each other via the bus 57. The communication I / F 56 functions as the communication unit 30 shown in FIG.

記憶部53は、Hard Disk Drive(HDD)、Solid State Drive(SSD)、フラッシュメモリ等によって実現できる。記憶媒体としての記憶部53には、コンピュータ50を端末10として機能させるためのAPI処理プログラム60が記憶される。API処理プログラム60は、前処理プロセス62と、関数特定プロセス63と、変換プロセス64と、実行プロセス65とを有する。 The storage unit 53 can be realized by a Hard Disk Drive (HDD), a Solid State Drive (SSD), a flash memory, or the like. The storage unit 53 as a storage medium stores an API processing program 60 for making the computer 50 function as a terminal 10. The API processing program 60 includes a preprocessing process 62, a function specifying process 63, a conversion process 64, and an execution process 65.

CPU51は、API処理プログラム60を記憶部53から読み出してメモリ52に展開し、API処理プログラム60が有するプロセスを順次実行する。CPU51は、前処理プロセス62を実行することで、図5に示す前処理部22として動作する。また、CPU51は、関数特定プロセス63を実行することで、図5に示す関数特定部24として動作する。また、CPU51は、変換プロセス64を実行することで、図5に示す変換部26として動作する。また、CPU51は、実行プロセス65を実行することで、図5に示す実行部28として動作する。これにより、API処理プログラム60を実行したコンピュータ50が、端末10として機能することになる。なお、プログラムを実行するCPU51はハードウェアである。 The CPU 51 reads the API processing program 60 from the storage unit 53, expands the API processing program 60 into the memory 52, and sequentially executes the processes included in the API processing program 60. The CPU 51 operates as the pre-processing unit 22 shown in FIG. 5 by executing the pre-processing process 62. Further, the CPU 51 operates as the function specifying unit 24 shown in FIG. 5 by executing the function specifying process 63. Further, the CPU 51 operates as the conversion unit 26 shown in FIG. 5 by executing the conversion process 64. Further, the CPU 51 operates as the execution unit 28 shown in FIG. 5 by executing the execution process 65. As a result, the computer 50 that has executed the API processing program 60 functions as the terminal 10. The CPU 51 that executes the program is hardware.

なお、API処理プログラム60により実現される機能は、例えば半導体集積回路、より詳しくはApplication Specific Integrated Circuit(ASIC)等で実現することも可能である。 The function realized by the API processing program 60 can also be realized by, for example, a semiconductor integrated circuit, more specifically, an Application Specific Integrated Circuit (ASIC) or the like.

次に、本実施形態に係るAPI処理システム100の作用について図19のフローチャートを参照して説明する。 Next, the operation of the API processing system 100 according to the present embodiment will be described with reference to the flowchart of FIG.

ステップS100で、前処理部22は、プログラムが同期的な記述、及び非同期的な記述が混在して書かれた形式のプログラムを同期的な記述に書き換えて変換する。 In step S100, the preprocessing unit 22 rewrites and converts a program in a format in which the program is written in which a synchronous description and an asynchronous description are mixed into a synchronous description.

ステップS102で、関数特定部24は、前処理部22で変換されたプログラムから、APIクライアントライブラリ14を参照して関数の呼び出し文を特定し、プログラムでAPIを呼び出している関数名を一覧にした関数リストを作成する。 In step S102, the function specifying unit 24 identifies the function call statement from the program converted by the preprocessing unit 22 with reference to the API client library 14, and lists the function names calling the API in the program. Create a function list.

ステップS104で、変換部26は、ステップS100で同期的な記述に変換したプログラムを、ステップS102で特定した関数リスト24Aと、変換ルール16とに基づいて、非同期的に記述されたプログラムに変換する。 In step S104, the conversion unit 26 converts the program converted into the synchronous description in step S100 into the program written asynchronously based on the function list 24A specified in step S102 and the conversion rule 16. ..

ステップS106で、実行部28は、ステップS104で変換された非同期的な記述のプログラムを実行する。実行部28は、非同期的に記述されたプログラムの関数呼び出し文に応じて、非同期的に、サーバー装置12のAPIの関数を呼び出して処理する。 In step S106, the execution unit 28 executes the program of the asynchronous description converted in step S104. The execution unit 28 asynchronously calls and processes the API function of the server device 12 in response to the function call statement of the program written asynchronously.

以上説明したように、本実施形態に係るAPI処理システムによれば、同期的な記述に変換したプログラムを、特定した関数リストと、変換ルールとに基づいて、非同期的に記述されたプログラムに変換する。また、変換された非同期的な記述のプログラムを実行する。このため、非同期的なプログラムの処理の作成及び実行を容易にすることができる。 As described above, according to the API processing system according to the present embodiment, the program converted into the synchronous description is converted into the program described asynchronously based on the specified function list and the conversion rule. do. It also executes the converted asynchronous description program. Therefore, it is possible to facilitate the creation and execution of asynchronous program processing.

また、プログラムの開発者は,従来の同期関数、及び非同期関数を用いたプログラムや同期的な記述を用いたプログラムを作成するだけで、非同期処理ライブラリを用いたプログラムを、ライブラリの利用方法やノウハウの習得なしに記述することが可能となる。また、非同期処理が可能なプログラムの開発工数が削減され、プログラムの記述性、可読性、及び保守性が向上する。 In addition, the program developer can create a program using an asynchronous processing library by simply creating a conventional synchronous function, a program using an asynchronous function, or a program using a synchronous description, and how to use the library and know-how. It is possible to write without learning. In addition, the man-hours for developing a program capable of asynchronous processing are reduced, and the descriptiveness, readability, and maintainability of the program are improved.

[第2実施形態]
次に第2実施形態について説明する。第2実施形態では、関数名に含まれる動詞及び名詞に基づいて並列性に基づく実行順序を反映したプログラムを生成する場合について説明する。なお第1実施形態と同様となる箇所については同一符号を付して説明を省略する。
[Second Embodiment]
Next, the second embodiment will be described. In the second embodiment, a case where a program reflecting the execution order based on parallelism is generated based on the verbs and nouns included in the function name will be described. The parts that are the same as those in the first embodiment are designated by the same reference numerals and the description thereof will be omitted.

まず本実施形態の背景を説明する。 First, the background of this embodiment will be described.

第1実施形態は非同期的な記述のプログラムに変換する手法であったが、このままではAPIの関数のうち、何れの関数の組み合わせが、並列化して実行可能な関数の組合せであるか分からない。APIにはブラックボックス化されたリソースへの副作用を伴うものがあるため、並列化可能なAPIの組合せには制限がある。副作用とは、例えば、リソースAを作成してからでないとリソースAを操作できない、という順序の問題である。しかし、APIライブラリの関数のシグネチャからはその組み合わせが容易には分からないようになっている。 The first embodiment is a method of converting into a program described asynchronously, but as it is, it is unknown which combination of API functions is a combination of functions that can be executed in parallel. Since some APIs have side effects on blackboxed resources, there are restrictions on the combinations of APIs that can be parallelized. The side effect is, for example, a problem of the order in which the resource A cannot be operated until the resource A is created. However, the combination is not easily known from the signatures of the functions in the API library.

そこで本実施形態では、関数名に含まれる動詞及び名詞から並列性の有無を判定し、並列性に基づく実行順序をプログラムに反映する場合を例に説明する。前提として、プログラムの各ステートメント(変数宣言、値更新、削除、等)の実行順序を計算し管理表にまとめる。変数の状態を変えるステートメントの実行順序は変更しない想定である。変数の参照を含むステートメントは、その変数の状態が変化しない区間で並列実行可能である。APIに対応する関数呼び出しを含むステートメントを特定したリストを用いて、並列性判定方法によりそれらが並列実行可能かどうかを判定する。そして、並列性を考慮した実行順序を、非同期的な記述のプログラムへの変換に反映する。 Therefore, in the present embodiment, a case where the presence or absence of parallelism is determined from the verbs and nouns included in the function name and the execution order based on the parallelism is reflected in the program will be described as an example. As a premise, the execution order of each statement of the program (variable declaration, value update, deletion, etc.) is calculated and summarized in the management table. It is assumed that the execution order of statements that change the state of variables does not change. Statements containing a variable reference can be executed in parallel in intervals where the variable's state does not change. Using a list that identifies the statements containing the function calls corresponding to the API, it is determined by the parallelism determination method whether or not they can be executed in parallel. Then, the execution order considering parallelism is reflected in the conversion of the asynchronous description into the program.

次に、関数名に含まれる動詞及び名詞についての概要を説明する。基本的な考え方としては副作用の意味のある特定の動詞が含まれる関数は、それらの関数と別の関数を並列で呼び出した時に常に同じ結果になるとは限らないため並列処理は不可であるとする。また、関数名に頻出する動詞(create,get,put,delete等)と、それらが副作用を生じる意味を持つかどうか(i.e.,状態を変更するものかどうか)を記録した動詞表を作成しておく。例えば、[(動詞,副作用あり?),(create,true),(get,false),…]といった動詞表である。動詞表を用いて、あるAPI呼び出しステートメントAの関数名に副作用を生じる動詞が含まれる場合について考える。Aの関数名に含まれる名詞と同じ名詞を含む、または同じ変数を引数に指定し、かつプログラム中の出現順が後ろである関数呼び出しを含むステートメントBの各々は、Aの後に実行すべきと判定する。 Next, an outline of the verbs and nouns included in the function name will be described. The basic idea is that a function that contains a specific verb that has a side effect does not always give the same result when calling those functions and another function in parallel, so parallel processing is not possible. .. Also, create a verb table that records the verbs that frequently appear in function names (create, get, put, delete, etc.) and whether they have the meaning of causing side effects (i.e., whether they change the state). back. For example, a verb table such as [(verb, side effect?), (Create, true), (get, false), ...]. Using a verb table, consider the case where the function name of a certain API call statement A contains a verb that causes a side effect. Each statement B containing a function call that contains the same noun as the noun contained in A's function name, or that specifies the same variable as an argument and has a later appearance order in the program, should be executed after A. judge.

図20に示すように、API処理システム200の端末210は、機能的には、APIクライアントライブラリ14と、変換ルール16と、前処理部22と、関数特定部24と、変換部226と、実行部228と、通信部30とを含む。端末210は、動詞表記憶部214と、表作成部222と、表更新部224とを含む。なお、変換部226が、特定部の一例である。実行部228が、実行部の一例である。 As shown in FIG. 20, the terminal 210 of the API processing system 200 functionally executes the API client library 14, the conversion rule 16, the preprocessing unit 22, the function specifying unit 24, and the conversion unit 226. A unit 228 and a communication unit 30 are included. The terminal 210 includes a verb table storage unit 214, a table creation unit 222, and a table update unit 224. The conversion unit 226 is an example of a specific unit. The execution unit 228 is an example of the execution unit.

表作成部222には、前処理部22での変換により得られた同期的な記述のプログラムが入力される。本実施形態では、上記図11と同様のプログラムが入力された場合を例に説明する。 A program of synchronous description obtained by the conversion in the preprocessing unit 22 is input to the table creation unit 222. In this embodiment, the case where the same program as in FIG. 11 is input will be described as an example.

表作成部222は、同期的な記述のプログラムから、実行順序管理表を作成する。表作成部222は、まず図21に示すような、tryブロック中のステートメント(関数を含むコード)を抜き出した表222Aを作成する。表222Aは、「項番」、「ステートメント」、「APIに対応?」の項目からなる。「項番」は、「ステートメント」ごとに降順の番号を割り当てる。「APIに対応?」の項目には、各ステートメントに関数呼び出し文リストに含まれるオブジェクト変数名、または関数名が含まれるかどうかに基づくブール値として、trueまたはfalseをセットする。 The table creation unit 222 creates an execution order management table from a program having a synchronous description. First, the table creation unit 222 creates a table 222A from which the statements (code including the function) in the try block are extracted as shown in FIG. 21. Table 222A includes items of "item number", "statement", and "corresponding to API?". For "item number", a descending number is assigned to each "statement". In the item "Supports API?", Set true or false as a Boolean value based on whether each statement contains an object variable name included in the function call statement list or a function name.

表更新部224は、表作成部222で作成した表222Aに対し、「変数操作」、「並列性」の項目の列を追加して更新する。まず、表更新部224は、「変数操作」の項目として個別の変数操作ごとに追加し、変数の状態を変更するステートメントに「×」、参照するステートメントに「↓」を挿入する。図22に「変数操作」の項目を追加した表224Aの一例を示す。図22では変数操作として「data」、「cb_data0」の列を追加し、対応するステートメントの状態を更新している。なお、表更新部224の処理では、「ステートメント」、「APIに対応?」の項目に対する更新はないため、図面上の記載は省略するものとする。 The table update unit 224 updates the table 222A created by the table creation unit 222 by adding columns for the items of "variable operation" and "parallelism". First, the table update unit 224 adds each individual variable operation as an item of "variable operation", inserts "x" in the statement for changing the state of the variable, and inserts "↓" in the statement to be referenced. FIG. 22 shows an example of Table 224A to which the item of “variable operation” is added. In FIG. 22, columns "data" and "cb_data0" are added as variable operations, and the state of the corresponding statement is updated. In the process of the table update unit 224, the items "statement" and "API corresponding?" Are not updated, so the description on the drawing is omitted.

次に、表更新部224は、動詞表記憶部214の動詞表214Aを参照し、「並列性」の項目として、副作用のある動詞を含む関数ごとに列を追加する。また、表更新部224は、当該関数を呼び出しているステートメントに「×」、当該関数と同じ名詞を含む、または引数として同じ変数を用いている関数を呼び出しているステートメントに「↓」を挿入する。図23に動詞表214Aの一例を示す。動詞表214Aは動詞に対する副作用の有無をまとめた表である。図24に「並列性」の項目を追加した表224Bの一例を示す。図24では「並列性」の項目の関数として「writeFile」、「createBucket」、「putObject」の列を追加し、対応するステートメントの状態を更新している。なお、動詞表214Aが、動詞及び名詞に関するルールの一例である。 Next, the table update unit 224 refers to the verb table 214A of the verb table storage unit 214, and adds a column as an item of "parallelism" for each function including a verb having a side effect. Further, the table update unit 224 inserts "x" in the statement calling the function and "↓" in the statement calling the function containing the same noun as the function or using the same variable as an argument. .. FIG. 23 shows an example of the verb table 214A. The verb table 214A is a table summarizing the presence or absence of side effects on the verb. FIG. 24 shows an example of Table 224B to which the item of “parallelism” is added. In FIG. 24, columns of "writeFile", "createBucket", and "putObject" are added as functions of the item of "parallelism", and the state of the corresponding statement is updated. The verb table 214A is an example of rules regarding verbs and nouns.

次に、表更新部224は、更新した表の冗長な順序を除去する。図25に示すように、表224Bの項番5は、「createBucket」に関して、項番4と共に項番2の後に実行すべきとある。それと同時に、「putObject」に関して、項番4の後に実行すべきでもある。そのため、図25の矢印で示すように順序を特定することができ、項番5の下線付きの「↓」が冗長であるため、これを除去する。 Next, the table update unit 224 removes the redundant order of the updated table. As shown in FIG. 25, item number 5 in Table 224B should be executed after item number 2 together with item number 4 with respect to "create Bucket". At the same time, regarding "putObject", it should be executed after item number 4. Therefore, the order can be specified as shown by the arrow in FIG. 25, and the underlined “↓” in item No. 5 is redundant and is removed.

以上の表更新部224の更新処理により、並列性に基づく実行順序を特定する。 By the above update process of the table update unit 224, the execution order based on the parallelism is specified.

変換部226は、上記の第1実施形態の変換部26と同様の処理により、同期的な記述のプログラムを非同期的な記述のプログラムに変換する。変換部226は、変換した非同期的な記述のプログラムから、表更新部224で更新した表224Bを用いて、並列性に基づく実行順序を反映したプログラムを生成する。なお、変換したプログラムに対して実行順序を反映する場合を例に説明するが、変換と実行順序の反映を同時に処理してもよい。また、並列性に基づく実行順序を反映したプログラムを生成することが、複数のAPI呼び出し処理のうち並行して実行可能なAPI呼び出し処理を特定することの一例である。 The conversion unit 226 converts the program of the synchronous description into the program of the asynchronous description by the same processing as the conversion unit 26 of the first embodiment described above. The conversion unit 226 generates a program that reflects the execution order based on parallelism from the converted asynchronous description program by using the table 224B updated by the table update unit 224. Although the case of reflecting the execution order for the converted program will be described as an example, the conversion and the reflection of the execution order may be processed at the same time. Further, generating a program that reflects the execution order based on parallelism is an example of specifying an API call process that can be executed in parallel among a plurality of API call processes.

変換部226の具体的な反映処理について以下の処理(1)~処理(4)を説明する。 The following processes (1) to (4) will be described with respect to the specific reflection process of the conversion unit 226.

処理(1)で、まず表224Bで「×」だけが付いたステートメントを抽出する。抽出された各々のステートメントについて、ステートメントがAPI呼び出しに対応する場合、Promiseで囲むようにする。図26に処理(1)でPromiseで囲むように処理したステートメントの一例を示す。 In the process (1), first, the statements with only "x" in Table 224B are extracted. For each extracted statement, enclose it in a promise if the statement corresponds to an API call. FIG. 26 shows an example of a statement processed so as to be surrounded by a promise in the process (1).

次に処理(2)で、処理(1)にてPromiseで囲んだステートメントが複数ある場合は、図27に示すようにユニークな名前の配列に各々を格納し、最後にawait Promise.all()で囲むような記述に変換する。図28に表224Bで処理(2)の反映対象となる部分を下線にて示す。 Next, in process (2), if there are multiple statements enclosed in Promises in process (1), store each in an array with a unique name as shown in FIG. 27, and finally await Promise.all (). Convert to a description that is enclosed in. In FIG. 28, the portion to be reflected in the process (2) in Table 224B is underlined.

次に処理(3)で、1つだけ「↓」の付いているステートメントについて、上記の処理(1)、(2)を実施し、表224Bで「↓」の付いている列に「×」の付いているステートメントの後続に繋げる。Promise.allされる1つのステートメントに繋げたい場合、図29に示すように文をawaitするものに置き換え、これらを直列に配置したasync付き関数に変換する。このとき最後の文が変数定義文、代入文である場合、処理(2)と同様に最後の文をreturn文に置き換え後続文の変数参照をawait Promise.allの戻り値に置換する。図30に表224Bで処理(3)の反映対象となる部分を下線にて示す。 Next, in process (3), the above processes (1) and (2) are executed for the statement with only one "↓", and "x" is displayed in the column with "↓" in Table 224B. Connect to the following of the statement with. If you want to connect to one statement that is Promise.all, replace the statement with one that awaits as shown in Fig. 29, and convert these to a function with async arranged in series. At this time, if the last statement is a variable definition statement or an assignment statement, the last statement is replaced with a return statement and the variable reference of the subsequent statement is replaced with the return value of await Promise.all as in process (2). In FIG. 30, the portion to be reflected in the process (3) in Table 224B is underlined.

次に処理(4)で、表224Bで「↓」が2個以上あるステートメントは、「↓」の付いた行に「×」の付いたステートメントがawait Promise.allされるステートメントの直後に配置する。さらに、Promise.allされた最後のステートメントで定義され、代入される変数を参照している場合、その変数参照をawait Promise.allの戻り値_valuesに置換し、上記処理(1)、(2)を実施する。例えば、図31に示すように、1番目にpushしたPromiseの戻り値(ここではdata)を参照する場合、変数参照を_values[0]に置換する。図32に表224Bで処理(4)の反映対象となる部分を下線にて示す。なお、「×」、「↓」の付いていないステートメントには何も処理しないようにする。 Next, in process (4), the statement with two or more "↓" in Table 224B is placed immediately after the statement with "x" in the line with "↓" is await Promise.all. .. Furthermore, if a variable defined and assigned in the last statement of Promise.all is referenced, that variable reference is replaced with the return value _values of await Promise.all, and the above processes (1) and (2) ). For example, as shown in FIG. 31, when referring to the return value (data in this case) of the first pushed Promise, the variable reference is replaced with _values [0]. In FIG. 32, the portion to be reflected in the process (4) in Table 224B is underlined. In addition, do not process anything for statements without "x" and "↓".

以上の変換部226の反映処理により並列性に基づく実行順序を反映したプログラムが生成される。図33に並列性に基づく実行順序を反映したプログラムの一例を示す。 By the reflection process of the conversion unit 226 as described above, a program reflecting the execution order based on parallelism is generated. FIG. 33 shows an example of a program that reflects the execution order based on parallelism.

実行部228は、変換部226で生成された並列性に基づく実行順序を反映したプログラムを実行する。実行部228は、プログラムの実行順序に応じて、並列に実行可能な関数については、サーバー装置12のAPIの関数を並列に呼び出して処理する。なお、並列に実行可能な関数についてサーバー装置12のAPIの関数を並列に呼び出して処理することが、特定されたAPI呼び出し処理に関する情報をサーバー装置に送信することの一例である。 The execution unit 228 executes a program that reflects the execution order based on the parallelism generated by the conversion unit 226. The execution unit 228 calls and processes the API functions of the server device 12 in parallel for the functions that can be executed in parallel according to the execution order of the program. It should be noted that calling and processing the API function of the server device 12 in parallel for the function that can be executed in parallel is an example of transmitting the information regarding the specified API call process to the server device.

端末210は、例えば図34に示すコンピュータ250で実現することができる。コンピュータ250は、CPU51と、一時記憶領域としてのメモリ52と、不揮発性の記憶部253とを備える。また、コンピュータ250は、入出力I/F54と、記憶媒体59に対するデータの読み込み及び書き込みを制御するR/W部55と、インターネット等のネットワークに接続される通信I/F56とを備える。CPU51、メモリ52、記憶部253、入出力I/F54、R/W部55、及び通信I/F56は、バス57を介して互いに接続される。 The terminal 210 can be realized by, for example, the computer 250 shown in FIG. 34. The computer 250 includes a CPU 51, a memory 52 as a temporary storage area, and a non-volatile storage unit 253. Further, the computer 250 includes an input / output I / F 54, an R / W unit 55 that controls reading and writing of data to the storage medium 59, and a communication I / F 56 connected to a network such as the Internet. The CPU 51, the memory 52, the storage unit 253, the input / output I / F 54, the R / W unit 55, and the communication I / F 56 are connected to each other via the bus 57.

記憶部253は、HDD、SSD、フラッシュメモリ等によって実現できる。記憶媒体としての記憶部253には、コンピュータ250を端末210として機能させるためのAPI処理プログラム260が記憶される。API処理プログラム260は、前処理プロセス62と、関数特定プロセス63と、表作成プロセス262と、表更新プロセス263と、変換プロセス264と、実行プロセス265とを有する。 The storage unit 253 can be realized by an HDD, SSD, flash memory, or the like. The storage unit 253 as a storage medium stores an API processing program 260 for making the computer 250 function as a terminal 210. The API processing program 260 has a preprocessing process 62, a function specifying process 63, a table creation process 262, a table update process 263, a conversion process 264, and an execution process 265.

CPU51は、API処理プログラム260を記憶部253から読み出してメモリ52に展開し、API処理プログラム260が有するプロセスを順次実行する。CPU51は、前処理プロセス62を実行することで、図20に示す前処理部22として動作する。また、CPU51は、関数特定プロセス63を実行することで、図20に示す関数特定部24として動作する。また、CPU51は、表作成プロセス262を実行することで、図20に示す表作成部222として動作する。CPU51は、表更新プロセス263を実行することで、図20に示す表更新部224として動作する。また、CPU51は、変換プロセス264を実行することで、図20に示す変換部226として動作する。また、CPU51は、実行プロセス265を実行することで、図20に示す実行部228として動作する。これにより、API処理プログラム260を実行したコンピュータ250が、端末210として機能することになる。なお、プログラムを実行するCPU51はハードウェアである。 The CPU 51 reads the API processing program 260 from the storage unit 253, expands it into the memory 52, and sequentially executes the processes included in the API processing program 260. The CPU 51 operates as the pre-processing unit 22 shown in FIG. 20 by executing the pre-processing process 62. Further, the CPU 51 operates as the function specifying unit 24 shown in FIG. 20 by executing the function specifying process 63. Further, the CPU 51 operates as the table creation unit 222 shown in FIG. 20 by executing the table creation process 262. The CPU 51 operates as the table update unit 224 shown in FIG. 20 by executing the table update process 263. Further, the CPU 51 operates as the conversion unit 226 shown in FIG. 20 by executing the conversion process 264. Further, the CPU 51 operates as the execution unit 228 shown in FIG. 20 by executing the execution process 265. As a result, the computer 250 that has executed the API processing program 260 will function as the terminal 210. The CPU 51 that executes the program is hardware.

なお、API処理プログラム260により実現される機能は、例えば半導体集積回路、より詳しくはASIC等で実現することも可能である。 The function realized by the API processing program 260 can also be realized by, for example, a semiconductor integrated circuit, more specifically, an ASIC or the like.

次に、本実施形態に係るAPI処理システム200の作用について図35のフローチャートを参照して説明する。 Next, the operation of the API processing system 200 according to the present embodiment will be described with reference to the flowchart of FIG.

ステップS200で、表作成部222は、ステップS100での変換により得られた同期的な記述のプログラムから、実行順序管理表(表222A)を作成する。 In step S200, the table creation unit 222 creates an execution order management table (Table 222A) from the program of the synchronous description obtained by the conversion in step S100.

ステップS202で、表更新部224は、動詞表214Aを参照し、表作成部222で作成した表222Aに対し、「変数操作」、「並列性」の項目の列を追加して表224Bとして更新する。 In step S202, the table update unit 224 refers to the verb table 214A, adds columns for the items of "variable operation" and "parallelism" to the table 222A created by the table creation unit 222, and updates the table 224B. do.

ステップS204で、変換部226は、ステップS104で変換した非同期的な記述のプログラムから、ステップS202で更新した表224Bを用いて、並列性に基づく実行順序を反映したプログラムを生成する。 In step S204, the conversion unit 226 generates a program reflecting the execution order based on parallelism from the program of the asynchronous description converted in step S104 by using Table 224B updated in step S202.

ステップS206で、実行部228は、ステップS204で生成された並列性に基づく実行順序を反映したプログラムを実行する。実行部228は、プログラムの実行順序に応じて、並列に実行可能な関数については、サーバー装置12のAPIの関数を並列に呼び出して処理する。 In step S206, the execution unit 228 executes a program that reflects the execution order based on the parallelism generated in step S204. The execution unit 228 calls and processes the API functions of the server device 12 in parallel for the functions that can be executed in parallel according to the execution order of the program.

なお、第2実施形態の他の構成及び作用については第1実施形態と同様であるため説明を省略する。 Since the other configurations and operations of the second embodiment are the same as those of the first embodiment, the description thereof will be omitted.

以上説明したように、本実施形態に係るAPI処理システムによれば、同期的な記述に変換したプログラムを、特定した関数リストと、変換ルールとに基づいて、非同期的に記述されたプログラムに変換する。また、変換された非同期的な記述のプログラムから、動詞表を参照し、並列性に基づく実行順序を反映したプログラムを生成する。実行順序を反映したプログラムを実行する。このため、非同期的なプログラムの処理の作成及び実行を容易にし、かつ、並列性を考慮して効率よくプログラムを実行することができる。 As described above, according to the API processing system according to the present embodiment, the program converted into the synchronous description is converted into the program described asynchronously based on the specified function list and the conversion rule. do. Also, from the converted asynchronous description program, the verb table is referenced and a program that reflects the execution order based on parallelism is generated. Execute the program that reflects the execution order. Therefore, it is possible to facilitate the creation and execution of asynchronous program processing, and to efficiently execute the program in consideration of parallelism.

[第3実施形態]
次に第3実施形態について説明する。第3実施形態では、HTTPリクエストのメソッド、及びパスから並列性に基づく実行順序を反映したプログラムを生成する場合について説明する。なお第2実施形態と同様となる箇所については同一符号を付して説明を省略する。
[Third Embodiment]
Next, the third embodiment will be described. In the third embodiment, a case where a program reflecting the execution order based on parallelism is generated from the HTTP request method and the path will be described. The parts that are the same as those in the second embodiment are designated by the same reference numerals and the description thereof will be omitted.

本実施形態では、APIクライアントライブラリ内で実際に発行されるHTTPリクエストのメソッド、及びパスから並列性の有無を判定し、並列性に基づく実行順序をプログラムに反映する場合を例に説明する。 In this embodiment, a case where the presence / absence of parallelism is determined from the method and path of the HTTP request actually issued in the API client library and the execution order based on the parallelism is reflected in the program will be described as an example.

基本的な考え方としては、HTTPメソッドのうちPOST、PUT、DELETE、PATCHは副作用のあるメソッドであるものとする。副作用がある場合、それらと別のAPIを並列で呼び出した時に常に同じ結果になるとは限らないため並列処理は不可であるとする。また、プログラムが依存しているAPIライブラリのソースコードを用いる。APIライブラリの各関数のプログラムを静的に解析し、HTTPクライアントを用いてHTTPリクエストを送るコード片を探索する。発見したコード片から各関数の発行するHTTPリクエストのメソッド(GET,POST,PUT,DELETE,PATCH等)、パス("/path/to/resource"等)を特定し、関数HTTPリクエスト対応表に記録及び管理する。例えば、[(関数名,メソッド,パス),(getContents, GET,/contents)]といった対応表である。また、関数HTTPリクエスト対応表を用いて、あるAPI呼び出しをするステートメントAについて、メソッドがPOST,PUT,DELETE,PATCHである場合、Aのパスと前方一致するパスに対するHTTPリクエストを発行しかつプログラム中の出現順が後ろである各々のステートメントBについて、BはAと並列実行できないと判定する。 The basic idea is that among the HTTP methods, POST, PUT, DELETE, and PATCH are methods with side effects. If there are side effects, parallel processing is not possible because the same result is not always obtained when calling other APIs in parallel. Also, use the source code of the API library on which the program depends. The program of each function of the API library is statically analyzed, and the code piece that sends the HTTP request is searched for using the HTTP client. Specify the HTTP request method (GET, POST, PUT, DELETE, PATCH, etc.) and path ("/ path / to / resource", etc.) issued by each function from the found code piece, and record it in the function HTTP request correspondence table. And manage. For example, it is a correspondence table such as [(function name, method, path), (getContents, GET, / contents)]. In addition, when the method is POST, PUT, DELETE, PATCH for the statement A that makes a certain API call using the function HTTP request correspondence table, an HTTP request is issued for the path that prefixes with the path of A and is being programmed. For each statement B whose appearance order is after, B determines that it cannot be executed in parallel with A.

図36に示すように、API処理システム300の端末310は、機能的には、APIクライアントライブラリ14と、変換ルール16と、前処理部22と、関数特定部24と、変換部226と、実行部228と、通信部30とを含む。また、端末310は、表作成部222と、関数対応表作成部322と、表更新部324とを含む。 As shown in FIG. 36, the terminal 310 of the API processing system 300 functionally executes the API client library 14, the conversion rule 16, the preprocessing unit 22, the function specifying unit 24, and the conversion unit 226. A unit 228 and a communication unit 30 are included. Further, the terminal 310 includes a table creation unit 222, a function correspondence table creation unit 322, and a table update unit 324.

表作成部222には、前処理部22での変換により得られた同期的な記述のプログラムが入力される。本実施形態では、図37に示す同期的な記述のプログラムが入力された場合を例に説明する。また、図38に、図37のプログラムから関数特定部24で特定された関数リスト24Bの一例を示す。 A program of synchronous description obtained by the conversion in the preprocessing unit 22 is input to the table creation unit 222. In this embodiment, the case where the program of the synchronous description shown in FIG. 37 is input will be described as an example. Further, FIG. 38 shows an example of the function list 24B specified by the function specifying unit 24 from the program of FIG. 37.

図39に、表作成部222で図37のプログラムから作成された表222Bの一例を示す。 FIG. 39 shows an example of Table 222B created by the table creation unit 222 from the program of FIG. 37.

関数対応表作成部322は、同期的な記述のプログラムから、APIクライアントライブラリ14の内容に基づいて、関数HTTPリクエスト対応表322Aを作成する。なお、関数HTTPリクエスト対応表322Aが、リクエストに関するルールの一例である。 The function correspondence table creation unit 322 creates the function HTTP request correspondence table 322A from the program of the synchronous description based on the contents of the API client library 14. The function HTTP request correspondence table 322A is an example of a rule regarding a request.

関数対応表作成部322は、まずAPIクライアントライブラリ14のソースコードをパーズして、抽象構文木(AST)を生成する。次に、入力されたプログラムについて、対象となる関数を宣言しているステートメントを探索する。関数宣言内でHTTPクライアントを用いてリクエストを送信している箇所のステートメントを探索する。使用しているHTTPクライアントの種類に対応した方法によってメソッドとパスを特定し、関数HTTPリクエスト対応表322Aに追加する。例えば、Node.jsのrequestライブラリを用いた例では、request.get(‘http://myapi.com/api/users’)のステートメントについて、メソッドが「GET」、パスが「http://myapi.com/api/users」と特定する。図40に関数HTTPリクエスト対応表322Aの一例を示す。関数HTTPリクエスト対応表322Aを参照することで、createUserはメソッドが「POST」で、putDataはcreateUserのパスに前方一致することが分かる。これにより、putDataはcreateUserと並列実行できないと判定できる。 The function correspondence table creation unit 322 first parses the source code of the API client library 14 and generates an abstract syntax tree (AST). Next, for the input program, search for the statement that declares the target function. Search for the statement in the function declaration where the request is being sent using the HTTP client. The method and path are specified by the method corresponding to the type of HTTP client used, and added to the function HTTP request correspondence table 322A. For example, in the example using the request library of Node.js, the method is "GET" and the path is "http: // myapi" for the statement of request.get ('http://myapi.com/api/users'). Specify as ".com/api/users". FIG. 40 shows an example of the function HTTP request correspondence table 322A. By referring to the function HTTP request correspondence table 322A, it can be seen that the method of createUser is "POST" and putData is prefix-matched to the path of createUser. From this, it can be determined that putData cannot be executed in parallel with createUser.

表更新部324は、表作成部222で作成した表222Bに対し、関数対応表作成部322で作成された関数HTTPリクエスト対応表322Aを参照し、「変数操作」、「並列性」の項目の列を追加して更新する。「変数操作」の項目の追加処理については上記第2実施形態の表更新部224と同様である。「並列性」の項目については、前方一致するパスごとに列を追加する。図41に「並列性」の項目を追加した表324Aの一例を示す。図41では、「並列性」の項目としてパスの固定部分(http://myapi.com/api/)が前方一致した後ろのパスである「/users」、「/contents」を追加し、対応するステートメントの状態を更新している。また、状態の更新では、先に実行するステートメントに「×」、後で実行するステートメントに「↓」を挿入している。 The table update unit 324 refers to the function HTTP request correspondence table 322A created by the function correspondence table creation unit 322 with respect to the table 222B created by the table creation unit 222, and has items of "variable operation" and "parallelism". Add columns and update. The additional processing of the item of "variable operation" is the same as the table update unit 224 of the second embodiment. For the "Parallel" item, add a column for each prefix-matching path. FIG. 41 shows an example of Table 324A to which the item of “parallelism” is added. In FIG. 41, "/ users" and "/ contents", which are the paths after the fixed part of the path (http://myapi.com/api/) is prefix-matched, are added as "parallelism" items to support them. The state of the statement to be updated. In updating the status, "x" is inserted in the statement to be executed first, and "↓" is inserted in the statement to be executed later.

図42に、変換部226が図41の表324Aを用いて生成した並列性に基づく実行順序を反映したプログラムの一例を示す。なお、変換部226の処理は、上記第2実施形態の表224Bを表324Aと読み替えて実施すればよい。 FIG. 42 shows an example of a program that reflects the execution order based on the parallelism generated by the conversion unit 226 using Table 324A of FIG. 41. The processing of the conversion unit 226 may be carried out by replacing Table 224B of the second embodiment with Table 324A.

端末310は、例えば図43に示すコンピュータ350で実現することができる。コンピュータ350は、CPU51と、一時記憶領域としてのメモリ52と、不揮発性の記憶部353とを備える。また、コンピュータ350は、入出力I/F54と、記憶媒体59に対するデータの読み込み及び書き込みを制御するR/W部55と、インターネット等のネットワークに接続される通信I/F56とを備える。CPU51、メモリ52、記憶部353、入出力I/F54、R/W部55、及び通信I/F56は、バス57を介して互いに接続される。 The terminal 310 can be realized by, for example, the computer 350 shown in FIG. 43. The computer 350 includes a CPU 51, a memory 52 as a temporary storage area, and a non-volatile storage unit 353. Further, the computer 350 includes an input / output I / F 54, an R / W unit 55 that controls reading and writing of data to the storage medium 59, and a communication I / F 56 connected to a network such as the Internet. The CPU 51, the memory 52, the storage unit 353, the input / output I / F 54, the R / W unit 55, and the communication I / F 56 are connected to each other via the bus 57.

記憶部353は、HDD、SSD、フラッシュメモリ等によって実現できる。記憶媒体としての記憶部353には、コンピュータ350を端末310として機能させるためのAPI処理プログラム360が記憶される。API処理プログラム360は、前処理プロセス62と、関数特定プロセス63と、表作成プロセス262と、表更新プロセス363と、関数対応表作成プロセス362と、変換プロセス264と、実行プロセス265とを有する。 The storage unit 353 can be realized by an HDD, SSD, flash memory, or the like. The storage unit 353 as a storage medium stores an API processing program 360 for making the computer 350 function as a terminal 310. The API processing program 360 includes a preprocessing process 62, a function specifying process 63, a table creation process 262, a table update process 363, a function correspondence table creation process 362, a conversion process 264, and an execution process 265.

CPU51は、API処理プログラム360を記憶部353から読み出してメモリ52に展開し、API処理プログラム360が有するプロセスを順次実行する。CPU51は、前処理プロセス62を実行することで、図36に示す前処理部22として動作する。また、CPU51は、関数特定プロセス63を実行することで、図36に示す関数特定部24として動作する。また、CPU51は、表作成プロセス262を実行することで、図36に示す表作成部222として動作する。また、CPU51は、関数対応表作成プロセス362を実行することで、図36に示す関数対応表作成部322として動作する。CPU51は、表更新プロセス363を実行することで、図36に示す表更新部324として動作する。また、CPU51は、変換プロセス264を実行することで、図36に示す変換部226として動作する。また、CPU51は、実行プロセス265を実行することで、図36に示す実行部228として動作する。これにより、API処理プログラム360を実行したコンピュータ350が、端末310として機能することになる。なお、プログラムを実行するCPU51はハードウェアである。 The CPU 51 reads the API processing program 360 from the storage unit 353, expands it into the memory 52, and sequentially executes the processes included in the API processing program 360. The CPU 51 operates as the pre-processing unit 22 shown in FIG. 36 by executing the pre-processing process 62. Further, the CPU 51 operates as the function specifying unit 24 shown in FIG. 36 by executing the function specifying process 63. Further, the CPU 51 operates as the table creation unit 222 shown in FIG. 36 by executing the table creation process 262. Further, the CPU 51 operates as the function correspondence table creation unit 322 shown in FIG. 36 by executing the function correspondence table creation process 362. The CPU 51 operates as the table update unit 324 shown in FIG. 36 by executing the table update process 363. Further, the CPU 51 operates as the conversion unit 226 shown in FIG. 36 by executing the conversion process 264. Further, the CPU 51 operates as the execution unit 228 shown in FIG. 36 by executing the execution process 265. As a result, the computer 350 that has executed the API processing program 360 will function as the terminal 310. The CPU 51 that executes the program is hardware.

なお、API処理プログラム360により実現される機能は、例えば半導体集積回路、より詳しくはASIC等で実現することも可能である。 The function realized by the API processing program 360 can also be realized by, for example, a semiconductor integrated circuit, more specifically, an ASIC or the like.

次に、本実施形態に係るAPI処理システム300の作用について図44のフローチャートを参照して説明する。 Next, the operation of the API processing system 300 according to the present embodiment will be described with reference to the flowchart of FIG.

ステップS300で、関数対応表作成部322は、同期的な記述のプログラムから、APIクライアントライブラリ14の内容に基づいて、関数HTTPリクエスト対応表322Aを作成する。 In step S300, the function correspondence table creation unit 322 creates the function HTTP request correspondence table 322A from the program described synchronously based on the contents of the API client library 14.

ステップS302で、表更新部324は、表作成部222で作成した表222Bに対し、関数対応表作成部322で作成された関数HTTPリクエスト対応表322Aを参照し、「変数操作」、「並列性」の項目の列を追加して表324Aとして更新する。 In step S302, the table update unit 324 refers to the function HTTP request correspondence table 322A created by the function correspondence table creation unit 322 with respect to the table 222B created by the table creation unit 222, and refers to "variable operation" and "parallelism". ”Item column is added and updated as Table 324A.

なお、第3実施形態の他の構成及び作用については第2実施形態と同様であるため説明を省略する。 Since the other configurations and operations of the third embodiment are the same as those of the second embodiment, the description thereof will be omitted.

以上説明したように、本実施形態に係るAPI処理システムによれば、同期的な記述に変換したプログラムを、特定した関数リストと、変換ルールとに基づいて、非同期的に記述されたプログラムに変換する。また、変換された非同期的な記述のプログラムから、関数HTTPリクエスト対応表を参照し、並列性に基づく実行順序を反映したプログラムを生成する。実行順序を反映したプログラムを実行する。このため、非同期的なプログラムの処理の作成及び実行を容易にし、かつ、並列性を考慮して効率よくプログラムを実行することができる。 As described above, according to the API processing system according to the present embodiment, the program converted into the synchronous description is converted into the program described asynchronously based on the specified function list and the conversion rule. do. In addition, the function HTTP request correspondence table is referred to from the converted asynchronous description program, and a program that reflects the execution order based on parallelism is generated. Execute the program that reflects the execution order. Therefore, it is possible to facilitate the creation and execution of asynchronous program processing, and to efficiently execute the program in consideration of parallelism.

[第4実施形態]
次に第4実施形態について説明する。第4実施形態では、aws-sdkやGitHub等のソースコードリポジトリの関数呼び出しの出現順から並列性に基づく実行順序を反映したプログラムを生成する場合について説明する。なお第2又は第3実施形態と同様となる箇所については同一符号を付して説明を省略する。
[Fourth Embodiment]
Next, the fourth embodiment will be described. In the fourth embodiment, a case where a program reflecting the execution order based on parallelism is generated from the appearance order of the function calls of the source code repository such as aws-sdk and GitHub will be described. The same parts as those in the second or third embodiment are designated by the same reference numerals and the description thereof will be omitted.

本実施形態では、ソースコードリポジトリ中で同じAPIライブラリを用いた多数のプログラムを解析し、関数呼び出しの出現順が全て同じかどうかで並列性の有無を判定し、並列性に基づく実行順序をプログラムに反映する場合を例に説明する。 In this embodiment, a large number of programs using the same API library are analyzed in the source code repository, the presence or absence of parallelism is determined based on whether the appearance order of function calls is the same, and the execution order based on the parallelism is programmed. The case of reflecting in is described as an example.

ソースコードリポジトリからAPIクライアントライブラリを用いているプログラムを抽出して用いる。抽出した全てのプログラムを静的解析し、同じ変数を値の変更無しに少なくとも一つ引数として用いているAPI呼び出し関数のペア(関数A、及び関数B)を全て抽出する。ただし関数Aの方が関数Bよりも出現順が先とする。ある関数A、及び関数Bについて、抽出したペアの中で関数A、及び関数Bの出現するものが全て関数A、及び関数Bの順番である場合、関数A、及び関数Bに暗黙の呼び出し順序があると判定し、並列不可ペア管理表に記録及び管理しておく。例えば、[(先に呼ぶ関数,後で呼ぶ関数),(関数A,関数B)]といった管理表である。あるAPI呼び出しをするステートメントα、ステートメントβについて、各々が呼び出している関数が関数A、及び関数Bの場合、並列不可ペア管理表に(関数A,関数B)が含まれている場合、αとβは並列処理不可であると判定する。 Extract the program using API client library from the source code repository and use it. All the extracted programs are statically analyzed, and all the pairs of API call functions (function A and function B) that use the same variable as at least one argument without changing the value are extracted. However, the function A comes before the function B in the order of appearance. For a certain function A and function B, if all of the extracted pairs in which function A and function B appear are in the order of function A and function B, the order of implicit call to function A and function B is implicit. It is determined that there is, and it is recorded and managed in the non-parallel pair management table. For example, it is a management table such as [(function called first, function called later), (function A, function B)]. For statement α and statement β that make a certain API call, if the functions being called are function A and function B, and if the non-parallelizable pair management table contains (function A, function B), then α and β determines that parallel processing is not possible.

図45に示すように、API処理システム400の端末410は、機能的には、APIクライアントライブラリ14と、変換ルール16と、前処理部22と、関数特定部24と、変換部226と、実行部228と、通信部30とを含む。また、端末410は、表作成部222と、管理表作成部422と、表更新部424とを含む。また、端末410はネットワーク3を介して外部のaws-sdkやGitHub等のソースコードリポジトリ414と接続されている。 As shown in FIG. 45, the terminal 410 of the API processing system 400 functionally executes the API client library 14, the conversion rule 16, the preprocessing unit 22, the function specifying unit 24, and the conversion unit 226. A unit 228 and a communication unit 30 are included. Further, the terminal 410 includes a table creation unit 222, a management table creation unit 422, and a table update unit 424. Further, the terminal 410 is connected to an external source code repository 414 such as aws-sdk or GitHub via the network 3.

表作成部222には、前処理部22での変換により得られた同期的な記述のプログラムが入力される。本実施形態では、図46に示す同期的な記述のプログラムが入力された場合を例に説明する。また、図47に、図46のプログラムから関数特定部24で特定された関数リスト24Cの一例を示す。 A program of synchronous description obtained by the conversion in the preprocessing unit 22 is input to the table creation unit 222. In the present embodiment, the case where the program of the synchronous description shown in FIG. 46 is input will be described as an example. Further, FIG. 47 shows an example of the function list 24C specified by the function specifying unit 24 from the program of FIG. 46.

図48に、表作成部222で図46のプログラムから作成された表222Cの一例を示す。 FIG. 48 shows an example of Table 222C created by the table creation unit 222 from the program of FIG. 46.

管理表作成部422は、同期的な記述のプログラムから、ソースコードリポジトリ414の内容を参照して、並列不可ペア管理表422Aを作成する。なお、並列不可ペア管理表422Aが、リポジトリに関するルールの一例である。 The management table creation unit 422 creates the non-parallel pair management table 422A by referring to the contents of the source code repository 414 from the program of the synchronous description. Note that the non-parallelable pair management table 422A is an example of the rules related to the repository.

管理表作成部422は、まずソースコードリポジトリ414から、図49に示すように、静的解析によってcreateBucket,putObjectを同じ参照及び値で呼び出しているソースコードを全て抽出する。createBucket,putObjectは表222Cで同じオブジェクト変数名である。抽出したソースコードのうち、putObjectからcreateBucketの順で呼び出すソースコードが他に存在しないことを検出し、並列不可ペア管理表422Aに追加する。図50に示すように、並列不可ペア管理表422Aには、先頭にソースコードリポジトリ名及びオブジェクト変数名を付与し、先に呼ぶ関数に「aws-sdk#S3.createBucket」、後で呼ぶ関数に「aws-sdk#S3.putObject」を追加する。なお、上記以外の並列不可ペアは未発見なものとして以下説明する。 The management table creation unit 422 first extracts from the source code repository 414 all the source code that calls createBucket and putObject with the same reference and value by static analysis, as shown in FIG. 49. createBucket and putObject have the same object variable name in Table 222C. Among the extracted source code, it is detected that there is no other source code to be called from putObject in the order of createBucket, and it is added to the non-parallel pair management table 422A. As shown in FIG. 50, in the non-parallel pair management table 422A, the source code repository name and the object variable name are given at the beginning, "aws-sdk # S3.createBucket" is added to the function to be called first, and the function to be called later is used. Add "aws-sdk # S3.putObject". It should be noted that the non-parallelable pairs other than the above will be described below as undiscovered ones.

表更新部424は、表作成部222で作成した表222Cに対し、管理表作成部422で作成された並列不可ペア管理表422Aを参照し、「変数操作」、「並列性」の項目の列を追加して更新する。「変数操作」の項目の追加処理については上記第2実施形態の表更新部224と同様である。「並列性」の項目については、APIに対応する関数ごとに列を追加する。図51に「並列性」の項目を追加した表424Aの一例を示す。図51では、「並列性」の項目としてリポジトリ名及びオブジェクト変数を付与した関数名「aws-sdk#S3.createBucket」、「aws-sdk#DyanmoDB.createTable」、「aws-sdk#S3.
putObject」を追加し、対応するステートメントの状態を更新している。また、状態の更新は先に実行するステートメントに「×」、後で実行するステートメントに「↓」を挿入している。並列不可ペアが未発見の関数は、関数呼び出しを行っているステートメントにのみ「×」を挿入している。
The table update unit 424 refers to the non-parallelizable pair management table 422A created by the management table creation unit 422 with respect to the table 222C created by the table creation unit 222, and the columns of the items of "variable operation" and "parallelism". To add and update. The additional processing of the item of "variable operation" is the same as the table update unit 224 of the second embodiment. For the item of "parallelism", add a column for each function corresponding to API. FIG. 51 shows an example of Table 424A to which the item of “parallelism” is added. In FIG. 51, the function names "aws-sdk # S3.createBucket", "aws-sdk # DyanmoDB.createTable", and "aws-sdk # S3."
"PutObject" is added and the state of the corresponding statement is updated. To update the status, "x" is inserted in the statement to be executed first, and "↓" is inserted in the statement to be executed later. A function for which a non-parallelable pair has not been found inserts an "x" only in the statement making the function call.

図52に、図51の表424Aを用いて生成した並列性に基づく実行順序を反映したプログラムの一例を示す。 FIG. 52 shows an example of a program that reflects the execution order based on the parallelism generated by using Table 424A of FIG.

端末410は、例えば図53に示すコンピュータ450で実現することができる。コンピュータ450は、CPU51と、一時記憶領域としてのメモリ52と、不揮発性の記憶部453とを備える。また、コンピュータ450は、入出力I/F54と、記憶媒体59に対するデータの読み込み及び書き込みを制御するR/W部55と、インターネット等のネットワークに接続される通信I/F56とを備える。CPU51、メモリ52、記憶部453、入出力I/F54、R/W部55、及び通信I/F56は、バス57を介して互いに接続される。 The terminal 410 can be realized by, for example, the computer 450 shown in FIG. 53. The computer 450 includes a CPU 51, a memory 52 as a temporary storage area, and a non-volatile storage unit 453. Further, the computer 450 includes an input / output I / F 54, an R / W unit 55 that controls reading and writing of data to the storage medium 59, and a communication I / F 56 connected to a network such as the Internet. The CPU 51, the memory 52, the storage unit 453, the input / output I / F 54, the R / W unit 55, and the communication I / F 56 are connected to each other via the bus 57.

記憶部453は、HDD、SSD、フラッシュメモリ等によって実現できる。記憶媒体としての記憶部453には、コンピュータ450を端末410として機能させるためのAPI処理プログラム460が記憶される。API処理プログラム460は、前処理プロセス62と、関数特定プロセス63と、表作成プロセス262と、表更新プロセス463と、管理表作成プロセス462と、変換プロセス264と、実行プロセス265とを有する。 The storage unit 453 can be realized by an HDD, SSD, flash memory, or the like. The storage unit 453 as a storage medium stores an API processing program 460 for making the computer 450 function as a terminal 410. The API processing program 460 has a preprocessing process 62, a function specifying process 63, a table creation process 262, a table update process 463, a management table creation process 462, a conversion process 264, and an execution process 265.

CPU51は、API処理プログラム460を記憶部453から読み出してメモリ52に展開し、API処理プログラム460が有するプロセスを順次実行する。CPU51は、前処理プロセス62を実行することで、図45に示す前処理部22として動作する。また、CPU51は、関数特定プロセス63を実行することで、図45に示す関数特定部24として動作する。また、CPU51は、表作成プロセス262を実行することで、図45に示す表作成部222として動作する。また、CPU51は、管理表作成プロセス462を実行することで、図45に示す管理表作成部422として動作する。CPU51は、表更新プロセス463を実行することで、図45に示す表更新部424として動作する。また、CPU51は、変換プロセス264を実行することで、図45に示す変換部226として動作する。また、CPU51は、実行プロセス265を実行することで、図45に示す実行部228として動作する。これにより、API処理プログラム460を実行したコンピュータ450が、端末410として機能することになる。なお、プログラムを実行するCPU51はハードウェアである。 The CPU 51 reads the API processing program 460 from the storage unit 453, expands the API processing program 460 into the memory 52, and sequentially executes the processes included in the API processing program 460. The CPU 51 operates as the pre-processing unit 22 shown in FIG. 45 by executing the pre-processing process 62. Further, the CPU 51 operates as the function specifying unit 24 shown in FIG. 45 by executing the function specifying process 63. Further, the CPU 51 operates as the table creation unit 222 shown in FIG. 45 by executing the table creation process 262. Further, the CPU 51 operates as the management table creation unit 422 shown in FIG. 45 by executing the management table creation process 462. The CPU 51 operates as the table update unit 424 shown in FIG. 45 by executing the table update process 463. Further, the CPU 51 operates as the conversion unit 226 shown in FIG. 45 by executing the conversion process 264. Further, the CPU 51 operates as the execution unit 228 shown in FIG. 45 by executing the execution process 265. As a result, the computer 450 that has executed the API processing program 460 functions as the terminal 410. The CPU 51 that executes the program is hardware.

なお、API処理プログラム460により実現される機能は、例えば半導体集積回路、より詳しくはASIC等で実現することも可能である。 The function realized by the API processing program 460 can also be realized by, for example, a semiconductor integrated circuit, more specifically, an ASIC or the like.

次に、本実施形態に係るAPI処理システム400の作用について図54のフローチャートを参照して説明する。 Next, the operation of the API processing system 400 according to the present embodiment will be described with reference to the flowchart of FIG.

ステップS400で、管理表作成部422は、同期的な記述のプログラムから、ソースコードリポジトリ414の内容を参照して、並列不可ペア管理表422Aを作成する。 In step S400, the management table creation unit 422 creates the non-parallel pair management table 422A by referring to the contents of the source code repository 414 from the program described synchronously.

ステップS402で、表更新部324は、表作成部222で作成した表222Cに対し、管理表作成部422で作成された並列不可ペア管理表422Aを参照し、「変数操作」、「並列性」の項目の列を追加して表424Aとして更新する。 In step S402, the table update unit 324 refers to the non-parallelizable pair management table 422A created by the management table creation unit 422 with respect to the table 222C created by the table creation unit 222, and refers to "variable operation" and "parallelism". The column of the item of is added and updated as Table 424A.

なお、第4実施形態の他の構成及び作用については第3実施形態と同様であるため説明を省略する。 Since the other configurations and operations of the fourth embodiment are the same as those of the third embodiment, the description thereof will be omitted.

以上説明したように、本実施形態に係るAPI処理システムによれば、同期的な記述に変換したプログラムを、特定した関数リストと、変換ルールとに基づいて、非同期的に記述されたプログラムに変換する。また、変換された非同期的な記述のプログラムから、並列不可ペア管理表を参照し、並列性に基づく実行順序を反映したプログラムを生成する。実行順序を反映したプログラムを実行する。このため、非同期的なプログラムの処理の作成及び実行を容易にし、かつ、並列性を考慮して効率よくプログラムを実行することができる。 As described above, according to the API processing system according to the present embodiment, the program converted into the synchronous description is converted into the program described asynchronously based on the specified function list and the conversion rule. do. Also, from the converted asynchronous description program, refer to the non-parallelizable pair management table and generate a program that reflects the execution order based on parallelism. Execute the program that reflects the execution order. Therefore, it is possible to facilitate the creation and execution of asynchronous program processing, and to efficiently execute the program in consideration of parallelism.

なお、第2~第4実施形態の手法は、図55に示すように、APIの特徴に適した得意な適用先を選んで適用することができる。適用範囲は相互排他的ではなく、複数適用可能なものもある。そのため、第2~第4実施形態の手法を組み合わせて、並列性に基づく実行順序を反映したプログラムを生成するようにしてもよい。 As shown in FIG. 55, the methods of the second to fourth embodiments can be applied by selecting a good application destination suitable for the characteristics of the API. The scope of application is not mutually exclusive, and there are some that can be applied multiple times. Therefore, the methods of the second to fourth embodiments may be combined to generate a program that reflects the execution order based on parallelism.

以上の各実施形態に関し、更に以下の付記を開示する。 The following additional notes will be further disclosed with respect to each of the above embodiments.

(付記1)
第一の形式で記載されたプログラムであって、当該プログラムにて定義された複数のAPI呼び出し処理を実行する端末と、
前記複数のAPI呼び出し処理に応じて、当該API呼び出し処理に対応する処理を実行するよう第二の形式で記載されたプログラムを動作させる複数のサーバー装置とを有し、
前記端末は、
前記第二の形式で記載されたプログラムに関する情報を取得し、
取得したプログラムに関する情報に基づいて前記複数のAPI呼び出し処理のうち並行して実行可能なAPI呼び出し処理を特定し、
特定されたAPI呼び出し処理に関する情報をサーバー装置に送信する、
API処理方法。
(Appendix 1)
A program described in the first format, which is a terminal that executes a plurality of API call processes defined in the program, and a terminal.
It has a plurality of server devices for operating a program described in the second format so as to execute a process corresponding to the API call process in response to the plurality of API call processes.
The terminal is
Obtain information about the program described in the second format,
Based on the acquired information about the program, the API call process that can be executed in parallel among the plurality of API call processes is specified.
Send information about the identified API call process to the server device,
API processing method.

(付記2)
前記端末は、
前記第一の形式を、前記API呼び出し処理を並行して実行しない同期的な記載の形式とし、
前記第二の形式を、前記API呼び出し処理を並行して実行可能な非同期的な記載の形式とし、
前記第一の形式で記載されたプログラムを、前記API呼び出し処理に対応する予め定められた関数のリストと、同期的な記載を非同期的な記載に変換するための予め定められたルールとに基づいて、前記第二の形式で記載されたプログラムに変換する付記1に記載のAPI処理方法。
(Appendix 2)
The terminal is
The first format is a synchronous description format in which the API call processing is not executed in parallel.
The second form is an asynchronous description form in which the API call processing can be executed in parallel.
The program described in the first form is based on a predetermined list of functions corresponding to the API call processing and a predetermined rule for converting a synchronous description into an asynchronous description. The API processing method according to Appendix 1 for converting to the program described in the second format.

(付記3)
前記端末は、
前記第一の形式を、前記API呼び出し処理を並行して実行しない同期的な記載、及び前記API呼び出し処理を並行して実行可能な非同期的な記載を含む形式とし、
前記第二の形式を、前記非同期的な記載の形式とし、
前記第一の形式で記載されたプログラムに含まれる、前記非同期的な記載を、前記同期的な記載に変換し、
前記非同期的な記載を、前記同期的な記載に変換したプログラムを、前記API呼び出し処理に対応する予め定められた関数のリストと、同期的な記載を非同期的な記載に変換するための予め定められたルールとに基づいて、前記第二の形式で記載されたプログラムに変換する付記1に記載のAPI処理方法。
(Appendix 3)
The terminal is
The first format is a format including a synchronous description in which the API call processing is not executed in parallel and an asynchronous description in which the API call processing can be executed in parallel.
The second form is defined as the asynchronous description form.
The asynchronous description contained in the program described in the first format is converted into the synchronous description.
A list of predetermined functions corresponding to the API call processing of the program in which the asynchronous description is converted into the synchronous description, and a predetermined description for converting the synchronous description into the asynchronous description. The API processing method according to Appendix 1, which converts the program into the program described in the second format based on the rule.

(付記4)
前記端末は、
前記第一の形式で記載されたプログラムを、前記第二の形式で記載されたプログラムに変換する際に、前記API呼び出し処理に含まれる関数に対して予め定められた、動詞及び名詞に関するルールに基づいて、前記第一の形式で記載されたプログラムに含まれる前記複数のAPI呼び出し処理のうち、並行して実行可能な処理の実行順序を特定し、特定した前記実行順序に基づいて、前記複数のAPI呼び出し処理のうち、並行して実行可能な処理を並行して実行するように、前記変換に反映する付記2又は付記3に記載のAPI処理方法。
(Appendix 4)
The terminal is
When converting the program described in the first form to the program described in the second form, the rules regarding verbs and nomenclature predetermined for the functions included in the API call processing are applied. Based on this, among the plurality of API call processes included in the program described in the first format, the execution order of the processes that can be executed in parallel is specified, and the plurality of processes are executed based on the specified execution order. The API processing method according to Appendix 2 or Appendix 3, which is reflected in the conversion so that the processes that can be executed in parallel are executed in parallel among the API call processes of the above.

(付記5)
前記端末は、
前記第一の形式で記載されたプログラムを、前記第二の形式で記載されたプログラムに変換する際に、前記API呼び出し処理に含まれる関数に対して予め定められた、リクエストに関するルールに基づいて、前記第一の形式で記載されたプログラムに含まれる前記複数のAPI呼び出し処理のうち、並行して実行可能な処理の実行順序を特定し、特定した前記実行順序に基づいて、前記複数のAPI呼び出し処理のうち、並行して実行可能な処理を並行して実行するように、前記変換に反映する付記2又は付記3に記載のAPI処理方法。
(Appendix 5)
The terminal is
When converting the program described in the first format to the program described in the second format, based on the rules regarding the request predetermined for the function included in the API call processing. , Among the plurality of API call processes included in the program described in the first form, the execution order of the processes that can be executed in parallel is specified, and the plurality of APIs are specified based on the specified execution order. The API processing method according to Appendix 2 or Appendix 3, which is reflected in the conversion so that the processes that can be executed in parallel are executed in parallel among the call processes.

(付記6)
前記端末は、
前記第一の形式で記載されたプログラムを、前記第二の形式で記載されたプログラムに変換する際に、前記API呼び出し処理に含まれる関数に対して予め定められた、リポジトリに関するルールに基づいて、前記第一の形式で記載されたプログラムに含まれる前記複数のAPI呼び出し処理のうち、並行して実行可能な処理の実行順序を特定し、特定した前記実行順序に基づいて、前記複数のAPI呼び出し処理のうち、並行して実行可能な処理を並行して実行するように、前記変換に反映する付記2又は付記3に記載のAPI処理方法。
(Appendix 6)
The terminal is
When converting the program described in the first format to the program described in the second format, based on the rules regarding the repository predetermined for the function included in the API call processing. , Among the plurality of API call processes included in the program described in the first form, the execution order of the processes that can be executed in parallel is specified, and the plurality of APIs are specified based on the specified execution order. The API processing method according to Appendix 2 or Appendix 3, which is reflected in the conversion so that the processes that can be executed in parallel are executed in parallel among the call processes.

(付記7)
第一の形式で記載されたプログラムであって、当該プログラムにて定義された複数のAPI呼び出し処理を実行する端末であって、
第二の形式で記載されたプログラムに関する情報を取得し、取得したプログラムに関する情報に基づいて前記複数のAPI呼び出し処理のうち並行して実行可能なAPI呼び出し処理を特定する特定部と、
特定されたAPI呼び出し処理に関する情報を、前記複数のAPI呼び出し処理に応じて、当該API呼び出し処理に対応する処理を実行するよう前記第二の形式で記載されたプログラムを動作させる複数のサーバー装置に送信する実行部と、
を含む端末。
(Appendix 7)
A program described in the first format, which is a terminal that executes a plurality of API call processes defined in the program.
A specific unit that acquires information about a program described in the second format and specifies an API call process that can be executed in parallel among the plurality of API call processes based on the acquired information.
Information about the specified API call processing is transmitted to a plurality of server devices that operate a program described in the second format so as to execute the processing corresponding to the API call processing in response to the plurality of API call processing. The execution part to send and
Terminals including.

(付記8)
前記端末は、
前記第一の形式を、前記API呼び出し処理を並行して実行しない同期的な記載の形式とし、
前記第二の形式を、前記API呼び出し処理を並行して実行可能な非同期的な記載の形式とし、
前記実行部は、前記第一の形式で記載されたプログラムを、前記API呼び出し処理に対応する予め定められた関数のリストと、同期的な記載を非同期的な記載に変換するための予め定められたルールとに基づいて、前記第二の形式で記載されたプログラムに変換する付記7に記載の端末。
(Appendix 8)
The terminal is
The first format is a synchronous description format in which the API call processing is not executed in parallel.
The second form is an asynchronous description form in which the API call processing can be executed in parallel.
The execution unit is predetermined to convert the program described in the first format into a list of predetermined functions corresponding to the API call processing and a synchronous description into an asynchronous description. The terminal according to Appendix 7, which converts the program into the program described in the second format based on the above rule.

(付記9)
前記端末は、
前記第一の形式を、前記API呼び出し処理を並行して実行しない同期的な記載、及び前記API呼び出し処理を並行して実行可能な非同期的な記載を含む形式とし、
前記第二の形式を、前記非同期的な記載の形式とし、
前記第一の形式で記載されたプログラムに含まれる、前記非同期的な記載を、前記同期的な記載に変換し、
前記実行部は、前記非同期的な記載を、前記同期的な記載に変換したプログラムを、前記API呼び出し処理に対応する予め定められた関数のリストと、同期的な記載を非同期的な記載に変換するための予め定められたルールとに基づいて、前記第二の形式で記載されたプログラムに変換する付記7に記載の端末。
(Appendix 9)
The terminal is
The first format is a format including a synchronous description in which the API call processing is not executed in parallel and an asynchronous description in which the API call processing can be executed in parallel.
The second form is defined as the asynchronous description form.
The asynchronous description contained in the program described in the first format is converted into the synchronous description.
The execution unit converts the program obtained by converting the asynchronous description into the synchronous description into a list of predetermined functions corresponding to the API call processing, and the synchronous description into the asynchronous description. The terminal according to Appendix 7 for converting into a program described in the second form based on a predetermined rule for the above.

(付記10)
前記端末は、
前記実行部は、前記第一の形式で記載されたプログラムを、前記第二の形式で記載されたプログラムに変換する際に、前記API呼び出し処理に含まれる関数に対して予め定められた、動詞及び名詞に関するルールに基づいて、前記第一の形式で記載されたプログラムに含まれる前記複数のAPI呼び出し処理のうち、並行して実行可能な処理の実行順序を特定し、特定した前記実行順序に基づいて、前記複数のAPI呼び出し処理のうち、並行して実行可能な処理を並行して実行するように、前記変換に反映する付記8又は付記9に記載の端末。
(Appendix 10)
The terminal is
The execution unit is a verb predetermined for a function included in the API call process when converting a program described in the first format into a program described in the second format. And, based on the rules regarding nomenclature, among the plurality of API call processes included in the program described in the first form, the execution order of the processes that can be executed in parallel is specified, and the specified execution order is set. Based on the above, the terminal according to Appendix 8 or Appendix 9 that is reflected in the conversion so that the processes that can be executed in parallel are executed in parallel among the plurality of API call processes.

(付記11)
前記端末は、
前記実行部は、前記第一の形式で記載されたプログラムを、前記第二の形式で記載されたプログラムに変換する際に、前記API呼び出し処理に含まれる関数に対して予め定められた、リクエストに関するルールに基づいて、前記第一の形式で記載されたプログラムに含まれる前記複数のAPI呼び出し処理のうち、並行して実行可能な処理の実行順序を特定し、特定した前記実行順序に基づいて、前記複数のAPI呼び出し処理のうち、並行して実行可能な処理を並行して実行するように、前記変換に反映する付記8又は付記9に記載の端末。
(Appendix 11)
The terminal is
When the execution unit converts the program described in the first format into the program described in the second format, the execution unit makes a predetermined request for the function included in the API call process. Based on the rules regarding, among the plurality of API call processes included in the program described in the first form, the execution order of the processes that can be executed in parallel is specified, and based on the specified execution order. The terminal according to Appendix 8 or Appendix 9, which is reflected in the conversion so as to execute processes that can be executed in parallel among the plurality of API call processes.

(付記12)
前記端末は、
前記実行部は、前記第一の形式で記載されたプログラムを、前記第二の形式で記載されたプログラムに変換する際に、前記API呼び出し処理に含まれる関数に対して予め定められた、リポジトリに関するルールに基づいて、前記第一の形式で記載されたプログラムに含まれる前記複数のAPI呼び出し処理のうち、並行して実行可能な処理の実行順序を特定し、特定した前記実行順序に基づいて、前記複数のAPI呼び出し処理のうち、並行して実行可能な処理を並行して実行するように、前記変換に反映する付記8又は付記9に記載の端末。
(Appendix 12)
The terminal is
The execution unit is a repository predetermined for a function included in the API call process when converting a program described in the first format into a program described in the second format. Based on the rules regarding, among the plurality of API call processes included in the program described in the first form, the execution order of the processes that can be executed in parallel is specified, and based on the specified execution order. The terminal according to Appendix 8 or Appendix 9, which is reflected in the conversion so as to execute processes that can be executed in parallel among the plurality of API call processes.

(付記13)
第一の形式で記載されたプログラムであって、当該プログラムにて定義された複数のAPI呼び出し処理を実行する端末と、
前記複数のAPI呼び出し処理に応じて、当該API呼び出し処理に対応する処理を実行するよう第二の形式で記載されたプログラムを動作させる複数のサーバー装置と、に対する処理をコンピュータに実行させるAPI処理プログラムであって、
前記端末は、
前記第二の形式で記載されたプログラムに関する情報を取得し、
取得したプログラムに関する情報に基づいて前記複数のAPI呼び出し処理のうち並行して実行可能なAPI呼び出し処理を特定し、
特定されたAPI呼び出し処理に関する情報をサーバー装置に送信する、
処理をコンピュータに実行させるAPI処理プログラム。
(Appendix 13)
A program described in the first format, which is a terminal that executes a plurality of API call processes defined in the program, and a terminal.
An API processing program that causes a computer to execute a process for a plurality of server devices that operate a program described in the second format so as to execute a process corresponding to the API call process in response to the plurality of API call processes. And
The terminal is
Obtain information about the program described in the second format,
Based on the acquired information about the program, the API call process that can be executed in parallel among the plurality of API call processes is specified.
Send information about the identified API call process to the server device,
An API processing program that causes a computer to execute processing.

(付記14)
前記端末は、
前記第一の形式を、前記API呼び出し処理を並行して実行しない同期的な記載の形式とし、
前記第二の形式を、前記API呼び出し処理を並行して実行可能な非同期的な記載の形式とし、
前記第一の形式で記載されたプログラムを、前記API呼び出し処理に対応する予め定められた関数のリストと、同期的な記載を非同期的な記載に変換するための予め定められたルールとに基づいて、前記第二の形式で記載されたプログラムに変換する付記13に記載のAPI処理プログラム。
(Appendix 14)
The terminal is
The first format is a synchronous description format in which the API call processing is not executed in parallel.
The second form is an asynchronous description form in which the API call processing can be executed in parallel.
The program described in the first form is based on a predetermined list of functions corresponding to the API call processing and a predetermined rule for converting a synchronous description into an asynchronous description. The API processing program according to Appendix 13, which is converted into the program described in the second format.

(付記15)
前記端末は、
前記第一の形式を、前記API呼び出し処理を並行して実行しない同期的な記載、及び前記API呼び出し処理を並行して実行可能な非同期的な記載を含む形式とし、
前記第二の形式を、前記非同期的な記載の形式とし、
前記第一の形式で記載されたプログラムに含まれる、前記非同期的な記載を、前記同期的な記載に変換し、
前記非同期的な記載を、前記同期的な記載に変換したプログラムを、前記API呼び出し処理に対応する予め定められた関数のリストと、同期的な記載を非同期的な記載に変換するための予め定められたルールとに基づいて、前記第二の形式で記載されたプログラムに変換する付記13に記載のAPI処理プログラム。
(Appendix 15)
The terminal is
The first format is a format including a synchronous description in which the API call processing is not executed in parallel and an asynchronous description in which the API call processing can be executed in parallel.
The second form is defined as the asynchronous description form.
The asynchronous description contained in the program described in the first format is converted into the synchronous description.
A program in which the asynchronous description is converted into the synchronous description is a list of predetermined functions corresponding to the API call processing, and a predetermined description for converting the synchronous description into the asynchronous description. The API processing program according to Appendix 13, which is converted into the program described in the second form based on the rule.

(付記16)
前記端末は、
前記第一の形式で記載されたプログラムを、前記第二の形式で記載されたプログラムに変換する際に、前記API呼び出し処理に含まれる関数に対して予め定められた、動詞及び名詞に関するルールに基づいて、前記第一の形式で記載されたプログラムに含まれる前記複数のAPI呼び出し処理のうち、並行して実行可能な処理の実行順序を特定し、特定した前記実行順序に基づいて、前記複数のAPI呼び出し処理のうち、並行して実行可能な処理を並行して実行するように、前記変換に反映する付記2又は付記3に記載のAPI処理プログラム。
(Appendix 16)
The terminal is
When converting the program described in the first form to the program described in the second form, the rules regarding verbs and nomenclature predetermined for the functions included in the API call processing are applied. Based on the above, among the plurality of API call processes included in the program described in the first format, the execution order of the processes that can be executed in parallel is specified, and the plurality of processes are executed based on the specified execution order. The API processing program according to Appendix 2 or Appendix 3, which is reflected in the conversion so as to execute the processes that can be executed in parallel among the API call processes of the above.

(付記17)
前記端末は、
前記第一の形式で記載されたプログラムを、前記第二の形式で記載されたプログラムに変換する際に、前記API呼び出し処理に含まれる関数に対して予め定められた、リクエストに関するルールに基づいて、前記第一の形式で記載されたプログラムに含まれる前記複数のAPI呼び出し処理のうち、並行して実行可能な処理の実行順序を特定し、特定した前記実行順序に基づいて、前記複数のAPI呼び出し処理のうち、並行して実行可能な処理を並行して実行するように、前記変換に反映する付記2又は付記3に記載のAPI処理プログラム。
(Appendix 17)
The terminal is
When converting the program described in the first format to the program described in the second format, based on the rules regarding the request predetermined for the function included in the API call processing. , Among the plurality of API call processes included in the program described in the first form, the execution order of the processes that can be executed in parallel is specified, and the plurality of APIs are specified based on the specified execution order. The API processing program according to Appendix 2 or Appendix 3 that is reflected in the conversion so that the processes that can be executed in parallel are executed in parallel among the call processes.

(付記18)
前記端末は、
前記第一の形式で記載されたプログラムを、前記第二の形式で記載されたプログラムに変換する際に、前記API呼び出し処理に含まれる関数に対して予め定められた、リポジトリに関するルールに基づいて、前記第一の形式で記載されたプログラムに含まれる前記複数のAPI呼び出し処理のうち、並行して実行可能な処理の実行順序を特定し、特定した前記実行順序に基づいて、前記複数のAPI呼び出し処理のうち、並行して実行可能な処理を並行して実行するように、前記変換に反映する付記2又は付記3に記載のAPI処理プログラム。
(Appendix 18)
The terminal is
When converting the program described in the first format to the program described in the second format, based on the rules regarding the repository predetermined for the function included in the API call processing. , Among the plurality of API call processes included in the program described in the first form, the execution order of the processes that can be executed in parallel is specified, and the plurality of APIs are specified based on the specified execution order. The API processing program according to Appendix 2 or Appendix 3 that is reflected in the conversion so that the processes that can be executed in parallel are executed in parallel among the call processes.

3 ネットワーク
10、210、310、410 端末
12 サーバー装置
16 変換ルール
22 前処理部
24 関数特定部
26、226 変換部
28、228 実行部
30 通信部
50、250、350、450 コンピュータ
51 CPU
52 メモリ
53、253、353、453 記憶部
60、260、360、460 API処理プログラム
214 動詞表記憶部
222 表作成部
224、324、424 表更新部
322 関数対応表作成部
414 ソースコードリポジトリ
422 管理表作成部
3 Network 10, 210, 310, 410 Terminal 12 Server device 16 Conversion rule 22 Preprocessing unit 24 Function specification unit 26, 226 Conversion unit 28, 228 Execution unit 30 Communication unit 50, 250, 350, 450 Computer 51 CPU
52 Memory 53, 253, 353, 453 Storage unit 60, 260, 360, 460 API processing program 214 Verb table storage unit 222 Table creation unit 224, 324, 424 Table update unit 322 Function correspondence table creation unit 414 Source code repository 422 management Table creation department

Claims (7)

ログラムにて定義された複数のAPI呼び出し処理を実行する端末と、
前記複数のAPI呼び出し処理に応じて、当該API呼び出し処理に対応して呼び出された関数に対応するプログラムを実行して処理結果を返却する複数のサーバー装置とを有し、
前記端末は、
API呼び出し処理を順次実行する同期的な記載を含む第一の形式で記載されたプログラムを、前記API呼び出し処理に対応する予め定められた関数のリストと、同期的な記載を非同期的な記載に変換するための予め定められたルールとに基づいて、API呼び出し処理を実行状況に応じて並列的に実行可能な非同期的な記載による第二の形式で記載されたプログラムに変換し、
変換された前記第二の形式で記載されたプログラムに応じて非同期的に前記複数のAPI呼び出し処理を実行し、前記複数のサーバー装置から対応する関数を呼び出して処理する
API処理方法。
A terminal that executes multiple API call processes defined in the program ,
It has a plurality of server devices that execute a program corresponding to a function called in response to the API call processing and return a processing result in response to the plurality of API call processing.
The terminal is
A program described in the first format including a synchronous description for sequentially executing API call processing is described in an asynchronous description with a list of predetermined functions corresponding to the API call processing and a synchronous description. Based on the predetermined rules for conversion, the API call processing is converted into a program described in the second format by asynchronous description that can be executed in parallel according to the execution status.
The plurality of API call processes are asynchronously executed according to the converted program described in the second format, and the corresponding functions are called and processed from the plurality of server devices.
API processing method.
前記端末は、
前記第一の形式が前記同期的な記載、及び前記非同期的な記載を含む形式である場合に
前記第一の形式で記載されたプログラムに含まれる、前記非同期的な記載を、前記同期的な記載に変換した後に
前記非同期的な記載を変換した後の前記第一の形式で記載されたプログラムを、前記API呼び出し処理に対応する予め定められた関数のリストと、同期的な記載を非同期的な記載に変換するための予め定められたルールとに基づいて、前記第二の形式で記載されたプログラムに変換する請求項1に記載のAPI処理方法。
The terminal is
When the first form is a form including the synchronous description and the asynchronous description,
After converting the asynchronous description contained in the program described in the first form into the synchronous description,
The program described in the first format after converting the asynchronous description is converted into a list of predetermined functions corresponding to the API call processing and the synchronous description to the asynchronous description. The API processing method according to claim 1, wherein the program is converted into the program described in the second form based on a predetermined rule for the above.
前記端末は、
前記第一の形式で記載されたプログラムを、前記第二の形式で記載されたプログラムに変換する際に、前記API呼び出し処理に含まれる関数に対して予め定められた、動詞及び名詞に関するルールに基づいて、前記第一の形式で記載されたプログラムに含まれる前記複数のAPI呼び出し処理のうち、並行して実行可能な処理の実行順序を特定し、特定した前記実行順序に基づいて、前記複数のAPI呼び出し処理のうち、並行して実行可能な処理を並行して実行するように、前記変換に反映する請求項1又は請求項2に記載のAPI処理方法。
The terminal is
When converting the program described in the first form to the program described in the second form, the rules regarding verbs and nomenclature predetermined for the functions included in the API call processing are applied. Based on this, among the plurality of API call processes included in the program described in the first format, the execution order of the processes that can be executed in parallel is specified, and the plurality of processes are executed based on the specified execution order. The API processing method according to claim 1 or 2 , wherein the processing that can be executed in parallel is executed in parallel among the API call processing of the above.
前記端末は、
前記第一の形式で記載されたプログラムを、前記第二の形式で記載されたプログラムに変換する際に、前記API呼び出し処理に含まれる関数に対して予め定められた、リクエストに関するルールに基づいて、前記第一の形式で記載されたプログラムに含まれる前記複数のAPI呼び出し処理のうち、並行して実行可能な処理の実行順序を特定し、特定した前記実行順序に基づいて、前記複数のAPI呼び出し処理のうち、並行して実行可能な処理を並行して実行するように、前記変換に反映する請求項1又は請求項2に記載のAPI処理方法。
The terminal is
When converting the program described in the first format to the program described in the second format, based on the rules regarding the request predetermined for the function included in the API call processing. , Among the plurality of API call processes included in the program described in the first form, the execution order of the processes that can be executed in parallel is specified, and the plurality of APIs are specified based on the specified execution order. The API processing method according to claim 1 or 2 , which is reflected in the conversion so that the processes that can be executed in parallel are executed in parallel among the call processes.
前記端末は、
前記第一の形式で記載されたプログラムを、前記第二の形式で記載されたプログラムに変換する際に、前記API呼び出し処理に含まれる関数に対して予め定められた、リポジトリに関するルールに基づいて、前記第一の形式で記載されたプログラムに含まれる前記複数のAPI呼び出し処理のうち、並行して実行可能な処理の実行順序を特定し、特定した前記実行順序に基づいて、前記複数のAPI呼び出し処理のうち、並行して実行可能な処理を並行して実行するように、前記変換に反映する請求項1又は請求項2に記載のAPI処理方法。
The terminal is
When converting the program described in the first format to the program described in the second format, based on the rules regarding the repository predetermined for the function included in the API call processing. , Among the plurality of API call processes included in the program described in the first form, the execution order of the processes that can be executed in parallel is specified, and the plurality of APIs are specified based on the specified execution order. The API processing method according to claim 1 or 2 , which is reflected in the conversion so that the processes that can be executed in parallel are executed in parallel among the call processes.
ログラムにて定義された複数のAPI呼び出し処理を実行する端末であって、
API呼び出し処理を順次実行する同期的な記載を含む第一の形式で記載されたプログラムを、前記API呼び出し処理に対応する予め定められた関数のリストと、同期的な記載を非同期的な記載に変換するための予め定められたルールとに基づいて、API呼び出し処理を実行状況に応じて並列的に実行可能な非同期的な記載による第二の形式で記載されたプログラムに変換する変換部と、
変換された前記第二の形式で記載されたプログラムに応じて非同期的に前記複数のAPI呼び出し処理を実行し、当該API呼び出し処理に対応して呼び出された関数に対応するプログラムを実行して処理結果を返却する複数のサーバー装置から対応する関数を呼び出して処理する実行部と、
を含む端末。
A terminal that executes multiple API call processes defined in the program .
A program described in the first format including a synchronous description for sequentially executing API call processing is described in an asynchronous description with a list of predetermined functions corresponding to the API call processing and a synchronous description. A conversion unit that converts API call processing into a program described in the second format by asynchronous description that can be executed in parallel according to the execution status based on predetermined rules for conversion .
The plurality of API call processes are asynchronously executed according to the converted program described in the second format, and the program corresponding to the function called corresponding to the API call process is executed and processed. An execution unit that calls and processes the corresponding function from multiple server devices that return the result ,
Terminals including.
ログラムにて定義された複数のAPI呼び出し処理を実行する端末と、
前記複数のAPI呼び出し処理に応じて、当該API呼び出し処理に対応して呼び出された関数に対応するプログラムを実行して処理結果を返却する複数のサーバー装置と、に対する処理をコンピュータに実行させるAPI処理プログラムであって、
前記端末は、
API呼び出し処理を順次実行する同期的な記載を含む第一の形式で記載されたプログラムを、前記API呼び出し処理に対応する予め定められた関数のリストと、同期的な記載を非同期的な記載に変換するための予め定められたルールとに基づいて、API呼び出し処理を実行状況に応じて並列的に実行可能な非同期的な記載による第二の形式で記載されたプログラムに変換し、
変換された前記第二の形式で記載されたプログラムに応じて非同期的に前記複数のAPI呼び出し処理を実行し、前記複数のサーバー装置から対応する関数を呼び出して処理する
処理をコンピュータに実行させるAPI処理プログラム。
A terminal that executes multiple API call processes defined in the program ,
API processing that causes a computer to execute processing for a plurality of server devices that execute a program corresponding to the function called in response to the API calling processing and return the processing result in response to the plurality of API calling processing. It ’s a program,
The terminal is
A program described in the first format including a synchronous description for sequentially executing API call processing is described in an asynchronous description with a list of predetermined functions corresponding to the API call processing and a synchronous description. Based on the predetermined rules for conversion, the API call processing is converted into a program described in the second format by asynchronous description that can be executed in parallel according to the execution status.
The plurality of API call processes are asynchronously executed according to the converted program described in the second format, and the corresponding functions are called and processed from the plurality of server devices.
An API processing program that causes a computer to execute processing.
JP2018068058A 2018-03-30 2018-03-30 API processing method, terminal, API processing program Active JP7059757B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018068058A JP7059757B2 (en) 2018-03-30 2018-03-30 API processing method, terminal, API processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018068058A JP7059757B2 (en) 2018-03-30 2018-03-30 API processing method, terminal, API processing program

Publications (2)

Publication Number Publication Date
JP2019179383A JP2019179383A (en) 2019-10-17
JP7059757B2 true JP7059757B2 (en) 2022-04-26

Family

ID=68278571

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018068058A Active JP7059757B2 (en) 2018-03-30 2018-03-30 API processing method, terminal, API processing program

Country Status (1)

Country Link
JP (1) JP7059757B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022185649A1 (en) * 2021-03-01 2022-09-09 富士フイルム株式会社 Information processing system, information processing method, and information processing program

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001184320A (en) 1999-12-27 2001-07-06 Pfu Ltd Distributed executing device and recording medium
JP2007108133A (en) 2005-10-17 2007-04-26 Paloma Ind Ltd Air/fuel ratio detecting method of gas combustor, air/fuel ratio detection sensor thereof, and gas combustor
US20180088937A1 (en) 2016-09-29 2018-03-29 Microsoft Technology Licensing, Llc Code refactoring mechanism for asynchronous code optimization using topological sorting

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001184320A (en) 1999-12-27 2001-07-06 Pfu Ltd Distributed executing device and recording medium
JP2007108133A (en) 2005-10-17 2007-04-26 Paloma Ind Ltd Air/fuel ratio detecting method of gas combustor, air/fuel ratio detection sensor thereof, and gas combustor
US20180088937A1 (en) 2016-09-29 2018-03-29 Microsoft Technology Licensing, Llc Code refactoring mechanism for asynchronous code optimization using topological sorting

Also Published As

Publication number Publication date
JP2019179383A (en) 2019-10-17

Similar Documents

Publication Publication Date Title
JP3738787B2 (en) Resource management apparatus and resource management method
US20030093420A1 (en) Method and system for retrieving sharable information using a hierarchically dependent directory structure
JP3272014B2 (en) Method and apparatus for creating a data processing dictionary including hierarchical data processing information
US5339435A (en) Heterogenous software configuration management apparatus
US9086931B2 (en) System for translating diverse programming languages
JPS6288033A (en) Apparatus and method for generating software program
JP3230467B2 (en) GDMO translator, GDMO translation method, and recording medium recording GDMO translator program
KR20040097909A (en) Reflection-based processing of input parameters for commands
US20060282452A1 (en) System and method for mapping structured document to structured data of program language and program for executing its method
JPH0383153A (en) Message processing system and method
JP5734311B2 (en) Efficient invariant syntactic representation with gradual change
US7472391B2 (en) Resource loader for applications that utilize relative uniform resource identifiers
CN115639980A (en) Draggable front-end logic arrangement method and device for low-code platform
US7458071B2 (en) Compilation method, compiler apparatus and compiler
US9244706B2 (en) Command line shell command generation based on schema
JP7059757B2 (en) API processing method, terminal, API processing program
NO329240B1 (en) System and method for explanatory definition and use of document encoding subgroups
CN114611714B (en) Model processing method, device, system, electronic equipment and storage medium
CN113515303B (en) Project transformation method, device and equipment
CN107577476A (en) A kind of Android system source code difference analysis method, server and medium based on Module Division
CN113608748A (en) Data processing method, device and equipment for converting C language into Java language
JP3266097B2 (en) Automatic reentrant method and system for non-reentrant program
KR100846203B1 (en) Method for generating mobile application and record media recorded program for realizing the same
WO2018182454A1 (en) Method for developing, storing, and using programs compiled in database tables in binary representation
JP4120879B2 (en) Program generation system and method and program thereof

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210113

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20211125

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20211130

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220125

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20220328

R150 Certificate of patent or registration of utility model

Ref document number: 7059757

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150