[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN111796978B - Interface detection method, device, system, equipment and storage medium - Google Patents

Interface detection method, device, system, equipment and storage medium Download PDF

Info

Publication number
CN111796978B
CN111796978B CN202010610645.2A CN202010610645A CN111796978B CN 111796978 B CN111796978 B CN 111796978B CN 202010610645 A CN202010610645 A CN 202010610645A CN 111796978 B CN111796978 B CN 111796978B
Authority
CN
China
Prior art keywords
interface
detected
target
preset
response
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
CN202010610645.2A
Other languages
Chinese (zh)
Other versions
CN111796978A (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.)
SUZHOU QINYOU NETWORK TECHNOLOGY Co.,Ltd.
Original Assignee
Suzhjou Game Friend Network 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 Suzhjou Game Friend Network Technology Co ltd filed Critical Suzhjou Game Friend Network Technology Co ltd
Priority to CN202010610645.2A priority Critical patent/CN111796978B/en
Publication of CN111796978A publication Critical patent/CN111796978A/en
Application granted granted Critical
Publication of CN111796978B publication Critical patent/CN111796978B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • G06F11/273Tester hardware, i.e. output processing circuits
    • G06F11/2733Test interface between tester and unit under test

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention discloses an interface detection method, device, system, equipment and storage medium. The method comprises the following steps: determining at least one interface to be detected according to preset node interface information; sending an interface detection request to each interface to be detected according to preset interface detection parameters, and acquiring interface response information fed back by each interface to be detected; matching interface detection parameters corresponding to the interface response information with preset interface detection parameters, and determining whether each interface to be detected is an abnormal interface or not according to a parameter matching result; and if at least one interface to be detected is determined to be an abnormal interface, generating alarm information according to a parameter matching result corresponding to the abnormal interface. According to the embodiment of the invention, the interface to be detected can be comprehensively detected according to the interface response information containing the specified response content, the comprehensiveness of the interface detection is improved, and the alarm information can be generated in time according to the parameter matching result corresponding to the abnormal interface.

Description

Interface detection method, device, system, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to an interface detection method, device, system, equipment and storage medium.
Background
Interface testing is a test that tests an interface between components of a system. Each node in the system can interact data with other devices through the interface. If the interface is abnormal, unpredictable results can occur in the system, for example, a data interaction error causes a certain service execution failure, and the like. Therefore, the abnormality of the interface is detected.
In the prior art, generally, a message is sent to an interface to be detected, and the interface can not be detected.
The inventor finds that the prior art only can detect the interface but can not detect the interface, and the content of the detection is less.
Disclosure of Invention
The embodiment of the invention provides an interface detection method, device, system, equipment and storage medium, which are used for optimizing the existing interface detection mode and improving the comprehensiveness of interface detection.
In a first aspect, an embodiment of the present invention provides an interface detection method, including:
determining at least one interface to be detected according to preset node interface information;
sending an interface detection request to each interface to be detected according to preset interface detection parameters, and acquiring interface response information fed back by each interface to be detected;
matching interface detection parameters corresponding to the interface response information with preset interface detection parameters, and determining whether each interface to be detected is an abnormal interface or not according to a parameter matching result;
and if at least one interface to be detected is determined to be an abnormal interface, generating alarm information according to a parameter matching result corresponding to the abnormal interface.
In a second aspect, an embodiment of the present invention further provides an interface detection apparatus, including:
the interface determining module is used for determining at least one interface to be detected according to preset node interface information;
the information acquisition module is used for sending an interface detection request to each interface to be detected according to preset interface detection parameters and acquiring interface response information fed back by each interface to be detected;
the parameter matching module is used for matching the interface detection parameters corresponding to the interface response information with preset interface detection parameters and determining whether each interface to be detected is an abnormal interface or not according to the parameter matching result;
and the information generation module is used for generating alarm information according to a parameter matching result corresponding to the abnormal interface if at least one interface to be detected is determined to be the abnormal interface.
In a third aspect, an embodiment of the present invention further provides an interface detection system, including:
at least one service node, a management node;
each service node is used for determining at least one interface to be detected according to preset node interface information; sending an interface detection request to each interface to be detected according to preset interface detection parameters, and acquiring interface response information fed back by each interface to be detected; matching interface detection parameters corresponding to the interface response information with preset interface detection parameters, and determining whether each interface to be detected is an abnormal interface or not according to a parameter matching result; if at least one interface to be detected is determined to be an abnormal interface, generating alarm information according to a parameter matching result corresponding to the abnormal interface, and sending the alarm information to the management node;
and the management node is used for receiving the alarm information and processing the alarm information.
In a fourth aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the computer program to implement the interface detection method according to the embodiment of the present invention.
In a fifth aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the interface detection method according to the embodiment of the present invention.
The technical scheme of the embodiment of the invention comprises the steps of determining at least one interface to be detected according to preset node interface information, then sending an interface detection request to each interface to be detected according to preset interface detection parameters, acquiring interface response information fed back by each interface to be detected, matching the interface detection parameters corresponding to the interface response information with the preset interface detection parameters, determining whether each interface to be detected is an abnormal interface or not according to parameter matching results, generating alarm information according to the parameter matching results corresponding to the abnormal interfaces when at least one interface to be detected is determined to be an abnormal interface, sending an interface detection request to each interface to be detected according to the preset interface detection parameters, requesting each interface to be detected to feed back interface response information containing specified response content, and sending a parameter matching result between the interface detection parameters corresponding to the interface response information and the preset interface detection parameters, whether each interface to be detected is an abnormal interface or not is determined, so that comprehensive interface detection can be performed on the interface to be detected according to interface response information containing specified response content, the comprehensiveness of interface detection is improved, and when at least one interface to be detected is determined to be an abnormal interface, alarm information can be generated in time according to a parameter matching result corresponding to the abnormal interface.
Drawings
Fig. 1 is a flowchart of an interface detection method according to an embodiment of the present invention.
Fig. 2 is a flowchart of an interface detection method according to a second embodiment of the present invention.
Fig. 3 is a flowchart of an interface detection method according to a third embodiment of the present invention.
Fig. 4 is a schematic structural diagram of an interface detection apparatus according to a fourth embodiment of the present invention.
Fig. 5 is a schematic structural diagram of an interface detection system according to a fifth embodiment of the present invention.
Fig. 6 is a schematic structural diagram of a computer device according to a sixth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention.
It should be further noted that, for the convenience of description, only some but not all of the relevant aspects of the present invention are shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Example one
Fig. 1 is a flowchart of an interface detection method according to an embodiment of the present invention. The embodiment of the present invention is applicable to the interface detection of the interface corresponding to the service node in the system, and the method may be executed by the interface detection apparatus provided in the embodiment of the present invention, and the apparatus may be implemented in a software and/or hardware manner, and may generally be integrated in a computer device. Such as a service node in the system. As shown in fig. 1, the method of the embodiment of the present invention specifically includes:
step 101, determining at least one interface to be detected according to preset node interface information.
Optionally, the host joins the system to become a service node in the system. A service node is a node in the system that performs various specified business tasks. The node interface information includes each interface to be detected corresponding to the service node. The interface to be detected corresponding to the service node may be a plurality of interfaces of a single other host, or may be a plurality of interfaces of a plurality of other hosts.
Optionally, preset node interface information is generated according to the corresponding relationship between the service node and the interface.
Specifically, each interface to be detected corresponding to a service node is determined according to the corresponding relationship between the service node and the interface; and generating preset node interface information corresponding to the service node according to each interface to be detected corresponding to the service node.
Optionally, the service node determines at least one interface to be detected according to preset node interface information, that is, the service node acquires all interfaces corresponding to the service node as the interfaces to be detected according to the preset node interface information, and performs interface detection.
Step 102, according to preset interface detection parameters, sending an interface detection request to each interface to be detected, and acquiring interface response information fed back by each interface to be detected.
Optionally, the interface detection parameter is a parameter related to response content that needs to be verified in the interface response message. The interface detection request is a request for requesting the interface to feed back interface response information containing specified response contents. The interface response information is response information fed back by each interface to be detected according to the interface detection request.
Optionally, the interface detection parameters may include: a status code, a response duration, and a response field.
In one embodiment, the interface detection parameters include: a status code, a response duration, and a response field. And the service node sends an interface detection request to each interface to be detected according to preset interface detection parameters, and requests each interface to be detected to feed back interface response information containing a state code and a response field. The service node acquires interface response information fed back by each interface to be detected, extracts a state code and a response field fed back by each interface to be detected from the interface response information, and determines the response duration of each interface to be detected according to the time difference between the sending time of the interface detection request and the acquisition time of the interface response information.
Optionally, the method further includes: at least one interface detection parameter is preset.
Specifically, a preset status code, a preset response duration and a preset response field corresponding to each interface to be detected are preset.
In a specific example, sending an interface detection request to each interface to be detected according to a preset interface detection parameter may include: and after the interface detection instruction is detected, sending an interface detection request to each interface to be detected in real time according to preset interface detection parameters.
Specifically, after detecting the interface detection instruction, the service node sends an interface detection request to each interface to be detected in real time according to preset interface detection parameters. Therefore, the service node can perform interface detection in real time according to an externally input interface detection instruction.
In another specific example, sending an interface detection request to each interface to be detected according to preset interface detection parameters may include: and sending interface detection requests to the interfaces to be detected at regular time according to preset interface detection parameters.
Specifically, the service node sends an interface detection request to each interface to be detected at regular time according to preset interface detection parameters. Illustratively, the service node sends an interface detection request to each interface to be detected at 0 point every day according to preset interface detection parameters. Thus, the service node can perform interface detection at the designated time node.
In another specific example, sending an interface detection request to each interface to be detected according to preset interface detection parameters may include: and periodically sending an interface detection request to each interface to be detected according to preset interface detection parameters. Illustratively, the service node sends an interface detection request to each interface to be detected every 3 hours according to preset interface detection parameters. Thus, the service node can perform interface detection according to a specified time period.
And 103, matching the interface detection parameters corresponding to the interface response information with preset interface detection parameters, and determining whether each interface to be detected is an abnormal interface according to a parameter matching result.
Optionally, matching the interface detection parameter corresponding to the interface response information with a preset interface detection parameter may include: acquiring one interface to be detected from each interface to be detected as a target interface to be detected; determining a target state code, a target response duration and a target response field corresponding to interface response information fed back by a target interface to be detected; matching the target state code with a preset state code to obtain a first parameter matching result corresponding to the target interface to be detected; matching the target response duration with a preset response duration to obtain a second parameter matching result corresponding to the target interface to be detected; matching the target response field with a preset response field to obtain a third parameter matching result corresponding to the target interface to be detected; and returning to execute the operation of acquiring one interface to be detected from each interface to be detected as the target interface to be detected until the processing of each interface to be detected is completed.
Therefore, for each interface to be detected corresponding to the service node, the interface detection parameters corresponding to the interface response information are matched with the preset interface detection parameters, and a parameter matching result is obtained.
Optionally, determining the target status code, the target response duration, and the target response field corresponding to the interface response information fed back by the target interface to be detected may include: extracting a state code fed back by the target interface to be detected from interface response information fed back by the target interface to be detected as a target state code; extracting a response field fed back by the target interface to be detected from interface response information fed back by the target interface to be detected as a target response field; and taking the time difference between the sending time of the interface detection request and the acquisition time of the interface response information fed back by the target interface to be detected as the target response duration.
Optionally, matching the target status code with a preset status code to obtain a first parameter matching result corresponding to the target to-be-detected interface, where the matching result includes: if the target state code is consistent with the preset state code, determining that a first parameter matching result corresponding to the target interface to be detected is matching; and if the target state code is inconsistent with the preset state code, determining that the first parameter matching result corresponding to the target interface to be detected is not matched.
Optionally, matching the target response duration with a preset response duration to obtain a second parameter matching result corresponding to the target to-be-detected interface, where the matching result includes: if the time difference between the target response time length and the preset response time length is within the preset difference range, determining that a second parameter matching result corresponding to the target interface to be detected is matching; and if the time difference between the target response time length and the preset response time length is not within the preset difference range, the second parameter matching result corresponding to the target interface to be detected is mismatching. The preset difference range can be set according to the service requirement.
Optionally, matching the target response field with a preset response field to obtain a third parameter matching result corresponding to the target interface to be detected, where the third parameter matching result includes: if the target response field is consistent with the preset response field, determining that a third parameter matching result corresponding to the target interface to be detected is matching; and if the target response field is inconsistent with the preset response field, determining that the third parameter matching result corresponding to the target interface to be detected is not matched.
Optionally, determining whether each interface to be detected is an abnormal interface according to the parameter matching result may include: if any one of the first parameter matching result, the second parameter matching result and the third parameter matching result corresponding to the target interface to be detected is not matched, determining that the target interface to be detected is an abnormal interface; and if the first parameter matching result, the second parameter matching result and the third parameter matching result corresponding to the target interface to be detected are all matched, determining that the target interface to be detected is a normal interface.
Therefore, for each interface to be detected corresponding to the service node, the interface to be detected is determined to be a normal interface or an abnormal interface according to the parameter matching result.
And 104, if at least one interface to be detected is determined to be an abnormal interface, generating alarm information according to a parameter matching result corresponding to the abnormal interface.
Optionally, if the service node determines that at least one interface to be detected in all corresponding interfaces to be detected is an abnormal interface, alarm information is generated according to a parameter matching result corresponding to the abnormal interface.
Optionally, generating alarm information according to a parameter matching result corresponding to the abnormal interface, which may include: determining an abnormal interface and an abnormal interface detection parameter corresponding to the abnormal interface according to a parameter matching result corresponding to the abnormal interface; and generating alarm information according to the abnormal interface and the abnormal interface detection parameters corresponding to the abnormal interface.
The abnormal interface detection parameter is an interface detection parameter which fails in matching.
Optionally, the service node determines, according to a parameter matching result corresponding to the abnormal interface, an abnormal interface in all corresponding interfaces to be detected and an abnormal interface detection parameter corresponding to the abnormal interface, and uses the abnormal interface and the abnormal interface detection parameter corresponding to the abnormal interface as alarm information.
Optionally, the method further includes: and sending the alarm information to a management node.
The management node is a node for managing each service node in the system. The management node may be a server or a host. And the service node sends the alarm information to the management node so that the management node processes the alarm information.
Optionally, the management node may display the alarm information through a display device, so that a manager takes measures to process the abnormal interface according to the displayed alarm information. The display device may be a display screen.
Optionally, the management node may send the alarm information to a mailbox of an administrator, so that the administrator takes measures to process the abnormal interface according to the alarm information.
Optionally, the administrator may position the interface with the abnormality according to the alarm information, and may analyze the reason for the abnormality of the interface according to the abnormal interface detection parameter corresponding to the abnormal interface.
Optionally, if it is determined that the interface to be detected does not exist as the abnormal interface, it is determined that all the interfaces to be detected corresponding to the service node are detected through the interfaces, and an alarm is not required.
The embodiment of the invention provides an interface detection method, which comprises the steps of determining at least one interface to be detected according to preset node interface information, then sending an interface detection request to each interface to be detected according to preset interface detection parameters, acquiring interface response information fed back by each interface to be detected, matching the interface detection parameters corresponding to the interface response information with the preset interface detection parameters, determining whether each interface to be detected is an abnormal interface or not according to a parameter matching result, generating alarm information according to the parameter matching result corresponding to the abnormal interface when at least one interface to be detected is determined to be the abnormal interface, sending the interface detection request to each interface to be detected according to the preset interface detection parameters, requesting each interface to be detected to feed back interface response information containing specified response content, and according to the parameter matching result between the interface detection parameters corresponding to the interface response information and the preset interface detection parameters, whether each interface to be detected is an abnormal interface or not is determined, so that comprehensive interface detection can be performed on the interface to be detected according to interface response information containing specified response content, the comprehensiveness of interface detection is improved, and when at least one interface to be detected is determined to be an abnormal interface, alarm information can be generated in time according to a parameter matching result corresponding to the abnormal interface.
Example two
Fig. 2 is a flowchart of an interface detection method according to a second embodiment of the present invention. The embodiment of the present invention may be combined with various alternatives in one or more of the above embodiments, and in the embodiment of the present invention, the method may further include: at least one interface detection parameter is preset.
And sending an interface detection request to each interface to be detected according to the preset interface detection parameters, which may include: and after the interface detection instruction is detected, sending an interface detection request to each interface to be detected in real time according to preset interface detection parameters.
As shown in fig. 2, the method of the embodiment of the present invention specifically includes:
step 201, at least one interface detection parameter is preset.
Optionally, the interface detection parameters may include: a status code, a response duration, and a response field.
Optionally, preset status codes, preset response durations and preset response fields corresponding to the interfaces to be detected are preset.
Step 202, determining at least one interface to be detected according to preset node interface information.
Step 203, after the interface detection instruction is detected, according to the preset interface detection parameters, sending an interface detection request to each interface to be detected in real time.
Optionally, after detecting the interface detection instruction, the service node sends an interface detection request to each interface to be detected in real time according to preset interface detection parameters. Therefore, the service node can perform interface detection in real time according to an externally input interface detection instruction.
And 204, matching the interface detection parameters corresponding to the interface response information with preset interface detection parameters, and determining whether each interface to be detected is an abnormal interface according to a parameter matching result.
And step 205, if at least one interface to be detected is determined to be an abnormal interface, generating alarm information according to a parameter matching result corresponding to the abnormal interface.
The embodiment of the invention provides an interface detection method, which comprises the steps of presetting at least one interface detection parameter, determining at least one interface to be detected according to preset node interface information, sending an interface detection request to each interface to be detected in real time according to the preset interface detection parameter after an interface detection instruction is detected, and sending the interface detection request to each interface to be detected in real time according to an externally input interface detection instruction and the preset at least one interface detection parameter to perform interface detection.
EXAMPLE III
Fig. 3 is a flowchart of an interface detection method according to a third embodiment of the present invention. In this embodiment of the present invention, the combination of the above options in one or more embodiments may be combined, where the generating of the alarm information according to the parameter matching result corresponding to the abnormal interface in the embodiment of the present invention may include: determining an abnormal interface and an abnormal interface detection parameter corresponding to the abnormal interface according to a parameter matching result corresponding to the abnormal interface; and generating alarm information according to the abnormal interface and the abnormal interface detection parameters corresponding to the abnormal interface.
And, the interface detection method may further include: and sending the alarm information to a management node.
As shown in fig. 3, the method of the embodiment of the present invention specifically includes:
step 301, determining at least one interface to be detected according to preset node interface information.
Step 302, according to preset interface detection parameters, sending an interface detection request to each interface to be detected, and acquiring interface response information fed back by each interface to be detected.
And 303, matching the interface detection parameters corresponding to the interface response information with preset interface detection parameters, and determining whether each interface to be detected is an abnormal interface according to a parameter matching result.
And 304, if at least one interface to be detected is determined to be an abnormal interface, determining the abnormal interface and the abnormal interface detection parameters corresponding to the abnormal interface according to the parameter matching result corresponding to the abnormal interface.
The abnormal interface detection parameter is an interface detection parameter which fails in matching.
And 305, generating alarm information according to the abnormal interface and the abnormal interface detection parameters corresponding to the abnormal interface.
Optionally, the service node determines, according to a parameter matching result corresponding to the abnormal interface, an abnormal interface in all corresponding interfaces to be detected and an abnormal interface detection parameter corresponding to the abnormal interface, and uses the abnormal interface and the abnormal interface detection parameter corresponding to the abnormal interface as alarm information.
And step 306, sending the alarm information to a management node.
The management node is a node for managing each service node in the system. The management node may be a server or a host. And the service node sends the alarm information to the management node so that the management node processes the alarm information.
Optionally, the management node may display the alarm information through a display device, so that a manager takes measures to process the abnormal interface according to the displayed alarm information. The display device may be a display screen.
Optionally, the management node may send the alarm information to a mailbox of an administrator, so that the administrator takes measures to process the abnormal interface according to the alarm information.
Optionally, the administrator may position the interface with the abnormality according to the alarm information, and may analyze the reason for the abnormality of the interface according to the abnormal interface detection parameter corresponding to the abnormal interface.
The embodiment of the invention provides an interface detection method, which comprises the steps of determining an abnormal interface and abnormal interface detection parameters corresponding to the abnormal interface according to a parameter matching result corresponding to the abnormal interface, generating alarm information according to the abnormal interface and the abnormal interface detection parameters corresponding to the abnormal interface, and sending the alarm information to a management node.
Example four
Fig. 4 is a schematic structural diagram of an interface detection apparatus according to a fourth embodiment of the present invention, as shown in fig. 4, the apparatus includes: an interface determination module 401, an information acquisition module 402, a parameter matching module 403, and an information generation module 404.
The interface determining module 401 is configured to determine at least one interface to be detected according to preset node interface information; the information acquisition module 402 is configured to send an interface detection request to each interface to be detected according to preset interface detection parameters, and acquire interface response information fed back by each interface to be detected; the parameter matching module 403 is configured to match interface detection parameters corresponding to the interface response information with preset interface detection parameters, and determine whether each interface to be detected is an abnormal interface according to a parameter matching result; and an information generating module 404, configured to generate alarm information according to a parameter matching result corresponding to the abnormal interface if it is determined that at least one interface to be detected is the abnormal interface.
The embodiment of the invention provides an interface detection device, which determines at least one interface to be detected according to preset node interface information, then sends an interface detection request to each interface to be detected according to preset interface detection parameters, acquires interface response information fed back by each interface to be detected, matches the interface detection parameters corresponding to the interface response information with the preset interface detection parameters, determines whether each interface to be detected is an abnormal interface according to a parameter matching result, generates alarm information according to the parameter matching result corresponding to the abnormal interface when at least one interface to be detected is determined to be the abnormal interface, sends the interface detection request to each interface to be detected according to the preset interface detection parameters, requests each interface to be detected to feed back interface response information containing specified response content, and sends a parameter matching result between the interface detection parameters corresponding to the interface response information and the preset interface detection parameters, whether each interface to be detected is an abnormal interface or not is determined, so that comprehensive interface detection can be performed on the interface to be detected according to interface response information containing specified response content, the comprehensiveness of interface detection is improved, and when at least one interface to be detected is determined to be an abnormal interface, alarm information can be generated in time according to a parameter matching result corresponding to the abnormal interface.
On the basis of the foregoing embodiments, the interface detection apparatus may further include: and the parameter setting module is used for presetting at least one interface detection parameter.
On the basis of the foregoing embodiments, the interface detection parameters may include: a status code, a response duration, and a response field.
On the basis of the foregoing embodiments, the information obtaining module 402 may include: and the first request sending unit is used for sending an interface detection request to each interface to be detected in real time according to preset interface detection parameters after detecting the interface detection instruction.
On the basis of the foregoing embodiments, the information obtaining module 402 may include: and the second request sending unit is used for sending interface detection requests to each interface to be detected at regular time according to preset interface detection parameters.
On the basis of the foregoing embodiments, the information obtaining module 402 may include: and the second request sending unit is used for periodically sending the interface detection request to each interface to be detected according to the preset interface detection parameters.
On the basis of the foregoing embodiments, the parameter matching module 403 may include: the interface acquisition unit is used for acquiring one interface to be detected from each interface to be detected as a target interface to be detected; the parameter determining unit is used for determining a target state code, a target response duration and a target response field corresponding to interface response information fed back by a target interface to be detected; the first matching unit is used for matching the target state code with a preset state code to obtain a first parameter matching result corresponding to the target interface to be detected; the second matching unit is used for matching the target response duration with the preset response duration to obtain a second parameter matching result corresponding to the target interface to be detected; the third matching unit is used for matching the target response field with a preset response field to obtain a third parameter matching result corresponding to the target interface to be detected; and the operation returning unit is used for returning and executing the operation of acquiring each interface to be detected as the target interface to be detected in each interface to be detected until the processing of each interface to be detected is completed.
On the basis of the foregoing embodiments, the parameter matching module 403 may include: the first interface determining unit is used for determining that the target interface to be detected is an abnormal interface if any one of a first parameter matching result, a second parameter matching result and a third parameter matching result corresponding to the target interface to be detected is not matched; and the second interface determining unit is used for determining that the target interface to be detected is a normal interface if the first parameter matching result, the second parameter matching result and the third parameter matching result corresponding to the target interface to be detected are all matching.
On the basis of the foregoing embodiments, the information generating module 404 may include: the parameter determining unit is used for determining the abnormal interface and the abnormal interface detection parameter corresponding to the abnormal interface according to the parameter matching result corresponding to the abnormal interface; and the information generation unit is used for generating alarm information according to the abnormal interface and the abnormal interface detection parameters corresponding to the abnormal interface.
On the basis of the foregoing embodiments, the interface detection apparatus may further include: and the information sending module is used for sending the alarm information to the management node.
On the basis of the foregoing embodiments, the interface detection apparatus may further include: and the interface information generation module is used for generating preset node interface information according to the corresponding relation between the service node and the interface.
The interface detection device can execute the interface detection method provided by any embodiment of the invention, and has the corresponding functional module and beneficial effect of executing the interface detection method.
EXAMPLE five
Fig. 5 is a schematic structural diagram of an interface detection system according to a fifth embodiment of the present invention. As shown in fig. 5, the system specifically includes: at least one service node 501, a management node 502.
Each service node 501 is configured to determine at least one interface to be detected according to preset node interface information; sending an interface detection request to each interface to be detected according to preset interface detection parameters, and acquiring interface response information fed back by each interface to be detected; matching interface detection parameters corresponding to the interface response information with preset interface detection parameters, and determining whether each interface to be detected is an abnormal interface or not according to a parameter matching result; and if at least one interface to be detected is determined to be an abnormal interface, generating alarm information according to a parameter matching result corresponding to the abnormal interface, and sending the alarm information to the management node.
And the management node 502 is configured to receive the alarm information and process the alarm information.
Specifically, each service node 501 determines at least one interface to be detected according to preset node interface information. Each service node 501 sends an interface detection request to each interface to be detected according to preset interface detection parameters, and obtains interface response information fed back by each interface to be detected. Each service node 501 matches the interface detection parameters corresponding to the interface response information with preset interface detection parameters, and determines whether each interface to be detected is an abnormal interface according to a parameter matching result. If each service node 501 determines that at least one interface to be detected is an abnormal interface, alarm information is generated according to a parameter matching result corresponding to the abnormal interface, and the alarm information is sent to the management node. The management node 502 receives the alarm information and processes the alarm information.
Optionally, the management node 502 may display the alarm information through a display device, so that a manager takes measures to process the abnormal interface according to the displayed alarm information. The display device may be a display screen.
Optionally, the management node 502 may send the alarm information to a mailbox of an administrator, so that the administrator takes measures to process the abnormal interface according to the alarm information.
Optionally, the administrator may position the interface with the abnormality according to the alarm information, and may analyze the reason for the abnormality of the interface according to the abnormal interface detection parameter corresponding to the abnormal interface.
The embodiment of the invention provides an interface detection system, which is characterized in that at least one interface to be detected is determined by each service node according to preset node interface information; each service node sends an interface detection request to each interface to be detected according to preset interface detection parameters and acquires interface response information fed back by each interface to be detected; each service node matches the interface detection parameters corresponding to the interface response information with preset interface detection parameters, and determines whether each interface to be detected is an abnormal interface or not according to the parameter matching result; if each service node determines that at least one interface to be detected is an abnormal interface, generating alarm information according to a parameter matching result corresponding to the abnormal interface, and sending the alarm information to a management node; the management node receives and processes the alarm information, can execute interface detection on a plurality of service nodes, can send an interface detection request to each interface to be detected according to preset interface detection parameters aiming at each service node, requests each interface to be detected to feed back interface response information containing specified response content, and determines whether each interface to be detected is an abnormal interface according to a parameter matching result between the interface detection parameters corresponding to the interface response information and the preset interface detection parameters, so that the comprehensive interface detection can be performed on the interfaces to be detected according to the interface response information containing the specified response content, the comprehensiveness of the interface detection is improved, and the alarm information is generated and sent to the management node according to the parameter matching result corresponding to the abnormal interface when the service node determines that at least one interface to be detected is the abnormal interface, so that the management node processes the alarm information, and thus processes the abnormal interface by taking measures.
EXAMPLE six
Fig. 6 is a schematic structural diagram of a computer device according to a sixth embodiment of the present invention. FIG. 6 illustrates a block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention. The computer device 12 shown in FIG. 6 is only an example and should not bring any limitations to the functionality or scope of use of embodiments of the present invention.
As shown in FIG. 6, computer device 12 is in the form of a general purpose computing device. The components of computer device 12 may include, but are not limited to: one or more processors 16, a memory 28, and a bus 18 that connects the various system components (including the memory 28 and the processors 16).
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. Computer device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, and commonly referred to as a "hard drive"). Although not shown in FIG. 6, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with computer device 12, and/or with any devices (e.g., network card, modem, etc.) that enable computer device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, computer device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with the other modules of computer device 12 via bus 18. It should be appreciated that although not shown in FIG. 6, other hardware and/or software modules may be used in conjunction with computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processor 16 executes various functional applications and data processing by running the program stored in the memory 28, thereby implementing the interface detection method provided by the embodiment of the present invention: determining at least one interface to be detected according to preset node interface information; sending an interface detection request to each interface to be detected according to preset interface detection parameters, and acquiring interface response information fed back by each interface to be detected; matching interface detection parameters corresponding to the interface response information with preset interface detection parameters, and determining whether each interface to be detected is an abnormal interface or not according to a parameter matching result; and if at least one interface to be detected is determined to be an abnormal interface, generating alarm information according to a parameter matching result corresponding to the abnormal interface.
EXAMPLE seven
The seventh embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where when the computer program is executed by a processor, the method for detecting an interface provided in the seventh embodiment of the present invention is implemented: determining at least one interface to be detected according to preset node interface information; sending an interface detection request to each interface to be detected according to preset interface detection parameters, and acquiring interface response information fed back by each interface to be detected; matching interface detection parameters corresponding to the interface response information with preset interface detection parameters, and determining whether each interface to be detected is an abnormal interface or not according to a parameter matching result; and if at least one interface to be detected is determined to be an abnormal interface, generating alarm information according to a parameter matching result corresponding to the abnormal interface.
Any combination of one or more computer-readable media may be employed. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. 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 (a non-exhaustive list) of the computer readable storage medium would include the following: 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.
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 any of a variety of 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, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or computer device. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (13)

1. An interface detection method, comprising:
determining at least one interface to be detected according to preset node interface information;
sending an interface detection request to each interface to be detected according to preset interface detection parameters, and acquiring interface response information fed back by each interface to be detected;
matching interface detection parameters corresponding to the interface response information with preset interface detection parameters, and determining whether each interface to be detected is an abnormal interface or not according to a parameter matching result;
if at least one interface to be detected is determined to be an abnormal interface, generating alarm information according to a parameter matching result corresponding to the abnormal interface;
the interface detection parameters include: a status code, a response duration and a response field;
the matching of the interface detection parameters corresponding to the interface response information with preset interface detection parameters includes:
acquiring one interface to be detected from each interface to be detected as a target interface to be detected;
determining a target state code, a target response duration and a target response field corresponding to interface response information fed back by the target interface to be detected;
matching the target state code with a preset state code to obtain a first parameter matching result corresponding to the target interface to be detected;
matching the target response duration with a preset response duration to obtain a second parameter matching result corresponding to the target interface to be detected;
matching the target response field with a preset response field to obtain a third parameter matching result corresponding to the target interface to be detected;
returning to execute the operation of acquiring each interface to be detected as a target interface to be detected in each interface to be detected until the processing of each interface to be detected is completed;
determining a target state code, a target response duration and a target response field corresponding to interface response information fed back by a target interface to be detected, including:
extracting a state code fed back by the target interface to be detected from interface response information fed back by the target interface to be detected as a target state code;
extracting a response field fed back by the target interface to be detected from interface response information fed back by the target interface to be detected as a target response field;
and taking the time difference between the sending time of the interface detection request and the acquisition time of the interface response information fed back by the target interface to be detected as the target response duration.
2. The method of claim 1, further comprising:
at least one interface detection parameter is preset.
3. The method according to claim 1, wherein the sending an interface detection request to each of the interfaces to be detected according to a preset interface detection parameter includes:
and after the interface detection instruction is detected, sending an interface detection request to each interface to be detected in real time according to preset interface detection parameters.
4. The method according to claim 1, wherein the sending an interface detection request to each of the interfaces to be detected according to a preset interface detection parameter includes:
and sending an interface detection request to each interface to be detected at regular time according to preset interface detection parameters.
5. The method according to claim 1, wherein the sending an interface detection request to each of the interfaces to be detected according to a preset interface detection parameter includes:
and periodically sending an interface detection request to each interface to be detected according to preset interface detection parameters.
6. The method according to claim 1, wherein the determining whether each of the interfaces to be detected is an abnormal interface according to the parameter matching result includes:
if any one of the first parameter matching result, the second parameter matching result and the third parameter matching result corresponding to the target interface to be detected is not matched, determining that the target interface to be detected is an abnormal interface;
and if the first parameter matching result, the second parameter matching result and the third parameter matching result corresponding to the target interface to be detected are all matched, determining that the target interface to be detected is a normal interface.
7. The method according to claim 1, wherein the generating alarm information according to the parameter matching result corresponding to the abnormal interface comprises:
determining an abnormal interface and an abnormal interface detection parameter corresponding to the abnormal interface according to a parameter matching result corresponding to the abnormal interface;
and generating alarm information according to the abnormal interface and the abnormal interface detection parameters corresponding to the abnormal interface.
8. The method of claim 1, further comprising:
and sending the alarm information to a management node.
9. The method of claim 1, further comprising:
and generating preset node interface information according to the corresponding relation between the service node and the interface.
10. An interface detection apparatus, comprising:
the interface determining module is used for determining at least one interface to be detected according to preset node interface information;
the information acquisition module is used for sending an interface detection request to each interface to be detected according to preset interface detection parameters and acquiring interface response information fed back by each interface to be detected;
the parameter matching module is used for matching the interface detection parameters corresponding to the interface response information with preset interface detection parameters and determining whether each interface to be detected is an abnormal interface or not according to a parameter matching result;
the information generating module is used for generating alarm information according to a parameter matching result corresponding to the abnormal interface if at least one interface to be detected is determined to be the abnormal interface;
the interface detection parameters include: a status code, a response duration and a response field;
the parameter matching module comprises:
the interface acquisition unit is used for acquiring one interface to be detected from each interface to be detected as a target interface to be detected;
the parameter determining unit is used for determining a target state code, a target response duration and a target response field corresponding to interface response information fed back by a target interface to be detected;
the first matching unit is used for matching the target state code with a preset state code to obtain a first parameter matching result corresponding to the target interface to be detected;
the second matching unit is used for matching the target response duration with the preset response duration to obtain a second parameter matching result corresponding to the target interface to be detected;
the third matching unit is used for matching the target response field with a preset response field to obtain a third parameter matching result corresponding to the target interface to be detected;
the operation returning unit is used for returning and executing the operation of acquiring each interface to be detected as the target interface to be detected in each interface to be detected until the processing of each interface to be detected is completed;
a parameter determining unit, specifically configured to:
extracting a state code fed back by the target interface to be detected from interface response information fed back by the target interface to be detected as a target state code;
extracting a response field fed back by the target interface to be detected from interface response information fed back by the target interface to be detected as a target response field;
and taking the time difference between the sending time of the interface detection request and the acquisition time of the interface response information fed back by the target interface to be detected as the target response duration.
11. An interface detection system, comprising:
at least one service node, a management node;
each service node is used for determining at least one interface to be detected according to preset node interface information; sending an interface detection request to each interface to be detected according to preset interface detection parameters, and acquiring interface response information fed back by each interface to be detected; matching interface detection parameters corresponding to the interface response information with preset interface detection parameters, and determining whether each interface to be detected is an abnormal interface or not according to a parameter matching result; if at least one interface to be detected is determined to be an abnormal interface, generating alarm information according to a parameter matching result corresponding to the abnormal interface, and sending the alarm information to the management node;
the interface detection parameters include: a status code, a response duration and a response field;
each service node is further configured to obtain one interface to be detected from each interface to be detected as a target interface to be detected; determining a target state code, a target response duration and a target response field corresponding to interface response information fed back by the target interface to be detected; matching the target state code with a preset state code to obtain a first parameter matching result corresponding to the target interface to be detected; matching the target response duration with a preset response duration to obtain a second parameter matching result corresponding to the target interface to be detected; matching the target response field with a preset response field to obtain a third parameter matching result corresponding to the target interface to be detected; returning to execute the operation of acquiring each interface to be detected as a target interface to be detected in each interface to be detected until the processing of each interface to be detected is completed;
each service node is also used for extracting a state code fed back by the target interface to be detected from the interface response information fed back by the target interface to be detected as a target state code;
extracting a response field fed back by the target interface to be detected from interface response information fed back by the target interface to be detected as a target response field;
according to the time difference between the sending time of the interface detection request and the acquisition time of the interface response information fed back by the target interface to be detected, the time difference is used as the target response duration;
and the management node is used for receiving the alarm information and processing the alarm information.
12. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the interface detection method according to any of claims 1-9 when executing the computer program.
13. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the interface detection method according to any one of claims 1 to 9.
CN202010610645.2A 2020-06-29 2020-06-29 Interface detection method, device, system, equipment and storage medium Active CN111796978B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010610645.2A CN111796978B (en) 2020-06-29 2020-06-29 Interface detection method, device, system, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010610645.2A CN111796978B (en) 2020-06-29 2020-06-29 Interface detection method, device, system, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111796978A CN111796978A (en) 2020-10-20
CN111796978B true CN111796978B (en) 2021-06-29

Family

ID=72810869

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010610645.2A Active CN111796978B (en) 2020-06-29 2020-06-29 Interface detection method, device, system, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111796978B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115333920B (en) * 2022-08-12 2024-04-23 北京天融信网络安全技术有限公司 Alarm test method, alarm test device, electronic equipment and computer readable storage medium
CN115941546B (en) * 2022-11-29 2024-06-14 重庆长安汽车股份有限公司 Monitoring method and device of system interface, electronic equipment and storage medium
CN117389725A (en) * 2023-10-12 2024-01-12 中科驭数(北京)科技有限公司 Service data node migration method and device, electronic equipment and storage medium
CN117493487B (en) * 2023-11-10 2024-08-27 南方电网数字电网集团信息通信科技有限公司 Abnormality detection method and device for response content, electronic equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106708676B (en) * 2016-12-01 2020-12-04 广州酷狗计算机科技有限公司 Interface test method and device
CN109298997A (en) * 2018-08-08 2019-02-01 平安科技(深圳)有限公司 Interface test method, system, computer equipment and storage medium
CN109491894B (en) * 2018-10-25 2022-01-14 深圳壹账通智能科技有限公司 Interface test method and equipment

Also Published As

Publication number Publication date
CN111796978A (en) 2020-10-20

Similar Documents

Publication Publication Date Title
CN111796978B (en) Interface detection method, device, system, equipment and storage medium
CN110795325B (en) Visual point burying method, device, equipment and storage medium
US11509505B2 (en) Method and apparatus for operating smart network interface card
US11119843B2 (en) Verifying application behavior based on distributed tracing
CN111291330A (en) SVN authority management method, SVN authority management device, computer equipment and storage medium
CN111818145B (en) File transmission method, device, system, equipment and storage medium
CN107817962B (en) Remote control method, device, control server and storage medium
CN110677307B (en) Service monitoring method, device, equipment and storage medium
CN111694684B (en) Abnormal construction method and device of storage device, electronic device and storage medium
CN109086097B (en) Method and device for starting small program, server and storage medium
CN112818204B (en) Service processing method, device, equipment and storage medium
CN113656301A (en) Interface testing method, device, equipment and storage medium
CN112084114B (en) Method and apparatus for testing interfaces
CN108399128A (en) A kind of generation method of user data, device, server and storage medium
CN110532203B (en) NAND reset method, device, electronic equipment and storage medium
CN113362173A (en) Anti-duplication mechanism verification method, anti-duplication mechanism verification system, electronic equipment and storage medium
CN110958243A (en) Network vulnerability submitting method and device, storage medium and electronic equipment
CN112069158A (en) Data restoration method, device, equipment and storage medium
CN114553663B (en) Abnormality detection method, abnormality detection device, abnormality detection equipment and storage medium
CN111741046B (en) Data reporting method, data acquisition method, device, equipment and medium
CN109189332A (en) A kind of disk hanging method, device, server and storage medium
CN110365763B (en) Data synchronization method, device, equipment and storage medium
CN111262727B (en) Service capacity expansion method, device, equipment and storage medium
CN110602162B (en) Terminal evidence obtaining method, device, equipment and storage medium
CN113467941A (en) Method and device for sharing information

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20211015

Address after: 215000 12F, friendship time building, No. 68, Qitai Road, Suzhou Industrial Park, Suzhou area, China (Jiangsu) pilot Free Trade Zone, Suzhou, Jiangsu

Patentee after: SUZHOU QINYOU NETWORK TECHNOLOGY Co.,Ltd.

Address before: 215006 building 22, Suhua science and Technology Park, 208 Tongyuan Road, Suzhou Industrial Park, Suzhou City, Jiangsu Province

Patentee before: SUZHJOU GAME FRIEND NETWORK TECHNOLOGY Co.,Ltd.