CN111597020A - Application Programming Interface (API) debugging method and debugging terminal - Google Patents

Application Programming Interface (API) debugging method and debugging terminal Download PDF

Info

Publication number
CN111597020A
CN111597020A CN202010332019.1A CN202010332019A CN111597020A CN 111597020 A CN111597020 A CN 111597020A CN 202010332019 A CN202010332019 A CN 202010332019A CN 111597020 A CN111597020 A CN 111597020A
Authority
CN
China
Prior art keywords
application programming
programming interface
application
parameter value
communication request
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
Application number
CN202010332019.1A
Other languages
Chinese (zh)
Other versions
CN111597020B (en
Inventor
李丁辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuba Co Ltd
Original Assignee
Wuba Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuba Co Ltd filed Critical Wuba Co Ltd
Priority to CN202010332019.1A priority Critical patent/CN111597020B/en
Publication of CN111597020A publication Critical patent/CN111597020A/en
Application granted granted Critical
Publication of CN111597020B publication Critical patent/CN111597020B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software

Abstract

The application discloses an Application Programming Interface (API) debugging method and a debugging terminal, wherein the method comprises the following steps: sending a communication request to a target application program, wherein the communication request comprises information of a first application programming interface and a target parameter value corresponding to the first application programming interface; receiving a feedback result obtained by the target application program according to the communication request, wherein the feedback result is obtained by the target application program executing the first application programming interface according to the information of the first application programming interface and a target parameter value corresponding to the first application programming interface, wherein the information of the first application programming interface is contained in the communication request; and under the condition that the feedback result is matched with the expected result corresponding to the target parameter value, determining that the debugging of the first application programming interface called by each application program in the plurality of application programs is successful. Therefore, the first application programming interfaces in different application programs do not need to be debugged respectively, and the debugging workload is reduced.

Description

Application Programming Interface (API) debugging method and debugging terminal
Technical Field
The invention relates to the technical field of communication, in particular to an Application Programming Interface (API) debugging method and a debugging terminal.
Background
Due to the wide variety of Application (APP) products, when a certain service function is developed by using Hybrid H5, it needs to run in multiple APPs, and thus, a very large compatible cost occurs. The concrete expression is as follows: for the same function, different versions of the same APP have very large differences; there are large differences in the parameter and return value formats of different APPs, and so on. For this reason, the front-end page needs to make a large number of compatibility decisions, which significantly increases the difficulty of development, debugging, and testing.
In order to solve the above problems, in the prior art, an APP factory plan is proposed, which aims to make the upper layer function different and the bottom layer technology uniform. For example, an adapter library may be abstracted for each APP, an API (Application Programming Interface) is provided at an upper layer, and a corresponding adaptation scheme is made for different APPs in the adapter library. However, for the same API in different APPs, the upper layer can implement uniform encapsulation only if the API has the same function, for example, the input and output modes are the same. In fact, in most cases, the functions of the same API in different APPs are different, that is, most APIs cannot implement uniform encapsulation. Therefore, for the same API in different APPs, when the functions of the API in each APP are different, a developer needs to debug the API in each APP. As many APPs exist, the number of times of corresponding debugging is needed, and the debugging workload is large.
Disclosure of Invention
The invention aims to provide an Application Programming Interface (API) debugging method and a debugging terminal, which are used for solving the problems that in the prior art, the number of corresponding times of debugging is needed for a plurality of APPs, and the debugging workload is large.
In a first aspect, the present application provides an API debugging method for an API, applied to a debugging terminal, including:
sending a communication request to a target application program, wherein the communication request comprises information of a first application programming interface and a target parameter value corresponding to the first application programming interface, the target application program is any one of a plurality of application programs calling the first application programming interface, and a protocol format of the communication request is suitable for any one of the plurality of application programs;
receiving a feedback result obtained by the target application program according to the communication request, wherein the feedback result is obtained by the target application program executing the first application programming interface according to the information of the first application programming interface and a target parameter value corresponding to the first application programming interface, which are included in the communication request;
and determining that the debugging of the first application programming interface called by each application program in the plurality of application programs is successful under the condition that the feedback result is matched with the expected result corresponding to the target parameter value.
Further, the first application programming interface includes at least two second application programming interfaces, and the feedback result is obtained by the target application executing each second application programming interface according to information of each second application programming interface in the at least two second application programming interfaces and a target parameter value corresponding to each second application programming interface included in the communication request.
In a second aspect, the present application further provides another method for debugging an API, which is applied to a debugging terminal, and includes:
receiving a communication request sent by a target page, wherein the communication request comprises information of a first application programming interface and a target parameter value corresponding to the first application programming interface;
executing the first application programming interface according to the information of the first application programming interface contained in the communication request and a target parameter value corresponding to the first application programming interface to obtain a feedback result;
and sending the feedback result to the target page.
Further, after the step of receiving the communication request sent by the target page, before the step of executing the first application programming interface according to the information of the first application programming interface and the target parameter value corresponding to the first application programming interface included in the communication request and obtaining the feedback result, the method further includes:
verifying whether the target parameter value is matched with a mandatory fill parameter value corresponding to the first application programming interface;
and executing the first application programming interface according to the information of the first application programming interface contained in the communication request and the target parameter value corresponding to the first application programming interface to obtain a feedback result under the condition that the target parameter value is matched with the required filling parameter value corresponding to the first application programming interface.
In a third aspect, the present application further provides a debug terminal, including:
a sending module, configured to send a communication request to a target application program, where the communication request includes information of a first application programming interface and a target parameter value corresponding to the first application programming interface, the target application program is any one of a plurality of application programs that call the first application programming interface, and a protocol format of the communication request is applicable to any one of the plurality of application programs;
a receiving module, configured to receive a feedback result obtained by the target application according to the communication request, where the feedback result is obtained by the target application executing the first application programming interface according to the information of the first application programming interface included in the communication request and a target parameter value corresponding to the first application programming interface;
and the determining module is used for determining that the debugging of the first application programming interface called by each application program in the plurality of application programs is successful under the condition that the feedback result is matched with the expected result corresponding to the target parameter value.
Further, the first application programming interface includes at least two second application programming interfaces, and the feedback result is obtained by the target application executing each second application programming interface according to information of each second application programming interface in the at least two second application programming interfaces and a target parameter value corresponding to each second application programming interface included in the communication request.
In a fourth aspect, the present application further provides a debug terminal, including:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a communication request sent by a target page, and the communication request comprises information of a first application programming interface and a target parameter value corresponding to the first application programming interface;
the first execution module is used for executing the first application programming interface according to the information of the first application programming interface contained in the communication request and a target parameter value corresponding to the first application programming interface to obtain a feedback result;
and the sending module is used for sending the feedback result to the target page.
Further, the debugging terminal further includes:
the verification module is used for verifying whether the target parameter value is matched with a required filling parameter value corresponding to the first application programming interface;
and a second execution module, configured to execute, when the target parameter value matches a padding required parameter value corresponding to the first application programming interface, the step of executing the first application programming interface according to the information of the first application programming interface included in the communication request and the target parameter value corresponding to the first application programming interface, so as to obtain a feedback result.
In a fifth aspect, the present application further provides an electronic device, including:
a memory for storing program instructions;
and the processor is used for calling and executing the program instructions in the memory so as to realize the API (application programming interface) debugging method of the first aspect.
In a sixth aspect, the present application further provides a readable storage medium, where a computer program is stored in the readable storage medium, and when at least one processor of the debug terminal executes the computer program, the debug terminal executes the API debugging method of the first aspect.
As can be seen from the foregoing technical solutions, in an application programming interface API debugging method and a debugging terminal according to an embodiment of the present invention, a communication request is sent to a target application program, where the communication request includes information of a first application programming interface and a target parameter value corresponding to the first application programming interface, the target application program is any one of a plurality of application programs that call the first application programming interface, and a protocol format of the communication request is applicable to any one of the plurality of application programs; receiving a feedback result obtained by the target application program according to the communication request, wherein the feedback result is obtained by the target application program executing the first application programming interface according to the information of the first application programming interface and a target parameter value corresponding to the first application programming interface, which are included in the communication request; and determining that the debugging of the first application programming interface called by each application program in the plurality of application programs is successful under the condition that the feedback result is matched with the expected result corresponding to the target parameter value. In this way, a communication request may be sent to the target application and a feedback result obtained by the target application in accordance with the communication request may be received. In the case that the feedback result matches the expected result corresponding to the target parameter value, it may be determined that the debugging of the first application programming interface invoked by each of the plurality of application programs is successful. The first application programming interfaces in different applications do not need to be debugged respectively, and the debugging workload is reduced.
Drawings
In order to more clearly explain the technical solution of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious to those skilled in the art that other drawings can be obtained according to the drawings without any creative effort.
FIG. 1 is a flowchart of an API debugging method according to the present invention;
FIG. 2 is a flowchart of another API debugging method according to the present invention;
FIG. 3 is a block diagram of a debug terminal according to the present invention;
FIG. 4 is a block diagram of another debug terminal provided by the present invention;
FIG. 5 is a block diagram of another debug terminal provided by the present invention;
fig. 6 is a schematic diagram of a hardware structure of an electronic device according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart of an API debugging method for an application programming interface according to the present invention, which is applied to a debugging terminal. As shown in fig. 1, the method comprises the following steps:
step 101, sending a communication request to a target application program, where the communication request includes information of a first application programming interface and a target parameter value corresponding to the first application programming interface, the target application program is any one of a plurality of application programs calling the first application programming interface, and a protocol format of the communication request is applicable to any one of the plurality of application programs.
In step 101, the target page may send a communication request to the target application, where the communication request may include information of the first application programming interface and a target parameter value corresponding to the first application programming interface, that is, the communication request may include information of the first API and a target parameter value corresponding to the first API. The target application is any one of a plurality of applications that call the first application programming interface, and the protocol format of the communication request is adapted to any one of the plurality of applications. The information of the first API may be a name of the first API.
In this embodiment, the communication request may be designed as:
app_schema://method/api_name?params=params&success=success&fail=fail&complete=complete&debug=true;
the communication request includes information of the first API, that is, the name of the first API is "API _ name"; the target parameter value corresponding to the first API included in the communication request is 'params'.
The "method" in the communication request may be a semantic method multiplexed with hypertext transfer protocol (HTTP).
method Semantics
get Request for
post Creating
options Query
delete Deleting
The meaning of each field in the above communication request is shown in the following table:
field(s) Type (B) Description of the invention
app_schema Character string Private protocol header for APP
method Character string options/get/post/delete
api_name Character string Name of api
params Character string Parameter(s)
success Character string Successful callback function name
fail Character string Callback letter after failureNumber name
complete Character string Callback function name regardless of success or failure
debug Boolean value Whether debugging is turned on and an error stack is printed
And 102, receiving a feedback result obtained by the target application program according to the communication request, wherein the feedback result is obtained by the target application program executing the first application programming interface according to the information of the first application programming interface included in the communication request and a target parameter value corresponding to the first application programming interface.
In step 102, the target page may receive a feedback result obtained by the target application according to the communication request. And the feedback result is obtained by executing the first application programming interface by the target application according to the information of the first application programming interface contained in the communication request and the target parameter value corresponding to the first application programming interface.
Optionally, the first application programming interface includes at least two second application programming interfaces, and the feedback result is obtained by executing each second application programming interface by the target application according to information of each second application programming interface in the at least two second application programming interfaces and a target parameter value corresponding to each second application programming interface included in the communication request.
It should be noted that the communication cost between the target page and the target application is relatively high. If multiple APIs in the target application are called, multiple communication requests need to be sent accordingly, which affects the response speed. Therefore, in this application, the first application programming interface may include at least two second application programming interfaces, and the feedback result is a feedback result obtained by the target application executing each second application programming interface according to the information of each second application programming interface of the at least two second application programming interfaces included in the communication request and the target parameter value corresponding to each second application programming interface. I.e. the first API may comprise at least two second APIs. The feedback result is obtained by the target application program executing each second API according to the information of each second API in the at least two second APIs contained in the communication request and the target parameter value corresponding to each second API.
For example, when multiple APIs in a target application are desired to be invoked, the corresponding communication requests may be as follows:
app_schema://method/combo/api_name1/api_name2/api_name3?params=params&success=success&fail=fail&complete=complete&debug=true;
at this time, it is possible to realize simultaneous calls of three APIs, one API indicated by API _ name1, one API indicated by API _ name2, and one API indicated by API _ name3, respectively, by the communication request. Therefore, when a plurality of APIs in the target application program are called, a plurality of communication requests do not need to be correspondingly sent, and only one communication request needs to be sent, so that the response speed is improved.
Correspondingly, the feedback result at this time is an array, and the array includes the feedback result corresponding to each API in the called APIs.
Further, the feedback result may contain an API field for characterizing the version and state of the current API. As shown in the following table:
field(s) Type (B) Means of
version string Versions, e.g. 1.2.1
status string State, indicating whether it is stable or paused
103, determining that the first application programming interface called by each application program in the plurality of application programs is successfully debugged under the condition that the feedback result is matched with the expected result corresponding to the target parameter value.
In step 103, in the case that the feedback result matches the expected result corresponding to the target parameter value, it may be determined that the debugging of the first application programming interface invoked by each of the plurality of applications is successful. For example, when the first API is debugged, if the target parameter value corresponding to the first API filled in the communication request meets the parameter requirement of the first API, the expected result corresponding to the target parameter value corresponding to the first API filled in the communication request is "success". If the feedback result is actually "success" at this time, it indicates that the first API is successfully debugged. Or, if the target parameter value corresponding to the first API filled in the communication request does not meet the parameter requirement of the first API, the expected result corresponding to the target parameter value corresponding to the first API filled in the communication request is "fail". If the feedback result is indeed "fail" at this time, the first API may also be considered to be successfully debugged.
It should be noted that, in the prior art, for the same API in different APPs, when the function of the API in each APP is different, a developer needs to debug the API in each APP. As many APPs exist, the number of times of corresponding debugging is needed, and the debugging workload is large.
In the present application, a communication request may be sent to a target application program, and a feedback result obtained by the target application program according to the communication request may be received. In the case that the feedback result matches the expected result corresponding to the target parameter value, it may be determined that the debugging of the first application programming interface invoked by each of the plurality of application programs is successful. The first application programming interfaces in different applications do not need to be debugged respectively, and the debugging workload is reduced.
As can be seen from the foregoing technical solutions, an API debugging method provided in an embodiment of the present invention is applied to a debugging terminal, and sends a communication request to a target application program, where the communication request includes information of a first application programming interface and a target parameter value corresponding to the first application programming interface, the target application program is any one of a plurality of application programs that call the first application programming interface, and a protocol format of the communication request is suitable for any one of the plurality of application programs; receiving a feedback result obtained by the target application program according to the communication request, wherein the feedback result is obtained by the target application program executing the first application programming interface according to the information of the first application programming interface and a target parameter value corresponding to the first application programming interface, which are included in the communication request; and determining that the debugging of the first application programming interface called by each application program in the plurality of application programs is successful under the condition that the feedback result is matched with the expected result corresponding to the target parameter value. In this way, a communication request may be sent to the target application and a feedback result obtained by the target application in accordance with the communication request may be received. In the case that the feedback result matches the expected result corresponding to the target parameter value, it may be determined that the debugging of the first application programming interface invoked by each of the plurality of application programs is successful. The first application programming interfaces in different applications do not need to be debugged respectively, and the debugging workload is reduced.
Referring to fig. 2, fig. 2 is a flowchart of another API debugging method for an API, which is applied to a debugging terminal. As shown in fig. 2, the method comprises the following steps:
step 201, receiving a communication request sent by a target page, where the communication request includes information of a first application programming interface and a target parameter value corresponding to the first application programming interface.
In step 201, the target application may receive a communication request sent by the target page. The communication request may include information of the first application programming interface and a target parameter value corresponding to the first application programming interface. That is, the communication request may include information of the first API and a target parameter value corresponding to the first API. The information of the first API may be a name of the first API.
In this embodiment, the communication request may be designed as:
app_schema://method/api_name?params=params&success=success&fail=fail&complete=complete&debug=true;
the communication request includes information of the first API, that is, the name of the first API is "API _ name"; the target parameter value corresponding to the first API included in the communication request is 'params'.
Optionally, after the step of receiving the communication request sent by the target page, before the step of executing the first application programming interface according to the information of the first application programming interface and the target parameter value corresponding to the first application programming interface included in the communication request and obtaining the feedback result, the method further includes:
verifying whether the target parameter value is matched with a mandatory fill parameter value corresponding to the first application programming interface;
and executing the first application programming interface according to the information of the first application programming interface contained in the communication request and the target parameter value corresponding to the first application programming interface to obtain a feedback result under the condition that the target parameter value is matched with the required filling parameter value corresponding to the first application programming interface.
It may be verified whether a target parameter value corresponding to the first application programming interface matches a fill required parameter value corresponding to the first application programming interface. For example, the first application programming interface may be a sharing API, and the required fill parameter value corresponding to the first application programming interface, that is, the required fill parameter value corresponding to the sharing API may be a title (title) and a Uniform Resource Locator (URL). Whether the target parameter value (params) corresponding to the sharing API included in the communication request matches the fill-necessary parameter value corresponding to the sharing API may be verified, that is, whether the target parameter value (params) corresponding to the sharing API included in the communication request includes the fill-necessary parameter value corresponding to the sharing API may be verified: title, and URL.
When the target parameter value corresponding to the first application programming interface is matched with the required filling parameter value corresponding to the first application programming interface, that is, when the target parameter value corresponding to the sharing API is matched with the required filling parameter value corresponding to the sharing API, that is, when the target parameter value (params) corresponding to the sharing API included in the communication request includes the required filling parameter value corresponding to the sharing API: and under the condition of title and URL, executing the first application programming interface according to the information of the first application programming interface contained in the communication request and the target parameter value corresponding to the first application programming interface to obtain a feedback result.
Step 202, executing the first application programming interface according to the information of the first application programming interface included in the communication request and a target parameter value corresponding to the first application programming interface, and obtaining a feedback result.
In step 202, the target application may execute the first application programming interface according to the information of the first application programming interface included in the communication request and the target parameter value corresponding to the first application programming interface, and obtain the feedback result. That is, the target application program can execute the first application programming interface indicated by the api _ name according to the api _ name and params contained in the communication request, and obtain the feedback result.
As previously mentioned, the cost of communication between the target page and the target application is relatively high. If multiple APIs in the target application are called, multiple communication requests need to be sent accordingly, which affects the response speed. Thus, in the present application, the first API may include at least two second APIs. The feedback result is obtained by the target application program executing each second API according to the information of each second API in the at least two second APIs contained in the communication request and the target parameter value corresponding to each second API.
For example, when multiple APIs in a target application are desired to be invoked, the corresponding communication requests may be as follows:
app_schema://method/combo/api_name1/api_name2/api_name3?params=params&success=success&fail=fail&complete=complete&debug=true;
at this time, it is possible to realize simultaneous calls of three APIs, one API indicated by API _ name1, one API indicated by API _ name2, and one API indicated by API _ name3, respectively, by the communication request. Therefore, when a plurality of APIs in the target application program are called, a plurality of communication requests do not need to be correspondingly sent, and only one communication request needs to be sent, so that the response speed is improved.
Correspondingly, the feedback result at this time is an array, and the array includes the feedback result corresponding to each API in the called APIs.
Further, the first API may be executed according to information of the first API included in the communication request and a target parameter value corresponding to the first API, and the execution success information may be obtained if the execution succeeds, or the execution failure information may be obtained if the execution fails.
Step 203, sending the feedback result to the target page.
In step 203, the target application may send the feedback results to the target page.
As can be seen from the foregoing technical solutions, the API debugging method for an application programming interface provided in the embodiments of the present invention is applied to a debugging terminal, and receives a communication request sent by a target page, where the communication request includes information of a first application programming interface and a target parameter value corresponding to the first application programming interface; executing the first application programming interface according to the information of the first application programming interface contained in the communication request and a target parameter value corresponding to the first application programming interface to obtain a feedback result; and sending the feedback result to the target page. Therefore, the communication request sent by the target page can be received, the first application programming interface is executed according to the information of the first application programming interface contained in the communication request and the target parameter value corresponding to the first application programming interface, and the feedback result is obtained. And then sending a feedback result to the target page. In the case that the feedback result matches the expected result corresponding to the target parameter value, it may be determined that the debugging of the first application programming interface invoked by each of the plurality of application programs is successful. The first application programming interfaces in different applications do not need to be debugged respectively, and the debugging workload is reduced.
Referring to fig. 3, fig. 3 is a structural diagram of a debug terminal provided by the present invention. As shown in fig. 3, the debug terminal 300 includes a sending module 301, a receiving module 302, and a determining module 303, wherein:
a sending module 301, configured to send a communication request to a target application, where the communication request includes information of a first application programming interface and a target parameter value corresponding to the first application programming interface, the target application is any one of multiple applications that call the first application programming interface, and a protocol format of the communication request is applicable to any one of the multiple applications;
a receiving module 302, configured to receive a feedback result obtained by the target application according to the communication request, where the feedback result is obtained by the target application executing the first application programming interface according to the information of the first application programming interface included in the communication request and a target parameter value corresponding to the first application programming interface;
a determining module 303, configured to determine that the debugging of the first application programming interface invoked by each of the multiple application programs is successful when the feedback result matches the expected result corresponding to the target parameter value.
Optionally, the first application programming interface includes at least two second application programming interfaces, and the feedback result is obtained by executing each second application programming interface by the target application according to information of each second application programming interface in the at least two second application programming interfaces and a target parameter value corresponding to each second application programming interface included in the communication request.
The debugging terminal 300 can implement each process implemented by the debugging terminal in the method embodiment of fig. 1, and is not described herein again to avoid repetition. And the debugging terminal 300 may implement sending a communication request to the target application program and receiving a feedback result obtained by the target application program according to the communication request. In the case that the feedback result matches the expected result corresponding to the target parameter value, it may be determined that the debugging of the first application programming interface invoked by each of the plurality of application programs is successful. The first application programming interfaces in different applications do not need to be debugged respectively, and the debugging workload is reduced.
Referring to fig. 4, fig. 4 is a structural diagram of another debugging terminal provided by the present invention. As shown in fig. 4, the debug terminal 400 includes a receiving module 401, a first executing module 402, and a sending module 403, wherein:
a receiving module 401, configured to receive a communication request sent by a target page, where the communication request includes information of a first application programming interface and a target parameter value corresponding to the first application programming interface;
a first executing module 402, configured to execute the first application programming interface according to the information of the first application programming interface included in the communication request and a target parameter value corresponding to the first application programming interface, so as to obtain a feedback result;
a sending module 403, configured to send the feedback result to the target page.
Optionally, as shown in fig. 5, the debug terminal further includes:
a verifying module 404, configured to verify whether the target parameter value matches a padding parameter value corresponding to the first application programming interface;
a second executing module 405, configured to execute, when the target parameter value matches a padding required parameter value corresponding to the first application programming interface, the step of executing the first application programming interface according to the information of the first application programming interface included in the communication request and the target parameter value corresponding to the first application programming interface, so as to obtain a feedback result.
The debugging terminal 400 can implement each process implemented by the debugging terminal in the method embodiment of fig. 2, and is not described herein again to avoid repetition. The debugging terminal 400 may receive the communication request sent by the target page, execute the first application programming interface according to the information of the first application programming interface included in the communication request and the target parameter value corresponding to the first application programming interface, and obtain the feedback result. And then sending a feedback result to the target page. In the case that the feedback result matches the expected result corresponding to the target parameter value, it may be determined that the debugging of the first application programming interface invoked by each of the plurality of application programs is successful. The first application programming interfaces in different applications do not need to be debugged respectively, and the debugging workload is reduced.
Fig. 6 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention. As shown in fig. 6, the electronic device includes:
a memory 601 for storing program instructions;
the processor 602 is configured to call and execute the program instructions in the memory to implement the API debugging method in the foregoing embodiment. Reference may be made in particular to the description in relation to the preceding embodiments.
In this embodiment, the processor 602 and the memory 601 may be connected by a bus or other means. The processor may be a general-purpose processor, such as a central processing unit, a digital signal processor, an application specific integrated circuit, or one or more integrated circuits configured to implement embodiments of the present invention. The memory may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, a hard disk, or a solid state disk.
An embodiment of the present invention further provides a readable storage medium, including: the readable storage medium stores a computer program, and when at least one processor of the debugging terminal executes the computer program, the debugging terminal executes the API debugging method in the above embodiment.
The readable storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a Random Access Memory (RAM).
Those skilled in the art will readily appreciate that the techniques of the embodiments of the present invention may be implemented as software plus a required general purpose hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The same and similar parts in the various embodiments in this specification may be referred to each other. In particular, as for the embodiments of the debugging terminal, the electronic device and the readable storage medium, since they are substantially similar to the embodiments of the method, the description is simple, and the relevant points can be referred to the description in the embodiments of the method.
The above-described embodiments of the present invention should not be construed as limiting the scope of the present invention.

Claims (10)

1. An API (application programming interface) debugging method is applied to a debugging terminal and is characterized by comprising the following steps:
sending a communication request to a target application program, wherein the communication request comprises information of a first application programming interface and a target parameter value corresponding to the first application programming interface, the target application program is any one of a plurality of application programs calling the first application programming interface, and a protocol format of the communication request is suitable for any one of the plurality of application programs;
receiving a feedback result obtained by the target application program according to the communication request, wherein the feedback result is obtained by the target application program executing the first application programming interface according to the information of the first application programming interface and a target parameter value corresponding to the first application programming interface, which are included in the communication request;
and determining that the debugging of the first application programming interface called by each application program in the plurality of application programs is successful under the condition that the feedback result is matched with the expected result corresponding to the target parameter value.
2. The method according to claim 1, wherein the first application programming interface comprises at least two second application programming interfaces, and the feedback result is obtained by the target application executing each second application programming interface according to information of each second application programming interface of the at least two second application programming interfaces and a target parameter value corresponding to each second application programming interface included in the communication request.
3. An API (application programming interface) debugging method is applied to a debugging terminal and is characterized by comprising the following steps:
receiving a communication request sent by a target page, wherein the communication request comprises information of a first application programming interface and a target parameter value corresponding to the first application programming interface;
executing the first application programming interface according to the information of the first application programming interface contained in the communication request and a target parameter value corresponding to the first application programming interface to obtain a feedback result;
and sending the feedback result to the target page.
4. The method according to claim 3, wherein after the step of receiving the communication request sent by the target page, before the step of executing the first application programming interface according to the information of the first application programming interface included in the communication request and the target parameter value corresponding to the first application programming interface and obtaining the feedback result, the method further comprises:
verifying whether the target parameter value is matched with a mandatory fill parameter value corresponding to the first application programming interface;
and executing the first application programming interface according to the information of the first application programming interface contained in the communication request and the target parameter value corresponding to the first application programming interface to obtain a feedback result under the condition that the target parameter value is matched with the required filling parameter value corresponding to the first application programming interface.
5. A debug terminal, comprising:
a sending module, configured to send a communication request to a target application program, where the communication request includes information of a first application programming interface and a target parameter value corresponding to the first application programming interface, the target application program is any one of a plurality of application programs that call the first application programming interface, and a protocol format of the communication request is applicable to any one of the plurality of application programs;
a receiving module, configured to receive a feedback result obtained by the target application according to the communication request, where the feedback result is obtained by the target application executing the first application programming interface according to the information of the first application programming interface included in the communication request and a target parameter value corresponding to the first application programming interface;
and the determining module is used for determining that the debugging of the first application programming interface called by each application program in the plurality of application programs is successful under the condition that the feedback result is matched with the expected result corresponding to the target parameter value.
6. The debugging terminal according to claim 5, wherein the first application programming interface comprises at least two second application programming interfaces, and the feedback result is obtained when the target application executes each second application programming interface according to information of each second application programming interface of the at least two second application programming interfaces included in the communication request and a target parameter value corresponding to each second application programming interface.
7. A debug terminal, comprising:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a communication request sent by a target page, and the communication request comprises information of a first application programming interface and a target parameter value corresponding to the first application programming interface;
the first execution module is used for executing the first application programming interface according to the information of the first application programming interface contained in the communication request and a target parameter value corresponding to the first application programming interface to obtain a feedback result;
and the sending module is used for sending the feedback result to the target page.
8. The debug terminal of claim 7, wherein said debug terminal further comprises:
the verification module is used for verifying whether the target parameter value is matched with a required filling parameter value corresponding to the first application programming interface;
and a second execution module, configured to execute, when the target parameter value matches a padding required parameter value corresponding to the first application programming interface, the step of executing the first application programming interface according to the information of the first application programming interface included in the communication request and the target parameter value corresponding to the first application programming interface, so as to obtain a feedback result.
9. An electronic device, comprising:
a memory for storing program instructions;
a processor for calling and executing the program instructions in the memory to implement the API debugging method of any one of claims 1-2.
10. A readable storage medium, wherein a computer program is stored in the readable storage medium, and when at least one processor of a debugging terminal executes the computer program, the debugging terminal executes the API debugging method according to any one of claims 1-2.
CN202010332019.1A 2020-04-24 2020-04-24 Application programming interface API debugging method and debugging terminal Active CN111597020B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010332019.1A CN111597020B (en) 2020-04-24 2020-04-24 Application programming interface API debugging method and debugging terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010332019.1A CN111597020B (en) 2020-04-24 2020-04-24 Application programming interface API debugging method and debugging terminal

Publications (2)

Publication Number Publication Date
CN111597020A true CN111597020A (en) 2020-08-28
CN111597020B CN111597020B (en) 2024-03-22

Family

ID=72185215

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010332019.1A Active CN111597020B (en) 2020-04-24 2020-04-24 Application programming interface API debugging method and debugging terminal

Country Status (1)

Country Link
CN (1) CN111597020B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112667239A (en) * 2020-12-17 2021-04-16 深圳集智数字科技有限公司 Method and device for acquiring data through Application Programming Interface (API)
CN115426266A (en) * 2022-10-09 2022-12-02 中国工商银行股份有限公司 Configuration issuing method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130290932A1 (en) * 2012-04-25 2013-10-31 Empire Technology Development Llc Application Programming Interface Testing Services
CN105099811A (en) * 2015-06-03 2015-11-25 北京金山安全软件有限公司 Interface testing method and device
CN110032511A (en) * 2019-03-19 2019-07-19 深圳市买买提信息科技有限公司 A kind of interface test method and interface testing equipment
CN110347604A (en) * 2019-07-11 2019-10-18 中国工商银行股份有限公司 Programming interface test method and equipment, electronic equipment and readable storage medium storing program for executing
CN110457205A (en) * 2019-07-05 2019-11-15 深圳壹账通智能科技有限公司 Interface test method, device, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130290932A1 (en) * 2012-04-25 2013-10-31 Empire Technology Development Llc Application Programming Interface Testing Services
CN105099811A (en) * 2015-06-03 2015-11-25 北京金山安全软件有限公司 Interface testing method and device
CN110032511A (en) * 2019-03-19 2019-07-19 深圳市买买提信息科技有限公司 A kind of interface test method and interface testing equipment
CN110457205A (en) * 2019-07-05 2019-11-15 深圳壹账通智能科技有限公司 Interface test method, device, computer equipment and storage medium
CN110347604A (en) * 2019-07-11 2019-10-18 中国工商银行股份有限公司 Programming interface test method and equipment, electronic equipment and readable storage medium storing program for executing

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112667239A (en) * 2020-12-17 2021-04-16 深圳集智数字科技有限公司 Method and device for acquiring data through Application Programming Interface (API)
CN115426266A (en) * 2022-10-09 2022-12-02 中国工商银行股份有限公司 Configuration issuing method and device
CN115426266B (en) * 2022-10-09 2024-04-30 中国工商银行股份有限公司 Configuration issuing method and device

Also Published As

Publication number Publication date
CN111597020B (en) 2024-03-22

Similar Documents

Publication Publication Date Title
CN111177005B (en) Service application testing method, device, server and storage medium
CN110365724B (en) Task processing method and device and electronic equipment
US11893331B2 (en) Device verification method, UVM verification platform, electronic apparatus and storage medium
CN110532182B (en) Automatic testing method and device for virtualization platform
CN111400246B (en) Asynchronous file import method, device, computer equipment and storage medium
CN111382084A (en) Test method and device and electronic equipment
CN111597020B (en) Application programming interface API debugging method and debugging terminal
CN110727581A (en) Collapse positioning method and electronic equipment
CN113687858A (en) Configuration file checking method and device, electronic equipment and storage medium
CN110955409B (en) Method and device for creating resources on cloud platform
CN109725887B (en) Data interaction method and device based on message research and development framework and terminal equipment
US7577541B1 (en) Test services provider
CN108664343B (en) State calling method and device for micro-service
CN114610598A (en) Test method, test device, electronic equipment and computer readable storage medium
CN111752820A (en) Pressure testing method of gPC interface, computer equipment and storage medium
CN112650689A (en) Test method, test device, electronic equipment and storage medium
CN113342353B (en) Mock data generation method and device
CN116450165A (en) Method, system, terminal and storage medium for quickly building environment and deploying program
CN111459819B (en) Software testing method and device, electronic equipment and computer readable medium
CN114115897A (en) Method for dynamically generating project local executable file based on nodejs script
CN111290897A (en) Asynchronous storage test method, electronic device, computer equipment and storage medium
CN111158661A (en) System interface docking method, device, medium and electronic equipment
US7082376B1 (en) State full test method executor
CN113901377B (en) Service calling method, device, storage medium and equipment of legacy system
CN116860651A (en) Automatic test method, device and storage medium

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