CN113220559A - Service interface abnormity simulation method, device and system and client - Google Patents

Service interface abnormity simulation method, device and system and client Download PDF

Info

Publication number
CN113220559A
CN113220559A CN202010071577.7A CN202010071577A CN113220559A CN 113220559 A CN113220559 A CN 113220559A CN 202010071577 A CN202010071577 A CN 202010071577A CN 113220559 A CN113220559 A CN 113220559A
Authority
CN
China
Prior art keywords
service interface
target
abnormal information
target service
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010071577.7A
Other languages
Chinese (zh)
Inventor
董焕强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun 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 Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202010071577.7A priority Critical patent/CN113220559A/en
Publication of CN113220559A publication Critical patent/CN113220559A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software

Abstract

The invention discloses a service interface abnormity simulation method, device and system and a client, and relates to the technical field of computers. One embodiment of the method comprises: receiving a request aiming at a target service interface sent by a client; determining a target interception condition corresponding to the target service interface according to a preset corresponding relation between a service interface identifier and the interception condition; determining whether the target service interface meets the target interception condition, if so, determining abnormal information corresponding to the target service interface according to a corresponding relation between a service interface identifier configured in advance and the abnormal information; and selecting target abnormal information from the abnormal information corresponding to the target service interface, and feeding the target abnormal information back to the client so that the client responds to the target abnormal information. This embodiment can improve simulation efficiency, avoids extravagant manpower.

Description

Service interface abnormity simulation method, device and system and client
Technical Field
The invention relates to the technical field of computers, in particular to a service interface abnormity simulation method, device and system and a client.
Background
In the software development process, in order to ensure that each service interface can normally provide services, each service interface needs to be subjected to exception simulation to determine whether a client can make a corresponding response when a test service interface is abnormal.
In the prior art, the service interface abnormality simulation is generally realized by means of manual intervention, and in the process, the abnormality information of each service interface is determined by a tester. However, not only is manpower wasted by means of manual intervention, but also simulation efficiency is low.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, and a system for simulating a service interface anomaly, and a client, which can improve simulation efficiency and avoid wasting manpower.
In a first aspect, an embodiment of the present invention provides a method for simulating an anomaly of a service interface, including:
receiving a request aiming at a target service interface sent by a client;
determining a target interception condition corresponding to the target service interface according to a preset corresponding relation between a service interface identifier and the interception condition;
determining whether the target service interface meets the target interception condition, if so, determining abnormal information corresponding to the target service interface according to a corresponding relation between a service interface identifier configured in advance and the abnormal information;
and selecting target abnormal information from the abnormal information corresponding to the target service interface, and feeding the target abnormal information back to the client so that the client responds to the target abnormal information.
Preferably, the first and second electrodes are formed of a metal,
further comprising: generating parameters corresponding to the target service interface;
determining whether the target service interface satisfies the target interception condition, including:
and determining whether the parameter corresponding to the target service interface is greater than or equal to a parameter threshold value.
Preferably, the first and second electrodes are formed of a metal,
further comprising:
and responding the request of the target service interface if the target service interface does not meet the target interception condition.
Preferably, the first and second electrodes are formed of a metal,
selecting target exception information from exception information corresponding to the target service interface, including:
and selecting any one piece of abnormal information from the abnormal information corresponding to the target service interface as the target abnormal information.
In a second aspect, an embodiment of the present invention provides a method for simulating an anomaly of a service interface, including:
sending a request aiming at a target service interface to a service interface abnormity simulation device; enabling the service interface abnormity simulation device to determine a target interception condition corresponding to the target service interface according to a corresponding relation between a service interface identifier configured in advance and the interception condition; determining whether the target service interface meets the target interception condition, if so, determining abnormal information corresponding to the target service interface according to a corresponding relation between a service interface identifier configured in advance and the abnormal information; selecting target abnormal information from the abnormal information corresponding to the target service interface;
and receiving and responding to the target abnormal information fed back by the service interface abnormal simulation device.
In a third aspect, an embodiment of the present invention provides a service interface abnormality simulation apparatus, including:
the receiving module is configured to receive a request which is sent by a client and aims at a target service interface;
the determining module is configured to determine a target interception condition corresponding to the target service interface according to a preset corresponding relationship between a service interface identifier and the interception condition; determining whether the target service interface meets the target interception condition, if so, determining abnormal information corresponding to the target service interface according to a corresponding relation between a service interface identifier configured in advance and the abnormal information;
and the sending module is configured to select target abnormal information from the abnormal information corresponding to the target service interface and feed the target abnormal information back to the client so that the client responds to the target abnormal information.
In a fourth aspect, an embodiment of the present invention provides a client, including:
the sending module is configured to send a request aiming at the target service interface to the service interface abnormity simulation device; enabling the service interface abnormity simulation device to determine a target interception condition corresponding to the target service interface according to a corresponding relation between a service interface identifier configured in advance and the interception condition; determining whether the target service interface meets the target interception condition, if so, determining abnormal information corresponding to the target service interface according to a corresponding relation between a service interface identifier configured in advance and the abnormal information; selecting target abnormal information from the abnormal information corresponding to the target service interface;
and the receiving module is configured to receive and respond to the target abnormity information fed back by the service interface abnormity simulating device.
In a fifth aspect, an embodiment of the present invention provides a service interface anomaly simulation system, including: the service interface abnormality simulation apparatus according to any of the above embodiments and the client according to any of the above embodiments.
In a sixth aspect, an embodiment of the present invention provides an electronic device, including:
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 of the embodiments described above.
In a seventh aspect, an embodiment of the present invention provides a computer-readable medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method described in any of the above embodiments.
One embodiment of the above invention has the following advantages or benefits: the method automatically determines abnormal information corresponding to the target service interface based on the request of the target service interface so as to perform abnormal simulation on the target service interface. This process does not need artificial intervention, can use manpower sparingly the cost, improves simulation efficiency.
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 flowchart of a service interface abnormality simulation method applied to a service interface abnormality simulation apparatus according to an embodiment of the present invention;
fig. 2 is a flowchart of a service interface anomaly simulation method applied to a client according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a service interface abnormality simulation apparatus according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a client according to an embodiment of the present invention;
fig. 5 is a flowchart of a service interface abnormality simulation method applied to a service interface abnormality simulation system 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.
Fig. 1 is a method for simulating an anomaly of a service interface according to an embodiment of the present invention, applied to a device for simulating an anomaly of a service interface, including:
step 101: and receiving a request which is sent by the client and aims at the target service interface.
The client can be a mobile client, and can also be other types of clients such as a Web client. A service interface is a shared boundary between one automation system and another automation system or user. In the embodiment of the invention, the service interface is a shared boundary between the client and the service interface abnormality simulation device. The target service interface refers to a service interface tested by the method, for example, a service interface 1 and a service interface 2 exist, and if the service interface 1 is abnormally simulated, a request sent by a client and directed to the service interface 1 is received.
The request for the target service interface may be a synchronous request or an asynchronous request. Compared with synchronous requests, asynchronous requests can shorten the time for processing the requests and improve the efficiency of abnormal simulation.
The request of the target service interface may include an identifier of the target service interface, and of course, the identifier of the target service interface may also be bound with the target service interface and sent to the server by the client.
Step 102: and determining a target interception condition corresponding to the target service interface according to the corresponding relation between the service interface identifier configured in advance and the interception condition.
In the embodiment of the invention, the target interception condition corresponding to the target service interface is determined, namely the target interception condition corresponding to the target service interface identifier is determined.
The service interface identifier and the interception condition may be stored in a data table, and the interception conditions corresponding to different service interface identifiers may be the same or different. For example, the service interface identifier 1 corresponds to the interception condition a, the service interface identifier 2 corresponds to the interception condition B, the service interface identifier 3 corresponds to the interception condition C, and the service interface identifier 4 corresponds to the interception condition a. If the target service interface identification is 1, the target interception condition is A.
Step 103: it is determined whether the target service interface satisfies the target intercept condition, if so, step 104 is performed, otherwise, step 106 is performed.
Step 104: and determining the abnormal information corresponding to the target service interface according to the corresponding relation between the service interface identifier configured in advance and the abnormal information.
Each service interface identification corresponds to at least one piece of exception information, i.e. a service interface identification may correspond to one or more pieces of exception information. The target service interface corresponds to at least one piece of exception information. Each exception information corresponds to an exception type, and the exception types comprise: network anomalies, parameter errors, etc. In an actual application scenario, the exception information of different exception types corresponding to the service interface identifier may be configured to test the reaction of the client when the service interface has exceptions of different types.
Step 105: and selecting target abnormal information from the abnormal information corresponding to the target service interface, and feeding the target abnormal information back to the client so that the client responds to the target abnormal information and terminates the current process.
The target exception information refers to exception information of each time the exception simulation process client side responds. The client side responds according to the target abnormal information, and a developer can determine whether the target service interface is abnormal or not according to the response result of the client side.
Step 106: responding to the request of the target service interface.
The responding to the request of the target service interface specifically includes: and requesting data corresponding to the request of the target service interface from the service module, and feeding back the data to the client. The service interface abnormity simulation device and the service module form a service end. Thus, the service interface is also a shared boundary between the client and the server.
The method automatically determines abnormal information corresponding to the target service interface based on the request of the target service interface so as to perform abnormal simulation on the target service interface. This process does not need artificial intervention, can use manpower sparingly the cost, improves simulation efficiency.
In an actual application scenario, the request may be intercepted based on different policies, where the different policies correspond to different interception conditions. For example, the request may be intercepted if the requested transmission frequency is greater than a preset frequency threshold based on the requested transmission frequency; whether to intercept the request may also be determined based on parameters carried in the request.
In one embodiment of the present invention, in order to facilitate control of the probability of interception of requests to each service interface, the method further comprises: generating parameters corresponding to the target service interface;
determining whether the target service interface meets a target interception condition, including:
and determining whether the parameter corresponding to the target service interface is greater than or equal to the parameter threshold value.
And the parameters corresponding to the target service interface are randomly generated in the value range corresponding to the target service interface. The parameter corresponding to the target service interface is greater than or equal to a first value and less than or equal to a second value, the parameter threshold is preset, the parameter threshold is greater than or equal to the first value and less than or equal to the second value +1, and the parameter, the parameter threshold, the first value and the second value are integers.
For example, if the first value is 0 and the second value is 9, the parameter corresponding to the target service interface is greater than or equal to 0 and less than or equal to 9, and the parameter threshold is greater than or equal to 0 and less than or equal to 10. If the parameter threshold corresponding to the target service interface is 8, the target interception condition is satisfied when the parameter is 8 or 9, and the probability of the parameter being 8 or 9 is 20%. Therefore, when the parameter corresponding to the target service interface is greater than or equal to 0 and less than or equal to 9 and the parameter threshold is 8, the probability that the request of the target service interface is intercepted is 20%. If the parameter threshold is 7, the probability that the request of the target service interface is intercepted is 30%.
For example, if the first value is 0 and the second value is 99, the parameter corresponding to the target service interface is greater than or equal to 0 and less than or equal to 99, and the parameter threshold is greater than or equal to 0 and less than or equal to 100. If the parameter threshold corresponding to the target service interface is 90, the target interception condition is satisfied when the parameter is greater than or equal to 90 and less than or equal to 99, and the probability that the parameter is greater than or equal to 90 and less than or equal to 99 is 10%. Therefore, when the parameter corresponding to the target service interface is greater than or equal to 0 and less than or equal to 99 and the parameter threshold is 90, the probability that the request of the target service interface is intercepted is 10%.
The method and the device control the interception probability of the request of each target service interface based on the parameters and the parameter threshold, and if the probability that the target service interface is abnormal in the actual application scene is high, the interception probability of the request of the target service interface can be improved by configuring the interception condition, namely the parameter threshold is configured to be a small value. Taking the parameter greater than or equal to 0 and less than or equal to 9 as an example, if the parameter threshold is 8, the probability that the request of the target service interface is intercepted is 20%, and if the parameter threshold is 7, the probability that the request of the target service interface is intercepted is 30%. If the interception probability of a request to the target service interface is 80%, the parameter threshold needs to be adjusted to 2.
If the request of the target service interface meets the interception condition, the target abnormal information needs to be selected from the abnormal information corresponding to the target service interface, and in an actual application scene, the target abnormal information can be selected based on different selection rules. The selection rule may be that, according to a preset priority order, the abnormal information corresponding to the target service interface is sequentially selected as the target abnormal information. For example, the exception information corresponding to the target service interface includes: A. b, C, D, the priority order is 2, 1, 4, 3, the first interception can take B as the target abnormal information, the second interception can take A as the target abnormal information, the third interception can take D as the target abnormal information, the fourth interception can take C as the target abnormal information.
In order to simulate different exception types, in an embodiment of the present invention, selecting target exception information from exception information corresponding to a target service interface includes:
and selecting any one piece of abnormal information from the abnormal information corresponding to the target service interface as target abnormal information.
Namely, the embodiment of the invention randomly selects the abnormal information from the abnormal information as the target abnormal information, and the probability of selecting each abnormal information is the same. Therefore, the method can simulate different abnormal types and meet the requirements of different application scenes.
As shown in fig. 2, an embodiment of the present invention provides a service interface anomaly simulation method, applied to a client, including:
step 201: sending a request aiming at a target service interface to a service interface abnormity simulation device; so that the service interface abnormity simulation device determines a target interception condition corresponding to the target service interface according to a corresponding relation between a service interface identifier configured in advance and the interception condition; determining whether the target service interface meets a target interception condition, if so, determining abnormal information corresponding to the target service interface according to a corresponding relation between a service interface identifier configured in advance and the abnormal information; and selecting target abnormal information from the abnormal information corresponding to the target service interface.
Step 202: and receiving and responding to the target abnormal information fed back by the service interface abnormal simulation device.
In the embodiment of the invention, the service interface abnormity simulation device can select the target abnormity information for the client to perform the service interface abnormity simulation based on the request aiming at the target service interface sent by the client, the process is automatically completed by the service interface abnormity simulation device without manual participation, and the efficiency of the service interface abnormity simulation can be improved.
As shown in fig. 3, an embodiment of the present invention provides a service interface abnormality simulation apparatus, including:
a receiving module 301 configured to receive a request for a target service interface sent by a client;
a determining module 302 configured to determine a target interception condition corresponding to the target service interface according to a pre-configured correspondence between the service interface identifier and the interception condition; determining whether the target service interface meets a target interception condition, if so, determining abnormal information corresponding to the target service interface according to a corresponding relation between a service interface identifier configured in advance and the abnormal information;
the sending module 303 is configured to select target exception information from the exception information corresponding to the target service interface, and feed the target exception information back to the client, so that the client responds to the target exception information.
In one embodiment of the invention, the determining module 302 is configured to generate a parameter corresponding to the target service interface; and determining whether the parameter corresponding to the target service interface is greater than or equal to the parameter threshold value.
The parameter corresponding to the target service interface is greater than or equal to a first value and less than or equal to a second value, the parameter threshold is greater than or equal to the first value and less than or equal to the second value +1, and the parameter, the parameter threshold, the first value and the second value are integers.
In an embodiment of the present invention, the determining module 302 is configured to respond to the request of the target service interface if the target service interface does not satisfy the target intercepting condition.
In an embodiment of the present invention, the sending module 303 is configured to select any one of the exception information corresponding to the target service interface as the target exception information.
As shown in fig. 4, an embodiment of the present invention provides a client, including:
a sending module 401 configured to send a request for a target service interface to a service interface abnormality simulation apparatus; so that the service interface abnormity simulation device determines a target interception condition corresponding to the target service interface according to a corresponding relation between a service interface identifier configured in advance and the interception condition; determining whether the target service interface meets a target interception condition, if so, determining abnormal information corresponding to the target service interface according to a corresponding relation between a service interface identifier configured in advance and the abnormal information; selecting target abnormal information from the abnormal information corresponding to the target service interface;
the receiving module 402 is configured to receive and respond to the target anomaly information fed back by the service interface anomaly simulation device.
The embodiment of the invention provides a service interface abnormity simulation system, which comprises: the service interface abnormality simulation apparatus according to any of the above embodiments and the client according to any of the above embodiments.
As shown in fig. 5, the embodiment of the present invention takes a service interface abnormality simulation system formed by a service interface abnormality simulation apparatus and a client as an example to describe a service interface abnormality simulation method, where the method includes:
step 501: and the client sends a request aiming at the target service interface to the service interface abnormity simulation device.
Step 502: and the service interface abnormity simulation device determines a target interception condition corresponding to the target service interface according to the corresponding relation between the service interface identifier and the interception condition which are configured in advance.
Step 503: and if the target service interface meets the target interception condition, the service interface abnormality simulation device determines the abnormality information corresponding to the target service interface according to the corresponding relation between the preset service interface identifier and the abnormality information.
Step 504: the service interface abnormality simulation device selects target abnormality information from abnormality information corresponding to a target service interface.
Step 505: and the service interface abnormality simulation device feeds the target abnormality information back to the client.
Step 506: the client responds to the target exception information.
The service interface abnormity simulation device automatically determines the abnormity information corresponding to the target service interface based on the request of the target service interface, and selects the target abnormity information from the abnormity information to feed back to the client so as to simulate the abnormity of the target service interface. This process does not need artificial intervention, can use manpower sparingly the cost, improves simulation efficiency.
An embodiment of the present invention provides an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method of any of the embodiments as described above.
Fig. 6 shows an exemplary system architecture 600 of a service interface anomaly simulation method or a service interface anomaly simulation apparatus to which an embodiment of the present invention can 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 (this architecture is merely an example, and the components included in a specific architecture may be adjusted according to the specific application). 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 service interface abnormality simulation method provided by the embodiment of the present invention is generally executed by the server 605, and accordingly, the service interface abnormality simulation apparatus 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, shown is a block diagram of a computer system 700 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device 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) services interface 705 is also connected to bus 704.
The following components are connected to the I/O service 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 service 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 service 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 modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a sending module, an obtaining module, a determining module, and a first processing module. The names of these modules do not form a limitation on the modules themselves in some cases, and for example, the sending module may also be described as a "module sending a picture acquisition request to a connected server".
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:
receiving a request aiming at a target service interface sent by a client;
determining a target interception condition corresponding to the target service interface according to a preset corresponding relation between a service interface identifier and the interception condition;
determining whether the target service interface meets the target interception condition, if so, determining a plurality of abnormal information corresponding to the target service interface according to a corresponding relation between a service interface identifier configured in advance and a plurality of abnormal information;
and selecting target abnormal information from a plurality of abnormal information corresponding to the target service interface, and feeding the target abnormal information back to the client so that the client responds to the target abnormal information.
According to the technical scheme of the embodiment of the invention, the server automatically determines a plurality of abnormal information corresponding to the target service interface based on the request of the target service interface, and the process does not need manual intervention, so that the labor cost can be saved, and the simulation efficiency can be improved.
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 (10)

1. A service interface anomaly simulation method is characterized by comprising the following steps:
receiving a request aiming at a target service interface sent by a client;
determining a target interception condition corresponding to the target service interface according to a preset corresponding relation between a service interface identifier and the interception condition;
determining whether the target service interface meets the target interception condition, if so, determining abnormal information corresponding to the target service interface according to a corresponding relation between a service interface identifier configured in advance and the abnormal information;
and selecting target abnormal information from the abnormal information corresponding to the target service interface, and feeding the target abnormal information back to the client so that the client responds to the target abnormal information.
2. The method of claim 1, further comprising: generating parameters corresponding to the target service interface;
determining whether the target service interface satisfies the target interception condition, including:
and determining whether the parameter corresponding to the target service interface is greater than or equal to a parameter threshold value.
3. The method of claim 1, further comprising:
and responding the request of the target service interface if the target service interface does not meet the target interception condition.
4. The method of any one of claims 1 to 3,
selecting target exception information from exception information corresponding to the target service interface, including:
and selecting any one piece of abnormal information from the abnormal information corresponding to the target service interface as the target abnormal information.
5. A service interface anomaly simulation method is characterized by comprising the following steps:
sending a request aiming at a target service interface to a service interface abnormity simulation device; enabling the service interface abnormity simulation device to determine a target interception condition corresponding to the target service interface according to a corresponding relation between a service interface identifier configured in advance and the interception condition; determining whether the target service interface meets the target interception condition, if so, determining abnormal information corresponding to the target service interface according to a corresponding relation between a service interface identifier configured in advance and the abnormal information; selecting target abnormal information from the abnormal information corresponding to the target service interface;
and receiving and responding to the target abnormal information fed back by the service interface abnormal simulation device.
6. A service interface anomaly simulation apparatus, comprising:
the receiving module is configured to receive a request which is sent by a client and aims at a target service interface;
the determining module is configured to determine a target interception condition corresponding to the target service interface according to a preset corresponding relationship between a service interface identifier and the interception condition; determining whether the target service interface meets the target interception condition, if so, determining abnormal information corresponding to the target service interface according to a corresponding relation between a service interface identifier configured in advance and the abnormal information;
and the sending module is configured to select target abnormal information from the abnormal information corresponding to the target service interface and feed the target abnormal information back to the client so that the client responds to the target abnormal information.
7. A client, comprising:
the sending module is configured to send a request aiming at the target service interface to the service interface abnormity simulation device; enabling the service interface abnormity simulation device to determine a target interception condition corresponding to the target service interface according to a corresponding relation between a service interface identifier configured in advance and the interception condition; determining whether the target service interface meets the target interception condition, if so, determining abnormal information corresponding to the target service interface according to a corresponding relation between a service interface identifier configured in advance and the abnormal information; selecting target abnormal information from the abnormal information corresponding to the target service interface;
and the receiving module is configured to receive and respond to the target abnormity information fed back by the service interface abnormity simulating device.
8. A service interface anomaly simulation system, comprising: the service interface anomaly simulation apparatus of claim 6 and the client of claim 7.
9. An 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.
10. 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.
CN202010071577.7A 2020-01-21 2020-01-21 Service interface abnormity simulation method, device and system and client Pending CN113220559A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010071577.7A CN113220559A (en) 2020-01-21 2020-01-21 Service interface abnormity simulation method, device and system and client

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010071577.7A CN113220559A (en) 2020-01-21 2020-01-21 Service interface abnormity simulation method, device and system and client

Publications (1)

Publication Number Publication Date
CN113220559A true CN113220559A (en) 2021-08-06

Family

ID=77085278

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010071577.7A Pending CN113220559A (en) 2020-01-21 2020-01-21 Service interface abnormity simulation method, device and system and client

Country Status (1)

Country Link
CN (1) CN113220559A (en)

Similar Documents

Publication Publication Date Title
CN107302597B (en) Message file pushing method and device
CN110377440B (en) Information processing method and device
CN112131095A (en) Pressure testing method and device
CN111737218A (en) File sharing method and device
CN113220559A (en) Service interface abnormity simulation method, device and system and client
CN108811036B (en) Method and apparatus for displaying wireless access point information
CN114528212A (en) Method, apparatus, device and computer readable medium for providing test data
CN108984189B (en) Module parsing method and device
CN107634942B (en) Method and device for identifying malicious request
CN109218041B (en) Request processing method and device for server system
CN108933695B (en) Method and apparatus for processing information
CN107729482B (en) Method and device for collecting logs
CN112579447A (en) Browser testing method and device
CN113778847A (en) Test report generation method and device
CN113746661A (en) Service processing method and device
CN110928758A (en) Method and device for generating test case
CN113760177A (en) Data reporting method and device
CN110795328A (en) Interface testing method and device
CN113704080A (en) Automatic testing method and device
CN111382953A (en) Dynamic process generation method and device
CN113449228A (en) Page rendering method and device
CN113448652A (en) Request processing method and device
CN113778660A (en) System and method for managing hot spot data
CN114625420A (en) Data processing method and device
CN113783713A (en) Method, device and system for configuring proxy

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