Movatterモバイル変換


[0]ホーム

URL:


CN112543118A - Method for realizing API gateway interface arrangement based on configuration - Google Patents

Method for realizing API gateway interface arrangement based on configuration
Download PDF

Info

Publication number
CN112543118A
CN112543118ACN202011335928.7ACN202011335928ACN112543118ACN 112543118 ACN112543118 ACN 112543118ACN 202011335928 ACN202011335928 ACN 202011335928ACN 112543118 ACN112543118 ACN 112543118A
Authority
CN
China
Prior art keywords
configuration
type
task
api gateway
gateway interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011335928.7A
Other languages
Chinese (zh)
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.)
Inspur Cloud Information Technology Co Ltd
Original Assignee
Inspur Cloud Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Cloud Information Technology Co LtdfiledCriticalInspur Cloud Information Technology Co Ltd
Priority to CN202011335928.7ApriorityCriticalpatent/CN112543118A/en
Publication of CN112543118ApublicationCriticalpatent/CN112543118A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

The invention discloses a method for realizing API gateway interface arrangement based on configuration, belonging to the technical field of computer software development. The method for realizing the arrangement of the API gateway interface based on the configuration specifically comprises the following steps: s1, compiling, arranging and configuring; s2, analyzing the configuration in the step S1; s3, executing the task arranging step; and S4, assembling the response result. The method for realizing the arrangement of the API gateway interface based on the configuration can acquire the corresponding data functions of a plurality of back-end service interfaces through one-time interface calling, and has good popularization and application values.

Description

Method for realizing API gateway interface arrangement based on configuration
Technical Field
The invention relates to the technical field of computer software development, and particularly provides a method for realizing arrangement of an API gateway interface based on configuration.
Background
The computer has the advantages of large information storage capacity, convenience and quickness in information acquisition and the like, and is widely applied. The use of the computer cannot be separated from the use of the network, an API (application programming interface) gateway is generally deployed between a user and a server in the current network service, and all user requests are firstly subjected to certain checksum logic processing through the API gateway and then forwarded to the back-end service.
At present, most API gateways only support one user request to correspondingly forward to one back-end service request, but cannot realize the capability of acquiring the data returned by a plurality of back-end service interfaces by one-time interface calling of the user, and further improvement is needed.
Disclosure of Invention
The technical task of the present invention is to provide a method for implementing API gateway interface arrangement based on configuration, which can obtain corresponding data functions of a plurality of backend service interfaces through one-time interface call.
In order to achieve the purpose, the invention provides the following technical scheme:
a method for realizing API gateway interface arrangement based on configuration specifically comprises the following steps:
s1, compiling, arranging and configuring;
s2, analyzing the configuration in the step S1;
s3, executing the task arranging step;
and S4, assembling the response result.
Preferably, in step S1, the interface is arranged using a json code format, and the task step is included in an array.
Preferably, the json encoding format comprises the following elements:
step, namely a task step;
inputs are the entries of the editing step;
outputs are the return of the orchestration step.
Preferably, in step S2, the json configuration is parsed into a processable data format according to the programming language.
Preferably, in step S3, the task steps are saved in an array, and the handler traverses the array and performs responsive processing according to the task step type of each step.
Preferably, the types supported by the task step include: http type, response type, if type, series type, and parallel type.
Preferably, the task step is an http type, and in order to initiate a request to an upstream, configuration includes type, that is, a request type, name, method, that is, an http request mode, inputs, that is, an http request parameter definition, url, that is, an http request address, and timeout, that is, an http request timeout.
Preferably, the task step is of response type, and is used for defining the result returned by the orchestration, and includes the following elements: type is the type, name is the name, outputs are the format and fields used to define the layout return result.
Preferably, the task step is of an if type, and is used for judging a flow result, and executing a different flow according to the result.
Preferably, the task step is a series type, and the task step comprises a subtask step, and the subtasks are executed in series; and if the task step is of a parallel type, the task step comprises a subtask step, and the subtasks are executed in parallel.
The layout configuration of the method for realizing the layout of the API gateway interface based on the configuration is compiled by using a json coding format, wherein the concept of the layout step is defined, and the layout steps are of various types, including http which is used for initiating an http request; if is to make branch condition judgment; series is a plurality of serial steps nested; parallel is nesting a plurality of parallel steps; response is the assembly response result. A plurality of arrangement steps are stored in the json array, and when the program is executed, the array containing the arrangement steps is traversed, and corresponding functions are executed according to the type of the arrangement steps.
Compared with the prior art, the method for realizing the arrangement of the API gateway interface based on the configuration has the following outstanding beneficial effects:
the method for realizing the arrangement of the API gateway interface based on the configuration can arrange a plurality of interfaces, thereby obtaining the function of responding data of a plurality of back-end service interfaces through one-time interface calling;
the capability of serial execution of a plurality of back-end service interfaces is realized, namely, the next interface call is executed only if the previous interface call is successful;
and (III) the capability of parallel execution of a plurality of back-end service interfaces is realized, namely the back-end service interfaces are executed simultaneously without mutual dependence, the response time of calling the API interface by a user is reduced, and the method has good popularization and application values.
Drawings
FIG. 1 is a flow chart of a method for implementing API gateway interface orchestration based on configuration according to the present invention.
Detailed Description
The method for implementing API gateway interface orchestration based on configuration according to the present invention will be described in further detail with reference to the accompanying drawings and embodiments.
Examples
As shown in fig. 1, the method for implementing API gateway interface arrangement based on configuration of the present invention specifically includes the following steps:
and S1, writing the layout configuration.
The interface is arranged using a json code format, and the task steps are contained in an array. The json encoding format includes the following elements: step, namely a task step; inputs are the entries of the editing step; outputs are the return of the orchestration step.
S2, analyzing the configuration in the step S1. The json configuration is parsed into a processable data format according to a programming language.
And S3, executing the programmed task step. The task steps are stored in an array, the processing program traverses the array, and the response processing is executed according to the task step type of each step.
And S4, assembling the response result.
The types of task step support include: http type, response type, if type, series type, and parallel type.
The task step is of an http type, and a request for upstream is initiated, and the configuration comprises type, namely a request type, name, method, namely an http request mode, inputs, namely http request parameter definition, url, namely an http request address, and timeout, namely http request timeout.
Examples are:
Figure BDA0002797204810000031
the task step is of a response type, and is used for defining the result returned by the layout, and comprises the following elements: type is the type, name is the name, outputs are the format and fields used to define the layout return result.
Examples are as follows:
Figure BDA0002797204810000041
if the task step is of the if type, the task step is used for judging the process result and executing different processes according to the result. Examples are as follows:
Figure BDA0002797204810000042
Figure BDA0002797204810000051
and if the task step is a series type, the task step comprises a subtask step, and the subtasks are executed in series. Examples are as follows:
Figure BDA0002797204810000052
and if the task step is a parallel type, the task step comprises a subtask step, and the subtasks are executed in parallel.
Examples are as follows:
Figure BDA0002797204810000053
the layout configuration of the method for realizing the layout of the API gateway interface based on the configuration is compiled by using a json coding format, wherein the concept of the layout step is defined, and the layout steps are of various types, including http which is used for initiating an http request; if is to make branch condition judgment; series is a plurality of serial steps nested; parallel is nesting a plurality of parallel steps; response is the assembly response result. A plurality of arrangement steps are stored in the json array, and when the program is executed, the array containing the arrangement steps is traversed, and corresponding functions are executed according to the type of the arrangement steps.
The above-described embodiments are merely preferred embodiments of the present invention, and general changes and substitutions by those skilled in the art within the technical scope of the present invention are included in the protection scope of the present invention.

Claims (10)

1. A method for realizing API gateway interface arrangement based on configuration is characterized in that: the method specifically comprises the following steps:
s1, compiling, arranging and configuring;
s2, analyzing the configuration in the step S1;
s3, executing the task arranging step;
and S4, assembling the response result.
2. The method of claim 1 for implementing API gateway interface orchestration based on configuration, wherein: in step S1, the interface is formatted using a json code format, and the task steps are included in an array.
3. The method of claim 2 for implementing API gateway interface orchestration based on configuration, wherein: the json encoding format includes the following elements:
step, namely a task step;
inputs are the entries of the editing step;
outputs are the return of the orchestration step.
4. The method of claim 3 for implementing API gateway interface orchestration based on configuration, wherein: in step S2, the json configuration is parsed into a processable data format according to the programming language.
5. The method of claim 4 for implementing API gateway interface orchestration based on configuration, wherein: in step S3, the task steps are saved in an array, and the processing program traverses the array and executes the processing of the response according to the task step type of each step.
6. The method of claim 5 for implementing API gateway interface orchestration based on configuration, wherein: the types of task step support include: http type, response type, if type, series type, and parallel type.
7. The method of claim 6, wherein the API gateway interface orchestration based on configuration is performed by: the task step is of an http type, and a request for upstream is initiated, and configuration includes type, namely a request type, name, method, namely an http request mode, inputs, namely http request parameter definition, url, namely an http request address, and timeout, namely an http request timeout.
8. The method of claim 7 for implementing API gateway interface orchestration based on configuration, wherein: the task step is of a response type, and is used for defining a result returned by the arrangement, and the task step comprises the following elements: type is the type, name is the name, outputs are the format and fields used to define the layout return result.
9. The method of claim 8, wherein the API gateway interface orchestration based on configuration is performed by: and if the task step is of the if type, judging the process result, and executing different processes according to the result.
10. The method of claim 9 for implementing API gateway interface orchestration based on configuration, comprising: if the task step is a series type, the task step comprises a subtask step, and the subtasks are executed in series; and if the task step is of a parallel type, the task step comprises a subtask step, and the subtasks are executed in parallel.
CN202011335928.7A2020-11-252020-11-25Method for realizing API gateway interface arrangement based on configurationPendingCN112543118A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202011335928.7ACN112543118A (en)2020-11-252020-11-25Method for realizing API gateway interface arrangement based on configuration

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202011335928.7ACN112543118A (en)2020-11-252020-11-25Method for realizing API gateway interface arrangement based on configuration

Publications (1)

Publication NumberPublication Date
CN112543118Atrue CN112543118A (en)2021-03-23

Family

ID=75015141

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202011335928.7APendingCN112543118A (en)2020-11-252020-11-25Method for realizing API gateway interface arrangement based on configuration

Country Status (1)

CountryLink
CN (1)CN112543118A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20150120936A1 (en)*2010-06-152015-04-30Oracle International CorporationCoordination of processes in cloud computing environments
US20160124742A1 (en)*2014-10-302016-05-05Equinix, Inc.Microservice-based application development framework
CN109040152A (en)*2017-06-082018-12-18阿里巴巴集团控股有限公司A kind of service request and providing method based on service orchestration, device and electronic equipment
CN111049695A (en)*2020-01-092020-04-21深圳壹账通智能科技有限公司Cloud gateway configuration method and system
CN111585879A (en)*2020-05-072020-08-25北京静帆科技有限公司Configuration method of API gateway and API gateway system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20150120936A1 (en)*2010-06-152015-04-30Oracle International CorporationCoordination of processes in cloud computing environments
US20160124742A1 (en)*2014-10-302016-05-05Equinix, Inc.Microservice-based application development framework
CN109040152A (en)*2017-06-082018-12-18阿里巴巴集团控股有限公司A kind of service request and providing method based on service orchestration, device and electronic equipment
CN111049695A (en)*2020-01-092020-04-21深圳壹账通智能科技有限公司Cloud gateway configuration method and system
CN111585879A (en)*2020-05-072020-08-25北京静帆科技有限公司Configuration method of API gateway and API gateway system

Similar Documents

PublicationPublication DateTitle
US11269611B2 (en)Data interface processing method, device, server and medium
CN110580189A (en)method and device for generating front-end page, computer equipment and storage medium
US11775269B2 (en)Generating a synchronous digital circuit from a source code construct defining a function call
KR102133906B1 (en) Data analysis and processing methods, devices, computer devices and storage media
CN112181522A (en)Data processing method and device and electronic equipment
CN114089986A (en) Low-code development platform function expression configuration method, system, device and medium
CN110728118B (en)Cross-data-platform data processing method, device, equipment and storage medium
CN116185425A (en)Event flow arrangement method, device, equipment and medium based on node combination
CN114371884A (en)Method, device, equipment and storage medium for processing Flink calculation task
CN111596970A (en)Dynamic library delay loading method, device, equipment and storage medium
CN115016784A (en)Low code application multiplexing method, application analysis system, equipment and storage medium
CN109388425A (en)A kind of interface switching method, system, device and the storage medium of front end engineering
CN112543118A (en)Method for realizing API gateway interface arrangement based on configuration
CN114816400A (en) Method, system, intelligent terminal and storage medium for building pages based on JSON configuration
CN115525534A (en)Test case generation method and platform based on swagger interface test
CN110598155A (en)Ajax request calling method and device, computer equipment and storage medium
US8200713B2 (en)Database exploration for building wireless component applications
CN113391810B (en) A parsing method and system based on application scenario graph
CN115048098A (en)Process automation method, device, system and storage medium
CN113626001A (en)API dynamic editing method and device based on script
CN114201241A (en)Business processing method, device, equipment, storage medium and program
CN117688025B (en)SQL dynamic assembly method and device based on JDBC protocol
CN119225770B (en) System upgrade method, device and storage medium
US20240281737A1 (en)Data compilation and execution device and data compilation and execution method
CN116301758B (en)Rule editing method, device, equipment and medium based on event time points

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication
RJ01Rejection of invention patent application after publication

Application publication date:20210323


[8]ページ先頭

©2009-2025 Movatter.jp