CN110417891A - Data processing method, device, API gateway and rear end management equipment - Google Patents

Data processing method, device, API gateway and rear end management equipment Download PDF

Info

Publication number
CN110417891A
CN110417891A CN201910697027.3A CN201910697027A CN110417891A CN 110417891 A CN110417891 A CN 110417891A CN 201910697027 A CN201910697027 A CN 201910697027A CN 110417891 A CN110417891 A CN 110417891A
Authority
CN
China
Prior art keywords
configuration file
api
request
rear end
mark
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
CN201910697027.3A
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910697027.3A priority Critical patent/CN110417891A/en
Publication of CN110417891A publication Critical patent/CN110417891A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer And Data Communications (AREA)

Abstract

This application discloses data processing method, device, API gateway and rear end management equipments.When API gateway receives the request of sender's transmission, configuration file corresponding with the API mark that the request is included is obtained from rear end management equipment, protocol conversion is carried out to request using the transcode in the configuration file later, to obtain the request with the protocol adaptation of recipient, the request after conversion is sent to recipient.Based on technical solution disclosed in the present application, when the service that server-side provides changes, it is only necessary to be updated to the configuration file by rear end management plant maintenance, without issuing new API gateway version, can be improved the stability of API gateway.

Description

Data processing method, device, API gateway and rear end management equipment
Technical field
The application belongs to Internet technical field more particularly to a kind of data processing method, device, API gateway and rear end Management equipment.
Background technique
Network service generally includes client and server-side.API (Application Programming Interface, Application programming interface) gateway is a bridge between client and server-side.API gateway provides API for server-side and connects Mouthful, so that client is in the service without access server-side offer under the premise of knowing server-side interior details.
In practical applications, client and server-side often use different agreements.In order to guarantee that client is able to access that The service that server-side provides, a critical function of API gateway are that the request sent to client and server-side carries out agreement turn It changes.For example, converting the request into the lattice with the protocol adaptation of server-side after API gateway receives the request that client is sent Formula sends the request after conversion to server-side;After API gateway receives the request of server-side transmission, convert the request into With the format of the protocol adaptation of client, the request after conversion is sent to client.
In order to realize above-mentioned protocol conversion, following scheme is used in the prior art: being stored in advance and is directed in API gateway The transcode that each api interface is write searches corresponding conversion generation when receiving the request of client or server-side Code carries out protocol conversion to request using the transcode.
But when the service that server-side provides changes, the api interface that API gateway provides can also occur accordingly Variation, needs to issue API gateway version again, to update the transcode in API gateway.Version updating is carried out in API gateway In the process, it cannot respond to the request of client and server-side, and frequently publication API gateway version will lead to the steady of API gateway Qualitative decline.
Summary of the invention
In view of this, the application be designed to provide a kind of data processing method, device, API gateway, rear end management are set Standby and storage medium, with solve in the prior art when server-side provide service change when, need to API gateway carry out version The problem of this update.
To achieve the above object, the application provides the following technical solutions:
The application provides a kind of data processing method, is applied to API gateway, which comprises
Receive the request that sender sends;Obtain the API mark that the request includes;From the acquisition of rear end management equipment and institute It states API and identifies corresponding configuration file;Protocol conversion is carried out to the request using the transcode in the configuration file, with Obtain the request with the protocol adaptation of recipient;The request after conversion is sent to the recipient.
Optionally, based on the above method, after the API mark that the acquisition request includes, further includes: In It is local to search configuration file corresponding with API mark;If not finding configuration corresponding with API mark locally File then executes the operation for obtaining from rear end management equipment and identifying corresponding configuration file with the API.Described from rear After holding management equipment to obtain configuration file corresponding with API mark, further includes: storage is obtained from the rear end management equipment Configuration file.
Optionally, based on the above method, further includes: receive the update prompt that the rear end management equipment is sent; The first configuration file being locally stored is deleted, wherein first configuration file is and the API for prompting to include that updates is marked Know corresponding configuration file.
Optionally, based on the above method, it after first configuration file that will be locally stored is deleted, also wraps It includes: from rear end management equipment acquisition configuration file corresponding with the API mark that the update prompt includes, and being deposited Storage.
Optionally, based on the above method, further includes: receive the deletion prompt that the rear end management equipment is sent; The second configuration file being locally stored is deleted, wherein second configuration file is and the API for prompting to include that deletes is marked Know corresponding configuration file.
The application also provides a kind of data processing method, is applied to rear end management equipment, which comprises
The configuration file acquisition request that API gateway is sent is received, the configuration file acquisition request is identified comprising API;It looks into Look for configuration file corresponding with API mark;The configuration file found is sent to the API gateway.
Optionally, based on the above method, further includes: receive configuration file addition request, the configuration file adds Request is added to identify comprising configuration file and API;The configuration file that the configuration file addition request includes is stored, establishes and stores The corresponding relationship of configuration file and API mark that the configuration file addition request includes.
Optionally, based on the above method, further includes: receive configuration file and update request, the configuration file is more New request is identified comprising configuration file and API;It is literary by the corresponding configuration of API mark that request includes is updated with the configuration file Part is updated to the configuration file and updates the configuration file that request includes.
Optionally, based on the above method, further includes: Xiang Suoshu API gateway, which is sent, updates prompt, and the update mentions Show to update comprising the configuration file and requests included API mark.
Optionally, based on the above method, further includes: receive configuration file removal request, the configuration file is deleted Except request is identified comprising API;The API mark for including by the configuration file removal request is corresponding with corresponding configuration file to close System deletes, and/or, the API for including by the configuration file removal request identifies corresponding configuration file and deletes.
Optionally, based on the above method, further includes: Xiang Suoshu API gateway, which is sent, deletes prompt, and the deletion mentions Show the API mark for being included comprising the configuration file removal request.
The application also provides a kind of data processing equipment, is applied to API gateway, and described device includes:
First request reception unit, for receiving the request of sender's transmission;
Mark acquiring unit, the API mark for including for obtaining the request;
First configuration file acquiring unit, for obtaining configuration text corresponding with API mark from rear end management equipment Part;
Converting unit, for carrying out protocol conversion to the request using the transcode in the configuration file, to obtain Obtain the request with the protocol adaptation of recipient;
Request transmitting unit, for sending the request after conversion to the recipient.
The application also provides a kind of data processing equipment, is applied to rear end management equipment, and described device includes:
Second request reception unit, for receiving the configuration file acquisition request of API gateway transmission, the configuration file is obtained Request is taken to identify comprising API;
Configuration file searching unit, for searching configuration file corresponding with API mark;
Configuration file transmission unit, for sending the configuration file found to the API gateway.
The application also provides a kind of API gateway, including processor and memory;
Wherein, the processor is for executing the program stored in the memory;
For storing program, described program is at least used for the memory:
Receive the request that sender sends;Obtain the API mark that the request includes;From the acquisition of rear end management equipment and institute It states API and identifies corresponding configuration file;Protocol conversion is carried out to the request using the transcode in the configuration file, with Obtain the request with the protocol adaptation of recipient;The request after conversion is sent to the recipient.
The application also provides a kind of rear end management equipment, including processor and memory;
Wherein, the processor is for executing the program stored in the memory;
For storing program, described program is at least used for the memory:
The configuration file acquisition request that API gateway is sent is received, the configuration file acquisition request is identified comprising API;It looks into Look for configuration file corresponding with API mark;The configuration file found is sent to the API gateway.
The application also provides a kind of storage medium, and computer executable instructions, the meter are stored in the storage medium When calculation machine executable instruction is loaded and executed by processor, as above described in any item data processing methods are realized.
It can be seen that the application's has the beneficial effect that
Technical solution provided by the present application, when API gateway receives the request of sender's transmission, from rear end, management equipment is obtained Configuration file corresponding with the API mark that the request is included is taken, later using the transcode in the configuration file to request Protocol conversion is carried out, to obtain the request with the protocol adaptation of recipient, the request after conversion is sent to recipient.It can see It arrives, in technical solution disclosed in the present application, configuration file needed for API gateway realizes protocol conversion is set by rear end management It is standby to be safeguarded, when the service that server-side provides changes, it is only necessary to the configuration file by rear end management plant maintenance It is updated, the API gateway version without issuing new can be improved the stabilization of API gateway compared with prior art Property.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is the application Some embodiments for those of ordinary skill in the art without creative efforts, can also basis These attached drawings obtain other attached drawings.
Fig. 1 is a kind of configuration diagram of service system provided by the present application;
Fig. 2 is a kind of signaling diagram of data processing method provided by the present application;
Fig. 3 is the signaling diagram of another data processing method provided by the present application;
Fig. 4 is the flow chart of the data processing method provided by the present application applied to rear end management equipment;
Fig. 5 is the signaling diagram of another data processing method provided by the present application;
Fig. 6 is the signaling diagram of the data processing method provided by the present application under an application scenarios;
Fig. 7 is a kind of structural schematic diagram of the data processing equipment applied to API gateway provided by the present application;
Fig. 8 is a kind of structural schematic diagram of the data processing equipment applied to rear end management equipment provided by the present application;
Fig. 9 is a kind of hardware structure diagram of API gateway provided by the present application;
Figure 10 is a kind of hardware structure diagram of rear end management equipment provided by the present application.
Specific embodiment
API gateway provides api interface for multiple services of server-side.In the prior art, in order to guarantee that API gateway can The request sent to client and server-side formats, and will directly deposit for the transcode that each api interface is write It stores up to API gateway.When the service that server-side provides changes, the api interface that API gateway provides can also change, this When need to issue new API gateway version.For example, needing to issue new API gateway when there is new service to access API gateway Version, to increase the transcode of the api interface for the service in API gateway;When service updates, need to send out The new API gateway version of cloth is updated to be directed to the transcode of api interface of the service in API gateway.
The application provides the technical solution of another thinking, by the cooperation of API gateway and rear end management equipment, to realize When the service that server-side provides changes, without updating API gateway, and positive frequentation of the client to server-side can guarantee It asks.
To keep the purposes, technical schemes and advantages of the embodiment of the present application clearer, below in conjunction with the embodiment of the present application In attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is Some embodiments of the present application, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art Every other embodiment obtained without making creative work, shall fall in the protection scope of this application.
In order to make it easy to understand, the framework for the system being applicable in first the scheme of the application is introduced.
Referring to Figure 1, Fig. 1 is a kind of structural schematic diagram of service system provided by the present application.The service system includes eventually End 101, server 102, API gateway 103 and rear end management equipment 104.
It is communicated to connect between terminal 101 and API gateway 103 by network implementations, between API gateway 103 and server 102 It is connected by network implementations, is connected between API gateway 103 and rear end management equipment 104 by network implementations.
Multiple terminals 101 constitute client, and multiple servers 102 constitute server-side.Each server 102 is capable of providing one A or multiple services.Each service that API gateway 103 is provided for server 102 provides an api interface respectively, so as to Terminal 101 accesses the service that server 102 provides by api interface.Terminal 101 can be mobile device, such as mobile phone, notebook Computer and tablet computer, or fixed apparatus, such as desktop computer and smart television.
API gateway 103 is used for: being received the request that sender sends, the API mark that the request includes is obtained, from rear end pipe It manages equipment 104 and obtains configuration file corresponding with API mark, later using the transcode in the configuration file to above-mentioned Request carries out protocol conversion, to obtain the request with the protocol adaptation of recipient, sends the request after conversion to recipient.
It should be noted that there are two data flows between client and server-side in service system shown in Fig. 1 To.First data flow are as follows: client sends service request to API gateway 103, and API gateway 103 assists service request View conversion, and the service request after conversion is sent to server-side.Second data flow are as follows: server-side responds service request and generates Business information sends business information to API gateway 103, and API gateway 103 carries out protocol conversion to business information, and to client Business information after sending conversion.
Therefore, the sender in the application is client or server-side, correspondingly, the recipient in the application is service End or client.That is, API gateway 103 receives the request that sender sends are as follows: API gateway 103 receives client hair The service request sent;API gateway 103 sends the request after conversion to recipient are as follows: API gateway 103 sends to server-side and converts Service request afterwards.Alternatively, API gateway 103 receives the request that sender sends are as follows: API gateway 103 receives what server-side was sent Business information;API gateway 103 sends the request after conversion to recipient are as follows: after API gateway 103 sends conversion to client Business information.
Rear end management equipment 104 is used for: receiving the configuration file acquisition request that API gateway 103 is sent, wherein the configuration File acquisition request is identified comprising API, searches configuration file corresponding with API mark, sends configuration file to API gateway.
In implementation, the api interface provided for API gateway 103 constructs corresponding configuration file respectively, by these configuration texts Part is stored in the addressable storage medium of rear end management equipment 104.Rear end management equipment 104 is receiving the hair of API gateway 103 When the configuration file acquisition request sent, configuration file corresponding with the API mark that the configuration file acquisition request includes is searched, to API gateway 103 sends the configuration file.
In one possible implementation, rear end management equipment will be stored in for the configuration file of api interface building In 104, as shown in fig. 1.For example, database is created in rear end management equipment 104, it will be for the configuration of api interface building File is stored in the database.
In alternatively possible implementation, set rear end management is stored in for the configuration file of api interface building In the standby 104 another electronic equipments being able to access that.So, rear end management equipment 104 is receiving matching for the transmission of API gateway 103 When setting file acquisition request, configuration file is obtained from another electronic equipment, and the configuration file that will acquire is sent out to API gateway It send.
Scheme provided by the present application, API gateway receive sender transmission request when, from rear end management equipment obtain with The API that the request is included identifies corresponding configuration file, is carried out later using the transcode in the configuration file to request Protocol conversion is sent the request after conversion to recipient with obtaining the request with the protocol adaptation of recipient.It can be seen that In scheme disclosed in the present application, configuration file needed for API gateway realizes protocol conversion, is tieed up by rear end management equipment Shield, when the service that server-side provides changes, it is only necessary to which the configuration file by rear end management plant maintenance is updated , can be improved the stability of API gateway compared with prior art without issuing new API gateway version.
Fig. 2 is referred to, Fig. 2 is a kind of signaling diagram of data processing method disclosed in the present application.This method comprises:
Step S201: sending direction API gateway sends request.
Wherein, which includes API mark and API parameter.Referring to explanation hereinbefore, sender is terminal, recipient For server, alternatively, sender is server, recipient is terminal.
In one possible implementation, API is identified as API Name.
Step S202:API gateway obtains the API mark that the request includes.
Step S203:API gateway rear end management equipment sends configuration file acquisition request.
Wherein, which identifies comprising API, which is identified as the API in the transmitted request of sender Mark.
Step S204: rear end management equipment searches configuration file corresponding with API mark.
Step S205: rear end management equipment sends the configuration file found to API gateway.
In one possible implementation, rear end management equipment will be stored in for the configuration file of api interface building In, then rear end management equipment is locally searching configuration file corresponding with API mark, if finding corresponding configuration text Part, then sending the configuration file to API gateway.
In alternatively possible implementation, set rear end management is stored in for the configuration file of api interface building In the standby another electronic equipment being able to access that, then rear end management equipment sends inquiry request to another electronic equipment, this is looked into It askes request to identify comprising the API, so that another electronic equipment searches configuration file corresponding with API mark.If this is another One electronic equipment finds corresponding configuration file, then rear end management equipment sends the configuration file, rear end is managed later Equipment sends the configuration file to API gateway.
Step S206:API gateway carries out protocol conversion to request using the transcode in configuration file, to obtain and connect The request of side protocol adaptation.
Configuration file includes transcode.API gateway is by executing the transcode in configuration file, creation and recipient The matched object of agreement, the data in request are copied in the object, are obtained and the matched request of recipient's agreement.
Step S207:API gateway sends the request after conversion to recipient.
In implementation, API gateway carries out serializing processing to the request after conversion, converts objects into byte sequence, to connecing Debit sends byte sequence.After recipient receives the byte sequence of API gateway transmission, byte sequence is carried out at unserializing Reason, obtains object.
It should be noted that if API gateway is not from rear end, management equipment gets configuration corresponding with aforementioned API mark File, then API gateway sends prompt information to sender, so that sender knows the request for having sent mistake.
In the application scheme shown in Fig. 2, configuration file needed for API gateway realizes protocol conversion, is by rear end pipe Reason equipment is safeguarded, when the service that server-side provides changes, it is only necessary to the configuration by rear end management plant maintenance File is updated, without issuing new API gateway version.For example, when server-side provides new service, for this The configuration file is stored in rear end management equipment or another electronics hereinbefore by the corresponding configuration file of new service creation Equipment;After server-side is updated a certain service, for the new configuration file of updated service creation, rear end is managed Equipment or hereinbefore the configuration file of the service of another electronic equipment storage is updated to the new configuration file.When API net When pass receives corresponding request, from rear end, management equipment obtains the configuration file, is converted the request into based on the configuration file With the matched request of agreement of the recipient.
Fig. 3 is referred to, Fig. 3 is a kind of signaling diagram of data processing method disclosed in the present application.This method comprises:
Step S301: sending direction API gateway sends request.
Wherein, which includes API mark and API parameter.Referring to explanation hereinbefore, sender is terminal, recipient For server, alternatively, sender is server, recipient is terminal.
In one possible implementation, API is identified as API Name.
Step S302:API gateway obtains the API mark that the request includes.
Step S303:API gateway is locally searching configuration file corresponding with API mark.
If API gateway is locally finding corresponding configuration file, S308 is thened follow the steps, if API gateway is at this Ground does not find corresponding configuration file, thens follow the steps S304.
Step S304:API gateway rear end management equipment sends configuration file acquisition request.
Wherein, which identifies comprising API, which is identified as the API in the transmitted request of sender Mark.
Step S305: rear end management equipment searches configuration file corresponding with API mark.
Step S306: rear end management equipment sends the configuration file found to API gateway.
Step S307:API gateway stores the configuration file.
Step S308:API gateway carries out protocol conversion to request using the transcode in configuration file, to obtain and connect The request of side protocol adaptation.
Step S309:API gateway sends the request after conversion to recipient.
Compared with scheme shown in Fig. 2, after the configuration file that API gateway holds management equipment to send upon receipt, storage The configuration file.Correspondingly, API gateway when receiving the request of sender's transmission, is first wrapped in locally lookup with the request The API contained identifies corresponding configuration file, if not finding configuration file locally, then rear end management equipment sends configuration File acquisition request, so that rear end management equipment searches specified configuration file.With the continuous service of API gateway, API gateway The configuration file of storage also gradually increases, and after the request for receiving sender's transmission, API gateway is got correctly from local The probability of configuration file is gradually increased, and can reduce the data interaction amount of API gateway Yu rear end management equipment.Certainly, API gateway It needs to be managed local configuration file, can hereinafter elaborate.
Scheme disclosed in the present application is illustrated from the angle of rear end management equipment below.
Referring to fig. 4, Fig. 4 is the flow chart of the data processing method provided by the present application applied to rear end management equipment.It should Method includes:
Step S401: configuration file addition request is received.Wherein, configuration file addition request includes configuration file and API Mark.
Step S402: the configuration file that configuration file addition request includes is stored, establishes and stores the configuration file and add Add the corresponding relationship of the configuration file that request includes and API mark.
When rear end management equipment receives configuration file addition request, the configuration text in configuration file addition request is stored Part, and the corresponding relationship of configuration file and API mark in configuration file addition request is established, save the corresponding relationship.
Optionally, which is the corresponding relationship of API mark and configuration file storage address.
Step S403: it receives configuration file and updates request.Wherein, the configuration file update request comprising configuration file and API mark.
Step S404: configuration file corresponding with the API mark that configuration file update request includes is updated to this and is matched It sets file and updates the configuration file that request includes.
When rear end management equipment receives configuration file update request, searches and configuration file updates the API in requesting and marks Know corresponding configuration file, which is deleted, storage configuration file updates the configuration file in request later, thus real The update of existing configuration file.
Step S405: configuration file removal request is received.Wherein, which identifies comprising API.
Step S406: the API for including by the configuration file removal request is identified and the corresponding relationship of corresponding configuration file It deletes.
If server-side stops a certain service, configuration file removal request is generated, and rear end management equipment is sent. The configuration file removal request is identified comprising API, which is identified as the mark of the corresponding api interface of service out of service.
When rear end management equipment receives configuration file removal request, the API that the configuration file removal request includes is obtained Mark later deletes API mark and the corresponding relationship of configuration file.Later, if matching of receiving of rear end management equipment It sets the API that file acquisition request includes and is identified as API mark, due to the corresponding relationship of API mark and configuration file It deletes, therefore rear end management equipment will not find corresponding configuration file.
In another implementation, step S406 is replaced are as follows: the API for including by the configuration file removal request is identified Corresponding configuration file is deleted.
In another implementation, step S406 is replaced are as follows: the API for including by the configuration file removal request is identified It is deleted with the corresponding relationship of corresponding configuration file, the API for including by the configuration file removal request identifies corresponding configuration text Part is deleted.
The application data processing method shown in Fig. 4, mainly to rear end management device management configurations file content into Row explanation.When management equipment receives the configuration file acquisition request of API gateway transmission when rear end, the related step in Fig. 3 is executed Suddenly, it is not discussed here.
In data processing method shown in Fig. 2, after API gateway receives the configuration file of rear end management equipment transmission, API gateway does not carry out protocol conversion to request merely with the transcode in the configuration file, is also stored in the configuration file It is local.Data processing method as shown in connection with fig. 4, rear end management equipment are receiving configuration file update request and configuration file After removal request, corresponding prompt can also be sent to API gateway, so that API gateway is to being stored in local configuration file It is managed, is described in detail below with reference to Fig. 5.
Referring to Fig. 5, Fig. 5 is the signaling diagram of another data processing method provided by the present application.This method comprises:
Step S501: rear end management equipment receives configuration file addition request.
Wherein, configuration file addition request is identified comprising configuration file and API.
Step S502: rear end management equipment stores the configuration file that configuration file addition request includes, and establishes and stores The corresponding relationship of configuration file and API mark that configuration file addition request includes.
Step S503: rear end management equipment receives configuration file and updates request.
Wherein, which updates request and identifies comprising configuration file and API.
Step S504: it is literary that rear end management equipment will update the corresponding configuration of API mark that request includes with the configuration file Part is updated to the configuration file and updates the configuration file that request includes.
Step S505: rear end management equipment is sent to API gateway updates prompt.
Wherein, update prompt is updated comprising the configuration file requests included API mark.
Step S506:API gateway receives the update prompt that rear end management equipment is sent, by the be locally stored first configuration text Part is deleted.
Wherein, the first configuration file is the corresponding configuration file of API mark for including with update prompt.
Step S507:API gateway obtains from rear end management equipment and prompts the corresponding configuration of API mark for including with the update File, and stored.
It should be noted that sending update after rear end management equipment receives configuration file update request to API gateway and mentioning Show.If API gateway is stored with the API that update prompt includes and identifies corresponding configuration file, API gateway is by the configuration File is deleted.Later, if the request that receives of API gateway includes API mark, due to API gateway and not stored corresponding Configuration file, therefore API gateway obtains corresponding configuration file from rear end management equipment, to guarantee API gateway using correctly Configuration file to request carry out protocol conversion.
Optionally, after API gateway deletes the configuration file, step S507 is executed, is obtained from rear end management equipment with this more It newly prompts the API for including to identify corresponding configuration file, and stores the configuration file, that is, be updated to configuration file, Also it can guarantee that API gateway carries out protocol conversion to request using correct configuration file.
It is understood that if the API that the not stored update prompt of API gateway includes identifies corresponding configuration file, So step S506 does not need to execute, and step S507 can be executed, and can not also execute.
Step S508: rear end management equipment receives configuration file removal request.
Wherein, which identifies comprising API.
Step S509: the API mark that the configuration file removal request is included by rear end management equipment is literary with corresponding configuration The corresponding relationship of part is deleted.
In another implementation, step S509 is replaced are as follows: the API for including by the configuration file removal request is identified Corresponding configuration file is deleted.
In another implementation, step S509 is replaced are as follows: the API for including by the configuration file removal request is identified It is deleted with the corresponding relationship of corresponding configuration file, the API for including by the configuration file removal request identifies corresponding configuration text Part is deleted.
Step S510: it is sent to API gateway and deletes prompt.
Wherein, the API mark that prompt is included comprising the configuration file removal request is deleted
Step S511: the deletion prompt that rear end management equipment is sent is received, the second configuration file being locally stored is deleted.
Wherein, the second configuration file is the corresponding configuration file of API mark for including with deletion prompt.
After rear end management equipment receives configuration file removal request, is sent to API gateway and delete prompt.If API net It closes and is stored with the corresponding configuration file of API mark that deletion prompt includes, then API gateway deletes the configuration file.It can With understanding, if the API that the not stored deletion prompt of API gateway includes identifies corresponding configuration file, step S511 does not need to execute.
The application data processing method shown in fig. 5 is realized and is updated to the lossless heat of API gateway.In addition, Fig. 5 is main It is to be illustrated to the content of rear end management equipment and API gateway management configuration file.When the request for receiving sender's transmission When, step shown in Fig. 3 is executed, is not discussed here.
Data processing method provided by the present application is illustrated below with reference to a concrete scene.
Referring to Fig. 6, Fig. 6 is the signaling diagram of the data processing method provided by the present application under a concrete application scene.
It first corresponds to be illustrated with scene.Terminal is using JSON as communication protocol, and server is using JCE as communication Agreement, server provide login service, the entitled Login of the api interface of login service.The full name of JSON is JavaScript Object Notation is a kind of data interchange format of lightweight.The full name of JCE is Java Cryptography Extension。
This method comprises:
Step S601: terminal initialization JSON object fills account and password.
Such as: { " account ": " test ", " password ": " 123456 " }
Step S602: terminal sends logging request to API gateway.
Terminal to the service request that API gateway is sent be specially logging request.The logging request includes API mark and API Parameter.Wherein, API mark is specially Login, and API parameter is above-mentioned JSON object.
Step S603:API gateway obtains the mark of the API in the logging request.
Step S604:API gateway identifies according to the API and is locally searching corresponding configuration file.
If API gateway is locally finding configuration file corresponding with " Login ", S609 is thened follow the steps, if API Gateway is not locally finding configuration file corresponding with " Login ", thens follow the steps S605.
Step S605:API gateway rear end management equipment sends configuration file acquisition request, the configuration file acquisition request " Login " is identified comprising API.
Step S606: rear end management equipment searches configuration file corresponding with " Login ".
Step S607: rear end management equipment sends the configuration file found to API gateway.
Step S608:API gateway stores the configuration file, establish and store the configuration file and API mark " Login " it Between corresponding relationship.
Step S609:API gateway executes the transcode in configuration file, creates JCE object, and call ReadFromObject function copies to the data in JSON object in JCE object, the logging request after being converted, conversion Logging request afterwards uses JCE communication protocol.
Step S610:API gateway carries out serializing processing to the logging request after conversion, obtains byte sequence.
Step S611:API gateway sends byte sequence to server.
Step S612: server receives byte sequence, carries out unserializing processing to byte sequence, obtains JCE object, reads Take the account and password in JCE object.
In implementation, API gateway can carry out sequence to the logging request after conversion with calling sequence function writeStream Change processing, server can call unserializing function readStream to carry out unserializing processing to byte sequence.
On the other hand, the application also provides a kind of data processing equipment applied to API gateway.
The data processing equipment provided by the present application applied to API gateway is introduced below.It is answered described in hereafter Data processing equipment for API gateway is regarded as, the API gateway data processing method that embodiment provides to realize the present invention The program module of required setting.Hereinafter with regard to be applied to API gateway data processing equipment description, can with above in connection with The description of data processing method applied to API gateway is cross-referenced.
Referring to Fig. 7, Fig. 7 is a kind of structural schematic diagram of the data processing equipment applied to API gateway provided by the present application. The data processing equipment includes:
First request reception unit 701, for receiving the request of sender's transmission;
Mark acquiring unit 702, the API mark for including for obtaining request;
First configuration file acquiring unit 703, for obtaining configuration text corresponding with API mark from rear end management equipment Part;
Converting unit 704, for carrying out protocol conversion to request using the transcode in configuration file, to obtain and connect The request of the protocol adaptation of debit;
Request transmitting unit 705, for sending the request after conversion to recipient.
In one possible implementation, data processing equipment further include: storage control unit.
Storage control unit is used for: the configuration file that storage is obtained from rear end management equipment.
In one possible implementation, data processing equipment further include: the second configuration file acquiring unit.
Second configuration file acquiring unit is used for: after mark acquiring unit 702 obtains the API mark that request includes, In It is local to search configuration file corresponding with API mark, if not finding configuration text corresponding with API mark locally Part then triggers the first configuration file acquiring unit 703 and executes configuration text corresponding with API mark from the acquisition of rear end management equipment The operation of part.
In one possible implementation, which further includes updating prompt processing unit.
It updates prompt processing unit to be used for: receiving the update prompt that rear end management equipment is sent, first will be locally stored Configuration file is deleted.Wherein, the first configuration file is the corresponding configuration file of API mark for including with update prompt.
Optionally, update prompt processing unit is also used to: obtaining from rear end management equipment and update prompt includes API identifies corresponding configuration file, and is stored.
In one possible implementation, which further includes deleting prompt processing unit.
It deletes prompt processing unit to be used for: receiving the deletion prompt that rear end management equipment is sent, second will be locally stored Configuration file is deleted.Wherein, second configuration file is, and configuration corresponding with the API mark that the deletion prompt includes is literary Part.
On the other hand, the application also provides a kind of data processing equipment applied to rear end management equipment.
The data processing equipment provided by the present application applied to rear end management equipment is introduced below.Hereinafter describe The data processing equipment applied to rear end management equipment be regarded as, rear end management equipment to realize the present invention embodiment provide Data processing method needed for be arranged program module.Hereinafter with regard to the data processing equipment for being applied to rear end management equipment Description, can be cross-referenced with the description above in connection with the data processing method for being applied to rear end management equipment.
Referring to Fig. 8, Fig. 8 is that a kind of structure of the data processing equipment applied to rear end management equipment provided by the present application is shown It is intended to.The data processing equipment includes:
Second request reception unit 801, for receiving the configuration file acquisition request of API gateway transmission, configuration file is obtained Request is taken to identify comprising API;
Configuration file searching unit 802, for searching configuration file corresponding with API mark;
Configuration file transmission unit 803, for sending the configuration file found to API gateway.
In one possible implementation, data processing equipment further include: addition requesting processing.
Addition requesting processing is used for: receiving configuration file addition request, wherein the configuration file adds request and includes Configuration file and API mark;The configuration file that configuration file addition request includes is stored, establishes and stores the configuration file and add Add the corresponding relationship of the configuration file that request includes and API mark.
In one possible implementation, data processing equipment further include: update requesting processing.
It updates requesting processing to be used for: receiving configuration file and update request, wherein configuration file updates request comprising matching Set file and API mark;Configuration file corresponding with the API mark that configuration file update request includes is updated to the configuration File updates the configuration file that request includes.
In one possible implementation, data processing equipment further include: update prompt transmission unit.
It updates prompt transmission unit to be used for: being sent to API gateway and update prompt.Wherein, update prompt includes configuration text Part, which updates, requests included API mark.
In one possible implementation, data processing equipment further include: removal request processing unit.
Removal request processing unit is used for: receiving configuration file removal request, wherein configuration file removal request includes API mark;The API mark for including by the configuration file removal request is deleted with the corresponding relationship of corresponding configuration file, and/ It is deleted or, the API for including by the configuration file removal request identifies corresponding configuration file.
In one possible implementation, data processing equipment further include: delete prompt transmission unit.
It deletes prompt transmission unit to be used for: being sent to API gateway and delete prompt.Wherein, deleting prompt includes configuration file The API mark that removal request is included.
On the other hand, the application also provides a kind of API gateway.
Referring to Fig. 9, Fig. 9 is a kind of hardware structure diagram of API gateway provided by the present application.The API gateway may include place Manage device 901 and memory 902.
Optionally, which can also include: communication interface 903, input unit 904, display 905 and communication bus 906.Wherein, processor 901, memory 902, communication interface 903, input unit 904, display 905 pass through communication bus 906 complete mutual communication.
In the embodiment of the present application, the processor 901 can for central processing unit (Central Processing Unit, CPU), application-specific integrated circuit, digital signal processor, ready-made programmable gate array or other programmable logic device Deng.
The processor 901 can call the program stored in memory 902.
For storing one or more than one program in memory 902, program may include program code, described program Code includes computer operation instruction.In the embodiment of the present application, it is at least stored in the memory for realizing following functions Program:
Receive the request that sender sends;Obtain the API mark that the request includes;It obtains and is somebody's turn to do from rear end management equipment API identifies corresponding configuration file;Protocol conversion is carried out to the request using the transcode in configuration file, to obtain and connect The request of the protocol adaptation of debit;The request after conversion is sent to recipient.
In one possible implementation, which may include storing program area and storage data area, wherein Storing program area can storage program area, above mentioned program etc.;Storage data area can be stored according to computer equipment The data etc. created in use process.
In addition, memory 902 may include high-speed random access memory, it can also include nonvolatile memory.
The communication interface 903 can be the interface of communication module.
The input unit 904 may include the touch sensing unit for incuding the touch event on touch display panel, keyboard Etc..
The display 905 includes display panel, such as touch display panel.
Certainly, the structure of API gateway shown in Fig. 9 does not constitute the restriction to API gateway in the embodiment of the present application, in reality API gateway may include than more or fewer components shown in Fig. 9, or the certain components of combination in the application of border.
On the other hand, the application also provides a kind of rear end management equipment.
Referring to Figure 10, Figure 10 is a kind of hardware structure diagram of rear end management equipment provided by the present application.Rear end management is set Standby may include processor 1001 and memory 1002.
Optionally, which can also include: that communication interface 1003, input unit 1004, display 1005 and communication are total Line 1006.Wherein, processor 1001, memory 1002, communication interface 1003, input unit 1004, display 1005 pass through Communication bus 1006 completes mutual communication.
In the embodiment of the present application, which can be central processing unit (Central Processing Unit, CPU), application-specific integrated circuit, digital signal processor, ready-made programmable gate array or other programmable logic Device etc..
The processor 1001 can call the program stored in memory 1002.
For storing one or more than one program in memory 1002, program may include program code, the journey Sequence code includes computer operation instruction.In the embodiment of the present application, it is at least stored in the memory for realizing following function The program of energy:
Receive the configuration file acquisition request that API gateway is sent, wherein the configuration file acquisition request is identified comprising API; Search configuration file corresponding with API mark;The configuration file found is sent to API gateway.
In one possible implementation, which may include storing program area and storage data area, wherein Storing program area can storage program area, above mentioned program etc.;Storage data area can be stored according to computer equipment The data etc. created in use process.
In addition, memory 1002 may include high-speed random access memory, it can also include nonvolatile memory.
The communication interface 1003 can be the interface of communication module.
The input unit 1004 may include the touch sensing unit for incuding the touch event on touch display panel, keyboard Etc..
The display 1005 includes display panel, such as touch display panel.
Certainly, the structure of rear end management equipment shown in Fig. 10 is not constituted to rear end management equipment in the embodiment of the present application Restriction, rear end management equipment may include or the combination than more or fewer components shown in Fig. 10 in practical applications Certain components.
On the other hand, the application also provides a kind of storage medium, and computer program, computer are stored in the storage medium When program is loaded and executed by processor, it is applied to API gateway for realizing described in any one embodiment as above Data processing method, or for realizing the data for being applied to rear end management equipment described in any one embodiment as above Processing method.
Finally, it is to be noted that, herein, relational terms such as first and second and the like be used merely to by One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning Covering non-exclusive inclusion, so that the process, method, article or equipment for including a series of elements not only includes that A little elements, but also including other elements that are not explicitly listed, or further include for this process, method, article or The intrinsic element of equipment.
Each embodiment in this specification is described in a progressive manner, the highlights of each of the examples are with other The difference of embodiment, the same or similar parts in each embodiment may refer to each other.For device disclosed in embodiment, For API gateway, rear end management equipment and storage medium, since it is corresponded to the methods disclosed in the examples, so description Fairly simple, reference may be made to the description of the method.
The foregoing description of the disclosed embodiments makes professional and technical personnel in the field can be realized or use the application. Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein General Principle can be realized in other embodiments without departing from the spirit or scope of the application.Therefore, the application It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one The widest scope of cause.

Claims (10)

1. a kind of data processing method, which is characterized in that be applied to application programming interface API gateway, which comprises
Receive the request that sender sends;
Obtain the API mark that the request includes;
Configuration file corresponding with API mark is obtained from rear end management equipment;
Protocol conversion is carried out to the request using the transcode in the configuration file, it is suitable with the agreement of recipient to obtain The request matched;
The request after conversion is sent to the recipient.
2. the method according to claim 1, wherein being gone back after the API mark that the acquisition request includes Include:
Locally searching configuration file corresponding with API mark;
If execution is described to be obtained from rear end management equipment not finding configuration file corresponding with API mark locally Take the operation that corresponding configuration file is identified with the API;
It is described obtain corresponding with API mark configuration file from rear end management equipment after, further includes: store after described The configuration file for holding management equipment to obtain.
3. according to the method described in claim 2, it is characterized by further comprising:
Receive the update prompt that the rear end management equipment is sent;
The first configuration file being locally stored is deleted, wherein first configuration file and the update prompt include API identifies corresponding configuration file;
From rear end management equipment acquisition configuration file corresponding with the API mark that the update prompt includes, and deposited Storage.
4. according to the method described in claim 2, it is characterized by further comprising:
Receive the deletion prompt that the rear end management equipment is sent;
The second configuration file being locally stored is deleted, wherein second configuration file and the deletion prompt include API identifies corresponding configuration file.
5. a kind of data processing method, which is characterized in that be applied to rear end management equipment, which comprises
The configuration file acquisition request that API gateway is sent is received, the configuration file acquisition request is identified comprising API;
Search configuration file corresponding with API mark;
The configuration file found is sent to the API gateway.
6. according to the method described in claim 5, it is characterized by further comprising:
It receives configuration file and updates request, the configuration file updates request and identifies comprising configuration file and API;
Configuration file corresponding with the API mark that configuration file update request includes is updated to the configuration file to update The configuration file that request includes;
It is sent to the API gateway and updates prompt, the update prompt is updated comprising the configuration file requests included API Mark;
Configuration file removal request is received, the configuration file removal request is identified comprising API;
The API mark for including by the configuration file removal request is deleted with the corresponding relationship of corresponding configuration file, and/or, The API for including by the configuration file removal request identifies corresponding configuration file and deletes;
It is sent to the API gateway and deletes prompt, the API for deleting prompt and being included comprising the configuration file removal request Mark.
7. a kind of data processing equipment, which is characterized in that be applied to API gateway, described device includes:
First request reception unit, for receiving the request of sender's transmission;
Mark acquiring unit, the API mark for including for obtaining the request;
First configuration file acquiring unit, for obtaining configuration file corresponding with API mark from rear end management equipment;
Converting unit, for using the transcode in the configuration file to the request carry out protocol conversion, with obtain with The request of the protocol adaptation of recipient;
Request transmitting unit, for sending the request after conversion to the recipient.
8. a kind of data processing equipment, which is characterized in that be applied to rear end management equipment, described device includes:
Second request reception unit, for receiving the configuration file acquisition request of API gateway transmission, the configuration file acquisition is asked It asks and is identified comprising API;
Configuration file searching unit, for searching configuration file corresponding with API mark;
Configuration file transmission unit, for sending the configuration file found to the API gateway.
9. a kind of API gateway, which is characterized in that including processor and memory;
Wherein, the processor is for executing the program stored in the memory;
For storing program, described program is at least used for the memory:
Receive the request that sender sends;Obtain the API mark that the request includes;From rear end management equipment obtain with it is described API identifies corresponding configuration file;Protocol conversion is carried out to the request using the transcode in the configuration file, to obtain Obtain the request with the protocol adaptation of recipient;The request after conversion is sent to the recipient.
10. a kind of rear end management equipment, which is characterized in that including processor and memory;
Wherein, the processor is for executing the program stored in the memory;
For storing program, described program is at least used for the memory:
The configuration file acquisition request that API gateway is sent is received, the configuration file acquisition request is identified comprising API;Search with The API identifies corresponding configuration file;The configuration file found is sent to the API gateway.
CN201910697027.3A 2019-07-30 2019-07-30 Data processing method, device, API gateway and rear end management equipment Pending CN110417891A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910697027.3A CN110417891A (en) 2019-07-30 2019-07-30 Data processing method, device, API gateway and rear end management equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910697027.3A CN110417891A (en) 2019-07-30 2019-07-30 Data processing method, device, API gateway and rear end management equipment

Publications (1)

Publication Number Publication Date
CN110417891A true CN110417891A (en) 2019-11-05

Family

ID=68364620

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910697027.3A Pending CN110417891A (en) 2019-07-30 2019-07-30 Data processing method, device, API gateway and rear end management equipment

Country Status (1)

Country Link
CN (1) CN110417891A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111064720A (en) * 2019-12-10 2020-04-24 大唐半导体科技有限公司 Method and device for converting configuration gateway data protocol
CN111885114A (en) * 2020-06-29 2020-11-03 百度在线网络技术(北京)有限公司 Method, device and storage medium for upgrading application program interface module in gateway
CN113422719A (en) * 2021-06-22 2021-09-21 北京博创联动科技有限公司 Configuration system and configuration method of protocol conversion gateway and protocol conversion gateway

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109165248A (en) * 2018-01-29 2019-01-08 北京数聚鑫云信息技术有限公司 A kind of management system and management method based on API
CN109213519A (en) * 2018-09-14 2019-01-15 北京数聚鑫云信息技术有限公司 A kind of isomery API adaptation processing method and system
CN109714332A (en) * 2018-12-26 2019-05-03 北京字节跳动网络技术有限公司 The method for converting protocol and device parsed based on Thrift and syntax tree

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109165248A (en) * 2018-01-29 2019-01-08 北京数聚鑫云信息技术有限公司 A kind of management system and management method based on API
CN109213519A (en) * 2018-09-14 2019-01-15 北京数聚鑫云信息技术有限公司 A kind of isomery API adaptation processing method and system
CN109714332A (en) * 2018-12-26 2019-05-03 北京字节跳动网络技术有限公司 The method for converting protocol and device parsed based on Thrift and syntax tree

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111064720A (en) * 2019-12-10 2020-04-24 大唐半导体科技有限公司 Method and device for converting configuration gateway data protocol
CN111885114A (en) * 2020-06-29 2020-11-03 百度在线网络技术(北京)有限公司 Method, device and storage medium for upgrading application program interface module in gateway
CN111885114B (en) * 2020-06-29 2023-03-24 百度在线网络技术(北京)有限公司 Method, device and storage medium for upgrading application program interface module in gateway
CN113422719A (en) * 2021-06-22 2021-09-21 北京博创联动科技有限公司 Configuration system and configuration method of protocol conversion gateway and protocol conversion gateway
CN113422719B (en) * 2021-06-22 2022-08-23 北京博创联动科技有限公司 Configuration system and configuration method of protocol conversion gateway and protocol conversion gateway

Similar Documents

Publication Publication Date Title
US10244058B2 (en) Extending functionality of applications
CN110351283B (en) Data transmission method, device, equipment and storage medium
RU2607616C2 (en) Selective linking of message accounts
US9021468B1 (en) Bundling extension installation with web browser installation
CN110417891A (en) Data processing method, device, API gateway and rear end management equipment
CN107153599B (en) Method and equipment for recording and playing back user operation
CN102984278B (en) Realize the system and method that browser data synchronizes
CN103001926A (en) Method, device and system for subscription notification
US20140122576A1 (en) Setting support apparatus, setting support system and setting support method
US9300610B2 (en) System and method for selecting a file stored on a cloud server
US20060259523A1 (en) System and method of synchronization of internal data cache with wireless device application data repositories
CN110704200A (en) Method and device for converting call interface
CN107844488B (en) Data query method and device
BR112014010096B1 (en) METHOD TO FACILITATE ELECTRONIC SUBSCRIPTIONS ON A CUSTOMER DEVICE WHICH IS OPERATED BY A SUBSCRIBER
JP2006243985A (en) Message notification system and method, and server used therefor
CN112925584A (en) Scene-based file configuration method, device, storage medium, and program product
Jin et al. IoT device management architecture based on proxy
CN111062682B (en) Work order processing method and device
WO2017097138A1 (en) Notification message processing method and device
US7792921B2 (en) Metadata endpoint for a generic service
US20200184007A1 (en) Edoc utility using non-structured-query-language databases
US20240193249A1 (en) Method of processing cross-domain authorization and method of processing cross-domain call
KR20030047528A (en) CRM data managing method, CRM server and the recording medium thereof
JP2020136827A (en) Information processing system, setting management server, and setting management method
CN116151903B (en) Service processing method and device based on sales promotion management system

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

Application publication date: 20191105

RJ01 Rejection of invention patent application after publication