Business service state detection method and device, electronic equipment and storage medium

By generating status detection rules, the service status detection of the API gateway is solved, and the problems of inaccurate and cumbersome detection in the prior art are realized, and efficient and accurate service status monitoring is achieved.

CN119201669APending Publication Date: 2024-12-27HANGZHOU DT DREAM TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410910467.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2020-04-15
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

In the service status detection of existing API gateways, the detection service port accessibility and fixed service address cannot truly reflect the availability of service services, and users need to manually configure the detection rules, which is a cumbersome process.

Method used

By obtaining test request parameters, generating status detection rules, functional tests on the target business services, and determining their status based on the call results, there is no need to manually configure the detection rules, and simulate real business calls to improve the timeliness and accuracy of detection.

Benefits of technology

The service status detection of business service without manual configuration of detection rules is realized, which improves the timeliness and accuracy of detection and can truly reflect the status of business services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201669A_ABST
    Figure CN119201669A_ABST
Patent Text Reader

Abstract

The invention provides a business service state detection method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a test request parameter for a target business service, the test request parameter being used for triggering and calling the target business service to perform a function test on the target business service; generating a state detection rule for a target business service according to the test request parameter; and in response to a state detection request for a 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 a calling result. Therefore, state detection of the business service can be automatically triggered, and timeliness and accuracy are high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present specification relates to the field of service detection technology, and in particular to a method and device for detecting the status of a business service, an electronic device, and a storage medium. Background Art

[0002] The API (application programming interface) gateway is the only entrance to the entire business service, so its position is extremely important. With the development of technology, the API gateway has gradually shifted from the early fast traffic forwarding to the refined management of business services, including the full life cycle management and availability detection of business services. When a business service is detected to be unavailable, an alarm is required in time so that the test developers can repair the business service in time after receiving the alarm. In the process of business service availability detection, accuracy and timeliness are crucial.

[0003] Currently, there are generally two solutions for API gateway to detect the status of business services: detecting the accessibility of the service port and detecting the fixed service address. The detection results of the above two solutions cannot truly reflect the availability of business services, cannot accurately determine the status of business services, and both require users to manually configure detection rules, which is a cumbersome process. Summary of the invention

[0004] In order to overcome the problems existing in the related art, this specification provides a method and device for detecting the status of a business service, an electronic device, and a storage medium.

[0005] According to a first aspect of an embodiment of this specification, a method for detecting the status of a business service is provided, which is applied to an API gateway. The method for detecting the status includes:

[0006] Acquire a test request parameter for a target business service, wherein the test request parameter is used to trigger a call to the target business service to perform a functional test on the target business service;

[0007] Generate a status detection rule for the target business service according to the test request parameters;

[0008] In response to a status detection request for a target business service, the target business service is called according to the status detection rule, and the status of the target business service is determined according to the calling result.

[0009] Optionally, 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, includes:

[0010] If the call result is receiving a response message returned by the target business service, and the format of the response message is the same as the standard response format corresponding to the target business service, then determining that the target business service is in an available state;

[0011] If the call result is that the response message is not received or the format of the response message is different from the standard response format, it is determined that the target business service is in an unavailable state.

[0012] Optionally, the state detection method further includes:

[0013] If the service request result is receiving 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, then it is determined that the target service is in an available state, and the service request result is the result of calling the target service according to the service processing request sent by the user;

[0014] If the result of the service request is that the response message is not received or the format of the response message is different from the standard response format, it is determined that the target business service is in an unavailable state.

[0015] Optionally, generating a status detection rule for a target business service according to the test request parameter further includes:

[0016] Obtaining a test result of the functional test;

[0017] When the test result is receiving a response message returned by the target business service and the format of the response message is the same as the standard response format corresponding to the target business service, a status detection rule for the target business service is generated according to the test request parameters.

[0018] Optionally, the state detection method further includes:

[0019] When 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 a standard response format corresponding to the target business service, the target business service is released.

[0020] Optionally, the state detection method further includes:

[0021] A registration document generated when the target business service is registered on the API gateway is obtained, wherein the registration document defines a standard response format of the target business service.

[0022] According to a second aspect of an embodiment of this specification, a state detection device for a business service is provided, which is applied to an API gateway, and the state detection device includes:

[0023] A parameter acquisition module, used to acquire a test request parameter for a target business service, wherein the test request parameter is used to trigger a call to the target business service to perform a functional test on the target business service;

[0024] A generating module, used to generate a status detection rule for a target business service according to the test request parameters;

[0025] The state detection module is used to respond to a state detection request for a target business service, call the target business service according to the state detection rule, and determine the state of the target business service according to the call result.

[0026] Optionally, when the target business service is called according to the state detection rule and the state of the target business service is determined according to the call result, the state detection module is used to:

[0027] If the call result is receiving a response message returned by the target business service, and the format of the response message is the same as the standard response format corresponding to the target business service, then determining that the target business service is in an available state;

[0028] If the call result is that the response message is not received or the format of the response message is different from the standard response format, it is determined that the target business service is in an unavailable state.

[0029] Optionally, the status detection module is further used for:

[0030] If the service request result is receiving 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, then it is determined that the target service is in an available state, and the service request result is the result of calling the target service according to the service processing request sent by the user;

[0031] If the result of the service request is that the response message is not received or the format of the response message is different from the standard response format, it is determined that the target business service is in an unavailable state.

[0032] Optionally, the generating module is specifically used for:

[0033] Obtaining a test result of the functional test;

[0034] When the test result is receiving a response message returned by the target business service and the format of the response message is the same as the standard response format corresponding to the target business service, a status detection rule for the target business service is generated according to the test request parameters.

[0035] Optionally, the state detection device further includes:

[0036] A publishing module is used to publish the target business service when 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.

[0037] Optionally, the state detection device further includes:

[0038] The document acquisition module is used to acquire the registration document generated when the target business service is registered on the API gateway, and the registration document defines a standard response format of the target business service.

[0039] According to a third aspect of an embodiment of this specification, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for detecting the status of a business service described in any one of the above when executing the computer program.

[0040] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the business service status detection method described in any one of the above are implemented.

[0041] The technical solutions provided by the embodiments of this specification may have the following beneficial effects:

[0042] In the embodiments of the present specification, with the help of the test request parameters used when testing the business service, status detection rules for performing status detection on the business service are generated, thereby eliminating the need to manually configure the detection rules, and simulating real business service calls according to the status detection rules to perform status detection on the business service, thereby improving the timeliness and accuracy of status detection.

[0043] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present specification. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the specification and, together with the description, serve to explain the principles of the specification.

[0045] Figure 1 The flowchart of a method for detecting the status of a business service is shown in this specification according to an exemplary embodiment.

[0046] Figure 2 The flowchart of another method for detecting the status of a business service is shown in the specification according to an exemplary embodiment.

[0047] Figure 3It is a flowchart of performing functional testing on a business service according to an exemplary embodiment of this specification.

[0048] Figure 4 This is a module diagram of a device for detecting a state of a business service according to an exemplary embodiment of the present specification.

[0049] Figure 5 It is a schematic structural diagram of an electronic device shown in an exemplary embodiment of the present invention. DETAILED DESCRIPTION

[0050] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same 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 this specification. Instead, they are merely examples of devices and methods consistent with some aspects of this specification as detailed in the appended claims.

[0051] The terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit this specification. The singular forms "a", "an", "the" and "the" used in this specification and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0052] It should be understood that although the terms first, second, third, etc. may be used in this specification to describe various information, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0053] The API (application programming interface) gateway is the only entrance to the entire business service, so its position is extremely important. With the development of technology, the API gateway has gradually shifted from the early fast traffic forwarding to the refined management of business services, including the full life cycle management and availability detection of business services. When a business service is detected to be unavailable, an alarm is required in time so that the test developers can repair the business service in time after receiving the alarm. In the process of business service availability detection, accuracy and timeliness are crucial. Currently, there are generally two solutions for API gateway to detect the status of business services:

[0054] Solution 1: Detect the reachability of the service port. The reachability of the service is detected by continuously sending detection messages to the service port. However, port reachability often does not mean that the business service is reachable. For example, a deadlock occurs at the business layer and the business service is unavailable, but the service port is still reachable.

[0055] Solution 2: Detecting a fixed service address. By continuously sending detection messages to a fixed address to detect the availability of business services, this solution requires the service provider to implement a fixed detection address, but the actual service provider generally does not have such an address; in addition, this solution requires the configuration and entry of this detection address on the gateway, which increases the configuration workload; similarly, the detection of a fixed address can only prove that this address is available, but cannot prove that the service is available. Taking web applications as an example, api / status is the detection address, and api / service is the business service address. The detection of the detection address can only prove that the api / status detection interface of the web service is available, but cannot prove that the api / service interface is available.

[0056] The detection results of the above two solutions cannot truly reflect the availability of business services, cannot accurately determine the status of business services, and both require users to manually configure detection rules, which is a cumbersome process.

[0057] Based on the above situation, an embodiment of the present specification provides a method for detecting the status of a business service. With the help of the test request parameters used when performing functional testing on the business service, a status detection rule for detecting the business service is automatically generated, so that the detection of the real status of the business service can be automatically started according to the status detection rule, without the need to manually configure the detection rules, thereby reducing labor costs.

[0058] Next, the embodiments of this specification are described in detail.

[0059] like Figure 1 As shown, Figure 1 This is a flowchart of a method for detecting the status of a business service according to an exemplary embodiment of the present specification. The method is applied to an API gateway and includes the following steps:

[0060] Step 101: Obtain test request parameters for the target business service.

[0061] The test request parameters are used to trigger the call of the target business service to perform functional testing on the target business service.

[0062] After the business service registers information on the API gateway and before it is released, it is necessary to perform functional testing on the business service. Only after the test is passed can the business service be released. After the release, the business service enters the available state and is allowed to be called. After the business service is released, it is also possible to perform functional testing on the business service as needed.

[0063] When testing a business service, the test request parameters will be sent to the API gateway to trigger the call of the business service. In step 101, the request test parameters can be obtained when the API gateway receives the request test parameters; if the server records the test-related information of the business service, the status detection parameters can also be obtained from the test-related information.

[0064] Step 102: Generate status detection rules for the target business service according to the test request parameters.

[0065] Among them, the status detection rule is used to automatically detect the status of the published target business service.

[0066] In another embodiment, before generating the status detection rule, it can be determined whether the test result of the functional test of the target business service is successful. If the test is successful, the status detection rule is generated to avoid the unavailability of parameters due to inappropriate setting of the test request parameters. Specifically, the following steps are included: obtaining the test result of the functional test, if the test result is a response message returned by the target business service, and the format of the response message is the same as the standard response format corresponding to the target business service, it means that the test is successful, the test request parameters are available, and then the status detection rule for the target business service is generated according to the test request parameters.

[0067] The standard response format of the business service can be determined according to the registration document. Business service registration means registering the service information of the business service on the API gateway and generating the corresponding registration document. The registration document usually includes the location information, request parameters, response code and standard response format of the business service.

[0068] Step 103: In response to the state detection request for the target business service, the target business service is called according to the state detection rule, and the state of the target business service is determined according to the call result.

[0069] In step 103, the state detection of the target business service can be performed periodically, or a test time can be set, and the state detection of the target business service is triggered when the set test time is reached. For different business services, users can configure the timing strategy of state detection.

[0070] In step 103, if the call 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, then the business service is determined to be in an available state; if the call result is that no response message is received or the format of the response message is different from the standard response format, then the business service is determined to be in an unavailable state. At this time, an alarm message can be generated to facilitate the test developer to repair the business service in time after receiving the alarm message.

[0071] Since the status detection rules used for status detection of the target business service are generated by the service during the testing phase, a status detection of the target business service is equivalent to simulating a real business call, and the detection result can truly reflect the status of the target business service.

[0072] In this embodiment, with the help of the test request parameters used when testing the target business service, status detection rules for performing status detection on the target business service are generated, thereby eliminating the need to manually configure the detection rules, and the status detection of the target business service can be performed in real time according to the status detection rules, thereby improving the timeliness and accuracy of the detection.

[0073] Functional testing of the target business service can be performed after the target business service is registered but before it is released, or after the target business is released. Correspondingly, the test request parameters used to generate status detection rules can be obtained in the scenario after the target business service is registered but before it is released, or after the target business is released. The following takes the scenario after the target business service is registered but before it is released as an example to further explain the status detection process of the business service.

[0074] Figure 2 This is a flowchart of another method for detecting the state of a business service according to an exemplary embodiment of the present specification, comprising the following steps:

[0075] Step 201: When the API gateway receives test request parameters for a target business service, the test request parameters are recorded.

[0076] The test request parameters are used to trigger the call of the target business service to perform functional testing on the target business service.

[0077] Normally, after registering information on the API gateway and before publishing, the business service needs to be functionally tested, and the business service is allowed to be published only after the test passes. During functional testing, all port addresses of the service are generally targeted to ensure that all port addresses are available. Therefore, the status detection rules are generated with the help of the test request parameters in this scenario and used for the status detection of the business service. The comprehensiveness and accuracy of the status detection are relatively high.

[0078] Step 202: Obtain the test result of the functional test of the target business service.

[0079] Figure 3 This is a flowchart of functional testing of business services according to an exemplary embodiment of this specification. It can be seen from the figure that when performing functional testing on business services, the test developer generates a test request through the terminal, and the test request carries the test request parameters input by the user. It can be understood that for different business services, the test parameters used in the test are not completely the same. Taking the functional testing of the business service for student information query as an example, the test request parameters may include at least one of the following parameters: student number, name, age, major, etc. The API gateway receives the test request and sends the test request to the corresponding business service through the service routing. If the business service is normal, it will perform business processing according to the test request test parameters carried by the test request and return a response message with the correct format through the API gateway. If the business service fails, it may be a logical layer failure or a service interface failure, then no response message will be returned or the format of the response message is incorrect. Thus, it can be judged whether the test is successful based on the result of the API gateway calling the business service.

[0080] Step 203: determine whether the test result is a response message returned by the target business service, and whether the format of the response message is the same as the standard response format corresponding to the target business service.

[0081] The standard response format of the target business service can be determined based on its registration document. Business service registration means registering the service information of the business service on the API gateway and generating the corresponding registration document, which usually includes the location information, request parameters, response code and standard response format of the business service.

[0082] In step 203, if the judgment is yes, it means that the test is successful and the test request parameters are available, then step 204 and step 204' are executed; if the judgment is no, it means that the test is unsuccessful, it is possible that the test request parameters are inappropriate and the test request parameters are unavailable, then no state detection rules are generated. It is understandable that in the case of an unsuccessful test, the developer will troubleshoot the business service and retest it, so if the test is unsuccessful, return to step 201 to obtain the test request parameters for the next test.

[0083] Step 204: Generate status detection rules for the target business service according to the test request parameters and the standard response format.

[0084] Among them, the status detection rule is used to automatically detect the status of the published target business service.

[0085] Step 204': publish the target business service.

[0086] After the functional test of the target business service passes, the target business service is allowed to be released. After the release, the target business service enters the available state, allowing applications or other business services to call it.

[0087] It should be noted that step 204 and step 204 ′ are not limited to being executed synchronously as shown in the figure. Step 204 may be executed first and then step 204 ′, or step 204 ′ may be executed first and then step 204 ′.

[0088] After the target business service is released, in order to ensure that the target business service is always available, it is necessary to automatically trigger the state detection of the target business according to the state detection rule, see step 205.

[0089] Step 205 : In response to the state detection request for the target business service, the target business service is called according to the state detection rule, and the state of the target business service is determined according to the calling result.

[0090] In step 205, the state detection of the target business service can be performed periodically, or a test time can be set, and the state detection of the target business service is triggered when the set test time is reached. For different business services, users can configure the timing strategy of state detection.

[0091] In step 205, if the call 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, then the business service is determined to be in an available state; if the call result is that no response message is received or the format of the response message is different from the standard response format, then the business service is determined to be in an unavailable state. At this time, an alarm message can be generated to facilitate the test developer to repair the business service in time after receiving the alarm message.

[0092] In this embodiment, by optimizing the publishing process of the business service, with the help of the test request parameters used to test the service before the service is released, status detection rules for automatically detecting the status of the business service are generated. Since the status detection rules used for status detection of the target business service are generated by the service during the testing phase, a status detection of the target business service is equivalent to simulating a real business call, and the detection result can truly reflect the status of the target business service with high accuracy.

[0093] In another embodiment, after the target business service is released for use, the call result of the business processing request for the user fed back by the target business service can also be detected through the status detection rules to determine the status of the target business service. Specifically: the user sends a business processing request, and the API gateway receives the business processing request and calls the corresponding target business service. If the call result is a response message returned by the target business service, and the format of the response message is the same as the standard response format corresponding to the target business service, then the business service is determined to be in an available state; if the call result is that the response message is not received or the format of the response message is different from the standard response format, then the business service is determined to be in an unavailable state. Thus, by analyzing and judging the call result of the user's business processing request through the status detection rules, the status of the target business service can be determined in real time. When the target business service is in an unavailable state, it can be discovered in time, an alarm message is generated, and the test developer is notified to perform maintenance.

[0094] Corresponding to the embodiment of the aforementioned business service status detection method, this specification also provides an embodiment of a business service status detection device and a terminal used therein.

[0095] Figure 4 This is a module diagram of a business service status detection device according to an exemplary embodiment of the present specification. The business service status detection device is applied to an API gateway and includes: a parameter acquisition module 401, a generation module 402 and a status detection module 403.

[0096] A parameter acquisition module 401 is used to acquire a test request parameter for a target business service, wherein the test request parameter is used to trigger a call to the target business service to perform a functional test on the target business service;

[0097] A generating module 402, configured to generate a status detection rule for a target business service according to the test request parameters;

[0098] The state detection module 403 is used to respond to a state detection request for a target business service, call the target business service according to the state detection rule, and determine the state of the target business service according to the call result.

[0099] Optionally, when the target business service is called according to the state detection rule and the state of the target business service is determined according to the call result, the state detection module is used to:

[0100] If the call result is receiving a response message returned by the target business service, and the format of the response message is the same as the standard response format corresponding to the target business service, then determining that the target business service is in an available state;

[0101] If the call result is that the response message is not received or the format of the response message is different from the standard response format, it is determined that the target business service is in an unavailable state.

[0102] Optionally, the status detection module is further used for:

[0103] If the service request result is receiving 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, then it is determined that the target service is in an available state, and the service request result is the result of calling the target service according to the service processing request sent by the user;

[0104] If the result of the service request is that the response message is not received or the format of the response message is different from the standard response format, it is determined that the target business service is in an unavailable state.

[0105] Optionally, the generating module is specifically used for:

[0106] Obtaining a test result of the functional test;

[0107] When the test result is receiving a response message returned by the target business service and the format of the response message is the same as the standard response format corresponding to the target business service, a status detection rule for the target business service is generated according to the test request parameters.

[0108] Optionally, the state detection device further includes:

[0109] A publishing module is used to publish the target business service when 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.

[0110] Optionally, the state detection device further includes:

[0111] The document acquisition module is used to acquire the registration document generated when the target business service is registered on the API gateway, and the registration document defines a standard response format of the target business service.

[0112] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. Ordinary technicians in this field can understand and implement it without paying creative work.

[0113] Figure 5 FIG. 1 is a schematic diagram of the structure of an electronic device according to an exemplary embodiment of the present invention, and shows a block diagram of an exemplary electronic device 50 suitable for implementing any embodiment of the present invention. Figure 5 The electronic device 50 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0114] like Figure 5 As shown, the electronic device 50 may be in the form of a general-purpose computing device, for example, it may be a server device. The components of the electronic device 50 may include, but are not limited to: at least one processor 51, at least one memory 52, and a bus 53 connecting different system components (including the memory 52 and the processor 51).

[0115] The bus 53 includes a data bus, an address bus, and a control bus.

[0116] The memory 52 may include a volatile memory, such as a random access memory (RAM) 521 and / or a cache memory 522 , and may further include a read-only memory (ROM) 523 .

[0117] The memory 52 may also include a program tool 525 (or utility) having a set (at least one) of program modules 524, such program modules 524 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0118] The processor 51 executes various functional applications and data processing by running the computer program stored in the memory 52, such as the method provided in any of the above embodiments.

[0119] The electronic device 50 may also communicate with one or more external devices 54 (e.g., keyboards, pointing devices, etc.). Such communication may be performed via an input / output (I / O) interface 55. Furthermore, the model-generated electronic device 50 may also 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 a network adapter 56. As shown, the network adapter 56 communicates with other modules of the model-generated electronic device 50 via a bus 53. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the model-generated electronic device 50, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.

[0120] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be embodied.

[0121] The embodiments of this specification also provide a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for detecting the status of a business service described in any of the above embodiments are implemented.

[0122] It should be understood that the present description is not limited to the precise structures that have been 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.

[0123] The above are only preferred embodiments of this specification and are not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.

Claims

1. A method for detecting the status of a business service, characterized in that: Applied to an API gateway, the API gateway stores a registration document of a target business service, and the status detection method includes: Acquire a test request parameter for the target business service from the registration document, wherein the test request parameter is used to trigger calling the target business service to perform a functional test on the target business service; Generate a status detection rule for the target business service according to the test request parameters; In response to a status detection request for a target business service, the target business service is called according to the status detection rule, and the status of the target business service is determined according to the calling result, including: if the calling result is receiving a reply message returned by the target business service, and the format of the reply message is the same as the standard reply format corresponding to the target business service, then the target business service is determined to be in an available state; if the calling result is not receiving the reply message or the format of the reply message is different from the standard reply format, then the target business service is determined to be in an unavailable state.

2. The method for detecting the status of a business service according to claim 1, characterized in that: The state detection method further includes: If the service request result is receiving 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, then it is determined that the target service is in an available state, and the service request result is the result of calling the target service according to the service processing request sent by the user; If the result of the service request is that the response message is not received or the format of the response message is different from the standard response format, it is determined that the target business service is in an unavailable state.

3. The method for detecting the status of a business service according to claim 1, characterized in that: The generating a status detection rule for a target business service according to the test request parameter includes: Obtaining a test result of the functional test; When the test result is receiving a response message returned by the target business service and the format of the response message is the same as the standard response format corresponding to the target business service, a status detection rule for the target business service is generated according to the test request parameters.

4. The method for detecting the state of a business service according to claim 3, characterized in that: The state detection method further includes: When 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 a standard response format corresponding to the target business service, the target business service is released.

5. The method for detecting the state of a business service according to any one of claims 1 to 4, characterized in that: The state detection method further includes: A registration document generated when the target business service is registered on the API gateway is obtained, wherein the registration document defines a standard response format of the target business service.

6. A device for detecting the status of a business service, characterized in that: Applied to an API gateway, the API gateway stores a registration document of a target business service, and the status detection device includes: A parameter acquisition module, used to acquire a test request parameter for the target business service from the registration document, wherein the test request parameter is used to trigger the call of the target business service to perform a functional test on the target business service; A generating module, used to generate a status detection rule for a target business service according to the test request parameters; A status detection module is used to respond to a status detection request for a target business service, call the target business service according to the status detection rule, and determine the status of the target business service according to the call result, including: if the call result is receiving a reply message returned by the target business service, and the format of the reply message is the same as the standard reply format corresponding to the target business service, then the target business service is determined to be in an available state; if the call result is not receiving the reply message or the format of the reply message is different from the standard reply format, then the target business service is determined to be in an unavailable state.

7. The device for detecting the state of a business service according to claim 6, characterized in that: The state detection module is also used for: If the service request result is receiving 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, then it is determined that the target service is in an available state, and the service request result is the result of calling the target service according to the service processing request sent by the user; If the result of the service request is that the response message is not received or the format of the response message is different from the standard response format, it is determined that the target business service is in an unavailable state.

8. The device for detecting the state of a business service according to claim 6, characterized in that: The generation module is used for: Obtaining a test result of the functional test; When the test result is receiving a response message returned by the target business service and the format of the response message is the same as the standard response format corresponding to the target business service, a status detection rule for the target business service is generated according to the test request parameters.

9. The device for detecting the state of a business service according to claim 8, characterized in that: The state detection device also includes: A publishing module is used to publish the target business service when 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.

10. The device for detecting the state of a business service according to any one of claims 6 to 9, characterized in that: The state detection device also includes: The document acquisition module is used to acquire the registration document generated when the target business service is registered on the API gateway, and the registration document defines a standard response format of the target business service.

11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for detecting the state of the business service according to any one of claims 1 to 5 is implemented.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for detecting the status of a business service according to any one of claims 1 to 5 are implemented.