CN112241332A - Interface compensation method and device - Google Patents

Interface compensation method and device Download PDF

Info

Publication number
CN112241332A
CN112241332A CN201910641602.8A CN201910641602A CN112241332A CN 112241332 A CN112241332 A CN 112241332A CN 201910641602 A CN201910641602 A CN 201910641602A CN 112241332 A CN112241332 A CN 112241332A
Authority
CN
China
Prior art keywords
request
interface
client
exception
abnormal
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.)
Granted
Application number
CN201910641602.8A
Other languages
Chinese (zh)
Other versions
CN112241332B (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.)
Beijing Jingdong Zhenshi Information Technology Co Ltd
Original Assignee
Beijing Jingdong Zhenshi Information 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 Beijing Jingdong Zhenshi Information Technology Co Ltd filed Critical Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority to CN201910641602.8A priority Critical patent/CN112241332B/en
Publication of CN112241332A publication Critical patent/CN112241332A/en
Application granted granted Critical
Publication of CN112241332B publication Critical patent/CN112241332B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0709Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a distributed system consisting of a plurality of standalone computer nodes, e.g. clusters, client-server systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/079Root cause analysis, i.e. error or fault diagnosis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Computer Hardware Design (AREA)
  • Debugging And Monitoring (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a method and a device for interface compensation, and relates to the technical field of computers. One embodiment of the method comprises: acquiring an abnormal request captured at a client, wherein the abnormal request is a request which cannot be normally processed by the client; generating a simulation request according to the abnormal request; and sending the simulation request to the client for interface compensation. According to the embodiment, the abnormal data of the interface can be managed by a third party, so that the fault tolerance and the availability of the interface are improved; the request retransmission can be carried out without depending on an upstream system, so that the calling between service systems becomes active and flexible; meanwhile, system resources can be saved, and data errors caused by repeated operation are avoided; finally, the service system with problems can be accurately positioned through the simulation request of the interface compensation system, and fault finding and repairing are facilitated.

Description

Interface compensation method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for interface compensation.
Background
With the rapid development of the internet industry, network clusters are increasingly large, and interaction among all service systems is also increasingly frequent. Data interaction between business systems through calling of micro-services (micro-service architecture is a new technology for deploying applications and services in cloud) is a mainstream trend of the current day, however, calling between business systems may fail, and called data will be lost.
At present, when the call between service systems fails, the call failure information is generally returned to the upstream system step by step, and the upstream system re-issues an instruction to perform the call. Since the calling situation between service systems is generally complex, one service call may involve a plurality of service systems, for example: when a user performs payment operation on a certain online shopping platform to purchase an article, the user sends a payment request to an online shopping platform B through a service system A, the online shopping platform B forwards the payment request to a service system C (for example, a money deduction platform such as a bank system) to deduct money, and the payment request is returned to the online shopping platform B after the money deduction of the service system C is successful, so that the online shopping platform B returns to the service system A to perform subsequent operation. When the calling fails, the calling failure information is returned to the service system A step by step, so that the user can resend the payment request through the service system A to execute the service calling.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
1. if the upstream system re-issues the instruction to call, the call of the service system that has been successfully executed in the last call process needs to be re-executed once again, which wastes system resources and may cause data errors;
2. the upstream system re-issues the instruction to call, and the calling process is passive and poor in experience because the upstream system is required to be relied on;
3. when a problem occurs in one service calling process, the service system with the problem cannot be accurately positioned because a plurality of service systems are involved in the one calling process, and the fault is inconvenient to find and repair.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for interface compensation, which can manage abnormal data of an interface through a third party, so as to improve fault tolerance and availability of the interface; the request retransmission can be carried out without depending on an upstream system, so that the calling between service systems becomes active and flexible; meanwhile, system resources can be saved, and data errors caused by repeated operation are avoided; finally, the service system with problems can be accurately positioned through the simulation request of the interface compensation system, and fault finding and repairing are facilitated.
To achieve the above object, according to an aspect of an embodiment of the present invention, a method of interface compensation is provided.
A method of interface compensation, comprising: acquiring an abnormal request captured at a client, wherein the abnormal request is a request which cannot be normally processed by the client; generating a simulation request according to the abnormal request; and sending the simulation request to the client to perform interface compensation.
Optionally, the exception request is captured by deploying a tool kit for capturing the exception request at the client, and after the tool kit captures the exception request, the exception request is sent in a message form.
Optionally, after obtaining the exception request captured by the client, the method further includes: and saving the abnormal request into a database and establishing a timing task to clear the abnormal request in the database after a set time is reached.
Optionally, the abnormal request is stored in a database according to the parameter of the abnormal request, the interface name and the interface path of the client, and the dimension of the application identifier corresponding to the abnormal request.
Optionally, generating a simulation request according to the exception request includes: and generating a simulation request according to the parameters of the abnormal request, the interface name and the interface path of the client and the current timestamp.
According to another aspect of the embodiments of the present invention, there is provided an apparatus for interface compensation.
An apparatus for interface compensation, comprising: the system comprises an exception acquisition module, a processing module and a processing module, wherein the exception acquisition module is used for acquiring an exception request captured at a client, and the exception request is a request which cannot be normally processed by the client; the request generation module is used for generating a simulation request according to the abnormal request; and the request sending module is used for sending the simulation request to the client to perform interface compensation.
Optionally, the exception request is captured by deploying a tool kit for capturing the exception request at the client, and after the tool kit captures the exception request, the exception request is sent in a message form.
Optionally, the system further comprises a request storage module, configured to: after acquiring the abnormal requests captured at the client, saving the abnormal requests into a database and establishing a timing task to clear the abnormal requests in the database after a set time is reached.
Optionally, the abnormal request is stored in a database according to the parameter of the abnormal request, the interface name and the interface path of the client, and the dimension of the application identifier corresponding to the abnormal request.
Optionally, the request generating module is further configured to: and generating a simulation request according to the parameters of the abnormal request, the interface name and the interface path of the client and the current timestamp.
According to yet another aspect of an embodiment of the present invention, an interface-compensated electronic device is provided.
An interface-compensated electronic device comprising: one or more processors; a storage device, configured to store one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the method for interface compensation provided by the embodiment of the present invention.
According to yet another aspect of embodiments of the present invention, a computer-readable medium is provided.
A computer-readable medium, on which a computer program is stored, which, when executed by a processor, implements the method of interface compensation provided by an embodiment of the invention.
One embodiment of the above invention has the following advantages or benefits: the abnormal data of the interface is managed by a third party by acquiring the abnormal request which is captured at the client and cannot be normally processed, generating a simulation request according to the abnormal request and sending the simulation request to the client for interface compensation, so that the fault tolerance and the availability of the interface are improved; the request retransmission can be carried out without depending on an upstream system, so that the calling between service systems becomes active and flexible; meanwhile, system resources can be saved, and data errors caused by repeated operation are avoided; finally, the service system with problems can be accurately positioned through the simulation request of the interface compensation system, and fault finding and repairing are facilitated. In addition, the invention monitors the interface by using a tangent plane object mode, can realize no invasion to a service system and can realize unified control; the interface compensation system of the embodiment of the invention can be disassembled into a plurality of modules, each module has definite division of labor, is convenient to expand, is flexible to combine and can realize componentization.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main steps of a method of interface compensation according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an implementation architecture of an interface compensation system according to an embodiment of the present invention;
FIG. 3 is a client process flow diagram of an interface compensation system of one embodiment of the invention;
FIG. 4 is a flow chart of a server process of the interface compensation system of one embodiment of the present invention;
FIG. 5 is a schematic diagram of the main blocks of an apparatus for interface compensation according to an embodiment of the present invention;
FIG. 6 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 7 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In order to solve the problems in the prior art, the invention provides an interface compensation method and an interface compensation device, which realize interface data fault-tolerant processing in a third-party management mode. Specifically, the service system is used as a client of the interface compensation system, a toolkit used for capturing abnormal requests is deployed to capture requests (namely, abnormal requests) which cannot be normally processed by the service system, then the server of the interface compensation system uniformly processes the abnormal requests to generate simulation requests to simulate the requests which cannot be normally processed by the service system, and the simulation requests are sent to the service system to retry, so that interface compensation is realized. The interface compensation method of the invention does not need to depend on an upstream system to carry out request retransmission, thereby leading the calling between service systems to be more active and flexible; meanwhile, system resources can be saved, and data errors caused by repeated operation are avoided; finally, the service system with problems can be accurately positioned through the simulation request of the interface compensation system, and fault finding and repairing are facilitated.
Fig. 1 is a schematic diagram of main steps of a method for interface compensation according to an embodiment of the present invention. As shown in fig. 1, the method for interface compensation according to the embodiment of the present invention mainly includes the following steps S101 to S103.
Step S101: acquiring an abnormal request captured at a client, wherein the abnormal request is a request which cannot be normally processed by the client;
step S102: generating a simulation request according to the abnormal request;
step S103: and sending the simulation request to the client for interface compensation.
According to the technical scheme of the embodiment of the invention, the client of the interface compensation system is a service system needing interface compensation. Deploying and installing middleware software development toolkits (such as jar packages) at the client, capturing the abnormal requests by deploying the toolkits for capturing the abnormal requests at the client, and sending the abnormal requests in a message form after capturing the abnormal requests by the toolkits.
The kit for capturing the exception request may include an annotation class of DataMakeUp and a tangent plane object of DataMakeUpAop, where the annotation class of DataMakeUp is used to mark whether the interface needs to be compensated, and an application identifier (e.g., an application name) may be added to the interface; the tangent plane object of the DataMakeUpAop is used for intercepting and capturing the exception request. When an abnormal request is captured by a DataMakeUpAop tangent plane object, a message corresponding to the abnormal request is encoded by using an MD5 message digest algorithm, a Base64 encoding algorithm and other algorithms to generate a unique identifier ID, parameters (such as information including an operation type, an operation key word, a client interface name, an interface path and the like corresponding to the abnormal request) in an implementation-like AOP of the DataMakeUpare analyzed to obtain parameter information, an application identifier marked on the DataMakeUp is obtained, and then the unique identifier ID, the parameter information and the application identifier are sent out in a message form. In the embodiment of the invention, the sending of the message corresponding to the abnormal request can be decoupled from the server side by introducing the message queue, so that the operation is more convenient and the combination is more flexible.
And the server side acquires the message from the message queue and consumes the message, namely acquiring the abnormal request captured at the client side. In order to avoid the waste of server resources, the message is deduplicated in advance when the message is consumed. In the embodiment of the invention, the message can be determined and deduplicated by storing the message into the Redis in a key-value pair key-value form (the unique identifier ID is the key name, and the parameter information, the application identifier and the like are the key values). Specifically, when the message is to be stored in the Redis, whether a corresponding record exists in the Redis can be searched according to the key of the message, if not, the message is not a repeated message, and the message is stored in the Redis; if yes, the message is indicated to be a repeated message, and the message is discarded. Therefore, the message can be judged and deduplicated according to the data storage characteristics of Redis.
For non-duplicate messages, then directly consume to get the exception request captured at the client. After that, the abnormal request can be saved in the database and a timing task is established to clear the abnormal request in the database after the set time is reached. Generally, when a client fails to process a request normally, that is, it is described that a program of the client is abnormal in operation, at this time, an exception is thrown, a program maintenance worker is required to perform program inspection and fault processing, a certain time is usually defined for performing fault processing, and thus a timing task is established. When the abnormal request is stored in the database, the abnormal request can be stored in the database according to the parameter of the abnormal request, the interface name and the interface path of the client and the dimension of the application identifier corresponding to the abnormal request, and meanwhile, the corresponding information such as the storage time and the retry state can also be stored.
After acquiring the abnormal request captured by the client, the server generates a simulation request according to the abnormal request so as to carry out interface compensation by sending the simulation request to the client. When the server generates the simulation request according to the abnormal request, the simulation request may be generated according to a parameter of the abnormal request, an interface name and an interface path of the client, and the current timestamp. By adding a timestamp to the emulation request, the interface with the anti-replay mechanism can be prevented from misidentifying the emulation request as a duplicate request. Here, the current timestamp can be acquired by Java native syntax system currenttimemillis ().
After the simulation request is sent to the client, the client can send the simulation request to the corresponding interface according to the interface and the interface path in the simulation request, and then the corresponding interface executes the processing and the response of the simulation request according to the parameters of the abnormal request.
Fig. 2 is a schematic diagram of an implementation architecture of an interface compensation system according to an embodiment of the present invention. As shown in fig. 2, in this embodiment, the interface compensation system mainly includes several parts, namely, a client, a message queue Mq, a server, a Redis, and a Work thread. The interface of the client is compensated by adding annotations to the interface. Then, an abnormal request is intercepted through the DataMakeUpAop tangent plane object, and when the abnormal request is captured, the abnormal request is added into a message queue and is sent to a server side in a message form. The server side acquires the message from the message queue and consumes the message, firstly, the message is judged to be repeated, and the message is judged to be repeated and removed in a Redis data management mode; then, writing the de-duplicated message into Redis and a Work thread, and performing timing task management on the Work thread so as to remove expired data in the database; then, writing the message into a database; then, the page shows calling abnormity to prompt maintenance personnel of a service system (namely, a client of the interface compensation system) to carry out fault treatment; and finally, generating a simulation request and sending the simulation request to a corresponding interface of the client to repeat the request, thereby achieving the purpose of interface compensation.
Fig. 3 is a flow chart of client-side processing of the interface compensation system of one embodiment of the present invention. As shown in fig. 3, a tool package for capturing an exception request is deployed at the client, and the tool package contains an annotation class of DataMakeUp and a tangent plane object of DataMakeUpAop. The DataMakeUp annotation can be added to the interface through the annotation class of the DataMakeUp so as to mark whether the interface needs to be compensated, and an application identifier is added to the interface. When a request calls the interface needing compensation, package monitoring of the whole interface method is realized through the DataMakeUpAop tangent plane object, and then a Trycatch method is added in the DataMakeUpAop class to intercept an Exception request and capture Exception excepting thrown in the interface execution process. When an abnormal request is captured, a method for obtaining an AOP section entry point is entered, an application identifier appCode (default is default) defined in DataMakeUp is obtained, then, the entered entry is coded by using an MD5 (or Base64 coding) algorithm, then, a DataMakeUpdto object (an object required by a compensation mechanism) is assembled, and then, the assembled message is sent out. And finally, throwing out the exception originally prompted by the service system (the client of the interface compensation system).
According to an embodiment of the invention, the annotation DataMakeUp can be set in a self-defining manner according to the requirements of an application scene to serve as a tangent point of interface interception. The internal structure of the DataMakeUp class is, for example:
Figure BDA0002132080220000081
Figure BDA0002132080220000091
the DataMakeUpAop object is used for realizing the interception function of the interface exception request. One specific implementation of the DataMakeUpAop object is, for example:
Figure BDA0002132080220000092
Figure BDA0002132080220000101
according to the codes, firstly, a doAround section is constructed, and the method for acquiring the section is as follows: a method signature msig (method signature) pjp. Then, the Trycatch method is added in the doAround section for capturing the abnormal state of the method. When an Exception is captured, the filterarms method filters in the objects that are not serializable. getFieldsName gets into the map object of the parameter data. And then, assembling the DataMakeUpdto object according to the map object, the application identifier, the interface path and the interface method name of the input parameter data. Then, encoding the map data of the join to obtain a unique identification ID, and sending the data in a message form by taking the data _ make _ up as a subject topic.
Fig. 4 is a flow chart of a service-side process of the interface compensation system according to an embodiment of the present invention. As shown in fig. 4, when the server starts consuming the message, it is first determined whether there is the same message in the Redis, and specifically, whether there is a corresponding message record in the Redis can be searched according to the unique identifier ID of the message; if yes, the message is a repeated message, and the message is discarded; otherwise, the message is a new message, the message is stored in the Redis, and the validity period is set; then, the message is written into the timing task and the expiration time is set (for example: two days), so that the expired task in the database is removed through the management of the timing task (generally, the task which is not processed manually within two days can be regarded as a task which does not need manual operation and can be removed). Then, the message is written into the database, specifically, the abnormal request can be saved into the database according to the parameters of the abnormal request, the interface name and the interface path of the client, and the dimension of the application identifier corresponding to the abnormal request, and at the same time, the corresponding saving time and retry state (for example, whether to retry, the retry number, etc.) and other information can be stored. Then, the page displays the abnormal condition so as to display the abnormal condition to the maintenance personnel of the service system, and the fault location and processing can be carried out, specifically, when the abnormal condition is displayed, the message content stored in the database can be displayed so as to enable the maintenance personnel of the service system to locate the fault better. Finally, a simulation request is generated and retried to be sent to the client interface for processing and responding, specifically, a manual retry is clicked by a maintenance personnel of the business system, and the generated simulation request is sent to the client. The generated simulation request can support an http mode and a camel mode, a domain name or an IP of a server is input at a calling party, captured parameters of an abnormal request, a client interface name, an interface path and the like are spliced according to a request generation rule to generate a simulation request, and a current timestamp is added to the simulation request.
According to the technical scheme of the embodiment of the invention, in specific implementation, the tool kit for capturing the abnormal request can be deployed to the client of the interface compensation system through the following steps:
the method comprises the following steps: xml by MAVEN;
step two: setting a configuration file of spring, adding Aop configuration, and injecting corresponding configuration of Redis and Mq;
step three: configuring corresponding parameters of the client, such as application identification;
step four: and adding a DataMakeUp note to the interface needing compensation in the code of the business system.
After the deployment and configuration of the toolkit are completed according to the steps, interface compensation can be achieved.
Fig. 5 is a schematic diagram of main blocks of an interface compensation apparatus according to an embodiment of the present invention. As shown in fig. 5, the apparatus 500 for interface compensation according to the embodiment of the present invention mainly includes an exception obtaining module 501, a request generating module 502, and a request sending module 503.
An exception obtaining module 501, configured to obtain an exception request captured at a client, where the exception request is a request that the client cannot normally process;
a request generating module 502, configured to generate a simulation request according to the abnormal request;
a request sending module 503, configured to send the simulation request to the client for interface compensation.
According to one embodiment of the invention, the exception request is captured by deploying a tool kit for capturing the exception request at the client, and the exception request is sent in a message form after the tool kit captures the exception request.
According to another embodiment of the present invention, the interface compensation apparatus 500 may further include a request storage module (not shown in the figure) for:
after acquiring the abnormal request captured at the client, saving the abnormal request into the database and establishing a timing task to clear the abnormal request in the database after reaching the set time.
According to the embodiment of the invention, the abnormal request is stored in the database according to the parameters of the abnormal request, the interface name and the interface path of the client and the dimension of the application identifier corresponding to the abnormal request.
According to yet another embodiment of the present invention, the request generation module 502 may be further configured to:
and generating a simulation request according to the parameters of the abnormal request, the interface name and the interface path of the client and the current timestamp.
According to the technical scheme of the embodiment of the invention, the abnormal request which is captured at the client and cannot be normally processed is obtained, then the simulation request is generated according to the abnormal request, and the simulation request is sent to the client for interface compensation, so that the abnormal data of the interface is managed by a third party, and the fault tolerance and the availability of the interface are improved; the request retransmission can be carried out without depending on an upstream system, so that the calling between service systems becomes active and flexible; meanwhile, system resources can be saved, and data errors caused by repeated operation are avoided; finally, the service system with problems can be accurately positioned through the simulation request of the interface compensation system, and fault finding and repairing are facilitated. In addition, the invention monitors the interface by using a tangent plane object mode, can realize no invasion to a service system and can realize unified control; the interface compensation system of the embodiment of the invention can be disassembled into a plurality of modules, each module has definite division of labor, is convenient to expand, is flexible to combine and can realize componentization.
Fig. 6 shows an exemplary system architecture 600 of an apparatus to which the method of interface compensation or the method of interface compensation of an embodiment of the present invention may be applied.
As shown in fig. 6, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 serves to provide a medium for communication links between the terminal devices 601, 602, 603 and the server 605. Network 604 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 601, 602, 603 to interact with the server 605 via the network 604 to receive or send messages or the like. The terminal devices 601, 602, 603 may have installed thereon various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 605 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 601, 602, 603. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the method for interface compensation provided by the embodiment of the present invention is generally executed by the server 605, and accordingly, the device for interface compensation is generally disposed in the server 605.
It should be understood that the number of terminal devices, networks, and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 7, a block diagram of a computer system 700 suitable for use with a terminal device or server implementing an embodiment of the invention is shown. The terminal device or the server shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 701.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present invention may be implemented by software, or may be implemented by hardware. The described units or modules may also be provided in a processor, and may be described as: a processor includes an exception acquisition module, a request generation module, and a request sending module. The names of these units or modules do not in some cases constitute a limitation on the units or modules themselves, and for example, the exception retrieval module may also be described as a "module for retrieving exception requests captured at the client".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: acquiring an abnormal request captured at a client, wherein the abnormal request is a request which cannot be normally processed by the client; generating a simulation request according to the abnormal request; and sending the simulation request to the client to perform interface compensation.
According to the technical scheme of the embodiment of the invention, the abnormal request which is captured at the client and cannot be normally processed is obtained, then the simulation request is generated according to the abnormal request, and the simulation request is sent to the client for interface compensation, so that the abnormal data of the interface is managed by a third party, and the fault tolerance and the availability of the interface are improved; the request retransmission can be carried out without depending on an upstream system, so that the calling between service systems becomes active and flexible; meanwhile, system resources can be saved, and data errors caused by repeated operation are avoided; finally, the service system with problems can be accurately positioned through the simulation request of the interface compensation system, and fault finding and repairing are facilitated. In addition, the invention monitors the interface by using a tangent plane object mode, can realize no invasion to a service system and can realize unified control; the interface compensation system of the embodiment of the invention can be disassembled into a plurality of modules, each module has definite division of labor, is convenient to expand, is flexible to combine and can realize componentization.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. A method of interface compensation, comprising:
acquiring an abnormal request captured at a client, wherein the abnormal request is a request which cannot be normally processed by the client;
generating a simulation request according to the abnormal request;
and sending the simulation request to the client to perform interface compensation.
2. The method of claim 1, wherein the exception request is captured by deploying a toolkit for capturing exception requests at the client, and wherein the exception request is sent in a message after the toolkit captures the exception request.
3. The method of claim 1, wherein obtaining the exception request captured by the client further comprises:
and saving the abnormal request into a database and establishing a timing task to clear the abnormal request in the database after a set time is reached.
4. The method according to claim 3, wherein the exception request is stored in a database according to the parameters of the exception request, the interface name and the interface path of the client, and the dimension of the application identifier corresponding to the exception request.
5. The method of claim 1, wherein generating a simulation request based on the exception request comprises:
and generating a simulation request according to the parameters of the abnormal request, the interface name and the interface path of the client and the current timestamp.
6. An apparatus for interface compensation, comprising:
the system comprises an exception acquisition module, a processing module and a processing module, wherein the exception acquisition module is used for acquiring an exception request captured at a client, and the exception request is a request which cannot be normally processed by the client;
the request generation module is used for generating a simulation request according to the abnormal request;
and the request sending module is used for sending the simulation request to the client to perform interface compensation.
7. The apparatus of claim 6, wherein the exception request is captured by deploying a toolkit for capturing exception requests at a client, and wherein the exception request is sent in a message after the toolkit captures the exception request.
8. The apparatus of claim 6, further comprising a request storage module configured to:
after acquiring the abnormal requests captured at the client, saving the abnormal requests into a database and establishing a timing task to clear the abnormal requests in the database after a set time is reached.
9. The apparatus of claim 8, wherein the exception request is stored in a database according to a parameter of the exception request, an interface name and an interface path of the client, and a dimension of an application identifier corresponding to the exception request.
10. The apparatus of claim 6, wherein the request generation module is further configured to:
and generating a simulation request according to the parameters of the abnormal request, the interface name and the interface path of the client and the current timestamp.
11. An interface-compensated electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
12. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN201910641602.8A 2019-07-16 2019-07-16 Interface compensation method and device Active CN112241332B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910641602.8A CN112241332B (en) 2019-07-16 2019-07-16 Interface compensation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910641602.8A CN112241332B (en) 2019-07-16 2019-07-16 Interface compensation method and device

Publications (2)

Publication Number Publication Date
CN112241332A true CN112241332A (en) 2021-01-19
CN112241332B CN112241332B (en) 2023-09-22

Family

ID=74167186

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910641602.8A Active CN112241332B (en) 2019-07-16 2019-07-16 Interface compensation method and device

Country Status (1)

Country Link
CN (1) CN112241332B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113296982A (en) * 2021-05-27 2021-08-24 北京京东振世信息技术有限公司 Interface calling method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100150134A1 (en) * 2008-12-11 2010-06-17 Chaoxin Qiu Method and apparatus for providing repeat calling
CN108093005A (en) * 2016-11-22 2018-05-29 北京京东尚科信息技术有限公司 A kind of management method and system of interface exception call
CN109101334A (en) * 2018-06-29 2018-12-28 中译语通科技股份有限公司 A kind of micro services concurrency control method towards Zuul gateway
CN109460312A (en) * 2018-10-31 2019-03-12 阿里巴巴集团控股有限公司 Request the processing method and processing device of failure
CN109739656A (en) * 2018-11-29 2019-05-10 东软集团股份有限公司 Interface data analogy method, device, storage medium and electronic equipment
CN109800096A (en) * 2019-01-08 2019-05-24 深圳市买买提信息科技有限公司 A kind of method and system that message block is retransmitted

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100150134A1 (en) * 2008-12-11 2010-06-17 Chaoxin Qiu Method and apparatus for providing repeat calling
CN108093005A (en) * 2016-11-22 2018-05-29 北京京东尚科信息技术有限公司 A kind of management method and system of interface exception call
CN109101334A (en) * 2018-06-29 2018-12-28 中译语通科技股份有限公司 A kind of micro services concurrency control method towards Zuul gateway
CN109460312A (en) * 2018-10-31 2019-03-12 阿里巴巴集团控股有限公司 Request the processing method and processing device of failure
CN109739656A (en) * 2018-11-29 2019-05-10 东软集团股份有限公司 Interface data analogy method, device, storage medium and electronic equipment
CN109800096A (en) * 2019-01-08 2019-05-24 深圳市买买提信息科技有限公司 A kind of method and system that message block is retransmitted

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
古凌岚;: "基于AOP的Web服务失效恢复机制", 计算机与数字工程, no. 08 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113296982A (en) * 2021-05-27 2021-08-24 北京京东振世信息技术有限公司 Interface calling method and device

Also Published As

Publication number Publication date
CN112241332B (en) 2023-09-22

Similar Documents

Publication Publication Date Title
CN110601952B (en) Multi-channel message notification sending method and device
US11061669B2 (en) Software development tool integration and monitoring
CN112559024A (en) Method and device for generating transaction code change list
CN110019158A (en) A kind of method and apparatus of monitoring data quality
JP2022542203A (en) Mini-program batch processing method, device, electronic device and readable storage medium
CN112445860B (en) Method and device for processing distributed transaction
CN111338834B (en) Data storage method and device
CN110716956A (en) Data request intercepting method and device
CN112241332B (en) Interface compensation method and device
CN111008202A (en) Distributed transaction processing method and framework
CN112783903B (en) Method and device for generating update log
CN114840429A (en) Method, apparatus, device, medium and program product for identifying version conflicts
CN113296829A (en) Method, device, equipment and computer readable medium for processing service
CN113779122A (en) Method and apparatus for exporting data
CN113592645A (en) Data verification method and device
CN113468218A (en) Method and device for monitoring and managing database slow SQL
CN112463616A (en) Chaos testing method and device for Kubernetes container platform
CN112988806A (en) Data processing method and device
CN113347052A (en) Method and device for counting user access data through access log
CN113132447A (en) Reverse proxy method and system
CN113448602A (en) Version updating method and device
CN112783665B (en) Interface compensation method and device
CN116701053B (en) Method, device, equipment and medium for restoring data backup of production environment database
CN113094211B (en) Backup data processing method and device
CN113688152B (en) System function self-checking method and device

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