CN111897728B - Interface debugging method and related equipment - Google Patents

Interface debugging method and related equipment Download PDF

Info

Publication number
CN111897728B
CN111897728B CN202010762795.5A CN202010762795A CN111897728B CN 111897728 B CN111897728 B CN 111897728B CN 202010762795 A CN202010762795 A CN 202010762795A CN 111897728 B CN111897728 B CN 111897728B
Authority
CN
China
Prior art keywords
interface
webpage
terminal
file
standard
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010762795.5A
Other languages
Chinese (zh)
Other versions
CN111897728A (en
Inventor
梁承飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Longqi Technology Co ltd
Original Assignee
Hangzhou Longqi Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Longqi Technology Co ltd filed Critical Hangzhou Longqi Technology Co ltd
Priority to CN202010762795.5A priority Critical patent/CN111897728B/en
Publication of CN111897728A publication Critical patent/CN111897728A/en
Application granted granted Critical
Publication of CN111897728B publication Critical patent/CN111897728B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to the technical field of computers, and provides an interface debugging method and related equipment. The interface debugging method obtains an interface file; the webpage end of the hybrid application program requests the original end of the hybrid application program to call the standard interface according to the access case and the interface name of each standard interface in the plurality of interfaces; the original terminal verifies the interface call request of the webpage terminal according to the interface file; when the original terminal verifies that the interface call request of the webpage terminal is successful, generating a call result of the standard interface through the original terminal, and returning the call result of the standard interface to the webpage terminal; the webpage end judges whether the standard interface is a target interface according to the calling result of the standard interface and the parameter-outputting case of the standard interface; and outputting the target interface in the plurality of interfaces through the webpage end. According to the invention, the interface between the webpage end and the original end in the hybrid application program is debugged, so that the debugging efficiency of the interface between the webpage end and the original end in the hybrid application program is improved.

Description

Interface debugging method and related equipment
Technical Field
The present invention relates to the field of computer technologies, and in particular, to an interface debugging method, an interface debugging device, a computer device, and a computer readable storage medium.
Background
With the rise of the mobile internet, a financial application program (APP) generally adopts Hybrid development technical architecture, such as Hybrid, to realize a Hybrid application program.
The hybrid application program comprises a primary end and a webpage end, and development and debugging work of the webpage end and the primary end depend on interface calling. The interface of the original terminal is inconsistent with the interface file and is asynchronous, so that the debugging efficiency is low easily. How to improve the interface debugging efficiency becomes a problem to be solved.
Disclosure of Invention
In view of the foregoing, there is a need for an interface debugging method, apparatus, computer device, and computer readable storage medium, which can debug an interface between a web page end and a native end in a hybrid application, and increase the efficiency of debugging the interface between the web page end and the native end in the hybrid application.
A first aspect of the present application provides an interface debugging method, including:
acquiring an interface file, wherein the interface file comprises a plurality of interfaces and interface names, input parameter cases and output parameter cases of the interfaces;
the webpage end of the hybrid application program requests the original end of the hybrid application program to call the standard interface according to the access example and the interface name of each standard interface in the plurality of interfaces;
The native terminal verifies the interface call request of the webpage terminal according to the interface file;
when the native terminal verifies that the interface call request of the webpage terminal is successful, generating a call result of the standard interface through the native terminal, and returning the call result of the standard interface to the webpage terminal;
the webpage end judges whether the standard interface is a target interface according to the calling result of the standard interface and the parameter-out case of the standard interface;
and outputting the target interface in the interfaces through the webpage end.
In another possible implementation manner, the obtaining the interface file includes:
acquiring an EXCEL interface file;
converting the EXCEL interface file into an interface file in a target format;
encrypting the interface file in the target format by using a preset public key to obtain an encrypted interface file;
storing the encrypted interface file;
and decrypting the encrypted interface file by using a preset private key corresponding to the preset public key, and loading the decrypted interface file into a memory.
In another possible implementation manner, before the web page end of the hybrid application program requests to call the standard interface to the native end of the hybrid application program according to the reference case and the interface name of each standard interface in the multiple interfaces, the interface debugging method further includes:
Reading the decrypted interface file;
and displaying the decrypted interface file at the webpage end.
In another possible implementation manner, the verifying, by the native terminal, the interface call request of the web page terminal according to the interface file includes:
judging whether the parameter type in the interface call request is consistent with the parameter type in the interface file or not through the native terminal;
judging whether the parameter length in the interface call request is larger than the parameter length in the interface file or not through the native terminal;
when the parameter type in the interface call request is consistent with the parameter type in the interface file, and the parameter length in the interface call request is not more than the parameter length in the interface file, the native terminal verifies that the interface call request of the webpage terminal is successful;
when the parameter type in the interface call request is inconsistent with the parameter type in the interface file, or the parameter length in the interface call request is greater than the parameter length in the interface file, the native terminal verifies that the interface call request of the webpage terminal fails.
In another possible implementation manner, the determining, by the web page end, whether the standard interface is a target interface according to the call result of the standard interface and the play reference case of the standard interface includes:
When the calling result of the standard interface is consistent with the parameter-outputting case of the standard interface, judging that the standard interface is an available interface;
and when the calling result of the standard interface is null or inconsistent with the parameter-out case of the standard interface, judging that the standard interface is a target interface.
In another possible implementation manner, after the outputting, by the web page end, the target interface of the plurality of interfaces, the interface debugging method further includes:
judging an error end of the target interface;
and sending the interface name and the error end of the target interface to a preset user.
In another possible implementation manner, after the outputting the target interface of the plurality of interfaces, the interface debugging method further includes:
the webpage end determines available interfaces in the interfaces;
the native terminal writes a preset value into a global variable of the webpage terminal for identifying an available interface by using a preset callback mechanism, wherein the callback mechanism is callback;
the native terminal registers the global variable to the webpage terminal by using the preset callback mechanism, so that the webpage terminal calls the available interfaces in the interfaces to realize the functions corresponding to the available interfaces.
A second aspect of the present application provides an interface debugging device, the interface debugging device comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring an interface file, and the interface file comprises a plurality of interfaces and interface names, parameter entering cases and parameter exiting cases of the interfaces;
the request module is used for requesting the original end of the hybrid application program to call the standard interface according to the access example and the interface name of each standard interface in the plurality of interfaces by the webpage end of the hybrid application program;
the verification module is used for verifying the interface call request of the webpage end by the original end according to the interface file;
the return module is used for generating a call result of the standard interface through the original terminal when the original terminal verifies that the interface call request of the webpage terminal is successful, and returning the call result of the standard interface to the webpage terminal;
the judging module is used for judging whether the standard interface is a target interface or not according to the calling result of the standard interface and the parameter-out case of the standard interface by the webpage end;
and the output module is used for outputting the target interface in the plurality of interfaces through the webpage end.
A third aspect of the present application provides a computer device comprising a processor for implementing the interface debugging method when executing computer readable instructions stored in a memory.
A fourth aspect of the present application provides a computer-readable storage medium having stored thereon computer-readable instructions that, when executed by a processor, implement the interface debugging method.
According to the interface file, the interface call request of the webpage end is checked; when the native terminal verifies that the interface call request of the webpage terminal is successful, generating a call result of the standard interface through the native terminal, and returning the call result of the standard interface to the webpage terminal; and the webpage end judges whether the standard interface is a target interface according to the calling result of the standard interface and the parameter-out case of the standard interface, and rapidly finds out the target interface. And the interface debugging efficiency is improved by avoiding inconsistent calling interfaces and interfaces in the interface document and avoiding calling the target interface. According to the invention, the interface between the webpage end and the original end in the hybrid application program is debugged, so that the debugging efficiency of the interface between the webpage end and the original end in the hybrid application program is improved.
Drawings
Fig. 1 is a flowchart of an interface debugging method provided in an embodiment of the present invention.
Fig. 2 is a block diagram of an interface debugging device according to an embodiment of the present invention.
Fig. 3 is a schematic diagram of a computer device according to an embodiment of the present invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will be more clearly understood, a more particular description of the invention will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings. It should be noted that, in the case of no conflict, the embodiments of the present application and the features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, and the described embodiments are merely some, rather than all, embodiments of the present invention.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
Preferably, the interface debugging method of the present invention is applied in one or more computer devices. The computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and its hardware includes, but is not limited to, a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a programmable gate array (Field-Programmable Gate Array, FPGA), a digital processor (Digital Signal Processor, DSP), an embedded device, and the like.
The computer equipment can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing equipment. The computer equipment can perform man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch pad or voice control equipment and the like.
Example 1
Fig. 1 is a flowchart of an interface debugging method according to an embodiment of the present invention. The interface debugging method is applied to computer equipment and is used for debugging the interface between the webpage end and the original end in the hybrid application program, so that the debugging efficiency of the interface between the webpage end and the original end in the hybrid application program is improved.
As shown in fig. 1, the interface debugging method includes:
101, obtaining an interface file, wherein the interface file comprises a plurality of interfaces and interface names, an input reference case and an output reference case of the interfaces.
In a specific embodiment, the obtaining the interface file includes:
acquiring an EXCEL interface file;
converting the EXCEL interface file into an interface file in a target format;
encrypting the interface file in the target format by using a preset public key to obtain an encrypted interface file;
storing the encrypted interface file;
and decrypting the encrypted interface file by using a preset private key corresponding to the preset public key, and loading the decrypted interface file into a memory.
The interface file in the target format may include a file in JSON format, a file in XML format, and the like.
The interface file also comprises interface function description, parameter entering type, parameter entering description, parameter exiting type and parameter exiting description, and the interface debugging method further comprises the following steps:
and displaying the input parameter, the output parameter, the interface function description, the input parameter type, the input parameter description, the output parameter type and the output parameter description of each interface by taking the interface name of each interface as a keyword.
102, the web page end of the hybrid application program requests the original end of the hybrid application program to call the standard interface according to the reference input example and the interface name of each standard interface in the plurality of interfaces.
The hybrid application runs on the computer device.
In a specific embodiment, before the web page end of the hybrid application requests the native end of the hybrid application to call the standard interface according to the reference entry and the interface name of each standard interface in the plurality of interfaces, the interface debugging method further includes:
reading the decrypted interface file;
and displaying the decrypted interface file at the webpage end.
Specifically, the decrypted interface file may be read from a memory or a local database; and distinguishing and displaying the decrypted interface file according to a module to which the interface belongs at the webpage end. Each module displays a module name and a module description.
Receiving a first click instruction of a user on a designated module; and displaying an interface list in the appointed module according to the clicking instruction, wherein each interface in the interface list comprises an interface name, an input reference case, an output reference case, an interface function description, an input reference type and the like.
And 103, the native terminal verifies the interface call request of the webpage terminal according to the interface file.
In a specific embodiment, the verifying, by the native terminal, the interface call request of the web page terminal according to the interface file includes:
judging whether the parameter type in the interface call request is consistent with the parameter type in the interface file or not through the native terminal;
judging whether the parameter length in the interface call request is larger than the parameter length in the interface file or not through the native terminal;
when the parameter type in the interface call request is consistent with the parameter type in the interface file, and the parameter length in the interface call request is not more than the parameter length in the interface file, the native terminal verifies that the interface call request of the webpage terminal is successful;
when the parameter type in the interface call request is inconsistent with the parameter type in the interface file, or the parameter length in the interface call request is greater than the parameter length in the interface file, the native terminal verifies that the interface call request of the webpage terminal fails.
Specifically, it may be determined whether the parameter type in the interface call request is consistent with the parameter type in the interface file, and whether the parameter length in the interface call request is greater than the parameter length in the interface file, that is, the parameter type in the interface call request needs to meet the requirement of the interface file on the input parameter. For example, when the entry type of the interface a in the interface file is character type, the parameter length is 4 bytes; in the interface call request to the interface A, the parameter type of the parameter is integer, the parameter length is 2 bytes, and the original terminal checks that the interface call request of the webpage terminal fails. For another example, when the parameter type of the interface A in the interface file is integer, the parameter length is 2 bytes; in the interface call request to the interface A, the parameter type of the parameter is integer, the parameter length is 2 bytes, and the original terminal verifies that the interface call request of the webpage terminal is successful.
104, when the native terminal verifies that the interface call request of the webpage terminal is successful, generating a call result of the standard interface through the native terminal, and returning the call result of the standard interface to the webpage terminal.
When the native terminal verifies that the interface call request of the webpage terminal is successful, the parameter type in the interface call request is indicated to meet the requirement of the interface file on the input parameters, and the method for realizing the standard interface can receive the parameters in the interface call request. And the original terminal takes the parameters in the interface call request as input to run the method of the standard interface, determines the output obtained by the method of running the standard interface as the call result of the standard interface, and returns the call result of the standard interface to the webpage terminal.
105, the webpage end judges whether the standard interface is a target interface according to the calling result of the standard interface and the parameter-out case of the standard interface;
in a specific embodiment, the determining, by the web page end, whether the standard interface is a target interface according to the call result of the standard interface and the play reference of the standard interface includes:
when the calling result of the standard interface is consistent with the parameter-outputting case of the standard interface, judging that the standard interface is an available interface;
and when the calling result of the standard interface is null or inconsistent with the parameter-out case of the standard interface, judging that the standard interface is a target interface.
The reference-out case of the standard interface corresponds to the reference-in case of the standard interface; i.e. for the standard interface, the out-reference case is the correct output corresponding to the in-reference case. After the standard interface is called through the input reference of the standard interface, the input of the standard interface is the output reference of the standard interface.
The calling result comprises a status code, and before the webpage end judges whether the standard interface is a target interface according to the calling result of the standard interface and the play reference example of the standard interface, the interface debugging method further comprises the following steps:
The webpage end judges whether the calling result is normal according to the state code;
when the webpage end judges that the calling result is normal according to the state code, the webpage end judges whether the standard interface is a target interface according to the calling result of the standard interface and the play reference example of the standard interface.
106, outputting the target interface in the interfaces through the webpage end.
Specifically, outputting the target interface in the interfaces through the webpage end, so that the webpage end stops calling the target interface in the interfaces. The target interface can also be sent to a preset user in a communication mode such as mail and the like so as to prompt that the target interface needs maintenance.
And outputting the target interface in the interfaces through the webpage end in an interface list mode. The target interface list includes the interface name of the target interface, the interface function description of the target interface, and the like.
In a specific embodiment, after the outputting, by the web page end, the target interface of the plurality of interfaces, the interface debugging method further includes:
judging an error end of the target interface;
and sending the interface name and the error end of the target interface to a preset user.
Specifically, a preset variable (such as a global variable) that can be assigned by the web page end and the native end may be set; when the original terminal verifies that the interface call request of the webpage terminal fails, the original terminal judges that the error terminal of the target interface is the webpage terminal, and assigns the preset variable as the identity (such as 0) of the webpage terminal; when the webpage end judges whether the standard interface is a target interface according to the calling result of the standard interface and the parameter-out case of the standard interface, the webpage end judges that the error end of the target interface is the original end, and assigns the preset variable as the identification (such as 1) of the original end. And sending an interface name (such as an interface A) and an error end (such as 0) of the target interface to a preset user so as to remind the preset user to maintain the target interface, wherein the error end is a webpage end.
In another embodiment, after the outputting the target interface of the plurality of interfaces, the interface debugging method further includes:
the webpage end determines available interfaces in the interfaces;
the native terminal writes a preset value into a global variable of the webpage terminal for identifying an available interface by using a preset callback mechanism, wherein the callback mechanism is callback;
The native terminal registers the global variable to the webpage terminal by using the preset callback mechanism, so that the webpage terminal calls the available interfaces in the interfaces to realize the functions corresponding to the available interfaces.
The interface debugging method further comprises the following steps:
and determining that the calling mode for calling the available interfaces in the interfaces is a simple log calling mode, a simple calling mode, an iframe calling mode or an addJavascript interface calling mode.
The interface debugging method of the first embodiment verifies the interface calling request of the webpage end according to the interface file; when the native terminal verifies that the interface call request of the webpage terminal is successful, generating a call result of the standard interface through the native terminal, and returning the call result of the standard interface to the webpage terminal; and the webpage end judges whether the standard interface is a target interface according to the calling result of the standard interface and the parameter-out case of the standard interface, and rapidly finds out the target interface. And the interface debugging efficiency is improved by avoiding inconsistent calling interfaces and interfaces in the interface document and avoiding calling the target interface. In the first embodiment, the interface between the web page end and the original end in the hybrid application program is debugged, so that the debugging efficiency of the interface between the web page end and the original end in the hybrid application program is improved.
Example two
Fig. 2 is a block diagram of an interface debugging device according to a second embodiment of the present invention. The interface debugging device 20 is applied to a computer device. The interface debugging device 20 is used for debugging the interface between the web page end and the native end in the hybrid application program, and increases the debugging efficiency of the interface between the web page end and the native end in the hybrid application program.
As shown in fig. 2, the interface debugging device 20 may include an obtaining module 201, a requesting module 202, a checking module 203, a returning module 204, a judging module 205, and an outputting module 206.
The obtaining module 201 is configured to obtain an interface file, where the interface file includes a plurality of interfaces and interface names, an in-reference case, and an out-reference case of the plurality of interfaces.
In a specific embodiment, the obtaining the interface file includes:
acquiring an EXCEL interface file;
converting the EXCEL interface file into an interface file in a target format;
encrypting the interface file in the target format by using a preset public key to obtain an encrypted interface file;
storing the encrypted interface file;
and decrypting the encrypted interface file by using a preset private key corresponding to the preset public key, and loading the decrypted interface file into a memory.
The interface file in the target format may include a file in JSON format, a file in XML format, and the like.
The interface file also comprises interface function description, an input parameter type, an input parameter description, an output parameter type and an output parameter description, and the interface debugging device also comprises a display module for displaying input parameter examples, output parameter examples, interface function description, input parameter type, input parameter description, output parameter type and output parameter description of each interface by taking the interface name of each interface as a keyword.
The request module 202 is configured to request, by a web page end of the hybrid application program, to call the standard interface from a native end of the hybrid application program according to an access instance and an interface name of each standard interface in the plurality of interfaces.
The hybrid application runs on the computer device.
In a specific embodiment, before the web page end of the hybrid application program requests the original end of the hybrid application program to call the standard interface according to the access case and the interface name of each standard interface in the multiple interfaces, the display module is further configured to read the decrypted interface file;
and displaying the decrypted interface file at the webpage end.
Specifically, the decrypted interface file may be read from a memory or a local database; and distinguishing and displaying the decrypted interface file according to a module to which the interface belongs at the webpage end. Each module displays a module name and a module description.
Receiving a first click instruction of a user on a designated module; and displaying an interface list in the appointed module according to the clicking instruction, wherein each interface in the interface list comprises an interface name, an input reference case, an output reference case, an interface function description, an input reference type and the like.
And the verification module 203 is configured to verify, by the native terminal, the interface call request of the web page terminal according to the interface file.
In a specific embodiment, the verifying, by the native terminal, the interface call request of the web page terminal according to the interface file includes:
judging whether the parameter type in the interface call request is consistent with the parameter type in the interface file or not through the native terminal;
judging whether the parameter length in the interface call request is larger than the parameter length in the interface file or not through the native terminal;
when the parameter type in the interface call request is consistent with the parameter type in the interface file, and the parameter length in the interface call request is not more than the parameter length in the interface file, the native terminal verifies that the interface call request of the webpage terminal is successful;
when the parameter type in the interface call request is inconsistent with the parameter type in the interface file, or the parameter length in the interface call request is greater than the parameter length in the interface file, the native terminal verifies that the interface call request of the webpage terminal fails.
Specifically, it may be determined whether the parameter type in the interface call request is consistent with the parameter type in the interface file, and whether the parameter length in the interface call request is greater than the parameter length in the interface file, that is, the parameter type in the interface call request needs to meet the requirement of the interface file on the input parameter. For example, when the entry type of the interface a in the interface file is character type, the parameter length is 4 bytes; in the interface call request to the interface A, the parameter type of the parameter is integer, the parameter length is 2 bytes, and the original terminal checks that the interface call request of the webpage terminal fails. For another example, when the parameter type of the interface A in the interface file is integer, the parameter length is 2 bytes; in the interface call request to the interface A, the parameter type of the parameter is integer, the parameter length is 2 bytes, and the original terminal verifies that the interface call request of the webpage terminal is successful.
And the return module 204 is configured to generate a call result of the standard interface by the native terminal when the native terminal verifies that the interface call request of the web page terminal is successful, and return the call result of the standard interface to the web page terminal.
When the native terminal verifies that the interface call request of the webpage terminal is successful, the parameter type in the interface call request is indicated to meet the requirement of the interface file on the input parameters, and the method for realizing the standard interface can receive the parameters in the interface call request. And the original terminal takes the parameters in the interface call request as input to run the method of the standard interface, determines the output obtained by the method of running the standard interface as the call result of the standard interface, and returns the call result of the standard interface to the webpage terminal.
The judging module 205 is configured to judge whether the standard interface is a target interface according to a call result of the standard interface and a parameter output case of the standard interface by using the web page end;
in a specific embodiment, the determining, by the web page end, whether the standard interface is a target interface according to the call result of the standard interface and the play reference of the standard interface includes:
when the calling result of the standard interface is consistent with the parameter-outputting case of the standard interface, judging that the standard interface is an available interface;
and when the calling result of the standard interface is null or inconsistent with the parameter-out case of the standard interface, judging that the standard interface is a target interface.
The reference-out case of the standard interface corresponds to the reference-in case of the standard interface; i.e. for the standard interface, the out-reference case is the correct output corresponding to the in-reference case. After the standard interface is called through the input reference of the standard interface, the input of the standard interface is the output reference of the standard interface.
The calling result comprises a state code, and the judging module is further used for judging whether the calling result is normal or not according to the state code by the webpage end before the webpage end judges whether the standard interface is a target interface according to the calling result of the standard interface and the parameter-outputting case of the standard interface;
When the webpage end judges that the calling result is normal according to the state code, the webpage end judges whether the standard interface is a target interface according to the calling result of the standard interface and the play reference example of the standard interface.
And the output module 206 is configured to output, through the web page end, a target interface of the plurality of interfaces.
Specifically, outputting the target interface in the interfaces through the webpage end, so that the webpage end stops calling the target interface in the interfaces. The target interface can also be sent to a preset user in a communication mode such as mail and the like so as to prompt that the target interface needs maintenance.
And outputting the target interface in the interfaces through the webpage end in an interface list mode. The target interface list includes the interface name of the target interface, the interface function description of the target interface, and the like.
In a specific embodiment, after the outputting, by the web page end, the target interface of the plurality of interfaces, the interface debugging device further includes a sending module, configured to determine an error end of the target interface;
and sending the interface name and the error end of the target interface to a preset user.
Specifically, a preset variable (such as a global variable) that can be assigned by the web page end and the native end may be set; when the original terminal verifies that the interface call request of the webpage terminal fails, the original terminal judges that the error terminal of the target interface is the webpage terminal, and assigns the preset variable as the identity (such as 0) of the webpage terminal; when the webpage end judges whether the standard interface is a target interface according to the calling result of the standard interface and the parameter-out case of the standard interface, the webpage end judges that the error end of the target interface is the original end, and assigns the preset variable as the identification (such as 1) of the original end. And sending an interface name (such as an interface A) and an error end (such as 0) of the target interface to a preset user so as to remind the preset user to maintain the target interface, wherein the error end is a webpage end.
In another embodiment, after the outputting the target interface of the plurality of interfaces, the interface debugging device further includes a registration module, configured to determine an available interface of the plurality of interfaces by the web page end;
the native terminal writes a preset value into a global variable of the webpage terminal for identifying an available interface by using a preset callback mechanism, wherein the callback mechanism is callback;
The native terminal registers the global variable to the webpage terminal by using the preset callback mechanism, so that the webpage terminal calls the available interfaces in the interfaces to realize the functions corresponding to the available interfaces.
The interface debugging device further comprises a determining module, and the determining module is used for determining that the calling mode of calling the available interfaces in the interfaces is a simple log calling mode, a simple calling mode, an iframe calling mode or an addjavascript interface calling mode.
The interface debugging device 20 of the second embodiment verifies the interface call request of the web page end according to the interface file; when the native terminal verifies that the interface call request of the webpage terminal is successful, generating a call result of the standard interface through the native terminal, and returning the call result of the standard interface to the webpage terminal; and the webpage end judges whether the standard interface is a target interface according to the calling result of the standard interface and the parameter-out case of the standard interface, and rapidly finds out the target interface. And the interface debugging efficiency is improved by avoiding inconsistent calling interfaces and interfaces in the interface document and avoiding calling the target interface. In the second embodiment, the interface between the web page end and the original end in the hybrid application program is debugged, so that the debugging efficiency of the interface between the web page end and the original end in the hybrid application program is improved.
Example III
The present embodiment provides a computer readable storage medium having stored thereon computer readable instructions which when executed by a processor implement the steps of the above-described interface debugging method embodiment, for example steps 101-106 shown in fig. 1:
101, acquiring an interface file, wherein the interface file comprises a plurality of interfaces and interface names, a parameter entering case and a parameter exiting case of the interfaces;
102, requesting a webpage end of a hybrid application program to call a standard interface from a native end of the hybrid application program according to a reference entry and an interface name of each standard interface in the plurality of interfaces;
103, the native terminal verifies the interface call request of the webpage terminal according to the interface file;
104, when the native terminal verifies that the interface call request of the webpage terminal is successful, generating a call result of the standard interface through the native terminal, and returning the call result of the standard interface to the webpage terminal;
105, the webpage end judges whether the standard interface is a target interface according to the calling result of the standard interface and the parameter-out case of the standard interface;
106, outputting the target interface in the interfaces through the webpage end.
Alternatively, the computer readable instructions, when executed by a processor, implement the functions of the modules in the apparatus embodiments described above, such as modules 201-206 in fig. 2:
an obtaining module 201, configured to obtain an interface file, where the interface file includes a plurality of interfaces and interface names, an input reference case, and an output reference case of the plurality of interfaces;
the request module 202 is configured to request, by a web page end of a hybrid application program, to call a standard interface to a native end of the hybrid application program according to an access instance and an interface name of each standard interface in the plurality of interfaces;
the verification module 203 is configured to verify, by using the native terminal, an interface call request of the web page terminal according to the interface file;
a return module 204, configured to generate, by the native terminal, a call result of the standard interface when the native terminal verifies that the interface call request of the web page terminal is successful, and return the call result of the standard interface to the web page terminal;
the judging module 205 is configured to judge whether the standard interface is a target interface according to a call result of the standard interface and a parameter output case of the standard interface by using the web page end;
and the output module 206 is configured to output, through the web page end, a target interface of the plurality of interfaces.
Example IV
Fig. 3 is a schematic diagram of a computer device according to a third embodiment of the present invention. The computer device 30 comprises a memory 301, a processor 302, and computer readable instructions 303, such as an interface debugging program, stored in the memory 301 and executable on the processor 302. The processor 302, when executing the computer-readable instructions 303, implements the steps of the interface debugging method embodiments described above, such as 101-106 shown in fig. 1:
101, acquiring an interface file, wherein the interface file comprises a plurality of interfaces and interface names, a parameter entering case and a parameter exiting case of the interfaces;
102, requesting a webpage end of a hybrid application program to call a standard interface from a native end of the hybrid application program according to a reference entry and an interface name of each standard interface in the plurality of interfaces;
103, the native terminal verifies the interface call request of the webpage terminal according to the interface file;
104, when the native terminal verifies that the interface call request of the webpage terminal is successful, generating a call result of the standard interface through the native terminal, and returning the call result of the standard interface to the webpage terminal;
105, the webpage end judges whether the standard interface is a target interface according to the calling result of the standard interface and the parameter-out case of the standard interface;
106, outputting the target interface in the interfaces through the webpage end.
Alternatively, the computer readable instructions, when executed by a processor, implement the functions of the modules in the apparatus embodiments described above, such as modules 201-207 in fig. 2:
an obtaining module 201, configured to obtain an interface file, where the interface file includes a plurality of interfaces and interface names, an input reference case, and an output reference case of the plurality of interfaces;
the request module 202 is configured to request, by a web page end of a hybrid application program, to call a standard interface to a native end of the hybrid application program according to an access instance and an interface name of each standard interface in the plurality of interfaces;
the verification module 203 is configured to verify, by using the native terminal, an interface call request of the web page terminal according to the interface file;
a return module 204, configured to generate, by the native terminal, a call result of the standard interface when the native terminal verifies that the interface call request of the web page terminal is successful, and return the call result of the standard interface to the web page terminal;
the judging module 205 is configured to judge whether the standard interface is a target interface according to a call result of the standard interface and a parameter output case of the standard interface by using the web page end;
And the output module 206 is configured to output, through the web page end, a target interface of the plurality of interfaces.
Illustratively, the computer readable instructions 303 may be partitioned into one or more modules that are stored in the memory 301 and executed by the processor 302 to perform the present methods. The one or more modules may be a series of computer readable instructions capable of performing a particular function describing the execution of the computer readable instructions 303 in the computer device 30. For example, the computer readable instructions 303 may be divided into the obtaining module 201, the requesting module 202, the verifying module 203, the returning module 204, the judging module 205, and the outputting module 206 in fig. 2, where each module has a specific function, see the second embodiment.
Those skilled in the art will appreciate that the schematic diagram 3 is merely an example of the computer device 30 and is not meant to be limiting of the computer device 30, and may include more or fewer components than shown, or may combine certain components, or different components, e.g., the computer device 30 may also include input and output devices, network access devices, buses, etc.
The processor 302 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor 302 may be any conventional processor or the like, the processor 302 being the control center of the computer device 30, with various interfaces and lines connecting the various parts of the overall computer device 30.
The memory 301 may be used to store the computer readable instructions 303, and the processor 302 may implement various functions of the computer device 30 by executing or executing the computer readable instructions or modules stored in the memory 301 and invoking data stored in the memory 301. The memory 301 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the computer device 30, or the like. In addition, the Memory 301 may include a hard disk, a Memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card), at least one magnetic disk storage device, a Flash Memory device, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), or other nonvolatile/volatile storage device.
The modules integrated by the computer device 30 may be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product. Based on such understanding, the present invention may also be implemented by implementing all or part of the processes in the methods of the embodiments described above, by instructing the associated hardware by means of computer readable instructions, which may be stored in a computer readable storage medium, the computer readable instructions, when executed by a processor, implementing the steps of the respective method embodiments described above. Wherein the computer readable instructions comprise computer readable instruction code which may be in the form of source code, object code, executable files, or in some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer readable instruction code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a Read Only Memory (ROM), a Random Access Memory (RAM), and so forth.
In the several embodiments provided in the present invention, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical modules, i.e., may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module. The integrated modules may be implemented in hardware or in hardware plus software functional modules.
The integrated modules, which are implemented in the form of software functional modules, may be stored in a computer readable storage medium. The software functional module is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute some steps of the interface debugging method according to the embodiments of the present invention.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned. Furthermore, it is evident that the word "comprising" does not exclude other modules or steps, and that the singular does not exclude a plurality. A plurality of modules or means recited in the system claims can also be implemented by means of one module or means in software or hardware. The terms first, second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (7)

1. An interface debugging method, which is characterized by comprising the following steps:
acquiring an interface file, wherein the interface file comprises a plurality of interfaces and interface names, input parameter cases and output parameter cases of the interfaces;
the webpage end of the hybrid application program requests the original end of the hybrid application program to call the standard interface according to the access example and the interface name of each standard interface in the plurality of interfaces;
the native terminal verifies the interface call request of the webpage terminal according to the interface file, and the method comprises the following steps: judging whether the parameter type in the interface call request is consistent with the parameter type in the interface file or not through the native terminal; judging whether the parameter length in the interface call request is larger than the parameter length in the interface file or not through the native terminal; when the parameter type in the interface call request is consistent with the parameter type in the interface file, and the parameter length in the interface call request is not more than the parameter length in the interface file, the native terminal verifies that the interface call request of the webpage terminal is successful; when the parameter type in the interface call request is inconsistent with the parameter type in the interface file or the parameter length in the interface call request is greater than the parameter length in the interface file, the native terminal verifies that the interface call request of the webpage terminal fails;
When the native terminal verifies that the interface call request of the webpage terminal is successful, generating a call result of the standard interface through the native terminal, and returning the call result of the standard interface to the webpage terminal;
the webpage end judges whether the standard interface is a target interface according to the calling result of the standard interface and the parameter-out case of the standard interface, and comprises the following steps: when the calling result of the standard interface is consistent with the parameter-outputting case of the standard interface, judging that the standard interface is an available interface; when the calling result of the standard interface is null or inconsistent with the parameter-out case of the standard interface, judging that the standard interface is a target interface;
outputting a target interface in the interfaces through the webpage end;
judging the error end of the target interface comprises the following steps: when the original terminal verifies that the interface call request of the webpage terminal fails, the original terminal judges that the error terminal of the target interface is the webpage terminal; when the webpage end judges whether the standard interface is a target interface according to the calling result of the standard interface and the parameter-out case of the standard interface, the webpage end judges that the error end of the target interface is the original end;
And sending the interface name and the error end of the target interface to a preset user.
2. The interface debugging method of claim 1, wherein the obtaining the interface file comprises:
acquiring an EXCEL interface file;
converting the EXCEL interface file into an interface file in a target format;
encrypting the interface file in the target format by using a preset public key to obtain an encrypted interface file;
storing the encrypted interface file;
and decrypting the encrypted interface file by using a preset private key corresponding to the preset public key, and loading the decrypted interface file into a memory.
3. The interface debugging method of claim 2, wherein before the web side of the hybrid application requests the native side of the hybrid application to call the standard interface according to the reference instance and the interface name of each standard interface in the plurality of interfaces, the interface debugging method further comprises:
reading the decrypted interface file;
and displaying the decrypted interface file at the webpage end.
4. The interface debugging method of claim 1, wherein after the outputting the target interface of the plurality of interfaces, the interface debugging method further comprises:
The webpage end determines available interfaces in the interfaces;
the native terminal writes a preset value into a global variable of the webpage terminal for identifying an available interface by using a preset callback mechanism, wherein the callback mechanism is callback;
the native terminal registers the global variable to the webpage terminal by using the preset callback mechanism, so that the webpage terminal calls the available interfaces in the interfaces to realize the functions corresponding to the available interfaces.
5. An interface debugging device, characterized in that the device comprises a module for implementing the interface debugging method according to any one of claims 1 to 4, the interface debugging device comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring an interface file, and the interface file comprises a plurality of interfaces and interface names, parameter entering cases and parameter exiting cases of the interfaces;
the request module is used for requesting the original end of the hybrid application program to call the standard interface according to the access example and the interface name of each standard interface in the plurality of interfaces by the webpage end of the hybrid application program;
the verification module is used for verifying the interface call request of the webpage end by the original end according to the interface file;
The return module is used for generating a call result of the standard interface through the original terminal when the original terminal verifies that the interface call request of the webpage terminal is successful, and returning the call result of the standard interface to the webpage terminal;
the judging module is used for judging whether the standard interface is a target interface or not according to the calling result of the standard interface and the parameter-out case of the standard interface by the webpage end;
and the output module is used for outputting the target interface in the plurality of interfaces through the webpage end.
6. A computer device comprising a processor for executing computer readable instructions stored in a memory to implement the interface debugging method of any of claims 1-4.
7. A computer readable storage medium having computer readable instructions stored thereon, which when executed by a processor implement the interface debugging method of any of claims 1-4.
CN202010762795.5A 2020-07-31 2020-07-31 Interface debugging method and related equipment Active CN111897728B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010762795.5A CN111897728B (en) 2020-07-31 2020-07-31 Interface debugging method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010762795.5A CN111897728B (en) 2020-07-31 2020-07-31 Interface debugging method and related equipment

Publications (2)

Publication Number Publication Date
CN111897728A CN111897728A (en) 2020-11-06
CN111897728B true CN111897728B (en) 2024-03-01

Family

ID=73183061

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010762795.5A Active CN111897728B (en) 2020-07-31 2020-07-31 Interface debugging method and related equipment

Country Status (1)

Country Link
CN (1) CN111897728B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113515767B (en) * 2021-08-02 2024-01-23 杭州粉象家科技有限公司 Interface request management method and device based on mixed mode mobile application

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9274935B1 (en) * 2013-01-15 2016-03-01 Google Inc. Application testing system with application programming interface
CN110348217A (en) * 2019-05-28 2019-10-18 深圳壹账通智能科技有限公司 Interface test method, device, electronic equipment and storage medium
CN110597709A (en) * 2019-08-13 2019-12-20 平安国际智慧城市科技股份有限公司 Interactive debugging method and device for mixed-mode mobile application and computer equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10289535B2 (en) * 2016-05-31 2019-05-14 Accenture Global Solutions Limited Software testing integration
US10169193B2 (en) * 2016-12-13 2019-01-01 International Business Machines Corporation Common debug scripting framework for driving hybrid applications consisting of compiled languages and interpreted languages

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9274935B1 (en) * 2013-01-15 2016-03-01 Google Inc. Application testing system with application programming interface
CN110348217A (en) * 2019-05-28 2019-10-18 深圳壹账通智能科技有限公司 Interface test method, device, electronic equipment and storage medium
CN110597709A (en) * 2019-08-13 2019-12-20 平安国际智慧城市科技股份有限公司 Interactive debugging method and device for mixed-mode mobile application and computer equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种嵌入式系统集成调试器的实现;姜大光;无线电工程(第11期);第66-68页 *

Also Published As

Publication number Publication date
CN111897728A (en) 2020-11-06

Similar Documents

Publication Publication Date Title
US8660833B2 (en) Method, computer program product and apparatus for providing an interactive network simulator
US7536599B2 (en) Methods and systems for validating a system environment
US8799861B2 (en) Performance-testing a system with functional-test software and a transformation-accelerator
CN110955409B (en) Method and device for creating resources on cloud platform
CN110750440A (en) Data testing method and terminal equipment
CN109902493B (en) Script issuing method and server
CN113761514B (en) Cloud desktop multi-factor security authentication method and system
US9430595B2 (en) Managing model checks of sequential designs
CN111897728B (en) Interface debugging method and related equipment
CN112306648A (en) Transaction calling method and device, electronic equipment and storage medium
CN102612683A (en) Maintaining data integrity across execution environments
CN110795137A (en) Authority configuration method, device, system, electronic equipment and readable medium
CN111859403B (en) Dependency vulnerability determination method and device, electronic equipment and storage medium
CN111598707B (en) Page generation method and electronic equipment
CN114637672A (en) Automatic data testing method and device, computer equipment and storage medium
KR20230132878A (en) Reduce transaction cancellations in execute-order-verify blockchain models
CN114461223A (en) Code generation method and device and terminal equipment
CN109274758B (en) Request message processing method and computing device
CN111813384A (en) System integration method and related equipment
CN111679862A (en) Cloud host shutdown method and device, electronic equipment and medium
CN111741118B (en) Interface calling method, device, computer equipment and computer readable storage medium
CN113298636B (en) Risk control method, device and system based on simulation resource application
CN112667659B (en) Feature processing method and related equipment
US20220006639A1 (en) Information processing program, device, and method
CN110309038B (en) Performance test method and device, electronic equipment and computer readable 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
TA01 Transfer of patent application right

Effective date of registration: 20240131

Address after: 311100 Building Y21, Xixi Art Collection Village, Visiting Xi Road, Wuchang Street, Yuhang District, Hangzhou City, Zhejiang Province

Applicant after: Hangzhou Longqi Technology Co.,Ltd.

Country or region after: China

Address before: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Applicant before: PING AN PUHUI ENTERPRISE MANAGEMENT Co.,Ltd.

Country or region before: China

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant