CN108429645A - A kind of configuration method of API gateway, device, storage medium and API gateway - Google Patents

A kind of configuration method of API gateway, device, storage medium and API gateway Download PDF

Info

Publication number
CN108429645A
CN108429645A CN201810178181.5A CN201810178181A CN108429645A CN 108429645 A CN108429645 A CN 108429645A CN 201810178181 A CN201810178181 A CN 201810178181A CN 108429645 A CN108429645 A CN 108429645A
Authority
CN
China
Prior art keywords
server
information
client
service requesting
sent
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
CN201810178181.5A
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.)
Shenzhen Lexin Software Technology Co Ltd
Original Assignee
Shenzhen Lexin Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Lexin Software Technology Co Ltd filed Critical Shenzhen Lexin Software Technology Co Ltd
Priority to CN201810178181.5A priority Critical patent/CN108429645A/en
Publication of CN108429645A publication Critical patent/CN108429645A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • 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
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0893Assignment of logical groups to network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring
    • 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/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • 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
    • 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
    • H04L67/63Routing a service request depending on the request content or context

Abstract

The embodiment of the invention discloses a kind of configuration method of API gateway, device, storage medium and API gateways.The configuration method of the API gateway includes:Receive the server configuration change request that user sends;Pre-stored server configuration information is updated according to server configuration change request;According to updated server configuration information and preset protocol conversion rule, the business information that server provides is fed back into client.The technical solution provided through the embodiment of the present invention can effectively realize the dynamic configuration of API gateway, provide the ability for accessing latest services device for client in real time, substantially increase flexibility and the stability of API gateway.

Description

A kind of configuration method of API gateway, device, storage medium and API gateway
Technical field
The present embodiments relate to technical field of software development more particularly to a kind of configuration method of API gateway, device, Storage medium and API gateway.
Background technology
Currently, various network services generally have client and server-side, and intermediate all there are one API (Application Programming Interface, application programming interface) gateway uniformly receives the tune such as client or outside partner With the request of side, and according to the different logic of each interface, certain verification and logical process is carried out, back-end services are relayed to Side.
Obviously, API gateway is the intermediate bridge that client and back-end services are accepted in network service, is that HTTP request is opened up Open up the process of back-end services.The request call amount of API gateway is typically all magnanimity, and even running is most important.
However, existing gateway system has the following defects:1, business that gateway system provides back-end services side Configuration information can not be handled into Mobile state, when the change of the configuration information of back-end services side, need developer in gateway system Side carries out adaptation adjustment, and not only efficiency is low, but also is easy to influence the stability of gateway system;2, when there is new back-end services side to connect When function Access Gateway system for client to provide service, it is also desirable to which developer carries out adaptation adjustment, developer in gateway system Heavy workload and repeatability it is high;3, the service adaptation logic of each back-end services side is handled in gateway system, coupling Seriously;4, gateway system can not support multiple back-end services sides to provide service parallel, need serially to execute related service operation, property Can be poor, efficiency is low.
Invention content
The embodiment of the present invention provides a kind of configuration method of API gateway, device, storage medium and API gateway, to realize The dynamic configuration of API gateway improves flexibility and the stability of API gateway.
In a first aspect, an embodiment of the present invention provides a kind of configuration method of API gateway, this method includes:
Receive the server configuration change request that user sends;
Pre-stored server configuration information is updated according to server configuration change request;
According to updated server configuration information and preset protocol conversion rule, the business that server is provided Information feeds back to client.
Further, described regular according to updated server configuration information and preset protocol conversion, it will take The business information that business device provides feeds back to client, including:
Receive the service requesting information that client is sent;
According to protocol conversion rule and the updated server configuration information, by the service requesting information with The mode of multithreading asynchronism and concurrency is sent at least one server;
The business information that at least one server is sent is received, and based on protocol conversion rule, by the industry Business information feeds back to client;
Wherein, the business information is the feedback information that the server responds the service requesting information.
Further, the service requesting information is being sent at least one service in a manner of multithreading asynchronism and concurrency Before device, further include:
Judge whether the service requesting information meets default safety certification rule;
The service requesting information is sent at least one server in a manner of multithreading asynchronism and concurrency, including:
When the service requesting information meets the default safety certification rule, by the service requesting information with multi-thread The mode of journey asynchronism and concurrency is sent at least one server.
Further, described when the service requesting information meets the default safety certification rule, by the business Solicited message is sent at least one server in a manner of multithreading asynchronism and concurrency, including:
When the service requesting information meets the default safety certification rule, logging request is sent to client;
When receiving the client end response in the log-on message of the logging request, whether the log-on message is judged Meet and presets registration conditions;
When the log-on message, which meets, presets registration conditions, by the service requesting information with multithreading asynchronism and concurrency Mode is sent at least one server.
Further, before the service requesting information that the reception client is sent, including:
Judge that whether unit interval server interface is called number more than predetermined threshold value;
The service requesting information for receiving client and sending, including:
When the called number of the unit interval server interface is less than predetermined threshold value, receive what client was sent Service requesting information.
Further, further include:
When the unit interval server interface is called number more than predetermined threshold value, the client is sent Service requesting information intercepts, and the service requesting information is sent to the server to cancel.
Further, further include:
The calling data of server interface are monitored in real time, wherein the calling data include server interface At least one of calling amount, method of calling, response time and error rate;
When monitoring the calling data and being unsatisfactory for preset condition, alarm.
Second aspect, the embodiment of the present invention additionally provide a kind of configuration device of API gateway, which includes:
Request receiving module is changed, the server configuration change request for receiving user's transmission;
Configuration information update module, for being configured to pre-stored server according to server configuration change request Information is updated;
Business information feedback module, for being advised according to updated server configuration information and preset protocol conversion Then, the business information that server provides is fed back into client.
The third aspect, the embodiment of the present invention additionally provide a kind of computer readable storage medium, are stored thereon with computer Program realizes the configuration method of the API gateway as described in first aspect of the embodiment of the present invention when program is executed by processor.
Fourth aspect processor and is stored in storage an embodiment of the present invention provides a kind of API gateway, including memory It can realize on device and when the computer program of processor operation, the processor execute the computer program such as the present invention in fact Apply the configuration method of the API gateway described in a first aspect.
The allocation plan of API gateway provided in an embodiment of the present invention, the server configuration change sent by receiving user It asks, and pre-stored server configuration information is updated according to server configuration change request, then basis Updated server configuration information and preset protocol conversion rule, visitor is fed back to by the business information that server provides Family end can effectively realize the dynamic configuration of API gateway, provide the ability for accessing latest services device for client in real time, significantly Improve flexibility and the stability of API gateway.
Description of the drawings
Fig. 1 is a kind of flow diagram of the configuration method for API gateway that the embodiment of the present invention one provides;
Fig. 2 is a kind of flow diagram of the configuration method of API gateway provided by Embodiment 2 of the present invention;
Fig. 3 is a kind of flow diagram of the configuration method for API gateway that the embodiment of the present invention three provides;
Fig. 4 is a kind of flow diagram of the configuration method for API gateway that the embodiment of the present invention four provides;
Fig. 5 is a kind of structural schematic diagram of the configuration device for API gateway that the embodiment of the present invention five provides;
Fig. 6 is a kind of structural schematic diagram for API gateway that the embodiment of the present invention seven provides.
Specific implementation mode
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining the present invention rather than limitation of the invention.It also should be noted that in order to just Only the parts related to the present invention are shown in description, attached drawing rather than entire infrastructure.
Embodiment one
Fig. 1 is the flow diagram of the configuration method of API gateway provided in an embodiment of the present invention, and this method is applicable to pair API gateway carries out the case where dynamic configuration, can be executed by the configuration device of API gateway, wherein the device can by software and/or Hardware realization can be generally integrated in API gateway.As shown in Figure 1, this method includes:
S110, the server configuration change request that user sends is received.
In embodiments of the present invention, it when the configuration information for needing the server to accessing API gateway is modified, receives The server configuration change request that user sends, wherein user here refers generally to server developer.Wherein, work as needs When accessing new server in API gateway, i.e., when developer develops the new server with new business, needing should New server accesses API gateway, when providing business information as client by API gateway, the request of server configuration change It may include registration information.When needing to unload the server that some has accessed API gateway, the request of server configuration change May include de-registration request information, i.e., the request deleted the interface message of the server and server info from API gateway Information.When need to the server configuration informations such as the interface message of the server that has accessed API gateway and/or server info into When row change, the request of server configuration change can be server configuration update request, the i.e. server to having accessed API gateway The solicited message that professional ability is upgraded or optimized is provided.
S120, pre-stored server configuration information is updated according to the request of server configuration change.
In embodiments of the present invention, pre-stored server configuration information can be understood as being currently accessed API gateway The configuration information of server.When receiving the server configuration change request of developer's input, to pre-stored service Device configuration information is updated.It is understood that being asked according to server configuration change, the pre-stored clothes of adaptation It is engaged in device configuration information, keeps the server configuration information that API gateway is locally stored related to the server that is currently accessed API gateway Configuration information synchronized update.The advantages of this arrangement are as follows the dynamic access that server enters API gateway may be implemented, and API gateway lateral root carries out adaptation according to the server of dynamic access to being stored in local server configuration information, realizes The dynamic configuration of API gateway improves flexibility and the stability of API gateway.
S130, according to updated server configuration information and preset protocol conversion rule, server is provided Business information feed back to client.
API gateway is the bridge that client and server carries out data transmission, when the business for receiving client transmission When solicited message, which is forwarded to corresponding service by API gateway according to updated server configuration information Device, server responds the service requesting information, and generates business information based on the service requesting information.API gateway receives service The business information that device provides, and according to preset protocol conversion rule, server-side is provided in a manner of custom protocol Business information be converted to the mode of http protocol, feed back to client, i.e., assist the business information that server provides with HTTP The form of view is presented on client.Certainly, API gateway in the service requesting information for sending client according to updated service Configuration information is forwarded to before corresponding server, and according to preset protocol conversion rule, by client with HTTP The service requesting information that protocol form is sent, after being converted into the custom protocol form of corresponding server, retransmits to the phase The server answered.
It is understood that the http data for sending client may be implemented in preset protocol conversion rule Back-end server custom protocol data are converted to, can also realize and server end custom protocol data are converted into client The http data of side, you can effectively to realize protocol adaptation when data transmission between client and server.And according to The service requesting information that client is sent can be accurately forwarded to corresponding server by updated server configuration information, and The business information of corresponding server is accurately supplied to client.
The configuration method of API gateway provided in an embodiment of the present invention, the server configuration change sent by receiving user It asks, and pre-stored server configuration information is updated according to server configuration change request, then basis Updated server configuration information and preset protocol conversion rule, visitor is fed back to by the business information that server provides Family end can effectively realize the dynamic configuration of API gateway, provide the ability for accessing latest services device for client in real time, significantly Improve flexibility and the stability of API gateway.
Embodiment two
Fig. 2 is a kind of flow diagram of the configuration method of API gateway provided by Embodiment 2 of the present invention.The present embodiment with It is optimized based on above-described embodiment, in the present embodiment, by step according to updated server configuration information and in advance The protocol conversion rule of setting, feeds back to client by the business information that server provides, is optimized for:Receive what client was sent Service requesting information;According to protocol conversion rule and the updated server configuration information, by the service request Information is sent at least one server in a manner of multithreading asynchronism and concurrency;Receive the industry that at least one server is sent Business information, and based on protocol conversion rule, the business information is fed back into client;Wherein, the business information is The server responds the feedback information of the service requesting information.Correspondingly, the method for the present embodiment specifically includes:
S210, the server configuration change request that user sends is received.
S220, pre-stored server configuration information is updated according to the request of server configuration change.
S230, the service requesting information that client is sent is received.
In embodiments of the present invention, the service requesting information that client is sent is received, wherein the business that client is sent is asked Information is asked to be sent to API gateway in the form of http protocol, namely the number that the service requesting information received is http protocol form According to.Wherein, client may include any one in APP callers, H5 callers and third party external callers.
S240, according to protocol conversion rule and updated server configuration information, by service requesting information with multithreading The mode of asynchronism and concurrency is sent at least one server.
In embodiments of the present invention, it is determined and service requesting information pair according to updated server configuration information first The server answered, i.e. client need the server of the specific access API gateway accessed.Wherein, corresponding with service requesting information Server can be one, or it is multiple.And it according to updated server configuration information, determines and believes with service request Cease the custom protocol of corresponding server, wherein the custom protocol of server corresponding with service requesting information can phase Together, it can also be different.Then, according to preset protocol conversion rule, the industry for the http protocol form that client is sent Business solicited message, is converted to the service requesting information of the custom protocol form of server corresponding with the service requesting information. By the service requesting information of each custom protocol form, at least one service is sent in a manner of multithreading asynchronism and concurrency Device.Wherein, by the service requesting information of each custom protocol form, at least one is sent in a manner of multithreading asynchronism and concurrency A server, it can be understood as, by the service requesting information, while being sent to multiple servers or at least one server not Same service interface completes response without some service interface of server or some server for the service requesting information After operation, another service interface of another server or server is directed to the service requesting information and executes corresponding response again Operation.
S250, the business information that at least one server is sent is received, and based on protocol conversion rule, business information is anti- It is fed to client.
Wherein, business information is the feedback information that server responds service requesting information.
In embodiments of the present invention, the business information that server is sent is received, wherein business information is that the server is made by oneself The form of adopted agreement is presented.Business information is the feedback information of server response service requesting information namely business information is clothes The service requesting information that business device is sent for client is responded, and is supplied to the service of the client.According to presetting Protocol conversion rule, the business information of custom protocol form is converted to the business information of http protocol form, and should Business information is sent to client, to provide corresponding business service to the user.
The configuration method of API gateway provided in an embodiment of the present invention, by according to protocol conversion rule and updated clothes The service requesting information that client is sent is sent at least one clothes by business device configuration information in a manner of multithreading asynchronism and concurrency Business device, and based on protocol conversion rule, the business information that at least one server is sent is fed back into client, wherein business Information is the feedback information that server responds service requesting information, and the HTTP request that may be implemented to send client is with multithreading The mode of asynchronism and concurrency accesses multiple servers, quickly meets the needs of client accesses multiple complicated business.
Embodiment three
Fig. 3 is a kind of flow diagram of the configuration method for API gateway that the embodiment of the present invention three provides.The present embodiment with Optimized based on above-described embodiment, in the present embodiment, by the service requesting information with multithreading asynchronism and concurrency Mode is sent to before at least one server, further includes:Judge whether the service requesting information meets default safety certification Rule;Correspondingly, the service requesting information is sent at least one service by step in a manner of multithreading asynchronism and concurrency Device is optimized for:When the service requesting information meets the default safety certification rule, by the service requesting information with more The mode of thread asynchronism and concurrency is sent at least one server.Further, by step when the service requesting information meets When the default safety certification rule, the service requesting information is sent in a manner of multithreading asynchronism and concurrency at least one Server is optimized for:When the service requesting information meets the default safety certification rule, sends to log in client and ask It asks;When receiving the client end response in the log-on message of the logging request, judge whether the log-on message meets Default registration conditions;It is when the log-on message, which meets, presets registration conditions, the service requesting information is asynchronous with multithreading Concurrent mode is sent at least one server.Correspondingly, the method for the present embodiment specifically includes:
S310, the server configuration change request that user sends is received.
S320, pre-stored server configuration information is updated according to the request of server configuration change.
S330, the service requesting information that client is sent is received.
S340, judge whether service requesting information meets default safety certification rule, otherwise held if so, executing S350 Row S380.
In the present embodiment, judge whether the service requesting information that client is sent meets default safety certification rule.Show Example property, may include the IP address for the client for sending the service requesting information in service requesting information, correspondingly, judging industry Whether business solicited message, which meets default safety certification rule, may include:With judging the IP of the client of transmission service requesting information Whether location is in default IP blacklists, when the IP address for the client for sending service requesting information is not in default IP blacklists When, it may be determined that the service requesting information, which meets, presets safety certification rule;As the IP for the client for sending service requesting information When address is in default IP blacklists, it may be determined that the service requesting information is unsatisfactory for default safety certification rule.
S350, logging request is sent to client.
In the present embodiment, it when client needs to access some server of access API gateway, needs just may be used after logging in To access.Therefore, when service requesting information, which meets, presets safety certification rule, logging request is sent to client.Its In, logging request can be understood as the finger that prompt user inputs the associated login informations such as login account and login password in client Enable information.
S360, when receiving client end response in the log-on message of logging request, it is pre- to judge whether log-on message meets If registration conditions, if so, executing S370, otherwise, returns and execute S350.
When receiving user in the log-on message that client inputs, judge whether log-on message meets default registration conditions. Illustratively, client end response in the log-on message of logging request may include login account and login password, correspondingly, judging Whether log-on message meets default registration conditions:Judge whether the login account, if there are the login account, Further judge whether login password is correct.Certainly, it if user does not access the login account of the server, can first carry Show that user inputs personal information login account.If login account is correct, but when login password is incorrect, user can be prompted Re-enter new login password.It is understood that when login account and correct login password, show that log-on message is full The default registration conditions of foot.
S370, according to protocol conversion rule and updated server configuration information, by service requesting information with multithreading The mode of asynchronism and concurrency is sent at least one server.
S380, the service requesting information for sending client intercept.
When service requesting information is unsatisfactory for default safety certification rule, directly the business that client is sent please can be believed Breath is intercepted.
The configuration method of API gateway provided in an embodiment of the present invention, by judging it is default whether service requesting information meets Safety certification rule sends logging request to client, works as reception when service requesting information, which meets, presets safety certification rule To client end response when the log-on message of logging request, judge whether log-on message meets default registration conditions, believes when logging in When breath meets default registration conditions, according to protocol conversion rule and updated server configuration information, by service requesting information It is sent at least one server in a manner of multithreading asynchronism and concurrency, the malicious traffic that client is sent can be effectively prevent to ask It asks information to wash away API gateway, stability and the safety of API gateway is provided, while invalid business can be effectively reduced and asked It asks information to be forwarded to server, promotes the ability of processing data.
Example IV
Fig. 4 is a kind of flow diagram of the configuration method for API gateway that the embodiment of the present invention four provides.The present embodiment with It is optimized based on above-described embodiment, in the present embodiment, the service requesting information that client is sent is received described in step Before, increase step:Judge that whether unit interval server interface is called number more than predetermined threshold value, correspondingly, will step The rapid service requesting information for receiving client and sending, is optimized for:When the unit interval server interface is called number not When more than predetermined threshold value, the service requesting information that client is sent is received.Correspondingly, the method for the present embodiment specifically includes:
S410, the server configuration change request that user sends is received.
S420, pre-stored server configuration information is updated according to the request of server configuration change.
S430, judge that unit interval server interface is called number whether more than predetermined threshold value, if so, executing Otherwise S470 executes S440.
In the present embodiment, judge that whether unit interval server interface is called number more than predetermined threshold value, wherein The unit of unit interval may include minute, hour or day etc..Illustratively, judge called time of server interface per hour Whether number is more than predetermined threshold value, such as 100 times.Wherein, the called number of unit interval server interface has reacted client visit Ask the uninterrupted of server, unit interval server is called, and number is more, and expression client accesses the flow of server Bigger, conversely, unit interval server is called, number is fewer, indicates that the flow of client access server is smaller.
S440, the service requesting information that client is sent is received.
When the called number of unit interval server interface is less than predetermined threshold value, the business that client is sent is received Solicited message.It is understood that when the called number of unit interval server interface is less than predetermined threshold value, show API gateway can also maintain back-end server to provide stable business for client, therefore, can continue to client at this time The service requesting information of transmission.
S450, according to protocol conversion rule and updated server configuration information, by service requesting information with multithreading The mode of asynchronism and concurrency is sent at least one server.
S460, the business information that at least one server is sent is received, and based on protocol conversion rule, business information is anti- It is fed to client.
Wherein, business information is the feedback information that server responds service requesting information.
S470, the service requesting information for sending client intercept, and service requesting information is sent to server to cancel.
When unit interval server interface is called number more than predetermined threshold value, by the service request of client transmission Service requesting information is sent to server by information intercepting to cancel.It is understood that when unit interval server interface When called number is more than predetermined threshold value, show that API gateway control back-end server provides the ability of business for client and reached To saturation, if being further continued for receiving the service requesting information that client is sent, do not simply fail to provide business service for the client, But also the stability that server provides business for other clients can be influenced, therefore, at this point it is possible to which directly client is sent Service requesting information intercept, forbid the service requesting information being sent to server.
Wherein, when unit interval server interface is called number more than predetermined threshold value, by the industry of client transmission Solicited message of being engaged in intercepts, and may include following two situations:API gateway intercepts the service requesting information that client is sent, and It is without any processing to the service requesting information, alternatively, API gateway intercepts the service requesting information that client is sent, and API gateway itself automatically responds the service requesting information, and response results are fed back to client.
The configuration method of API gateway provided in an embodiment of the present invention, by judging that unit interval server interface is adjusted Whether it is more than predetermined threshold value with number, when the called number of unit interval server interface is less than predetermined threshold value, receives The service requesting information that client is sent will be objective when unit interval server interface is called number more than predetermined threshold value The service requesting information that family end is sent intercepts, and service requesting information is sent to server to cancel, can be effectively to client The flow of the service requesting information of transmission is controlled, can be direct when the flow of service requesting information is more than predetermined threshold value Service requesting information is intercepted, server system can be avoided to run quickly and burst, server system is improved with effective protection back-end server The stability of system.
In some embodiments, further include:The calling data of server interface are monitored in real time, wherein call number According at least one of calling amount, method of calling, response time and error rate including server interface;When monitoring the tune When being unsatisfactory for preset condition with data, alarm.The advantages of this arrangement are as follows can be to each clothes of access API gateway The calling data of business device interface are monitored in real time, and when the calling data of server interface occur abnormal, are alerted, carried in time The preceding influence taken precautions against when abnormal conditions occurs in back-end server to API gateway, further increases the stability of API gateway.
In the present embodiment, the transfer data of server interface are monitored in real time, judge to call whether data meet Preset condition.Wherein, monitoring data may include server interface calling amount, method of calling, response time and error rate in It is at least one.Illustratively, judge that calling data whether to meet preset condition may include:Judge the calling of server interface Whether amount is more than default calling threshold value, and whether the method for calling of server interface is default method of calling, the sound of server interface Whether default response lag is more than between seasonable, and whether error rate is more than default error rate threshold.Meet following appoint when calling data When a condition of anticipating, it is believed that call data to be unsatisfactory for preset condition, that is, call data to occur abnormal, alarm:Service The calling amount of device interface is more than default calling threshold value, and the method for calling of server interface is not default method of calling, and server connects The response time of mouth is more than default response lag and error rate is more than default error rate threshold.
Embodiment five
Fig. 5 is a kind of structural schematic diagram of the configuration device for API gateway that the embodiment of the present invention five provides.As shown in figure 5, Described device includes:Request receiving module 510, configuration information update module 520 and business information feedback module 530 are changed, Wherein:
Request receiving module 510 is changed, the server configuration change request for receiving user's transmission;
Configuration information update module 520, for being asked to pre-stored server according to the server configuration change Configuration information is updated;
Business information feedback module 530, for being turned according to updated server configuration information and preset agreement Rule is changed, the business information that server provides is fed back into client.
The configuration device of API gateway provided in an embodiment of the present invention, the server configuration change sent by receiving user It asks, and pre-stored server configuration information is updated according to server configuration change request, then basis Updated server configuration information and preset protocol conversion rule, visitor is fed back to by the business information that server provides Family end can effectively realize the dynamic configuration of API gateway, provide the ability for accessing latest services device for client in real time, significantly Improve flexibility and the stability of API gateway.
Optionally, the business information feedback module, including:
Service request receives unit, the service requesting information for receiving client transmission;
Service request transmission unit, for matching confidence according to protocol conversion rule and the updated server Breath, at least one server is sent to by the service requesting information in a manner of multithreading asynchronism and concurrency;
Business information feedback unit, the business information sent for receiving at least one server, and based on described Protocol conversion rule, client is fed back to by the business information;
Wherein, the business information is the feedback information that the server responds the service requesting information.
Optionally, which further includes:
Regular judging unit, for being sent at least in a manner of multithreading asynchronism and concurrency by the service requesting information Before one server, judge whether the service requesting information meets default safety certification rule;
The service request transmission unit, including:
Service request transmission sub-unit, for when the service requesting information meets the default safety certification rule, The service requesting information is sent at least one server in a manner of multithreading asynchronism and concurrency.
Optionally, the service request transmission sub-unit, is used for:
When the service requesting information meets the default safety certification rule, logging request is sent to client;
When receiving the client end response in the log-on message of the logging request, whether the log-on message is judged Meet and presets registration conditions;
When the log-on message, which meets, presets registration conditions, by the service requesting information with multithreading asynchronism and concurrency Mode is sent at least one server.
Optionally, which further includes:
Call number judging unit, for before the service requesting information that the reception client is sent, judging unit Whether time server interface is called number more than predetermined threshold value;
The service request receiving unit, is used for:
When the called number of the unit interval server interface is less than predetermined threshold value, receive what client was sent Service requesting information.
Optionally, which further includes:
Service request interception unit, for being called number more than predetermined threshold value when the unit interval server interface When, the service requesting information that the client is sent intercepts, and the service requesting information is sent to the service to cancel Device.
Optionally, which further includes:
Data monitoring unit is called, for being monitored in real time to the calling data of server interface, wherein the calling Data include at least one of calling amount, method of calling, response time and error rate of server interface;
Alarm unit, for when monitoring the calling data and being unsatisfactory for preset condition, alarming.
Embodiment six
The embodiment of the present invention six provides a kind of storage medium including computer executable instructions, and the computer is executable It instructs and includes for the configuration method of API gateway, this method when being executed by computer processor:
Receive the server configuration change request that user sends;
Pre-stored server configuration information is updated according to server configuration change request;
According to updated server configuration information and preset protocol conversion rule, the business that server is provided Information feeds back to client.
Storage medium --- any various types of memory devices or storage device.Term " storage medium " is intended to wrap It includes:Install medium, such as CD-ROM, floppy disk or magnetic tape equipment;Computer system memory or random access memory, such as DRAM, DDRRAM, SRAM, EDORAM, blue Bath (Rambus) RAM etc.;Nonvolatile memory, such as flash memory, magnetic medium (example Such as hard disk or optical storage);The memory component etc. of register or other similar types.Storage medium can further include other types Memory or combinations thereof.In addition, storage medium can be located at program in the first computer system being wherein performed, or It can be located in different second computer systems, second computer system is connected to the first meter by network (such as internet) Calculation machine system.Second computer system can provide program instruction to the first computer for executing.Term " storage medium " can To include two or more that may reside in different location (such as in different computer systems by network connection) Storage medium.Storage medium can store the program instruction that can be executed by one or more processors and (such as be implemented as counting Calculation machine program).
Certainly, a kind of storage medium including computer executable instructions that the embodiment of the present invention is provided, computer The configuration for the API gateway that executable instruction is not limited to the described above operates, and any embodiment of the present invention can also be performed and provided API gateway configuration method in relevant operation.
Embodiment seven
Fig. 6 is that the embodiment of the present invention seven provides a kind of structural schematic diagram of API gateway, as shown in fig. 6, the API gateway 600 May include:Memory 601, processor 602 and storage on a memory and can processor operation computer program, it is described Processor 602 realizes the configuration method of API gateway as described in the embodiments of the present invention when executing the computer program.
API gateway provided in an embodiment of the present invention receives the server configuration change request that user sends, and according to described The request of server configuration change is updated pre-stored server configuration information, is then matched according to updated server Confidence ceases and preset protocol conversion rule, and the business information that server provides is fed back to client.By using upper Technical solution is stated, can effectively realize the dynamic configuration of API gateway, the energy for accessing latest services device is provided for client in real time Power substantially increases flexibility and the stability of API gateway.
The executable present invention of configuration device, storage medium and API gateway of the API gateway provided in above-described embodiment is implemented The configuration method for the corresponding API gateway that example is provided has and executes the corresponding function module of this method and advantageous effect.Do not exist The technical detail of detailed description in above-described embodiment, reference can be made to the configuration side for the API gateway that any embodiment of the present invention is provided Method.
Note that above are only presently preferred embodiments of the present invention and institute's application technology principle.It will be appreciated by those skilled in the art that The present invention is not limited to specific embodiments described here, can carry out for a person skilled in the art it is various it is apparent variation, It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out to the present invention by above example It is described in further detail, but the present invention is not limited only to above example, without departing from the inventive concept, also May include other more equivalent embodiments, and the scope of the present invention is determined by scope of the appended claims.

Claims (10)

1. a kind of configuration method of API gateway, which is characterized in that including:
Receive the server configuration change request that user sends;
Pre-stored server configuration information is updated according to server configuration change request;
According to updated server configuration information and preset protocol conversion rule, the business information that server is provided Feed back to client.
2. according to the method described in claim 1, it is characterized in that, described according to updated server configuration information and advance The protocol conversion rule of setting, client is fed back to by the business information that server provides, including:
Receive the service requesting information that client is sent;
According to protocol conversion rule and the updated server configuration information, by the service requesting information with multi-thread The mode of journey asynchronism and concurrency is sent at least one server;
The business information that at least one server is sent is received, and based on protocol conversion rule, the business is believed Breath feeds back to client;
Wherein, the business information is the feedback information that the server responds the service requesting information.
3. according to the method described in claim 2, it is characterized in that, by the service requesting information with multithreading asynchronism and concurrency Mode be sent to before at least one server, further include:
Judge whether the service requesting information meets default safety certification rule;
The service requesting information is sent at least one server in a manner of multithreading asynchronism and concurrency, including:
It is when the service requesting information meets the default safety certification rule, the service requesting information is different with multithreading It walks concurrent mode and is sent at least one server.
4. according to the method described in claim 3, it is characterized in that, described when the service requesting information meets the default peace When full certification rule, the service requesting information is sent at least one server in a manner of multithreading asynchronism and concurrency, wrapped It includes:
When the service requesting information meets the default safety certification rule, logging request is sent to client;
When receiving the client end response in the log-on message of the logging request, judge whether the log-on message meets Default registration conditions;
When the log-on message, which meets, presets registration conditions, by the service requesting information in a manner of multithreading asynchronism and concurrency It is sent at least one server.
5. according to the method described in claim 2, it is characterized in that, it is described reception client send service requesting information it Before, further include:
Judge that whether unit interval server interface is called number more than predetermined threshold value;
The service requesting information for receiving client and sending, including:
When the called number of the unit interval server interface is less than predetermined threshold value, the business that client is sent is received Solicited message.
6. according to the method described in claim 5, it is characterized in that, further including:
When the unit interval server interface be called number be more than predetermined threshold value when, business that the client is sent Solicited message intercepts, and the service requesting information is sent to the server to cancel.
7. according to the method described in claim 1, it is characterized in that, further including:
The calling data of server interface are monitored in real time, wherein the calling data include the calling of server interface At least one of amount, method of calling, response time and error rate;
When monitoring the calling data and being unsatisfactory for preset condition, alarm.
8. a kind of configuration device of API gateway, which is characterized in that including:
Request receiving module is changed, the server configuration change request for receiving user's transmission;
Configuration information update module, for being asked to pre-stored server configuration information according to the server configuration change It is updated;
Business information feedback module, for regular according to updated server configuration information and preset protocol conversion, The business information that server provides is fed back into client.
9. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is held by processor The configuration method of the API gateway as described in claim 1-7 is any is realized when row.
10. a kind of API gateway, which is characterized in that including memory, processor and storage can transport on a memory and in processor Capable computer program, the processor realize the API nets as described in claim 1-7 is any when executing the computer program The configuration method of pass.
CN201810178181.5A 2018-03-05 2018-03-05 A kind of configuration method of API gateway, device, storage medium and API gateway Pending CN108429645A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810178181.5A CN108429645A (en) 2018-03-05 2018-03-05 A kind of configuration method of API gateway, device, storage medium and API gateway

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810178181.5A CN108429645A (en) 2018-03-05 2018-03-05 A kind of configuration method of API gateway, device, storage medium and API gateway

Publications (1)

Publication Number Publication Date
CN108429645A true CN108429645A (en) 2018-08-21

Family

ID=63157690

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810178181.5A Pending CN108429645A (en) 2018-03-05 2018-03-05 A kind of configuration method of API gateway, device, storage medium and API gateway

Country Status (1)

Country Link
CN (1) CN108429645A (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109922160A (en) * 2019-03-28 2019-06-21 全球能源互联网研究院有限公司 A kind of terminal security cut-in method, apparatus and system based on electric power Internet of Things
CN110113374A (en) * 2019-03-15 2019-08-09 平安科技(深圳)有限公司 Streaming media server executes multitask method, device and storage medium, terminal device
CN110213331A (en) * 2019-04-29 2019-09-06 北京奇艺世纪科技有限公司 Processing method, terminal device, electronic equipment and the storage medium of service request
CN110493067A (en) * 2019-09-05 2019-11-22 中国银联股份有限公司 A kind of method and device that API gateway service updates
CN110781051A (en) * 2019-09-18 2020-02-11 北京你财富计算机科技有限公司 Server-side interface field monitoring method and device and electronic equipment
CN110995873A (en) * 2019-12-27 2020-04-10 美的集团股份有限公司 Gateway service interface discovery method, system, electronic device and storage medium
WO2020083189A1 (en) * 2018-10-24 2020-04-30 北京金山云网络技术有限公司 Request processing method and device, api gateway, and readable storage medium
CN111131397A (en) * 2019-12-02 2020-05-08 北京海益同展信息科技有限公司 Application management method and system, gateway platform, server and storage medium
CN111240832A (en) * 2019-12-31 2020-06-05 上海汇付数据服务有限公司 API management method and API gateway system
CN111314212A (en) * 2020-01-16 2020-06-19 青木数字技术股份有限公司 API gateway based on Netty and plug-in mechanism and control method
CN111385244A (en) * 2018-12-27 2020-07-07 中国移动通信集团四川有限公司 Abnormal flow identification method, device, equipment, system and medium
CN113422719A (en) * 2021-06-22 2021-09-21 北京博创联动科技有限公司 Configuration system and configuration method of protocol conversion gateway and protocol conversion gateway
CN113595795A (en) * 2021-07-30 2021-11-02 工银科技有限公司 Network communication method, device, system, equipment and medium
CN114374603A (en) * 2022-01-12 2022-04-19 上海商米科技集团股份有限公司 API gateway-based data processing method and API gateway
CN114095554B (en) * 2021-12-01 2024-01-12 浙江国利网安科技有限公司 Industrial control data processing method and device, storage medium and industrial control gateway

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105827446A (en) * 2016-03-31 2016-08-03 深圳市金溢科技股份有限公司 Intelligent traffic API gateway and intelligent traffic service system
CN106533944A (en) * 2016-12-29 2017-03-22 金蝶软件(中国)有限公司 Distributed API gateway, management method and management system
US20170116181A1 (en) * 2014-06-19 2017-04-27 Thomson Licensing Cloud service supplementing embedded natural language processing engine

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170116181A1 (en) * 2014-06-19 2017-04-27 Thomson Licensing Cloud service supplementing embedded natural language processing engine
CN105827446A (en) * 2016-03-31 2016-08-03 深圳市金溢科技股份有限公司 Intelligent traffic API gateway and intelligent traffic service system
CN106533944A (en) * 2016-12-29 2017-03-22 金蝶软件(中国)有限公司 Distributed API gateway, management method and management system

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020083189A1 (en) * 2018-10-24 2020-04-30 北京金山云网络技术有限公司 Request processing method and device, api gateway, and readable storage medium
CN111385244A (en) * 2018-12-27 2020-07-07 中国移动通信集团四川有限公司 Abnormal flow identification method, device, equipment, system and medium
CN110113374B (en) * 2019-03-15 2022-03-25 平安科技(深圳)有限公司 Method and device for executing tasks by streaming media server, storage medium and terminal equipment
CN110113374A (en) * 2019-03-15 2019-08-09 平安科技(深圳)有限公司 Streaming media server executes multitask method, device and storage medium, terminal device
WO2020186792A1 (en) * 2019-03-15 2020-09-24 平安科技(深圳)有限公司 Streaming media server task execution method and apparatus, and storage medium and terminal device
CN109922160A (en) * 2019-03-28 2019-06-21 全球能源互联网研究院有限公司 A kind of terminal security cut-in method, apparatus and system based on electric power Internet of Things
CN110213331A (en) * 2019-04-29 2019-09-06 北京奇艺世纪科技有限公司 Processing method, terminal device, electronic equipment and the storage medium of service request
CN110493067B (en) * 2019-09-05 2022-02-18 中国银联股份有限公司 Method and device for updating API gateway service
CN110493067A (en) * 2019-09-05 2019-11-22 中国银联股份有限公司 A kind of method and device that API gateway service updates
CN110781051A (en) * 2019-09-18 2020-02-11 北京你财富计算机科技有限公司 Server-side interface field monitoring method and device and electronic equipment
CN111131397A (en) * 2019-12-02 2020-05-08 北京海益同展信息科技有限公司 Application management method and system, gateway platform, server and storage medium
CN111131397B (en) * 2019-12-02 2022-09-30 京东科技信息技术有限公司 Application management method and system, gateway platform, server and storage medium
CN110995873A (en) * 2019-12-27 2020-04-10 美的集团股份有限公司 Gateway service interface discovery method, system, electronic device and storage medium
CN111240832A (en) * 2019-12-31 2020-06-05 上海汇付数据服务有限公司 API management method and API gateway system
CN111314212A (en) * 2020-01-16 2020-06-19 青木数字技术股份有限公司 API gateway based on Netty and plug-in mechanism and control method
CN111314212B (en) * 2020-01-16 2022-04-19 青木数字技术股份有限公司 API gateway based on Netty and plug-in mechanism and control method
CN113422719B (en) * 2021-06-22 2022-08-23 北京博创联动科技有限公司 Configuration system and configuration method of protocol conversion gateway and protocol conversion gateway
CN113422719A (en) * 2021-06-22 2021-09-21 北京博创联动科技有限公司 Configuration system and configuration method of protocol conversion gateway and protocol conversion gateway
CN113595795A (en) * 2021-07-30 2021-11-02 工银科技有限公司 Network communication method, device, system, equipment and medium
CN114095554B (en) * 2021-12-01 2024-01-12 浙江国利网安科技有限公司 Industrial control data processing method and device, storage medium and industrial control gateway
CN114374603A (en) * 2022-01-12 2022-04-19 上海商米科技集团股份有限公司 API gateway-based data processing method and API gateway

Similar Documents

Publication Publication Date Title
CN108429645A (en) A kind of configuration method of API gateway, device, storage medium and API gateway
US10802906B2 (en) Monitoring method and apparatus of server, and storage medium
WO2020233059A1 (en) Login processing method based on data processing and related apparatus
US8732709B2 (en) Transaction management in a web service messaging environment
CN105373420B (en) Data transmission method and device
CN110633442A (en) Pushing method and device and electronic equipment
EP3516514A1 (en) Event-driven policy-based distributed container management system
CN111049901B (en) Load balancing method, load balancing system and registration server
CN108512903B (en) Abnormal information processing method and device, storage medium and API gateway
WO2019034979A1 (en) Systems and methods for controlling real-time traffic surge of application programming interfaces (apis) at server
US9813422B2 (en) Detecting unauthorized risky or inefficient usage of privileged credentials through analysis of task completion timing
US10740142B2 (en) System and method for obtaining task trigger information by a baseband processor of an intelligent device and triggering a hosting task
US11606391B2 (en) Method for controlling and provisioning resource access
CN109889468B (en) Network data transmission method, system, device, equipment and storage medium
WO2020006902A1 (en) Batch payment method and apparatus, computer device, and storage medium
US20070136301A1 (en) Systems and methods for enforcing protocol in a network using natural language messaging
CN109711152A (en) A kind of application keepalive method calculates equipment and storage medium
CN112448987A (en) Fusing degradation triggering method and system and storage medium
CN115396221A (en) Authorization processing method, device and system, electronic equipment and storage medium
US20070136472A1 (en) Systems and methods for requesting protocol in a network using natural language messaging
US10116745B2 (en) Automatic client-server role detection among data storage systems in a distributed data store
US10474498B2 (en) Server scheduling tool
US10991214B2 (en) Remote reestablishment of one-way communications session with mobile bug
US11012537B2 (en) Method for handling long-running client-server processes
US20230319559A1 (en) Enrollment of enrollee devices to a wireless network

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