Request handling method and device based on API intelligent adaption

A request processing and adaptation technology, applied in the Internet field, can solve problems such as reducing user experience, service invocation failure, and inconsistent input and output, and achieve the effect of improving user experience and reducing management costs.

Active Publication Date: 2018-10-16
BEIJING SHUJU XINYUN TECH CO LTD
View PDF3 Cites 7 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] In the prior art, the format of the API request received by the API gateway from the client needs to be consistent with the format defined by the receiving end of the API request. When the data formats of the two are inconsistent, the inconsistent input and output will cause the server to fail to process data. , or when the software is updated, but the client is not upgraded in time, the interface cannot be compatible up and down, which will lead to the failure of the service call, or when the back-end service cannot be provided normally, it will reduce the user experience

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Request handling method and device based on API intelligent adaption
  • Request handling method and device based on API intelligent adaption

Examples

Experimental program
Comparison scheme
Effect test

specific Embodiment 1

[0056] The gateway receives an API request for purchasing a certain service from the client, and the receiving target of the API request is the first service party. After the gateway receives the API request from the client, it judges that the format of the API request is XML format, and the format supported by the first server is JSON format. The gateway searches for preset adaptation rules. Reconstruct a new API request conforming to the parameter configuration rules in JSON format according to the adaptation rules, and send the constructed new API request to the first server.

specific Embodiment 2

[0057]The gateway receives an API request for purchasing a certain service from the client, and the receiving target of the API request is the first service party. After the gateway receives the API request from the client, it judges that the protocol version of the API request is XML version 3.0, and the format supported by the first server is XML version 4.0. The gateway searches for the preset matching rules between version 3.0 and version 4.0. Reconstruct a new API request conforming to the parameter configuration rules of version 4.0 according to the adaptation rules, and send the constructed new API request to the first server.

specific Embodiment 3

[0058] This specific embodiment 3 is applied to a scenario where a certain data field in an API request is changed.

[0059] The original interface format of the service used to obtain the user's avatar information is

[0060] GET / user / profile? id=01234567

[0061] After this interface has been running for a period of time, another business develops a new interface to achieve the same function. The format of the new interface is as follows:

[0062] GET / user / profile? name=01234567

[0063] At this time, there will be two versions of the old and new versions of the interface in the same function within the enterprise, which makes it very inconvenient for users to call the interface, and then switch to different interfaces according to different scenarios.

[0064] According to the gist of the present invention, two backends are added to this function. Specifically, the enterprise can configure the interface provided by the API gateway, such as on the API management platfo...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a request handling method and device based on API intelligent adaption. The method comprises the following steps: receiving an API request from a data transmitting terminal byan API gateway; when a fact that the API request needs to be adapted is judged, determining a data receiver, and matching an adaption rule; converting the API request into a format of the data receiver according to the adaption rule; and sending the converted API request to the data receiver. The method disclosed by the invention can intelligently adapt to clients and server sides in different formats, protocol adaptation and conversion of API input and output are guaranteed, and a function of modifying the rule by a user is supported, so that management of a service supplier can be facilitated, service stability is effectively improved, management cost is reduced and usage experience of the user is improved; and API monitoring also can be carried out, and statistical analysis on interfacedata is realized.

Description

technical field [0001] The present invention relates to the technical field of the Internet, in particular to a request processing method and device based on API intelligent adaptation. Background technique [0002] The API gateway provides various application programming interface (Application Programming Interface, API) interfaces for different service parties to support services of each service party. The mobile client can install the client software of each service provider, so that the user can use the various services of the corresponding service provider on the client. [0003] In the prior art, the format of the API request received by the API gateway from the client needs to be consistent with the format defined by the receiving end of the API request. When the data formats of the two are inconsistent, the inconsistent input and output will cause the server to fail to process data. , or when the software is updated, but the client is not upgraded in time, the incom...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): H04L29/08
CPCH04L67/51H04L67/565H04L67/60
Inventor 丛磊
Owner BEIJING SHUJU XINYUN TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products