CN114756446A - Interface debugging method and device - Google Patents

Interface debugging method and device Download PDF

Info

Publication number
CN114756446A
CN114756446A CN202110029044.7A CN202110029044A CN114756446A CN 114756446 A CN114756446 A CN 114756446A CN 202110029044 A CN202110029044 A CN 202110029044A CN 114756446 A CN114756446 A CN 114756446A
Authority
CN
China
Prior art keywords
debugging
interface
parameter
debugged
page
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.)
Pending
Application number
CN202110029044.7A
Other languages
Chinese (zh)
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110029044.7A priority Critical patent/CN114756446A/en
Publication of CN114756446A publication Critical patent/CN114756446A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • G06F11/3644Software debugging by instrumenting at runtime

Abstract

The embodiment of the invention discloses an interface debugging method and device; after an interface debugging page corresponding to an interface to be debugged is displayed, the interface debugging page comprises a debugging control and at least one type of parameter input control corresponding to the debugging parameter, the at least one type of debugging parameter input in the parameter input control is received according to the type of the parameter input control to obtain a target debugging parameter, then the target debugging parameter is checked based on the type of the debugging parameter, when the target debugging parameter is checked to pass, debugging request information of the interface to be debugged is generated according to the target debugging parameter, when the debugging operation of the debugging control is responded, a debugging result of the interface to be debugged is displayed on the interface debugging page, and the debugging result is generated by a debugging server calling the interface to be debugged according to the debugging request information; the scheme can greatly improve the debugging efficiency of interface debugging.

Description

Interface debugging method and device
Technical Field
The invention relates to the technical field of communication, in particular to an interface debugging method and device.
Background
In recent years, with the rapid development of internet technology, more and more application program interfaces are developed, and the development efficiency of application programs is greatly promoted. Debugging of the application program interface is required when the application program is developed. The existing debugging method mainly carries out debugging through a debugging tool by manually understanding the interface document or referring to the content of the interface document.
In the course of research and practice of the prior art, the inventor of the present invention finds that for the interface debugging method, because the rules defined by each interface are different, the content of the interface document is manually understood or referred to, the use is complicated, and errors are easily generated when debugging parameters are input, so that the debugging efficiency of interface debugging is greatly reduced.
Disclosure of Invention
The embodiment of the invention provides an interface debugging method and device, which can improve the debugging efficiency of interface debugging.
An interface debugging method, comprising:
displaying an interface debugging page corresponding to an interface to be debugged, wherein the interface debugging page comprises a debugging control and at least one type of parameter input control corresponding to debugging parameters;
receiving at least one type of debugging parameter input in the parameter input control according to the type of the parameter input control to obtain a target debugging parameter;
checking the target debugging parameter based on the type of the debugging parameter;
when the target debugging parameter passes the verification, generating debugging request information of the interface to be debugged according to the target debugging parameter;
And when responding to the debugging operation of the debugging control, displaying the debugging result of the interface to be debugged on the interface debugging page, wherein the debugging result is generated by calling the interface to be debugged by a debugging server according to the debugging request information.
Optionally, an embodiment of the present invention may further provide another interface debugging method, including:
acquiring an interface document of at least one interface to be debugged, and reading interface information of the interface to be debugged in the interface document;
sending the interface information to a debugging terminal, so that the debugging terminal displays an interface debugging page corresponding to the interface to be debugged according to the interface information;
receiving debugging request information of the interface to be debugged, which is returned by the debugging terminal;
sending the debugging request information to an interface to be debugged through a proxy service interface, and receiving a debugging result returned by the interface to be debugged according to the debugging request information;
and sending the debugging result to the debugging terminal, so that the debugging terminal displays the debugging result on the interface debugging page.
Correspondingly, an embodiment of the present invention provides an interface debugging apparatus, including:
The debugging page display unit is used for displaying an interface debugging page corresponding to an interface to be debugged, and the interface debugging page comprises a debugging control and at least one type of parameter input control corresponding to debugging parameters;
the first receiving unit is used for receiving at least one type of debugging parameter input in the parameter input control according to the type of the parameter input control to obtain a target debugging parameter;
the checking unit is used for checking the target debugging parameters based on the types of the debugging parameters;
the generating unit is used for generating debugging request information of the interface to be debugged according to the target debugging parameters when the target debugging parameters pass the verification;
and the debugging result display unit is used for displaying the debugging result of the interface to be debugged on the interface debugging page in response to the debugging operation of the debugging control, and the debugging result is generated by calling the interface to be debugged by the debugging server according to the debugging request information.
Optionally, an embodiment of the present invention may further provide another interface debugging apparatus, including:
the device comprises an acquisition unit, a debugging unit and a debugging unit, wherein the acquisition unit is used for acquiring an interface document of at least one interface to be debugged and reading interface information of the interface to be debugged in the interface document;
The first sending unit is used for sending the interface information to a debugging terminal, so that the debugging terminal displays an interface debugging page corresponding to the interface to be debugged according to the interface information;
the second receiving unit is used for receiving debugging request information of the interface to be debugged, which is returned by the debugging terminal;
the calling unit is used for sending the debugging request information to an interface to be debugged through a proxy service interface and receiving a debugging result returned by the interface to be debugged according to the debugging request information;
and the second sending unit is used for sending the debugging result to the debugging terminal, so that the debugging terminal displays the debugging result on the interface debugging page.
Optionally, in some embodiments, the interface debugging apparatus may further include a page generating unit, where the page generating unit is specifically configured to receive interface information of at least one interface to be debugged, which is sent by the debugging server, to obtain an interface information set; screening out interface information of the interface to be debugged currently in the interface information set to obtain target interface information; analyzing the target interface information to obtain an interface request parameter of the interface to be debugged; and generating the interface debugging page according to the interface request parameters.
Optionally, in some embodiments, the page generating unit may be specifically configured to identify a data type of the interface description data of the interface to be debugged in the target interface information; determining an analysis mode corresponding to the interface description data according to the data type; and analyzing the interface description data based on the analysis mode to obtain the interface request parameters.
Optionally, in some embodiments, the page generating unit may be specifically configured to determine, according to the interface request parameter, a component data structure and a basic debugging parameter of a debugging component of the interface to be debugged; constructing an initial interface debugging page based on the component data structure; and adding the basic debugging parameters to the initial interface debugging page to obtain the interface debugging page.
Optionally, in some embodiments, the debugging page display unit may be specifically configured to adjust the parameter input control on the interface debugging page in response to an adjustment operation of the parameter adjustment control, so as to obtain an adjusted parameter input control; responding to the prompt operation of the prompt control, and displaying prompt information corresponding to the debugging parameters on the interface debugging page; the receiving at least one type of debugging parameter input in the parameter input control according to the type of the parameter input control to obtain a target debugging parameter includes: and receiving at least one type of debugging parameter input by the user according to the input identification and the prompt information in the adjusted parameter input control according to the type of the parameter input control to obtain a target debugging parameter.
Optionally, in some embodiments, the first receiving unit may be specifically configured to receive parameter information that is input by a user according to the input identifier and the prompt information in the adjusted parameter input control; classifying the parameter information according to the type of the input control; and converting the parameter information based on the classification result to obtain the target debugging parameter.
Optionally, in some embodiments, the debugging page display unit may be specifically configured to, in response to a selection operation of the scene selection control, screen out, from a preset scene debugging parameter set, a scene debugging parameter corresponding to a scene type of the scene selection control; displaying the scene debugging parameters on the interface debugging page; the receiving at least one type of debugging parameter input in the parameter input control according to the type of the parameter input control to obtain a target debugging parameter includes: and receiving the debugging parameters which are input by the parameter input control and are used for adjusting the scene debugging parameters according to the type of the parameter input control, and obtaining the target debugging parameters.
Optionally, in some embodiments, the debugging page display unit may be specifically configured to determine, in response to a selection operation of the history parameter selection control, a history debugging parameter identifier corresponding to the history parameter selection control; screening out historical debugging parameters corresponding to the historical debugging parameter identification from a preset historical debugging parameter set, and displaying the historical debugging parameters on the interface debugging page; the receiving at least one type of debugging parameter input in the parameter input control according to the type of the parameter input control to obtain a target debugging parameter includes: and taking the historical debugging parameters as the target debugging parameters.
Optionally, in some embodiments, the verification unit may be specifically configured to screen out candidate debugging parameters that need to be verified from the target debugging parameters according to the input identifier of the debugging parameter; determining a check rule of the candidate debugging parameters according to the parameter types of the candidate debugging parameters; based on the verification rule, verifying the candidate debugging parameters; when the target debugging parameter passes the verification, generating debugging information of the interface to be debugged according to the target debugging parameter, including: and when the candidate debugging parameters pass the inspection, generating debugging information of the interface to be debugged according to the target debugging parameters.
Optionally, in some embodiments, the generating unit may be specifically configured to convert the debugging request information into a debugging execution code in response to a viewing operation of the code viewing control; displaying the debugging execution code on the interface debugging page; copying the debugging execution code in response to the copying operation of the code copying control; and responding to the execution operation of the code execution control, and displaying the debugging result of the interface to be debugged on the interface debugging page.
Optionally, in some embodiments, the debugging result display unit may be specifically configured to send the debugging request information to the debugging server in response to the debugging operation of the debugging control; receiving a debugging result of the interface to be debugged, which is returned by the debugging server, aiming at the debugging request information; and displaying the debugging result on the interface debugging page.
Optionally, in some embodiments, the debugging result display unit may be specifically configured to perform code conversion on the debugging result to obtain a debugging code corresponding to the debugging result; displaying the debugging code on the interface debugging page; and copying the debugging code in response to the copying operation of the debugging code copying control.
Optionally, in some embodiments, the obtaining unit may be specifically configured to identify the interface document to obtain a document format of the interface document; when the document format is different from a preset document format, converting the document format of the interface document into the preset document format to obtain a target interface document; and reading the interface information of the interface to be debugged in the target interface document.
In addition, an embodiment of the present invention further provides an electronic device, which includes a processor and a memory, where the memory stores an application program, and the processor is configured to run the application program in the memory to implement the interface debugging method provided in the embodiment of the present invention.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a plurality of instructions are stored in the computer-readable storage medium, and the instructions are suitable for being loaded by a processor to perform steps in any one of the interface debugging methods provided in the embodiments of the present invention.
After an interface debugging page corresponding to an interface to be debugged is displayed, the interface debugging page comprises a debugging control and at least one type of parameter input control corresponding to the debugging parameter, then, the at least one type of debugging parameter input in the parameter input control is received according to the type of the parameter input control to obtain a target debugging parameter, then, the target debugging parameter is checked based on the type of the debugging parameter, when the target debugging parameter is checked to pass, debugging request information of the interface to be debugged is generated according to the target debugging parameter, when the debugging operation of the debugging control is responded, a debugging result of the interface to be debugged is displayed on the interface debugging page, and the debugging result is generated by a debugging server calling the interface to be debugged according to the debugging request information; according to the scheme, the debugging parameters are only required to be input through the parameter input control, and the debugging request information is generated according to the debugging parameters, so that the debugging result is directly displayed on the interface debugging page, the contents of the interface document or the reference interface document do not need to be manually understood, the complexity of the debugging process is greatly reduced, the input debugging parameters can be checked, and the debugging efficiency of interface debugging can be greatly improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of an interface debugging system provided by an embodiment of the present invention;
fig. 2 is a schematic view of a scenario of an interface debugging method according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of an interface debugging method according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a display interface request parameter provided by an embodiment of the invention;
FIG. 5 is a page diagram of an interface debug page provided by an embodiment of the present invention;
FIG. 6 is a diagram illustrating scene debugging parameters provided by an embodiment of the present invention;
FIG. 7 is a diagram illustrating debugging execution code provided by an embodiment of the invention;
FIG. 8 is a diagram of displaying debugging code provided by an embodiment of the invention;
fig. 9 is a schematic diagram of a debugging process of a debugging terminal according to an embodiment of the present invention;
fig. 10 is another flowchart illustrating an interface debugging method according to an embodiment of the present invention;
FIG. 11 is a diagram illustrating read interface information provided by an embodiment of the present invention;
FIG. 12 is an information diagram of a sub-level element provided by an embodiment of the invention;
FIG. 13 is an interaction flow diagram for interface debugging according to an embodiment of the present invention;
FIG. 14 is a schematic diagram illustrating a debugging process of interface debugging according to an embodiment of the present invention;
fig. 15 is a schematic structural diagram of a first interface debugging apparatus according to an embodiment of the present invention;
fig. 16 is a schematic structural diagram of a second interface debugging apparatus according to an embodiment of the present invention;
fig. 17 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the 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.
The embodiment of the invention provides an interface debugging method, an interface debugging device and a computer readable storage medium. The interface debugging device may be integrated in an electronic device, and the electronic device may be a server or a terminal. Specifically, the embodiment of the present invention provides an interface debugging apparatus (which may be referred to as a first interface debugging apparatus for differentiation) suitable for a first electronic device, and an interface debugging apparatus (which may be referred to as a second interface debugging apparatus for differentiation) suitable for a second electronic device.
The first electronic device may be a terminal, and the terminal may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, and the like, but is not limited thereto. The second electronic device may be a Network-side device such as a server, the server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a Network acceleration service (CDN), and a big data and artificial intelligence platform. The terminal and the server may be directly or indirectly connected through wired or wireless communication, and the application is not limited herein.
The embodiment of the invention introduces an interface debugging method by taking a first electronic device as a terminal and a second electronic device as a server as an example.
For example, referring to fig. 1, an interface debugging system provided by the embodiment of the present invention includes a debugging terminal 10, a debugging server 20, and the like, where the debugging terminal 10 and the debugging server 20 are connected through a network, for example, through an active or wireless network, and the like, where the interface debugging apparatus is integrated in the terminal, for example, in the form of a client.
The debugging terminal 10 may be configured to display an interface debugging page corresponding to the interface to be debugged, where the interface debugging page includes a debugging control and at least one type of parameter input control corresponding to the debugging parameter, then receive at least one type of debugging parameter input by the parameter input control according to the type of the parameter input control to obtain a target debugging parameter, then check the target debugging parameter based on the type of the debugging parameter, when the target debugging parameter passes the check, generate debugging request information of the interface to be debugged according to the target debugging parameter, and when responding to a debugging operation of the debugging control, display a debugging result of the interface to be debugged on the interface debugging page, where the debugging result is generated by the debugging server 20 calling the interface to be debugged according to the debugging request information, which may be specifically as shown in fig. 2.
Wherein, in response to the condition or state on which the operation to be performed depends being indicated, when the condition or state on which the operation depends is satisfied, the operation or operations to be performed may be in real time or may have a set delay; there is no restriction on the order of execution of the operations performed unless otherwise specified.
The Interface debugging may be understood as debugging an Application Programming Interface (API), and the debugging process may be regarded as testing the API.
The debugging server 20 may be configured to obtain an interface document of at least one interface to be debugged, read interface information of the interface to be debugged in the interface document, and send the interface information to the debugging terminal 10, so that the debugging terminal 10 displays an interface debugging page corresponding to the interface to be debugged according to the interface information, receive debugging request information of the interface to be debugged, which is returned by the debugging terminal 10, send the debugging request information to the interface to be debugged through the proxy service interface, receive a debugging result, which is returned by the interface to be debugged according to the debugging request information, and then send the debugging result to the debugging terminal 10, so that the debugging terminal displays a debugging result on the interface debugging page.
The following are detailed descriptions. It should be noted that the following description of the embodiments is not intended to limit the preferred order of the embodiments.
In this embodiment, the first interface debugging apparatus will be described in terms of a first interface debugging apparatus, where the first interface debugging apparatus may be specifically integrated in an electronic device, and the electronic device may be a terminal or another device; the terminal may include a tablet Computer, a notebook Computer, a Personal Computer (PC), a wearable device, a virtual reality device, or other devices such as a smart device capable of performing interface debugging.
An interface debugging method, comprising:
the interface debugging page corresponding to the interface to be debugged is displayed, the interface debugging page comprises a debugging control and at least one type of parameter input control corresponding to the debugging parameter, the debugging parameter of at least one type input in the parameter input control is received according to the type of the parameter input control to obtain a target debugging parameter, the target debugging parameter is checked based on the type of the debugging parameter, when the target debugging parameter is checked to pass, debugging request information of the interface to be debugged is generated according to the target debugging parameter, when the debugging operation of the debugging control is responded, the debugging result of the interface to be debugged is displayed on the interface debugging page, and the debugging result is generated by calling the interface to be debugged by a debugging server according to the debugging request information.
As shown in fig. 3, the specific flow of the interface debugging method is as follows:
101. and displaying an interface debugging page corresponding to the interface to be debugged.
The interface debugging page comprises a debugging control and at least one type of parameter input control corresponding to the debugging parameter, and can be a page for debugging the interface to be debugged and generated by interface information sent by a debugging server. The parameter input control can be of various types, and can include, for example, an input box, a drop-down box, a check box (or switch), or a selection list. The types of the parameter input controls corresponding to different types of debugging parameters can be the same or different.
For example, a user may operate on a user operation page of the debugging terminal to trigger display of an interface debugging page corresponding to the interface to be debugged, for example, the user performs selection operation on an interface selection page of the debugging client to trigger display of the interface debugging page corresponding to the interface to be debugged, and the interface selection page may provide various selection pages of the interface to be debugged for the user. For example, an interface selection control can be arranged on the interface selection page, and the representation form of the control can be various, such as an input box, an icon, a button and the like. The user can operate the interface selection control on the interface debugging page, for example, clicking, sliding and other triggering operations, and in response to the selection operation of the interface selection control, the display of the interface debugging page on the debugging terminal can be triggered.
Optionally, before displaying the interface debugging page corresponding to the interface to be debugged, interface information of the interface to be debugged, which is sent by the debugging server and selected by the user, needs to be received, and the interface debugging page is generated according to the interface information, so the interface debugging method may further include:
receiving interface information of at least one interface to be debugged sent by a debugging server to obtain an interface information set, screening out the interface information of the current interface to be debugged from the interface information set to obtain target interface information, analyzing the target interface information to obtain interface request parameters of the interface to be debugged, and generating an interface debugging page according to the interface request parameters, wherein the interface debugging page specifically comprises the following steps:
(1) And receiving interface information of at least one interface to be debugged sent by the debugging server to obtain an interface information set.
The Interface information may be information about an Interface defined in an Interface Description Language (IDL) in the Interface document. The IDL is used to describe interface definitions, such as parameter names, types, meanings, and constraints, and has a variety of implementation-specific formats, such as JSON, XML, or YAML.
For example, the interface information of the at least one interface to be debugged sent by the debug server may be directly received, for example, the debug server obtains an interface document, reads the interface information of the at least one interface to be debugged from the interface document, and directly sends the interface information to the first interface debugging apparatus, so that the first interface debugging apparatus directly obtains the interface information, thereby obtaining the interface information set. When the number of the interfaces to be debugged is large or the memory of the interface information is large, the interface information of at least one interface to be debugged sent by the debugging server may also be indirectly obtained, for example, after the debugging server obtains the interface document, the interface information is read from the interface document, the interface information is stored, the storage address is sent to the first interface debugging device, and after the first interface debugging device receives the storage address, the interface information is obtained according to the storage address, so as to obtain the interface information set.
(2) And screening the interface information of the interface to be debugged currently in the interface information set to obtain target interface information.
For example, interface information of the currently debugged interface to be debugged may be screened from the interface information set according to information of the interface to be debugged selected by the user on the interface selection page, for example, information such as an interface identifier or an interface address of the interface to be debugged selected by the user on the interface selection page is obtained, and interface information corresponding to the interface identifier or the interface address is screened from the interface information set, so as to obtain target interface information.
(3) And analyzing the target interface information to obtain the interface request parameters of the interface to be debugged.
The interface request parameter may be a parameter corresponding to a component data structure of the interface to be debugged, description information of the parameter, and the like.
For example, the data type of the interface description data of the interface to be debugged is identified in the target interface information, and the data type may include an array, an object, a character string, an integer, a boolean, a custom, a file type, or the like. Determining an analysis mode corresponding to the interface description data according to the data type, for example, when the data type is an array and an object, determining the analysis mode of the interface description data to be recursive analysis, where the recursive analysis may be multiple-level analysis performed on the interface description data in a recursive manner, so as to obtain information of the entire object or the array; when the data type is a character string, an integer, a boolean, a custom, a file type, or the like, it may be determined that the interface description data is parsed in a logical parsing manner, where the logical parsing method is to parse the interface description data by using specific targeted logic according to the difference of the data types, for example, when the data type is a character string, the interface description data is parsed by using specific parsing logic for the character string. Analyzing the interface description data to obtain interface request parameters based on an analysis mode, for example, when the data type is an array and an object, analyzing the interface description data to obtain initial interface request parameters by adopting a recursive analysis mode, and when the data type is a character string, an integer, a boolean, a custom or a file type, analyzing the interface description data to obtain initial interface request parameters by adopting a logic analysis mode, and fusing the initial interface request parameters to obtain the interface request parameters of the interface to be debugged. The interface request parameters may also be displayed on an interface debugging page, for example, taking the interface as an ad creative interface as an example, the detailed information of the interface request parameters of the ad creative interface displayed on the interface debugging page may be as shown in fig. 4.
(4) And generating an interface debugging page according to the interface request parameters.
For example, the component data structure and the basic debugging parameters of the debugging component of the interface to be debugged are determined according to the interface request parameters, for example, the data structure of the interface parameters of the interface to be debugged and the candidate debugging parameters corresponding to the interface parameters are identified in the interface request parameters, and the component data structure of the debugging component is determined according to the data structure of the interface parameters, for example, the data structure of the interface parameters is a-B-C, and B may include B1-B2-B3, so the component data structure may be the same as the data structure of the interface parameters. The candidate debugging parameters may also be used as basic debugging parameters of the debugging component, for example, a certain data parameter may include a plurality of enumeration values, and if a user needs to select at least one enumeration value from the enumeration values, the enumeration values may be used as the basic debugging parameters, and the user may select parameter values of the debugging parameters from the basic debugging parameters. And constructing an initial interface debugging page based on the component data structure, for example, constructing the component data structure by the page after initialization, and displaying to obtain the initial interface debugging page. For example, taking an enumeration value as an example, the enumeration value may be added to an enumeration value selection list of the initial interface debugging page, and then an interface debugging page may be obtained, taking the interface to be debugged as an advertisement creative interface as an example, and the interface debugging page corresponding to the interface to be debugged may be as shown in fig. 5.
Optionally, after displaying the interface debugging page corresponding to the interface to be debugged, the user may further manually increase or decrease the selectively filled debugging parameters and the like by triggering the parameter adjustment space, and therefore, the interface debugging method may further include:
responding to the adjustment operation of the parameter adjustment control, adjusting the parameter input control on the interface debugging page to obtain the adjusted parameter input control, responding to the prompt operation of the prompt control, displaying prompt information corresponding to the debugging parameter on the interface debugging page, receiving at least one type of debugging parameter input by a user in the adjusted parameter input control according to the input identification and the prompt information according to the type of the parameter input control, and obtaining the target debugging parameter.
For example, the interface debugging page may further include a parameter adjustment control, where the parameter adjustment control is used to increase or decrease the parameter input control, and the increased or decreased parameter input control is a padding parameter input control and is used to input the padded debugging parameters, where the padded debugging parameters may be understood as unnecessary debugging parameters, and corresponding to the unnecessary debugging parameters, the parameter adjustment control cannot adjust the parameter input control corresponding to the padding parameters. Therefore, for the object parameters, the user manually triggers the parameter adjusting control to increase or decrease the parameter input control of the filling parameters in the object on the interface debugging page, and for the parameters of the array type, the user can manually increase or decrease the parameter input control of the array elements, so that the adjusted parameter input control is obtained.
The interface debugging page may further include an input identifier and a prompt control of the debugging parameter, where the input identifier is used to identify whether the debugging parameter belongs to the required filling parameter, for example, the input identifier may be one, and when the identifier exists beside the parameter input control corresponding to the debugging parameter, it may be determined that the debugging parameter belongs to the required filling parameter, otherwise, it is determined that the debugging parameter belongs to the selected filling parameter. And the prompt control is used for prompting the use details of the debugging parameter so that the user can know the relevant information of the parameter. When a user triggers a prompt control on an interface debugging page, responding to the prompt operation of the prompt control, and displaying prompt information of debugging parameters corresponding to the prompt control triggered by the user on the interface debugging page. And receiving at least one type of debugging parameters input by the user according to the input identification and the prompt information after the parameter input control is adjusted according to the type of the parameter input control.
Optionally, the interface debugging page may further include a scene selection control of at least one scene type, where the scene selection control is used for a user to select a debugging scene of the interface to be debugged and debugging parameters in the debugging scene on the interface debugging page, after the interface debugging page corresponding to the interface to be debugged is displayed, multiple sets of scene parameters may also be preset on the interface debugging page, and by triggering the scene selection control, the preset debugging parameters in the debugging scene are displayed on the interface debugging page, therefore, the interface debugging method may further include:
And responding to the selection operation of the scene selection control, screening out scene debugging parameters corresponding to the scene type of the scene selection control from a preset scene debugging parameter set, displaying the scene debugging parameters on an interface debugging page, and receiving the debugging parameters which are input by the parameter input control and are used for adjusting the scene debugging parameters to obtain target debugging parameters according to the type of the parameter input control.
For example, a user triggers a scene selection control on an interface debugging page to select a debugging scene to be debugged, screens out a scene debugging parameter corresponding to the debugging scene from a preset scene debugging parameter set in response to the selection operation of the scene selection control, and displays a parameter value corresponding to the scene debugging parameter on the interface debugging page, as shown in fig. 6. When a user needs to modify the parameter value corresponding to the scene debugging parameter, the parameter value can be modified through the parameter input control corresponding to the scene debugging parameter, so that the target debugging parameter is obtained. So that the debugging is more convenient.
Optionally, the interface debugging page may further include at least one type of history parameter selection control, where the history parameter selection control is used for a user to select stored history debugging parameters on the interface debugging page, and after the interface debugging page is displayed, the user may further select the previously stored history debugging parameters to debug the interface to be debugged, and therefore, the interface debugging method may further include:
And responding to the selection operation of the historical parameter selection control, determining a historical debugging parameter identifier corresponding to the historical parameter selection control, screening out a historical debugging parameter corresponding to the historical debugging parameter identifier from a preset historical debugging parameter set, and displaying the historical debugging parameter on an interface debugging page. And taking the historical debugging parameters as target debugging information of the interface to be debugged.
For example, the user triggers a historical parameter selection control at an interface debugging page to select the previously saved historical debugging parameters, and in response to the selection operation of the historical parameter selection control, the historical debugging parameter identification corresponding to the historical parameter selection control is determined. And when the historical debugging parameters modified or adjusted by the user through the parameter input control are not received within the preset time, the historical debugging parameters can be used as target debugging parameters of the interface to be debugged.
102. And receiving at least one type of debugging parameter input by the parameter input control according to the type of the parameter input control to obtain a target debugging parameter.
For example, when the user does not adjust the parameter input control through the parameter adjustment control, at least one type of debugging parameter of the parameter input control can be received according to the type of the parameter input control, for example, the parameter information input by the user in the parameter input control according to the input identification and the prompt information can be received, for example, the user can input the parameter information in the parameter input control according to the input identification and the prompt information, the first interface debugging device can receive the parameter information input by the user according to the type of the parameter input control, for example, when the adjusting parameter is a character string or a numeric type parameter, the type of the parameter input control corresponding to the adjusting parameter can be an input box, the user directly inputs the content in the input box, the input content can be used as the parameter information, and the character string/shaping can be automatically adapted, the user can directly input the content in the input box. When the debugging parameter is a boolean parameter, the type of the corresponding parameter input control may be a check box (or a switch), and the user may directly click or select the corresponding content in the check box or the switch as the input parameter information. When the debugging parameter is an enumeration type parameter, the type of the parameter input control corresponding to the debugging parameter may be a drop-down box, the drop-down box may include at least one candidate enumeration value, and a user may directly select the at least one enumeration value as input parameter information in the drop-down box. When the type of the user is a self-defined structure which is not clearly defined, the type of the parameter input control corresponding to the user is an input box with a specific format, the specific format can be a json format, the user can directly input a character string with the json format in the input box, and the character string with the json format is used as input parameter information. The parameter information is classified according to the type of the input control, for example, the parameter information input by the user through the input box is classified into one type, the parameter information input through the drop-down box is classified into one type, and so on, and the parameter information is classified. The parameter information is converted based on the classification result, for example, the parameter information to be converted is determined from the parameter information based on the classification result, for example, information input through a drop-down box, a check box or a switch is converted, for example, a drop-down box is used as an example to convert drop-down box input selection information into debugging parameters corresponding to the selection information, and check information input through the check box is converted into debugging parameters corresponding to the check information. And fusing the debugging parameters obtained after the conversion and the debugging parameters which do not need to be converted to obtain the target debugging parameters of the interface to be debugged.
When a user adjusts the parameter input control through the parameter adjustment control, at least one type of debugging parameter input by the user according to the input identifier and the prompt information in the adjusted parameter input control is received according to the parameter input control to obtain a target debugging parameter, for example, the user receives the parameter input parameter information input by the user according to the input identifier and the prompt information in the adjusted parameter input control, the parameter information is classified according to the type of the input control, the parameter information is converted based on the classification result to obtain the target debugging parameter, and the specific process is as above, and is not repeated here.
When a user triggers a scene selection control, the user can receive debugging parameters which are input by the parameter input control and are used for adjusting the scene debugging parameters to obtain target debugging parameters, for example, the user can modify the scene debugging parameters through the parameter input control corresponding to the scene parameters on an interface debugging page, when the user triggers the parameter input control to modify the scene debugging parameters, the modified parameter information input by the parameter input control is received, the modified parameter information is classified based on the type of the parameter input control, the modified parameter information is converted based on the classification result to obtain the target debugging parameters, and the specific process is repeated.
When the user triggers the historical parameter selection control, the historical debugging parameters corresponding to the historical parameter selection control can be used as the target debugging parameters of the interface to be debugged, for example, the historical debugging parameters displayed on the interface debugging page are directly used as the target debugging parameters of the interface to be debugged.
Optionally, after receiving the target debugging parameter of the interface to be debugged, the target debugging parameter may be displayed on the interface debugging page, and the interface debugging page may further include a saving control, where when the saving control is triggered by a user, the target debugging parameter is saved to a preset historical parameter debugging set in response to a saving operation of the saving control, a target historical parameter selection control corresponding to the target debugging parameter is added to the interface debugging page, and when the target historical parameter selection control is triggered, the target debugging parameter may be displayed on the interface debugging page.
103. And checking the target debugging parameters based on the type of the debugging parameters.
For example, candidate debugging parameters to be checked are screened from the target debugging parameters according to the input identifiers of the debugging parameters, for example, a required filling parameter is screened from the target debugging parameters according to the input identifiers of the debugging parameters, and the required filling parameter is used as the candidate debugging parameter. And determining a check rule of the candidate debugging parameter according to the parameter type of the candidate debugging parameter, for example, when the parameter type is a number, determining that the check rule of the candidate debugging parameter is a number check rule, wherein the number check rule is used for checking whether the parameter value of the candidate debugging parameter meets a number filling rule, when the parameter type is an email format, determining that the check rule of the candidate debugging parameter is a format check rule, and so on. Different check rules are used to check different types of parameters, for example, the check rules used to check the parameter type and the parameter content may be different. And checking the candidate debugging parameters based on the checking rules, for example, checking the numbers filled by the user or the email format and the like by using the corresponding checking rules, so as to obtain a checking result, for example, when the candidate debugging parameters pass the checking, it can be determined that the target debugging parameters pass the checking, and when the candidate debugging parameters do not pass the checking, it can be determined that the target debugging parameters do not pass the checking. When the target debugging parameter is not verified, and the user triggers the debugging control, an error can be reported in the debugging execution process, for example, prompt information of the error is displayed on an interface debugging page.
104. And when the target debugging parameter passes the verification, generating debugging request information of the interface to be debugged according to the target debugging parameter.
The debugging request information may be request information for requesting to debug the interface to be debugged, the debugging request information may carry request information such as a target debugging parameter, an interface name and an interface address of the interface to be debugged, and if the interface to be debugged needs to be called to be in a login state, the debugging request information may further include login state information.
For example, when the target debugging parameter passes the verification, the attribute information of the interface to be debugged is screened out from the interface information of the interface to be debugged according to the interface type of the interface to be debugged. And generating debugging request information of the interface to be debugged according to the attribute information and the target debugging parameter, for example, identifying an interface name and an interface address of the interface to be debugged in the attribute information to obtain target attribute information, and identifying an interface calling condition in the attribute information, when the interface calling condition requires the login state of a user, obtaining the login state information of the current user, and taking the login state information, the target attribute information and the target debugging parameter as the debugging request information of the interface to be debugged, and when the interface calling condition does not require the login state of the user, taking the target attribute information and the target debugging parameter as the debugging request information of the interface to be debugged.
Optionally, after generating the debug request information of the interface to be debugged, the debug request information may be further converted into a debug execution code, and the interface to be debugged is debugged by executing the debug execution code, so as to obtain a debug result of the interface to be debugged, and therefore, the interface debugging method may further include:
and responding to the checking operation of the code checking control, converting the debugging request information into a debugging execution code, displaying the debugging execution code on an interface debugging page, responding to the copying operation of the code copying control, assigning the debugging execution code, responding to the executing operation of the code copying control, and displaying a debugging result of the interface to be debugged on the interface debugging page.
For example, the interface debugging page further includes a code viewing control, a code executing control, and a code copying control, where the code viewing control is used to view the debugging executing code corresponding to the debugging request information, the code executing control is used to execute the debugging executing code to debug the interface to be debugged, and the code copying control is used to copy the debugging executing code. The user triggers a code viewing control on the interface debugging page, and in response to the viewing operation of the code viewing control, the debugging request information is converted into the debugging execution code, for example, the debugging request information is converted into the debugging execution code through the conversion logic. The debug execution code is displayed on the interface debug page, for example, the debug execution code may be as shown in fig. 7 by taking a curl command as an example. The user can also trigger a code copying page on the interface debugging page, so that the debugging execution code can be copied, and the debugging execution code can be reused. The user can also trigger the execution operation of the code execution control on the interface debugging page, which is equivalent to triggering the debugging control, so as to debug the interface to be debugged, and display the debugging result of the interface to be debugged on the interface debugging page.
105. And responding to the debugging operation of the debugging control, and displaying the debugging result of the interface to be debugged on the interface debugging page.
For example, the debugging request information is sent to the debugging server in response to the debugging operation of the debugging control, for example, the debugging request information is sent to the proxy service interface of the debugging server in response to the debugging operation of the debugging control. And receiving a debugging result of the interface to be debugged, which is returned by the interface to be debugged and returned by the debugging server, aiming at the debugging request information, for example, sending the debugging request information to the interface to be debugged by the proxy service interface, debugging the interface to be debugged according to the target debugging parameters in the debugging request information, feeding the debugging result back to the proxy service interface, returning the debugging result to the first interface debugging device by the proxy service interface, and receiving the debugging result by the first interface debugging device. The debugging result is displayed on the interface debugging page, for example, the debugging result is subjected to code conversion to obtain a debugging code corresponding to the debugging result, and the debugging code is displayed on the interface debugging page, which may be as shown in fig. 8. The response area of the interface debugging page for displaying the debugging result can further comprise a debugging code copying control, the debugging code copying control is used for copying the debugging code by a user, and when the user triggers the debugging code copying control, the debugging code is copied in response to the copying operation of the debugging code copying control.
After the debugging codes are displayed in the response area of the interface debugging page, a user can determine whether the debugging of the current interface to be debugged is completed according to the debugging codes, the debugging of the next interface to be debugged can be continued after the debugging is completed, and the debugging of the current interface to be debugged can be continued if the debugging is not completed. The whole interface debugging process can be used for analyzing the interface information so as to display an interface debugging page corresponding to the interface information, a user interacts on the interface debugging page to construct request body content so as to obtain target debugging parameters, debugging request information is generated based on the target debugging parameters, the debugging request information is sent to the proxy service interface, a debugging result returned by the proxy service interface is received, and a data component, a currently filled field value and debugging result information are displayed on the interface debugging page, which can be specifically shown in fig. 9.
As can be seen from the above, in the embodiment of the present invention, after an interface debugging page corresponding to an interface to be debugged is displayed, the interface debugging page includes a debugging control and at least one type of parameter input control corresponding to a debugging parameter, then, according to the type of the parameter input control, at least one type of debugging parameter input in the parameter input control is received to obtain a target debugging parameter, then, based on the type of the debugging parameter, the target debugging parameter is checked, when the target debugging parameter is checked, debugging request information of the interface to be debugged is generated according to the target debugging parameter, and in response to a debugging operation of the debugging control, a debugging result of the interface to be debugged is displayed on the interface debugging page, and the debugging result is generated by a debugging server calling the interface to be debugged according to the debugging request information; according to the scheme, the debugging parameters are only required to be input through the parameter input control, and the debugging request information is generated according to the debugging parameters, so that the debugging result is directly displayed on the interface debugging page, the contents of the interface document or the reference interface document do not need to be manually understood, the complexity of the debugging process is greatly reduced, the input debugging parameters can be checked, and the debugging efficiency of interface debugging can be greatly improved.
The method described in the above examples is further illustrated in detail below by way of example.
In this embodiment, the second interface debugging apparatus will be described from the perspective of the second interface debugging apparatus, where the second interface debugging apparatus may be specifically integrated in an electronic device, the electronic device is taken as an access server, and the server may be an independent physical server, a server cluster or a distributed system formed by multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud service, a cloud database, cloud computing, cloud function, cloud storage, Network service, cloud communication, middleware service, domain name service, security service, Network acceleration service (CDN), and a big data and artificial intelligence platform.
An interface debugging method, comprising:
the method comprises the steps of obtaining an interface document of at least one interface to be debugged, reading interface information of the interface to be debugged in the interface document, and sending the interface information to a debugging terminal, so that the debugging terminal displays an interface debugging page corresponding to the interface to be debugged according to the interface information, receives debugging request information of the interface to be debugged, which is returned by the debugging terminal, sends the debugging request information to the interface to be debugged through a proxy service interface, receives a debugging result, which is returned by the interface to be debugged according to the debugging request information, and sends the debugging result to the debugging terminal, so that the debugging terminal displays the debugging result on the interface debugging page.
As shown in fig. 10, the specific flow of the interface debugging method may be as follows:
201. the method comprises the steps of obtaining an interface document of at least one interface to be debugged, and reading interface information of the interface to be debugged in the interface document.
For example, the interface document of the interface to be debugged may be directly obtained, for example, the interface document uploaded by the user or the developer may be directly received, or the development document uploaded by the user may be received, and the interface document of the interface to be debugged may be extracted from the development document. The interface file of the interface to be debugged may also be obtained indirectly, for example, when the number of the interface files is large or the memory is large, the storage address of the interface file or the development file uploaded or sent by the user or the developer may also be received, and the interface file of the interface to be debugged may be obtained according to the storage address.
Reading interface information of an interface to be debugged in an interface document, for example, identifying the interface document to obtain a document format of the interface document, and when the document format is different from a preset document format, converting the document format of the interface document into the preset document format to obtain a target interface document, where the preset document format may be a json format, and the json format is easily processed by a background program. For example, the interface information that can be read in the target interface document may include several levels, an interface name (operation name), first-level field names (including description, filling, restriction, type, and verification information (verification condition), etc.), and taking the interface to be debugged as an ad creative interface as an example, the read interface information is converted into a json format as shown in fig. 11. For multi-level structures (objects and arrays), the interface information may also include sub-level element elements, as can be seen in FIG. 12.
202. And sending the interface information to the debugging terminal, so that the debugging terminal displays an interface debugging page corresponding to the interface to be debugged according to the interface information.
For example, the interface information may be directly sent to the debug terminal, so that the debug terminal parses the interface information to obtain the interface request parameter, generates an interface debug page according to the interface request parameter, and displays the interface debug page. When the amount of the interface information is large or the memory is large, the storage address of the interface information can be sent to the debugging terminal, so that the debugging terminal obtains the interface information according to the storage address and analyzes the interface information, and an interface debugging page corresponding to the interface to be debugged is displayed.
203. And receiving debugging request information of the interface to be debugged returned by the debugging terminal.
For example, the debugging request information corresponding to the interface to be debugged, which is returned by the debugging terminal, may be directly received, and when the number of the debugging request information is large or the memory is large, the debugging request information returned by the debugging terminal may also be indirectly received, for example, a storage address of the debugging request information sent by the debugging terminal is received, and the debugging request information of the interface to be debugged is obtained in the memory or cache of the debugging terminal according to the storage address.
204. And sending the debugging request information to the interface to be debugged through the proxy service interface, and receiving a debugging result returned by the interface to be debugged according to the debugging request information.
For example, the interface address of the interface to be debugged may be obtained in the debugging request information, and the debugging request information may be sent to the interface to be debugged according to the interface address. The actual request environment is mainly determined by the proxy service interface, and can be a debugging environment or a formal environment. And after the interface to be debugged receives the debugging request information, executing the target debugging parameters in the debugging request information, acquiring a return value by the interface to be debugged, and returning the return value serving as a debugging result to the proxy service interface, so that the second interface debugging device receives the debugging result returned by the interface to be debugged.
205. And sending the debugging result to the debugging terminal, so that the debugging terminal displays the debugging result on the interface debugging page.
For example, the debugging result is sent to the debugging terminal through the proxy service interface, so that the debugging terminal displays the debugging result on the interface debugging page, for example, after the debugging terminal receives the debugging result, the debugging terminal performs code conversion on the debugging result to obtain a debugging code corresponding to the debugging result, and the debugging code is displayed on the interface debugging page.
As can be seen from the above, in the embodiment of the present invention, after an interface document of at least one interface to be debugged is obtained and interface information of the interface to be debugged is read in the interface document, the interface information is sent to a debug terminal, so that the debug terminal displays an interface debug page corresponding to the interface to be debugged according to the interface information, then, debug request information of the interface to be debugged returned by the debug terminal is received, the debug request information is sent to the interface to be debugged through a proxy service interface, a debug result returned by the interface to be debugged according to the debug request information is received, and the debug result is sent to the debug terminal, so that the debug result is displayed by the debug terminal on the interface debug page; according to the scheme, the interface information of the interface to be debugged is read in the interface document, so that the debugging terminal can display the interface debugging page corresponding to the interface information, receive the debugging request information returned by the debugging terminal, and use the proxy service interface to call the interface to be debugged for debugging, the complexity of the debugging process is greatly reduced, and therefore, the debugging efficiency of interface debugging can be greatly improved.
The method described in the above examples is further illustrated in detail below by way of example.
In this embodiment, an example will be described in which the first interface debugging apparatus is integrated in a debugging terminal, and the second interface debugging apparatus is integrated in a debugging server.
As shown in fig. 13, a specific flow of the interface debugging method is as follows:
301. the debugging server obtains an interface document of at least one interface to be debugged, and reads the interface information of the interface to be debugged in the interface document.
For example, the debugging server may directly receive the interface document uploaded by the user or the developer, or receive the development document uploaded by the user, and extract the interface document of the interface to be debugged from the development document. When the number of the interface documents is large or the memory is large, the storage address of the interface document or the development document uploaded or sent by a user or a developer can be received, and the interface document of the interface to be debugged can be obtained according to the storage address. And identifying the interface document to obtain the document format of the interface document, and converting the document format of the interface document into a json format to obtain a target interface document when the document format is not the json format. The interface information read in the target interface document may include several levels, an interface name (operation name), first-level field names (including description, necessary padding, constraint, type, and check information (check condition), and the like), and for a multi-level structure (object and array), the interface information may further include sub-level element elements.
302. And the debugging server sends the interface information to the debugging terminal.
For example, the debugging server directly sends the interface information to the debugging terminal, and when the number of the interface information is large or the memory is large, the storage address of the interface information can be sent to the debugging terminal, so that the debugging terminal obtains the interface information according to the storage address.
303. And the debugging terminal generates an interface debugging page corresponding to the interface to be debugged according to the interface information.
For example, the debugging terminal directly receives the interface information of at least one interface to be debugged sent by the debugging server, so as to obtain the interface information set. When the number of the interfaces to be debugged is large or the memory of the interface information is large, after the debugging server obtains the interface document, the interface information is read from the interface document, the interface information is stored, the storage address is sent to the first interface debugging device, and after the first interface debugging device receives the storage address, the interface information is obtained according to the storage address, so that the interface information set is obtained. And acquiring information such as interface identification or interface address of the interface to be debugged selected by the user on the interface selection page, and screening interface information corresponding to the interface identification or interface address from the interface information set to obtain target interface information.
And identifying the data type of the interface description data of the interface to be debugged in the target interface information, wherein the data type can comprise an array, an object, a character string, an integer, a Boolean, a custom or a file type and the like. When the data type is an array and an object, the analysis mode of the interface description data can be determined to be recursive analysis, and the recursive analysis can be multi-level analysis of the interface description data in a recursive mode, so that the information of the whole object or the array is obtained; when the data type is a character string, an integer, a boolean, a custom, a file type, or the like, it may be determined that the parsing manner of the interface description data is a logical parsing manner. When the data type is an array and an object, analyzing the interface description data in a recursive analysis mode to obtain initial interface request parameters, when the data type is a character string, an integer, a Boolean, a custom or a file type, analyzing the interface description data in a logic analysis mode to obtain initial interface request parameters, and fusing the initial interface request parameters to obtain the interface request parameters of the interface to be debugged.
The data structure of the interface parameter of the interface to be debugged and the candidate debugging parameter corresponding to the interface parameter are identified in the interface request parameter, the component data structure of the debugging component is determined according to the data structure of the interface parameter, the candidate debugging parameter can also be used as a basic debugging parameter of the debugging component, for example, a certain data parameter can include a plurality of enumerated values, a user needs to select at least one enumerated value from the enumerated values, then the enumerated values can be used as the basic debugging parameter, and the user can select the parameter value of the debugging parameter from the basic debugging parameter. And after initialization, constructing a component data structure by the page, and displaying to obtain an initial interface debugging page. The basic debugging parameters are added to the initial interface debugging page to obtain the interface debugging page, for example, taking an enumeration value as an example, the enumeration value can be added to an enumeration value selection list of the initial interface debugging page to obtain the interface debugging page.
304. And the debugging terminal displays an interface debugging page corresponding to the interface to be debugged.
For example, a user performs a selection operation on an interface selection page of a debugging client, so as to trigger and display an interface debugging page corresponding to an interface to be debugged, for example, a debugging terminal may set an interface selection control on the interface selection page, the user may operate the interface selection control on the interface debugging page, and in response to the selection operation of the interface selection control, the interface debugging page may be triggered and displayed on the debugging terminal.
Optionally, after the debugging terminal displays the interface debugging page corresponding to the interface to be debugged, the user may further manually increase or decrease the selected and filled debugging parameters and the like by triggering the parameter adjusting space, for example, the user triggers the parameter adjusting control corresponding to the selected and filled debugging parameters on the interface debugging page, so as to adjust the selected and filled debugging parameters, for the selected and filled debugging parameters as object parameters, the user manually triggers the parameter adjusting control on the interface debugging page to increase or decrease the parameter input control of the selected and filled parameters in the object, for the parameters of the array type, the user may manually increase or decrease the parameter input controls of a small number of array elements, thereby obtaining the adjusted parameter input control. When a user triggers a prompt control on an interface debugging page, responding to the prompt operation of the prompt control, and displaying prompt information of debugging parameters corresponding to the prompt control triggered by the user on the interface debugging page. And receiving at least one type of debugging parameters input by the user according to the input identification and the prompt information after the parameter input control is adjusted according to the type of the parameter input control.
Optionally, the interface debugging page may further include at least one scene selection control of a scene type, so that a user may directly use multiple scene debugging parameters to modify the parameters based on the scene selection control, for example, the user triggers the scene selection control on the interface debugging page to select a debugging scene to be debugged, the debugging terminal responds to the selection operation of the scene selection control, screens out a scene debugging parameter corresponding to the debugging scene from a preset scene debugging parameter set, and displays a parameter value corresponding to the scene debugging parameter on the interface debugging page, and when the user needs to modify the parameter value corresponding to the scene debugging parameter, the parameter value may be modified through the parameter input control corresponding to the scene debugging parameter, so as to obtain the target debugging parameter. So that the debugging is more convenient.
Optionally, the interface debugging page may further include at least one type of historical parameter selection control, and after the interface debugging page is displayed, the user may further select the historical debugging parameters that are stored before to debug the interface to be debugged. For example, the user triggers the history parameter selection control on the interface debugging page to select the history debugging parameters stored before, and the debugging terminal determines the history debugging parameter identifier corresponding to the history parameter selection control in response to the selection operation of the history parameter selection control. And when the historical debugging parameters are not modified or adjusted by the user through the parameter input control within the preset time, the historical debugging parameters can be used as target debugging parameters of the interface to be debugged.
305. And the debugging terminal receives at least one type of debugging parameter input by the parameter input control according to the type of the parameter input control to obtain a target debugging parameter.
For example, when the user does not adjust the parameter input control through the parameter adjustment control, the user may input the parameter information in the parameter input control according to the input identifier and the prompt information, and the debugging terminal may receive the parameter information input by the user according to the type of the parameter input control, for example, when the adjustment parameter is a character string or a numeric type parameter, the type of the parameter input control corresponding to the adjustment parameter may be an input box, the user may directly input the content in the input box, the input content may be used as the parameter information, the character string/shaping may be automatically adapted, and the user may directly input the content in the input box. When the debugging parameter is a boolean parameter, the type of the corresponding parameter input control may be a check box (or a switch), and the user may directly click or select the corresponding content in the check box or the switch as the input parameter information. When the debugging parameter is an enumeration type parameter, the type of the parameter input control corresponding to the debugging parameter may be a drop-down box, the drop-down box may include at least one candidate enumeration value, and a user may directly select the at least one enumeration value as input parameter information in the drop-down box. When the type of the user is a self-defined structure which is not clearly defined, the type of the parameter input control corresponding to the user is an input box with a specific format, the specific format can be a json format, the user can directly input a character string with the json format in the input box, and the character string with the json format is used as input parameter information. The parameter information input by the user through the input box is classified into one type, the parameter information input through the drop-down box is classified into one type, and the like, so that the parameter information is classified. The parameter information to be converted is determined based on the classification result, for example, information input through a drop-down box, a check box, or a switch is converted, and for example, a drop-down box inputs selection information into debugging parameters corresponding to the selection information, and check information input through a check box is converted into debugging parameters corresponding to the check information. And fusing the debugging parameters obtained after conversion and the debugging parameters which do not need to be converted to obtain the target debugging parameters of the interface to be debugged.
When a user adjusts the parameter input control through the parameter adjustment control, the debugging terminal receives the parameter information input by the user according to the input identification and the prompt information after the parameter input control is adjusted, classifies the parameter information according to the type of the input control, converts the parameter information based on the classification result to obtain a target debugging parameter, and the specific process is described above and is not repeated here.
When a user triggers a scene selection control, the user can modify scene debugging parameters through a parameter input control corresponding to the scene parameters on an interface debugging page, when the user triggers the parameter input control to modify the scene debugging parameters, a debugging terminal receives modified parameter information input by the parameter input control, classifies the modified parameter information based on the type of the parameter input control, converts the modified parameter information based on a classification result to obtain target debugging parameters, and the specific process is described above and is not repeated.
When the user triggers the historical parameter selection control, the debugging terminal directly takes the historical debugging parameters displayed on the interface debugging page as the target debugging parameters of the interface to be debugged.
Optionally, after receiving the target debugging parameter of the interface to be debugged, the debugging terminal may further display the target debugging parameter on the interface debugging page, where the interface debugging page may further include a saving control, and when the saving control is triggered by a user, the target debugging parameter is saved to a preset historical parameter debugging set in response to a saving operation of the saving control, and a target historical parameter selection control corresponding to the target debugging parameter is added to the interface debugging page, and when the target historical parameter selection control is triggered, the target debugging parameter may be displayed on the interface debugging page.
306. And the debugging terminal checks the target debugging parameters based on the type of the debugging parameters.
For example, the debugging terminal screens out the necessary filling parameters from the target debugging parameters according to the input identification of the debugging parameters, and takes the necessary filling parameters as candidate debugging parameters. And determining a check rule of the candidate debugging parameter according to the parameter type of the candidate debugging parameter, for example, when the parameter type is a number, determining that the check rule of the candidate debugging parameter is a digital check rule, wherein the digital check rule is used for checking whether the parameter value of the candidate debugging parameter accords with a digital filling rule, when the parameter type is an email format, determining that the check rule of the candidate debugging parameter is a format check rule, and so on. And checking the numbers or the email formats filled by the user by adopting corresponding checking rules to obtain a checking result, for example, when the candidate debugging parameters pass the checking, the target debugging parameters can be determined to pass the checking, and when the candidate debugging parameters do not pass the checking, the target debugging parameters can be determined to fail the checking. When the target debugging parameter is not verified, and a user triggers the debugging control, displaying error-reporting prompt information on an interface debugging page.
307. And when the target debugging parameters pass the verification, the debugging terminal generates debugging request information of the interface to be debugged according to the target debugging parameters.
For example, when the target debugging parameter passes the verification, the debugging terminal screens out the attribute information of the interface to be debugged from the interface information of the interface to be debugged according to the interface type of the interface to be debugged. The interface name and the interface address of the interface to be debugged are identified in the attribute information to obtain target attribute information, the interface calling condition can be identified in the attribute information, when the login state of the user is required in the interface calling condition, the login state information of the current user is obtained, the login state information, the target attribute information and the target debugging parameter are used as debugging request information of the interface to be debugged, and when the login state of the user is not required in the interface calling condition, the target attribute information and the target debugging parameter can be used as debugging request information of the interface to be debugged.
Optionally, after the debugging terminal generates the debugging request information of the interface to be debugged, the debugging request information may be further converted into a debugging execution code, and the debugging execution code is executed to debug the interface to be debugged, so as to obtain a debugging result of the interface to be debugged. The debugging execution code is displayed on the interface debugging page, and a user can trigger a code copying page on the interface debugging page to copy the debugging execution code, so that the debugging execution code is multiplexed. The user can also trigger the execution operation of the code execution control on the interface debugging page, which is equivalent to triggering the debugging control, so as to debug the interface to be debugged, and display the debugging result of the interface to be debugged on the interface debugging page.
308. And the debugging terminal responds to the debugging operation of the debugging control and sends debugging request information to the debugging server.
For example, when a user triggers a debugging control on an interface debugging page, the debugging terminal responds to the debugging operation of the debugging control, can directly send debugging request information to the proxy service interface of the debugging server, and can also send the storage address of the debugging request information to the proxy service interface, so that the debugging server obtains the debugging request information of the interface to be debugged according to the storage address.
309. And the debugging server sends the debugging request information to the interface to be debugged through the proxy service interface and receives a debugging result returned by the interface to be debugged according to the debugging request information.
For example, the debugging server may obtain an interface address of the interface to be debugged in the debugging request information, and send the debugging request information to the interface to be debugged according to the interface address. The actual request environment is mainly determined by the proxy service interface, and can be a debugging environment or a formal environment. And after the interface to be debugged receives the debugging request information, executing the target debugging parameters in the debugging request information, acquiring a return value by the interface to be debugged, and returning the return value serving as a debugging result to the proxy service interface, so that the debugging server receives the debugging result returned by the interface to be debugged.
310. And the debugging server sends the debugging result to the debugging terminal.
For example, the debugging server sends the debugging result to the debugging terminal through the proxy service interface, so that the debugging terminal displays the debugging result on the interface debugging page.
311. And the debugging terminal displays the debugging result on the interface debugging page.
For example, code conversion is performed on the debugging result to obtain a debugging code corresponding to the debugging result, the debugging code is displayed on the interface debugging page, the response area of the interface debugging page for displaying the debugging result can further comprise a debugging code copying control, the debugging code copying control is used for copying the debugging code by a user, and when the user triggers the debugging code copying control, the debugging code is copied in response to the copying operation of the debugging code copying control.
The process of debugging the interface may be regarded as a process in which the debugging server sends interface information to the debugging terminal, the debugging terminal debugs a page through a display interface, so that a user operates on the interface debugging page to construct a request json to obtain debugging request information, and calls the interface to be debugged according to the debugging request information through the proxy service interface of the debugging server, so as to obtain a debugging result, and displays the debugging result on the interface debugging page, which may be specifically shown in fig. 14.
As can be seen from the above, after the interface debugging page corresponding to the interface to be debugged is displayed by the debugging terminal of this embodiment, the interface debugging page includes the debugging control and at least one type of parameter input control corresponding to the debugging parameter, then, according to the type of the parameter input control, receives at least one type of debugging parameter input in the parameter input control, obtains the target debugging parameter, then, based on the type of the debugging parameter, checks the target debugging parameter, when the target debugging parameter is checked to pass, according to the target debugging parameter, generates the debugging request information of the interface to be debugged, in response to the debugging operation of the debugging control, displays the debugging result of the interface to be debugged on the interface debugging page, and the debugging result is generated by the debugging server calling the interface to be debugged according to the debugging request information; according to the scheme, the debugging parameters are only required to be input through the parameter input control, and the debugging request information is generated according to the debugging parameters, so that the debugging result is directly displayed on the interface debugging page, the contents of the interface document or the reference interface document are not required to be manually understood, the complexity of the debugging process is greatly reduced, and the input debugging parameters can be checked, so that the debugging efficiency of interface debugging can be greatly improved.
In order to better implement the above method, an embodiment of the present invention further provides an interface debugging apparatus (i.e., a first interface debugging apparatus), which may be integrated in a terminal, where the terminal may include a tablet computer, a notebook computer, and/or a personal computer.
For example, as shown in fig. 15, the first interface debugging apparatus may include a debugging page display unit 401, a first receiving unit 402, a checking unit 403, a generating unit 404, and a debugging result display unit 405 as follows:
(1) a debug page display unit 401;
the debugging page display unit 401 is configured to display an interface debugging page corresponding to the interface to be debugged, where the interface debugging page includes a debugging control and at least one type of parameter input control corresponding to a debugging parameter.
For example, the debugging page display unit 401 may be specifically configured to enable a user to perform a selection operation on an interface selection page of the debugging client, and in response to the selection operation of the interface selection control, may trigger the display of the interface debugging page at the debugging terminal.
(2) A first receiving unit 402;
a first receiving unit 402, configured to receive at least one type of debugging parameter input in the parameter input control according to the type of the parameter input control, so as to obtain a target debugging parameter.
For example, the first receiving unit 402 may be specifically configured to receive at least one type of debugging parameter of a parameter input control according to a type of the parameter input control when a user does not adjust the parameter input control through the parameter adjustment control; when a user adjusts the parameter input control through the parameter adjustment control, at least one type of debugging parameter input by the user according to the input identification and the prompt information after the parameter input control is adjusted can be received according to the parameter input control, and a target debugging parameter is obtained; when a user triggers the scene selection control, debugging parameters which are input by the parameter input control and are used for adjusting the scene debugging parameters can be received according to the type of the parameter input control, and target debugging parameters are obtained; when the user triggers the historical parameter selection control, the historical debugging parameters corresponding to the historical parameter selection control can be used as target debugging parameters of the interface to be debugged.
(3) A verification unit 403;
a checking unit 403, configured to check the target debugging parameter based on the type of the debugging parameter.
For example, the checking unit 403 may be specifically configured to screen candidate debugging parameters that need to be checked from the target debugging parameters according to the input identifiers of the debugging parameters, determine a checking rule of the candidate debugging parameters according to the parameter type of the candidate debugging parameters, and check the candidate debugging parameters based on the checking rule.
(4) A generation unit 404;
and a generating unit 404, configured to generate, according to the target debugging parameter, debugging request information of the interface to be debugged when the target debugging parameter passes verification.
For example, the generating unit 404 may be specifically configured to, when the target debugging parameter passes the verification, screen out attribute information of the interface to be debugged from the interface information of the interface to be debugged according to the interface type of the interface to be debugged. Generating debugging request information of the interface to be debugged according to the attribute information and the target debugging parameters
(5) A debugging result display unit 405;
and a debugging result display unit 405, configured to display, on the interface debugging page, a debugging result of the interface to be debugged when responding to the debugging operation of the debugging control, where the debugging result is generated by the debugging server invoking the interface to be debugged according to the debugging request information.
For example, the debugging result display unit 405 may be specifically configured to respond to a debugging operation of a debugging control, send debugging request information to a debugging server, receive a debugging result of a to-be-debugged interface returned by the debugging server for the debugging request information, perform code conversion on the debugging result, and obtain a debugging code corresponding to the debugging result, display the debugging code on an interface debugging page, where an answer area of the interface debugging page, where the debugging result is displayed, may further include a debugging code copying control, where the debugging code copying control is used for a user to copy the debugging code, and when the user triggers the debugging code copying control, copy the debugging code in response to a copying operation of the debugging code copying control.
In a specific implementation, the above units may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and the specific implementation of the above units may refer to the foregoing method embodiments, which are not described herein again.
As can be seen from the above, in the embodiment, after the prompt page display unit 401 displays the interface debugging page corresponding to the interface to be debugged, the interface debug page includes debug controls and at least one type of parameter input controls corresponding to debug parameters, then, the first receiving unit 402 receives at least one type of debugging parameter inputted in the parameter input control according to the type of the parameter input control to obtain a target debugging parameter, and then, the checking unit 403 obtains a target debugging parameter based on the type of the debugging parameter, the target debugging parameters are checked, and when the target debugging parameters are checked to pass, generating debugging request information of the interface to be debugged according to the target debugging parameters, displaying the debugging result of the interface to be debugged on an interface debugging page when the debugging result display unit 405 responds to the debugging operation of the debugging control, the debugging result is generated by calling the interface to be debugged by the debugging server according to the debugging request information; according to the scheme, the debugging parameters are only required to be input through the parameter input control, and the debugging request information is generated according to the debugging parameters, so that the debugging result is directly displayed on the interface debugging page, the contents of the interface document or the reference interface document do not need to be manually understood, the complexity of the debugging process is greatly reduced, the input debugging parameters can be checked, and the debugging efficiency of interface debugging can be greatly improved.
In order to implement the foregoing method better, an embodiment of the present invention further provides an interface debugging apparatus (i.e., a second interface debugging apparatus), where the second interface debugging apparatus may be integrated in a server, and the server may be a single server or a server cluster formed by multiple servers.
For example, as shown in fig. 16, the second interface debugging apparatus may include an obtaining unit 501, a first sending unit 502, a second receiving unit 503, a calling unit 504, and a second sending unit 505, as follows:
(1) an acquisition unit 501;
the obtaining unit 501 is configured to obtain an interface document of at least one interface to be debugged, and read interface information of the interface to be debugged in the interface document.
For example, the obtaining unit 501 may be specifically configured to directly or indirectly obtain an interface document of an interface to be debugged, identify the interface document, obtain a document format of the interface document, convert the document format of the interface document into the preset document format when the document format is different from the preset document format, obtain a target interface document, and read interface information of the interface to be debugged in the target interface document.
(2) A first sending unit 502;
the first sending unit 502 is configured to send the interface information to the debugging terminal, so that the debugging terminal displays, according to the interface information, an interface debugging page corresponding to the interface to be debugged.
For example, the first sending unit 502 may be specifically configured to directly send the interface information to the debugging terminal, so that the debugging terminal parses the interface information to obtain the interface request parameter, generates an interface debugging page according to the interface request parameter, and displays the interface debugging page. When the amount of the interface information is large or the memory is large, the storage address of the interface information can be sent to the debugging terminal, so that the debugging terminal obtains the interface information according to the storage address and analyzes the interface information, and an interface debugging page corresponding to the interface to be debugged is displayed.
(3) A second receiving unit 503;
the second receiving unit 503 is configured to receive debugging request information of the interface to be debugged, where the debugging request information is returned by the debugging terminal.
For example, the second receiving unit 503 may be specifically configured to directly receive debug request information corresponding to the interface to be debugged, where the debug request information is returned by the debug terminal, and when the number of the debug request information is large or the memory is large, receive a storage address of the debug request information sent by the debug terminal, and obtain the debug request information of the interface to be debugged in the memory or the cache of the debug terminal according to the storage address.
(4) A calling unit 504;
the invoking unit 504 is configured to send the debug request information to the interface to be debugged through the proxy service interface, and receive a debug result returned by the interface to be debugged according to the debug request information.
For example, the invoking unit 504 may be specifically configured to obtain an interface address of the interface to be debugged in the debugging request information, and send the debugging request information to the interface to be debugged according to the interface address. And after the interface to be debugged receives the debugging request information, executing the target debugging parameters in the debugging request information, acquiring a return value by the interface to be debugged, and returning the return value serving as a debugging result to the proxy service interface, so that the second interface debugging device receives the debugging result returned by the interface to be debugged.
(5) A second transmitting unit 505;
and a second sending unit 505, configured to send the debugging result to the debugging terminal, so that the debugging terminal displays the debugging result on the interface debugging page.
For example, the second sending unit 505 may be specifically configured to send the debugging result to the debugging terminal through the proxy service interface, so that the debugging terminal displays the debugging result on the interface debugging page, and after receiving the debugging result, the debugging terminal performs code conversion on the debugging result to obtain a debugging code corresponding to the debugging result, and displays the debugging code on the interface debugging page.
As can be seen from the above, in this embodiment, after the obtaining unit 501 obtains an interface document of at least one interface to be debugged, and reads interface information of the interface to be debugged in the interface document, the first sending unit 502 sends the interface information to the debug terminal, so that the debug terminal displays an interface debug page corresponding to the interface to be debugged according to the interface information, then, the second receiving unit 503 receives debug request information of the interface to be debugged returned by the debug terminal, the calling unit 504 sends the debug request information to the interface to be debugged through the proxy service interface, receives a debug result returned by the interface to be debugged according to the debug request information, and the second sending unit 505 sends the debug result to the debug terminal, so that the debug terminal displays a debug result on the interface debug page; according to the scheme, the interface information of the interface to be debugged is read in the interface document, so that the debugging terminal can display the interface debugging page corresponding to the interface information, receive the debugging request information returned by the debugging terminal, and use the proxy service interface to call the interface to be debugged for debugging, the complexity of the debugging process is greatly reduced, and therefore, the debugging efficiency of interface debugging can be greatly improved.
An embodiment of the present invention further provides an electronic device, as shown in fig. 17, which shows a schematic structural diagram of the electronic device according to the embodiment of the present invention, specifically:
the electronic device may include components such as a processor 601 of one or more processing cores, memory 602 of one or more computer-readable storage media, a power supply 603, and an input unit 604. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 17 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the processor 601 is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, and performs various functions of the electronic device and processes data by operating or executing software programs and/or modules stored in the memory 602 and calling data stored in the memory 602, thereby performing overall monitoring of the electronic device. Alternatively, processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 601.
The memory 602 may be used to store software programs and modules, and the processor 601 executes various functional applications and data processing by operating the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 602 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 access to the memory 602.
The electronic device further comprises a power supply 603 for supplying power to the various components, and preferably, the power supply 603 is logically connected to the processor 601 through a power management system, so that functions of managing charging, discharging, power consumption, and the like are realized through the power management system. The power supply 603 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The electronic device may further include an input unit 604, and the input unit 604 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the electronic device may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 601 in the electronic device loads the executable file corresponding to the process of one or more application programs into the memory 602 according to the following instructions, and the processor 601 runs the application programs stored in the memory 602, thereby implementing various functions as follows:
the interface debugging page corresponding to the interface to be debugged is displayed, the interface debugging page comprises a debugging control and at least one type of parameter input control corresponding to the debugging parameter, the at least one type of debugging parameter input by the parameter input control is received according to the type of the parameter input control to obtain a target debugging parameter, the target debugging parameter is checked based on the type of the debugging parameter, when the target debugging parameter passes the checking, debugging request information of the interface to be debugged is generated according to the target debugging parameter, when the debugging operation of the debugging control is responded, a debugging result of the interface to be debugged is displayed on the interface debugging page, and the debugging result is generated by calling the interface to be debugged by a debugging server according to the debugging request information.
Or
The method comprises the steps of obtaining an interface document of at least one interface to be debugged, reading interface information of the interface to be debugged in the interface document, and sending the interface information to a debugging terminal, so that the debugging terminal displays an interface debugging page corresponding to the interface to be debugged according to the interface information, receives debugging request information of the interface to be debugged, which is returned by the debugging terminal, sends the debugging request information to the interface to be debugged through a proxy service interface, receives a debugging result, which is returned by the interface to be debugged according to the debugging request information, and sends the debugging result to the debugging terminal, so that the debugging terminal displays the debugging result on the interface debugging page.
The above operations can be implemented in the foregoing embodiments, and are not described herein.
As can be seen from the above, in the embodiment of the present invention, after an interface debugging page corresponding to an interface to be debugged is displayed, the interface debugging page includes a debugging control and at least one type of parameter input control corresponding to a debugging parameter, then, according to the type of the parameter input control, at least one type of debugging parameter input in the parameter input control is received to obtain a target debugging parameter, then, based on the type of the debugging parameter, the target debugging parameter is checked, when the target debugging parameter is checked, debugging request information of the interface to be debugged is generated according to the target debugging parameter, and in response to a debugging operation of the debugging control, a debugging result of the interface to be debugged is displayed on the interface debugging page, and the debugging result is generated by a debugging server calling the interface to be debugged according to the debugging request information; according to the scheme, the debugging parameters are only required to be input through the parameter input control, and the debugging request information is generated according to the debugging parameters, so that the debugging result is directly displayed on the interface debugging page, the contents of the interface document or the reference interface document are not required to be manually understood, the complexity of the debugging process is greatly reduced, and the input debugging parameters can be checked, so that the debugging efficiency of interface debugging can be greatly improved.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, the embodiment of the present invention provides a computer-readable storage medium, in which a plurality of instructions are stored, where the instructions can be loaded by a processor to execute the steps in any one of the interface debugging methods provided by the embodiment of the present invention. For example, the instructions may perform the steps of:
the interface debugging page corresponding to the interface to be debugged is displayed, the interface debugging page comprises a debugging control and at least one type of parameter input control corresponding to the debugging parameter, the debugging parameter of at least one type input in the parameter input control is received according to the type of the parameter input control to obtain a target debugging parameter, the target debugging parameter is checked based on the type of the debugging parameter, when the target debugging parameter is checked to pass, debugging request information of the interface to be debugged is generated according to the target debugging parameter, when the debugging operation of the debugging control is responded, the debugging result of the interface to be debugged is displayed on the interface debugging page, and the debugging result is generated by calling the interface to be debugged by a debugging server according to the debugging request information.
Or
The method comprises the steps of obtaining an interface document of at least one interface to be debugged, reading interface information of the interface to be debugged in the interface document, and sending the interface information to a debugging terminal, so that the debugging terminal displays an interface debugging page corresponding to the interface to be debugged according to the interface information, receiving debugging request information of the interface to be debugged returned by the debugging terminal, sending the debugging request information to the interface to be debugged through a proxy service interface, receiving a debugging result returned by the interface to be debugged according to the debugging request information, and sending the debugging result to the debugging terminal, so that the debugging terminal displays the debugging result on the interface debugging page.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the computer-readable storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the computer-readable storage medium can execute the steps in any interface debugging method provided in the embodiment of the present invention, the beneficial effects that can be achieved by any interface debugging method provided in the embodiment of the present invention can be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
According to one aspect of the application, there is provided, among other things, a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in the various alternative implementations of the interface debugging aspect.
The interface debugging method, apparatus and computer-readable storage medium provided in the embodiments of the present invention are described in detail above, and specific embodiments are applied in this document to explain the principles and embodiments of the present invention, and the description of the above embodiments is only used to help understanding the method and its core idea of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed, and in summary, the content of the present specification should not be construed as limiting the present invention.

Claims (15)

1. An interface debugging method, comprising:
displaying an interface debugging page corresponding to an interface to be debugged, wherein the interface debugging page comprises a debugging control and at least one type of parameter input control corresponding to debugging parameters;
Receiving at least one type of debugging parameter input in the parameter input control according to the type of the parameter input control to obtain a target debugging parameter;
checking the target debugging parameter based on the type of the debugging parameter;
when the target debugging parameter passes the verification, generating debugging request information of the interface to be debugged according to the target debugging parameter;
and when responding to the debugging operation of the debugging control, displaying the debugging result of the interface to be debugged on the interface debugging page, wherein the debugging result is generated by calling the interface to be debugged by a debugging server according to the debugging request information.
2. The interface debugging method according to claim 1, wherein before displaying the interface debugging page corresponding to the interface to be debugged, the method further comprises:
receiving interface information of at least one interface to be debugged sent by the debugging server to obtain an interface information set;
screening out interface information of the interface to be debugged currently in the interface information set to obtain target interface information;
analyzing the target interface information to obtain an interface request parameter of the interface to be debugged;
And generating the interface debugging page according to the interface request parameters.
3. The interface debugging method of claim 2, wherein the analyzing the target interface information to obtain the interface request parameter of the interface to be debugged comprises:
identifying the data type of the interface description data of the interface to be debugged in the target interface information;
determining an analysis mode corresponding to the interface description data according to the data type;
and analyzing the interface description data based on the analysis mode to obtain the interface request parameters.
4. The interface debugging method of claim 2, wherein the generating the interface debugging page according to the interface request parameters comprises:
determining a component data structure and basic debugging parameters of a debugging component of the interface to be debugged according to the interface request parameters;
constructing an initial interface debugging page based on the component data structure;
and adding the basic debugging parameters to the initial interface debugging page to obtain the interface debugging page.
5. The interface debugging method according to any one of claims 1 to 4, wherein the interface debugging page further includes a parameter adjustment control, an input identifier of the debugging parameter, and a prompt control, where the input identifier is used to indicate an input right of a user for the debugging parameter, and after the interface debugging page corresponding to the interface to be debugged is displayed, the method further includes:
Responding to the adjustment operation of the parameter adjustment control, and adjusting the parameter input control on the interface debugging page to obtain an adjusted parameter input control;
responding to the prompt operation of the prompt control, and displaying prompt information corresponding to the debugging parameters on the interface debugging page;
the receiving at least one type of debugging parameter input in the parameter input control according to the type of the parameter input control to obtain a target debugging parameter includes: and receiving at least one type of debugging parameter input by the user according to the input identification and the prompt information in the adjusted parameter input control according to the type of the parameter input control to obtain a target debugging parameter.
6. The interface debugging method of claim 5, wherein the receiving, according to the type of the parameter input control, at least one type of debugging parameter input by a user at the adjusted parameter input control according to the input identifier and the prompt message to obtain a target debugging parameter comprises:
receiving parameter information input by a user according to the adjusted parameter input control according to the input identification and the prompt information;
Classifying the parameter information according to the type of the input control;
and converting the parameter information based on the classification result to obtain the target debugging parameter.
7. The interface debugging method according to any one of claims 1 to 4, wherein the interface debugging page further comprises a scene selection control of at least one scene type, and after the interface debugging page corresponding to the interface to be debugged is displayed, the method further comprises:
responding to the selection operation of the scene selection control, and screening out scene debugging parameters corresponding to the scene type of the scene selection control from a preset scene debugging parameter set;
displaying the scene debugging parameters on the interface debugging page;
the receiving at least one type of debugging parameter input in the parameter input control according to the type of the parameter input control to obtain a target debugging parameter includes: and receiving the debugging parameters which are input by the parameter input control and are used for adjusting the scene debugging parameters according to the type of the parameter input control, and obtaining the target debugging parameters.
8. The interface debugging method according to any one of claims 1 to 4, wherein the interface debugging page further includes at least one type of historical parameter selection control, and after the interface debugging page corresponding to the interface information of the interface to be debugged is displayed, the method further includes:
Responding to the selection operation of the historical parameter selection control, and determining a historical debugging parameter identifier corresponding to the historical parameter selection control;
screening out historical debugging parameters corresponding to the historical debugging parameter identification from a preset historical debugging parameter set, and displaying the historical debugging parameters on the interface debugging page;
the receiving at least one type of debugging parameter input in the parameter input control according to the type of the parameter input control to obtain a target debugging parameter includes: and taking the historical debugging parameters as the target debugging parameters.
9. The interface debugging method of claim 1, wherein the checking the target debugging parameter based on the type of the debugging parameter comprises:
screening candidate debugging parameters needing to be checked from the target debugging parameters according to the input identification of the debugging parameters;
determining a check rule of the candidate debugging parameters according to the parameter types of the candidate debugging parameters;
based on the verification rule, verifying the candidate debugging parameters;
when the target debugging parameter passes the verification, generating debugging information of the interface to be debugged according to the target debugging parameter, including: and when the candidate debugging parameters pass the inspection, generating debugging information of the interface to be debugged according to the target debugging parameters.
10. The interface debugging method according to claim 9, wherein the interface debugging page further includes a code viewing control, a code execution control, and a code copying control, and after generating the debugging request information of the interface to be debugged according to the target debugging parameter, the method further includes:
responding to the viewing operation of the code viewing control, and converting the debugging request information into debugging execution code;
displaying the debugging execution code on the interface debugging page;
copying the debugging execution code in response to the copying operation of the code copying control;
and responding to the execution operation of the code execution control, and displaying the debugging result of the interface to be debugged on the interface debugging page.
11. The interface debugging method according to claim 1, wherein displaying, on the interface debugging page, a debugging result of the interface to be debugged in response to the debugging operation of the debugging control comprises:
responding to the debugging operation of the debugging control, and sending the debugging request information to the debugging server;
receiving a debugging result of the interface to be debugged, which is returned by the debugging server, aiming at the debugging request information;
And displaying the debugging result on the interface debugging page.
12. The interface debugging method of claim 11, wherein the interface debugging page further comprises a debugging code copying control, and wherein displaying the debugging result on the interface debugging page comprises:
performing code conversion on the debugging result to obtain a debugging code corresponding to the debugging result;
displaying the debugging code on the interface debugging page;
and copying the debugging code in response to the copying operation of the debugging code copying control.
13. An interface debugging method, comprising:
acquiring an interface document of at least one interface to be debugged, and reading interface information of the interface to be debugged in the interface document;
sending the interface information to a debugging terminal, so that the debugging terminal displays an interface debugging page corresponding to the interface to be debugged according to the interface information;
receiving debugging request information of the interface to be debugged, which is returned by the debugging terminal;
sending the debugging request information to the interface to be debugged through a proxy service interface, and receiving a debugging result returned by the interface to be debugged according to the debugging request information;
And sending the debugging result to the debugging terminal, so that the debugging terminal displays the debugging result on the interface debugging page.
14. An interface debugging apparatus, comprising:
the debugging page display unit is used for displaying an interface debugging page corresponding to an interface to be debugged, and the interface debugging page comprises a debugging control and at least one type of parameter input control corresponding to debugging parameters;
the first receiving unit is used for receiving at least one type of debugging parameter input by the parameter input control according to the type of the parameter input control to obtain a target debugging parameter;
the checking unit is used for checking the target debugging parameters based on the types of the debugging parameters;
the generating unit is used for generating debugging request information of the interface to be debugged according to the target debugging parameters when the target debugging parameters pass the verification;
and the debugging result display unit is used for displaying the debugging result of the interface to be debugged on the interface debugging page in response to the debugging operation of the debugging control, and the debugging result is generated by calling the interface to be debugged by the debugging server according to the debugging request information.
15. An interface debugging apparatus, comprising:
the device comprises an acquisition unit, a debugging unit and a debugging unit, wherein the acquisition unit is used for acquiring an interface document of at least one interface to be debugged and reading interface information of the interface to be debugged in the interface document;
the first sending unit is used for sending the interface information to a debugging terminal, so that the debugging terminal displays an interface debugging page corresponding to the interface to be debugged according to the interface information;
the second receiving unit is used for receiving debugging request information of the interface to be debugged, which is returned by the debugging terminal;
the calling unit is used for sending the debugging request information to the interface to be debugged through the proxy service interface and receiving a debugging result returned by the interface to be debugged according to the debugging request information;
and the second sending unit is used for sending the debugging result to the debugging terminal, so that the debugging terminal displays the debugging result on the interface debugging page.
CN202110029044.7A 2021-01-11 2021-01-11 Interface debugging method and device Pending CN114756446A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110029044.7A CN114756446A (en) 2021-01-11 2021-01-11 Interface debugging method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110029044.7A CN114756446A (en) 2021-01-11 2021-01-11 Interface debugging method and device

Publications (1)

Publication Number Publication Date
CN114756446A true CN114756446A (en) 2022-07-15

Family

ID=82325981

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110029044.7A Pending CN114756446A (en) 2021-01-11 2021-01-11 Interface debugging method and device

Country Status (1)

Country Link
CN (1) CN114756446A (en)

Similar Documents

Publication Publication Date Title
CN108153670B (en) Interface testing method and device and electronic equipment
CN108628748B (en) Automatic test management method and automatic test management system
US10175954B2 (en) Method of processing big data, including arranging icons in a workflow GUI by a user, checking process availability and syntax, converting the workflow into execution code, monitoring the workflow, and displaying associated information
CN109408375A (en) The generation method and device of interface document
US11720825B2 (en) Framework for multi-tenant data science experiments at-scale
CN107807841B (en) Server simulation method, device, equipment and readable storage medium
CN107562459B (en) Management system, interface generating/displaying/operating method, medium, and terminal
CN111581920A (en) Document conversion method, device, equipment and computer storage medium
CN102929646A (en) Application program production method and device
CN114564922A (en) Document editing method and device, computer equipment and storage medium
CN114036439A (en) Website building method, device, medium and electronic equipment
CN110321283A (en) Interface testing case generation method, device, computer installation and storage medium
CN113360947A (en) Data desensitization method and device, computer readable storage medium and electronic equipment
KR20200119176A (en) System, apparatuses, and methods of processing and managing web traffic data
CN113778897A (en) Automatic test method, device, equipment and storage medium of interface
US9104573B1 (en) Providing relevant diagnostic information using ontology rules
CN110704394B (en) Report configuration modification method and device
US20230267430A1 (en) Data processing method and device, and computer-readable storage medium
CN115712571A (en) Interactive service test device, interactive service test device, computer equipment and storage medium
CN114756446A (en) Interface debugging method and device
CN116360735A (en) Form generation method, device, equipment and medium
CN114327709A (en) Control page generation method and device, intelligent device and storage medium
CN114386853A (en) Data auditing processing method, device and equipment based on universal auditing model
CN113986494A (en) Interface processing method and device, electronic equipment and storage medium
CN111158654A (en) Algorithm calling method, device, server 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