CN113220559B - A service interface abnormality simulation method, device, system and client - Google Patents

A service interface abnormality simulation method, device, system and client Download PDF

Info

Publication number
CN113220559B
CN113220559B CN202010071577.7A CN202010071577A CN113220559B CN 113220559 B CN113220559 B CN 113220559B CN 202010071577 A CN202010071577 A CN 202010071577A CN 113220559 B CN113220559 B CN 113220559B
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.)
Active
Application number
CN202010071577.7A
Other languages
Chinese (zh)
Other versions
CN113220559A (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 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/CN113220559B/en
Publication of CN113220559A publication Critical patent/CN113220559A/en
Application granted granted Critical
Publication of CN113220559B publication Critical patent/CN113220559B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a service interface abnormality simulation method, device and system and a client, and relates to the technical field of computers. The method comprises the steps of receiving a request for a target service interface sent by a client, determining a target interception condition corresponding to the target service interface according to a corresponding relation between a preset service interface identifier and the interception condition, determining whether the target service interface meets the target interception condition, determining abnormal information corresponding to the target service interface according to a corresponding relation between the preset service interface identifier and abnormal information if the target service interface meets the target interception condition, selecting target abnormal information from the abnormal information corresponding to the target service interface, and feeding back the target abnormal information to the client so that the client responds to the target abnormal information. According to the embodiment, the simulation efficiency can be improved, and the waste of manpower is avoided.

Description

Service interface abnormality simulation method, device and system and client
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a service interface anomaly 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, exception simulation needs to be performed on each service interface to determine whether a client can make a corresponding response when an exception occurs in a test service interface.
In the prior art, service interface abnormality simulation is generally realized by manual intervention, and in the process, the abnormal information of each service interface is determined by a tester. But not only is human waste caused by manual intervention, but also the simulation efficiency is low.
Disclosure of Invention
In view of the above, the embodiments of the present invention provide a method, an apparatus, a system, and a client for simulating service interface anomalies, which can improve simulation efficiency and avoid wasting manpower.
In a first aspect, an embodiment of the present invention provides a service interface anomaly simulation method, including:
Receiving a request for a target service interface sent by a client;
determining a target interception condition corresponding to the target service interface according to the corresponding relation between a preset 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 the corresponding relation between a preset service interface identifier and the abnormal information;
and selecting target abnormal information from the abnormal information corresponding to the target service interface, and feeding back the target abnormal information to the client so that the client responds to the target abnormal information.
Preferably, the method comprises the steps of,
Generating parameters corresponding to the target service interface;
Determining whether the target service interface meets the target interception condition includes:
and determining whether the parameter corresponding to the target service interface is greater than or equal to a parameter threshold.
Preferably, the method comprises the steps of,
Further comprises:
and if the target service interface does not meet the target interception condition, responding to the request of the target service interface.
Preferably, the method comprises the steps of,
Selecting target abnormal information from the abnormal information corresponding to the target service interface, wherein the method comprises the following steps:
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 service interface anomaly simulation method, including:
The method comprises the steps of receiving a request for a target service interface from a service interface abnormality simulation device, determining a target interception condition corresponding to the target service interface by the service interface abnormality simulation device according to the corresponding relation between a preset service interface identifier and the interception condition, determining whether the target service interface meets the target interception condition, and if so, determining abnormality information corresponding to the target service interface according to the corresponding relation between the preset service interface identifier and the abnormality information;
and receiving and responding to the target abnormality information fed back by the service interface abnormality 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 for a target service interface sent by a client;
The system comprises a determining module, a judging module and a judging module, wherein the determining module is configured to determine a target interception condition corresponding to the target service interface according to the corresponding relation between a pre-configured service interface identifier and the interception condition;
and the sending module is configured to select target abnormal information from the abnormal information corresponding to the target service interface and feed back the target abnormal information 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 system comprises a service interface abnormality simulation device, a sending module, a target interception condition determining module, a target service interface abnormality simulation device, a target interception condition determining module and a target service interface abnormality simulation module, wherein the service interface abnormality simulation device is used for determining a target interception condition corresponding to the target service interface according to the corresponding relation between a preset service interface identifier and the interception condition;
And the receiving module is configured to receive and respond to the target abnormality information fed back by the service interface abnormality simulation device.
In a fifth aspect, an embodiment of the present invention provides a service interface abnormality simulation system, including the service interface abnormality simulation device described in any one of the above embodiments and the client described in any one of the above embodiments.
In a sixth aspect, an embodiment of the present invention provides an electronic device, including:
one or more processors;
storage means for storing one or more programs,
The one or more programs, when executed by the one or more processors, cause the one or more processors to implement the methods of any of the embodiments described above.
In a seventh aspect, embodiments of the present invention provide a computer readable medium having stored thereon a computer program which, when executed by a processor, implements a method as described in any of the above embodiments.
The method has the advantages that based on the request of the target service interface, the abnormal information corresponding to the target service interface is automatically determined, so that the target service interface is subjected to abnormal simulation. The process does not need manual intervention, can save labor cost and improve simulation efficiency.
Further effects of the above-described non-conventional alternatives are 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 device according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for simulating service interface abnormality applied to a client according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a service interface abnormality simulation device 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 anomaly simulation method applied to a service interface anomaly 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 applied;
fig. 7 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered 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 service interface abnormality simulation method according to an embodiment of the present invention, which is applied to a service interface abnormality simulation device, and includes:
and 101, receiving a request for a target service interface sent by a client.
The client may be a mobile client, or may be a Web client or other type of 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, the service interface 1 and the service interface 2 exist, and if the service interface 1 is abnormally simulated, a request sent by a client for the service interface 1 is received.
The request for the target service interface may be a synchronous request or an asynchronous request. Asynchronous requests can shorten the time to process the request and improve the efficiency of exception simulation compared to synchronous requests.
The request of the target service interface may include the 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, determining a target interception condition corresponding to the target service interface according to the corresponding relation between the preset service interface identification 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 identifiers and the interception conditions can be correspondingly stored in a data table, and the interception conditions corresponding to different service interface identifiers can be the same or different. For example, service interface identifier 1 corresponds to interception condition a, service interface identifier 2 corresponds to interception condition B, service interface identifier 3 corresponds to interception condition C, and service interface identifier 4 corresponds to interception condition a. If the target service interface identification is 1, the target interception condition is A.
Step 103, determining whether the target service interface meets the target interception condition, if so, executing step 104, otherwise, executing step 106.
Step 104, determining the abnormal information corresponding to the target service interface according to the corresponding relation between the preset service interface identification and the abnormal information.
Each service interface identification corresponds to at least one anomaly information, i.e. the service interface identification may correspond to one or more anomaly information. The target service interface corresponds to at least one anomaly information. Each anomaly information corresponds to an anomaly type, and the anomaly type comprises network anomalies, parameter errors and the like. In an actual application scene, the abnormal information of different abnormal types corresponding to the service interface identifier can be configured to test the reaction of the client when the service interface generates different types of abnormalities.
And 105, 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 to terminate the current flow.
The target anomaly information refers to anomaly information responded by the client during each anomaly simulation. The client responds according to the target abnormality information, and a developer can determine whether the target service interface is abnormal according to the response result of the client.
And step 106, responding to the request of the target service interface.
Responding to the request of the target service interface specifically comprises requesting data corresponding to the request of the target service interface from the service module and feeding the data back to the client. The service interface abnormality 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 the 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. The process does not need manual intervention, can save labor cost and improve simulation efficiency.
In an actual application scene, the request can be intercepted based on different strategies, and the different strategies correspond to different interception conditions. For example, the request may be intercepted if the request sending frequency is greater than a preset frequency threshold based on the request sending frequency, and whether to intercept the request may be determined based on parameters carried in the request.
In one embodiment of the invention, in order to facilitate control of the interception probability of requests to the respective service interfaces, the method further comprises generating parameters corresponding to the target service interface;
determining whether the target service interface meets the target interception condition includes:
And determining whether the parameter corresponding to the target service interface is greater than or equal to a parameter threshold.
The parameters corresponding to the target service interface are randomly generated in the corresponding value range. The parameter corresponding to the target service interface is larger than or equal to the first value and smaller than or equal to the second value, the parameter threshold is preset, the parameter threshold is larger than or equal to the first value and smaller 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 equal to or greater than 0 and equal to or less than 9 and the parameter threshold is 8, the probability of interception of the request of the target service interface 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 more than or equal to 90 and less than or equal to 99, and the probability that the parameter is more 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 equal to or greater than 0 and equal to or less than 99 and the parameter threshold is 90, the probability of interception of the request of the target service interface is 10%.
According to the embodiment of the invention, based on the parameters and the parameter threshold values, the interception probability of the requests of all the target service interfaces is controlled, and if the probability of the target service interfaces abnormal in the actual application scene is larger, the interception probability of the requests of the target service interfaces can be improved by configuring interception conditions, namely, the parameter threshold values are configured to be smaller. Taking the parameter of 0 or more and 9 or less as an example, when the parameter threshold is 8, the probability of interception of the request of the target service interface is 20%, and when the parameter threshold is 7, the probability of interception of the request of the target service interface is 30%. If the interception probability of the 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 the actual application scene, the target abnormal information can be selected based on different selection rules. The selection rule may sequentially select, according to a preset priority order, the anomaly information corresponding to the target service interface as the target anomaly information. For example, the anomaly information corresponding to the target service interface includes A, B, C, D, where the priority order is 2, 1,4, and 3, then B may be used as the target anomaly information in the first interception, a may be used as the target anomaly information in the second interception, D may be used as the target anomaly information in the third interception, and C may be used as the target anomaly information in the fourth interception.
In order to simulate different anomaly types, in one embodiment of the present invention, selecting target anomaly information from anomaly information corresponding to a target service interface includes:
Any one piece of abnormality information is selected from the abnormality information corresponding to the target service interface as target abnormality information.
Namely, in the embodiment of the invention, the anomaly information is randomly selected from the anomaly information to serve as target anomaly information, and the probability that each anomaly information is selected 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, which is applied to a client, and includes:
Step 201, sending a request for a target service interface to a service interface abnormality simulation device, enabling the service interface abnormality simulation device to determine a target interception condition corresponding to the target service interface according to the corresponding relation between a pre-configured service interface identifier and an interception condition, determining whether the target service interface meets the target interception condition, if so, determining abnormality information corresponding to the target service interface according to the corresponding relation between the pre-configured service interface identifier and the abnormality information, and selecting the target abnormality information from the abnormality information corresponding to the target service interface.
And 202, receiving and responding to the target abnormality information fed back by the service interface abnormality simulation device.
In the embodiment of the invention, the service interface abnormality simulation device can select the target abnormality information for the client to perform service interface abnormality simulation based on the request for the target service interface sent by the client, and the process is automatically completed by the service interface abnormality simulation device without manual participation, so that the efficiency of service interface abnormality simulation can be improved.
As shown in fig. 3, an embodiment of the present invention provides a service interface abnormality simulation device, including:
a receiving module 301 configured to receive a request for a target service interface sent by a client;
the determining module 302 is configured to determine a target interception condition corresponding to the target service interface according to the corresponding relation between the pre-configured service interface identifier and the interception condition;
And the sending module 303 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 one embodiment of the present invention, the determining module 302 is configured to generate a parameter corresponding to the target service interface, and determine whether the parameter corresponding to the target service interface is greater than or equal to a parameter threshold.
The parameter corresponding to the target service interface is greater than or equal to the first value and less than or equal to the 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 one embodiment of the invention, the determination module 302 is configured to respond to a request of the target service interface if the target service interface does not meet the target intercept condition.
In one embodiment of the present invention, the sending module 303 is configured to select any one of the anomaly information from the anomaly information corresponding to the target service interface as the target anomaly information.
As shown in fig. 4, an embodiment of the present invention provides a client, including:
The system comprises a sending module 401, a target service interface abnormality simulation device, a target interception condition determining module and a target service interface abnormality simulation device, wherein the sending module 401 is configured to send a request for the target service interface to the service interface abnormality simulation device, so that the service interface abnormality simulation device determines the target interception condition corresponding to the target service interface according to the corresponding relation between a preset service interface identifier and the interception condition;
the receiving module 402 is configured to receive and respond to the target abnormality information fed back by the service interface abnormality simulation device.
The embodiment of the invention provides a service interface abnormality simulation system, which comprises the service interface abnormality simulation device of any embodiment and the client of any embodiment.
As shown in fig. 5, an embodiment of the present invention is an example of a service interface abnormality simulation system composed of a service interface abnormality simulation device and a client, and describes a service interface abnormality model method, which includes:
Step 501, the client sends a request for a target service interface to the service interface abnormality simulation device.
Step 502, the service interface abnormality simulation device determines a target interception condition corresponding to a target service interface according to a corresponding relation between a pre-configured service interface identifier and an interception condition.
Step 503, 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 the abnormality information corresponding to the target service interface.
And 505, the service interface abnormality simulation device feeds back the target abnormality information to the client.
Step 506, the client responds to the target anomaly information.
The service interface abnormality simulation device automatically determines abnormality information corresponding to the target service interface based on the request of the target service interface, selects target abnormality information from the abnormality information and feeds the target abnormality information back to the client so as to perform abnormality simulation on the target service interface. The process does not need manual intervention, can save labor cost and improve simulation efficiency.
The embodiment of the invention provides electronic equipment, which comprises:
one or more processors;
storage means for storing one or more programs,
The 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.
Fig. 6 illustrates an exemplary system architecture 600 to which the service interface abnormality simulation method or the service interface abnormality simulation apparatus of the embodiment of the present invention may be applied.
As shown in fig. 6, a 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 contained in a particular architecture may be tailored to the application specific case). The network 604 is used as a medium to provide communication links between the terminal devices 601, 602, 603 and the server 605. The network 604 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 605 via the network 604 using the terminal devices 601, 602, 603 to receive or send messages, etc. Various communication client applications such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only) may be installed on the terminal devices 601, 602, 603.
The terminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 605 may be a server providing various services, such as a background management server (by way of example only) providing support for shopping-type websites browsed by users using terminal devices 601, 602, 603. The background management server may analyze and process the received data such as the product information query request, and feedback the processing result (e.g., the target push information, the product information—only an example) to the terminal device.
It should be noted that, the service interface abnormality simulation method provided in the embodiment of the present invention is generally executed by the server 605, and accordingly, the service interface abnormality simulation device 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, there is illustrated a schematic diagram of a computer system 700 suitable for use in implementing an embodiment of the present invention. The terminal device shown in fig. 7 is only an example, and should not impose any limitation on the functions and the scope of use of the embodiment 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 according to 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 required for the operation of the system 700 are also stored. The CPU 701, ROM 702, and RAM 703 are connected to each other through a bus 704. An input/output (I/O) service interface 705 is also connected to bus 704.
Connected to the I/O service interface 705 are an input section 706 including a keyboard, a mouse, and the like, an output section 707 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like, 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, and the like. The communication section 709 performs communication processing via a network such as the internet. The 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 therefrom is mounted into the storage section 708 as necessary.
In particular, according to embodiments of the present disclosure, the processes described above with reference to 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 shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 709, and/or installed from the removable medium 711. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 701.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of a 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 context of this document, 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, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. 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, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts 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 involved in the embodiments of the present invention may be implemented in software or in hardware. The described modules may also be provided in a processor, for example, a processor may be described as comprising a sending module, an obtaining module, a determining module and a first processing module. The names of these modules do not in some cases limit the module itself, and for example, the transmitting module may also be described as "a module that transmits a picture acquisition request to a connected server".
As a further aspect, the invention also provides a computer readable medium which may be comprised in the device described in the above embodiments or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include:
Receiving a request for a target service interface sent by a client;
determining a target interception condition corresponding to the target service interface according to the corresponding relation between a preset service interface identifier and the interception condition;
Determining whether the target service interface meets the target interception condition, if so, determining a plurality of pieces of abnormal information corresponding to the target service interface according to the corresponding relation between a preset service interface identifier and the plurality of pieces of abnormal information;
And selecting target abnormal information from a plurality of abnormal information corresponding to the target service interface, and feeding back the target abnormal information 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 embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A service interface anomaly simulation method, comprising:
Receiving a request for a target service interface sent by a client;
determining a target interception condition corresponding to the target service interface according to the corresponding relation between a preset 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 the corresponding relation between a preset service interface identifier and the abnormal information;
and selecting target abnormal information from the abnormal information corresponding to the target service interface, and feeding back the target abnormal information 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 meets the target interception condition includes:
and determining whether the parameter corresponding to the target service interface is greater than or equal to a parameter threshold.
3. The method as recited in claim 1, further comprising:
and if the target service interface does not meet the target interception condition, responding to the request of the target service interface.
4. A method according to any one of claims 1 to 3,
Selecting target abnormal information from the abnormal information corresponding to the target service interface, wherein the method comprises the following steps:
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, comprising:
The method comprises the steps of receiving a request for a target service interface from a service interface abnormality simulation device, determining a target interception condition corresponding to the target service interface by the service interface abnormality simulation device according to the corresponding relation between a preset service interface identifier and the interception condition, determining whether the target service interface meets the target interception condition, and if so, determining abnormality information corresponding to the target service interface according to the corresponding relation between the preset service interface identifier and the abnormality information;
and receiving and responding to the target abnormality information fed back by the service interface abnormality simulation device.
6. A service interface abnormality simulation apparatus, comprising:
The receiving module is configured to receive a request for a target service interface sent by a client;
The system comprises a determining module, a judging module and a judging module, wherein the determining module is configured to determine a target interception condition corresponding to the target service interface according to the corresponding relation between a pre-configured service interface identifier and the interception condition;
and the sending module is configured to select target abnormal information from the abnormal information corresponding to the target service interface and feed back the target abnormal information to the client so that the client responds to the target abnormal information.
7. A client-side, which is provided with a client-side, characterized by comprising the following steps:
The system comprises a service interface abnormality simulation device, a sending module, a target interception condition determining module, a target service interface abnormality simulation device, a target interception condition determining module and a target service interface abnormality simulation module, wherein the service interface abnormality simulation device is used for determining a target interception condition corresponding to the target service interface according to the corresponding relation between a preset service interface identifier and the interception condition;
And the receiving module is configured to receive and respond to the target abnormality information fed back by the service interface abnormality simulation device.
8. A service interface abnormality simulation system comprising the service interface abnormality simulation device according to claim 6 and the client according to claim 7.
9. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
When executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-5.
10. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-5.
CN202010071577.7A 2020-01-21 2020-01-21 A service interface abnormality simulation method, device, system and client Active CN113220559B (en)

Priority Applications (1)

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

Applications Claiming Priority (1)

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

Publications (2)

Publication Number Publication Date
CN113220559A CN113220559A (en) 2021-08-06
CN113220559B true CN113220559B (en) 2025-02-21

Family

ID=77085278

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010071577.7A Active CN113220559B (en) 2020-01-21 2020-01-21 A service interface abnormality simulation method, device, system and client

Country Status (1)

Country Link
CN (1) CN113220559B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103676830A (en) * 2012-09-12 2014-03-26 阿尔斯通技术有限公司 Devices and methods for diagnosis of industrial electronic based products

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3592121B2 (en) * 1999-01-26 2004-11-24 日本電気株式会社 A switching device that identifies only analog terminals and reports errors when an error occurs
CN106875184B (en) * 2016-08-10 2020-07-24 阿里巴巴集团控股有限公司 Abnormal scene simulation method, device and equipment
CN106484592B (en) * 2016-09-28 2020-01-24 北京奇虎科技有限公司 An abnormality detection method and device
CN109298997A (en) * 2018-08-08 2019-02-01 平安科技(深圳)有限公司 Interface test method, system, computer equipment and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103676830A (en) * 2012-09-12 2014-03-26 阿尔斯通技术有限公司 Devices and methods for diagnosis of industrial electronic based products

Also Published As

Publication number Publication date
CN113220559A (en) 2021-08-06

Similar Documents

Publication Publication Date Title
CN110442524B (en) Method and device for testing web service interface with authentication authorization
CN111786939B (en) Method, device and system for testing management platform of Internet of things
CN108933695B (en) Method and apparatus for processing information
CN109218041B (en) Request processing method and device for server system
CN112131095B (en) Pressure testing method and device
CN111831503B (en) Monitoring method based on monitoring agent and monitoring agent device
CN110795328A (en) Interface testing method and device
CN113282489B (en) Interface testing method and device
CN113076153B (en) Interface calling method and device
CN110324384B (en) Data pushing method and device
CN112241357B (en) Method, apparatus, device and computer readable medium for gray scale testing
CN111950232B (en) Method and device for automatically switching number segments
CN113220559B (en) A service interface abnormality simulation method, device, system and client
CN111382953A (en) Dynamic process generation method and device
CN112257039B (en) Identity attribute adding method and device and electronic equipment
CN112306791B (en) Performance monitoring method and device
CN113778847A (en) Test report generation method and device
CN111414566B (en) Method and device for pushing information
CN113360939A (en) Control method and device for security access
CN112559233A (en) Method, device, equipment and computer readable medium for identifying fault type
CN113448652A (en) Request processing method and device
CN113760177A (en) Data reporting method and device
CN110928758B (en) Method and device for generating test cases
CN113934548B (en) A method and device for establishing connection with dependent services
CN113704080B (en) Automatic test 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