CN111506507A - Business service state detection method and device, electronic equipment and storage medium - Google Patents
Business service state detection method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN111506507A CN111506507A CN202010296395.XA CN202010296395A CN111506507A CN 111506507 A CN111506507 A CN 111506507A CN 202010296395 A CN202010296395 A CN 202010296395A CN 111506507 A CN111506507 A CN 111506507A
- Authority
- CN
- China
- Prior art keywords
- service
- business service
- target
- target business
- response message
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 144
- 238000012360 testing method Methods 0.000 claims abstract description 124
- 238000000034 method Methods 0.000 claims abstract description 37
- 230000004044 response Effects 0.000 claims description 129
- 230000006870 function Effects 0.000 claims description 18
- 238000012545 processing Methods 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 9
- 238000004458 analytical method Methods 0.000 claims description 2
- 230000001960 triggered effect Effects 0.000 abstract 1
- 238000011990 functional testing Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 238000007726 management method Methods 0.000 description 4
- 230000008439 repair process Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 238000013024 troubleshooting Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/547—Remote procedure calls [RPC]; Web services
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The present specification provides a method and an apparatus for detecting a state of a service, an electronic device, and a storage medium, where the method includes: acquiring a test request parameter aiming at a target business service, wherein the test request parameter is used for triggering and calling the target business service to perform a function test on the target business service; generating a state detection rule aiming at the target business service according to the test request parameter; and responding to a state detection request aiming at the target business service, calling the target business service according to the state detection rule, and determining the state of the target business service according to the calling result. Therefore, the state detection of the business service can be automatically triggered, and the timeliness and the accuracy are higher.
Description
Technical Field
The present disclosure relates to the field of service detection technologies, and in particular, to a method and an apparatus for detecting a status of a service, an electronic device, and a storage medium.
Background
The API (application program interface) gateway is the only entry for the entire business service, and therefore its position is extremely important. With the development of the technology, the API gateway starts to gradually switch from the early-stage fast traffic forwarding to the fine management of the business service, including the full life cycle management and the availability detection of the business service, and needs to give an alarm in time when detecting that the business service is unavailable, so that the test developer can repair the business service in time after receiving the alarm. In the service availability detection process, accuracy and timeliness are crucial.
The current API gateway generally has two schemes for detecting the state of the service: detecting reachability of service ports, detecting fixed service addresses. The detection results of the two schemes cannot truly reflect the availability of the business service, the state of the business service cannot be accurately determined, and the detection rules are manually configured by a user, so that the process is complicated.
Disclosure of Invention
In order to overcome the problems in the related art, the present specification provides a method and an apparatus for detecting a status of a business service, an electronic device, and a storage medium.
According to a first aspect of the embodiments of the present specification, there is provided a method for detecting a state of a business service, which is applied to an API gateway, the method for detecting a state includes:
acquiring a test request parameter aiming at a target business service, wherein the test request parameter is used for triggering and calling the target business service to perform a function test on the target business service;
generating a state detection rule aiming at the target business service according to the test request parameter;
and responding to a state detection request aiming at the target business service, calling the target business service according to the state detection rule, and determining the state of the target business service according to the calling result.
Optionally, the invoking the target service according to the state detection rule, and determining the state of the target service according to an invoking result includes:
if the calling result is that a response message returned by the target business service is received and the format of the response message is the same as the standard response format corresponding to the target business service, determining that the target business service is in an available state;
and if the calling result is that the response message is not received or the format of the response message is different from the standard response format, determining that the target business service is in an unavailable state.
Optionally, the state detection method further includes:
if the service request result is a response message returned by the target service and the format of the response message is the same as the standard response format corresponding to the target service, determining that the target service is in an available state, wherein the service request result is a result of calling the target service according to a service processing request sent by a user;
and if the service request result is that the response message is not received or the format of the response message is different from the standard response format, determining that the target service is in an unavailable state.
Optionally, generating a state detection rule for the target service according to the test request parameter, further comprising:
obtaining a test result of the function test;
and under the condition that the test result is that a response message returned by the target business service is received and the format of the response message is the same as the standard response format corresponding to the target business service, generating a state detection rule aiming at the target business service according to the test request parameter.
Optionally, the state detection method further includes:
and issuing the target business service under the condition that the test result is that a response message returned by the target business service is received and the format of the response message is the same as the standard response format corresponding to the target business service.
Optionally, the state detection method further includes:
and acquiring a registration document generated when the target business service is registered on the API gateway, wherein the registration document defines a standard response format of the target business service.
According to a second aspect of the embodiments of the present specification, there is provided a status detection apparatus for a business service, which is applied to an API gateway, the status detection apparatus including:
the system comprises a parameter acquisition module, a parameter acquisition module and a parameter analysis module, wherein the parameter acquisition module is used for acquiring a test request parameter aiming at a target business service, and the test request parameter is used for triggering and calling the target business service to perform function test on the target business service;
the generating module is used for generating a state detection rule aiming at the target business service according to the test request parameter;
and the state detection module is used for responding to a state detection request aiming at the target business service, calling the target business service according to the state detection rule and determining the state of the target business service according to the calling result.
Optionally, when the target service is called according to the state detection rule and the state of the target service is determined according to the calling result, the state detection module is configured to:
if the calling result is that a response message returned by the target business service is received and the format of the response message is the same as the standard response format corresponding to the target business service, determining that the target business service is in an available state;
and if the calling result is that the response message is not received or the format of the response message is different from the standard response format, determining that the target business service is in an unavailable state.
Optionally, the state detection module is further configured to:
if the service request result is a response message returned by the target service and the format of the response message is the same as the standard response format corresponding to the target service, determining that the target service is in an available state, wherein the service request result is a result of calling the target service according to a service processing request sent by a user;
and if the service request result is that the response message is not received or the format of the response message is different from the standard response format, determining that the target service is in an unavailable state.
Optionally, the generating module is specifically configured to:
obtaining a test result of the function test;
and under the condition that the test result is that a response message returned by the target business service is received and the format of the response message is the same as the standard response format corresponding to the target business service, generating a state detection rule aiming at the target business service according to the test request parameter.
Optionally, the state detection apparatus further includes:
and the issuing module is used for issuing the target business service under the condition that the test result is that a response message returned by the target business service is received and the format of the response message is the same as the standard response format corresponding to the target business service.
Optionally, the state detection apparatus further includes:
and the document acquisition module is used for acquiring a registration document generated when the target business service is registered on the API gateway, wherein the registration document defines a standard response format of the target business service.
According to a third aspect of the embodiments of the present specification, there is provided an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the method for detecting the state of the business service according to any one of the above items when executing the computer program.
According to a fourth aspect of embodiments herein, there is provided a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps of the method for detecting a status of a business service of any one of the above.
The technical scheme provided by the embodiment of the specification can have the following beneficial effects:
in the embodiment of the description, the state detection rule for performing state detection on the business service is generated by means of the test request parameter adopted in the process of testing the business service, so that the detection rule does not need to be manually configured, the real business service call is simulated according to the state detection rule to perform state detection on the business service, and the timeliness and the accuracy of the state detection are improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the specification.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present specification and together with the description, serve to explain the principles of the specification.
Fig. 1 is a flowchart illustrating a method for detecting a status of a business service according to an exemplary embodiment.
Fig. 2 is a flow chart illustrating another method for detecting a status of a business service according to an example embodiment.
FIG. 3 is a flow chart illustrating functional testing of business services according to an exemplary embodiment of the present description.
Fig. 4 is a block diagram illustrating a status detection apparatus for a business service according to an exemplary embodiment of the present disclosure.
Fig. 5 is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present invention.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the specification, as detailed in the appended claims.
The terminology used in the description herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the description. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information, without departing from the scope of the present specification. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The API (application program interface) gateway is the only entry for the entire business service, and therefore its position is extremely important. With the development of the technology, the API gateway starts to gradually switch from the early-stage fast traffic forwarding to the fine management of the business service, including the full life cycle management and the availability detection of the business service, and needs to give an alarm in time when detecting that the business service is unavailable, so that the test developer can repair the business service in time after receiving the alarm. In the service availability detection process, accuracy and timeliness are crucial. The current API gateway generally has two schemes for detecting the state of the service:
the first scheme is as follows: the reachability of the service port is probed. The accessibility of the service is detected by continuously sending the detection message to the service port, but the port can be reached many times without representing that the service is available, for example, the service layer is deadlocked, the service is in an unavailable state, but the service port can still be reached.
Scheme II: fixed service addresses are detected. The availability of the service is detected by continuously sending detection messages to a fixed address, the scheme requires that a server side needs to realize the fixed detection address, and an actual service provider side does not have the address generally; in addition, the scheme needs to configure and input the detection address on the gateway, so that the configuration workload is increased; similarly, the detection of the fixed address can only prove that the address is available, and cannot prove that the service is available, taking the web application as an example, the api/status is a detection address, the api/service is a service address, the detection of the detection address can only prove that the detection interface of the api/status of the web service is available, and cannot prove that the interface of the api/service is available.
The detection results of the two schemes cannot truly reflect the availability of the business service, the state of the business service cannot be accurately determined, and the detection rules are manually configured by a user, so that the process is complicated.
Based on the above situation, embodiments of the present specification provide a method for detecting a state of a business service, in which a state detection rule for detecting the business service is automatically generated by using a test request parameter used when performing a function test on the business service, so that detection of a real state of the business service can be automatically started according to the state detection rule, a detection rule does not need to be manually configured, and labor cost is reduced.
The following provides a detailed description of examples of the present specification.
As shown in fig. 1, fig. 1 is a flowchart illustrating a method for detecting a status of a business service according to an exemplary embodiment, where the method is applied to an API gateway, and includes the following steps:
The test request parameter is used for triggering and calling the target business service to perform function test on the target business service.
Before the business service is issued after the information is registered on the API gateway, the business service needs to be subjected to function testing, the business service is allowed to be issued after the testing is passed, and the issued business service enters an available state and is allowed to be called. After the business service is released, it is also possible to perform a functional test on the business service as needed.
In the service test, the test request parameter is sent to the API gateway to trigger the call of the service, and in step 101, the request test parameter can be obtained when the API gateway receives the request test parameter; if the server records the test related information of the service, the state detection parameters can be obtained from the test related information.
And 102, generating a state detection rule aiming at the target business service according to the test request parameters.
The state detection rule is used for carrying out automatic state detection on the issued target business service.
In another embodiment, before generating the state detection rule, it may be determined whether the test result of the functional test of the target service is successful, and if the test is successful, the state detection rule is generated, so as to avoid the unavailability of the parameters due to the inappropriate setting of the test request parameters. Specifically, the method comprises the following steps: and obtaining a test result of the function test, if the test result is that a response message returned by the target business service is received and the format of the response message is the same as the standard response format corresponding to the target business service, indicating that the test is successful, enabling the test request parameter to be available, and further generating a state detection rule aiming at the target business service according to the test request parameter.
Wherein the standard response format of the business service can be determined according to the registration document. The service registration is to register the service information of the service on the API gateway, and generate a corresponding registration document, where the registration document generally includes information such as location information, request parameters, response codes, and standard response formats of the service.
And 103, responding to the state detection request aiming at the target business service, calling the target business service according to the state detection rule, and determining the state of the target business service according to the calling result.
In step 103, the status detection for the target service may be performed periodically; or setting the test time, and triggering the state detection of the target service when the set test time is reached. For different service, the user can configure the opportunity strategy of state detection.
In step 103, if the calling result is that a response message returned by the target service is received and the format of the response message is the same as the standard response format corresponding to the target service, determining that the service is in an available state; if the calling result is that the response message is not received or the format of the response message is different from the standard response format, the business service is determined to be in an unavailable state, and alarm information can be generated at the moment so that a test developer can repair the business service in time after receiving the alarm information.
Because the state detection rule adopted for the state detection of the target business service is generated in the test stage, one state detection of the target business service is equivalent to one real business call, and the detection result can truly reflect the state of the target business service.
In the embodiment, the state detection rule for performing the state detection on the target business service is generated by using the test request parameter adopted when the target business service is tested, so that the detection rule does not need to be manually configured, the state detection can be performed on the target business service in real time according to the state detection rule, and the timeliness and the accuracy of the detection are improved.
The functional test of the target service may be performed after the registration of the target service and before the release of the target service, or after the release of the target service, and the corresponding test request parameter for generating the state detection rule may be acquired in a scenario before the release of the target service after the registration of the target service, or may be acquired in a scenario after the release of the target service. The following takes the scenario before the target business service is published after registration as an example, and further description is made on the status detection process of the business service.
Fig. 2 is a flowchart illustrating another method for detecting a status of a business service according to an exemplary embodiment of the present disclosure, including the following steps:
The test request parameter is used for triggering and calling the target business service to perform function test on the target business service.
In general, before a business service is published after information is registered in an API gateway, a functional test needs to be performed on the business service, and the business service is permitted to be published after the test is passed. During function test, all port addresses of the service are ensured to be available, so that a state detection rule is generated by means of test request parameters in the scene and is used for state detection of the service, and the comprehensiveness and the accuracy of the state detection are higher.
Fig. 3 is a flowchart illustrating a functional test on a business service according to an exemplary embodiment of the present disclosure, and it can be seen from the diagram that, when the business service is subjected to the functional test, a test developer generates a test request through a terminal, where the test request carries a test request parameter input by a user. It is understood that the test parameters used in the test are not completely the same for different business services, and for example, the test request parameters may include at least one of the following parameters: school number, name, age, specialty, etc. The API gateway receives the test request and sends the test request to the corresponding business service through the service route. If the service is normal, the service is processed according to the test parameters of the test request carried by the test request and a response message with a correct format is returned through the API gateway. Therefore, whether the test is successful or not can be judged according to the calling result of the API gateway to the business service.
Wherein the standard response format of the target business service can be determined according to the registration document. The service registration is to register the service information of the service on the API gateway, and generate a corresponding registration document, where the registration document generally includes information such as location information, request parameters, response codes, and standard response formats of the service.
In step 203, if yes, the test is successful, and the test request parameter is available, then step 204 and step 204' are executed; if the judgment result is no, the test is not successful, and the test request parameters are not appropriate and are not available, the state detection rule is not generated. It can be understood that, in case of unsuccessful test, the developer will perform troubleshooting on the business service and perform the test again, so if the test is unsuccessful, the process returns to step 201 to obtain the test request parameters for the next test.
And step 204, generating a state detection rule aiming at the target business service according to the test request parameters and the standard response format.
The state detection rule is used for carrying out automatic state detection on the issued target business service.
Step 204', the target business service is published.
And after the functional test of the target business service is passed, the target business service is allowed to be issued, and after the target business service is issued, the target business service enters an available state and the application or other business services are allowed to be called.
It should be noted that steps 204 and 204 ' are not limited to the synchronous execution shown in the figure, and step 204 may be executed first and then step 204 ', or step 204 ' may be executed first and then step 204 is executed.
After the target service is released, in order to ensure that the target service is always in an available state, it is necessary to automatically trigger the state detection on the target service according to the state detection rule, see step 205.
In step 205, the status detection for the target service may be performed periodically; or setting the test time, and triggering the state detection of the target service when the set test time is reached. For different service, the user can configure the opportunity strategy of state detection.
In step 205, if the calling result is that a response message returned by the target service is received and the format of the response message is the same as the standard response format corresponding to the target service, it is determined that the service is in an available state; if the calling result is that the response message is not received or the format of the response message is different from the standard response format, the business service is determined to be in an unavailable state, and alarm information can be generated at the moment so that a test developer can repair the business service in time after receiving the alarm information.
In the embodiment, the issuing flow of the business service is optimized, the state detection rule for automatically detecting the business service state is generated by means of the test request parameter adopted by testing the service before the service is issued, and the state detection rule adopted by detecting the state of the target business service is generated in the test stage of the service, so that one state detection of the target business service is equivalent to one real business call simulation, the detection result can truly reflect the state of the target business service, and the accuracy is high.
In another embodiment, after the target service is released and used, the state detection rule may further be used to detect a call result of the service processing request for the user, which is fed back by the target service, so as to determine the state of the target service, specifically: a user sends a service processing request, an API gateway receives the service processing request and calls a corresponding target service, and if the calling result is that a response message returned by the target service is received and the format of the response message is the same as the standard response format corresponding to the target service, the service is determined to be in an available state; and if the calling result is that the response message is not received or the format of the response message is different from the standard response format, determining that the service is in an unavailable state. Therefore, the calling result of the business processing request of the user is analyzed and judged through the state detection rule, the state of the target business service can be determined in real time, when the target business service is in an unavailable state, the target business service is found in time, alarm information is generated, and a test developer is informed to overhaul the target business service.
Corresponding to the embodiment of the foregoing method for detecting the state of the business service, the present specification further provides embodiments of a device for detecting the state of the business service and a terminal applied thereto.
Fig. 4 is a block diagram of a service state detection apparatus according to an exemplary embodiment, where the service state detection apparatus is applied to an API gateway, and includes: a parameter acquisition module 401, a generation module 402 and a status detection module 403.
A parameter obtaining module 401, configured to obtain a test request parameter for a target service, where the test request parameter is used to trigger and call the target service to perform a function test on the target service;
a generating module 402, configured to generate a state detection rule for a target service according to the test request parameter;
the state detection module 403 is configured to, in response to a state detection request for a target service, invoke the target service according to the state detection rule, and determine a state of the target service according to an invocation result.
Optionally, when the target service is called according to the state detection rule and the state of the target service is determined according to the calling result, the state detection module is configured to:
if the calling result is that a response message returned by the target business service is received and the format of the response message is the same as the standard response format corresponding to the target business service, determining that the target business service is in an available state;
and if the calling result is that the response message is not received or the format of the response message is different from the standard response format, determining that the target business service is in an unavailable state.
Optionally, the state detection module is further configured to:
if the service request result is a response message returned by the target service and the format of the response message is the same as the standard response format corresponding to the target service, determining that the target service is in an available state, wherein the service request result is a result of calling the target service according to a service processing request sent by a user;
and if the service request result is that the response message is not received or the format of the response message is different from the standard response format, determining that the target service is in an unavailable state.
Optionally, the generating module is specifically configured to:
obtaining a test result of the function test;
and under the condition that the test result is that a response message returned by the target business service is received and the format of the response message is the same as the standard response format corresponding to the target business service, generating a state detection rule aiming at the target business service according to the test request parameter.
Optionally, the state detection apparatus further includes:
and the issuing module is used for issuing the target business service under the condition that the test result is that a response message returned by the target business service is received and the format of the response message is the same as the standard response format corresponding to the target business service.
Optionally, the state detection apparatus further includes:
and the document acquisition module is used for acquiring a registration document generated when the target business service is registered on the API gateway, wherein the registration document defines a standard response format of the target business service.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the modules described as separate parts may or may not be physically separate, and the parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution in the specification. One of ordinary skill in the art can understand and implement it without inventive effort.
Fig. 5 is a schematic diagram of an electronic device according to an exemplary embodiment of the present invention, showing a block diagram of an exemplary electronic device 50 suitable for use in implementing any of the embodiments of the present invention. The electronic device 50 shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 5, the electronic device 50 may be embodied in the form of a general purpose computing device, which may be, for example, a server device. The components of the electronic device 50 may include, but are not limited to: the at least one processor 51, the at least one memory 52, and a bus 53 connecting the various system components (including the memory 52 and the processor 51).
The bus 53 includes a data bus, an address bus, and a control bus.
The memory 52 may include volatile memory, such as Random Access Memory (RAM)521 and/or cache memory 522, and may further include Read Only Memory (ROM) 523.
The processor 51 executes various functional applications and data processing, such as the methods provided by any of the above embodiments, by running a computer program stored in the memory 52.
The electronic device 50 may also communicate with one or more external devices 54 (e.g., keyboard, pointing device, etc.) such communication may be through AN input/output (I/O) interface 55, and the model-generated electronic device 50 may also communicate with one or more networks (e.g., a local area network (L AN), a Wide Area Network (WAN) and/or a public network, such as the Internet) through a network adapter 56. As shown, the network adapter 56 communicates with other modules of the model-generated electronic device 50 through a bus 53.
It should be noted that although in the above detailed description several units/modules or sub-units/modules of the electronic device are mentioned, such a division is merely exemplary and not mandatory. Indeed, the features and functionality of two or more of the units/modules described above may be embodied in one unit/module according to embodiments of the invention. Conversely, the features and functions of one unit/module described above may be further divided into embodiments by a plurality of units/modules.
The embodiments of the present specification further provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the method for detecting the state of the business service according to any one of the above embodiments.
It will be understood that the present description is not limited to the precise arrangements described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present description is limited only by the appended claims.
The above description is only a preferred embodiment of the present disclosure, and should not be taken as limiting the present disclosure, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.
Claims (14)
1. A state detection method of business service is applied to API gateway, and is characterized in that the state detection method comprises the following steps:
acquiring a test request parameter aiming at a target business service, wherein the test request parameter is used for triggering and calling the target business service to perform a function test on the target business service;
generating a state detection rule aiming at the target business service according to the test request parameter;
and responding to a state detection request aiming at the target business service, calling the target business service according to the state detection rule, and determining the state of the target business service according to the calling result.
2. The method for detecting the state of the business service according to claim 1, wherein the step of calling the target business service according to the state detection rule and determining the state of the target business service according to the calling result comprises:
if the calling result is that a response message returned by the target business service is received and the format of the response message is the same as the standard response format corresponding to the target business service, determining that the target business service is in an available state;
and if the calling result is that the response message is not received or the format of the response message is different from the standard response format, determining that the target business service is in an unavailable state.
3. A method for state detection of a traffic service according to claim 1, characterized in that said method for state detection further comprises:
if the service request result is a response message returned by the target service and the format of the response message is the same as the standard response format corresponding to the target service, determining that the target service is in an available state, wherein the service request result is a result of calling the target service according to a service processing request sent by a user;
and if the service request result is that the response message is not received or the format of the response message is different from the standard response format, determining that the target service is in an unavailable state.
4. The method for detecting the state of a service according to claim 1, wherein generating the state detection rule for the target service according to the test request parameter further comprises:
obtaining a test result of the function test;
and under the condition that the test result is that a response message returned by the target business service is received and the format of the response message is the same as the standard response format corresponding to the target business service, generating a state detection rule aiming at the target business service according to the test request parameter.
5. A method for state detection of a traffic service according to claim 4, characterized in that said state detection method further comprises:
and issuing the target business service under the condition that the test result is that a response message returned by the target business service is received and the format of the response message is the same as the standard response format corresponding to the target business service.
6. A method for state detection of a traffic service according to any of claims 2-5, characterized in that the method for state detection further comprises:
and acquiring a registration document generated when the target business service is registered on the API gateway, wherein the registration document defines a standard response format of the target business service.
7. A status detection apparatus for a business service, which is applied to an API gateway, the status detection apparatus comprising:
the system comprises a parameter acquisition module, a parameter acquisition module and a parameter analysis module, wherein the parameter acquisition module is used for acquiring a test request parameter aiming at a target business service, and the test request parameter is used for triggering and calling the target business service to perform function test on the target business service;
the generating module is used for generating a state detection rule aiming at the target business service according to the test request parameter;
and the state detection module is used for responding to a state detection request aiming at the target business service, calling the target business service according to the state detection rule and determining the state of the target business service according to the calling result.
8. The apparatus for detecting status of service as claimed in claim 7, wherein when the target service is invoked according to the status detection rule and the status of the target service is determined according to the invocation result, the status detection module is configured to:
if the calling result is that a response message returned by the target business service is received and the format of the response message is the same as the standard response format corresponding to the target business service, determining that the target business service is in an available state;
and if the calling result is that the response message is not received or the format of the response message is different from the standard response format, determining that the target business service is in an unavailable state.
9. A status detection apparatus of a service as claimed in claim 7, wherein the status detection module is further configured to:
if the service request result is a response message returned by the target service and the format of the response message is the same as the standard response format corresponding to the target service, determining that the target service is in an available state, wherein the service request result is a result of calling the target service according to a service processing request sent by a user;
and if the service request result is that the response message is not received or the format of the response message is different from the standard response format, determining that the target service is in an unavailable state.
10. The apparatus for detecting status of a business service of claim 7, wherein the generating module is specifically configured to:
obtaining a test result of the function test;
and under the condition that the test result is that a response message returned by the target business service is received and the format of the response message is the same as the standard response format corresponding to the target business service, generating a state detection rule aiming at the target business service according to the test request parameter.
11. A status detection device for a business service as claimed in claim 10 wherein said status detection device further comprises:
and the issuing module is used for issuing the target business service under the condition that the test result is that a response message returned by the target business service is received and the format of the response message is the same as the standard response format corresponding to the target business service.
12. A state detection device for a traffic service according to any of claims 8-11, characterized in that said state detection device further comprises:
and the document acquisition module is used for acquiring a registration document generated when the target business service is registered on the API gateway, wherein the registration document defines a standard response format of the target business service.
13. An electronic 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 method of status detection of a business service according to any one of claims 1 to 6 when executing the computer program.
14. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for status detection of a business service of any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010296395.XA CN111506507B (en) | 2020-04-15 | 2020-04-15 | Business service state detection method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010296395.XA CN111506507B (en) | 2020-04-15 | 2020-04-15 | Business service state detection method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111506507A true CN111506507A (en) | 2020-08-07 |
CN111506507B CN111506507B (en) | 2024-07-26 |
Family
ID=71864731
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010296395.XA Active CN111506507B (en) | 2020-04-15 | 2020-04-15 | Business service state detection method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111506507B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113312321A (en) * | 2021-05-31 | 2021-08-27 | 中国民航信息网络股份有限公司 | Abnormal monitoring method for traffic and related equipment |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7249344B1 (en) * | 1996-10-31 | 2007-07-24 | Citicorp Development Center, Inc. | Delivery of financial services to remote devices |
US20160092344A1 (en) * | 2014-09-29 | 2016-03-31 | Teodor Joav Bally | End-to-end, lifecycle aware, api management |
US20160124742A1 (en) * | 2014-10-30 | 2016-05-05 | Equinix, Inc. | Microservice-based application development framework |
WO2017023276A1 (en) * | 2015-07-31 | 2017-02-09 | Hewlett Packard Enterprise Development Lp | Discovering and publishing api information |
US9921894B1 (en) * | 2017-03-17 | 2018-03-20 | Accenture Global Solutions Limited | Extensible single point orchestration system for application program interfaces |
US10015167B1 (en) * | 2017-03-17 | 2018-07-03 | Accenture Global Solutions Limited | Extensible key management system for application program interfaces |
US20180359201A1 (en) * | 2017-06-09 | 2018-12-13 | Equinix, Inc. | Near real-time messaging service for data center infrastructure monitoring data |
CN109308266A (en) * | 2018-11-30 | 2019-02-05 | 北京微播视界科技有限公司 | Construction method, test method, device, equipment and the medium of test case |
US10382266B1 (en) * | 2016-03-16 | 2019-08-13 | Equinix, Inc. | Interconnection platform with event-driven notification for a cloud exchange |
CN110365751A (en) * | 2019-06-26 | 2019-10-22 | 口碑(上海)信息技术有限公司 | Method for processing business, device and the equipment of gateway system |
US10491462B1 (en) * | 2016-05-06 | 2019-11-26 | Equinix, Inc. | Port verification for customer interconnection in a data center |
CN110618889A (en) * | 2019-08-14 | 2019-12-27 | 网联清算有限公司 | Service availability detection method and device, computer equipment and storage medium |
CN110765024A (en) * | 2019-10-29 | 2020-02-07 | 百度在线网络技术(北京)有限公司 | Simulation test method, simulation test device, electronic equipment and computer-readable storage medium |
-
2020
- 2020-04-15 CN CN202010296395.XA patent/CN111506507B/en active Active
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7249344B1 (en) * | 1996-10-31 | 2007-07-24 | Citicorp Development Center, Inc. | Delivery of financial services to remote devices |
US20160092344A1 (en) * | 2014-09-29 | 2016-03-31 | Teodor Joav Bally | End-to-end, lifecycle aware, api management |
US20160124742A1 (en) * | 2014-10-30 | 2016-05-05 | Equinix, Inc. | Microservice-based application development framework |
WO2017023276A1 (en) * | 2015-07-31 | 2017-02-09 | Hewlett Packard Enterprise Development Lp | Discovering and publishing api information |
US10382266B1 (en) * | 2016-03-16 | 2019-08-13 | Equinix, Inc. | Interconnection platform with event-driven notification for a cloud exchange |
US10491462B1 (en) * | 2016-05-06 | 2019-11-26 | Equinix, Inc. | Port verification for customer interconnection in a data center |
US9921894B1 (en) * | 2017-03-17 | 2018-03-20 | Accenture Global Solutions Limited | Extensible single point orchestration system for application program interfaces |
US10015167B1 (en) * | 2017-03-17 | 2018-07-03 | Accenture Global Solutions Limited | Extensible key management system for application program interfaces |
US20180359201A1 (en) * | 2017-06-09 | 2018-12-13 | Equinix, Inc. | Near real-time messaging service for data center infrastructure monitoring data |
CN109308266A (en) * | 2018-11-30 | 2019-02-05 | 北京微播视界科技有限公司 | Construction method, test method, device, equipment and the medium of test case |
CN110365751A (en) * | 2019-06-26 | 2019-10-22 | 口碑(上海)信息技术有限公司 | Method for processing business, device and the equipment of gateway system |
CN110618889A (en) * | 2019-08-14 | 2019-12-27 | 网联清算有限公司 | Service availability detection method and device, computer equipment and storage medium |
CN110765024A (en) * | 2019-10-29 | 2020-02-07 | 百度在线网络技术(北京)有限公司 | Simulation test method, simulation test device, electronic equipment and computer-readable storage medium |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113312321A (en) * | 2021-05-31 | 2021-08-27 | 中国民航信息网络股份有限公司 | Abnormal monitoring method for traffic and related equipment |
Also Published As
Publication number | Publication date |
---|---|
CN111506507B (en) | 2024-07-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111177005A (en) | Service application testing method, device, server and storage medium | |
CN109885496B (en) | Test log management method and system | |
CN111858296B (en) | Interface testing method, device, equipment and storage medium | |
CN114745295B (en) | Data acquisition method, device, equipment and readable storage medium | |
CN111858083B (en) | Remote service calling method and device, electronic equipment and storage medium | |
CN111597110B (en) | Page test method and device, electronic equipment and storage medium | |
CN110784374A (en) | Method, device, equipment and system for monitoring operation state of service system | |
CN112242938B (en) | Detection method, device, electronic equipment and computer readable storage medium | |
CN114448867B (en) | Route visualization method, device, equipment and storage medium | |
CN105743725A (en) | Method and device for testing application programs | |
CN115542875A (en) | Vehicle detection method based on SOA service and related equipment | |
CN111506507A (en) | Business service state detection method and device, electronic equipment and storage medium | |
CN112561690B (en) | Method, system, equipment and storage medium for testing credit card staged service interface | |
CN114297062A (en) | Service testing method and device, electronic equipment and storage medium | |
CN116627849B (en) | System test method, device, equipment and storage medium | |
CN110875832A (en) | Abnormal service monitoring method, device and system and computer readable storage medium | |
CN117041111A (en) | Vehicle cloud function test method and device, electronic equipment and storage medium | |
CN112073462B (en) | Positioning method and device | |
CN113342664B (en) | Dial testing method, device, storage medium and computer equipment | |
CN114528074A (en) | Dynamic baffle implementation method, system and equipment based on micro-service architecture | |
CN115391127A (en) | Dial testing method and device, storage medium and chip | |
US10977146B2 (en) | Application operation monitoring apparatus and application operation monitoring method | |
CN110727601A (en) | Multi-platform program testing method and related device | |
CN115426301B (en) | Device detection method, device, equipment and storage medium based on self-generated message | |
CN110661677A (en) | DNS (Domain name System) testing method, device and system |
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 |