CN108512903B - Abnormal information processing method and device, storage medium and API gateway - Google Patents

Abnormal information processing method and device, storage medium and API gateway Download PDF

Info

Publication number
CN108512903B
CN108512903B CN201810161447.5A CN201810161447A CN108512903B CN 108512903 B CN108512903 B CN 108512903B CN 201810161447 A CN201810161447 A CN 201810161447A CN 108512903 B CN108512903 B CN 108512903B
Authority
CN
China
Prior art keywords
information
conversion rule
relation table
service
server
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.)
Active
Application number
CN201810161447.5A
Other languages
Chinese (zh)
Other versions
CN108512903A (en
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 CN201810161447.5A priority Critical patent/CN108512903B/en
Publication of CN108512903A publication Critical patent/CN108512903A/en
Application granted granted Critical
Publication of CN108512903B publication Critical patent/CN108512903B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • H04L41/5003Managing SLA; Interaction between SLA and QoS
    • H04L41/5019Ensuring fulfilment of SLA
    • H04L41/5025Ensuring fulfilment of SLA by proactively reacting to service quality change, e.g. by reconfiguration after service quality degradation or upgrade
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Abstract

The embodiment of the invention discloses an abnormal information processing method, an abnormal information processing device, a storage medium and an API gateway. The abnormal information processing method comprises the following steps: receiving request response information sent by a server, wherein the request response information is feedback information of the server responding to service request information sent by a client; when the request response information is abnormal information, acquiring service interface information of the server and the service request information; determining escape information corresponding to the request response information according to the service interface information and the service request information; and converting the request response information into the escaping information, and sending the escaping information to a client. By the technical scheme provided by the embodiment of the invention, different abnormal information prompting schemes can be provided aiming at different server service interfaces and different application scenes of the client, and the flexibility of processing the abnormal information fed back by the server is enhanced.

Description

Abnormal information processing method and device, storage medium and API gateway
Technical Field
The embodiment of the invention relates to the technical field of software development, in particular to an abnormal information processing method, an abnormal information processing device, a storage medium and an API gateway.
Background
Currently, various network services generally include a client and a server, and an Application Programming Interface (API) gateway is provided therebetween to uniformly receive requests of a calling party such as the client or an external partner, perform certain check and logic processing according to different logics of each Interface, and forward the requests to a back-end server.
Obviously, the API gateway is an intermediate bridge for receiving the client and the backend service in the network service, and is a process for expanding the HTTP request to the backend service. In the process that the gateway system provides each back-end service to the client, the back-end service party often generates error prompt information, however, the existing gateway system lacks a configurable error prompt information escape function for the error prompt information of each back-end service party.
The existing gateway system lacking the configurable function of transferring error-reporting prompt messages has the following defects: 1. the gateway system cannot dynamically adjust and process the error notification information provided for the client in real time. The error reporting prompt information provided for the client is provided by the back-end server, when the error reporting prompt information is changed, the back-end server needs to be adapted and adjusted, the efficiency is low, and the real-time performance is lacked; 2. for the same service request information and error reporting information of different service scenes, the gateway system cannot provide different error reporting prompts and is lack of flexibility; 3. the gateway system directly provides error information such as frame abnormity or service abnormity generated by the request of the server to the client without escaping processing, which is inconvenient for users to understand and lacks friendliness.
Disclosure of Invention
The embodiment of the invention provides an abnormal information processing method, an abnormal information processing device, a storage medium and an API gateway, which are used for optimizing a scheme of processing server feedback abnormal prompt information in the prior art.
In a first aspect, an embodiment of the present invention provides an exception information processing method, where the method includes:
receiving request response information sent by a server, wherein the request response information is feedback information of the server responding to service request information sent by a client;
when the request response information is abnormal information, acquiring service interface information of the server and the service request information;
determining escape information corresponding to the request response information according to the service interface information and the service request information;
and converting the request response information into the escaping information, and sending the escaping information to a client.
Further, determining escape information corresponding to the request response information according to the service interface information and the service request information includes:
acquiring a pre-stored conversion rule relation table, wherein the conversion rule relation table comprises a corresponding relation among preset service interface information, preset service request information and preset escape information;
and searching escape information corresponding to the request response information from the conversion rule relation table according to the service interface information and the service request information.
Further, before obtaining the pre-stored conversion rule relation table, the method further includes:
judging whether conversion rule change information input by a user is received or not;
and updating the pre-stored conversion rule relation table when the conversion rule change information is received.
Further, before obtaining the pre-stored conversion rule relation table, the method further includes:
monitoring whether the conversion rule relation table is updated or not in real time;
the obtaining of the pre-stored conversion rule relation table includes:
and after monitoring that the conversion rule relation table is updated, acquiring the updated conversion rule relation table.
Further, the exception information includes a business exception and a framework exception.
In a second aspect, an embodiment of the present invention further provides an exception information processing apparatus, where the apparatus includes:
the response information receiving module is used for receiving request response information sent by a server, wherein the request response information is feedback information of the server responding to service request information sent by a client;
a service information obtaining module, configured to obtain service interface information of the server and the service request information when the request response information is abnormal information;
the escape information determining module is used for determining escape information corresponding to the request response information according to the service interface information and the service request information;
and the escape information sending module is used for converting the request response information into the escape information and sending the escape information to a client.
Further, the escape information determining module includes:
the system comprises a relation table acquisition unit, a conversion rule relation table acquisition unit and a conversion rule conversion unit, wherein the relation table acquisition unit is used for acquiring a prestored conversion rule relation table, and the conversion rule relation table comprises corresponding relations among preset service interface information, preset service request information and preset escape information;
and the escape information searching unit is used for searching escape information corresponding to the request response information from the conversion rule relation table according to the service interface information and the service request information.
Further, the method also comprises the following steps:
the conversion rule relation table is used for storing conversion rule relation tables of conversion rules;
and the relation table updating unit is used for updating the prestored conversion rule relation table when the conversion rule change information is received.
Further, the method also comprises the following steps:
the updating monitoring unit is used for monitoring whether the conversion rule relation table is updated in real time before the prestored conversion rule relation table is acquired;
the relationship table obtaining unit is configured to:
and after monitoring that the conversion rule relation table is updated, acquiring the updated conversion rule relation table.
Further, the exception information includes a business exception and a framework exception.
In a third aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for processing the exception information according to the first aspect of the embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention provides an API gateway, including a memory, a processor, and a computer program stored on the memory and executable by the processor, where the processor executes the computer program to implement the method for processing exception information according to the first aspect of the embodiment of the present invention.
According to the abnormal information processing scheme provided by the embodiment of the invention, request response information sent by a server is received, wherein the request response information is feedback information of the server responding to service request information sent by a client, and when the request response information is abnormal information, service interface information and the service request information of the server are acquired; and determining escape information corresponding to the request response information according to the service interface information and the service request information, finally converting the request response information into escape information, and sending the escape information to the client.
Drawings
Fig. 1 is a schematic flowchart of an exception handling method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of an exception handling method according to a second embodiment of the present invention;
fig. 3 is a schematic flowchart of an exception handling method according to a third embodiment of the present invention;
fig. 4 is a schematic flowchart of an exception handling method according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of an exception information processing apparatus according to a fifth embodiment of the present invention;
fig. 6 is a schematic structural diagram of an API gateway according to a seventh embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a schematic flow diagram of an abnormal information processing method according to an embodiment of the present invention, where the method is applicable to a case where abnormal information is processed when request response information fed back to a server by an API gateway is abnormal information, and the method may be executed by an abnormal information processing apparatus, where the apparatus may be implemented by software and/or hardware, and may generally be integrated in the API gateway. As shown in fig. 1, the method includes:
and S110, receiving request response information sent by the server.
The request response information is feedback information of the server responding to the service request information sent by the client.
In the embodiment of the invention, the API gateway is a bridge for data transmission between the client and the server, when receiving the service request information sent by the client, the API gateway forwards the service request information to the corresponding server according to the pre-stored server configuration information, the server responds to the service request information and generates request response information aiming at the service request information, and the server sends the request response information to the API gateway. The API gateway receives request response information sent by the server, where the request response information may include service request information sent by the server for the client, service information provided to the client, that is, service information provided by the server for the client, and may also include server exception information fed back when the server fails to respond normally to the service request information sent by the client.
And S120, when the request response information is abnormal information, acquiring the service interface information and the service request information of the server.
And when the request response information sent by the server is abnormal information, namely when the server cannot normally respond to the service request information sent by the client, the service interface information and the service request information of the server are obtained when the information fed back to the API gateway is the abnormal information of the server. The service request information is access information that the client sends to the API gateway and wants to access a certain server through the API gateway, that is, call request information that the client wants to call a service of a certain server through the API gateway. The service interface information of the server is the service interface information of the server sending the request response information, that is, the service request information is forwarded to the relevant information of the interface of the server corresponding to the service request information according to the service request information sent by the client and the server configuration information stored in advance.
Optionally, when the request response information sent by the server is received as exception information, the exception information may include a service exception and a frame exception. The service exception can be understood as exception prompt information returned by the server for the condition when the service request information sent by the client does not conform to the specification of the accessed server. Illustratively, when the service request information sent by the client is registration request information, the API gateway forwards the registration request information sent by the client to the corresponding server, and the server checks the registration request information, and if the registration request information sent by the client is to be registered by another user, at this time, the feedback information (request response information) responded by the server with respect to the registration request information is abnormal information, that is, service abnormality, and if the request response information is "user already exists". The frame exception can be understood as that service request information sent by the client and the server are normal, but in the process of data communication transmission between the client and the server, the transmission data is intercepted by abnormal logic, and the server returns exception prompt information for the situation. For example, when the service request information sent by the client is registration request information, the API gateway forwards the registration request information sent by the client to a corresponding server, and if the whole service provided by the server is unavailable due to database abnormality or the like, at this time, the feedback information (request response information) responded by the server for the registration request information is abnormal information, that is, a framework is abnormal, for example, the request response information is "database connection failure".
S130, determining escape information corresponding to the request response information according to the service interface information and the service request information.
In the embodiment of the invention, when the request response information sent by the server is abnormal information, the escape information corresponding to the request response information is determined according to the acquired service interface information and the service request information. It can be understood that, when the request response information is abnormal information, that is, whether the abnormal information is a service abnormality or a framework abnormality, the abnormal information needs to be fed back to the client through the API gateway, so that the user knows the feedback result of the server for the service request information response sent by the client. However, the request response information (exception information) sent to the API gateway by the server is presented in the form of a custom protocol of the server, so that the user cannot easily understand or even understand the specific meaning of the exception information, and when the request response information is exception information, the user usually does not pay attention to which configuration modules of the server have problems. Therefore, it is necessary to convert request response information transmitted from a server, which is difficult to understand, into escape information corresponding to the request response information, which is easy to understand by a user. It is understood that the escape information is another expression corresponding to the request response information, but the escape information is easier for the user to understand than the request response information, and enables the user to perform a flow operation of responding according to the escape information.
The service interface information is different, the service request information is different, and the escape information corresponding to the request response information is different. Therefore, it is necessary to determine escape information corresponding to the request response information according to the service interface information and the service request information. Optionally, a pre-stored conversion rule relation table is obtained, where the conversion rule relation table includes a corresponding relation between preset service interface information, preset service request information, and preset escaping information, and then escaping information corresponding to the request response information is searched from the conversion rule relation table according to the service interface information and the service request information.
And S140, converting the request response information into escaping information, and sending the escaping information to the client.
In this embodiment, according to the escape information determined in S130, the request response information is converted into the escape information, and the escape information is sent to the client for the user to refer to. It can be understood that the request response information is converted into the escape information, that is, the request response information is converted into two expression modes, and the request response information is sent to the client in a popular and easily understood language form.
The abnormal information processing method provided by the embodiment of the invention receives request response information sent by a server, wherein the request response information is feedback information of the server responding to service request information sent by a client, and when the request response information is abnormal information, service interface information and the service request information of the server are acquired; and determining escape information corresponding to the request response information according to the service interface information and the service request information, finally converting the request response information into escape information, and sending the escape information to the client.
Example two
Fig. 2 is a flowchart illustrating an exception information processing method according to a second embodiment of the present invention. In this embodiment, the step of determining escape information corresponding to the request response information according to the service interface information and the service request information is optimized based on the above embodiment as follows: acquiring a pre-stored conversion rule relation table, wherein the conversion rule relation table comprises a corresponding relation among preset service interface information, preset service request information and preset escape information; and searching escape information corresponding to the request response information from the conversion rule relation table according to the service interface information and the service request information. Correspondingly, the method of the embodiment specifically includes:
and S210, receiving request response information sent by the server.
The request response information is feedback information of the server responding to the service request information sent by the client.
And S220, when the request response information is abnormal information, acquiring the service interface information and the service request information of the server.
And S230, acquiring a prestored conversion rule relation table.
The conversion rule relation table comprises corresponding relations among preset service interface information, preset service request information and preset escape information.
In the embodiment of the invention, a pre-stored conversion rule relation table is obtained, wherein the conversion rule relation table records the corresponding relation among different service interface information, different service request information and different escape information. It can be understood that, the service request information with the same service interface information and different service interface information has different corresponding escape information, that is, the service interfaces of the servers accessed by the client are different, and the abnormal information provided by the server to the client has different abnormal information prompting modes. For example, the same client accesses different server interfaces, that is, the same service request information sent by the same client is forwarded to different server interfaces, for example, the same client accesses server interface a and server interface B, respectively, when the request response information fed back by server interface a and server interface B is both abnormal information, in the conversion rule relationship table, the escape information corresponding to the abnormal information fed back by server interface a is "format error of input login mobile phone number", and the escape information corresponding to the abnormal information fed back by server interface B is "input password error". The service interface information with the same service request information and different service interface information correspond to different escape information, that is, the abnormal information provided by the server is provided to different clients in different prompting modes aiming at different clients initiating the server access request or different application scenes providing the service information by the server. Illustratively, two different clients call the same server interface, for example, client a and client b call server interface a respectively, that is, server interface a is called by client a and client b respectively, when both the request response information of server interface a for the service request information sent by client a and the service request information sent by server interface a for client b are abnormal information, in the conversion rule relation table, the escape information of the abnormal information corresponding to client a is "please dial a serviceable telephone", and the escape information of the abnormal information corresponding to client b is "please log in again".
S240, according to the service interface information and the service request information, escape information corresponding to the request response information is searched from the conversion rule relation table.
And searching whether the service interface information and the service request information exist in the conversion rule relation table, namely judging whether the preset service interface information which is the same as the service interface information and the preset service request information which is the same as the service request information exist in the conversion rule relation table. And when the preset service interface information which is the same as the service interface information and the preset service request information which is the same as the service request information exist in the conversion rule relation table, taking the preset escape information corresponding to the service request information and the service interface information as escape information corresponding to request response information sent by the server.
And S250, converting the request response information into escaping information, and sending the escaping information to the client.
The abnormal information processing method provided by the embodiment of the invention can accurately and quickly determine the escaping information corresponding to the request response information by acquiring the prestored conversion rule relation table, wherein the conversion rule relation table comprises the corresponding relation among the preset service interface information, the preset service request information and the preset escaping information, and searching the escaping information corresponding to the request response information from the conversion rule relation table according to the service interface information and the service request information, thereby realizing different application scenes of different server service interfaces and clients, providing different abnormal information prompt schemes and enhancing the flexibility of processing the abnormal information fed back by the server.
EXAMPLE III
Fig. 3 is a schematic flowchart of an exception information processing method according to a third embodiment of the present invention. In this embodiment, before obtaining the pre-stored conversion rule relationship table, the following steps are added: judging whether conversion rule change information input by a user is received or not; and updating the pre-stored conversion rule relation table when the conversion rule change information is received. Correspondingly, the method of the embodiment specifically includes:
and S310, receiving request response information sent by the server.
The request response information is feedback information of the server responding to the service request information sent by the client.
And S320, when the request response information is abnormal information, acquiring the service interface information and the service request information of the server.
S330, judging whether conversion rule change information input by a user is received.
In the embodiment of the invention, whether the conversion rule change information input by the user is received or not is judged. It can be understood that, when a developer needs to modify or update the preset conversion rule relation table, corresponding conversion rule change information may be input in the conversion rule management center. The conversion rule change information may include changing a corresponding relationship among the preset service interface information, the preset service request information, and the preset escape information in the conversion rule relationship table, adding a new corresponding relationship among the preset service interface information, the preset service request information, and the preset escape information, or deleting an existing corresponding relationship among the preset service interface information, the preset service request information, and the preset escape information.
And S340, updating the pre-stored conversion rule relation table when the conversion rule change information is received.
When receiving conversion rule change information input by a user, updating a conversion rule relation table stored in advance according to the conversion rule change information, namely updating the corresponding relation among the preset service interface information, the preset service request information and the preset escape information in the conversion rule relation table.
And S350, acquiring the updated conversion rule relation table.
The updated conversion rule relation table comprises the corresponding relation among the latest preset service interface information, the preset service request information and the preset escape information.
And S360, searching escape information corresponding to the request response information from the updated conversion rule relation table according to the service interface information and the service request information.
And S370, converting the request response information into escaping information, and sending the escaping information to the client.
According to the abnormal information processing method provided by the embodiment of the invention, before the prestored conversion rule relation table is obtained, whether conversion rule change information input by a user is received or not is judged, and when the conversion rule change information is received, the prestored conversion rule relation table is updated, so that the online configuration and dynamic adjustment of the conversion rule relation table can be realized, different conversion rules can be immediately effective and invalid, and different conversion rules have timeliness.
Example four
Fig. 4 is a flowchart illustrating an exception information processing method according to a fourth embodiment of the present invention. In this embodiment, before obtaining the pre-stored conversion rule relationship table, the following steps are added: monitoring whether the conversion rule relation table is updated or not in real time; correspondingly, the conversion rule relation table which is obtained and stored in advance in the step is optimized as follows: and after monitoring that the conversion rule relation table is updated, acquiring the updated conversion rule relation table. Correspondingly, the method of the embodiment specifically includes:
and S410, receiving request response information sent by the server.
The request response information is feedback information of the server responding to the service request information sent by the client.
And S420, when the request response information is abnormal information, acquiring the service interface information and the service request information of the server.
And S430, monitoring whether the conversion rule relation table is updated or not in real time.
In the embodiment of the invention, whether the prestored conversion rule relation table is updated or not is monitored in real time. When the corresponding relationship among the preset service interface information, the preset service request information and the preset escape information in the conversion rule relationship table is changed, and/or a new corresponding relationship among the preset service interface information, the preset service request information and the preset escape information is added in the conversion rule relationship table, and/or the corresponding relationship among the preset service interface information, the preset service request information and the preset escape information existing in the conversion rule relationship table is deleted, it can be indicated that the conversion rule relationship table is monitored to be updated.
S440, after monitoring that the conversion rule relation table is updated, acquiring the updated conversion rule relation table.
The updated conversion rule relation table comprises the corresponding relation among the latest preset service interface information, the preset service request information and the preset escape information.
In this embodiment, when it is monitored that the conversion rule relationship table is updated, the updated conversion rule relationship table is obtained, so as to accurately determine escape information corresponding to request response information (exception information) provided by the server, for different service interface information and service request information.
S450, according to the service interface information and the service request information, escape information corresponding to the request response information is searched from the updated conversion rule relation table.
And S460, converting the request response information into escaping information, and sending the escaping information to the client.
In the abnormal information processing method provided by the embodiment of the present invention, before the prestored conversion rule relation table is obtained, whether the conversion rule relation table is updated or not is monitored in real time, and after the conversion rule relation table is monitored to be updated, the updated conversion rule relation table is obtained, so that the escape information corresponding to the request response information (abnormal information) provided by the server can be accurately determined.
EXAMPLE five
Fig. 5 is a schematic structural diagram of an exception information processing apparatus according to a fifth embodiment of the present invention. As shown in fig. 5, the apparatus includes: a response information receiving module 510, a service information acquiring module 520, an escape information determining module 530 and an escape information sending module 540, wherein:
a response information receiving module 510, configured to receive request response information sent by a server, where the request response information is feedback information of the server responding to service request information sent by a client;
a service information obtaining module 520, configured to obtain service interface information of the server and the service request information when the request response information is abnormal information;
an escape information determining module 530, configured to determine escape information corresponding to the request response information according to the service interface information and the service request information;
and an escape information sending module 540, configured to convert the request response information into the escape information, and send the escape information to a client.
The abnormal information processing device provided by the embodiment of the invention receives the request response information sent by the server, wherein the request response information is the feedback information of the server responding to the service request information sent by the client, and when the request response information is the abnormal information, the service interface information and the service request information of the server are acquired; and determining escape information corresponding to the request response information according to the service interface information and the service request information, finally converting the request response information into escape information, and sending the escape information to the client.
Optionally, the escape information determining module includes:
the system comprises a relation table acquisition unit, a conversion rule relation table acquisition unit and a conversion rule conversion unit, wherein the relation table acquisition unit is used for acquiring a prestored conversion rule relation table, and the conversion rule relation table comprises corresponding relations among preset service interface information, preset service request information and preset escape information;
and the escape information searching unit is used for searching escape information corresponding to the request response information from the conversion rule relation table according to the service interface information and the service request information.
Optionally, the apparatus further comprises:
the conversion rule relation table is used for storing conversion rule relation tables of conversion rules;
and the relation table updating unit is used for updating the prestored conversion rule relation table when the conversion rule change information is received.
Optionally, the apparatus further comprises:
the updating monitoring unit is used for monitoring whether the conversion rule relation table is updated in real time before the prestored conversion rule relation table is acquired;
the relationship table obtaining unit is configured to:
and after monitoring that the conversion rule relation table is updated, acquiring the updated conversion rule relation table.
Optionally, the exception information includes a service exception and a framework exception.
EXAMPLE six
An embodiment of the present invention provides a storage medium containing computer-executable instructions, where the computer-executable instructions are used in a method for processing exception information when executed by a computer processor, and the method includes:
receiving request response information sent by a server, wherein the request response information is feedback information of the server responding to service request information sent by a client;
when the request response information is abnormal information, acquiring service interface information of the server and the service request information;
determining escape information corresponding to the request response information according to the service interface information and the service request information;
and converting the request response information into the escaping information, and sending the escaping information to a client.
Storage medium-any of various types of memory devices or storage devices. The term "storage medium" is intended to include: mounting media such as CD-ROM, floppy disk, or tape devices; computer system memory or random access memory such as DRAM, DDRRAM, SRAM, EDORAM, Lanbas (Rambus) RAM, etc.; non-volatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in a first computer system in which the program is executed, or may be located in a different second computer system connected to the first computer system through a network (such as the internet). The second computer system may provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations, such as in different computer systems that are connected by a network. The storage medium may store program instructions (e.g., embodied as a computer program) that are executable by one or more processors.
Of course, the storage medium provided by the embodiment of the present invention includes computer-executable instructions, and the computer-executable instructions are not limited to the above-mentioned exception information processing operation, and may also perform related operations in the exception information processing method provided by any embodiment of the present invention.
EXAMPLE seven
Fig. 6 is a schematic structural diagram of an API gateway according to a seventh embodiment of the present invention, as shown in fig. 6, the API gateway 600 may include: the API gateway configuration method includes a memory 601, a processor 602 and a computer program stored on the memory and executable by the processor, where the processor 602 implements the API gateway configuration method according to an embodiment of the present invention when executing the computer program.
The API gateway provided in the embodiment of the present invention receives request response information sent by a server, where the request response information is feedback information of a service request information sent by a server response client, and when the request response information is abnormal information, obtains service interface information and service request information of the server; and determining escape information corresponding to the request response information according to the service interface information and the service request information, finally converting the request response information into escape information, and sending the escape information to the client. By adopting the technical scheme, different abnormal information prompting schemes can be provided according to different server service interfaces and different application scenes of the client, and the flexibility of processing the abnormal information fed back by the server is enhanced.
The exception information processing apparatus, the storage medium, and the API gateway provided in the above embodiments may execute the corresponding exception information processing method provided in the embodiments of the present invention, and have functional modules and beneficial effects corresponding to the execution of the method. For technical details that are not described in detail in the above embodiments, reference may be made to an exception information processing method provided in any embodiment of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. An exception information processing method, comprising:
receiving request response information sent by a server, wherein the request response information is feedback information of the server responding to service request information sent by a client;
when the request response information is abnormal information, acquiring service interface information of the server and the service request information;
determining escape information corresponding to the request response information according to the service interface information and the service request information;
and converting the request response information into the escaping information, and sending the escaping information to a client.
2. The method of claim 1, wherein determining escape information corresponding to the request response information according to the service interface information and the service request information comprises:
acquiring a pre-stored conversion rule relation table, wherein the conversion rule relation table comprises a corresponding relation among preset service interface information, preset service request information and preset escape information;
and searching escape information corresponding to the request response information from the conversion rule relation table according to the service interface information and the service request information.
3. The method according to claim 2, before obtaining the pre-stored conversion rule relation table, further comprising:
judging whether conversion rule change information input by a user is received or not;
and updating the pre-stored conversion rule relation table when the conversion rule change information is received.
4. The method according to claim 2, before obtaining the pre-stored conversion rule relation table, further comprising:
monitoring whether the conversion rule relation table is updated or not in real time;
the obtaining of the pre-stored conversion rule relation table includes:
and after monitoring that the conversion rule relation table is updated, acquiring the updated conversion rule relation table.
5. The method according to any of claims 1-4, wherein the exception information comprises a business exception and a framework exception.
6. An abnormality information processing apparatus characterized by comprising:
the response information receiving module is used for receiving request response information sent by a server, wherein the request response information is feedback information of the server responding to service request information sent by a client;
a service information obtaining module, configured to obtain service interface information of the server and the service request information when the request response information is abnormal information;
the escape information determining module is used for determining escape information corresponding to the request response information according to the service interface information and the service request information;
and the escape information sending module is used for converting the request response information into the escape information and sending the escape information to a client.
7. The apparatus of claim 6, wherein the escape information determining module comprises:
the system comprises a relation table acquisition unit, a conversion rule relation table acquisition unit and a conversion rule conversion unit, wherein the relation table acquisition unit is used for acquiring a prestored conversion rule relation table, and the conversion rule relation table comprises corresponding relations among preset service interface information, preset service request information and preset escape information;
and the escape information searching unit is used for searching escape information corresponding to the request response information from the conversion rule relation table according to the service interface information and the service request information.
8. The apparatus of claim 7, further comprising:
the conversion rule relation table is used for storing conversion rule relation tables of conversion rules;
and the relation table updating unit is used for updating the prestored conversion rule relation table when the conversion rule change information is received.
9. A computer-readable storage medium on which a computer program is stored, the program, when being executed by a processor, implementing the abnormality information processing method according to any one of claims 1 to 5.
10. An API gateway comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the exception information handling method according to any one of claims 1 to 5 when executing the computer program.
CN201810161447.5A 2018-02-27 2018-02-27 Abnormal information processing method and device, storage medium and API gateway Active CN108512903B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810161447.5A CN108512903B (en) 2018-02-27 2018-02-27 Abnormal information processing method and device, storage medium and API gateway

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810161447.5A CN108512903B (en) 2018-02-27 2018-02-27 Abnormal information processing method and device, storage medium and API gateway

Publications (2)

Publication Number Publication Date
CN108512903A CN108512903A (en) 2018-09-07
CN108512903B true CN108512903B (en) 2021-04-23

Family

ID=63375385

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810161447.5A Active CN108512903B (en) 2018-02-27 2018-02-27 Abnormal information processing method and device, storage medium and API gateway

Country Status (1)

Country Link
CN (1) CN108512903B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110958127B (en) * 2018-09-26 2021-04-13 瑞数信息技术(上海)有限公司 Exception handling method, device and equipment and computer storage medium
CN111722949B (en) * 2019-03-18 2024-04-05 北京京东尚科信息技术有限公司 Information processing method, terminal, server and storage medium
CN111641691B (en) * 2020-05-20 2022-09-23 北京字节跳动网络技术有限公司 Session message transmission method and device and electronic equipment
CN111988384B (en) * 2020-08-10 2022-08-30 北京百度网讯科技有限公司 Information transmission method and device, electronic equipment and storage medium
CN112583930B (en) * 2020-12-25 2023-04-18 四川安迪科技实业有限公司 Data forwarding synchronization method, system and device for multi-independent system interaction
CN113900895A (en) * 2021-10-08 2022-01-07 深圳市欢太数字科技有限公司 Information processing method, information processing apparatus, storage medium, and electronic device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080282078A1 (en) * 2007-05-10 2008-11-13 Murata Machinery, Ltd. Gateway device, controlling method of the same, and program record medium storing controlling method
CN107204961A (en) * 2016-03-16 2017-09-26 阿里巴巴集团控股有限公司 The treating method and apparatus of ESC is needed in interface packets

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6665730B1 (en) * 1999-12-16 2003-12-16 At&T Corp. Method and apparatus for transaction routing in a connection-oriented packet network using a non-fault-tolerant directory server
GB2499534B (en) * 2010-11-01 2018-09-19 Seven Networks Llc Caching adapted for mobile application behavior and network conditions
CN104363072B (en) * 2014-10-29 2019-08-13 中国建设银行股份有限公司 A kind of error message transmitting escape methods, devices and systems
CN104601540B (en) * 2014-12-05 2018-11-16 华为技术有限公司 A kind of cross site scripting XSS attack defence method and Web server

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080282078A1 (en) * 2007-05-10 2008-11-13 Murata Machinery, Ltd. Gateway device, controlling method of the same, and program record medium storing controlling method
CN107204961A (en) * 2016-03-16 2017-09-26 阿里巴巴集团控股有限公司 The treating method and apparatus of ESC is needed in interface packets

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"A Transfer Fault Diagnosing Method for Protocol Conformance Test Based on FSMs";Xinchang Zhang;《IEEE》;20090719;全文 *
"VPDN用户故障影响PPP指标的案例分析";姜学东;《CNKI》;20070813;全文 *

Also Published As

Publication number Publication date
CN108512903A (en) 2018-09-07

Similar Documents

Publication Publication Date Title
CN108512903B (en) Abnormal information processing method and device, storage medium and API gateway
CN110351283B (en) Data transmission method, device, equipment and storage medium
WO2017097123A1 (en) Access request conversion method and device
US7836088B2 (en) Relationship-based processing
CN111092877B (en) Data processing method and device, electronic equipment and storage medium
WO2016184175A1 (en) Database processing method and apparatus
WO2016184266A1 (en) Early warning method and device, and processing server
WO2020019724A1 (en) Method for acquiring sensor data in server, acquisition system, and related apparatus
US10044597B2 (en) System and method for processing service requests using logical environments
US20140280464A1 (en) Intermediary api for providing presence data to requesting clients
WO2019223099A1 (en) Application program calling method and system
CN114285852A (en) Service calling method and device based on multi-stage service platform
JP2006243985A (en) Message notification system and method, and server used therefor
US20070150540A1 (en) Presence and peer launch pad
CN111240760B (en) Application publishing method, system, storage medium and equipment based on registry
WO2019201111A1 (en) Information processing method, apparatus and device, and computer-readable storage medium
CN113127335A (en) System testing method and device
CN110930253A (en) Intelligent contract internal main key generation method and device, computer equipment and storage medium
CN116414628A (en) Transaction request processing method and device in new and old system switching process
JP2020127158A (en) ENUM server and congestion control method
CN113055494B (en) Communication method and communication device
US7213056B2 (en) Providing modular telephony service
WO2020220272A1 (en) Method and system for changing resource state, terminal, and storage medium
CN110995890A (en) Domain name request scheduling method and device
TWI381314B (en) Middleware bridge system and method

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
GR01 Patent grant
GR01 Patent grant