[go: up one dir, main page]

CN111694561A - Interface management method, device, equipment and storage medium - Google Patents

Interface management method, device, equipment and storage medium Download PDF

Info

Publication number
CN111694561A
CN111694561A CN202010522353.3A CN202010522353A CN111694561A CN 111694561 A CN111694561 A CN 111694561A CN 202010522353 A CN202010522353 A CN 202010522353A CN 111694561 A CN111694561 A CN 111694561A
Authority
CN
China
Prior art keywords
interface
information
request
interface definition
parameter
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
CN202010522353.3A
Other languages
Chinese (zh)
Other versions
CN111694561B (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.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
CCB Finetech 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 China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202010522353.3A priority Critical patent/CN111694561B/en
Publication of CN111694561A publication Critical patent/CN111694561A/en
Application granted granted Critical
Publication of CN111694561B publication Critical patent/CN111694561B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

本发明实施例公开了一种接口管理方法、装置、设备及存储介质。该方法包括:当接收到用户输入的接口定义指令时,显示接口定义交互界面;基于所述接口定义交互界面采集接口定义信息,并基于所述接口定义信息生成接口文档;接收外部输入的请求信息,并根据所述请求信息和所述接口文档生成与所述请求信息对应的测试数据。本发明实施例通过设置接口定义交互界面采集接口定义信息,生成接口文档,解决了前后端协作效率低的问题,使得前端技术人员和后端技术人员可以同时开展开发工作,既满足了前端技术人员对测试数据的需求,又能避免后端技术人员后期反复对接口代码进行修订。

Figure 202010522353

The embodiments of the present invention disclose an interface management method, apparatus, device and storage medium. The method includes: when an interface definition instruction input by a user is received, displaying an interface definition interactive interface; collecting interface definition information based on the interface definition interactive interface, and generating an interface document based on the interface definition information; receiving externally input request information , and generate test data corresponding to the request information according to the request information and the interface document. The embodiment of the present invention solves the problem of low front-end and back-end collaboration efficiency by setting the interface definition interactive interface to collect interface definition information and generate interface documents, so that front-end technicians and back-end technicians can carry out development work at the same time, which not only satisfies the requirements of front-end technicians The demand for test data can also prevent back-end technicians from repeatedly revising the interface code in the later stage.

Figure 202010522353

Description

一种接口管理方法、装置、设备及存储介质An interface management method, apparatus, device and storage medium

技术领域technical field

本发明实施例涉及应用开发技术领域,尤其涉及一种接口管理方法、装置、设备及存储介质。Embodiments of the present invention relate to the technical field of application development, and in particular, to an interface management method, apparatus, device, and storage medium.

背景技术Background technique

在应用产品的开发过程中,后端技术人员负责逻辑并向前端技术人员提供数据,前端技术人员负责接收后端数据进行展示以及交互。前后端分离的开发模式,让技术人员可以专注在各自的领域内提高开发效率。但这种协作方式同样也存在一些问题,例如:由于前端技术人员和后端技术人员缺少技术上的沟通,前端技术人员只有在根据后端技术人员提供的接口文档进行联调时,才能根据生成的测试数据判断接口是否满足前端要求。如果不满足要求,则需要后端技术人员进行返工。这种串行的工作模式会延长产品开发的时间,降低产品开发的效率,也会增加前后端技术人员的工作负担。In the development process of application products, back-end technicians are responsible for logic and provide data to front-end technicians, and front-end technicians are responsible for receiving back-end data for display and interaction. The front-end and back-end separation development mode allows technicians to focus on improving development efficiency in their respective fields. However, there are also some problems in this collaboration method. For example, due to the lack of technical communication between the front-end technicians and the back-end technicians, the front-end technicians can only perform joint debugging according to the interface documents provided by the back-end technicians. The test data determines whether the interface meets the front-end requirements. If the requirements are not met, back-end technicians are required to rework. This serial working mode will prolong the time of product development, reduce the efficiency of product development, and increase the workload of front-end and back-end technicians.

现有技术主要是通过对后端技术人员撰写的代码数据进行信息解析,生成接口文档,但这种技术手段同样需要等待后端技术人员编写完代码才能实现。并且由于缺少前端技术人员的参与同样也会存在反复修改接口的问题。并且现有的接口管理工具,如Swagger,并不具备动态生成测试数据的功能,从而无法满足前端开发过程对测试数据的需求。The existing technology mainly generates interface documents by analyzing the code data written by the back-end technicians, but this technical means also needs to wait for the back-end technicians to finish writing the code before it can be realized. And due to the lack of participation of front-end technicians, there will also be the problem of repeatedly modifying the interface. And the existing interface management tools, such as Swagger, do not have the function of dynamically generating test data, so it cannot meet the requirements of the front-end development process for test data.

发明内容SUMMARY OF THE INVENTION

本发明实施例提供了一种接口管理方法、装置、设备及存储介质,以提高前后端协作效率,并动态生成前端技术人员所需的测试数据。Embodiments of the present invention provide an interface management method, apparatus, device, and storage medium, so as to improve front-end and back-end collaboration efficiency, and dynamically generate test data required by front-end technicians.

第一方面,本发明实施例提供了一种接口管理方法,该方法包括:In a first aspect, an embodiment of the present invention provides an interface management method, which includes:

当接收到用户输入的接口定义指令时,显示接口定义交互界面;When receiving the interface definition instruction input by the user, display the interface definition interactive interface;

基于所述接口定义交互界面采集接口定义信息,并基于所述接口定义信息生成接口文档;Collect interface definition information based on the interface definition interactive interface, and generate an interface document based on the interface definition information;

接收外部输入的请求信息,并根据所述请求信息和所述接口文档生成与所述请求信息对应的测试数据。Receive externally input request information, and generate test data corresponding to the request information according to the request information and the interface document.

第二方面,本发明实施例还提供了一种接口管理装置,该装置包括:In a second aspect, an embodiment of the present invention further provides an interface management apparatus, the apparatus includes:

接口定义模块,用于当接收到用户输入的接口定义指令时,显示接口定义交互界面,采集用户基于所述接口定义交互界面输入的接口定义信息,并基于所述接口定义信息生成接口文档;an interface definition module, configured to display an interface definition interactive interface when receiving an interface definition instruction input by a user, collect interface definition information input by the user based on the interface definition interactive interface, and generate an interface document based on the interface definition information;

信息传输模块,用于接收用户输入的请求信息;The information transmission module is used to receive the request information input by the user;

响应模拟模块,用于根据所述请求信息和所述接口文档生成与所述请求信息对应的测试数据。A response simulation module, configured to generate test data corresponding to the request information according to the request information and the interface document.

第三方面,本发明实施例还提供了一种设备,该设备包括:In a third aspect, an embodiment of the present invention further provides a device, and the device includes:

一个或多个处理器;one or more processors;

存储器,用于存储一个或多个程序;memory for storing one or more programs;

当所述一个或多个程序被所述一个或多个处理器执行时,使得所述一个或多个处理器实现上述所涉及的任一所述的接口管理方法。When the one or more programs are executed by the one or more processors, the one or more processors are caused to implement any one of the above-mentioned interface management methods.

第四方面,本发明实施例还提供了一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行上述所涉及的任一所述的接口管理方法。In a fourth aspect, an embodiment of the present invention further provides a storage medium containing computer-executable instructions, where the computer-executable instructions are used to execute any one of the above-mentioned interface management methods when executed by a computer processor .

本发明实施例通过设置接口定义交互界面采集接口定义信息,生成接口文档,解决了前后端协作效率低的问题,使得前端技术人员和后端技术人员可以同时开展开发工作,既满足了前端技术人员对测试数据的需求,又能避免后端技术人员后期反复对接口代码进行修订。In the embodiment of the present invention, the interface definition information is collected by setting the interface definition interactive interface, and the interface document is generated, which solves the problem of low front-end and back-end collaboration efficiency, enables the front-end technical personnel and the back-end technical personnel to carry out development work at the same time, which not only satisfies the requirements of the front-end technical personnel The demand for test data can also prevent back-end technicians from repeatedly revising the interface code in the later stage.

附图说明Description of drawings

图1是本发明实施例一提供的一种接口管理方法的流程图。FIG. 1 is a flowchart of an interface management method according to Embodiment 1 of the present invention.

图2A是本发明实施例一提供的一种接口定义交互界面中Headers参数采集模块的示意图。FIG. 2A is a schematic diagram of a Headers parameter collection module in an interface definition interactive interface provided by Embodiment 1 of the present invention.

图2B是本发明实施例一提供的一种接口定义交互界面中Query参数采集模块的示意图。FIG. 2B is a schematic diagram of a Query parameter collection module in an interface definition interactive interface provided by Embodiment 1 of the present invention.

图2C是本发明实施例一提供的一种接口定义交互界面中Body参数采集模块的示意图。FIG. 2C is a schematic diagram of a body parameter collection module in an interface definition interactive interface provided by Embodiment 1 of the present invention.

图3A是本发明实施例一提供的一种接口定义交互界面的示意图。FIG. 3A is a schematic diagram of an interface definition interactive interface according to Embodiment 1 of the present invention.

图3B是本发明实施例一提供的一种接口定义信息的示意图。FIG. 3B is a schematic diagram of interface definition information according to Embodiment 1 of the present invention.

图4是本发明实施例二提供的一种接口管理方法的流程图。FIG. 4 is a flowchart of an interface management method according to Embodiment 2 of the present invention.

图5是本发明实施例二提供的一种测试数据的响应方法的流程图。FIG. 5 is a flowchart of a method for responding to test data according to Embodiment 2 of the present invention.

图6是本发明实施例二提供的一种接口文档导入和导出的流程图。FIG. 6 is a flowchart of importing and exporting an interface document according to Embodiment 2 of the present invention.

图7是本发明实施例三提供的一种接口管理装置的示意图。FIG. 7 is a schematic diagram of an interface management apparatus according to Embodiment 3 of the present invention.

图8是本发明实施例四提供的一种设备的结构示意图。FIG. 8 is a schematic structural diagram of a device according to Embodiment 4 of the present invention.

具体实施方式Detailed ways

下面结合附图和实施例对本发明作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本发明,而非对本发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部结构。The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention. In addition, it should be noted that, for the convenience of description, the drawings only show some but not all structures related to the present invention.

实施例一Example 1

图1是本发明实施例一提供的一种接口管理方法的流程图,本实施例可适用于基于前后端模式的产品开发的情况,该方法可以由接口管理装置来执行,该装置可采用软件和/或硬件的方式实现,该装置可以配置于终端设备中。具体包括如下步骤:FIG. 1 is a flowchart of an interface management method provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation of product development based on front-end and back-end models. The method can be executed by an interface management device, and the device can use software and/or hardware, the apparatus may be configured in a terminal device. Specifically include the following steps:

S110、当接收到用户输入的接口定义指令时,显示接口定义交互界面。S110. When an interface definition instruction input by a user is received, display an interface definition interactive interface.

在一个实施例中,可选的,用户输入接口定义指令的方式包括快捷键、页面选项和代码中至少一种输入方式。其中,示例性的,当用户通过快捷键输入接口定义指令时,建立接口定义指令与快捷键之间的对应关系,示例性的,该快捷键可以是“shift+T”。此处对快捷键的具体定义不作限定,用户可对其进行自定义。其中,示例性的,当用户通过页面选项输入接口定义指令时,具体的,用户可通过点击终端设备显示界面上的与接口定义功能对应的页面选项,输入接口定义指令,具体的,页面选项也可以是图标。其中,示例性的,用户通过代码输入接口定义指令时,建立接口定义指令与代码之间的对应关系,用户可通过编写该代码输入接口定义指令。具体的,用户可在终端设备的“运行”程序中输入与接口定义指令对应的代码。In one embodiment, optionally, the way in which the user inputs the interface definition instruction includes at least one input way among shortcut keys, page options, and codes. Wherein, exemplarily, when the user inputs an interface definition instruction through a shortcut key, a corresponding relationship between the interface definition instruction and the shortcut key is established, exemplarily, the shortcut key may be "shift+T". The specific definition of the shortcut key is not limited here, and the user can customize it. For example, when the user inputs the interface definition instruction through the page option, specifically, the user can input the interface definition instruction by clicking the page option corresponding to the interface definition function on the display interface of the terminal device. Can be an icon. Wherein, exemplarily, when the user inputs the interface definition instruction through the code, a corresponding relationship between the interface definition instruction and the code is established, and the user can input the interface definition instruction by writing the code. Specifically, the user can input the code corresponding to the interface definition instruction in the "run" program of the terminal device.

接口定义指令用于触发显示接口定义交互界面。其中,接口定义交互界面可用户采集用户输入的接口定义信息。The interface definition instruction is used to trigger the display of the interface definition interactive interface. The interface definition interactive interface may allow the user to collect interface definition information input by the user.

S120、基于接口定义交互界面采集接口定义信息,并基于接口定义信息生成接口文档。S120. Collect interface definition information based on the interface definition interactive interface, and generate an interface document based on the interface definition information.

其中,示例性的,用户基于接口定义交互界面显示的内容和相关操作方法,在接口定义交互界面中输入接口定义信息。Exemplarily, the user inputs the interface definition information in the interface definition interactive interface based on the content displayed on the interface definition interactive interface and related operation methods.

在一个实施例中,可选的,接口定义信息包括基本信息、请求参数信息和响应数据信息。In an embodiment, optionally, the interface definition information includes basic information, request parameter information, and response data information.

在一个实施例中,可选的,基本信息包括接口名称、接口方法和接口路径信息。其中,示例性的,接口名称用于区分不同功能的接口,用户可自定义设置。在实际应用中,前端技术人员和后端技术人员协商确定需要的接口功能和各功能接口的命名方式。其中,示例性的,接口方法包括HTTP请求(HyperText Transport Protocol,超文本传输协议)支持的方法。示例性的,接口方法包括但不限于GET、POST、PUT、DELETE、HEAD、OPTIONS、PATCH和TRACE等方法。其中,GET用于获取指定的资源并返回请求体;POST用于向指定资源提交数据进行请求处理,如上传文件;PUT用于向指定资源上传最新内容;DELETE用于删除指定资源;HEAD用于获取指定资源但不返回请求体;OPTIONS用于返回服务器对指定资源提供的HTTP请求方法;PATCH用于对指定资源的部分内容进行更新,如更新某一个字段;TRACE回显服务器端收到的请求,主要用于测试或诊断。其中,示例性的,接口路径包括接口URI(UniformResource Identifier,统一资源标识符),示例性的,接口路径支持Restful风格,如/api/users/:id。In an embodiment, optionally, the basic information includes interface name, interface method, and interface path information. Among them, for example, the interface name is used to distinguish interfaces with different functions, and the user can customize the settings. In practical applications, front-end technicians and back-end technicians negotiate to determine the required interface functions and the naming method of each functional interface. Wherein, by way of example, the interface method includes a method supported by an HTTP request (HyperText Transport Protocol, hypertext transport protocol). Exemplarily, the interface methods include but are not limited to methods such as GET, POST, PUT, DELETE, HEAD, OPTIONS, PATCH, and TRACE. Among them, GET is used to obtain the specified resource and return the request body; POST is used to submit data to the specified resource for request processing, such as uploading a file; PUT is used to upload the latest content to the specified resource; DELETE is used to delete the specified resource; HEAD is used to Get the specified resource without returning the request body; OPTIONS is used to return the HTTP request method provided by the server for the specified resource; PATCH is used to update part of the content of the specified resource, such as updating a field; TRACE echoes the request received by the server , mainly used for testing or diagnosis. Wherein, the interface path exemplarily includes an interface URI (UniformResource Identifier, uniform resource identifier), and exemplarily, the interface path supports the Restful style, such as /api/users/:id.

在一个实施例中,可选的,请求参数信息包括Headers参数信息、Query参数信息和Body参数信息。其中,HTTP请求消息包括请求行、请求体、空行和请求数据。其中,请求头由关键字/值对组成,关键字和值之间用“:”分隔。请求头用于通知服务器端有关客户端的请求信息。Headers参数包括HTTP请求消息中的请求头。具体的,Headers参数信息包括参数名称、参数值、示例和备注等信息,其中,Headers参数信息的示例可以是Content-Type:application/json。图2A是本发明实施例一提供的一种接口定义交互界面中Headers参数采集模块的示意图。如图2A所示,Headers参数采集界面包括“添加Header”选项,用户可通过点击该选项生成新的Headers参数采集单元。图2A中示出了3个Headers参数采集单元,每个Headers参数采集单元包括参数名称文本框、参数值文本框和备注信息文本框。用户还可点击Headers参数采集单元后面的垃圾桶式样的图标删除对应的Headers参数采集单元。In an embodiment, optionally, the request parameter information includes Headers parameter information, Query parameter information, and Body parameter information. The HTTP request message includes a request line, a request body, a blank line and request data. Among them, the request header consists of keyword/value pairs, and the keyword and value are separated by ":". The request header is used to inform the server about the client's request information. The Headers parameter includes the request headers in the HTTP request message. Specifically, the Headers parameter information includes information such as parameter names, parameter values, examples, and remarks, where an example of the Headers parameter information may be Content-Type: application/json. FIG. 2A is a schematic diagram of a Headers parameter collection module in an interface definition interactive interface provided by Embodiment 1 of the present invention. As shown in FIG. 2A , the header parameter collection interface includes an “Add Header” option, and the user can generate a new Headers parameter collection unit by clicking this option. FIG. 2A shows three Headers parameter collection units, and each Headers parameter collection unit includes a parameter name text box, a parameter value text box, and a remark information text box. The user can also click the trash can icon behind the Headers parameter collection unit to delete the corresponding Headers parameter collection unit.

其中,Query参数信息是HTTP请求消息中URL(Uniform Resource Locator,统一资源定位符)中的参数,位于“?”后面。Query参数由关键字/值对组成,多个Query参数采用“&”连接。具体的,Query参数信息包括参数名称、是否必填、示例和备注等信息,其中,Query参数信息的示例可以是http://example.com/?a=xxx&b=yyy,其中,a和b表示Query参数,xxx和yyy分别为a和b的值。图2B是本发明实施例一提供的一种接口定义交互界面中Query参数采集模块的示意图。如图2B所示,Query参数采集界面包括“添加Query参数”选项,用户可通过点击该选项生成新的Query参数采集单元。图2B中示出了3个Query参数采集单元,每个Query参数采集单元包括参数名称文本框、参数值文本框和备注信息文本框。每个Query参数采集单元中的“方框”表示“是否必填”,用户点击方框后在该方框中生成“√”。用户还可点击Query参数采集单元后面的“垃圾桶”图标删除对应的Query参数采集单元。The Query parameter information is a parameter in the URL (Uniform Resource Locator, Uniform Resource Locator) in the HTTP request message, which is located after "?". Query parameters consist of keyword/value pairs, and multiple Query parameters are connected by "&". Specifically, the Query parameter information includes information such as the parameter name, whether it is required, an example, and a remark, where an example of the Query parameter information can be http://example.com/? a=xxx&b=yyy, where a and b represent Query parameters, and xxx and yyy are the values of a and b, respectively. FIG. 2B is a schematic diagram of a Query parameter collection module in an interface definition interactive interface provided by Embodiment 1 of the present invention. As shown in FIG. 2B , the Query parameter collection interface includes an “Add Query parameter” option, and the user can generate a new Query parameter collection unit by clicking this option. FIG. 2B shows three Query parameter collection units, and each Query parameter collection unit includes a parameter name text box, a parameter value text box, and a remark information text box. The "box" in each Query parameter collection unit indicates "required or not". After the user clicks the box, a "√" will be generated in the box. Users can also click the "trash can" icon behind the Query parameter collection unit to delete the corresponding Query parameter collection unit.

其中,Body参数包括HTTP请求消息中的请求体,支持JSON格式。在一个实施例中,可选的,采用JSON属性编辑器采集Body参数信息。具体的,Body参数信息包括属性名称、是否必填、属性类型、模拟规则和备注等信息。图2C是本发明实施例一提供的一种接口定义交互界面中Body参数采集模块的示意图。如图2C所示,“root”表示属性名称、“方框”表示“是否必填”,“object”表示“属性类型”,“mock”表示“模拟规则”。用户可通过点击Body参数采集单元后面的“+”图标,在该Body参数下添加与该Body参数对应的新的子Body参数,如图2C所示,“field_1”、“field_2”和“field_3”为“root”的子Body参数,“field_4”为“field_1”的子Body参数。用于可通过点击Body参数采集单元后面的“×”图标删除对应的Body参数采集单元。The Body parameter includes the request body in the HTTP request message, and supports JSON format. In an embodiment, optionally, a JSON property editor is used to collect Body parameter information. Specifically, the Body parameter information includes information such as attribute name, whether it is required, attribute type, simulation rules, and remarks. FIG. 2C is a schematic diagram of a body parameter collection module in an interface definition interactive interface provided by Embodiment 1 of the present invention. As shown in Fig. 2C, "root" indicates the attribute name, "box" indicates "required", "object" indicates "attribute type", and "mock" indicates "mock rule". The user can click the "+" icon behind the Body parameter acquisition unit to add a new sub-Body parameter corresponding to the Body parameter under the Body parameter, as shown in Figure 2C, "field_1", "field_2" and "field_3" is the sub-Body parameter of "root", and "field_4" is the sub-Body parameter of "field_1". Used to delete the corresponding Body parameter collection unit by clicking the "X" icon behind the Body parameter collection unit.

在一个实施例中,可选的,响应数据信息包括JSON格式的数据。其中,示例性的,响应数据信息用于定义生成测试数据的约束和规则。接口定义交互界面中响应数据信息采集模块的示意图与图4类似,此处不再重复说明。In one embodiment, optionally, the response data information includes data in JSON format. Wherein, exemplarily, the response data information is used to define constraints and rules for generating test data. Interface Definition The schematic diagram of the response data information acquisition module in the interactive interface is similar to FIG. 4 , and the description is not repeated here.

图3A是本发明实施例一提供的一种接口定义交互界面的示意图。如图3所示的接口定义交互界面包括基本信息采集模块、请求参数采集模块和响应数据采集模块。其中,“接口路径”后的两个文本框分别为接口方法文本框和接口路径文本框。用户在编辑完成当前接口的定义信息后,点击界面中的“保存”按钮对接口定义信息进行保存。接口定义交互界面还包括接口列表,用于显示采集到的所有接口。其中,具体的,可对接口进行分类,在不同的分类列表中显示对应的接口,示例性的,分类列表包括测试接口。FIG. 3A is a schematic diagram of an interface definition interactive interface according to Embodiment 1 of the present invention. The interface definition interactive interface shown in Figure 3 includes a basic information collection module, a request parameter collection module and a response data collection module. Among them, the two text boxes after "Interface Path" are the interface method text box and the interface path text box respectively. After editing the definition information of the current interface, the user clicks the "Save" button in the interface to save the interface definition information. Interface Definition The interactive interface also includes an interface list, which is used to display all the collected interfaces. Specifically, the interfaces can be classified, and corresponding interfaces are displayed in different classified lists. Exemplarily, the classified lists include test interfaces.

在一个实施例中,可选的,接口定义信息还包括接口状态、接口创建人和接口更新时间。其中,接口状态用于表示当前接口的定义状态,示例性的,接口状态可以是未完成、已完成和更新中等等。其中,接口创建人包括创建当前接口的用户。具体的,显示接口定义交互界面之前,显示账号输入提示框,当输入的账号与已保存的账号相同时,显示接口定义交互界面,允许使用该账户的用于录入接口定义信息。其中,接口更新时间用于记录当前接口的被编辑时间,具体的,当接收到保存指令时记录接口更新时间。In one embodiment, optionally, the interface definition information further includes interface status, interface creator and interface update time. The interface state is used to represent the definition state of the current interface. Exemplarily, the interface state may be incomplete, completed, updating, and so on. The interface creator includes the user who created the current interface. Specifically, before displaying the interface definition interaction interface, an account input prompt box is displayed, and when the input account is the same as the saved account, the interface definition interaction interface is displayed, allowing the use of the account for inputting interface definition information. The interface update time is used to record the edited time of the current interface. Specifically, the interface update time is recorded when a save instruction is received.

图3B是本发明实施例一提供的一种接口定义信息的示意图。图3B所示的接口的接口定义信息包括基本信息、请求参数信息、响应数据信息、备注和修改记录。其中,基本信息包括名称、创建人、状态、更新时间、方法和路径。请求参数信息包括Headers参数信息、Query参数信息和Body参数信息。在Header列表中的每个Headers参数采集单元包括参数名称、参数取值、示例和备注,在Query列表中的每个Query参数采集单元包括参数名称、是否必填、示例和备注,在Body列表中的每个Body参数采集单元包括属性名称、是否必填、属性类型、模拟规则和备注,其中,属性类型包括text类型和file类型。text类型是指该参数包含关键字/值对,file类型是指该参数包含文件。响应数据信息的数据类型主要为JSON格式,参数列表中的每个采集单元包括属性名称、是否必填、属性类型、模拟规则和备注,其中,属性类型包括string、number、array、object、boolean和integer,上述属性类型分别表示字符串数据类型、数值数据类型、数组数据类型、引用类型、布尔类型和整型数据类型。FIG. 3B is a schematic diagram of interface definition information according to Embodiment 1 of the present invention. The interface definition information of the interface shown in FIG. 3B includes basic information, request parameter information, response data information, remarks and modification records. Among them, the basic information includes name, creator, status, update time, method and path. The request parameter information includes Headers parameter information, Query parameter information, and Body parameter information. Each header parameter collection unit in the Header list includes parameter name, parameter value, example and remarks, and each Query parameter collection unit in the Query list includes parameter name, whether it is required, example and remarks, in the Body list Each Body parameter collection unit of , includes attribute name, whether it is required, attribute type, simulation rules and remarks, wherein, the attribute type includes text type and file type. The text type means that the parameter contains keyword/value pairs, and the file type means that the parameter contains a file. The data type of the response data information is mainly in JSON format. Each collection unit in the parameter list includes the attribute name, whether it is required, attribute type, simulation rules and remarks. The attribute type includes string, number, array, object, boolean and Integer, the above attribute types represent string data type, numeric data type, array data type, reference type, Boolean type and integer data type respectively.

S130、接收外部输入的请求信息,并根据请求信息和接口文档生成与请求信息对应的测试数据。S130: Receive externally input request information, and generate test data corresponding to the request information according to the request information and the interface document.

其中,示例性的,请求信息的类型包括HTTP请求信息。其中,具体的,根据请求信息中的请求参数数据和接口文档中定义的响应数据信息,生成与请求信息对应的测试数据。Wherein, exemplarily, the type of request information includes HTTP request information. Specifically, the test data corresponding to the request information is generated according to the request parameter data in the request information and the response data information defined in the interface document.

本实施例的技术方案,通过设置接口定义交互界面采集接口定义信息,生成接口文档,解决了前后端协作效率低的问题,使得前端技术人员和后端技术人员可以同时开展开发工作,既满足了前端技术人员对测试数据的需求,又能避免后端技术人员后期反复对接口代码进行修订。In the technical solution of this embodiment, the interface definition information is collected by setting the interface definition interactive interface, and the interface document is generated, which solves the problem of low front-end and back-end collaboration efficiency, and enables front-end technicians and back-end technicians to carry out development work at the same time, which not only satisfies The requirements of front-end technicians for test data can also avoid the need for back-end technicians to revise the interface code repeatedly in the later period.

实施例二Embodiment 2

图4是本发明实施例二提供的一种接口管理方法的流程图,本实施例的技术方案是上述实施例的基础上的进一步细化。可选的,所述根据所述请求信息和所述接口文档生成与所述请求信息对应的测试数据,包括:将所述请求信息与所述接口文档中的请求参数信息进行匹配,得到目标请求参数信息和与所述目标请求参数信息对应的响应数据信息;根据所述目标请求参数信息和所述响应数据信息生成与所述请求信息对应的测试数据。FIG. 4 is a flowchart of an interface management method according to Embodiment 2 of the present invention. The technical solution of this embodiment is a further refinement on the basis of the foregoing embodiment. Optionally, generating the test data corresponding to the request information according to the request information and the interface document includes: matching the request information with the request parameter information in the interface document to obtain the target request. parameter information and response data information corresponding to the target request parameter information; generate test data corresponding to the request information according to the target request parameter information and the response data information.

本实施例的具体实施步骤包括:The specific implementation steps of this embodiment include:

S210、当接收到用户输入的接口定义指令时,显示接口定义交互界面。S210. When receiving the interface definition instruction input by the user, display the interface definition interactive interface.

S220、基于接口定义交互界面采集接口定义信息,并基于接口定义信息生成接口文档。S220. Collect interface definition information based on the interface definition interactive interface, and generate an interface document based on the interface definition information.

S230、接收外部输入的请求信息,将请求信息与接口文档中的请求参数信息进行匹配,得到目标请求参数信息和与目标请求参数信息对应的响应数据信息。S230: Receive externally input request information, match the request information with the request parameter information in the interface document, and obtain target request parameter information and response data information corresponding to the target request parameter information.

其中,示例性的,请求信息的类型包括HTTP请求信息。其中,具体的,基于请求信息中的基本信息与接口文档中的基本信息进行匹配,示例性的,基本信息包括接口名称、接口方法和接口路径等信息,匹配成功后可得到与请求信息对应的定义接口、定义接口对应的目标请求参数信息和目标请求参数对应的响应数据信息。Wherein, exemplarily, the type of request information includes HTTP request information. Specifically, the basic information in the request information is matched with the basic information in the interface document. Exemplarily, the basic information includes information such as interface name, interface method, and interface path. After successful matching, the corresponding request information can be obtained. Define the interface, define the target request parameter information corresponding to the interface, and the response data information corresponding to the target request parameter.

S240、根据目标请求参数信息和响应数据信息生成与请求信息对应的测试数据。S240. Generate test data corresponding to the request information according to the target request parameter information and the response data information.

在一个实施例中,可选地,根据目标请求参数信息对请求信息进行校验;如果校验成功,则根据响应数据信息生成与请求信息对应的测试数据。其中,示例性的,根据目标请求参数信息中的参数类型对请求信息中的参数类型进行校验,如果请求信息中的参数类型与目标请求参数信息中的参数类型不同,则校验失败,如果相同,则校验成功。其中,根据响应数据信息生成与请求信息对应的测试数据,包括:根据响应数据信息中的模拟规则和请求信息中的请求参数数据,生成测试数据。其中,模拟规则用于标识测试数据的生成规则。在一个实施例中,模拟规则包括定义测试数据的数据类型,如@integer表示整型数据,@string表示字符串数据。在一个实施例中,模拟规则包括定义测试数据的数据类型和数据长度,如@integer(1-10)表示数值为1-10的整型数据,@string(1-10)表示数值为1-10字符串数据。在一个实施例中,模拟规则包括正则表达式规则,如@regex:^[a-zA-Z0-9]+$,其中,“^”表示匹配输入字行首,“[a-zA-Z0-9]”表示26个大写字母、26个小写字母和0至9数字,“$”表示匹配输入行尾。In an embodiment, optionally, the request information is verified according to the target request parameter information; if the verification is successful, test data corresponding to the request information is generated according to the response data information. Wherein, exemplarily, the parameter type in the request information is verified according to the parameter type in the target request parameter information, if the parameter type in the request information is different from the parameter type in the target request parameter information, the verification fails, if If they are the same, the verification is successful. Wherein, generating the test data corresponding to the request information according to the response data information includes: generating the test data according to the simulation rules in the response data information and the request parameter data in the request information. Among them, the simulation rule is used to identify the generation rule of the test data. In one embodiment, the simulation rule includes defining the data type of the test data, such as @integer for integer data and @string for string data. In one embodiment, the simulation rule includes defining the data type and data length of the test data. For example, @integer(1-10) represents integer data with a value of 1-10, and @string(1-10) represents a value of 1- 10 string data. In one embodiment, the simulation rules include regular expression rules, such as @regex:^[a-zA-Z0-9]+$, where "^" indicates matching the beginning of the input word line, "[a-zA-Z0 -9]" means 26 uppercase letters, 26 lowercase letters and numbers from 0 to 9, and "$" means match the end of the input line.

在一个实施例中,可选地,将校验结果和生成的测试数据返回给用户;其中,校验结果包括校验失败标识和与校验失败标识对应的备注信息。其中,校验失败标识用于表征不同的校验失败原因,备注信息用于说明校验失败的原因。其中,示例性的,如果请求参数的请求信息中的参数类型与目标请求参数信息中的参数类型不同,则校验失败标识为A,备注信息为参数类型不符合要求。如果请求参数的请求信息中缺少必填参数时,则校验失败标识为B,备注信息为缺少必填参数。此处对校验失败标识和备注信息不作具体限定,用户可自定义设置。In one embodiment, optionally, the verification result and the generated test data are returned to the user; wherein the verification result includes a verification failure identifier and remark information corresponding to the verification failure identifier. The verification failure identifier is used to represent different verification failure reasons, and the remark information is used to describe the verification failure reasons. Exemplarily, if the parameter type in the request information of the request parameter is different from the parameter type in the target request parameter information, the verification failure is marked as A, and the remark information is that the parameter type does not meet the requirements. If the required parameter is missing in the request information of the request parameter, the verification failure is marked as B, and the remark information is that the required parameter is missing. The verification failure identification and remark information are not specifically limited here, and the user can customize the settings.

图5是本发明实施例二提供的一种测试数据的响应方法的流程图。图5中虚线表示服务器端,请求信息通过客户端输入到服务器端,服务器端将生成的响应返回给客户端。图5所示的请求信息的接收入口和响应入口采用同一网关,该网关接收客户端输入的请求信息,也接收服务器端输入的响应数据。当网关接收到请求信息时,将请求信息的基本信息与接口文档中接口的基本信息进行匹配,确定匹配的定义接口、定义接口的目标请求参数信息和与目标请求参数信息对应的响应数据信息。基于目标请求参数信息对请求信息进行校验,并将校验响应数据发送给响应入口网关。如果校验成功,则基于响应数据信息和请求信息中的参数数据生成测试数据并发送给响应入口网关。响应入口网关将接收到的校验响应数据和测试数据返回给客户端。FIG. 5 is a flowchart of a method for responding to test data according to Embodiment 2 of the present invention. The dotted line in FIG. 5 represents the server side, the request information is input to the server side through the client side, and the server side returns the generated response to the client side. The same gateway is used for the reception entry and the response entry of the request information shown in FIG. 5 , and the gateway receives the request information input by the client and the response data input by the server. When the gateway receives the request information, it matches the basic information of the request information with the basic information of the interface in the interface document, and determines the matching defined interface, the target request parameter information of the defined interface, and the response data information corresponding to the target request parameter information. The request information is verified based on the target request parameter information, and the verification response data is sent to the response portal gateway. If the verification is successful, test data is generated based on the response data information and the parameter data in the request information and sent to the response portal gateway. The response entry gateway returns the received verification response data and test data to the client.

在上述实施例的基础上,可选的,接收用户输入的待迁移接口文档,对待迁移接口文档中的接口定义信息进行解析,得到满足预设格式要求的接口定义信息。其中,待迁移接口文档包括其他接口管理平台生成的接口文档,示例性的,其他接口管理平台可以是swagger平台,待迁移接口文档的数据格式可以为JSON格式。不同的接口管理平台生成的接口文档中的接口定义信息的定义方式不同,示例性的,本实施例中采用“name”表示参数名称,其他接口管理平台采用“”表示参数名称。具体的,对待迁移接口文档中的接口定义信息进行解析,包括:根据预设格式要求,将待迁移接口文档中的接口定义信息转化为目标接口定义信息。示例性的,将迁移接口文档中的接口定义信息中的“definition”替换为“name”。On the basis of the above embodiment, optionally, the interface document to be migrated input by the user is received, and the interface definition information in the interface to be migrated document is parsed to obtain the interface definition information that meets the preset format requirements. The interface documents to be migrated include interface documents generated by other interface management platforms. Exemplarily, the other interface management platforms may be the swagger platform, and the data format of the interface documents to be migrated may be JSON format. Interface definition information in interface documents generated by different interface management platforms is defined in different ways. Exemplarily, in this embodiment, "name" is used to represent the parameter name, and other interface management platforms use "" to represent the parameter name. Specifically, parsing the interface definition information in the interface document to be migrated includes: converting the interface definition information in the interface document to be migrated into target interface definition information according to preset format requirements. Exemplarily, replace "definition" in the interface definition information in the migration interface document with "name".

这样设置的好处在于,swagger平台可以生成接口文档,但不具备动态生成测试数据的功能,本实施例一方面简化了技术人员重新录入接口定义信息的步骤,另一方面,提高了接口管理的兼容性,以便更好的满足用户的使用需求。The advantage of this setting is that the swagger platform can generate interface documents, but does not have the function of dynamically generating test data. On the one hand, this embodiment simplifies the steps for technicians to re-enter interface definition information, and on the other hand, improves the compatibility of interface management. in order to better meet the needs of users.

在上述实施例的基础上,可选的,获取目标导出模板和导出接口定义信息,将导出接口定义信息填写到目标导出模板中生成导出接口文档。其中,目标导出模板包括需要导出的接口和接口之间的逻辑关系。具体的,用户可对默认导出模板进行编辑生成目标导出模板,基于目标导出模板中的导出接口,获取与导出接口对应的导出接口定义信息。On the basis of the above embodiment, optionally, a target export template and export interface definition information are obtained, and the export interface definition information is filled in the target export template to generate an export interface document. The target export template includes the interface to be exported and the logical relationship between the interfaces. Specifically, the user can edit the default export template to generate the target export template, and obtain the export interface definition information corresponding to the export interface based on the export interface in the target export template.

这样设置的好处在于,不同的用户需求对应不同的接口文档,如果只能导出默认的接口文档不能满足不同的用户需求。本实施例通过设置导出模板,避免了反复对导出的接口文档进行修改的步骤,降低了导出接口文档的工作量,进而提高工作效率。The advantage of this setting is that different user needs correspond to different interface documents. If only the default interface document can be exported, it cannot meet different user needs. In this embodiment, by setting an export template, the step of repeatedly modifying the exported interface document is avoided, the workload of exporting the interface document is reduced, and the work efficiency is improved.

图6是本发明实施例二提供的一种接口文档导入和导出的流程图。接收JSON格式或swagger接口提供的待迁移接口文档,通过导入模块对待迁移接口文档进行解析得到符合预设格式要求的接口定义信息。通过导出模块中定义的导出模板,将与该导出模板对应的接口定义信息填写到导出模板中,生成接口文档并导出。FIG. 6 is a flowchart of importing and exporting an interface document according to Embodiment 2 of the present invention. Receive the to-be-migrated interface document provided in JSON format or the swagger interface, and parse the to-be-migrated interface document through the import module to obtain the interface definition information that meets the preset format requirements. Through the export template defined in the export module, the interface definition information corresponding to the export template is filled in the export template, and the interface document is generated and exported.

本实施例的技术方案,通过对基于目标请求参数信息对请求信息进行匹配和校验,解决了测试工作效率低的问题,技术人员可根据输出的校验结果及时修正输入的请求信息,从而提高测试工作的效率。The technical solution of this embodiment solves the problem of low test work efficiency by matching and verifying the request information based on the target request parameter information, and the technician can correct the input request information in time according to the output verification result, thereby improving the efficiency of the test. Test the efficiency of work.

实施例三Embodiment 3

图7是本发明实施例三提供的一种接口管理装置的示意图。本实施例可适用于基于前后端模式的产品开发的情况,该装置可采用软件和/或硬件的方式实现,该装置可以配置于终端设备中。该接口管理装置包括:接口定义模块310、信息传输模块320和响应模拟模块330。FIG. 7 is a schematic diagram of an interface management apparatus according to Embodiment 3 of the present invention. This embodiment is applicable to the case of product development based on the front-end and back-end mode, the apparatus may be implemented in software and/or hardware, and the apparatus may be configured in a terminal device. The interface management apparatus includes: an interface definition module 310 , an information transmission module 320 and a response simulation module 330 .

其中,接口定义模块310,用于当接收到用户输入的接口定义指令时,显示接口定义交互界面,采集用户基于接口定义交互界面输入的接口定义信息,并基于接口定义信息生成接口文档;Wherein, the interface definition module 310 is configured to display the interface definition interactive interface when receiving the interface definition instruction input by the user, collect the interface definition information input by the user based on the interface definition interactive interface, and generate an interface document based on the interface definition information;

信息传输模块320,用于接收用户输入的请求信息;an information transmission module 320, configured to receive request information input by a user;

响应模拟模块330,用于根据请求信息和接口文档生成与请求信息对应的测试数据。The response simulation module 330 is configured to generate test data corresponding to the request information according to the request information and the interface document.

本实施例的技术方案,通过设置接口定义交互界面采集接口定义信息,生成接口文档,解决了前后端协作效率低的问题,使得前端技术人员和后端技术人员可以同时开展开发工作,既满足了前端技术人员对测试数据的需求,又能避免后端技术人员后期反复对接口代码进行修订。In the technical solution of this embodiment, the interface definition information is collected by setting the interface definition interactive interface, and the interface document is generated, which solves the problem of low front-end and back-end collaboration efficiency, and enables front-end technicians and back-end technicians to carry out development work at the same time, which not only satisfies The requirements of front-end technicians for test data can also avoid the need for back-end technicians to revise the interface code repeatedly in the later period.

在上述技术方案的基础上,可选的,接口定义信息包括基本信息、请求参数信息和响应数据信息,其中,请求参数信息包括Headers参数信息、Query参数信息和Body参数信息。Based on the above technical solution, optionally, the interface definition information includes basic information, request parameter information, and response data information, wherein the request parameter information includes Headers parameter information, Query parameter information, and Body parameter information.

在上述技术方案的基础上,可选地,响应模拟模块330包括:On the basis of the above technical solution, optionally, the response simulation module 330 includes:

目标请求参数信息确定单元,用于将请求信息与接口文档中的请求参数信息进行匹配,得到目标请求参数信息和与目标请求参数信息对应的响应数据信息;a target request parameter information determination unit, configured to match the request information with the request parameter information in the interface document to obtain the target request parameter information and the response data information corresponding to the target request parameter information;

测试数据生成单元,用于根据目标请求参数信息和响应数据信息生成与请求信息对应的测试数据。The test data generating unit is used for generating test data corresponding to the request information according to the target request parameter information and the response data information.

在上述技术方案的基础上,可选地,测试数据生成单元具体用于:On the basis of the above technical solution, optionally, the test data generation unit is specifically used for:

根据目标请求参数信息对请求信息进行校验;Verify the request information according to the target request parameter information;

如果校验成功,则根据响应数据信息生成与请求信息对应的测试数据。If the verification is successful, test data corresponding to the request information is generated according to the response data information.

在上述技术方案的基础上,可选地,该装置还包括:On the basis of the above technical solution, optionally, the device further includes:

测试数据返回模块,用于将校验结果和生成的测试数据返回给用户;其中,校验结果包括校验失败标识和与校验失败标识对应的备注信息。The test data return module is used to return the verification result and the generated test data to the user; wherein the verification result includes a verification failure identifier and remark information corresponding to the verification failure identifier.

在上述技术方案的基础上,可选地,该装置还包括:On the basis of the above technical solution, optionally, the device further includes:

导入模块,用于接收用户输入的待迁移接口文档,对待迁移接口文档中的接口定义信息进行解析,得到满足预设格式要求的接口定义信息。The import module is configured to receive the interface document to be migrated input by the user, parse the interface definition information in the interface document to be migrated, and obtain the interface definition information that meets the requirements of the preset format.

在上述技术方案的基础上,可选地,该装置还包括:On the basis of the above technical solution, optionally, the device further includes:

导出模块,用于获取目标导出模板和导出接口定义信息,将导出接口定义信息填写到目标导出模板中生成导出接口文档。The export module is used to obtain the target export template and export interface definition information, and fill in the export interface definition information into the target export template to generate an export interface document.

本发明实施例所提供的接口管理装置可以用于执行本发明实施例所提供的接口管理方法,具备执行方法相应的功能和有益效果。The interface management apparatus provided by the embodiment of the present invention can be used to execute the interface management method provided by the embodiment of the present invention, and has corresponding functions and beneficial effects of the execution method.

值得注意的是,上述接口管理装置的实施例中,所包括的各个单元和模块只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,各功能单元的具体名称也只是为了便于相互区分,并不用于限制本发明的保护范围。It is worth noting that in the above-mentioned embodiment of the interface management apparatus, the units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized; The specific names of the functional units are only for the convenience of distinguishing from each other, and are not used to limit the protection scope of the present invention.

实施例四Embodiment 4

图8是本发明实施例四提供的一种设备的结构示意图,本发明实施例为本发明上述实施例的接口管理方法的实现提供服务,可配置上述实施例中的接口管理装置。图8示出了适于用来实现本发明实施方式的示例性设备12的框图。图8显示的设备12仅仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。8 is a schematic structural diagram of a device according to Embodiment 4 of the present invention. This embodiment of the present invention provides services for the implementation of the interface management method in the above-mentioned embodiment of the present invention, and the interface management apparatus in the above-mentioned embodiment can be configured. FIG. 8 shows a block diagram of an exemplary apparatus 12 suitable for use in implementing embodiments of the present invention. The device 12 shown in FIG. 8 is only an example, and should not impose any limitation on the function and scope of use of the embodiments of the present invention.

如图8所示,设备12以通用计算设备的形式表现。设备12的组件可以包括但不限于:一个或者多个处理器或者处理单元16,系统存储器28,连接不同系统组件(包括系统存储器28和处理单元16)的总线18。As shown in FIG. 8, device 12 takes the form of a general-purpose computing device. Components of device 12 may include, but are not limited to, one or more processors or processing units 16, system memory 28, and a bus 18 connecting various system components including system memory 28 and processing unit 16.

总线18表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。举例来说,这些体系结构包括但不限于工业标准体系结构(ISA)总线,微通道体系结构(MAC)总线,增强型ISA总线、视频电子标准协会(VESA)局域总线以及外围组件互连(PCI)总线。Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of a variety of bus structures. By way of example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect ( PCI) bus.

设备12典型地包括多种计算机系统可读介质。这些介质可以是任何能够被设备12访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。Device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by device 12, including volatile and non-volatile media, removable and non-removable media.

系统存储器28可以包括易失性存储器形式的计算机系统可读介质,例如随机存取存储器(RAM)30和/或高速缓存存储器32。设备12可以进一步包括其它可移动/不可移动的、易失性/非易失性计算机系统存储介质。仅作为举例,存储系统34可以用于读写不可移动的、非易失性磁介质(图8未显示,通常称为“硬盘驱动器”)。尽管图8中未示出,可以提供用于对可移动非易失性磁盘(例如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如CD-ROM,DVD-ROM或者其它光介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过一个或者多个数据介质接口与总线18相连。存储器28可以包括至少一个程序产品,该程序产品具有一组(例如至少一个)程序模块,这些程序模块被配置以执行本发明各实施例的功能。System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and/or cache memory 32 . Device 12 may further include other removable/non-removable, volatile/non-volatile computer system storage media. For example only, storage system 34 may be used to read and write to non-removable, non-volatile magnetic media (not shown in FIG. 8, commonly referred to as a "hard disk drive"). Although not shown in Figure 8, a disk drive may be provided for reading and writing to removable non-volatile magnetic disks (eg "floppy disks"), as well as removable non-volatile optical disks (eg CD-ROM, DVD-ROM) or other optical media) to read and write optical drives. In these cases, each drive may be connected to bus 18 through one or more data media interfaces. Memory 28 may include at least one program product having a set (eg, at least one) of program modules configured to perform the functions of various embodiments of the present invention.

具有一组(至少一个)程序模块42的程序/实用工具40,可以存储在例如存储器28中,这样的程序模块42包括但不限于操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。程序模块42通常执行本发明所描述的实施例中的功能和/或方法。A program/utility 40 having a set (at least one) of program modules 42, which may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data , each or some combination of these examples may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods of the described embodiments of the present invention.

设备12也可以与一个或多个外部设备14(例如键盘、指向设备、显示器24等)通信,还可与一个或者多个使得用户能与该设备12交互的设备通信,和/或与使得该设备12能与一个或多个其它计算设备进行通信的任何设备(例如网卡,调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口22进行。并且,设备12还可以通过网络适配器20与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图8所示,网络适配器20通过总线18与设备12的其它模块通信。应当明白,尽管图中未示出,可以结合设备12使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。Device 12 may also communicate with one or more external devices 14 (eg, keyboards, pointing devices, display 24, etc.), may also communicate with one or more devices that enable a user to interact with device 12, and/or communicate with Device 12 can communicate with any device (eg, network card, modem, etc.) that communicates with one or more other computing devices. Such communication may take place through input/output (I/O) interface 22 . Also, the device 12 may communicate with one or more networks (eg, a local area network (LAN), a wide area network (WAN), and/or a public network such as the Internet) through a network adapter 20 . As shown in FIG. 8 , network adapter 20 communicates with other modules of device 12 via bus 18 . It should be understood that, although not shown, other hardware and/or software modules may be used in conjunction with device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and Data backup storage system, etc.

处理单元16通过运行存储在系统存储器28中的程序,从而执行各种功能应用以及数据处理,例如实现本发明实施例所提供的接口管理方法。The processing unit 16 executes various functional applications and data processing by running the programs stored in the system memory 28, for example, implementing the interface management method provided by the embodiments of the present invention.

通过上述设备,解决了前后端协作效率低的问题,使得前端技术人员和后端技术人员可以同时开展开发工作,既满足了前端技术人员对测试数据的需求,又能避免后端技术人员后期反复对接口代码进行修订。Through the above equipment, the problem of low efficiency of front-end and back-end collaboration is solved, so that front-end technicians and back-end technicians can carry out development work at the same time, which not only meets the needs of front-end technicians for test data, but also avoids back-end technicians repeating later Revised interface code.

实施例五Embodiment 5

本发明实施例五还提供了一种包含计算机可执行指令的存储介质,计算机可执行指令在由计算机处理器执行时用于执行一种接口管理方法,该方法包括:Embodiment 5 of the present invention also provides a storage medium containing computer-executable instructions, where the computer-executable instructions are used to execute an interface management method when executed by a computer processor, and the method includes:

当接收到用户输入的接口定义指令时,显示接口定义交互界面;When receiving the interface definition instruction input by the user, display the interface definition interactive interface;

基于接口定义交互界面采集接口定义信息,并基于接口定义信息生成接口文档;Collect interface definition information based on the interface definition interactive interface, and generate interface documents based on the interface definition information;

接收外部输入的请求信息,并根据请求信息和接口文档生成与请求信息对应的测试数据。Receive externally input request information, and generate test data corresponding to the request information according to the request information and the interface document.

本发明实施例的计算机存储介质,可以采用一个或多个计算机可读的介质的任意组合。计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质。计算机可读存储介质例如可以是但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本文件中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。The computer storage medium in the embodiments of the present invention may adopt any combination of one or more computer-readable mediums. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples (a non-exhaustive list) of computer readable storage media include: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), Erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。A computer-readable signal medium may include a propagated data signal in baseband or as part of a carrier wave, with computer-readable program code embodied thereon. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device .

计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、电线、光缆、RF等等,或者上述的任意合适的组合。Program code embodied on a computer readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

可以以一种或多种程序设计语言或其组合来编写用于执行本发明操作的计算机程序代码,程序设计语言包括面向对象的程序设计语言,诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言,诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络包括局域网(LAN)或广域网(WAN),连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for carrying out operations of the present invention may be written in one or more programming languages, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural A programming language, such as the "C" language or similar programming language. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. Where a remote computer is involved, the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider to connect through the Internet) ).

当然,本发明实施例所提供的一种包含计算机可执行指令的存储介质,其计算机可执行指令不限于如上的方法操作,还可以执行本发明任意实施例所提供的接口管理方法中的相关操作。Of course, a storage medium containing computer-executable instructions provided by an embodiment of the present invention, the computer-executable instructions thereof are not limited to the above method operations, and can also perform related operations in the interface management method provided by any embodiment of the present invention. .

注意,上述仅为本发明的较佳实施例及所运用技术原理。本领域技术人员会理解,本发明不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施例对本发明进行了较为详细的说明,但是本发明不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多其他等效实施例,而本发明的范围由所附的权利要求范围决定。Note that the above are only preferred embodiments of the present invention and applied technical principles. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and can also include more other equivalent embodiments without departing from the concept of the present invention. The scope is determined by the scope of the appended claims.

Claims (10)

1. An interface management method, comprising:
when an interface definition instruction input by a user is received, displaying an interface definition interactive interface;
collecting interface definition information based on the interface definition interactive interface, and generating an interface document based on the interface definition information;
and receiving request information input from the outside, and generating test data corresponding to the request information according to the request information and the interface document.
2. The method of claim 1, wherein the interface definition information comprises basic information, request parameter information, and response data information, wherein the request parameter information comprises heads parameter information, Query parameter information, and Body parameter information.
3. The method of claim 2, wherein generating test data corresponding to the request information from the request information and the interface document comprises:
matching the request information with request parameter information in the interface document to obtain target request parameter information and response data information corresponding to the target request parameter information;
and generating test data corresponding to the request information according to the target request parameter information and the response data information.
4. The method of claim 3, wherein generating test data corresponding to the request information according to the target request parameter information and the response data information comprises:
checking the request information according to the target request parameter information;
and if the verification is successful, generating test data corresponding to the request information according to the response data information.
5. The method of claim 4, further comprising:
returning the verification result and the generated test data to the user; and the verification result comprises a verification failure identifier and remark information corresponding to the verification failure identifier.
6. The method of claim 1, further comprising:
receiving an interface document to be migrated, which is input by a user, and analyzing interface definition information in the interface document to be migrated to obtain interface definition information meeting the requirement of a preset format.
7. The method of claim 1, further comprising:
and acquiring a target export template and export interface definition information, and filling the export interface definition information into the target export template to generate an export interface document.
8. An interface management apparatus, comprising:
the interface definition module is used for displaying an interface definition interactive interface when receiving an interface definition instruction input by a user, acquiring interface definition information input by the user based on the interface definition interactive interface, and generating an interface document based on the interface definition information;
the information transmission module is used for receiving request information input by a user;
and the response simulation module is used for generating test data corresponding to the request information according to the request information and the interface document.
9. An apparatus, comprising:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the interface management method of any of claims 1-7.
10. A storage medium containing computer-executable instructions for performing the interface management method of any one of claims 1-7 when executed by a computer processor.
CN202010522353.3A 2020-06-10 2020-06-10 Interface management method, device, equipment and storage medium Active CN111694561B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010522353.3A CN111694561B (en) 2020-06-10 2020-06-10 Interface management method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010522353.3A CN111694561B (en) 2020-06-10 2020-06-10 Interface management method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111694561A true CN111694561A (en) 2020-09-22
CN111694561B CN111694561B (en) 2024-10-25

Family

ID=72480128

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010522353.3A Active CN111694561B (en) 2020-06-10 2020-06-10 Interface management method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111694561B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112380281A (en) * 2020-10-30 2021-02-19 中国人寿保险股份有限公司 Platform layer code generation method and device, electronic equipment and storage medium
CN112667219A (en) * 2021-01-21 2021-04-16 中信银行股份有限公司 Code generation method and device, equipment and computer readable storage medium
CN112685014A (en) * 2020-12-25 2021-04-20 中孚安全技术有限公司 Method, system and equipment for quickly simulating interface
CN113741893A (en) * 2021-08-02 2021-12-03 重庆长安汽车股份有限公司 JSON (Java Server object notation) -analysis-based open platform interface document automatic generation method and system
CN113836460A (en) * 2021-08-13 2021-12-24 深圳市明源云空间电子商务有限公司 mock data control method, equipment terminal and computer readable storage medium
CN114491191A (en) * 2022-01-29 2022-05-13 瀚云科技有限公司 A method, device, electronic device and storage medium for generating interface document
CN118034678A (en) * 2024-02-20 2024-05-14 北京三维天地科技股份有限公司 Interface integration method and system based on low-code development platform

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2000023925A2 (en) * 1998-10-16 2000-04-27 Commerce One, Inc. Documents for commerce in trading partner networks and interface definitions based on the documents
US20050060317A1 (en) * 2003-09-12 2005-03-17 Lott Christopher Martin Method and system for the specification of interface definitions and business rules and automatic generation of message validation and transformation software
CN107463409A (en) * 2017-08-11 2017-12-12 深圳乐信软件技术有限公司 A kind of interface conversion method, interface convertor, storage medium and electric terminal
CN107977308A (en) * 2016-10-25 2018-05-01 传化物流集团有限公司 interface test method and device
CN109408375A (en) * 2018-09-27 2019-03-01 深圳壹账通智能科技有限公司 The generation method and device of interface document
CN109446072A (en) * 2018-09-27 2019-03-08 深圳壹账通智能科技有限公司 The generation method and device of test script
US20190188119A1 (en) * 2017-12-14 2019-06-20 Cognizant Technology Solutions India Pvt. Ltd. System and a method for providing automated performance detection of application programming interfaces
CN110287109A (en) * 2019-06-18 2019-09-27 广州华多网络科技有限公司 Test method, device, computer equipment and its storage medium of protocol interface
CN110471842A (en) * 2019-07-12 2019-11-19 平安普惠企业管理有限公司 A kind of test method, device and computer readable storage medium
CN110727580A (en) * 2019-09-03 2020-01-24 深圳壹账通智能科技有限公司 Response data generation method, full-flow interface data processing method and related equipment

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2000023925A2 (en) * 1998-10-16 2000-04-27 Commerce One, Inc. Documents for commerce in trading partner networks and interface definitions based on the documents
US20050060317A1 (en) * 2003-09-12 2005-03-17 Lott Christopher Martin Method and system for the specification of interface definitions and business rules and automatic generation of message validation and transformation software
CN107977308A (en) * 2016-10-25 2018-05-01 传化物流集团有限公司 interface test method and device
CN107463409A (en) * 2017-08-11 2017-12-12 深圳乐信软件技术有限公司 A kind of interface conversion method, interface convertor, storage medium and electric terminal
US20190188119A1 (en) * 2017-12-14 2019-06-20 Cognizant Technology Solutions India Pvt. Ltd. System and a method for providing automated performance detection of application programming interfaces
CN109408375A (en) * 2018-09-27 2019-03-01 深圳壹账通智能科技有限公司 The generation method and device of interface document
CN109446072A (en) * 2018-09-27 2019-03-08 深圳壹账通智能科技有限公司 The generation method and device of test script
CN110287109A (en) * 2019-06-18 2019-09-27 广州华多网络科技有限公司 Test method, device, computer equipment and its storage medium of protocol interface
CN110471842A (en) * 2019-07-12 2019-11-19 平安普惠企业管理有限公司 A kind of test method, device and computer readable storage medium
CN110727580A (en) * 2019-09-03 2020-01-24 深圳壹账通智能科技有限公司 Response data generation method, full-flow interface data processing method and related equipment

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
QQ_38188999: "利用ApiPost一键、快速生成接口文档!女猿也过38节!", pages 1 - 4, Retrieved from the Internet <URL:https://blog.csdn.net/qq_38188999/article/details/88321989?> *
仰望银河系: "接口文档编写工具", 《CSDN HTTPS://BLOG.CSDN.NET/WEIXIN_44185837/ARTICLE/DETAILS/105933792》 *
张悦: "通用软件接口测试平台的设计与实现", 《通用软件接口测试平台的设计与实现》, no. 12, 25 December 2019 (2019-12-25) *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112380281A (en) * 2020-10-30 2021-02-19 中国人寿保险股份有限公司 Platform layer code generation method and device, electronic equipment and storage medium
CN112685014A (en) * 2020-12-25 2021-04-20 中孚安全技术有限公司 Method, system and equipment for quickly simulating interface
CN112667219A (en) * 2021-01-21 2021-04-16 中信银行股份有限公司 Code generation method and device, equipment and computer readable storage medium
CN113741893A (en) * 2021-08-02 2021-12-03 重庆长安汽车股份有限公司 JSON (Java Server object notation) -analysis-based open platform interface document automatic generation method and system
CN113836460A (en) * 2021-08-13 2021-12-24 深圳市明源云空间电子商务有限公司 mock data control method, equipment terminal and computer readable storage medium
CN114491191A (en) * 2022-01-29 2022-05-13 瀚云科技有限公司 A method, device, electronic device and storage medium for generating interface document
CN118034678A (en) * 2024-02-20 2024-05-14 北京三维天地科技股份有限公司 Interface integration method and system based on low-code development platform

Also Published As

Publication number Publication date
CN111694561B (en) 2024-10-25

Similar Documents

Publication Publication Date Title
CN111694561B (en) Interface management method, device, equipment and storage medium
CN113900958B (en) Test case script generation method, system, medium and electronic device
US11669503B2 (en) Building and managing data-processing attributes for modeled data sources
CN111930489B (en) Task scheduling method, device, equipment and storage medium
CN111221739A (en) Service testing method, device and system
CN109558525B (en) Test data set generation method, device, equipment and storage medium
CN111782117B (en) Interface display method and device, storage medium and electronic device
CN113792138B (en) Report generation method and device, electronic equipment and storage medium
CN112363699B (en) Interaction method and device applied to multi-language development platform
CN102866911B (en) Mashup application establishing method and device
CN111309317A (en) Code automation method and device for realizing data visualization
CN108073429A (en) A kind of means of payment collocation method, device, equipment and storage medium
CN113836014A (en) An interface testing method, device, electronic device and storage medium
CN108710708A (en) Report processing method, device, medium and electronic equipment
CN115016978A (en) Data verification method and device, computer storage medium and electronic equipment
CN116911240A (en) Command configuration method, device, equipment and media for electronic automation design software
CN111913922B (en) Binary structured log generation method, device, equipment and storage medium
CN116360735A (en) Form generation method, device, equipment and medium
CN113806556B (en) Method, device, equipment and medium for constructing knowledge graph based on power grid data
CN114296696B (en) Business function operation method and device, storage medium and electronic device
CN116382640A (en) Method, device, equipment and storage medium for managing micro-service
CN114780126A (en) Code updating method, device, equipment and medium for vehicle-mounted controller software
CN118972460A (en) Application processing method, medium, device and computing equipment
CN119127788A (en) Conversion method, device, equipment and storage medium
CN113419996A (en) Method, system, equipment and medium for converting metadata file

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20220930

Address after: 25 Financial Street, Xicheng District, Beijing 100033

Applicant after: CHINA CONSTRUCTION BANK Corp.

Address before: 25 Financial Street, Xicheng District, Beijing 100033

Applicant before: CHINA CONSTRUCTION BANK Corp.

Applicant before: Jianxin Financial Science and Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant