CN111831542A - API application debugging method and device, storage medium - Google Patents

API application debugging method and device, storage medium Download PDF

Info

Publication number
CN111831542A
CN111831542A CN201910328886.5A CN201910328886A CN111831542A CN 111831542 A CN111831542 A CN 111831542A CN 201910328886 A CN201910328886 A CN 201910328886A CN 111831542 A CN111831542 A CN 111831542A
Authority
CN
China
Prior art keywords
api
target
api service
service
application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910328886.5A
Other languages
Chinese (zh)
Other versions
CN111831542B (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201910328886.5A priority Critical patent/CN111831542B/en
Publication of CN111831542A publication Critical patent/CN111831542A/en
Application granted granted Critical
Publication of CN111831542B publication Critical patent/CN111831542B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本申请实施例公开一种API应用调测方法及装置、存储介质,属于网络技术领域。该方法包括:获取目标调测日志,目标调测日志是对目标API应用进行调测的过程中生成的调测日志,目标API应用由至少一个API服务编排而成;从目标调测日志中,获取目标API服务的目标调用日志,目标API服务是对目标API应用进行调测的过程中被调用的任一API服务;获取目标调用日志中的关键信息;呈现关键信息。本申请实施例有助于解决API应用的调测效率较低的问题,有助于提高API应用的调测效率。本申请实施例用于API应用调测。

Figure 201910328886

The embodiments of the present application disclose an API application debugging method and device, and a storage medium, which belong to the technical field of networks. The method includes: obtaining a target commissioning log, where the target commissioning log is a commissioning log generated during the commissioning of a target API application, and the target API application is composed of at least one API service; and from the target commissioning log, Obtain the target call log of the target API service. The target API service is any API service that is called in the process of debugging the target API application; obtain key information in the target call log; present key information. The embodiments of the present application help to solve the problem of low debugging efficiency of API applications, and help to improve the debugging efficiency of API applications. The embodiments of the present application are used for API application debugging.

Figure 201910328886

Description

API应用调测方法及装置、存储介质API application debugging method and device, storage medium

技术领域technical field

本申请实施例涉及网络技术领域,特别涉及一种应用程序编程接口(applicationprogramming interface,API)应用调测方法及装置、存储介质。The embodiments of the present application relate to the field of network technologies, and in particular, to an application programming interface (application programming interface, API) application debugging method and device, and a storage medium.

背景技术Background technique

在互联网云化场景中,API编排是指采用专业的API管理工具,将一个或多个API服务编排成API应用的过程。其中,API服务是指满足特定需求的功能单元,API编排的API服务之间具有一定的顺序。在编排形成API应用之后,通常需要对API应用进行调测。In the Internet cloudification scenario, API orchestration refers to the process of using professional API management tools to orchestrate one or more API services into API applications. Among them, the API service refers to the functional unit that meets the specific requirements, and the API services arranged by the API have a certain order. After an API application is orchestrated, it is usually necessary to debug the API application.

目前,通常采用MuleSoft API编排工具对API应用进行调测。调测过程包括:MuleSoft API编排工具根据测试人员编辑的模型代码生成API模型,根据API模型,通过与API网关交互调用该API应用中的API服务,以对API应用进行调测,在调测的过程中,API网关生成调测日志,MuleSoft API编排工具从API网关获取该调测日志,并以文本的形式显示该调测日志,以由测试人员对该调测日志进行人工分析确定出该调测日志的关键信息(例如被调用的API服务的输入信息、被调用的API服务的输出信息、被调用的API服务转发的请求信息、被调用的API服务转发的响应信息、异常信息等),并根据该调测日志的关键信息确定API编排的问题点。At present, the MuleSoft API orchestration tool is usually used to debug API applications. The commissioning process includes: the MuleSoft API orchestration tool generates an API model according to the model code edited by the tester, and according to the API model, interacts with the API gateway to call the API service in the API application to commission the API application. During the process, the API gateway generates a commissioning log, and the MuleSoft API orchestration tool obtains the commissioning log from the API gateway and displays the commissioning log in the form of text, so that the tester can manually analyze the commissioning log to determine the commissioning log. key information of the test log (such as input information of the called API service, output information of the called API service, request information forwarded by the called API service, response information forwarded by the called API service, exception information, etc.), And determine the problem point of API layout according to the key information of the commissioning log.

但是,由于人工分析的效率较低,因此,API应用的调测效率较低。However, due to the low efficiency of manual analysis, the debugging efficiency of API applications is low.

发明内容SUMMARY OF THE INVENTION

本申请实施例提供一种API应用调测方法及装置、存储介质,有助于提高API应用的调测效率。技术方案如下:The embodiments of the present application provide an API application debugging method, device, and storage medium, which help to improve the API application debugging efficiency. The technical solution is as follows:

第一方面,提供一种API应用调测方法,该方法包括:In a first aspect, an API application debugging method is provided, the method includes:

获取目标调测日志,目标调测日志是对目标API应用进行调测的过程中生成的调测日志,目标API应用由至少一个API服务编排而成;从目标调测日志中,获取目标API服务的目标调用日志,目标API服务是对目标API应用进行调测的过程中被调用的任一API服务;获取目标调用日志中的关键信息;呈现关键信息。Obtain the target commissioning log. The target commissioning log is the commissioning log generated during the commissioning of the target API application. The target API application is composed of at least one API service. From the target commissioning log, obtain the target API service. The target call log of the target API service is any API service that is called in the process of debugging the target API application; obtains the key information in the target call log; presents the key information.

本申请实施例提供的方案,由于无需人工分析就可以获取并呈现调用日志中的关键信息,因此有助于提高API应用的调测效率。The solution provided by the embodiment of the present application can acquire and present key information in the call log without manual analysis, thereby helping to improve the debugging efficiency of the API application.

可选地,从目标调测日志中,获取目标API服务的目标调用日志,包括:从被调用的API服务与调用日志的关联关系中,获取目标调用日志,被调用的API服务与调用日志的关联关系是根据目标调测日志建立的。Optionally, obtaining the target call log of the target API service from the target debugging log, including: obtaining the target call log from the association relationship between the called API service and the call log, and the difference between the called API service and the call log. Associations are established based on target commissioning logs.

本申请实施例提供的方案,由于可以从被调用的API服务与调用日志的关联关系中获取目标调用日志,因此可以便于目标调用日志的快速获取。In the solution provided by the embodiment of the present application, since the target call log can be obtained from the association relationship between the called API service and the call log, it is convenient to quickly obtain the target call log.

可选地,在从被调用的API服务与调用日志的关联关系中,获取目标调用日志之前,该方法还包括:根据目标调测日志,确定目标API应用中的API服务的调用顺序;从目标调测日志中,获取各个被调用的API服务的调用日志;根据各个被调用的API服务与相应的调用日志,建立被调用的API服务与调用日志的关联关系。Optionally, before acquiring the target call log from the association relationship between the called API service and the call log, the method further includes: determining the calling sequence of the API service in the target API application according to the target debugging log; In the commissioning log, the call log of each called API service is obtained; according to each called API service and the corresponding call log, the relationship between the called API service and the call log is established.

本申请实施例提供的方案,由于在获取目标调用日志之前,首先建立了被调用的API服务与调用日志的关联关系,因此可以便于目标调用日志的快速获取。In the solution provided by the embodiment of the present application, before acquiring the target invocation log, the association relationship between the invoked API service and the invocation log is first established, so that the fast acquisition of the target invocation log can be facilitated.

可选地,从目标调测日志中,获取各个被调用的API服务的调用日志,包括:确定各个被调用的API服务的特征标签,特征标签包括被调用的API服务的标识和对目标API应用进行调测的跟踪实例标识;根据各个被调用的API服务的特征标签,从目标调测日志中提取各个被调用的API服务的调用日志。Optionally, obtaining the call log of each called API service from the target commissioning log includes: determining the characteristic label of each called API service, where the characteristic label includes the identifier of the called API service and the application to the target API. The trace instance identifier for debugging; according to the feature tag of each called API service, the call log of each called API service is extracted from the target debugging log.

本申请实施例提供的方案,由于可以以特征标签的方式从目标调测日志中提取各个被调用的API服务的调用日志,因此可以便于各个被调用的API服务的调用日志提取。In the solution provided by the embodiments of the present application, since the call log of each called API service can be extracted from the target commissioning log in the form of a feature tag, it is convenient to extract the call log of each called API service.

可选地,在从目标调测日志中,获取目标API服务的目标调用日志之前,该方法还包括:Optionally, before acquiring the target call log of the target API service from the target debugging log, the method further includes:

根据目标调测日志,确定目标API应用中的API服务的调用顺序;Determine the calling sequence of API services in the target API application according to the target commissioning log;

根据调用顺序,呈现API服务调用轨迹,API服务调用轨迹至少包括被调用的API服务的图元以及按照调用顺序连接至少两个被调用的API服务的图元的轨迹线,API服务的图元指示API服务;According to the calling sequence, the API service calling track is presented. The API service calling track at least includes the picture element of the called API service and the trajectory line connecting the picture elements of at least two called API services according to the calling sequence. The picture element of the API service indicates API service;

从目标调测日志中,获取目标API服务的目标调用日志,包括:当检测到针对目标API服务的图元触发的获取指令时,从目标调测日志中,获取目标API服务的目标调用日志。Obtain the target invocation log of the target API service from the target commissioning log, including: when the acquisition instruction triggered by the primitive of the target API service is detected, obtain the target invocation log of the target API service from the target commissioning log.

本申请实施例提供的方案,由于可以呈现API服务调用轨迹,因此可以便于调测人员获知调测过程的调用流程和调用分支,API应用调测的可视化效果较好。进一步地,呈现API服务调用轨迹,可以便于测试人员获取期望的API服务的调测日志(例如目标调用日志)。In the solution provided by the embodiment of the present application, since the API service call trace can be displayed, it is convenient for the commissioning personnel to know the calling process and the calling branch of the commissioning process, and the visualization effect of API application commissioning is better. Further, presenting the API service call trace can facilitate the tester to obtain the commissioning log (for example, the target call log) of the desired API service.

可选地,在根据调用顺序,呈现API服务调用轨迹之前,该方法还包括:Optionally, before presenting the API service calling trace according to the calling sequence, the method further includes:

根据调用顺序,确定最后一个被调用的API服务;根据目标API应用的API服务编排顺序,确定目标API应用的结束API服务;判断最后一个被调用的API服务是否为目标API应用的结束API服务;当最后一个被调用的API服务是目标API应用的结束API服务时,确定API服务调用轨迹为正常轨迹;当最后一个被调用的API服务不是目标API应用的结束API服务时,确定API服务调用轨迹为异常轨迹。Determine the last called API service according to the calling sequence; determine the ending API service of the target API application according to the API service arrangement sequence of the target API application; determine whether the last API service called is the ending API service of the target API application; When the last API service called is the end API service of the target API application, determine the API service call track as a normal track; when the last API service called is not the end API service of the target API application, determine the API service call track is an abnormal trajectory.

本申请实施例提供的方案,由于正常轨迹与异常轨迹不同,因此在呈现API服务调用轨迹之前确定API服务调用轨迹是否为正常轨迹,可以便于呈现API服务调用轨迹。In the solution provided by the embodiments of the present application, since the normal trajectory is different from the abnormal trajectory, it is convenient to present the API service invocation trajectory by determining whether the API service invocation trajectory is a normal trajectory before presenting the API service invocation trajectory.

可选地,根据调用顺序,呈现API服务调用轨迹,包括:Optionally, according to the calling sequence, the API service call trace is presented, including:

当API服务调用轨迹为正常轨迹时,根据调用顺序,呈现API服务调用轨迹,API服务调用轨迹包括被调用的API服务的图元,以及,按照调用顺序连接所有被调用的API服务的图元的轨迹线;When the API service calling track is a normal track, the API service calling track is presented according to the calling sequence. The API service calling track includes the graphic elements of the called API service, and the graphic elements that connect all the called API services according to the calling sequence. track line;

当API服务调用轨迹为异常轨迹时,根据调用顺序和API服务编排顺序呈现API服务调用轨迹,API服务调用轨迹包括被调用的API服务的图元,未被调用的API服务的图元,按照调用顺序连接所有被调用的API服务的图元的轨迹线,按照API服务编排顺序连接所有未被调用的API服务的图元的编排线,以及,按照API服务编排顺序连接被调用的API服务的图元与未被调用的API服务的图元的编排线,被调用的API服务包括调用正常的API服务和调用异常的API服务,调用正常的API服务的图元、调用异常的API服务的图元以及未被调用的API服务的图元的呈现形式不同。When the API service calling track is an abnormal track, the API service calling track is presented according to the calling sequence and the API service arrangement order. The API service calling track includes the graphics elements of the called API services and the graphics elements of the API services that have not been called. The trace lines that connect the primitives of all called API services in sequence, the choreography lines that connect the primitives of all API services that have not been called according to the API service orchestration order, and the graphs that connect the called API services in the API service orchestration order The arrangement line of the primitives and the primitives of the API services that have not been called. The invoked API services include the normal API services and the abnormal API services, the primitives that call the normal API services, and the primitives that call the abnormal API services. And the rendering form of the primitives of the API service that is not called is different.

本申请实施例提供的方案,由于可以以不同的形式呈现调用正常的API服务的图元、调用异常的API服务的图元以及未被调用的API服务的图元,因此可以便于测试人员快速确定各个API服务的调用情况。In the solution provided by the embodiments of the present application, since the graphic elements for calling normal API services, the graphic elements for calling abnormal API services, and the graphic elements for uncalled API services can be presented in different forms, it is convenient for testers to quickly determine Calls of each API service.

可选地,根据目标调测日志,确定目标API应用中的API服务的调用顺序,包括:以正则方式对目标调测日志进行分析,确定目标API应用中被调用的API服务的调用顺序。Optionally, determining the calling sequence of the API services in the target API application according to the target commissioning log includes: analyzing the target commissioning log in a regular manner to determine the calling sequence of the API services called in the target API application.

可选地,获取目标调测日志,目标调测日志是对目标API应用进行调测的过程中生成的调测日志,包括:向API网关发送调测请求,调测请求携带API应用标识和第一时间戳,API应用标识指示目标API应用,第一时间戳为目标API应用调测的开始时间戳;接收API网关发送的调测响应,调测响应包括目标调测日志,目标调测日志为第二时间戳与第一时间戳之间API网关针对目标API应用生成的调测日志,第二时间戳为目标API应用调测的结束时间戳。Optionally, obtain a target commissioning log, where the target commissioning log is a commissioning log generated during commissioning of the target API application, including: sending a commissioning request to the API gateway, and the commissioning request carries the API application identifier and the first A timestamp, the API application identifier indicates the target API application, the first timestamp is the start timestamp of the target API application commissioning; the commissioning response sent by the API gateway is received, and the commissioning response includes the target commissioning log, and the target commissioning log is A commissioning log generated by the API gateway for the target API application between the second timestamp and the first timestamp, where the second timestamp is the end timestamp of the target API application commissioning.

本申请实施例提供的方案,向API网关发送调测请求可以触发调测过程,在调测结束时可以接收API网关发送的调测响应,调测响应包括目标调测日志,因此在调测结束时就可以获取到目标调测日志,目标调测日志的获取较为及时,便于及时分析,从而及时发现问题。In the solution provided by the embodiment of this application, sending a commissioning request to the API gateway can trigger the commissioning process, and at the end of the commissioning, a commissioning response sent by the API gateway can be received, and the commissioning response includes the target commissioning log. The target commissioning log can be obtained at the same time, and the target commissioning log can be obtained in a timely manner, which is convenient for timely analysis and timely detection of problems.

可选地,在获取目标调测日志之前,该方法还包括:获取调测执行结果,调测执行结果是对目标API应用进行调测的执行结果;呈现调测执行结果;Optionally, before acquiring the target commissioning log, the method further includes: acquiring a commissioning execution result, where the commissioning execution result is an execution result of commissioning the target API application; and presenting the commissioning execution result;

获取目标调测日志,包括:当接收到根据调测执行结果触发的分析指令时,获取目标调测日志。Obtaining the target commissioning log includes: when an analysis command triggered according to the commissioning execution result is received, obtaining the target commissioning log.

本申请实施例提供的方案,由于可以呈现调测执行结果,因此可以使测试人员获知调测执行结果;此外,由于接收到根据调测执行结果触发的分析指令时,获取目标调测日志,因此对目标调测日志的分析可以由测试人员触发,提高调测过程的可控性。In the solution provided by the embodiments of the present application, since the commissioning execution result can be displayed, the tester can be informed of the commissioning execution result; in addition, since the target commissioning log is obtained when an analysis command triggered according to the commissioning execution result is received, the target commissioning log is obtained. The analysis of the target commissioning log can be triggered by testers, which improves the controllability of the commissioning process.

第二方面,提供一种API应用调测装置,该API应用调测装置包括至少一个模块,该至少一个模块用于实现上述第一方面或第一方面的任一可选方式所提供的API应用调测方法。In a second aspect, an API application debugging apparatus is provided. The API application debugging apparatus includes at least one module, and the at least one module is used to implement the API application provided in the first aspect or any optional manner of the first aspect. debugging method.

第三方面,提供一种API应用调测装置,该API应用调测装置包括:处理器、通信接口、存储器和总线,该处理器用于执行存储器中存储的指令,以实现第一方面或第一方面的任一可选方式所提供的API应用调测方法。A third aspect provides an API application debugging apparatus, the API application debugging apparatus includes: a processor, a communication interface, a memory, and a bus, where the processor is configured to execute instructions stored in the memory to implement the first aspect or the first The API application debugging method provided in any optional manner of the aspect.

第四方面,提供一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当该指令在计算机的处理组件上运行时,使得处理组件执行第一方面或第一方面的任一可选方式所提供的API应用调测方法。In a fourth aspect, a computer-readable storage medium is provided, and instructions are stored in the computer-readable storage medium, and when the instructions are executed on a processing component of a computer, the processing component executes the first aspect or any one of the first aspects. The API application debugging method provided by the optional method.

第五方面,提供一种包含指令的计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行第一方面或第一方面的任一可选方式所提供的API应用调测方法。In a fifth aspect, a computer program product containing instructions is provided, when the computer program product runs on a computer, the computer program product enables the computer to execute the API application debugging method provided in the first aspect or any optional manner of the first aspect.

第六方面,提供一种芯片,该芯片包括可编程逻辑电路和/或程序指令,当芯片运行时用于实现第一方面或第一方面的任一可选方式所提供的API应用调测方法。A sixth aspect provides a chip, the chip includes a programmable logic circuit and/or program instructions, and is used to implement the first aspect or the API application debugging method provided in any optional manner of the first aspect when the chip is running .

上述第二至第六方面的有益效果可以参考第一方面,在此不再赘述。For the beneficial effects of the above-mentioned second to sixth aspects, reference may be made to the first aspect, which will not be repeated here.

附图说明Description of drawings

图1是本申请实施例所涉及的一种实施环境的示意图;FIG. 1 is a schematic diagram of an implementation environment involved in an embodiment of the present application;

图2是本申请实施例实施例提供的一种API应用调测方法的方法流程图;FIG. 2 is a method flowchart of an API application debugging method provided by an embodiment of the present application;

图3是本申请实施例提供的一种目标API应用中的API服务编排顺序的示意图;3 is a schematic diagram of an API service arrangement sequence in a target API application provided by an embodiment of the present application;

图4是本申请实施例提供的一种显示调测执行结果的示意图;FIG. 4 is a schematic diagram of displaying a commissioning execution result according to an embodiment of the present application;

图5是本申请实施例提供的一种获取被调用的API服务的调用日志的方法流程图;5 is a flowchart of a method for obtaining a call log of a called API service provided by an embodiment of the present application;

图6是本申请实施例提供的一种API服务编排顺序和API服务调用轨迹的示意图;6 is a schematic diagram of an API service arrangement sequence and an API service calling track provided by an embodiment of the present application;

图7是本申请实施例提供的另一种API服务编排顺序和API服务调用轨迹的示意图;7 is a schematic diagram of another API service arrangement sequence and API service calling track provided by an embodiment of the present application;

图8是本申请实施例提供的一种确定API服务调用轨迹是否为正常轨迹的方法流程图;8 is a flowchart of a method for determining whether an API service call trajectory is a normal trajectory provided by an embodiment of the present application;

图9是本申请实施例实施例提供的一种API应用调测装置的逻辑结构示意图;FIG. 9 is a schematic diagram of a logical structure of an API application debugging apparatus provided by an embodiment of the present application;

图10是本申请实施例实施例提供的另一种API应用调测装置的逻辑结构示意图;FIG. 10 is a schematic diagram of a logical structure of another API application debugging apparatus provided by an embodiment of the present application;

图11是本申请实施例提供的一种API应用调测装置的实体结构示意图。FIG. 11 is a schematic diagram of a physical structure of an API application debugging apparatus provided by an embodiment of the present application.

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请实施例的实施例,并与说明书一起用于解释本申请实施例的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the embodiments of the present application, and together with the description serve to explain the principles of the embodiments of the present application.

具体实施方式Detailed ways

为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.

随着互联网云化场景的普及,越来越多的云化站点将自身的资源(例如API服务)集成起来,通过API网关开放给开发者调用,以为云计算用户提供高性能、高可用的API托管服务。其中,API网关为完全托管API服务,使开发人员能够轻松地创建、发布、维护和保护任何规模的API服务的网关。With the popularization of Internet cloudification scenarios, more and more cloudified sites integrate their own resources (such as API services) and open them to developers through API gateways to provide high-performance and highly available APIs for cloud computing users. baby sitting program. Among them, API Gateway is a gateway for fully managed API services that enables developers to easily create, publish, maintain and secure API services of any scale.

在互联网云化场景中,API编排是指采用专业的API管理工具,将一个或多个API服务编排成API应用的过程。API编排不涉及编程,仅通过在云平台配置和/或映射来调用和/或组合API服务。其中,API服务是指满足特定需求的功能单元。在API应用中,API服务之间可以是顺序(前一API服务的输出是后一API服务的输入)、并行(两个API服务并行)或条件跳转(在符合条件时从一API服务跳转至另一API服务)的关系。API应用是否由API服务编排而成,以及API应用由多少API服务编排而成,对于用户(包括测试人员和实际用户)来说是不可见的。因此通过API编排,用户无需关心API应用复杂的配置流程。In the Internet cloudification scenario, API orchestration refers to the process of using professional API management tools to orchestrate one or more API services into API applications. API orchestration does not involve programming, and only calls and/or compose API services through configuration and/or mapping on the cloud platform. Among them, API services refer to functional units that meet specific requirements. In API applications, API services can be sequential (the output of the previous API service is the input of the next API service), parallel (two API services in parallel) or conditional jump (jump from one API service when conditions are met) to another API service). Whether an API application is orchestrated by API services, and how many API services are orchestrated by an API application, are invisible to users (including testers and actual users). Therefore, through API orchestration, users do not need to care about the complex configuration process of API applications.

在API编排形成API应用之后,通常需要对API应用进行调测。然而实际场景中,当调测过程出现问题时,传统的调测方法无法直观的定位出API编排的问题点,测试人员需要查看调测日志,并根据调测日志找API编排的问题点,这导致API应用的调测耗时长,效率低。After an API is orchestrated to form an API application, it is usually necessary to debug the API application. However, in actual scenarios, when there is a problem in the commissioning process, the traditional commissioning method cannot intuitively locate the problem point of API layout. Testers need to view the commissioning log and find the problem point of API layout according to the commissioning log. As a result, API application debugging takes a long time and is inefficient.

目前,通常采用MuleSoft API编排工具对API应用进行调测,MuleSoft API编排工具是一种基于离线集成开发环境的图形化编排工具,其允许用户采用图形化的开发业务流程,且可以向测试人员提供调测执行结果(调测正常或异常)。当调测异常时,MuleSoft API编排工具可以根据测试人员编写的代码生成API模型,根据API模型,通过向API网关发送特定请求获取调测日志,并以文本的形式显示该调测日志,测试人员通过对调测日志进行分析,确定出调测日志的关键信息,并根据该调测日志的关键信息确定API编排的问题点。At present, API applications are usually debugged using the MuleSoft API orchestration tool. The MuleSoft API orchestration tool is a graphical orchestration tool based on an offline integrated development environment. It allows users to use graphical development business processes and provides testers with Commissioning execution result (normal or abnormal commissioning). When the debugging is abnormal, the MuleSoft API Orchestration Tool can generate an API model according to the code written by the tester, and according to the API model, send a specific request to the API gateway to obtain the debugging log, and display the debugging log in the form of text. Through the analysis of the commissioning log, the key information of the commissioning log is determined, and the problem point of the API layout is determined according to the key information of the commissioning log.

但是,目前的方案需要人工分析调测日志,API应用的调测耗时长,效率低;目前的方案仅向测试人员提供调测执行结果和调测日志,无法可视化的向测试人员提供调测过程的API服务的调用流程及调用分支(也即是无法向测试人员提供API服务调用轨迹),可视化效果较差;目前的方案以文本的形式显示调测日志,测试人员无法迅速查看到API编排的问题点,用户体验较低。However, the current solution requires manual analysis of the commissioning logs, and the commissioning of API applications is time-consuming and inefficient; the current solution only provides the testers with the commissioning execution results and the commissioning logs, and cannot visually provide the testers with the commissioning process The call process and call branch of the API service (that is, the API service call trace cannot be provided to the tester), and the visualization effect is poor; the current solution displays the debugging log in the form of text, and the tester cannot quickly view the API layout. The problem is that the user experience is low.

本申请实施例提供一种API应用调测方法及装置、存储介质,无需人工分析就可以获取并呈现调测日志中的关键信息,有助于减小API应用的调测耗时,提高API应用的调测效率,提升用户体验;并且可以获取并呈现API应用调测过程中的API服务调用轨迹,API应用调测的可视化效果较好。下面对本申请实施例的方案进行详细阐述。The embodiments of the present application provide an API application debugging method, device, and storage medium, which can acquire and present key information in a debugging log without manual analysis, which helps reduce the time consuming of API application debugging and improves API application performance. It can improve the commissioning efficiency and improve the user experience; and can obtain and display the API service call trace during the API application commissioning process, and the visualization effect of API application commissioning is better. The solutions of the embodiments of the present application are described in detail below.

请参考图1,其示出了本申请实施例所涉及的一种实施环境的示意图,该实施环境包括API应用调测装置01和API网关02,API应用调测装置01与API网关02可以通过有线网络或者无线网络通信连接,无线网络可以包括但不限于:无线保真(wireless fidelity,WIFI)、蓝牙、红外、紫蜂(zigbee)或数据等。Please refer to FIG. 1 , which shows a schematic diagram of an implementation environment involved in an embodiment of the present application. The implementation environment includes an API application debugging device 01 and an API gateway 02 . The API application debugging device 01 and the API gateway 02 can pass through the Wired network or wireless network communication connection, wireless network may include but not limited to: wireless fidelity (wireless fidelity, WIFI), bluetooth, infrared, zigbee (zigbee) or data and so on.

API应用调测装置01可以是终端或运行在终端上的调测装置或调测工具。终端可以为智能手机、平板电脑或台式电脑等。API网关02可以是一台网关,或者由若干台网关组成的网关集群。示例地,API网关02可以包括部署在测试环境(例如沙箱测试环境)中的网关和部署在生产环境(例如API应用的真实应用环境)中的网关。The API application debugging device 01 may be a terminal or a debugging device or a debugging tool running on the terminal. The terminal can be a smart phone, a tablet computer, or a desktop computer. The API gateway 02 may be one gateway, or a gateway cluster composed of several gateways. For example, the API gateway 02 may include a gateway deployed in a test environment (eg, a sandbox test environment) and a gateway deployed in a production environment (eg, a real application environment of an API application).

API应用调测装置01用于将编排得到的API应用部署到API网关02中,并通过与API网关02交互来调测API应用。API网关02用于生成调测日志以及向API应用调测装置01提供调测日志。此外,API网关02还用于对API应用进行生命周期的管理。The API application debugging device 01 is configured to deploy the API application obtained by the orchestration into the API gateway 02, and to debug the API application by interacting with the API gateway 02. The API gateway 02 is used to generate a commissioning log and provide the commissioning log to the API application commissioning device 01 . In addition, the API gateway 02 is also used to manage the life cycle of the API application.

在一些实施场景中,API应用调测装置01也称为API服务跟踪系统,API服务跟踪系统可以包括API开发单元和API调测单元,API开发单元主要用于API应用的开发,API调测单元主要用于API应用的调测。示例地,API开发单元用于API与API服务之间的编排关系的生成,以及沙箱环境和生产环境的配置;API调测单元用于测试用例(用于调测API应用)的生成、测试的执行(也即是API服务的调用),以及调测日志的分析。In some implementation scenarios, the API application debugging apparatus 01 is also called an API service tracking system. The API service tracking system may include an API development unit and an API debugging unit. The API development unit is mainly used for the development of API applications, and the API debugging unit It is mainly used for debugging API applications. For example, the API development unit is used for the generation of the orchestration relationship between the API and the API service, as well as the configuration of the sandbox environment and the production environment; the API debugging unit is used for the generation and testing of test cases (for debugging API applications) The execution of the API service (that is, the call of the API service), and the analysis of the debugging log.

需要指出的是,图1所示的实施环境仅用于举例,并非用于限制本申请实施例的技术方案。本领域的技术人员应当明白,在具体实现过程中,本申请的实施环境还可能包括其他设备,并且可以根据需要来配置各个设备的数量。It should be pointed out that the implementation environment shown in FIG. 1 is only used for example, and is not used to limit the technical solutions of the embodiments of the present application. Those skilled in the art should understand that, in the specific implementation process, the implementation environment of the present application may also include other devices, and the number of each device can be configured as required.

请参考图2,其示出了本申请实施例实施例提供的一种API应用调测方法的方法流程图,该方法可以应用于上述实施环境,且可以由API应用调测装置01来执行。参见图2,该方法可以包括如下步骤:Please refer to FIG. 2 , which shows a method flowchart of an API application debugging method provided by an embodiment of the present application. The method can be applied to the above-mentioned implementation environment and can be executed by the API application debugging apparatus 01 . Referring to Figure 2, the method may include the following steps:

步骤101、获取调测执行结果,调测执行结果是对目标API应用进行调测的执行结果,目标API应用由至少一个API服务编排而成。Step 101: Obtain a commissioning execution result, where the commissioning execution result is an execution result of commissioning a target API application, and the target API application is composed of at least one API service.

可选地,API应用调测装置可以根据测试用例,通过与API网关交互对目标API应用进行调测。在调测执行完毕(也即是对目标API应用中的API服务调用结束)之后,API网关可以生成调测执行结果,API应用调测装置可以从API网关获取该调测执行结果。其中,调测执行结果可以为调测正常或异常。测试用例可以是测试人员部署在API应用调测装置中的,目标API应用由至少一个API服务编排而成。示例地,请参考图3,其示出了本申请实施例提供的一种目标API应用中的API服务编排顺序的示意图,参见图3,目标API应用由API服务N1、API服务N3和API服务N2顺序编排而成,目标API应用中的API服务编排顺序为:API服务N1—>API服务N3—>API服务N2。其中,图3中的每个圆表示一个图元,图元指示API服务。示例地,N1所在的圆表示API服务N1的图元(可以称为图元N1),图元N1指示API服务N1,N2所在的圆表示API服务N2的图元(可以称为图元N2),图元N2指示API服务N2,N3所在的圆表示API服务N3的图元(可以称为图元N3),图元N3指示API服务N3。Optionally, the API application debugging apparatus may conduct debugging on the target API application by interacting with the API gateway according to the test case. After the commissioning and execution is completed (that is, the call to the API service in the target API application ends), the API gateway may generate a commissioning execution result, and the API application commissioning apparatus may obtain the commissioning execution result from the API gateway. The commissioning execution result may be normal or abnormal for commissioning. The test case may be deployed by the tester in the API application debugging device, and the target API application is composed of at least one API service. For example, please refer to FIG. 3 , which shows a schematic diagram of an API service orchestration sequence in a target API application provided by an embodiment of the present application. Referring to FIG. 3 , the target API application consists of API service N1 , API service N3 and API service N2 is arranged in sequence, and the API service arrangement order in the target API application is: API service N1—>API service N3—>API service N2. Among them, each circle in Figure 3 represents a graphic element, and the graphic element indicates an API service. For example, the circle where N1 is located represents the graphic element of API service N1 (which may be referred to as graphic element N1), the graphic element N1 indicates API service N1, and the circle where N2 is located represents the graphic element of API service N2 (which may be called graphic element N2) , the graphic element N2 indicates the API service N2, and the circle where the N3 is located represents the graphic element of the API service N3 (may be referred to as the graphic element N3), and the graphic element N3 indicates the API service N3.

可选地,API应用调测装置从API网关获取调测执行结果可以包括:API应用调测装置向API网关发送调测请求,该调测请求可以携带API应用标识和测试用例,API应用标识指示目标API应用;API网关接收到该调测请求后,根据该API应用标识确定目标API应用,并根据该测试用例,调用目标API应用中的API服务以对目标API应用进行调测,在对目标API应用中的API服务调用结束时,API网关生成调测执行结果;之后,API网关向API应用调测装置发送调测响应,该调测响应包括调测执行结果;API应用调测装置接收到调测响应后,对调测响应进行解析得到调测执行结果。Optionally, obtaining the commissioning execution result from the API gateway by the API application commissioning apparatus may include: the API application commissioning apparatus sends a commissioning request to the API gateway, where the commissioning request may carry the API application identifier and the test case, and the API application identifier indicates Target API application; after the API gateway receives the commissioning request, it determines the target API application according to the API application identifier, and calls the API service in the target API application according to the test case to debug the target API application. When the API service call in the API application ends, the API gateway generates a commissioning execution result; after that, the API gateway sends a commissioning response to the API application commissioning device, and the commissioning response includes the commissioning execution result; the API application commissioning device receives the After the commissioning response, parse the commissioning response to obtain the commissioning execution result.

本申请实施例中,在该步骤101之前,API应用调测装置可以对至少一个API服务进行API编排得到目标API应用,并在API网关上部署该目标API应用。API应用调测装置在API网关上部署目标API应用的过程可以包括:API应用调测装置向API网关发送部署请求,该部署请求携带目标API应用中的API服务的编排信息,API网关接收到部署请求后,根据部署请求中的编排信息在API网关上部署目标API应用,并在部署成功后向API应用调测装置发送用于指示目标API应用部署成功的响应,本申请实施例在此不再赘述。In this embodiment of the present application, before step 101, the API application debugging apparatus may perform API programming on at least one API service to obtain a target API application, and deploy the target API application on the API gateway. The process of deploying the target API application on the API gateway by the API application debugging apparatus may include: the API application debugging apparatus sends a deployment request to the API gateway, the deployment request carries the arrangement information of the API service in the target API application, and the API gateway receives the deployment request. After the request, the target API application is deployed on the API gateway according to the arrangement information in the deployment request, and after the deployment is successful, a response indicating the successful deployment of the target API application is sent to the API application debugging device, which is not repeated in this embodiment of the present application. Repeat.

步骤102、呈现调测执行结果。Step 102 , presenting the commissioning execution result.

API应用调测装置获取到调测执行结果后,可以呈现调测执行结果,以使得测试人员获知调测执行结果。可选地,API应用调测装置具有显示界面,API应用调测装置可以在显示界面中显示调测执行结果。After the API application commissioning device obtains the commissioning execution result, it can present the commissioning execution result, so that the tester can know the commissioning execution result. Optionally, the API application commissioning apparatus has a display interface, and the API application commissioning apparatus can display the commissioning execution result on the display interface.

示例地,请参考图4,其示出了本申请实施例提供的一种API应用调测装置显示调测执行结果的示意图,参见图4,API应用调测装置的显示界面中显示有调测执行结果“调测异常”,此外,还显示有“是否分析”,以及“是”和“否”按钮。当测试人员点击“是”按钮时,API应用调测装置可以对调测执行过程进行分析,当测试人员点击“否”按钮时,API应用调测装置不对调测执行过程进行分析。对调测执行过程进行分析的过程可以参考下述步骤103至步骤110。For example, please refer to FIG. 4 , which shows a schematic diagram of an API application commissioning apparatus displaying commissioning execution results provided by an embodiment of the present application. Referring to FIG. 4 , the display interface of the API application commissioning apparatus displays commissioning The execution result is "Commissioning Abnormal". In addition, "Analysis" and "Yes" and "No" buttons are displayed. When the tester clicks the "Yes" button, the API application debugging device can analyze the debugging execution process. When the tester clicks the "No" button, the API application debugging device does not analyze the debugging execution process. For the process of analyzing the commissioning execution process, reference may be made to the following steps 103 to 110 .

需要指出的是,图4是以调测执行结果异常为例进行说明的,当调测执行结果正常时,API应用调测装置呈现调测执行结果的界面可以参考图4,本申请实施例在此不再赘述。It should be pointed out that FIG. 4 is illustrated by taking an abnormal commissioning execution result as an example. When the commissioning execution result is normal, the API application commissioning apparatus displays the interface of the commissioning execution result. Refer to FIG. 4 . This will not be repeated here.

步骤103、获取目标调测日志,目标调测日志是对目标API应用进行调测的过程中生成的调测日志。Step 103: Obtain a target commissioning log, where the target commissioning log is a commissioning log generated during commissioning of the target API application.

在对目标API应用进行调测的过程中,API网关可以生成目标调测日志,API应用调测装置可以从API网关获取目标调测日志。可选地,API应用调测装置呈现调测执行结果后,测试人员可以根据调测执行结果触发分析指令,当API应用调测装置接收到根据调测执行结果触发的分析指令时,API应用调测装置可以从API网关获取目标调测日志。例如,当测试人员点击图4中的“是”按钮时,可以触发分析指令,API应用调测装置从API网关获取目标调测日志。In the process of debugging the target API application, the API gateway can generate the target debugging log, and the API application debugging device can obtain the target debugging log from the API gateway. Optionally, after the API application commissioning device presents the commissioning execution result, the tester can trigger the analysis instruction according to the commissioning execution result. When the API application commissioning device receives the analysis instruction triggered according to the commissioning execution result, the API application commissioning The test device can obtain the target commissioning log from the API gateway. For example, when the tester clicks the "Yes" button in Figure 4, the analysis instruction can be triggered, and the API application debugging device obtains the target debugging log from the API gateway.

可选地,API应用调测装置从API网关获取目标调测日志可以包括:API应用调测装置向API网关发送调测请求,该调测请求携带API应用标识和第一时间戳,API应用标识指示目标API应用,除此之外,该调测请求还可以携带测试用例;API网关接收到该调测请求后,调用目标API应用中的API服务以对目标API应用进行调测,在调测的过程中,API网关可以针对目标API应用生成调测日志,在对目标API应用中的API服务调用结束时,API网关停止针对标API应用生成调测日志,并将第一时间戳与第二时间戳之间针对目标API应用生成调测日志作为目标调测日志;之后,API网关向API应用调测装置发送调测响应,该调测响应包括该目标调测日志;API应用调测装置接收到调测响应后,对调测响应进行解析得到目标调测日志。其中,第一时间戳为目标API应用调测的开始时间戳,该第一时间戳可以是API应用调测装置向API网关发送调测请求的时间戳,第二时间戳为目标API应用调测的结束时间戳,该第二时间戳可以为API网关调用完目标API应用的最后一个API服务的时间戳,或者API网关对目标API应用的API服务调用异常的时间戳,第二时间戳具体可以根据对目标API应用的API服务调用是否正常确定,本申请实施例在此不再赘述。Optionally, the acquisition of the target commissioning log by the API application commissioning apparatus from the API gateway may include: the API application commissioning apparatus sends a commissioning request to the API gateway, where the commissioning request carries the API application identifier and the first timestamp, the API application identifier Indicates the target API application. In addition, the commissioning request can also carry test cases; after the API gateway receives the commissioning request, it calls the API service in the target API application to commission the target API application. During the process, the API gateway can generate a debug log for the target API application. When the API service call in the target API application ends, the API gateway stops generating the debug log for the target API application, and compares the first timestamp with the second timestamp. Between timestamps, a commissioning log is generated for the target API application as the target commissioning log; after that, the API gateway sends a commissioning response to the API application commissioning device, and the commissioning response includes the target commissioning log; the API application commissioning device receives After the commissioning response is reached, the target commissioning log is obtained by parsing the commissioning response. The first timestamp is the start timestamp of the target API application commissioning, the first timestamp may be the timestamp when the API application commissioning device sends the commissioning request to the API gateway, and the second timestamp is the target API application commissioning The end timestamp of the target API application, the second timestamp can be the timestamp of the last API service of the target API application that is called by the API gateway, or the timestamp of the abnormal call of the API service of the target API application by the API gateway. The second timestamp can specifically be It is determined according to whether the API service call to the target API application is normal, and details are not described herein again in this embodiment of the present application.

需要指出的是,该步骤103中的调测请求与步骤101中的调测请求可以为同一调测请求或不同调测请求,调测响应可以为同一调测响应或不同调测响应。当步骤103中的调测请求与步骤101中的调测请求可以为同一调测请求,且步骤103中的调测响应与步骤101中的调测请求可以为同一调测响应时,容易理解,在步骤101中,API网关已经向API应用调测装置返回目标调测日志,API应用调测装置可以先存储目标调测日志,从而在步骤103中,API应用调测装置从自身的存储空间中读取目标调测日志,就可以实现对目标调测日志的获取,本申请实施例对此不做限定。It should be noted that the commissioning request in step 103 and the commissioning request in step 101 may be the same commissioning request or different commissioning requests, and the commissioning responses may be the same commissioning response or different commissioning responses. When the commissioning request in step 103 and the commissioning request in step 101 can be the same commissioning request, and the commissioning response in step 103 and the commissioning request in step 101 can be the same commissioning response, it is easy to understand, In step 101, the API gateway has returned the target commissioning log to the API application commissioning apparatus, and the API application commissioning apparatus may first store the target commissioning log, so in step 103, the API application commissioning apparatus stores data from its own storage space. The target commissioning log can be obtained by reading the target commissioning log, which is not limited in this embodiment of the present application.

示例地,在本申请实施例中,目标调测日志可以如下所示:For example, in this embodiment of the present application, the target commissioning log may be as follows:

........

<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:14,031]|INFO||253753916688722|Begin Element Execution[Element Id:diagram_N1,xxx]>>><<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:14,031]|INFO||253753916688722|Begin Element Execution[Element Id:diagram_N1,xxx]>>>

........

<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:14,056]|INFO||253753916688722|End Element Execution[Element Id:diagram_N1,xxx]>>><<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:14,056]|INFO||253753916688722|End Element Execution[Element Id:diagram_N1,xxx]>>>

........

<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,021]|INFO||253753916688722|Begin Element Execution[Element Id:diagram_N3,xxx]>>><<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,021]|INFO||253753916688722|Begin Element Execution[Element Id:diagram_N3,xxx]>>>

<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,039]|DEBUG||253753916688722|Start execute diagram,element Id diagram_N3…,inputs:{“rest3_POST_xxxInfo”:{“a”:“stringa”,“b”:intb},outputs:{“rest3_POST_xxxInfo”:{“a”:“stringa”,“b”:intb}.requestInfo:{“reqUrl”:“http://www.example.com”,“method”:“POST”,“headers”:{“content-length”:“162”,“content-type”:“application/json;charset=UTF-8”},“body”:“”}responseInfo:{“statusCode”:200,“code”:200,“headers”:{“content-type”:“application/json”},“body”:“xxx”}<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,039]|DEBUG||253753916688722|Start execute diagram,element Id diagram_N3…,inputs:{“rest3_POST_xxxInfo”:{“a”:” stringa","b":intb},outputs:{"rest3_POST_xxxInfo":{"a":"stringa","b":intb}.requestInfo:{"reqUrl":"http://www.example.com ","method":"POST","headers":{"content-length":"162","content-type":"application/json;charset=UTF-8"},"body":"" }responseInfo:{"statusCode":200,"code":200,"headers":{"content-type":"application/json"},"body":"xxx"}

<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,055]|DEBUG||253753916688722|Complete execute diagram,element Id diagram_N3,cost:7(ms),element execute info is…<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,055]|DEBUG||253753916688722|Complete execute diagram,element Id diagram_N3,cost:7(ms),element execute info is…

<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,098]|INFO||253753916688722|End Element Execution[Element Id:diagram_N3,xxx]>>><<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,098]|INFO||253753916688722|End Element Execution[Element Id:diagram_N3,xxx]>>>

........

<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,321]|INFO||253753916688722|Begin Element Execution[Element Id:diagram_N2,xxx]>>><<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,321]|INFO||253753916688722|Begin Element Execution[Element Id:diagram_N2,xxx]>>>

........

<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,448]|INFO||253753916688722|End Element Execution[Element Id:diagram_N2,xxx]>>><<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,448]|INFO||253753916688722|End Element Execution[Element Id:diagram_N2,xxx]>>>

........

其中,diagram_N1为图元N1的标识,其表示图元N1,图元N1指示API服务N1,因此diagram_N1也可以认为是API服务N1的标识;diagram_N3为图元N3的标识,其表示图元N3,图元N3指示API服务N3,diagram_N3也可以认为是API服务N3的标识;diagram_N2为图元N2的标识,其表示图元N2,图元N2指示API服务N2,diagram_N2也可以认为是API服务N2的标识;2018-09-21 14:31:14,031为第一时间戳;2018-09-21 14:31:15,448为第二时间戳;INFO为目标调测日志的日志级别;253753916688722为对目标API应用进行调测的跟踪实例标识(也即是对目标API应用调测的测试用例的标识,或者说目标调测日志的跟踪实例标识);applicationImpl TheadPool-4为线程池的线程标识,表示对目标API应用的调测由applicationImpl TheadPool-4指示的线程执行。上述目标调测日志包括API服务N1的调用日志,API服务N3的调用日志和API服务N2的调用日志,表示对目标API应用调测的过程中,依次调用了目标API应用的API服务N1、API服务N3和API服务N2。其中,Among them, diagram_N1 is the identifier of the graphic element N1, which represents the graphic element N1, and the graphic element N1 indicates the API service N1, so the diagram_N1 can also be regarded as the identifier of the API service N1; the diagram_N3 is the identifier of the graphic element N3, which represents the graphic element N3, The graphic element N3 indicates the API service N3, and diagram_N3 can also be considered as the identifier of the API service N3; diagram_N2 is the identifier of the graphic element N2, which represents the graphic element N2, the graphic element N2 indicates the API service N2, and the diagram_N2 can also be considered as the API service N2. ID; 2018-09-21 14:31:14,031 is the first timestamp; 2018-09-21 14:31:15,448 is the second timestamp; INFO is the log level of the target debugging log; 253753916688722 is the application to the target API The trace instance identifier for debugging (that is, the identifier of the test case for debugging the target API application, or the trace instance identifier of the target debugging log); applicationImpl TheadPool-4 is the thread identifier of the thread pool, indicating that the target API The debugging of the application is performed by the thread indicated by applicationImpl TheadPool-4. The above target commissioning log includes the call log of API service N1, the call log of API service N3, and the call log of API service N2, indicating that during the commissioning of the target API application, the API service N1 and API of the target API application are called in sequence. Service N3 and API Service N2. in,

API服务N1的调用日志可以为调用日志1,调用日志1的内容为:The call log of API service N1 can be call log 1, and the content of call log 1 is:

“<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:14,031]|INFO||253753916688722|Begin Element Execution[Element Id:diagram_N1,xxx]>>>“<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:14,031]|INFO||253753916688722|Begin Element Execution[Element Id:diagram_N1,xxx]>>>

........

<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:14,056]|INFO||253753916688722|End Element Execution[Element Id:diagram_N1,xxx]>>>”<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:14,056]|INFO||253753916688722|End Element Execution[Element Id:diagram_N1,xxx]>>>”

API服务N1的调用日志表示在2018-09-21 14:31:14,031开始调用(关键字BeginElement Execution)API服务N1(关键字diagram_N1),在2018-09-21 14:31:14,056结束调用(关键字End Element Execution)API服务N1。The call log of API service N1 indicates that the call (keyword BeginElement Execution) API service N1 (keyword diagram_N1) starts at 2018-09-21 14:31:14,031, and ends at 2018-09-21 14:31:14,056 (keyword Word End Element Execution) API service N1.

API服务N3的调用日志可以为调用日志3,调用日志3的内容为:The call log of API service N3 can be call log 3, and the content of call log 3 is:

“<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,021]|INFO||253753916688722|Begin Element Execution[Element Id:diagram_N3,xxx]>>>“<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,021]|INFO||253753916688722|Begin Element Execution[Element Id:diagram_N3,xxx]>>>

<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,039]|DEBUG||253753916688722|Start execute diagram,element Id diagram_N3…,inputs:{“rest3_POST_xxxInfo”:{“a”:“stringa”,“b”:intb},outputs:{“rest3_POST_xxxInfo”:{“a”:“stringa”,“b”:intb}.requestInfo:{“reqUrl”:“http://www.example.com”,“method”:“POST”,“headers”:{“content-length”:“162”,“content-type”:“application/json;charset=UTF-8”},“body”:“”}responseInfo:{“statusCode”:200,“code”:200,“headers”:{“content-type”:“application/json”},“body”:“xxx”}<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,039]|DEBUG||253753916688722|Start execute diagram,element Id diagram_N3…,inputs:{“rest3_POST_xxxInfo”:{“a”:” stringa","b":intb},outputs:{"rest3_POST_xxxInfo":{"a":"stringa","b":intb}.requestInfo:{"reqUrl":"http://www.example.com ","method":"POST","headers":{"content-length":"162","content-type":"application/json;charset=UTF-8"},"body":"" }responseInfo:{"statusCode":200,"code":200,"headers":{"content-type":"application/json"},"body":"xxx"}

<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,055]|DEBUG||253753916688722|Complete execute diagram,element Id diagram_N3,cost:7(ms),element execute info is…<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,055]|DEBUG||253753916688722|Complete execute diagram,element Id diagram_N3,cost:7(ms),element execute info is…

<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,098]|INFO||253753916688722|End Element Execution[Element Id:diagram_N3,xxx]>>>”<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,098]|INFO||253753916688722|End Element Execution[Element Id:diagram_N3,xxx]>>>”

API服务N3的调用日志表示在2018-09-21 14:31:15,021开始调用(关键字BeginElement Execution)API服务N3(关键字diagram_N3),在2018-09-21 14:31:15,098结束调用(关键字End Element Execution)API服务N3,API服务N3的输入信息(关键字inputs)为{“rest3_POST_xxxInfo”:{“a”:“stringa”,“b”:intb},输出信息(关键字outputs)为{“rest3_POST_xxxInfo”:{“a”:“stringa”,“b”:intb},请求信息(关键字requestInfo)为{“reqUrl”:“http://www.example.com”,“method”:“POST”,“headers”:{“content-length”:“162”,“content-type”:“application/json;charset=UTF-8”},“body”:“”},响应信息(关键字responseInfo)为{“statusCode”:200,“code”:200,“headers”:{“content-type”:“application/json”},“body”:“xxx”},调用API服务N3的耗时(关键字cost)为7毫秒。The call log of API service N3 indicates that API service N3 (keyword diagram_N3) was called at 2018-09-21 14:31:15,021 (keyword BeginElement Execution), and ended at 2018-09-21 14:31:15,098 (keyword Word End Element Execution) API service N3, the input information (keyword inputs) of API service N3 is {"rest3_POST_xxxInfo":{"a":"stringa","b":intb}, and the output information (keyword outputs) is {"rest3_POST_xxxInfo":{"a":"stringa","b":intb}, the request information (keyword requestInfo) is {"reqUrl":"http://www.example.com","method": "POST", "headers": {"content-length": "162", "content-type": "application/json; charset=UTF-8"}, "body": ""}, response information (key The word responseInfo) is {"statusCode":200,"code":200,"headers":{"content-type":"application/json"},"body":"xxx"}, the consumption of calling API service N3 time (keyword cost) is 7 milliseconds.

API服务N2的调用日志可以为调用日志2,调用日志2的内容为:The call log of API service N2 can be call log 2, and the content of call log 2 is:

“<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,321]|INFO||253753916688722|Begin Element Execution[Element Id:diagram_N2,xxx]>>>“<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,321]|INFO||253753916688722|Begin Element Execution[Element Id:diagram_N2,xxx]>>>

........

<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,448]|INFO||253753916688722|End Element Execution[Element Id:diagram_N2,xxx]>>>”<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,448]|INFO||253753916688722|End Element Execution[Element Id:diagram_N2,xxx]>>>”

API服务N2的调用日志表示在2018-09-21 14:31:15,321开始调用(关键字BeginElement Execution)API服务N2(关键字diagram_N2),在2018-09-21 14:31:15,448结束调用(关键字End Element Execution)API服务N2。The call log of API service N2 indicates that the call (keyword BeginElement Execution) API service N2 (keyword diagram_N2) starts at 2018-09-21 14:31:15,321, and ends at 2018-09-21 14:31:15,448 (keyword Word End Element Execution) API service N2.

步骤104、根据目标调测日志,确定目标API应用中的API服务的调用顺序。Step 104: Determine the calling sequence of the API service in the target API application according to the target commissioning log.

可选地,API应用调测装置可以以正则方式对目标调测日志进行分析,确定目标API应用中被调用的API服务的调用顺序。API应用调测装置可以根据目标调测日志中的调用关键字,以正则方式对目标调测日志进行分析,确定目标API应用中被调用的API服务的调用顺序。其中,调用关键字可以包括调用开始关键字(例如Begin Element Execution),调用结束关键字(例如End Element Execution)和图元标识(例如diagram_N1)等。Optionally, the API application debugging apparatus may analyze the target debugging log in a regular manner, and determine the calling sequence of the API services called in the target API application. The API application commissioning apparatus can analyze the target commissioning log in a regular manner according to the call keywords in the target commissioning log, and determine the calling sequence of the API services called in the target API application. Wherein, the call keyword may include a call start keyword (eg, Begin Element Execution), a call end keyword (eg, End Element Execution), a primitive identifier (eg, diagram_N1 ), and the like.

示例地,API应用调测装置根据步骤103中的目标调测日志,确定目标API应用中的API服务的调用顺序为:API服务N1—>API服务N3—>API服务N2。For example, the API application debugging apparatus determines, according to the target debugging log in step 103, that the calling sequence of the API service in the target API application is: API service N1->API service N3->API service N2.

在一些场景中,调用顺序也称为执行顺序,执行顺序可以以列表的形式体现,示例地,执行顺序可以为执行顺序列表list[API服务N1,API服务N3,API服务N2]。In some scenarios, the calling sequence is also called execution sequence, and the execution sequence may be embodied in the form of a list. For example, the execution sequence may be an execution sequence list [API service N1, API service N3, API service N2].

步骤105、从目标调测日志中,获取各个被调用的API服务的调用日志。Step 105: Obtain call logs of each called API service from the target commissioning log.

可选地,API应用调测装置可以根据被调用的API服务的特征标签,从目标调测日志中,获取各个被调用的API服务的调用日志。在一些场景中,调用日志也称为特征日志。Optionally, the apparatus for debugging the API application may acquire the call log of each called API service from the target debugging log according to the feature tag of the called API service. In some scenarios, call logs are also called feature logs.

请参考图5,其示出了本申请实施例提供的一种从目标调测日志中获取各个被调用的API服务的调用日志的方法流程图,参见图5,该方法可以包括:Please refer to FIG. 5 , which shows a flowchart of a method for obtaining call logs of each called API service from a target commissioning log provided by an embodiment of the present application. Referring to FIG. 5 , the method may include:

子步骤1051、确定各个被调用的API服务的特征标签,特征标签包括被调用的API服务的标识和对目标API应用进行调测的跟踪实例标识。Sub-step 1051: Determine the characteristic labels of each called API service, where the characteristic labels include the identifier of the called API service and the identifier of the trace instance for debugging the target API application.

其中,目标调测日志中存在某一API服务的标识,则说明在调测目标API应用的过程中调用了该API服务。Wherein, if the identifier of an API service exists in the target debugging log, it means that the API service is called during the debugging of the target API application.

可选地,API应用调测装置可以根据各个被调用的API服务的标识和对目标API应用进行调测的跟踪实例标识,生成各个被调用的API服务的特征标签。Optionally, the API application debugging apparatus may generate a feature label of each called API service according to the identifier of each called API service and the tracking instance identifier for debugging the target API application.

示例地,对目标API应用进行调测的跟踪实例标识为253753916688722,API服务1的标识可以为diagram_N1,API服务2的标识可以为diagram_N2,API服务3的标识可以为diagram_N3,且API服务1、API服务2和API服务3均为被调用的API服务,则API服务1的特征标签可以为{253753916688722,diagram_N1},API服务2的特征标签可以为{253753916688722,diagram_N2},API服务3的特征标签可以为{253753916688722,diagram_N3}。For example, the trace instance identifier for debugging the target API application is 253753916688722, the identifier of API service 1 may be diagram_N1, the identifier of API service 2 may be diagram_N2, the identifier of API service 3 may be diagram_N3, and API service 1, API If both service 2 and API service 3 are called API services, the feature label of API service 1 can be {253753916688722, diagram_N1}, the feature label of API service 2 can be {253753916688722, diagram_N2}, and the feature label of API service 3 can be is {253753916688722, diagram_N3}.

子步骤1052、根据各个被调用的API服务的特征标签,从目标调测日志中提取各个被调用的API服务的调用日志。Sub-step 1052: Extract the call log of each called API service from the target commissioning log according to the feature tag of each called API service.

可选地,API应用调测装置可以根据各个被调用的API服务的特征标签,结合目标调测日志中的调用时间关键字,从目标调测日志中确定各个被调用的API服务的调用日志,并提取各个被调用的API服务的调用日志。其中,调用时间关键字可以包括调用开始关键字(例如Begin Element Execution)和调用结束关键字(例如End Element Execution)。Optionally, the API application debugging apparatus may determine the calling log of each called API service from the target debugging log according to the feature tag of each called API service and in combination with the calling time keyword in the target debugging log, And extract the call log of each called API service. The call time keyword may include a call start keyword (eg, Begin Element Execution) and a call end keyword (eg, End Element Execution).

示例地,API应用调测装置根据{253753916688722,diagram_N1}、Begin ElementExecution和End Element Execution,从步骤103的目标调测日志中提取API服务1的调用日志1,根据{253753916688722,diagram_N2}、Begin Element Execution和End ElementExecution,从步骤103的目标调测日志中提取API服务2的调用日志2,根据{253753916688722,diagram_N3}、Begin Element Execution和End Element Execution,从步骤103的目标调测日志中提取API服务3的调用日志3。For example, the API application commissioning device extracts the call log 1 of API service 1 from the target commissioning log in step 103 according to {253753916688722, diagram_N1}, Begin ElementExecution and End Element Execution, according to {253753916688722, diagram_N2}, Begin Element Execution and End ElementExecution, extract the call log 2 of API service 2 from the target commissioning log in step 103, and extract API service 3 from the target commissioning log in step 103 according to {253753916688722, diagram_N3}, Begin Element Execution and End Element Execution The call log of 3.

步骤106、根据各个被调用的API服务与相应的调用日志,建立被调用的API服务与调用日志的关联关系。Step 106: Establish an association relationship between the called API service and the calling log according to each called API service and the corresponding calling log.

可选地,API应用调测装置可以将每个被调用的API服务与该被调用的API服务的调用日志关联,得到被调用的API服务与调用日志的关联关系。示例地,API应用调测装置将API服务1与调用日志1关联,将API服务2与调用日志2关联,将API服务3与调用日志3关联,得到被调用的API服务与调用日志的关联关系可以如下表1所示:Optionally, the API application debugging apparatus may associate each called API service with a call log of the called API service, and obtain an association relationship between the called API service and the call log. For example, the API application debugging apparatus associates the API service 1 with the call log 1, associates the API service 2 with the call log 2, and associates the API service 3 with the call log 3, and obtains the association relationship between the called API service and the call log It can be shown in Table 1 below:

表1Table 1

API服务API service 调用日志call log API服务1API Service 1 调用日志1call log 1 API服务2API Service 2 调用日志2call log 2 API服务3API Service 3 调用日志3call log 3

步骤107、根据目标API应用中的API服务的调用顺序,呈现API服务调用轨迹。Step 107 , present the calling track of the API service according to the calling sequence of the API service in the target API application.

API应用调测装置可以根据目标API应用中的API服务的调用顺序,呈现API服务调用轨迹,例如,显示API服务调用轨迹。其中,API服务调用轨迹至少包括被调用的API服务的图元以及按照调用顺序连接至少两个被调用的API服务的图元的轨迹线,API服务的图元指示API服务。在一些实施场景中,调用轨迹也称为执行轨迹。The API application debugging apparatus can present the API service calling track according to the calling sequence of the API service in the target API application, for example, display the API service calling track. Wherein, the API service calling track includes at least the picture element of the called API service and the trajectory line connecting the picture elements of at least two called API services according to the calling sequence, and the picture element of the API service indicates the API service. In some implementation scenarios, the call trajectory is also referred to as the execution trajectory.

在本申请实施例中,API服务调用轨迹可以为正常轨迹或异常轨迹。API应用调测装置根据目标API应用中的API服务的调用顺序呈现API服务调用轨迹可以包括:当API服务调用轨迹为正常轨迹时,API应用调测装置根据调用顺序呈现API服务调用轨迹,API服务调用轨迹包括被调用的API服务的图元以及按照调用顺序连接所有被调用的API服务的图元的轨迹线。当API服务调用轨迹为异常轨迹时,API应用调测装置根据调用顺序和API服务编排顺序呈现API服务调用轨迹,API服务调用轨迹包括被调用的API服务的图元,未被调用的API服务的图元,按照调用顺序连接所有被调用的API服务的图元的轨迹线,按照API服务编排顺序连接所有未被调用的API服务的图元的编排线,以及,按照API服务编排顺序连接被调用的API服务的图元与未被调用的API服务的图元的编排线,被调用的API服务包括调用正常的API服务和调用异常的API服务,调用正常的API服务的图元、调用异常的API服务的图元以及未被调用的API服务的图元的呈现形式不同。为了更直观的呈现API服务调用轨迹为正常轨迹或异常轨迹,API应用调测装置还可以呈现API服务编排顺序,以使测试人员能够根据API服务编排顺序直观的确定出API服务调用轨迹为正常轨迹或异常轨迹。In this embodiment of the present application, the API service calling track may be a normal track or an abnormal track. The API application debugging apparatus presents the API service calling trace according to the calling sequence of the API services in the target API application, which may include: when the API service calling trace is a normal trace, the API application debugging apparatus presents the API service calling trace according to the calling sequence. The call trace includes the primitives of the called API service and the trace lines connecting the primitives of all the called API services in the calling sequence. When the API service invocation trace is an abnormal trace, the API application debugging device presents the API service invocation trace according to the invocation sequence and the API service arrangement order. Primitives, the trace lines connecting the primitives of all called API services in the calling order, the arranging lines connecting all the primitives of the API services that have not been called according to the API service orchestration order, and, connecting the called API services in the order of API service orchestration The arrangement line of the primitives of the API service and the primitives of the API services that have not been called. The called API services include calling normal API services and calling abnormal API services, calling normal API services, and calling abnormal API services. The presentation forms of the primitives of the API service and the primitives of the API services that have not been called are different. In order to more intuitively present the API service call track as a normal track or an abnormal track, the API application debugging device can also present the API service arrangement sequence, so that the tester can intuitively determine the API service call track as the normal track according to the API service arrangement sequence. or abnormal trajectory.

示例地,请参考图6,其示出了本申请实施例提供的一种API服务调用轨迹的示意图,该图6还出了API服务编排顺序。参见图6,API服务调用轨迹包括API服务N1、API服务N3和API服务N2(被调用的API服务)的图元以及按照调用顺序连接API服务N1、API服务N3和API服务N2的图元的轨迹线,该图6表示在对目标API应用调测的过程中,依次调用了API服务N1、API服务N3和API服务N2,且API服务N1、API服务N3和API服务N2均调用正常,该图6所示的API服务调用轨迹为正常轨迹。For example, please refer to FIG. 6 , which shows a schematic diagram of an API service invocation trace provided by an embodiment of the present application, and FIG. 6 also shows an API service arrangement sequence. Referring to FIG. 6 , the API service call trace includes the graphic elements of API service N1, API service N3 and API service N2 (the called API service) and the graphic elements connecting API service N1, API service N3 and API service N2 in the calling sequence. Trajectory line, Fig. 6 shows that in the process of debugging the target API application, API service N1, API service N3 and API service N2 are called in sequence, and API service N1, API service N3 and API service N2 are all called normally. The API service call trace shown in Figure 6 is a normal trace.

示例地,请参考图7,其示出了本申请实施例提供的另一种API服务调用轨迹的示意图,该图7还出了API服务编排顺序。参见图7,API服务调用轨迹包括API服务N1和API服务N3(所有被调用的API服务)的图元,API服务N2(所有未被调用的API服务)的图元,按照调用顺序连接API服务N1和API服务N3(所有被调用的API服务)的图元的轨迹线,按照API服务编排顺序连接API服务N2(未被调用的API服务)的图元的编排线,以及,按照API服务编排顺序连接API服务N3(被调用的API服务)的图元与API服务N2(未被调用的API服务)的图元的编排线,被调用的API服务包括API服务N1(调用正常的API服务)和API服务N3(调用异常的API服务),API服务N1(调用正常的API服务)的图元、API服务N3(调用异常的API服务)的图元以及API服务N2(未被调用的API服务)的图元的呈现形式不同。该图7表示在对目标API应用调测的过程中,依次调用了API服务N2和API服务N3,未调用API服务N2,且API服务N1调用正常,API服务N3调用异常,该图7所示的API服务调用轨迹为异常轨迹。For example, please refer to FIG. 7 , which shows a schematic diagram of another API service invocation trace provided by an embodiment of the present application, and FIG. 7 also shows an API service arrangement sequence. Referring to Fig. 7, the API service call trace includes the primitives of API service N1 and API service N3 (all API services that are called), the primitives of API service N2 (all API services that have not been called), and the API services are connected in the calling sequence. Trajectory lines of primitives of N1 and API service N3 (all called API services), choreography lines connecting primitives of API service N2 (not called API services) in the order of API service choreography, and choreography according to API services An arrangement line that sequentially connects the primitives of API service N3 (the invoked API service) and the primitives of API service N2 (the API service that has not been invoked). The invoked API services include API service N1 (the normal API service is invoked) and API service N3 (calling abnormal API service), API service N1 (calling normal API service) graphic element, API service N3 (calling abnormal API service) graphic element and API service N2 (not calling API service) ) are rendered differently. Figure 7 shows that in the process of debugging the target API application, the API service N2 and the API service N3 are called in sequence, the API service N2 is not called, the API service N1 is called normally, and the API service N3 is called abnormally, as shown in Figure 7 The API service call trace is abnormal trace.

步骤108、从目标调测日志中,获取目标API服务的目标调用日志。Step 108: Obtain the target call log of the target API service from the target commissioning log.

其中,目标API服务是对目标API应用进行调测的过程中被调用的任一API服务,该目标API服务可以是调用异常的API服务,也可以是调用正常的API服务。The target API service is any API service that is called in the process of debugging the target API application, and the target API service can be an API service that calls abnormally, or can call a normal API service.

可选地,在步骤108之前,API应用调测装置可以根据目标调测日志,确定目标API应用中的API服务的调用顺序,并根据目标API应用中的API服务的调用顺序,呈现API服务调用轨迹,API应用调测装置呈现API服务调用轨迹后,测试人员可以根据API服务调用轨迹,针对目标API服务的图元触发获取指令(例如点击API服务调用轨迹中的目标API服务的图元获取指令);当API应用调测装置检测到针对目标API服务的图元触发的获取指令时,API应用调测装置可以从目标调测日志中,获取目标API服务的目标调用日志。可选地,API应用调测装置可以从被调用的API服务与调用日志的关联关系中,获取目标API服务的目标调用日志。被调用的API服务与调用日志的关联关系可以是被调用的API服务的标识与调用日志的关联关系,API应用调测装置可以根据目标API服务的标识,查询被调用的API服务与调用日志的关联关系,得到目标调用日志,并获取目标调用日志。Optionally, before step 108, the API application debugging apparatus may determine the calling sequence of the API services in the target API application according to the target debugging log, and present the API service calls according to the calling sequence of the API services in the target API application. After the API application debugging device presents the API service call trace, the tester can trigger the acquisition instruction for the graphic element of the target API service according to the API service call trace (for example, click the graphic element acquisition instruction of the target API service in the API service call trace) ); when the API application debugging device detects the acquisition instruction triggered by the graphic element of the target API service, the API application debugging device can obtain the target calling log of the target API service from the target debugging log. Optionally, the API application debugging apparatus may obtain the target invocation log of the target API service from the association relationship between the invoked API service and the invocation log. The relationship between the called API service and the call log can be the relationship between the identifier of the called API service and the call log. The API application debugging device can query the relationship between the called API service and the call log according to the identifier of the target API service. Association relationship, get the target call log, and get the target call log.

示例地,以图6为例,API服务调用轨迹如图6所示,目标API服务为API服务N3(调用正常的API服务)。测试人员可以根据图6所示的API服务调用轨迹,针对API服务N3的图元触发获取指令,当API应用调测装置检测到针对API服务N3的图元触发的获取指令时,API应用调测装置可以从上述表1中,获取API服务N3的调用日志3(目标调用日志)。Illustratively, taking FIG. 6 as an example, the API service calling trace is shown in FIG. 6 , and the target API service is API service N3 (calling a normal API service). According to the API service call trace shown in Figure 6, the tester can trigger the acquisition instruction for the graphic element of the API service N3. When the API application debugging device detects the acquisition instruction triggered by the graphic element of the API service N3, the API application debugging The device may obtain the call log 3 (target call log) of the API service N3 from the above Table 1.

示例地,调用日志3(目标调用日志)的内容为:For example, the content of call log 3 (target call log) is:

“<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,021]|INFO||253753916688722|Begin Element Execution[Element Id:diagram_N3,xxx]>>>“<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,021]|INFO||253753916688722|Begin Element Execution[Element Id:diagram_N3,xxx]>>>

<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,039]|DEBUG||253753916688722|Start execute diagram,element Id diagram_N3…,inputs:{“rest3_POST_xxxInfo”:{“a”:“stringa”,“b”:intb},outputs:{“rest3_POST_xxxInfo”:{“a”:“stringa”,“b”:intb}.requestInfo:{“reqUrl”:“http://www.example.com”,“method”:“POST”,“headers”:{“content-length”:“162”,“content-type”:“application/json;charset=UTF-8”},“body”:“”}responseInfo:{“statusCode”:200,“code”:200,“headers”:{“content-type”:“application/json”},“body”:“xxx”}<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,039]|DEBUG||253753916688722|Start execute diagram,element Id diagram_N3…,inputs:{“rest3_POST_xxxInfo”:{“a”:” stringa","b":intb},outputs:{"rest3_POST_xxxInfo":{"a":"stringa","b":intb}.requestInfo:{"reqUrl":"http://www.example.com ","method":"POST","headers":{"content-length":"162","content-type":"application/json;charset=UTF-8"},"body":"" }responseInfo:{"statusCode":200,"code":200,"headers":{"content-type":"application/json"},"body":"xxx"}

<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,055]|DEBUG||253753916688722|Complete execute diagram,element Id diagram_N3,cost:7(ms),element execute info is…<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,055]|DEBUG||253753916688722|Complete execute diagram,element Id diagram_N3,cost:7(ms),element execute info is…

<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,098]|INFO||253753916688722|End Element Execution[Element Id:diagram_N3,xxx]>>>”。<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,098]|INFO||253753916688722|End Element Execution[Element Id:diagram_N3,xxx]>>>”.

步骤109、获取目标调用日志中的关键信息。Step 109: Acquire key information in the target call log.

其中,关键信息可以包括但不限于:输入信息(关键字inputs)、输出信息(关键字outputs)、请求信息(关键字requestInfo)、响应信息(关键字responseInfo)和异常信息(关键字Exception)。当目标API服务为调用正常的API服务时,目标调用日志中的关键信息包括输入信息、输出信息、请求信息和响应信息,当目标API服务为调用异常的API服务时,目标调用日志中的关键信息包括异常信息。The key information may include, but is not limited to: input information (keyword inputs), output information (keyword outputs), request information (keyword requestInfo), response information (keyword responseInfo) and exception information (keyword Exception). When the target API service is a normal API service, the key information in the target call log includes input information, output information, request information and response information. When the target API service is an abnormal API service, the key information in the target call log The information includes exception information.

可选地,API应用调测装置可以根据目标API服务的标识,结合关键字获取目标调用日志中的关键信息。示例地,继续以图6为例,目标API服务为API服务N3,API应用调测装置根据API服务N3的标识diagram_N3,关键字inputs、关键字outputs、关键字requestInfo和关键字responseInfo,获取目标调用日志(步骤108中的调用日志3)中的关键信息,该关键信息可以为:“inputs:{“rest3_POST_xxxInfo”:{“a”:“stringa”,“b”:intb},outputs:{“rest3_POST_xxxInfo”:{“a”:“stringa”,“b”:intb}.requestInfo:{“reqUrl”:“http://www.example.com”,“method”:“POST”,“headers”:{“content-length”:“162”,“content-type”:“application/json;charset=UTF-8”},“body”:“”}responseInfo:{“statusCode”:200,“code”:200,“headers”:{“content-type”:“application/json”},“body”:“xxx”}”。Optionally, the API application debugging apparatus may obtain key information in the target call log in combination with the identifier of the target API service and the keyword. 6 as an example, the target API service is API service N3, and the API application debugging device obtains the target call according to the identifier diagram_N3 of the API service N3, the keyword inputs, the keyword outputs, the keyword requestInfo and the keyword responseInfo. The key information in the log (call log 3 in step 108), the key information can be: "inputs:{"rest3_POST_xxxInfo":{"a":"stringa","b":intb}, outputs:{"rest3_POST_xxxInfo" ":{"a":"stringa","b":intb}.requestInfo:{"reqUrl":"http://www.example.com","method":"POST","headers":{ "content-length":"162","content-type":"application/json;charset=UTF-8"},"body":""}responseInfo:{"statusCode":200,"code":200 ,"headers":{"content-type":"application/json"},"body":"xxx"}".

步骤110、呈现关键信息。Step 110, presenting key information.

API应用调测装置获取目标调用日志中的关键信息后,可以呈现该关键信息,以使得测试人员获知该关键信息。可选地,API应用调测装置具有显示界面,API应用调测装置可以在显示界面中显示目标调用日志中的关键信息。After acquiring the key information in the target call log, the API application debugging apparatus can present the key information, so that the tester can know the key information. Optionally, the API application debugging apparatus has a display interface, and the API application debugging apparatus can display key information in the target call log on the display interface.

可选地,目标调用日志可以包括关键信息和非关键信息,API应用调测装置呈现目标调用日志中的关键信息可以包括:API应用调测装置呈现目标调用日志,且以不同于非关键信息的形式呈现关键信息。Optionally, the target invocation log may include key information and non-critical information, and the API application commissioning apparatus presenting the key information in the target invocation log may include: the API application commissioning apparatus presents the target invocation log in a format different from the non-critical information. form to present key information.

示例地,API应用调测装置呈现目标调用日志,且以不同于非关键信息的形式呈现关键信息可以包括:API应用调测装置显示目标调用日志,且关键信息的字号大于非关键信息的字号;API应用调测装置显示目标调用日志,且关键信息的字体不同于非关键信息的字体;API应用调测装置显示目标调用日志,且关键信息高亮,非关键信息非高亮;API应用调测装置显示目标调用日志,且关键信息的字体加粗,非关键信息的字体非加粗;API应用调测装置显示目标调用日志,且关键信息的字体倾斜,非关键信息的字体非倾斜,等等。For example, the API application commissioning apparatus displaying the target call log, and presenting the key information in a form different from the non-critical information may include: the API application commissioning apparatus displays the target call log, and the font size of the key information is larger than the font size of the non-critical information; The API application commissioning device displays the target call log, and the font of the key information is different from the font of the non-critical information; the API application commissioning device displays the target call log, and the key information is highlighted, and the non-critical information is not highlighted; API application commissioning The device displays the target call log, and the font of the key information is bold, and the font of the non-critical information is not bold; the API application debugging device displays the target call log, and the font of the key information is oblique, and the font of the non-critical information is not oblique, etc. .

示例地,API应用调测装置显示目标调用日志,且关键信息的字体加粗,非关键信息的字体非加粗,API应用调测装置显示的关键信息(目标调用日志)可以如下:For example, the API application debugging device displays the target call log, and the font of key information is bold, and the font of non-critical information is not bold, and the key information (target call log) displayed by the API application debugging device may be as follows:

“<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,021]|INFO||253753916688722|Begin Element Execution[Element Id:diagram_N3,xxx]>>>“<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,021]|INFO||253753916688722|Begin Element Execution[Element Id:diagram_N3,xxx]>>>

<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,039]|DEBUG||253753916688722|Start execute diagram,element Id diagram_N3…,inputs:{“rest3_POST_xxxInfo”:{“a”:“stringa”,“b”:intb},outputs:{“rest3_POST_xxxInfo”:{“a”:“stringa”,“b”:intb}.requestInfo:{“reqUrl”:“http://www.example.com”,“method”:“POST”,“headers”:{“content-length”:“162”,“content-type”:“application/json;charset=UTF-8”},“body”:“”}responseInfo:{“statusCode”:200,“code”:200,“headers”:{“content-type”:“application/json”},“body”:“xxx”}<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,039]|DEBUG||253753916688722|Start execute diagram,element Id diagram_N3…,inputs:{“rest3_POST_xxxInfo”:{“a”:” stringa","b":intb},outputs:{"rest3_POST_xxxInfo":{"a":"stringa","b":intb}.requestInfo:{"reqUrl":"http://www.example.com ","method":"POST","headers":{"content-length":"162","content-type":"application/json;charset=UTF-8"},"body":"" }responseInfo:{"statusCode":200,"code":200,"headers":{"content-type":"application/json"},"body":"xxx"}

<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,055]|DEBUG||253753916688722|Complete execute diagram,element Id diagram_N3,cost:7(ms),element execute info is…<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,055]|DEBUG||253753916688722|Complete execute diagram,element Id diagram_N3,cost:7(ms),element execute info is…

<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,098]|INFO||253753916688722|End Element Execution[Element Id:diagram_N3,xxx]>>>”。<<<[applicationImpl TheadPool-4]|[2018-09-21 14:31:15,098]|INFO||253753916688722|End Element Execution[Element Id:diagram_N3,xxx]>>>”.

需要指出的是,步骤108至步骤110是以目标API服务为调用正常的API服务为例说明的,当目标API服务为调用异常的API服务时,相应的实现过程可以参考步骤108至步骤110。示例地,当目标API服务为调用异常的API服务时,API应用调测装置获取并呈现的关键信息(目标调用日志)可以如下:It should be pointed out that steps 108 to 110 are illustrated by taking the target API service as an example of calling a normal API service. When the target API service is an API service with an abnormal call, the corresponding implementation process can refer to steps 108 to 110 . For example, when the target API service is an API service with an abnormal call, the key information (target call log) acquired and presented by the API application debugging apparatus may be as follows:

“||com.huawei.xxx.service.excuteByLocal(xxx.java:17)>>>“||com.huawei.xxx.service.executeByLocal(xxx.java:17)>>>

javax.script.ScriptException:rebate amt over limit in<eval>at linenumber 5at column number 8”javax.script.ScriptException: rebate amt over limit in <eval>at linenumber 5at column number 8"

其中,“Exception”为异常关键字,“Exception”的呈现形式与非关键信息的呈现形式不同,因此API应用调测装置呈现该关键信息后,测试人员可以根据该关键信息中的异常关键字“Exception”,很快的确定出API编排的问题点。本申请实施例提供的方案中,API应用调测装置可以自动对调测执行过程进行分析,便于测试人员快速确定问题点。Among them, "Exception" is the exception keyword, and the presentation form of "Exception" is different from that of non-critical information. Therefore, after the API application debugging device presents the key information, the tester can Exception", quickly identify the problem of API layout. In the solution provided by the embodiment of the present application, the API application commissioning apparatus can automatically analyze the commissioning execution process, which is convenient for the tester to quickly determine the problem point.

需要指出的是,本申请实施例中,API应用调测装置可以包括API开发单元和API调测单元,上述步骤101至步骤110可以由API开发单元和API调测单元配合完成,例如,由API开发单元执行与目标API应用的编排,在API网关部署目标API应用等相关的步骤,由API调测单元执行与目标调测日志的获取以及分析等相关的步骤。It should be pointed out that, in the embodiment of the present application, the API application debugging device may include an API development unit and an API debugging unit, and the above steps 101 to 110 may be completed by the API development unit and the API debugging unit, for example, by the API The development unit performs the steps related to the orchestration of the target API application, deploying the target API application on the API gateway, etc., and the API commissioning unit performs the steps related to the acquisition and analysis of the target commissioning log.

还需要指出的是,本申请实施例中,在调测执行结果正常时对调测执行过程进行了分析,本领域技术人员应当明白,实际应用中,可以仅在调测执行结果异常时对调测执行过程进行分析,在调测执行结果正常时可以不对调测执行过程进行分析,具体在何种情况下对调测执行过程进行分析,可以根据测试人员对调测执行结果的操作确定(例如根据调测人员在如图4所示的显示界面中的操作确定),本申请实施例对此不做限定。It should also be pointed out that, in the embodiments of the present application, the commissioning execution process is analyzed when the commissioning execution result is normal. Those skilled in the art should understand that in practical applications, the commissioning execution process may only be performed when the commissioning execution result is abnormal. When the commissioning execution result is normal, the commissioning execution process may not be analyzed. The specific circumstances under which the commissioning execution process is analyzed can be determined according to the operation of the tester on the commissioning execution result (for example, according to the commissioning personnel The operation in the display interface shown in FIG. 4 is determined), which is not limited in this embodiment of the present application.

本领域技术人员容易理解,本申请实施例提供的API应用调测方法步骤的先后顺序可以进行适当调整,例如,步骤105可以在步骤102与步骤103之间执行,或者与步骤103同步执行,步骤也可以根据情况进行相应增减,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化的方法,都应涵盖在本申请的保护范围之内,因此不再赘述。Those skilled in the art can easily understand that the sequence of steps of the API application debugging method provided in the embodiments of the present application can be appropriately adjusted. Corresponding increases and decreases can also be made according to the situation. Any person skilled in the art who is familiar with the technical scope disclosed in the present application can easily think of the changed methods, which should be covered by the protection scope of the present application, so they will not be repeated.

综上所述,本申请实施例提供的API应用调测方法,获取目标调测日志,从目标调测日志中获取目标API服务的目标调用日志,获取目标调用日志中的关键信息,并呈现该关键信息,由于无需人工分析就可以获取并呈现调用日志中的关键信息,因此有助于减小API应用的调测耗时,提高API应用的调测效率,提升用户体验。此外,由于可以以图元的形式呈现API服务调用轨迹,便于调测人员获知调测过程的调用流程和调用分支,因此API应用调测的可视化效果较好;进一步地,在呈现API服务调用轨迹之后,可以根据针对目标API服务的图元触发的获取指令获取目标API服务的目标调用日志,并呈现目标调用日志的关键信息,因此可以便于测试人员快速查看关键信息并定位API编排的问题点,及时修正API编排的问题,调测效率较高。To sum up, the API application debugging method provided in the embodiment of the present application obtains the target debugging log, obtains the target calling log of the target API service from the target debugging log, obtains the key information in the target calling log, and presents the Key information, since the key information in the call log can be obtained and presented without manual analysis, it helps to reduce the time-consuming of API application commissioning, improve the commissioning efficiency of API applications, and improve user experience. In addition, because the API service call trace can be presented in the form of graphic elements, it is convenient for the commissioner to know the call flow and call branch of the commissioning process, so the visualization effect of API application commissioning is better; further, when the API service call trace is presented, After that, the target call log of the target API service can be obtained according to the acquisition instruction triggered by the primitive of the target API service, and the key information of the target call log can be displayed, so it is convenient for the tester to quickly view the key information and locate the problem point of the API layout. The problem of API arrangement is corrected in time, and the debugging efficiency is high.

在本申请实施例中,API应用调测装置呈现API服务调用轨迹(步骤107)之前,可以先确定API服务调用轨迹是否为正常轨迹。请参考图8,其示出了本申请实施例提供的一种确定API服务调用轨迹是否为正常轨迹的方法流程图,参见图8,该方法可以包括:In this embodiment of the present application, before presenting the API service calling track (step 107 ), the API application debugging apparatus may first determine whether the API service calling track is a normal track. Please refer to FIG. 8 , which shows a flowchart of a method for determining whether an API service call trace is a normal trace provided by an embodiment of the present application. Referring to FIG. 8 , the method may include:

步骤201、根据目标API应用中的API服务的调用顺序,确定最后一个被调用的API服务。Step 201: Determine the last called API service according to the calling sequence of the API services in the target API application.

可选地,API应用调测装置将API服务的调用顺序中的最后一个API服务,确定为最后一个被调用的API服务。示例地,假设目标API应用中的API服务的调用顺序为:API服务N1—>API服务N3—>API服务N2,则API应用调测装置将API服务N2确定为最后一个被调用的API服务;再示例地,假设目标API应用中的API服务的调用顺序为:API服务N1—>API服务N3,则API应用调测装置将API服务N3确定为最后一个被调用的API服务。Optionally, the API application debugging apparatus determines the last API service in the calling sequence of the API services as the last API service to be called. For example, assuming that the calling sequence of the API service in the target API application is: API service N1 -> API service N3 -> API service N2, the API application debugging apparatus determines API service N2 as the last API service to be called; As another example, assuming that the calling sequence of API services in the target API application is: API service N1 -> API service N3, the API application debugging apparatus determines API service N3 as the last API service to be called.

步骤202、根据目标API应用的API服务编排顺序,确定目标API应用的结束API服务。Step 202: Determine the ending API service of the target API application according to the API service arrangement sequence of the target API application.

可选地,API应用调测装置将目标API应用的API服务编排顺序中的最后一个API服务,确定为目标API应用的结束API服务。示例地,目标API应用中的API服务编排顺序为:API服务N1—>API服务N3—>API服务N2,则API应用调测装置将API服务N2确定为目标API应用的结束API服务。Optionally, the API application debugging apparatus determines the last API service in the sequence of the API services of the target API application as the ending API service of the target API application. For example, the sequence of API services in the target API application is: API service N1 -> API service N3 -> API service N2, then the API application debugging apparatus determines API service N2 as the ending API service of the target API application.

步骤203、判断最后一个被调用的API服务是否为目标API应用的结束API服务。Step 203: Determine whether the last API service called is the end API service of the target API application.

可选地,API应用调测装置可以确定最后一个被调用的API服务的标识(例如被调用的API服务的图元的标识)和目标API应用的结束API服务的标识(例如结束API服务的图元的标识),将最后一个被调用的API服务的标识与目标API应用的结束API服务的标识进行比对,来判断最后一个被调用的API服务是否为目标API应用的结束API服务,如果最后一个被调用的API服务的标识与目标API应用的结束API服务的标识相同,则最后一个被调用的API服务是目标API应用的结束API服务,如果最后一个被调用的API服务的标识与目标API应用的结束API服务的标识不同,则最后一个被调用的API服务不是目标API应用的结束API服务。Optionally, the API application debugging apparatus may determine the identifier of the last API service called (for example, the identifier of the graphic element of the called API service) and the identifier of the target API application that ends the API service (for example, the image of the finished API service). Meta ID), compare the ID of the last API service called with the ID of the end API service of the target API application to determine whether the last API service called is the end API service of the target API application, if the last API service is the end API service of the target API application. The identifier of a called API service is the same as the identifier of the end API service of the target API application, then the last API service called is the end API service of the target API application. If the identifier of the last API service called is the same as that of the target API If the identifiers of the end API services of the application are different, the last API service called is not the end API service of the target API application.

示例地,假设最后一个被调用的API服务为API服务N2,目标API应用的结束API服务为API服务N2,则API应用调测装置通过标识比对,可以确定最后一个被调用的API服务是目标API应用的结束API服务;再示例地,假设最后一个被调用的API服务为API服务N3,目标API应用的结束API服务为API服务N2,则API应用调测装置通过标识比对,可以确定最后一个被调用的API服务不是目标API应用的结束API服务。For example, assuming that the last API service called is API service N2, and the end API service of the target API application is API service N2, the API application debugging apparatus can determine that the last API service called is the target API service by comparing the identifiers. The end API service of the API application; for another example, assuming that the last API service called is API service N3, and the end API service of the target API application is API service N2, the API application debugging device can determine the final API service by comparing the identifiers. A called API service is not the end API service of the target API application.

步骤204、当最后一个被调用的API服务是目标API应用的结束API服务时,确定API服务调用轨迹为正常轨迹。Step 204: When the last API service called is the ending API service of the target API application, determine that the API service calling track is a normal track.

如果在步骤203中API应用调测装置确定最后一个被调用的API服务是目标API应用的结束API服务,则API应用调测装置确定API服务调用轨迹为正常轨迹。示例地,当最后一个被调用的API服务为API服务N2,目标API应用的结束API服务为API服务N2时,API应用调测装置确定API服务调用轨迹为正常轨迹。If the API application debugging apparatus determines in step 203 that the last API service called is the ending API service of the target API application, the API application debugging apparatus determines that the API service calling track is a normal track. For example, when the last API service called is API service N2, and the ending API service of the target API application is API service N2, the API application debugging apparatus determines that the API service calling track is a normal track.

步骤205、当最后一个被调用的API服务不是目标API应用的结束API服务时,确定API服务调用轨迹为异常轨迹。Step 205 , when the last API service called is not the end API service of the target API application, determine that the API service calling track is an abnormal track.

如果在步骤203中API应用调测装置确定最后一个被调用的API服务不是目标API应用的结束API服务,则API应用调测装置确定API服务调用轨迹为异常轨迹。示例地,当最后一个被调用的API服务为API服务N3,目标API应用的结束API服务为API服务N2时,API应用调测装置确定API服务调用轨迹为异常轨迹。If the API application debugging apparatus determines in step 203 that the last API service called is not the end API service of the target API application, the API application debugging apparatus determines that the API service calling track is an abnormal track. For example, when the last API service called is API service N3, and the ending API service of the target API application is API service N2, the API application debugging apparatus determines that the API service calling track is an abnormal track.

需要说明的是,在API服务调用轨迹为异常轨迹的情况下,在呈现API服务调用轨迹时,可以在API服务调用轨迹中,将最后一个被调用的API服务设置为异常API服务(例如图7中的API服务3)。It should be noted that when the API service call trace is an abnormal trace, when the API service call trace is presented, the last called API service can be set as the abnormal API service in the API service call trace (for example, Figure 7 API service in 3).

本申请实施例中,API服务调用轨迹可以为正常轨迹或异常轨迹,正常轨迹与异常轨迹不同,API应用调测装置在呈现API服务调用轨迹之前,确定API服务调用轨迹是否为正常轨迹,可以便于API服务调用轨迹的呈现。In the embodiment of the present application, the API service calling track may be a normal track or an abnormal track. The normal track is different from the abnormal track. Before presenting the API service calling track, the API application debugging device determines whether the API service calling track is a normal track, which can facilitate Rendering of API service call traces.

下述为本申请装置实施例,可以用于执行本申请方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。The following are apparatus embodiments of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.

请参考图9,其示出了本申请实施例实施例提供的一种API应用调测装置300的逻辑结构示意图,该API应用调测装置300可以用于执行上述实施例提供的API应用调测方法,参见图9,该API应用调测装置300可以包括但不限于:Please refer to FIG. 9 , which shows a schematic diagram of a logical structure of an API application debugging apparatus 300 provided by an embodiment of the present application. The API application debugging apparatus 300 may be used to perform the API application debugging provided by the above-mentioned embodiments. For the method, referring to FIG. 9 , the API application debugging apparatus 300 may include, but is not limited to:

第一获取模块301,用于获取目标调测日志,目标调测日志是对目标API应用进行调测的过程中生成的调测日志,目标API应用由至少一个API服务编排而成;The first obtaining module 301 is configured to obtain a target commissioning log, where the target commissioning log is a commissioning log generated during commissioning of a target API application, and the target API application is composed of at least one API service;

第二获取模块302,用于从目标调测日志中,获取目标API服务的目标调用日志,目标API服务是对目标API应用进行调测的过程中被调用的任一API服务;The second obtaining module 302 is configured to obtain the target call log of the target API service from the target debugging log, where the target API service is any API service that is called in the process of debugging the target API application;

第三获取模块303,用于获取目标调用日志中的关键信息;The third obtaining module 303 is used to obtain the key information in the target call log;

第一呈现模块304,用于呈现关键信息。The first presentation module 304 is used for presenting key information.

综上所述,本申请实施例提供的API应用调测装置,第一获取模块获取目标调测日志后,第二获取模块从目标调测日志中获取目标API服务的目标调用日志,第三获取模块获取目标调用日志中的关键信息,第一呈现模块呈现该关键信息,由于无需人工分析就可以获取并呈现调用日志中的关键信息,因此有助于减小API应用的调测耗时,提高API应用的调测效率,提升用户体验。To sum up, in the API application debugging device provided by the embodiment of the present application, after the first obtaining module obtains the target debugging log, the second obtaining module obtains the target calling log of the target API service from the target debugging log, and the third obtaining module obtains the target calling log of the target API service from the target debugging log. The module obtains the key information in the target call log, and the first presentation module presents the key information. Since the key information in the call log can be obtained and presented without manual analysis, it is helpful to reduce the time-consuming of API application debugging and improve the The debugging efficiency of API applications improves the user experience.

可选地,第二获取模块302,用于从被调用的API服务与调用日志的关联关系中,获取目标API服务的目标调用日志,被调用的API服务与调用日志的关联关系是根据目标调测日志建立的。Optionally, the second obtaining module 302 is configured to obtain the target call log of the target API service from the relationship between the called API service and the call log, and the relationship between the called API service and the call log is based on the target call log. The test log is created.

可选地,请参考图10,其示出了本申请实施例实施例提供的另一种API应用调测装置300的逻辑结构示意图,参见图10,在图9的基础上,该API应用调测装置300还包括:Optionally, please refer to FIG. 10 , which shows a schematic diagram of a logical structure of another API application debugging apparatus 300 provided by an embodiment of the present application. Referring to FIG. 10 , on the basis of FIG. 9 , the API application debugging The measuring device 300 also includes:

第一确定模块305,用于根据目标调测日志,确定目标API应用中的API服务的调用顺序;The first determining module 305 is configured to determine the calling sequence of the API service in the target API application according to the target debugging log;

第四获取模块306,用于从目标调测日志中,获取各个被调用的API服务的调用日志;The fourth obtaining module 306 is configured to obtain the call log of each called API service from the target commissioning log;

建立模块307,用于根据各个被调用的API服务与相应的调用日志,建立被调用的API服务与调用日志的关联关系。The establishing module 307 is configured to establish an association relationship between the called API service and the calling log according to each called API service and the corresponding calling log.

可选地,第四获取模块306,用于:Optionally, the fourth obtaining module 306 is used for:

确定各个被调用的API服务的特征标签,特征标签包括被调用的API服务的标识和对目标API应用进行调测的跟踪实例标识;Determine the characteristic label of each called API service, and the characteristic label includes the identifier of the called API service and the identifier of the tracking instance for debugging the target API application;

根据各个被调用的API服务的特征标签,从目标调测日志中提取各个被调用的API服务的调用日志。According to the feature tag of each called API service, the call log of each called API service is extracted from the target commissioning log.

可选地,请继续参考图10,该API应用调测装置300还包括:Optionally, please continue to refer to FIG. 10 , the API application debugging apparatus 300 further includes:

第二确定模块308,用于根据目标调测日志,确定目标API应用中的API服务的调用顺序;The second determining module 308 is configured to determine the calling sequence of the API service in the target API application according to the target debugging log;

第二呈现模块309,用于根据调用顺序,呈现API服务调用轨迹,API服务调用轨迹至少包括被调用的API服务的图元以及按照调用顺序连接至少两个被调用的API服务的图元的轨迹线,API服务的图元指示API服务;The second presentation module 309 is configured to present the API service calling track according to the calling sequence, where the API service calling track at least includes the picture element of the called API service and the track connecting the picture elements of at least two called API services according to the calling sequence Line, the graphic element of the API service indicates the API service;

第二获取模块302,用于当检测到针对目标API服务的图元触发的获取指令时,从被调用的API服务与调用日志的关联关系中,获取目标调用日志。The second acquiring module 302 is configured to acquire the target invocation log from the association relationship between the invoked API service and the invocation log when an acquisition instruction triggered by a graphic element for the target API service is detected.

可选地,请继续参考图10,该API应用调测装置300还包括:Optionally, please continue to refer to FIG. 10 , the API application debugging apparatus 300 further includes:

第三确定模块310,用于根据调用顺序,确定最后一个被调用的API服务;The third determining module 310 is configured to determine the last called API service according to the calling sequence;

第四确定模块311,用于根据目标API应用的API服务编排顺序,确定目标API应用的结束API服务;The fourth determining module 311 is configured to determine the ending API service of the target API application according to the API service arrangement sequence of the target API application;

判断模块312,用于判断最后一个被调用的API服务是否为目标API应用的结束API服务;The judgment module 312 is used to judge whether the last called API service is the end API service of the target API application;

第五确定模块313,用于当最后一个被调用的API服务是目标API应用的结束API服务时,确定API服务调用轨迹为正常轨迹;The fifth determining module 313 is configured to determine that the API service calling track is a normal track when the last API service called is the ending API service of the target API application;

第六确定模块314,用于当最后一个被调用的API服务不是目标API应用的结束API服务时,确定API服务调用轨迹为异常轨迹。The sixth determining module 314 is configured to determine that the API service calling track is an abnormal track when the last API service called is not the ending API service of the target API application.

可选地,第二呈现模块309,用于:Optionally, the second presentation module 309 is used for:

当API服务调用轨迹为正常轨迹时,根据调用顺序,呈现API服务调用轨迹,API服务调用轨迹包括被调用的API服务的图元,以及,按照调用顺序连接所有被调用的API服务的图元的轨迹线;When the API service calling track is a normal track, the API service calling track is presented according to the calling sequence. The API service calling track includes the graphic elements of the called API service, and the graphic elements that connect all the called API services according to the calling sequence. track line;

当API服务调用轨迹为异常轨迹时,根据调用顺序和API服务编排顺序呈现API服务调用轨迹,API服务调用轨迹包括被调用的API服务的图元,未被调用的API服务的图元,按照调用顺序连接所有被调用的API服务的图元的轨迹线,按照API服务编排顺序连接所有未被调用的API服务的图元的编排线,以及,按照API服务编排顺序连接被调用的API服务的图元与未被调用的API服务的图元的编排线,被调用的API服务包括调用正常的API服务和调用异常的API服务,调用正常的API服务的图元、调用异常的API服务的图元以及未被调用的API服务的图元的呈现形式不同。When the API service calling track is an abnormal track, the API service calling track is presented according to the calling sequence and the API service arrangement order. The API service calling track includes the graphics elements of the called API services and the graphics elements of the API services that have not been called. The trace lines that connect the primitives of all called API services in sequence, the choreography lines that connect the primitives of all API services that have not been called according to the API service orchestration order, and the graphs that connect the called API services in the API service orchestration order The arrangement line of the primitives and the primitives of the API services that have not been called. The invoked API services include the normal API services and the abnormal API services, the primitives that call the normal API services, and the primitives that call the abnormal API services. And the rendering form of the primitives of the API service that is not called is different.

可选地,第一确定模块305,用于以正则方式对目标调测日志进行分析,确定目标API应用中被调用的API服务的调用顺序。Optionally, the first determining module 305 is configured to analyze the target commissioning log in a regular manner, and determine the calling sequence of the API services called in the target API application.

可选地,第一获取模块301,用于:Optionally, the first obtaining module 301 is used for:

向API网关发送调测请求,调测请求携带API应用标识和第一时间戳,API应用标识指示目标API应用,第一时间戳为目标API应用调测的开始时间戳;Send a commissioning request to the API gateway, where the commissioning request carries the API application identifier and the first timestamp, the API application identifier indicates the target API application, and the first timestamp is the start timestamp of the target API application commissioning;

接收API网关发送的调测响应,调测响应包括目标调测日志,目标调测日志为第二时间戳与第一时间戳之间API网关针对目标API应用生成的调测日志,第二时间戳为目标API应用调测的结束时间戳。Receive the commissioning response sent by the API gateway. The commissioning response includes the target commissioning log. The target commissioning log is the commissioning log generated by the API gateway for the target API application between the second timestamp and the first timestamp. The second timestamp End timestamp of application debugging for the target API.

可选地,调测响应还包括调测执行结果,调测执行结果是API网关对目标API应用进行调测的执行结果,请继续参考图10,该API应用调测装置300还包括:Optionally, the commissioning response further includes a commissioning execution result. The commissioning execution result is the execution result of the API gateway commissioning the target API application. Please continue to refer to FIG. 10 . The API application commissioning apparatus 300 further includes:

第五获取模块315,用于获取调测执行结果,调测执行结果是对目标API应用进行调测的执行结果;The fifth obtaining module 315 is configured to obtain a commissioning execution result, where the commissioning execution result is an execution result of commissioning the target API application;

第三呈现模块316,用于呈现调测执行结果;a third presentation module 316, configured to present the commissioning execution result;

第一获取模块301,用于当接收到根据调测执行结果触发的分析指令时,获取目标调测日志。The first acquiring module 301 is configured to acquire a target commissioning log when an analysis instruction triggered according to a commissioning execution result is received.

综上所述,本申请实施例提供的API应用调测装置,第一获取模块获取目标调测日志后,第二获取模块从目标调测日志中获取目标API服务的目标调用日志,第三获取模块获取目标调用日志中的关键信息,第一呈现模块呈现该关键信息,由于无需人工分析就可以获取并呈现调用日志中的关键信息,因此有助于减小API应用的调测耗时,提高API应用的调测效率,提升用户体验。此外,由于可以以图元的形式呈现API服务调用轨迹,便于调测人员获知调测过程的调用流程和调用分支,因此API应用调测的可视化效果较好;进一步地,在呈现API服务调用轨迹之后,可以根据针对目标API服务的图元触发的获取指令获取目标API服务的目标调用日志,并呈现目标调用日志的关键信息,因此可以便于测试人员快速查看关键信息并定位API编排的问题点,及时修正API编排的问题,调测效率较高。To sum up, in the API application debugging device provided by the embodiment of the present application, after the first obtaining module obtains the target debugging log, the second obtaining module obtains the target calling log of the target API service from the target debugging log, and the third obtaining module obtains the target calling log of the target API service from the target debugging log. The module obtains the key information in the target call log, and the first presentation module presents the key information. Since the key information in the call log can be obtained and presented without manual analysis, it is helpful to reduce the time-consuming of API application debugging and improve the The debugging efficiency of API applications improves the user experience. In addition, because the API service call trace can be presented in the form of graphic elements, it is convenient for the commissioner to know the call flow and call branch of the commissioning process, so the visualization effect of API application commissioning is better; further, when the API service call trace is presented, After that, the target call log of the target API service can be obtained according to the acquisition instruction triggered by the primitive of the target API service, and the key information of the target call log can be displayed, so it is convenient for the tester to quickly view the key information and locate the problem point of the API layout. The problem of API arrangement is corrected in time, and the debugging efficiency is high.

请参考图11,其示出了本申请实施例提供的一种API应用调测装置400的硬件结构示意图,参见图11,该API应用调测装置400包括处理器402、存储器404、通信接口406和总线408,处理器402、存储器404和通信接口406通过总线408连接。存储器404可以用于存储指令4042和数据4044。容易理解,图11所示的处理器402、存储器404和通信接口406之间的连接方式仅仅是示例性的,在具体实现过程中,处理器402、存储器404和通信接口406也可以采用除了总线408之外的其他连接方式彼此通信连接。Please refer to FIG. 11 , which shows a schematic diagram of a hardware structure of an API application debugging apparatus 400 provided by an embodiment of the present application. Referring to FIG. 11 , the API application debugging apparatus 400 includes a processor 402 , a memory 404 , and a communication interface 406 And bus 408, processor 402, memory 404 and communication interface 406 are connected by bus 408. Memory 404 may be used to store instructions 4042 and data 4044 . It is easy to understand that the connection between the processor 402, the memory 404 and the communication interface 406 shown in FIG. 11 is only exemplary, and in the specific implementation process, the processor 402, the memory 404 and the communication interface 406 can also use other than the bus Other connection methods other than 408 are communicatively connected to each other.

其中,处理器402可以是通用处理器,通用处理器可以是通过读取并执行存储器(例如存储器404)中存储的指令(例如指令4042)来执行特定步骤和/或操作的处理器,通用处理器在执行上述步骤和/或操作的过程中可能用到存储在存储器(例如存储器404)中的数据(例如数据4044)。通用处理器可以是,例如但不限于,中央处理器(centralprocessing unit,CPU)。此外,处理器402也可以是专用处理器,专用处理器可以是专门设计的用于执行特定步骤和/或操作的处理器,该专用处理器可以是,例如但不限于,数字信号处理器(digital signal processor,DSP)、应用专用集成电路(application specificintegrated circuit,ASIC)和现场可编程门阵列(field programmable gate array,FPGA)等。此外,处理器402还可以是多个处理器的组合,例如多核处理器。处理器402可以包括至少一个电路,以执行下述实施例中的API应用调测方法的步骤。The processor 402 may be a general-purpose processor, and the general-purpose processor may be a processor that performs specific steps and/or operations by reading and executing instructions (eg, instructions 4042 ) stored in a memory (eg, memory 404 ). The processor may use data (eg, data 4044 ) stored in memory (eg, memory 404 ) in performing the steps and/or operations described above. A general-purpose processor may be, for example, but not limited to, a central processing unit (CPU). Additionally, processor 402 may also be a special purpose processor, which may be a processor specially designed to perform particular steps and/or operations, such as, but not limited to, a digital signal processor ( digital signal processor, DSP), application specific integrated circuit (application specific integrated circuit, ASIC) and field programmable gate array (field programmable gate array, FPGA) and so on. In addition, the processor 402 may also be a combination of multiple processors, such as a multi-core processor. The processor 402 may include at least one circuit to perform the steps of the API application debugging method in the following embodiments.

存储器404可以是各种类型的存储介质,例如随机存取存储器(random accessmemory,RAM)、ROM、非易失性RAM(non-volatile RAM,NVRAM)、可编程ROM(programmableROM,PROM)、可擦除PROM(erasable PROM,EPROM)、电可擦除PROM(electrically ErasablePROM,EEPROM)、闪存、光存储器和寄存器等。存储器404具体用于存储指令4042和数据4044,当处理器402为通用处理器时,处理器402可以通过读取并执行存储器404中存储的指令4042,来执行特定步骤和/或操作,在执行上述步骤和/或操作的过程中可能需要用到数据4044。The memory 404 may be various types of storage media, such as random access memory (RAM), ROM, non-volatile RAM (NVRAM), programmable ROM (PROM), erasable In addition to PROM (erasable PROM, EPROM), electrically erasable PROM (electrically Erasable PROM, EEPROM), flash memory, optical memory and registers, etc. The memory 404 is specifically used to store the instructions 4042 and the data 4044. When the processor 402 is a general-purpose processor, the processor 402 can perform specific steps and/or operations by reading and executing the instructions 4042 stored in the memory 404. Data 4044 may be required during the above steps and/or operations.

根据API应用调测装置的不同,通信接口406可以包括收发器、多根天线或I/O(输入/输出,input/output)接口等,I/O接口用于接收来自外围设备的指令和/或数据,以及向外围设备输出指令和/或数据。天线与收发器连接,收发器通过与其连接的至少一根天线来收发信号。Depending on the API application debugging device, the communication interface 406 may include transceivers, multiple antennas, or I/O (input/output, input/output) interfaces, etc., the I/O interfaces are used to receive instructions from peripheral devices and/or or data, and output commands and/or data to peripheral devices. The antenna is connected to the transceiver, and the transceiver transmits and receives signals through at least one antenna connected thereto.

在具体实现过程中,处理器402可以用于进行,例如但不限于调测相关处理,收发器可以用于进行,例如但不限于收发相关处理。上述器件可以分别设置在彼此独立的芯片上,也可以至少部分的或者全部的设置在同一块芯片上。例如,处理器402可以进一步划分为模拟基带处理器和数字基带处理器,其中模拟基带处理器可以与收发器集成在同一块芯片上,数字基带处理器可以设置在独立的芯片上。随着集成电路技术的不断发展,可以在同一块芯片上集成的器件越来越多,例如,数字基带处理器可以与多种应用处理器(例如但不限于图形处理器,多媒体处理器等)集成在同一块芯片之上。这样的芯片可以称为系统芯片(System on Chip)。将各个器件独立设置在不同的芯片上,还是整合设置在一个或者多个芯片上,往往取决于产品设计的具体需要。本申请实施例对上述器件的具体实现形式不做限定。In a specific implementation process, the processor 402 may be used to perform, for example, but not limited to, commissioning related processing, and the transceiver may be used to perform, for example, but not limited to, transceiver-related processing. The above-mentioned devices may be respectively arranged on chips that are independent of each other, or at least part or all of them may be arranged on the same chip. For example, the processor 402 can be further divided into an analog baseband processor and a digital baseband processor, wherein the analog baseband processor and the transceiver can be integrated on the same chip, and the digital baseband processor can be provided on a separate chip. With the continuous development of integrated circuit technology, more and more devices can be integrated on the same chip. For example, a digital baseband processor can be combined with a variety of application processors (such as but not limited to graphics processors, multimedia processors, etc.) integrated on the same chip. Such a chip may be referred to as a System on Chip. Whether each device is independently arranged on different chips or integrated on one or more chips often depends on the specific needs of product design. The embodiments of the present application do not limit the specific implementation form of the above device.

容易理解,图11所示的API应用调测装置400仅仅是示例性的,在具体实现过程中,API应用调测装置400还可以包括其他硬件器件,本文不再一一列举。API应用调测装置400中硬件器件的具体作用将在下文进行详细的描述。It is easy to understand that the API application debugging apparatus 400 shown in FIG. 11 is only exemplary, and in the specific implementation process, the API application debugging apparatus 400 may also include other hardware devices, which are not listed one by one herein. The specific functions of the hardware devices in the API application debugging apparatus 400 will be described in detail below.

本申请实施例提供一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当该指令在计算机的处理组件上运行时,使得该处理组件执行上述实施例所提供的API应用调测方法。Embodiments of the present application provide a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are executed on a processing component of a computer, the processing component causes the processing component to execute the API application call provided by the foregoing embodiments. measurement method.

本申请实施例提供一种包含指令的计算机程序产品,当该计算机程序产品在计算机上运行时,使得该计算机执行上述实施例所提供的API应用调测方法。The embodiments of the present application provide a computer program product containing instructions, when the computer program product runs on a computer, the computer enables the computer to execute the API application debugging method provided by the foregoing embodiments.

本申请实施例提供一种芯片,该芯片包括可编程逻辑电路和/或程序指令,当该芯片运行时用于实现上述实施例所提供的API应用调测方法。Embodiments of the present application provide a chip, where the chip includes a programmable logic circuit and/or program instructions, and is used to implement the API application debugging method provided by the above embodiments when the chip is running.

本申请实施例中,术语“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。In the embodiments of this application, the term "and/or" is only an association relationship to describe associated objects, indicating that there may be three relationships, for example, A and/or B, which may indicate that A exists alone, and A and B exist at the same time , there are three cases of B alone. In addition, the character "/" in this document generally indicates that the related objects are an "or" relationship.

本申请实施例中,术语“至少一个”表示一个或多个,多个指的是一个以上,例如两个。In the embodiments of the present application, the term "at least one" refers to one or more, and a plurality refers to more than one, for example, two.

本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, etc.

以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above descriptions are only optional embodiments of the present application, and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the protection of the present application. within the range.

Claims (24)

1. A method for API application debugging, the method comprising:
acquiring a target debugging log, wherein the target debugging log is generated in the debugging process of a target API application, and the target API application is formed by arranging at least one API service;
acquiring a target call log of a target API service from the target call log, wherein the target API service is any API service called in the process of calling and testing the target API application;
acquiring key information in the target call log;
and presenting the key information.
2. The method of claim 1, wherein obtaining a target call log of a target API service from the target call log comprises:
and acquiring the target call log from the association relationship between the called API service and the call log, wherein the association relationship between the called API service and the call log is established according to the target call log.
3. The method of claim 2, wherein before obtaining the target call log from the association of the called API service with the call log, the method further comprises:
determining a calling sequence of API services in the target API application according to the target debugging log;
obtaining a call log of each called API service from the target call log;
and establishing an association relation between the called API service and the call log according to each called API service and the corresponding call log.
4. The method of claim 3, wherein obtaining a call log for each called API service from the target call log comprises:
determining a feature tag of each called API service, wherein the feature tag comprises an identifier of the called API service and a tracking instance identifier for testing the target API application;
and extracting the call logs of the called API services from the target call logs according to the feature tags of the called API services.
5. The method of claim 1,
before obtaining the target call log of the target API service from the target call log, the method further includes:
determining a calling sequence of API services in the target API application according to the target debugging log;
presenting an API service calling track according to the calling sequence, wherein the API service calling track at least comprises primitives of the called API service and trajectory lines for connecting the primitives of at least two called API services according to the calling sequence, and the primitives of the API service indicate the API service;
obtaining a target call log of a target API service from the target call log, including:
and when an acquisition instruction triggered by the graphic element of the target API service is detected, acquiring a target call log of the target API service from the target call log.
6. The method of claim 5, wherein prior to presenting API service call traces according to the call order, the method further comprises:
determining the last called API service according to the calling sequence;
determining the end API service of the target API application according to the API service arrangement sequence of the target API application;
judging whether the last called API service is the ending API service of the target API application;
when the last called API service is the ending API service of the target API application, determining that the API service calling track is a normal track;
and when the last called API service is not the ending API service of the target API application, determining that the API service calling track is an abnormal track.
7. The method of claim 6, wherein presenting API service call tracks according to the call order comprises:
when the API service calling track is a normal track, presenting the API service calling track according to the calling sequence, wherein the API service calling track comprises primitives of the called API service and trajectory lines for connecting all the primitives of the called API service according to the calling sequence;
when the API service calling track is an abnormal track, presenting the API service calling track according to the calling sequence and the API service arranging sequence, the API service call trace includes primitives for called API services, primitives for un-called API services, connecting the trajectory lines of the primitives of all the called API services according to the calling sequence, connecting the layout lines of the primitives of all the un-called API services according to the API service layout sequence, and an arrangement line connecting the primitives of the called API service and the primitives of the un-called API service according to the API service arrangement sequence, the called API service includes calling a normal API service and calling an abnormal API service, and the presentation forms of the primitive calling the normal API service, the primitive calling the abnormal API service and the primitive not called the API service are different.
8. The method of claim 3, wherein determining the calling order of the API services in the target API application from the target commissioning log comprises:
and analyzing the target debugging log in a regular mode, and determining the calling sequence of the called API service in the target API application.
9. The method of claim 1, wherein obtaining a target commissioning log, the target commissioning log being a commissioning log generated during commissioning of a target API application, comprises:
sending a debugging request to an API gateway, wherein the debugging request carries an API application identifier and a first timestamp, the API application identifier indicates the target API application, and the first timestamp is a starting timestamp of debugging of the target API application;
receiving a debugging response sent by the API gateway, wherein the debugging response comprises the target debugging log, the target debugging log is the debugging log generated by the API gateway aiming at the target API application between a second timestamp and the first timestamp, and the second timestamp is an ending timestamp of the target API application debugging.
10. The method of any of claims 1 to 9, wherein prior to obtaining the target commissioning log, the method further comprises:
obtaining a debugging execution result, wherein the debugging execution result is an execution result of debugging the target API application;
presenting the debugging execution result;
the acquiring of the target survey log includes:
and when an analysis instruction triggered according to the debugging execution result is received, acquiring the target debugging log.
11. An apparatus for API application debugging, the apparatus comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a target debugging log, the target debugging log is generated in the debugging process of a target API application, and the target API application is formed by arranging at least one API service;
a second obtaining module, configured to obtain a target call log of a target API service from the target call log, where the target API service is any API service that is called in a process of testing the target API application;
the third acquisition module is used for acquiring key information in the target call log;
and the first presentation module is used for presenting the key information.
12. The apparatus of claim 11,
the second obtaining module is configured to obtain a target call log of the target API service from an association relationship between the called API service and the call log, where the association relationship between the called API service and the call log is established according to the target call log.
13. The apparatus of claim 12, further comprising:
a first determining module, configured to determine, according to the target debug log, a call order of API services in the target API application;
a fourth obtaining module, configured to obtain, from the target call log, a call log of each called API service;
and the establishing module is used for establishing the association relationship between the called API service and the call log according to each called API service and the corresponding call log.
14. The apparatus of claim 13, wherein the fourth obtaining module is configured to:
determining a feature tag of each called API service, wherein the feature tag comprises an identifier of the called API service and a tracking instance identifier for testing the target API application;
and extracting the call logs of the called API services from the target call logs according to the feature tags of the called API services.
15. The apparatus of claim 11, further comprising:
a second determining module, configured to determine, according to the target debug log, a call order of API services in the target API application;
the second presentation module is used for presenting an API service calling track according to the calling sequence, wherein the API service calling track at least comprises primitives of the called API service and trajectory lines for connecting at least two primitives of the called API service according to the calling sequence, and the primitives of the API service indicate the API service;
and the second obtaining module is used for obtaining a target call log of the target API service from the target call log when an obtaining instruction triggered by the primitive aiming at the target API service is detected.
16. The apparatus of claim 15, further comprising:
a third determining module, configured to determine, according to the call order, a last called API service;
a fourth determining module, configured to determine, according to the API service arrangement order of the target API application, an end API service of the target API application;
the judging module is used for judging whether the last called API service is the ending API service of the target API application;
a fifth determining module, configured to determine that the API service calling track is a normal track when the last called API service is an end API service of the target API application;
a sixth determining module, configured to determine that the API service call trajectory is an abnormal trajectory when the last called API service is not the end API service of the target API application.
17. The apparatus of claim 16, wherein the second rendering module is configured to:
when the API service calling track is a normal track, presenting the API service calling track according to the calling sequence, wherein the API service calling track comprises primitives of the called API service and trajectory lines for connecting all the primitives of the called API service according to the calling sequence;
when the API service calling track is an abnormal track, presenting the API service calling track according to the calling sequence and the API service arranging sequence, the API service call trace includes primitives for called API services, primitives for un-called API services, connecting the trajectory lines of the primitives of all the called API services according to the calling sequence, connecting the layout lines of the primitives of all the un-called API services according to the API service layout sequence, and an arrangement line connecting the primitives of the called API service and the primitives of the un-called API service according to the API service arrangement sequence, the called API service includes calling a normal API service and calling an abnormal API service, and the presentation forms of the primitive calling the normal API service, the primitive calling the abnormal API service and the primitive not called the API service are different.
18. The apparatus of claim 13,
the first determining module is configured to analyze the target debugging log in a regular manner, and determine a calling order of the called API service in the target API application.
19. The apparatus of claim 11, wherein the first obtaining module is configured to:
sending a debugging request to an API gateway, wherein the debugging request carries an API application identifier and a first timestamp, the API application identifier indicates the target API application, and the first timestamp is a starting timestamp of debugging of the target API application;
receiving a debugging response sent by the API gateway, wherein the debugging response comprises the target debugging log, the target debugging log is the debugging log generated by the API gateway aiming at the target API application between a second timestamp and the first timestamp, and the second timestamp is an ending timestamp of the target API application debugging.
20. The apparatus of any one of claims 11 to 19, further comprising:
a fifth obtaining module, configured to obtain a debugging execution result, where the debugging execution result is an execution result of debugging the target API application;
the third presentation module is used for presenting the debugging execution result;
the first obtaining module is used for obtaining the target debugging log when receiving an analysis instruction triggered according to the debugging execution result.
21. An API application deployment test apparatus, comprising: a processor, a communication interface, a memory, and a bus, the processor to execute instructions stored in the memory to implement the API application commissioning method of any one of claims 1 to 10.
22. A computer-readable storage medium having stored therein instructions which, when run on a processing component of a computer, cause the processing component to perform the API application commissioning method of any one of claims 1 to 10.
23. A computer program product comprising instructions for causing a computer to perform the API application commissioning method of any one of claims 1 to 10 when said computer program product is run on the computer.
24. A chip comprising programmable logic circuitry and/or program instructions for implementing the API application commissioning method of any one of claims 1 to 10 when said chip is run.
CN201910328886.5A 2019-04-23 2019-04-23 API application debugging method and device, storage medium Active CN111831542B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910328886.5A CN111831542B (en) 2019-04-23 2019-04-23 API application debugging method and device, storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910328886.5A CN111831542B (en) 2019-04-23 2019-04-23 API application debugging method and device, storage medium

Publications (2)

Publication Number Publication Date
CN111831542A true CN111831542A (en) 2020-10-27
CN111831542B CN111831542B (en) 2022-04-05

Family

ID=72911825

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910328886.5A Active CN111831542B (en) 2019-04-23 2019-04-23 API application debugging method and device, storage medium

Country Status (1)

Country Link
CN (1) CN111831542B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112994976A (en) * 2021-02-23 2021-06-18 北京百度网讯科技有限公司 Gateway testing method and device, electronic equipment and storage medium
CN113259181A (en) * 2021-06-29 2021-08-13 天聚地合(苏州)数据股份有限公司 Interface service deployment method, device, storage medium and equipment
CN113986517A (en) * 2021-12-28 2022-01-28 深圳市明源云科技有限公司 API call log acquisition method and device, electronic equipment and storage medium
CN114257531A (en) * 2021-12-10 2022-03-29 北京金山云网络技术有限公司 Test method and related device for Application Programming Interface (API) gateway

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140282418A1 (en) * 2013-03-15 2014-09-18 Ab Initio Technology Llc Recording program execution
CN107391353A (en) * 2017-07-07 2017-11-24 西安电子科技大学 Complicated software system anomaly detection method based on daily record
CN107665167A (en) * 2016-07-28 2018-02-06 华为软件技术有限公司 Program debugging method, device and program development equipment
CN108234245A (en) * 2018-01-09 2018-06-29 上海帝联网络科技有限公司 The screening technique of log content and daily record data, device, system, readable medium
CN109617750A (en) * 2019-01-31 2019-04-12 国网电子商务有限公司 A service early warning method and gateway

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140282418A1 (en) * 2013-03-15 2014-09-18 Ab Initio Technology Llc Recording program execution
CN107665167A (en) * 2016-07-28 2018-02-06 华为软件技术有限公司 Program debugging method, device and program development equipment
CN107391353A (en) * 2017-07-07 2017-11-24 西安电子科技大学 Complicated software system anomaly detection method based on daily record
CN108234245A (en) * 2018-01-09 2018-06-29 上海帝联网络科技有限公司 The screening technique of log content and daily record data, device, system, readable medium
CN109617750A (en) * 2019-01-31 2019-04-12 国网电子商务有限公司 A service early warning method and gateway

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112994976A (en) * 2021-02-23 2021-06-18 北京百度网讯科技有限公司 Gateway testing method and device, electronic equipment and storage medium
CN113259181A (en) * 2021-06-29 2021-08-13 天聚地合(苏州)数据股份有限公司 Interface service deployment method, device, storage medium and equipment
CN113259181B (en) * 2021-06-29 2021-12-07 天聚地合(苏州)数据股份有限公司 Interface service deployment method, device, storage medium and equipment
CN114257531A (en) * 2021-12-10 2022-03-29 北京金山云网络技术有限公司 Test method and related device for Application Programming Interface (API) gateway
CN114257531B (en) * 2021-12-10 2024-02-23 北京金山云网络技术有限公司 Test method and related device for application programming interface API gateway
CN113986517A (en) * 2021-12-28 2022-01-28 深圳市明源云科技有限公司 API call log acquisition method and device, electronic equipment and storage medium
CN113986517B (en) * 2021-12-28 2022-04-08 深圳市明源云科技有限公司 API call log acquisition method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111831542B (en) 2022-04-05

Similar Documents

Publication Publication Date Title
US10909028B1 (en) Multi-version regression tester for source code
CN111831542B (en) API application debugging method and device, storage medium
CN107193750B (en) Script recording method and device
WO2020233369A1 (en) Method for improving software integration system on basis of simulated port, and related device
CN109992498B (en) Test case generation method and system and computer system
WO2016095554A1 (en) Test method, device and system for application
CN110337641A (en) Use screenshot metadata to determine app test results
CN109302522A (en) Test method, device and computer system and medium
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
US20200050534A1 (en) System error detection
CN113032244A (en) Interface testing method, device, computer system and computer readable storage medium
US12079298B2 (en) Methods and systems for browser extension used to generate relative XPath, absolute XPath and/or CSS selectors
CN113836014B (en) Interface testing method, device, electronic device and storage medium
US8046638B2 (en) Testing of distributed systems
CN106815142A (en) A kind of method for testing software and system
CN112817866A (en) Recording playback method, device, system, computer equipment and storage medium
CN114371974A (en) Buried point data verification method and electronic equipment
CN106713011B (en) Method and system for obtaining test data
CN112241362A (en) Test method, test device, server and storage medium
WO2024119471A1 (en) Algorithm testing method, algorithm testing platform, and computer readable storage medium
US20160292067A1 (en) System and method for keyword based testing of custom components
CN112988267B (en) Loading method and device, storage medium and electronic equipment
CN112965711B (en) Job testing method and device, electronic equipment and storage medium
CN110309062A (en) Use case generation method, device, electronic device and storage medium
CN118606211A (en) Test script generation method, device, electronic equipment and vehicle

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant