CN112543118A - Method for realizing API gateway interface arrangement based on configuration - Google Patents
Method for realizing API gateway interface arrangement based on configuration Download PDFInfo
- Publication number
- CN112543118A CN112543118A CN202011335928.7A CN202011335928A CN112543118A CN 112543118 A CN112543118 A CN 112543118A CN 202011335928 A CN202011335928 A CN 202011335928A CN 112543118 A CN112543118 A CN 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 34
- 230000004044 response Effects 0.000 claims abstract description 17
- 230000008569 process Effects 0.000 claims description 4
- 238000011144 upstream manufacturing Methods 0.000 claims description 3
- 230000006870 function Effects 0.000 abstract description 5
- 230000000977 initiatory effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/20—Software design
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0893—Assignment of logical groups to network elements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/133—Protocols for remote procedure calls [RPC]
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
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
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:
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:
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:
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:
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:
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.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011335928.7A CN112543118A (en) | 2020-11-25 | 2020-11-25 | Method for realizing API gateway interface arrangement based on configuration |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011335928.7A CN112543118A (en) | 2020-11-25 | 2020-11-25 | Method for realizing API gateway interface arrangement based on configuration |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112543118A true CN112543118A (en) | 2021-03-23 |
Family
ID=75015141
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011335928.7A Pending CN112543118A (en) | 2020-11-25 | 2020-11-25 | Method for realizing API gateway interface arrangement based on configuration |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112543118A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150120936A1 (en) * | 2010-06-15 | 2015-04-30 | Oracle International Corporation | Coordination of processes in cloud computing environments |
US20160124742A1 (en) * | 2014-10-30 | 2016-05-05 | Equinix, Inc. | Microservice-based application development framework |
CN109040152A (en) * | 2017-06-08 | 2018-12-18 | 阿里巴巴集团控股有限公司 | A kind of service request and providing method based on service orchestration, device and electronic equipment |
CN111049695A (en) * | 2020-01-09 | 2020-04-21 | 深圳壹账通智能科技有限公司 | Cloud gateway configuration method and system |
CN111585879A (en) * | 2020-05-07 | 2020-08-25 | 北京静帆科技有限公司 | Configuration method of API gateway and API gateway system |
-
2020
- 2020-11-25 CN CN202011335928.7A patent/CN112543118A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150120936A1 (en) * | 2010-06-15 | 2015-04-30 | Oracle International Corporation | Coordination of processes in cloud computing environments |
US20160124742A1 (en) * | 2014-10-30 | 2016-05-05 | Equinix, Inc. | Microservice-based application development framework |
CN109040152A (en) * | 2017-06-08 | 2018-12-18 | 阿里巴巴集团控股有限公司 | A kind of service request and providing method based on service orchestration, device and electronic equipment |
CN111049695A (en) * | 2020-01-09 | 2020-04-21 | 深圳壹账通智能科技有限公司 | Cloud gateway configuration method and system |
CN111585879A (en) * | 2020-05-07 | 2020-08-25 | 北京静帆科技有限公司 | Configuration method of API gateway and API gateway system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
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 | |
CN106557307B (en) | Service data processing method and system | |
CN110580189A (en) | method and device for generating front-end page, computer equipment and storage medium | |
US20210224055A1 (en) | Data interface processing method, device, server and medium | |
CN114089986A (en) | Method, system, device and medium for configuring low code development platform function expression | |
CN112181522A (en) | Data processing method and device and electronic equipment | |
CN112214334A (en) | Micro-service calling method and device, electronic equipment and computer-readable storage medium | |
CN111427578B (en) | Data conversion method, device and equipment | |
CN111225018A (en) | Request message processing method and device and electronic equipment | |
CN109388425A (en) | A kind of interface switching method, system, device and the storage medium of front end engineering | |
CN115016784A (en) | Low code application multiplexing method, application analysis system, equipment and storage medium | |
CN102402455A (en) | Method and device for calling dynamic link library (DLL) | |
CN111814449A (en) | Form analysis method, device, equipment and storage medium | |
CN115525534A (en) | Test case generation method and platform based on swagger interface test | |
CN112543118A (en) | Method for realizing API gateway interface arrangement based on configuration | |
CN111427630B (en) | Cold start optimization method and device, electronic equipment and storage medium | |
CN110728118B (en) | Cross-data-platform data processing method, device, equipment and storage medium | |
CN111596970A (en) | Dynamic library delay loading method, device, equipment and storage medium | |
CN116185425A (en) | Event flow arrangement method, device, equipment and medium based on node combination | |
CN114064125B (en) | Instruction analysis method and device and electronic equipment | |
CN115167856A (en) | Jue project appointed route configuration method and system based on node | |
CN114371884A (en) | Method, device, equipment and storage medium for processing Flink calculation task | |
US8200713B2 (en) | Database exploration for building wireless component applications | |
CN113626001A (en) | API dynamic editing method and device based on script |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210323 |