Movatterモバイル変換


[0]ホーム

URL:


CN110532107A - Interface call method, device, computer equipment and storage medium - Google Patents

Interface call method, device, computer equipment and storage medium
Download PDF

Info

Publication number
CN110532107A
CN110532107ACN201910662547.0ACN201910662547ACN110532107ACN 110532107 ACN110532107 ACN 110532107ACN 201910662547 ACN201910662547 ACN 201910662547ACN 110532107 ACN110532107 ACN 110532107A
Authority
CN
China
Prior art keywords
information
interface
target
keyword
return
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
CN201910662547.0A
Other languages
Chinese (zh)
Other versions
CN110532107B (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.)
Ping An Pay Electronic Payment Co.,Ltd.
Original Assignee
Pingan Payment Technology Service 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 Pingan Payment Technology Service Co LtdfiledCriticalPingan Payment Technology Service Co Ltd
Priority to CN201910662547.0ApriorityCriticalpatent/CN110532107B/en
Publication of CN110532107ApublicationCriticalpatent/CN110532107A/en
Application grantedgrantedCritical
Publication of CN110532107BpublicationCriticalpatent/CN110532107B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本申请实施例提供一种接口调用的方法、装置、计算机设备及存储介质。该方法包括:获取目标服务器的接口文档说明文件;从接口文档说明文件中提取接口参数信息、返回字段类型要求信息以及返回字段长度要求信息;根据接口调用程序获取接口调用参数;若接口调用参数与所述接口参数信息一致,将接口调用参数发送至目标服务器;获取目标服务器的返回信息,根据返回信息获取目标返回字段,并提取目标返回字段的类型信息和长度信息;若目标返回字段的类型信息与返回字段类型要求信息一致且目标返回字段的长度信息与返回字段长度要求信息一致,生成接口调用成功信息并输出所生成的接口调用成功信息。该方法基于功能测试技术,可显著提升测试开发效率。

Embodiments of the present application provide a method, an apparatus, a computer device, and a storage medium for an interface invocation. The method includes: obtaining an interface document description file of a target server; extracting interface parameter information, return field type requirement information and return field length requirement information from the interface document description file; obtaining interface calling parameters according to an interface calling program; The interface parameter information is consistent, and the interface calling parameters are sent to the target server; the return information of the target server is obtained, the target return field is obtained according to the return information, and the type information and length information of the target return field are extracted; if the type information of the target return field is Consistent with the return field type requirement information and the target return field length information is consistent with the return field length requirement information, generate interface call success information and output the generated interface call success information. This method is based on functional testing technology, which can significantly improve the efficiency of test development.

Description

Translated fromChinese
接口调用方法、装置、计算机设备及存储介质Interface calling method, apparatus, computer equipment and storage medium

技术领域technical field

本申请涉及计算机技术领域,尤其涉及一种接口调用方法、装置、计算机设备及存储介质。The present application relates to the field of computer technology, and in particular, to an interface calling method, apparatus, computer device, and storage medium.

背景技术Background technique

现有技术中,服务器提供接口调用的文档说明,调用方根据该文档说明编写调用程序,以根据该调用程序对服务器的相关接口进行调用以达到功能实现。但是在开发阶段,经常会出现服务器的接口实现方法与其所提供的文档说明不一致的情况,或者调用方所编写的调用程序与服务器的文档说明不一致,这就导致了开发和测试的难度较大。In the prior art, the server provides a document description of the interface invocation, and the caller writes a calling program according to the document description, so as to call the relevant interface of the server according to the calling program to achieve function realization. However, in the development stage, the interface implementation method of the server is often inconsistent with the documentation provided, or the calling program written by the caller is inconsistent with the documentation of the server, which makes development and testing more difficult.

发明内容SUMMARY OF THE INVENTION

本申请提供了一种接口调用方法、装置、计算机设备及存储介质,可实现对服务器进行接口调用中,便于确定接口调用是否成功以及出错情况。The present application provides an interface invocation method, device, computer equipment and storage medium, which can implement an interface invocation to a server, and facilitate the determination of whether the interface invocation is successful and an error condition.

第一方面,本申请提供了一种接口调用方法,其包括:获取目标服务器的接口文档说明文件;从所述接口文档说明文件中提取接口参数信息、返回字段类型要求信息以及返回字段长度要求信息;根据接口调用程序获取接口调用参数;判断所述接口调用参数与所述接口参数信息进行比对是否一致;若所述接口调用参数与所述接口参数信息一致,将所述接口调用参数发送至所述目标服务器;获取所述目标服务器的返回信息,根据所述返回信息获取目标返回字段,并提取所述目标返回字段的类型信息和长度信息;若所述目标返回字段的类型信息与所述返回字段类型要求信息一致且所述目标返回字段的长度信息与所述返回字段长度要求信息一致,生成接口调用成功信息并输出所生成的接口调用成功信息。In a first aspect, the present application provides an interface invocation method, which includes: acquiring an interface document description file of a target server; extracting interface parameter information, returning field type requirement information, and returning field length requirement information from the interface document description file ; Obtain interface calling parameters according to the interface calling program; judge whether the interface calling parameters are consistent with the interface parameter information when compared; if the interface calling parameters are consistent with the interface parameter information, send the interface calling parameters to the target server; obtain the return information of the target server, obtain the target return field according to the return information, and extract the type information and length information of the target return field; if the type information of the target return field is the same as the The returned field type requirement information is consistent and the length information of the target return field is consistent with the returned field length requirement information, the interface invocation success information is generated and the generated interface invocation success information is output.

第二方面,本申请提供了一种接口调用装置,其包括:第一获取单元,用于获取目标服务器的接口文档说明文件;第一提取单元,用于从所述接口文档说明文件中提取接口参数信息、返回字段类型要求信息以及返回字段长度要求信息;第二获取单元,用于根据接口调用程序获取接口调用参数;第一发送单元,用于判断所述接口调用参数与所述接口参数信息进行比对是否一致;若所述接口调用参数与所述接口参数信息一致,将所述接口调用参数发送至所述目标服务器;第二提取单元,用于获取所述目标服务器的返回信息,根据所述返回信息获取目标返回字段,并提取所述目标返回字段的类型信息和长度信息;第一提醒单元,用于若所述目标返回字段的类型信息与所述返回字段类型要求信息一致且所述目标返回字段的长度信息与所述返回字段长度要求信息一致,生成接口调用成功信息并输出所生成的接口调用成功信息。In a second aspect, the present application provides an interface invocation device, which includes: a first acquisition unit, configured to acquire an interface document description file of a target server; a first extraction unit, used to extract an interface from the interface document description file parameter information, return field type requirement information, and return field length requirement information; a second acquiring unit, used to acquire interface calling parameters according to an interface calling program; a first sending unit, used to determine the interface calling parameters and the interface parameter information Whether the comparison is consistent; if the interface calling parameters are consistent with the interface parameter information, send the interface calling parameters to the target server; the second extraction unit is used to obtain the return information of the target server, according to The return information obtains the target return field, and extracts the type information and length information of the target return field; the first reminder unit is used for if the type information of the target return field is consistent with the return field type requirement information and the The length information of the target return field is consistent with the length requirement information of the return field, the interface invocation success information is generated, and the generated interface invocation success information is output.

第三方面,本申请提供了一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现本申请提供的任一项所述的接口调用方法。In a third aspect, the present application provides a computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor implements the present invention when the processor executes the computer program Any one of the interface invocation methods provided by the application.

第四方面,本申请还提供了一种存储介质,其中所述存储介质存储有计算机程序,所述计算机程序当被处理器执行时使所述处理器执行本申请提供的任一项所述的接口调用方法。In a fourth aspect, the present application further provides a storage medium, wherein the storage medium stores a computer program, and when executed by a processor, the computer program causes the processor to execute any one of the methods provided in the present application. The interface calls the method.

本申请提供一种接口调用方法、装置、计算机设备及存储介质。该接口调用方法,获取目标服务器的接口文档说明文件;从所述接口文档说明文件中提取接口参数信息、返回字段类型要求信息以及返回字段长度要求信息;根据接口调用程序获取接口调用参数;判断所述接口调用参数与所述接口参数信息进行比对是否一致;若所述接口调用参数与所述接口参数信息一致,将所述接口调用参数发送至所述目标服务器;获取所述目标服务器的返回信息,根据所述返回信息获取目标返回字段,并提取所述目标返回字段的类型信息和长度信息;若所述目标返回字段的类型信息与所述返回字段类型要求信息一致且所述目标返回字段的长度信息与所述返回字段长度要求信息一致,生成接口调用成功信息并输出所生成的接口调用成功信息。该接口调用方法,可实现对服务器进行接口调用中,便于确定接口调用是否成功以及出错情况。The present application provides an interface calling method, apparatus, computer equipment and storage medium. The interface calling method obtains the interface document description file of the target server; extracts the interface parameter information, the return field type requirement information and the return field length requirement information from the interface document description file; obtains the interface calling parameters according to the interface calling program; Check whether the interface call parameters are consistent with the interface parameter information; if the interface call parameters are consistent with the interface parameter information, send the interface call parameters to the target server; obtain the return of the target server information, obtain the target return field according to the return information, and extract the type information and length information of the target return field; if the type information of the target return field is consistent with the return field type requirement information and the target return field The length information of the returned field is consistent with the length requirement information of the returned field, generates the interface invocation success information and outputs the generated interface invocation success information. The interface invocation method can implement the interface invocation to the server, which is convenient for determining whether the interface invocation is successful and the error condition.

附图说明Description of drawings

为了更清楚地说明本发明实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments. Obviously, the drawings in the following description are some embodiments of the present invention, which are of great significance to the art For those of ordinary skill, other drawings can also be obtained from these drawings without any creative effort.

图1为本申请实施例提供的接口调用方法的应用场景示意图;FIG. 1 is a schematic diagram of an application scenario of an interface calling method provided by an embodiment of the present application;

图2为本申请实施例提供的接口调用方法的流程示意图;2 is a schematic flowchart of an interface calling method provided by an embodiment of the present application;

图3为本申请又一实施例提供的接口调用方法的流程示意图;3 is a schematic flowchart of an interface calling method provided by another embodiment of the present application;

图4为本申请又一实施例提供的接口调用方法的流程示意图;FIG. 4 is a schematic flowchart of an interface calling method provided by another embodiment of the present application;

图5为本申请另一实施例提供的接口调用方法的子流程示意图;5 is a schematic sub-flow diagram of an interface calling method provided by another embodiment of the present application;

图6为本申请再一实施例提供的接口调用方法的子流程示意图;FIG. 6 is a schematic diagram of a sub-flow of an interface calling method provided by still another embodiment of the present application;

图7为本申请实施例提供的接口调用装置的示意性框图;7 is a schematic block diagram of an interface invocation apparatus provided by an embodiment of the present application;

图8为本申请又一实施例提供的接口调用装置的示意性框图;FIG. 8 is a schematic block diagram of an apparatus for invoking an interface provided by another embodiment of the present application;

图9为本申请又一实施例提供的接口调用装置的示意性框图;9 is a schematic block diagram of an apparatus for invoking an interface provided by another embodiment of the present application;

图10为本申请另一实施例提供的接口调用装置的示意性框图;FIG. 10 is a schematic block diagram of an apparatus for invoking an interface provided by another embodiment of the present application;

图11为本申请再一实施例提供的接口调用装置的示意性框图;FIG. 11 is a schematic block diagram of an apparatus for invoking an interface provided by still another embodiment of the present application;

图12为本申请实施例提供的计算机设备的示意性框图。FIG. 12 is a schematic block diagram of a computer device provided by an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”和“包含”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It is to be understood that, when used in this specification and the appended claims, the terms "comprising" and "comprising" indicate the presence of the described features, integers, steps, operations, elements and/or components, but do not exclude one or The presence or addition of a number of other features, integers, steps, operations, elements, components, and/or sets thereof.

还应当理解,在此本申请说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本申请。如在本申请说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。It should also be understood that the terminology used in the specification of the application herein is for the purpose of describing particular embodiments only and is not intended to limit the application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural unless the context clearly dictates otherwise.

还应当进一步理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should also be further understood that, as used in this specification and the appended claims, the term "and/or" refers to and including any and all possible combinations of one or more of the associated listed items .

请参阅图1,图1为本发明实施例提供的一种接口调用方法的应用场景示意图,所述应用场景包括:Please refer to FIG. 1. FIG. 1 is a schematic diagram of an application scenario of an interface calling method provided by an embodiment of the present invention. The application scenario includes:

(1)服务器,服务器用于提供传输接口文档说明文件的后端服务。服务器为一种计算机设备,可以为单台服务器或者服务器集群,也可以为云服务器,或者为专门的网页服务器,接收外部终端的访问,通过有线网络或者无线网络与终端连接。(1) The server, the server is used to provide the back-end service of the transmission interface document description file. A server is a computer device, which can be a single server or a server cluster, a cloud server, or a dedicated web server. It receives access from external terminals and connects to the terminal through a wired or wireless network.

(2)终端,图1所示终端包括终端1、终端2和终端3,所述终端通过访问服务器,从服务器上获取接口文档说明文件,在终端上,若接口调用参数与接口文档说明文件中的接口参数信息一致,通过该终端将接口调用参数发送至服务器。所述终端可以为智能手机、智能手表、笔记本电脑、平板电脑或者台式电脑等电子设备,终端通过有线网络或者无线网络访问服务器。(2) Terminal, the terminal shown in FIG. 1 includes terminal 1, terminal 2 and terminal 3. The terminal obtains the interface document description file from the server by accessing the server. On the terminal, if the interface calling parameters and the interface document description file are in the The interface parameter information is consistent, and the interface calling parameters are sent to the server through the terminal. The terminal may be an electronic device such as a smart phone, a smart watch, a notebook computer, a tablet computer or a desktop computer, and the terminal accesses the server through a wired network or a wireless network.

请参阅图2,图2是本申请实施例提供的接口调用方法的流程示意图。如图2所示,该接口调用方法包括步骤S110~S160。Please refer to FIG. 2 , which is a schematic flowchart of an interface calling method provided by an embodiment of the present application. As shown in FIG. 2, the interface calling method includes steps S110-S160.

S110、获取目标服务器的接口文档说明文件。S110: Obtain an interface document description file of the target server.

在本发明实施例中,目标服务器中对其所能提供的接口配置有相应的接口文档说明文件,本实施例通过终端获取目标服务器中的接口文档说明文件,所述终端可以为智能手机、智能手表、笔记本电脑、平板电脑或者台式电脑等电子设备,终端通过有线网络或者无线网络访问服务器;所述接口文档说明文件可以包括接口参数信息、返回字段类型要求信息以及返回字段长度要求信息。其中,所述接口参数信息指的是接口的基本参数信息,其主要包括接口所属功能、接口内容和接口名称等,接口所属功能如用于登录/注销的接口,接口内容如“登录”/“注销”,接口名称如“login”/“logout”;所述返回字段类型要求信息指的是接口针对返回参数对应的字段类型要求,例如:目的服务器的接口对应的接口配置规定接口返回参数对应的字段类型须为布尔型(boolean)、字节型(byte)、整型(int)、短整型(short)、长整型(long)或者单精度浮点型(float)等;所述返回字段长度要求信息指的是接口针对返回参数对应的字段长度要求,例如:目的服务器的接口对应的接口配置规定接口返回参数对应的字段长度为1个字节、2个字节、4个字节或者8个字节等。In this embodiment of the present invention, the target server is configured with a corresponding interface document description file for the interface it can provide. In this embodiment, the interface document description file in the target server is obtained through a terminal, and the terminal may be a smartphone, a For electronic devices such as watches, notebook computers, tablet computers or desktop computers, the terminal accesses the server through a wired network or wireless network; the interface document description file may include interface parameter information, return field type requirement information, and return field length requirement information. The interface parameter information refers to the basic parameter information of the interface, which mainly includes the function of the interface, the content of the interface, and the name of the interface. Logout", the interface name is such as "login"/"logout"; the returned field type requirement information refers to the field type requirement corresponding to the return parameter of the interface, for example: the interface configuration corresponding to the interface of the destination server specifies the corresponding return parameter of the interface The field type must be boolean, byte, int, short, long, or single-precision floating-point (float); the return The field length requirement information refers to the field length requirement of the interface for the return parameter. For example, the interface configuration corresponding to the interface of the destination server specifies that the field length corresponding to the interface return parameter is 1 byte, 2 bytes, or 4 bytes. Or 8 bytes etc.

S120、从所述接口文档说明文件中提取接口参数信息、返回字段类型要求信息以及返回字段长度要求信息。S120. Extract interface parameter information, return field type requirement information, and return field length requirement information from the interface document description file.

譬如,可通过对接口文档说明文件进行关键词提取,以获取接口参数信息、返回字段类型要求信息以及返回字段长度要求信息。其中,在本发明实施例中,所述终端可存储有预设的第一关键词数据库,通过对所述接口文档说明文件进行关键词识别,以获取到相应的关键词,并在所述接口文档说明文件中定位所述关键词的位置,根据所述关键词的位置在所述接口文档说明文件中进一步查找和提取所述接口参数信息、所述返回字段类型要求信息以及所述返回字段长度要求信息。For example, the interface parameter information, the returned field type requirement information, and the returned field length requirement information can be obtained by performing keyword extraction on the interface document description file. Wherein, in this embodiment of the present invention, the terminal may store a preset first keyword database, and by performing keyword identification on the interface document description file, the corresponding keywords are obtained, and the corresponding keywords are obtained on the interface. Locate the position of the keyword in the document description file, and further search and extract the interface parameter information, the return field type requirement information and the return field length in the interface document description file according to the position of the keyword Request information.

参见图3,其为本发明另一实施例提供的接口调用方法的子流程示意图。如图所示,所述步骤S120包括子步骤S1200~S1203。Referring to FIG. 3 , it is a schematic diagram of a sub-flow of an interface calling method provided by another embodiment of the present invention. As shown in the figure, the step S120 includes sub-steps S1200-S1203.

S1200、根据预设的第一关键词数据库,对所述接口文档说明文件进行关键词识别以获取第一关键词组,所述第一关键词组包括多个第一关键词。S1200. Perform keyword identification on the interface document description file according to a preset first keyword database to obtain a first keyword group, where the first keyword group includes a plurality of first keywords.

在本发明实施例中,所述终端包括有预设的第一关键词数据库,以便于对所述接口文档说明文件进行关键词识别,以获取第一关键词组,具体的,该第一关键词数据库包括接口各类参数信息、接口各类返回字段类型要求信息以及接口各类返回字段长度要求信息,以方便对应各种关键词,第一关键词数据库通过接收接口文档说明文件对应的接口参数信息、返回字段类型要求信息以及返回字段长度要求信息,利用第一关键词数据库对所接收到的接口参数信息、返回字段类型要求信息以及返回字段长度要求信息进行识别,在识别之前,依次分别从所接收到的接口参数信息、返回字段类型要求信息以及返回字段长度要求信息中第一个字开始拆分出多个分词,将拆分得到的多个分词经由所述第一关键词数据库依次进行对比,查询所述第一关键词数据库中是否存在该分词,若是,则提取出该分词并将该分词作为第一关键词,最后,将识别得到的多个分词组成所述第一关键词组,其中,所述第一关键词组包括多个第一关键词,所述第一关键词组可包括“接口内容”、“接口名称”以及“字段类型”等关键词。In the embodiment of the present invention, the terminal includes a preset first keyword database, so as to perform keyword identification on the interface document description file to obtain a first keyword group, specifically, the first keyword The database includes various types of parameter information of the interface, type requirements information of various types of returned fields of the interface, and information of the length requirements of various types of returned fields of the interface, so as to facilitate corresponding various keywords. The first keyword database receives the interface parameter information corresponding to the interface document description file. , return field type requirement information and return field length requirement information, use the first keyword database to identify the received interface parameter information, return field type requirement information and return field length requirement information, before identifying, sequentially from all The received interface parameter information, the returned field type requirement information, and the returned field length requirement information are split into multiple word segments starting from the first word, and the split multiple word segments are sequentially compared through the first keyword database , query whether the word segment exists in the first keyword database, if so, extract the word segment and use the segment as the first keyword, and finally, form the first keyword group with the identified multiple word segments, wherein , the first keyword group includes a plurality of first keywords, and the first keyword group may include keywords such as "interface content", "interface name", and "field type".

S1201、获取所述第一关键词组中与第一预设关键字一致的第一关键词作为第一目标关键词,并获取所述第一目标关键词在所述接口文档说明文件的第一位置信息,根据所述第一位置信息在所述接口文档说明文件中获取所述接口参数信息。S1201. Acquire a first keyword in the first keyword group that is consistent with a first preset keyword as a first target keyword, and acquire a first position of the first target keyword in the interface document description file information, and obtain the interface parameter information from the interface document description file according to the first location information.

在本发明实施例中,所述终端存储有第一预设关键字,用于确定所述接口参数信息。通过获取所述第一关键词组中与第一预设关键字一致的第一关键词作为第一目标关键词,并获取所述第一目标关键词在所述接口文档说明文件的第一位置信息,根据所述第一位置信息在所述接口文档说明文件中获取所述接口参数信息,其中,所述第一位置信息指的是所获取的第一目标关键词所处段落位于所述接口文档说明文件的段落位置信息和所述第一目标关键词位于所属段落的分词位置信息;也就是说,所述第一目标关键词所处的段落在所述接口文档说明文件中的标号,例如,所述段落为第一段,那么段落位置信息为1,所述段落为第三段,那么段落位置信息为3。所述分词位置信息指的是所述第一目标关键词在其属于的段落中的位置;也就是说,所述第一目标关键词是所述段落中的第几个词,例如,所述第一目标关键词是段落中的第5个词,那么第一目标关键词位置信息为5,第一目标关键词是段落中的第8个词,那么第一目标关键词位置信息为8。最后,根据所述第一位置信息在所述接口文档说明文件中获取所述接口参数信息。In this embodiment of the present invention, the terminal stores a first preset keyword, which is used to determine the interface parameter information. By acquiring the first keyword in the first keyword group that is consistent with the first preset keyword as the first target keyword, and acquiring the first position information of the first target keyword in the interface document description file , obtain the interface parameter information in the interface document description file according to the first location information, where the first location information refers to the paragraph where the acquired first target keyword is located in the interface document The paragraph position information of the description file and the word segmentation position information of the paragraph where the first target keyword is located; that is, the label of the paragraph where the first target keyword is located in the interface document description file, for example, If the paragraph is the first paragraph, then the paragraph position information is 1; if the paragraph is the third paragraph, then the paragraph position information is 3. The word segmentation position information refers to the position of the first target keyword in the paragraph to which it belongs; that is, the first target keyword is the number of words in the paragraph, for example, the If the first target keyword is the 5th word in the paragraph, the position information of the first target keyword is 5, and the first target keyword is the 8th word in the paragraph, then the position information of the first target keyword is 8. Finally, the interface parameter information is acquired from the interface document description file according to the first location information.

S1202、获取所述第一关键词组中与第二预设关键字一致的第一关键词作为第二目标关键词,并获取所述第二目标关键词在所述接口文档说明文件的第二位置信息,根据所述第二位置信息在所述接口文档说明文件中获取所述返回字段类型要求信息。S1202: Acquire a first keyword in the first keyword group that is consistent with a second preset keyword as a second target keyword, and acquire the second target keyword in a second position of the interface document description file information, and obtain the returned field type requirement information from the interface document description file according to the second location information.

在本发明实施例中,所述终端存储有第二预设关键字,用于确定所述返回字段类型要求信息。通过获取所述第一关键词组中与第二预设关键字一致的第一关键词作为第二目标关键词,并获取所述第二目标关键词在所述接口文档说明文件的第二位置信息,根据所述第二位置信息在所述接口文档说明文件中获取所述返回字段类型要求信息。其中,所述第二位置信息指的是所获取的第二目标关键词所处段落位于所述接口文档说明文件的段落位置信息和所述第二目标关键词位于所属段落的分词位置信息;也就是说,所述第二目标关键词所处的段落在所述接口文档说明文件中的标号,例如,所述段落为第二段,那么段落位置信息为2,所述段落为第四段,那么段落位置信息为4。所述分词位置信息指的是所述第二目标关键词在其属于的段落中的位置;也就是说,所述第二目标关键词是所述段落中的第几个词,例如,所述第二目标关键词是段落中的第8个词,那么第二目标关键词位置信息为8,第二目标关键词是段落中的第10个词,那么第二目标关键词位置信息为10。最后,根据所述第二位置信息在所述接口文档说明文件中获取所述返回字段类型要求信息。In this embodiment of the present invention, the terminal stores a second preset keyword, which is used to determine the returned field type requirement information. By acquiring the first keyword in the first keyword group that is consistent with the second preset keyword as the second target keyword, and acquiring the second position information of the second target keyword in the interface document description file , and obtain the returned field type requirement information from the interface document description file according to the second location information. Wherein, the second position information refers to the obtained paragraph position information of the second target keyword in the paragraph of the interface document description file and the word segmentation position information of the second target keyword in the paragraph; also That is to say, the label of the paragraph where the second target keyword is located in the interface document description file, for example, if the paragraph is the second paragraph, then the paragraph position information is 2, and the paragraph is the fourth paragraph, Then the paragraph position information is 4. The word segmentation position information refers to the position of the second target keyword in the paragraph to which it belongs; that is, the second target keyword is the number of words in the paragraph, for example, the The second target keyword is the 8th word in the paragraph, then the position information of the second target keyword is 8, and the second target keyword is the 10th word in the paragraph, then the position information of the second target keyword is 10. Finally, the returned field type requirement information is acquired from the interface document description file according to the second location information.

S1203、获取所述第一关键词组中与第三预设关键字一致的第一关键词作为第三目标关键词,并获取所述第三目标关键词在所述接口文档说明文件的第三位置信息,根据所述第三位置信息在所述接口文档说明文件中获取所述返回字段长度要求信息。S1203: Acquire a first keyword in the first keyword group that is consistent with a third preset keyword as a third target keyword, and acquire the third target keyword in a third position of the interface document description file information, and obtain the returned field length requirement information from the interface document description file according to the third position information.

在本发明实施例中,所述终端存储有第三预设关键字,用于确定所述返回字段长度要求信息。通过获取所述第一关键词组中与第三预设关键字一致的第一关键词作为第三目标关键词,并获取所述第三目标关键词在所述接口文档说明文件的第三位置信息,根据所述第三位置信息在所述接口文档说明文件中获取所述返回字段长度要求信息。其中,所述第三位置信息指的是所获取的第三目标关键词所处段落位于所述接口文档说明文件的段落位置信息和所述第三目标关键词位于所属段落的分词位置信息;也就是说,所述第三目标关键词所处的段落在所述接口文档说明文件中的标号,例如,所述段落为第五段,那么段落位置信息为5,所述段落为第八段,那么段落位置信息为8。所述分词位置信息指的是所述第三目标关键词在其属于的段落中的位置;也就是说,所述第三目标关键词是所述段落中的第几个词,例如,所述第三目标关键词是段落中的第12个词,那么第三目标关键词位置信息为12,第三目标关键词是段落中的第16个词,那么第三目标关键词位置信息为16。最后,根据所述第三位置信息在所述接口文档说明文件中获取所述返回字段长度要求信息。In this embodiment of the present invention, the terminal stores a third preset keyword, which is used to determine the returned field length requirement information. By acquiring the first keyword in the first keyword group that is consistent with the third preset keyword as the third target keyword, and acquiring the third position information of the third target keyword in the interface document description file , and obtain the returned field length requirement information from the interface document description file according to the third position information. Wherein, the third position information refers to the obtained paragraph position information of the third target keyword in the paragraph of the interface document description file and the word segmentation position information of the third target keyword in the paragraph; also That is to say, the label of the paragraph where the third target keyword is located in the interface document description file, for example, if the paragraph is the fifth paragraph, then the paragraph position information is 5, and the paragraph is the eighth paragraph, Then the paragraph position information is 8. The word segmentation position information refers to the position of the third target keyword in the paragraph to which it belongs; that is, the third target keyword is the number of words in the paragraph, for example, the The third target keyword is the 12th word in the paragraph, then the position information of the third target keyword is 12, and the third target keyword is the 16th word in the paragraph, then the position information of the third target keyword is 16. Finally, the returned field length requirement information is obtained from the interface document description file according to the third position information.

S130、根据接口调用程序获取接口调用参数。S130. Obtain interface calling parameters according to the interface calling program.

在本发明实施例中,所述接口调用程序存储在终端中,针对目标服务器提供的接口,根据终端上的接口调用程序获取接口调用参数。具体的,通过执行所述接口调用程序向所述目标服务器中的接口发起接口参数调用请求,该调用请求的格式为JSON串格式,目标服务器中的接口接收到终端的调用请求后,对调用请求进行检验,例如:检验该调用请求是否格式正确,若格式不正确,则返回错识代码给终端,若格式正确,所述目标服务器中的接口将该调用请求写入文件服务器中,并生成接口调用参数,所述接口调用参数可以包括:接口所属功能、接口内容和接口名称等,接口调用程序将所生成的接口调用参数返回至终端。In the embodiment of the present invention, the interface calling program is stored in the terminal, and for the interface provided by the target server, the interface calling parameters are obtained according to the interface calling program on the terminal. Specifically, by executing the interface invocation program, an interface parameter invocation request is initiated to the interface in the target server, and the format of the invocation request is JSON string format. Check, for example: check whether the calling request is in the correct format, if the format is incorrect, return the error code to the terminal, if the format is correct, the interface in the target server writes the calling request into the file server, and generates an interface Calling parameters, the interface calling parameters may include: the function to which the interface belongs, the content of the interface, and the name of the interface, etc. The interface calling program returns the generated interface calling parameters to the terminal.

S140、判断所述接口调用参数与所述接口参数信息是否一致;若所述接口调用参数与所述接口参数信息一致,将所述接口调用参数发送至所述目标服务器。S140. Determine whether the interface invocation parameters are consistent with the interface parameter information; if the interface invocation parameters are consistent with the interface parameter information, send the interface invocation parameters to the target server.

在本发明实施例中,对接口调用参数与从所述接口文档说明文件中提取的所述接口参数信息进行比对,若所述接口调用参数与所述接口参数信息一致,将所述接口调用参数发送至所述目标服务器以对所述目标服务器的相应接口进行调用。In this embodiment of the present invention, the interface calling parameters are compared with the interface parameter information extracted from the interface documentation description file, and if the interface calling parameters are consistent with the interface parameter information, the interface calling parameters are Parameters are sent to the target server to invoke the corresponding interface of the target server.

S150、获取所述目标服务器的返回信息,根据所述返回信息获取目标返回字段,并提取所述目标返回字段的类型信息和长度信息。S150. Acquire return information of the target server, acquire a target return field according to the return information, and extract type information and length information of the target return field.

在本发明实施例中,所述目标服务器根据终端发送的接口调用参数执行相应接口的功能实现,生成返回信息,并将所述返回信息发送至所述终端。通过对所述返回信息进行查找,可获取目标返回字段。其中,所述终端可存储有预设的第二关键词数据库,通过对所述返回信息进行关键词识别,可获取相应的关键词,并确定所述关键词在所述返回信息中的位置,根据所述关键词的位置在所述返回信息中进一步查找和提取所述目标返回字段,并提取所述目标返回字段的类型信息和长度信息,所述目标返回字段的类型信息可以包括布尔型(boolean)、字节型(byte)、整型(int)、短整型(short)、长整型(long)或者单精度浮点型(float)等,在本实施例中,例如所述目标返回字段的类型信息为字节型,目标返回字段为B,目标返回字段的长度为1个字节。In the embodiment of the present invention, the target server executes the function realization of the corresponding interface according to the interface calling parameters sent by the terminal, generates return information, and sends the return information to the terminal. By searching the returned information, the target return field can be obtained. Wherein, the terminal may store a preset second keyword database, and by performing keyword identification on the returned information, a corresponding keyword may be obtained, and the position of the keyword in the returned information may be determined, According to the position of the keyword, the target return field is further searched and extracted from the return information, and the type information and length information of the target return field are extracted, and the type information of the target return field may include Boolean ( boolean), byte (byte), integer (int), short integer (short), long integer (long) or single-precision floating point (float), etc. In this embodiment, for example, the target The type information of the return field is byte type, the target return field is B, and the length of the target return field is 1 byte.

参见图4,其为本发明再一实施例提供的接口调用方法的子流程示意图。如图所示,所述步骤S150包括子步骤S1500和S1501。Referring to FIG. 4 , it is a schematic diagram of a sub-flow of an interface calling method provided by still another embodiment of the present invention. As shown in the figure, the step S150 includes sub-steps S1500 and S1501.

S1500、根据预设的第二关键词数据库,对所述目标服务器的返回信息进行关键词识别以获取第二关键词组,所述第二关键词组包括多个第二关键词。S1500. According to a preset second keyword database, perform keyword identification on the returned information of the target server to obtain a second keyword group, where the second keyword group includes a plurality of second keywords.

在本发明实施例中,所述终端包括有预设的第二关键词数据库,以便于对所述返回信息进行关键词识别,以获取第二关键词组,具体的,该第二关键词数据库包括接口各类返回信息,以方便对应各种关键词,第二关键词数据库通过接收目标服务器的返回信息,利用第二关键词数据库对所接收到的返回信息进行识别,在识别之前,依次分别从所接收到的返回信息中第一个字开始拆分出多个分词,将拆分得到的多个分词经由所述第二关键词数据库依次进行对比,查询所述第二关键词数据库中是否存在该分词,若是,则提取出该分词并将该分词作为第二关键词,最后,将识别得到的多个分词组成所述第二关键词组,其中,所述第二关键词组包括多个第二关键词。In this embodiment of the present invention, the terminal includes a preset second keyword database, so as to perform keyword identification on the returned information to obtain a second keyword group. Specifically, the second keyword database includes Interface various types of return information to facilitate corresponding various keywords. The second keyword database uses the second keyword database to identify the received return information by receiving the return information from the target server. In the received return information, the first word starts to split into multiple word segments, and the multiple word segments obtained by splitting are sequentially compared through the second keyword database, and it is inquired whether there are any existing words in the second keyword database. The word segmentation, if yes, extract the word segmentation and use the word segmentation as the second keyword, and finally, form the second keyword group with the identified multiple word segmentations, wherein the second keyword group includes a plurality of second keyword groups. Key words.

S1501、获取所述第二关键词组中与第四预设关键字一致的第二关键词作为第四目标关键词,并获取所述第四目标关键词在所述返回信息的第四位置信息,根据所述第四位置信息在所述返回信息中获取所述目标返回字段。S1501. Acquire a second keyword in the second keyword group that is consistent with a fourth preset keyword as a fourth target keyword, and acquire fourth position information of the fourth target keyword in the returned information, The target return field is acquired in the return information according to the fourth position information.

在本发明实施例中,所述终端存储有第四预设关键字,用于确定所述目标返回字段。通过获取所述第二关键词组中与第四预设关键字一致的第二关键词作为第四目标关键词,并获取所述第四目标关键词在所述返回信息的第四位置信息,根据所述第四位置信息在所述返回信息中获取所述目标返回字段。其中,所述第四位置信息指的是所获取的第四目标关键词所处段落位于所述返回信息的段落位置信息和所述第四目标关键词位于所属段落的分词位置信息;也就是说,所述第四目标关键词所处的段落在所述返回信息中的标号,例如,所述段落为第六段,那么段落位置信息为6,所述段落为第十段,那么段落位置信息为10。所述分词位置信息指的是所述第四目标关键词在其属于的段落中的位置;也就是说,所述第四目标关键词是所述段落中的第几个词,例如,所述第四目标关键词是段落中的第13个词,那么第四目标关键词位置信息为13,第四目标关键词是段落中的第15个词,那么第四目标关键词位置信息为15。最后,根据所述第四位置信息在所述返回信息中获取所述目标返回字段。In this embodiment of the present invention, the terminal stores a fourth preset keyword, which is used to determine the target return field. By acquiring the second keyword in the second keyword group that is consistent with the fourth preset keyword as the fourth target keyword, and acquiring the fourth position information of the fourth target keyword in the returned information, according to The fourth location information acquires the target return field in the return information. Wherein, the fourth position information refers to the obtained paragraph position information of the paragraph where the fourth target keyword is located in the returned information and the word segmentation position information of the paragraph where the fourth target keyword is located; that is, , the label of the paragraph where the fourth target keyword is located in the returned information, for example, if the paragraph is the sixth paragraph, then the paragraph position information is 6, and the paragraph is the tenth paragraph, then the paragraph position information is 10. The word segmentation position information refers to the position of the fourth target keyword in the paragraph to which it belongs; that is, the fourth target keyword is the number of words in the paragraph, for example, the The fourth target keyword is the thirteenth word in the paragraph, then the fourth target keyword position information is 13, and the fourth target keyword is the 15th word in the paragraph, then the fourth target keyword position information is 15. Finally, the target return field is acquired in the return information according to the fourth position information.

参见图5,其为本发明又一实施例提供的接口调用方法的流程示意图。如图所示,在所述步骤S160之前,所述方法还包括S160a。Referring to FIG. 5, it is a schematic flowchart of an interface calling method provided by another embodiment of the present invention. As shown in the figure, before the step S160, the method further includes S160a.

S160a、判断分别对所述目标返回字段的类型信息与所述返回字段类型要求信息进行比对以及对所述目标返回字段的长度信息与所述返回字段长度要求信息进行比对是否均比对一致。S160a. Determine whether the comparison between the type information of the target return field and the return field type requirement information and the comparison between the length information of the target return field and the return field length requirement information are all consistent .

S160、若所述目标返回字段的类型信息与所述返回字段类型要求信息一致且所述目标返回字段的长度信息与所述返回字段长度要求信息一致,生成接口调用成功信息并输出所生成的接口调用成功信息。S160. If the type information of the target return field is consistent with the return field type requirement information and the length information of the target return field is consistent with the return field length requirement information, generate interface invocation success information and output the generated interface Call success information.

在本发明实施例中,通过获取目标返回字段的类型信息和长度信息,并将所述目标返回字段的类型信息与从所述接口文档说明文件中提取的所述返回字段类型要求信息进行比对,将所述目标返回字段的长度信息与从所述接口文档说明文件中提取的所述返回字段长度要求信息进行比对,若均获得比对一致信息,则生成接口调用成功信息并输出所生成的接口调用成功信息,以对终端的用户进行提醒。In this embodiment of the present invention, the type information and length information of the target return field are acquired, and the type information of the target return field is compared with the return field type requirement information extracted from the interface document description file. , compare the length information of the target return field with the length requirement information of the return field extracted from the interface document description file, and if both obtain consistent information, generate the interface call success information and output the generated API call success information to remind the user of the terminal.

S180、若所述目标返回字段的类型信息与所述返回字段类型要求信息不一致和/或所述目标返回字段的长度信息与所述返回字段长度要求信息不一致,生成接口调用返回字段错误提示信息并输出所生成的接口调用参数错误提示信息。S180. If the type information of the target return field is inconsistent with the return field type requirement information and/or the length information of the target return field is inconsistent with the return field length requirement information, generate an interface call return field error message and Output the generated interface call parameter error message.

在本发明实施例中,通过获取目标返回字段的类型信息和长度信息,并将所述目标返回字段的类型信息与从所述接口文档说明文件中提取的所述返回字段类型要求信息进行比对,将所述目标返回字段的长度信息与从所述接口文档说明文件中提取的所述返回字段长度要求信息进行比对,若存在比对不一致信息,则生成接口调用返回字段错误提示信息并输出所生成的接口调用参数错误提示信息,以对终端的用户进行提醒。In this embodiment of the present invention, the type information and length information of the target return field are acquired, and the type information of the target return field is compared with the return field type requirement information extracted from the interface document description file. , compare the length information of the target return field with the length requirement information of the return field extracted from the interface document description file, and if there is inconsistent information in the comparison, generate and output the interface call return field error message The generated interface calls parameter error prompt information to remind the terminal user.

参见图6,其为本发明又一实施例提供的接口调用方法的流程示意图。如图所示,所述方法还包括S170:Referring to FIG. 6 , which is a schematic flowchart of an interface calling method provided by another embodiment of the present invention. As shown in the figure, the method further includes S170:

S170、若所述接口调用参数与所述接口参数信息不一致,生成接口调用参数错误提示信息并输出所生成的接口调用参数错误提示信息。S170. If the interface calling parameters are inconsistent with the interface parameter information, generate interface calling parameter error prompt information and output the generated interface calling parameter error prompt information.

在本发明实施例中,通过对接口调用参数与从所述接口文档说明文件中提取的所述接口参数信息进行比对,若所述接口调用参数与所述接口参数信息不一致,生成比对不一致信息,则生成接口调用参数错误提示信息并输出所生成的接口调用参数错误提示信息以对所述终端的用户进行提醒,以便于用户对接口调用程序进行修改以更正接口调用参数。In the embodiment of the present invention, by comparing the interface calling parameters with the interface parameter information extracted from the interface documentation description file, if the interface calling parameters are inconsistent with the interface parameter information, the generated comparison is inconsistent. information, then generate the interface call parameter error prompt information and output the generated interface call parameter error prompt information to remind the user of the terminal, so that the user can modify the interface call program to correct the interface call parameters.

参见图7,其为本申请实施例提供的接口调用装置的示意性框图。如图所示,本申请提出的接口调用装置200,包括:第一获取单元210、第一提取单元220、第二获取单元230、第一发送单元240、第二提取单元250以及第一提醒单元260。Referring to FIG. 7 , which is a schematic block diagram of an apparatus for invoking an interface provided by an embodiment of the present application. As shown in the figure, the interface invocation apparatus 200 proposed in this application includes: a first acquiring unit 210, a first extracting unit 220, a second acquiring unit 230, a first sending unit 240, a second extracting unit 250, and a first reminding unit 260.

第一获取单元210,用于获取目标服务器的接口文档说明文件。The first obtaining unit 210 is configured to obtain the interface document description file of the target server.

第一提取单元220,用于从所述接口文档说明文件中提取接口参数信息、返回字段类型要求信息以及返回字段长度要求信息。The first extracting unit 220 is configured to extract interface parameter information, return field type requirement information and return field length requirement information from the interface document description file.

第二获取单元230,用于根据接口调用程序获取接口调用参数。The second obtaining unit 230 is configured to obtain the interface calling parameters according to the interface calling program.

第一发送单元240,用于判断所述接口调用参数与所述接口参数信息是否一致;若所述接口调用参数与所述接口参数信息一致,将所述接口调用参数发送至所述目标服务器。The first sending unit 240 is configured to determine whether the interface calling parameters are consistent with the interface parameter information; if the interface calling parameters are consistent with the interface parameter information, send the interface calling parameters to the target server.

第二提取单元250,用于获取所述目标服务器的返回信息,根据所述返回信息获取目标返回字段,并提取所述目标返回字段的类型信息和长度信息。The second extracting unit 250 is configured to obtain the return information of the target server, obtain the target return field according to the return information, and extract the type information and length information of the target return field.

第一提醒单元260,用于若所述目标返回字段的类型信息与所述返回字段类型要求信息一致且所述目标返回字段的长度信息与所述返回字段长度要求信息一致,生成接口调用成功信息并输出所生成的接口调用成功信息。The first reminding unit 260 is configured to generate interface invocation success information if the type information of the target return field is consistent with the return field type requirement information and the length information of the target return field is consistent with the return field length requirement information And output the generated interface call success information.

参见图8,其为本申请又一实施例提供的接口调用装置的示意性框图。如图所示,本申请提出的接口调用装置200,包括:第一获取单元210、第一提取单元220、第二获取单元230、第一发送单元240、第二提取单元250、第一提醒单元260以及第二提醒单元270。其中,除第二提醒单元270以外,其他单元在上述实施例中已有描述,此处不再赘述。Referring to FIG. 8 , which is a schematic block diagram of an apparatus for invoking an interface provided by another embodiment of the present application. As shown in the figure, the interface invocation device 200 proposed in this application includes: a first obtaining unit 210, a first extracting unit 220, a second obtaining unit 230, a first sending unit 240, a second extracting unit 250, and a first reminding unit 260 and the second reminder unit 270. Among them, except for the second reminding unit 270, other units have been described in the above-mentioned embodiments, and will not be repeated here.

第二提醒单元270,用于若所述接口调用参数与所述接口参数信息不一致,生成接口调用参数错误提示信息并输出所生成的接口调用参数错误提示信息。The second reminding unit 270 is configured to generate interface calling parameter error prompt information and output the generated interface call parameter error prompt information if the interface calling parameter is inconsistent with the interface parameter information.

参见图9,其为本申请又一实施例提供的接口调用装置的示意性框图。如图所示,本申请提出的接口调用装置200,包括:第一获取单元210、第一提取单元220、第二获取单元230、第一发送单元240、第二提取单元250、第二判断单元260a、第一提醒单元260以及第三提醒单元280。其中,除第二判断单元260a和第三提醒单元280以外,其他单元在上述实施例中已有描述,此处不再赘述。Referring to FIG. 9 , which is a schematic block diagram of an apparatus for invoking an interface provided by another embodiment of the present application. As shown in the figure, the interface invocation apparatus 200 proposed in this application includes: a first obtaining unit 210, a first extracting unit 220, a second obtaining unit 230, a first sending unit 240, a second extracting unit 250, and a second judging unit 260a, the first reminding unit 260 and the third reminding unit 280. Among them, except for the second judgment unit 260a and the third reminder unit 280, other units have been described in the above embodiments, and will not be repeated here.

第二判断单元260a,用于判断分别对所述目标返回字段的类型信息与所述返回字段类型要求信息进行比对以及对所述目标返回字段的长度信息与所述返回字段长度要求信息进行比对是否均比对一致。The second judging unit 260a is configured to judge respectively to compare the type information of the target return field with the return field type requirement information and to compare the length information of the target return field with the return field length requirement information. Whether the pairs are all aligned.

第三提醒单元280,用于若所述目标返回字段的类型信息与所述返回字段类型要求信息不一致和/或所述目标返回字段的长度信息与所述返回字段长度要求信息不一致,生成接口调用返回字段错误提示信息。The third reminding unit 280 is configured to generate an interface call if the type information of the target return field is inconsistent with the return field type requirement information and/or the length information of the target return field is inconsistent with the return field length requirement information Returns the field error message.

参见图10,其为本申请另一实施例提供的接口调用装置的示意性框图。如图所示,本申请提出的接口调用装置200,包括:第一获取单元210、第一提取单元220、第二获取单元230、第一发送单元240、第二提取单元250以及第一提醒单元260,其中,所述第一提取单元220包括关键词识别单元2200、接口参数信息获取单元2201、返回字段类型要求信息获取单元2202以及返回字段长度要求信息获取单元2203。Referring to FIG. 10 , which is a schematic block diagram of an apparatus for invoking an interface provided by another embodiment of the present application. As shown in the figure, the interface invocation apparatus 200 proposed in this application includes: a first acquiring unit 210, a first extracting unit 220, a second acquiring unit 230, a first sending unit 240, a second extracting unit 250, and a first reminding unit 260, wherein the first extraction unit 220 includes a keyword identification unit 2200, an interface parameter information acquisition unit 2201, a return field type requirement information acquisition unit 2202, and a return field length requirement information acquisition unit 2203.

第一关键词组获取单元2200,用于根据预设的第一关键词数据库,对所述接口文档说明文件进行关键词识别以获取第一关键词组,所述第一关键词组包括多个第一关键词。The first keyword group obtaining unit 2200 is configured to perform keyword identification on the interface document description file according to a preset first keyword database to obtain a first keyword group, where the first keyword group includes a plurality of first keywords word.

接口参数信息获取单元2201,用于获取所述第一关键词组中与第一预设关键字一致的第一关键词作为第一目标关键词,并获取所述第一目标关键词在所述接口文档说明文件的第一位置信息,根据所述第一位置信息在所述接口文档说明文件中获取所述接口参数信息。The interface parameter information obtaining unit 2201 is configured to obtain the first keyword in the first keyword group that is consistent with the first preset keyword as the first target keyword, and obtain the first target keyword in the interface The first location information of the document description file, and the interface parameter information is obtained from the interface documentation description file according to the first location information.

返回字段类型要求信息获取单元2202,用于获取所述第一关键词组中与第二预设关键字一致的第一关键词作为第二目标关键词,并获取所述第二目标关键词在所述接口文档说明文件的第二位置信息,根据所述第二位置信息在所述接口文档说明文件中获取所述返回字段类型要求信息。The return field type requirement information obtaining unit 2202 is configured to obtain the first keyword in the first keyword group that is consistent with the second preset keyword as the second target keyword, and obtain the location of the second target keyword in the The second location information of the interface document description file is obtained, and the returned field type requirement information is obtained in the interface document description file according to the second location information.

返回字段长度要求信息获取单元2203,用于获取所述第一关键词组中与第三预设关键字一致的第一关键词作为第三目标关键词,并获取所述第三目标关键词在所述接口文档说明文件的第三位置信息,根据所述第三位置信息在所述接口文档说明文件中获取所述返回字段长度要求信息。The return field length requirement information obtaining unit 2203 is configured to obtain the first keyword in the first keyword group that is consistent with the third preset keyword as the third target keyword, and obtain the third target keyword in the The third position information of the interface document description file is obtained, and the returned field length requirement information is obtained in the interface document description file according to the third position information.

参见图11,其为本申请再一实施例提供的接口调用装置的示意性框图。如图所示,本申请提出的接口调用装置200,包括:第一获取单元210、第一提取单元220、第二获取单元230、第一发送单元240、第二提取单元250以及第一提醒单元260,其中,所述第二提取单元250包括第二关键词组获取单元2500和目标返回字段获取单元2501。Referring to FIG. 11 , which is a schematic block diagram of an apparatus for invoking an interface provided by yet another embodiment of the present application. As shown in the figure, the interface invocation apparatus 200 proposed in this application includes: a first acquiring unit 210, a first extracting unit 220, a second acquiring unit 230, a first sending unit 240, a second extracting unit 250, and a first reminding unit 260, wherein the second extraction unit 250 includes a second keyword group acquisition unit 2500 and a target return field acquisition unit 2501.

第二关键词组获取单元2500,用于根据预设的第二关键词数据库,对所述目标服务器的返回信息进行关键词识别以获取第二关键词组,所述第二关键词组包括多个第二关键词。The second keyword group obtaining unit 2500 is configured to perform keyword identification on the returned information of the target server according to a preset second keyword database to obtain a second keyword group, where the second keyword group includes a plurality of second keyword groups. Key words.

目标返回字段获取单元2501,用于获取所述第二关键词组中与第四预设关键字一致的第二关键词作为第四目标关键词,并获取所述第四目标关键词在所述返回信息的第四位置信息,根据所述第四位置信息在所述返回信息中获取所述目标返回字段。The target return field obtaining unit 2501 is used to obtain the second keyword consistent with the fourth preset keyword in the second keyword group as the fourth target keyword, and obtain the fourth target keyword in the return The fourth position information of the information, the target return field is acquired in the return information according to the fourth position information.

上述接口调用装置可以实现为一种计算机程序的形式,该计算机程序可以在如图12所示的计算机设备上运行。The above-mentioned interface invoking apparatus can be implemented in the form of a computer program, and the computer program can be executed on the computer device as shown in FIG. 12 .

请参阅图12,图12是本申请实施例提供的计算机设备的示意性框图。该计算机设备300设备可以是终端。参阅图12,该计算机设备300包括通过系统总线301连接的处理器302、存储器和网络接口305,其中,存储器可以包括非易失性存储介质303和内存储器304。该非易失性存储介质303可存储操作系统3031和计算机程序3032。该计算机程序3032包括程序指令,该程序指令被执行时,可使得处理器302执行一种接口调用方法。该处理器302用于提供计算和控制能力,支撑整个计算机设备300的运行。该内存储器304为非易失性存储介质303中的计算机程序3032的运行提供环境,该计算机程序3032被处理器302执行时,可使得处理器302执行一种接口调用方法。该网络接口305用于进行网络通信,如发送分配的任务等。本领域技术人员可以理解,图12中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备300的限定,具体的计算机设备300可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Please refer to FIG. 12, which is a schematic block diagram of a computer device provided by an embodiment of the present application. The computer device 300 device may be a terminal. Referring to FIG. 12 , the computer device 300 includes a processor 302 , a memory and a network interface 305 connected by a system bus 301 , wherein the memory may include a non-volatile storage medium 303 and an internal memory 304 . The nonvolatile storage medium 303 can store an operating system 3031 and a computer program 3032 . The computer program 3032 includes program instructions that, when executed, can cause the processor 302 to execute an interface calling method. The processor 302 is used to provide computing and control capabilities to support the operation of the entire computer device 300 . The internal memory 304 provides an environment for running the computer program 3032 in the non-volatile storage medium 303. When the computer program 3032 is executed by the processor 302, the processor 302 can execute an interface calling method. The network interface 305 is used for network communication, such as sending assigned tasks and the like. Those skilled in the art can understand that the structure shown in FIG. 12 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 300 to which the solution of the present application is applied. The specific computer device 300 may include more or fewer components than shown, or combine certain components, or have a different arrangement of components.

其中,所述处理器302用于运行存储在存储器中的计算机程序3032,以实现如下功能:获取目标服务器的接口文档说明文件;从所述接口文档说明文件中提取接口参数信息、返回字段类型要求信息以及返回字段长度要求信息;根据接口调用程序获取接口调用参数;判断所述接口调用参数与所述接口参数信息是否一致;若所述接口调用参数与所述接口参数信息一致,将所述接口调用参数发送至所述目标服务器;获取所述目标服务器的返回信息,根据所述返回信息获取目标返回字段,并提取所述目标返回字段的类型信息和长度信息;若所述目标返回字段的类型信息与所述返回字段类型要求信息一致且所述目标返回字段的长度信息与所述返回字段长度要求信息一致,生成接口调用成功信息并输出所生成的接口调用成功信息。Wherein, the processor 302 is configured to run the computer program 3032 stored in the memory, so as to realize the following functions: obtaining the interface document description file of the target server; extracting interface parameter information and returning field type requirements from the interface document description file information and return field length requirement information; obtain interface calling parameters according to the interface calling program; determine whether the interface calling parameters are consistent with the interface parameter information; if the interface calling parameters are consistent with the interface parameter information, the interface The calling parameters are sent to the target server; the return information of the target server is obtained, the target return field is obtained according to the return information, and the type information and length information of the target return field are extracted; if the type of the target return field is If the information is consistent with the returned field type requirement information and the length information of the target return field is consistent with the returned field length requirement information, the interface invocation success information is generated and the generated interface invocation success information is output.

在一实施例中,处理器302在执行所述根据接口调用程序获取接口调用参数之后,还实现如下功能:若所述接口调用参数与所述接口参数信息不一致,生成接口调用参数错误提示信息并输出所生成的接口调用参数错误提示信息。In one embodiment, after the processor 302 executes the acquisition of the interface calling parameters according to the interface calling program, the processor 302 further implements the following function: if the interface calling parameters are inconsistent with the interface parameter information, generate an interface calling parameter error prompt message and Output the generated interface call parameter error message.

在一实施例中,处理器302在执行所述获取所述目标服务器的返回信息,根据所述返回信息获取目标返回字段,并提取所述目标返回字段的类型信息和长度信息之后,还实现如下功能:若所述目标返回字段的类型信息与所述返回字段类型要求信息不一致和/或所述目标返回字段的长度信息与所述返回字段长度要求信息不一致,生成接口调用返回字段错误提示信息。In one embodiment, after the processor 302 executes the obtaining of the return information of the target server, obtains the target return field according to the return information, and extracts the type information and length information of the target return field, the processor 302 also implements the following: Function: If the type information of the target return field is inconsistent with the return field type requirement information and/or the length information of the target return field is inconsistent with the return field length requirement information, generate an interface call return field error message.

在一实施例中,处理器302在执行所述从所述接口文档说明文件中提取接口参数信息、返回字段类型要求信息以及返回字段长度要求信息,具体实现如下功能:根据预设的第一关键词数据库,对所述接口文档说明文件进行关键词识别以获取第一关键词组,所述第一关键词组包括多个第一关键词;获取所述第一关键词组中与第一预设关键字一致的第一关键词作为第一目标关键词,并获取所述第一目标关键词在所述接口文档说明文件的第一位置信息,根据所述第一位置信息在所述接口文档说明文件中获取所述接口参数信息;获取所述第一关键词组中与第二预设关键字一致的第一关键词作为第二目标关键词,并获取所述第二目标关键词在所述接口文档说明文件的第二位置信息,根据所述第二位置信息在所述接口文档说明文件中获取所述返回字段类型要求信息;获取所述第一关键词组中与第三预设关键字一致的第一关键词作为第三目标关键词,并获取所述第三目标关键词在所述接口文档说明文件的第三位置信息,根据所述第三位置信息在所述接口文档说明文件中获取所述返回字段长度要求信息。In one embodiment, the processor 302 specifically implements the following functions when executing the extraction of interface parameter information, returned field type requirement information, and returned field length requirement information from the interface document description file: according to the preset first key A word database, performing keyword identification on the interface document description file to obtain a first keyword group, where the first keyword group includes a plurality of first keywords; obtaining the first keyword group and the first preset keywords in the first keyword group The consistent first keyword is used as the first target keyword, and the first position information of the first target keyword in the interface document description file is obtained, and the first position information is in the interface document description file according to the first position information. Obtain the interface parameter information; obtain the first keyword in the first keyword group that is consistent with the second preset keyword as the second target keyword, and obtain the second target keyword in the interface document description The second position information of the file, according to the second position information, obtain the return field type requirement information in the interface document description file; obtain the first keyword group consistent with the third preset keyword The keyword is used as the third target keyword, and the third position information of the third target keyword in the interface document description file is obtained, and the return is obtained in the interface document description file according to the third position information. Field length request information.

在一实施例中,处理器302在执行所述获取所述目标服务器的返回信息,根据所述返回信息获取目标返回字段,并提取所述目标返回字段的类型信息和长度信息,还实现如下功能:根据预设的第二关键词数据库,对所述目标服务器的返回信息进行关键词识别以获取第二关键词组,所述第二关键词组包括多个第二关键词;获取所述第二关键词组中与第四预设关键字一致的第二关键词作为第四目标关键词,并获取所述第四目标关键词在所述返回信息的第四位置信息,根据所述第四位置信息在所述返回信息中获取所述目标返回字段。In one embodiment, the processor 302 executes the obtaining of the return information of the target server, obtains the target return field according to the return information, extracts the type information and length information of the target return field, and also implements the following functions: : according to the preset second keyword database, perform keyword identification on the returned information of the target server to obtain a second keyword group, where the second keyword group includes a plurality of second keywords; obtain the second keyword The second keyword in the phrase that is consistent with the fourth preset keyword is used as the fourth target keyword, and the fourth position information of the fourth target keyword in the returned information is obtained. The target return field is obtained from the return information.

应当理解,在本申请实施例中,处理器302可以是中央处理单元(CentralProcessing Unit,CPU),该处理器502还可以是其他通用处理器、数字信号处理器(DigitalSignal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable GateArray,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that, in this embodiment of the present application, the processor 302 may be a central processing unit (Central Processing Unit, CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), dedicated integrated Circuit (Application Specific Integrated Circuit, ASIC), off-the-shelf Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. Wherein, the general-purpose processor can be a microprocessor or the processor can also be any conventional processor or the like.

在本申请的另一实施例中提供一种存储介质。该存储介质可以为计算机可读存储介质。该存储介质存储有计算机程序,其中计算机程序包括程序指令。该程序指令被处理器执行时使处理器执行如下程序:获取目标服务器的接口文档说明文件;从所述接口文档说明文件中提取接口参数信息、返回字段类型要求信息以及返回字段长度要求信息;根据接口调用程序获取接口调用参数;判断所述接口调用参数与所述接口参数信息是否一致;若所述接口调用参数与所述接口参数信息一致,将所述接口调用参数发送至所述目标服务器;获取所述目标服务器的返回信息,根据所述返回信息获取目标返回字段,并提取所述目标返回字段的类型信息和长度信息;若所述目标返回字段的类型信息与所述返回字段类型要求信息一致且所述目标返回字段的长度信息与所述返回字段长度要求信息一致,生成接口调用成功信息并输出所生成的接口调用成功信息。In another embodiment of the present application, a storage medium is provided. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When the program instruction is executed by the processor, the processor executes the following program: obtain the interface document description file of the target server; extract interface parameter information, return field type requirement information and return field length requirement information from the interface document description file; The interface calling program obtains interface calling parameters; judges whether the interface calling parameters are consistent with the interface parameter information; if the interface calling parameters are consistent with the interface parameter information, sending the interface calling parameters to the target server; Obtain the return information of the target server, obtain the target return field according to the return information, and extract the type information and length information of the target return field; if the type information of the target return field and the return field type requirement information If it is consistent and the length information of the target return field is consistent with the length requirement information of the return field, the interface invocation success information is generated and the generated interface invocation success information is output.

在一实施例中,该程序指令被处理器执行所述根据接口调用程序获取接口调用参数之后,还执行如下程序:若所述接口调用参数与所述接口参数信息不一致,生成接口调用参数错误提示信息并输出所生成的接口调用参数错误提示信息。In one embodiment, after the program instruction is executed by the processor to obtain the interface call parameters according to the interface call program, the following program is also executed: if the interface call parameters are inconsistent with the interface parameter information, an error prompt of the interface call parameters is generated. information and output the generated interface call parameter error message.

在一实施例中,该程序指令被处理器执行所述获取所述目标服务器的返回信息,根据所述返回信息获取目标返回字段,并提取所述目标返回字段的类型信息和长度信息之后,还执行如下程序:若所述目标返回字段的类型信息与所述返回字段类型要求信息不一致和/或所述目标返回字段的长度信息与所述返回字段长度要求信息不一致,生成接口调用返回字段错误提示信息。In one embodiment, the program instruction is executed by the processor to obtain the return information of the target server, obtain the target return field according to the return information, and after extracting the type information and length information of the target return field, further Execute the following program: if the type information of the target return field is inconsistent with the return field type requirement information and/or the length information of the target return field is inconsistent with the return field length requirement information, generate an interface call return field error prompt information.

在一实施例中,该程序指令被处理器执行所述从所述接口文档说明文件中提取接口参数信息、返回字段类型要求信息以及返回字段长度要求信息,具体执行如下程序:根据预设的第一关键词数据库,对所述接口文档说明文件进行关键词识别以获取第一关键词组,所述第一关键词组包括多个第一关键词;获取所述第一关键词组中与第一预设关键字一致的第一关键词作为第一目标关键词,并获取所述第一目标关键词在所述接口文档说明文件的第一位置信息,根据所述第一位置信息在所述接口文档说明文件中获取所述接口参数信息;获取所述第一关键词组中与第二预设关键字一致的第一关键词作为第二目标关键词,并获取所述第二目标关键词在所述接口文档说明文件的第二位置信息,根据所述第二位置信息在所述接口文档说明文件中获取所述返回字段类型要求信息;获取所述第一关键词组中与第三预设关键字一致的第一关键词作为第三目标关键词,并获取所述第三目标关键词在所述接口文档说明文件的第三位置信息,根据所述第三位置信息在所述接口文档说明文件中获取所述返回字段长度要求信息。In one embodiment, the program instruction is executed by the processor to extract interface parameter information, return field type requirement information and return field length requirement information from the interface document description file, and specifically execute the following program: according to the preset No. A keyword database, performing keyword identification on the interface document description file to obtain a first keyword group, where the first keyword group includes a plurality of first keywords; The first keyword with the same keyword is used as the first target keyword, and the first position information of the first target keyword in the interface document description file is obtained, and the interface document is described according to the first position information. Obtain the interface parameter information from the file; obtain the first keyword in the first keyword group that is consistent with the second preset keyword as the second target keyword, and obtain the second target keyword in the interface The second location information of the document description file, obtaining the returned field type requirement information in the interface document description file according to the second location information; obtaining the first keyword group that is consistent with the third preset keyword The first keyword is used as the third target keyword, and the third position information of the third target keyword in the interface document description file is obtained, and the third position information is obtained in the interface document description file according to the third position information. The above returns the field length requirement information.

在一实施例中,该程序指令被处理器执行所述获取所述目标服务器的返回信息,根据所述返回信息获取目标返回字段,并提取所述目标返回字段的类型信息和长度信息,还执行如下程序:根据预设的第二关键词数据库,对所述目标服务器的返回信息进行关键词识别以获取第二关键词组,所述第二关键词组包括多个第二关键词;获取所述第二关键词组中与第四预设关键字一致的第二关键词作为第四目标关键词,并获取所述第四目标关键词在所述返回信息的第四位置信息,根据所述第四位置信息在所述返回信息中获取所述目标返回字段。In one embodiment, the program instruction is executed by the processor to obtain the return information of the target server, obtain the target return field according to the return information, extract the type information and length information of the target return field, and execute The following procedures: perform keyword identification on the returned information of the target server according to a preset second keyword database to obtain a second keyword group, where the second keyword group includes a plurality of second keywords; obtain the first keyword The second keyword in the two keyword group that is consistent with the fourth preset keyword is used as the fourth target keyword, and the fourth position information of the fourth target keyword in the returned information is obtained. According to the fourth position The information obtains the target return field in the return information.

该存储介质可以是U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The storage medium may be a U disk, a removable hard disk, a read-only memory (ROM, Read-Only Memory), a magnetic disk or an optical disk and other mediums that can store program codes.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. Interchangeability, the above description has generally described the components and steps of each example in terms of function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.

在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的。例如,各个单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is only a logical function division, and other division methods may be used in actual implementation. For example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.

本申请实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。本申请实施例装置中的单元可以根据实际需要进行合并、划分和删减。另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以是两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。该集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分,或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,终端,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。The steps in the method of the embodiment of the present application may be adjusted, combined and deleted in sequence according to actual needs. Units in the apparatus of the embodiment of the present application may be combined, divided, and deleted according to actual needs. In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units. The integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a storage medium. Based on this understanding, the technical solutions of the present application are essentially or part of contributions to the prior art, or all or part of the technical solutions can be embodied in the form of software products, and the computer software products are stored in a storage medium , including several instructions to cause a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited to this. Any person skilled in the art can easily think of various equivalents within the technical scope disclosed by the present invention. Modifications or substitutions should be included within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims (10)

Translated fromChinese
1.一种接口调用方法,其特征在于,包括:1. an interface calling method, is characterized in that, comprises:获取目标服务器的接口文档说明文件;Obtain the interface documentation of the target server;从所述接口文档说明文件中提取接口参数信息、返回字段类型要求信息以及返回字段长度要求信息;Extract interface parameter information, return field type requirement information and return field length requirement information from the interface document description file;根据接口调用程序获取接口调用参数;Obtain interface calling parameters according to the interface calling program;判断所述接口调用参数与所述接口参数信息是否一致;若所述接口调用参数与所述接口参数信息一致,将所述接口调用参数发送至所述目标服务器;Determine whether the interface invocation parameters are consistent with the interface parameter information; if the interface invocation parameters are consistent with the interface parameter information, send the interface invocation parameters to the target server;获取所述目标服务器的返回信息,根据所述返回信息获取目标返回字段,并提取所述目标返回字段的类型信息和长度信息;Obtain the return information of the target server, obtain the target return field according to the return information, and extract the type information and length information of the target return field;若所述目标返回字段的类型信息与所述返回字段类型要求信息一致且所述目标返回字段的长度信息与所述返回字段长度要求信息一致,生成接口调用成功信息并输出所生成的接口调用成功信息。If the type information of the target return field is consistent with the return field type requirement information and the length information of the target return field is consistent with the return field length requirement information, generate interface invocation success information and output the generated interface invocation success information.2.根据权利要求1所述的接口调用方法,其特征在于,在所述根据接口调用程序获取接口调用参数之后,所述方法还包括:2. The interface invocation method according to claim 1, wherein after the interface invocation parameters are obtained according to the interface invocation program, the method further comprises:若所述接口调用参数与所述接口参数信息不一致,生成接口调用参数错误提示信息并输出所生成的接口调用参数错误提示信息。If the interface invocation parameters are inconsistent with the interface parameter information, generate interface invocation parameter error prompt information and output the generated interface invocation parameter error prompt information.3.根据权利要求1所述的接口调用方法,其特征在于,在所述获取所述目标服务器的返回信息,根据所述返回信息获取目标返回字段,并提取所述目标返回字段的类型信息和长度信息之后,所述方法还包括:3. The interface invocation method according to claim 1, characterized in that, in said obtaining the return information of the target server, obtaining the target return field according to the return information, and extracting the type information and the type information of the target return field. After the length information, the method further includes:若所述目标返回字段的类型信息与所述返回字段类型要求信息不一致和/或所述目标返回字段的长度信息与所述返回字段长度要求信息不一致,生成接口调用返回字段错误提示信息。If the type information of the target return field is inconsistent with the return field type requirement information and/or the length information of the target return field is inconsistent with the return field length requirement information, an interface call return field error message is generated.4.根据权利要求1所述的接口调用方法,其特征在于,所述从所述接口文档说明文件中提取接口参数信息、返回字段类型要求信息以及返回字段长度要求信息,包括:4. The interface invocation method according to claim 1, wherein the extraction of interface parameter information, return field type requirement information and return field length requirement information from the interface document description file comprises:根据预设的第一关键词数据库,对所述接口文档说明文件进行关键词识别以获取第一关键词组,所述第一关键词组包括多个第一关键词;Perform keyword identification on the interface document description file according to a preset first keyword database to obtain a first keyword group, where the first keyword group includes a plurality of first keywords;获取所述第一关键词组中与第一预设关键字一致的第一关键词作为第一目标关键词,并获取所述第一目标关键词在所述接口文档说明文件的第一位置信息,根据所述第一位置信息在所述接口文档说明文件中获取所述接口参数信息;acquiring the first keyword in the first keyword group that is consistent with the first preset keyword as the first target keyword, and acquiring the first position information of the first target keyword in the interface document description file, Obtain the interface parameter information in the interface document description file according to the first location information;获取所述第一关键词组中与第二预设关键字一致的第一关键词作为第二目标关键词,并获取所述第二目标关键词在所述接口文档说明文件的第二位置信息,根据所述第二位置信息在所述接口文档说明文件中获取所述返回字段类型要求信息;acquiring the first keyword in the first keyword group that is consistent with the second preset keyword as the second target keyword, and acquiring the second position information of the second target keyword in the interface document description file, Obtain the return field type requirement information in the interface document description file according to the second location information;获取所述第一关键词组中与第三预设关键字一致的第一关键词作为第三目标关键词,并获取所述第三目标关键词在所述接口文档说明文件的第三位置信息,根据所述第三位置信息在所述接口文档说明文件中获取所述返回字段长度要求信息。acquiring the first keyword in the first keyword group that is consistent with the third preset keyword as the third target keyword, and acquiring the third position information of the third target keyword in the interface document description file, The returned field length requirement information is acquired from the interface document description file according to the third position information.5.根据权利要求1所述的接口调用方法,其特征在于,所述获取所述目标服务器的返回信息,根据所述返回信息获取目标返回字段,并提取所述目标返回字段的类型信息和长度信息,包括:5. The interface invocation method according to claim 1, characterized in that, the acquisition of the return information of the target server, the acquisition of a target return field according to the return information, and the extraction of type information and length of the target return field information, including:根据预设的第二关键词数据库,对所述目标服务器的返回信息进行关键词识别以获取第二关键词组,所述第二关键词组包括多个第二关键词;According to a preset second keyword database, keyword identification is performed on the returned information of the target server to obtain a second keyword group, where the second keyword group includes a plurality of second keywords;获取所述第二关键词组中与第四预设关键字一致的第二关键词作为第四目标关键词,并获取所述第四目标关键词在所述返回信息的第四位置信息,根据所述第四位置信息在所述返回信息中获取所述目标返回字段。Obtain the second keyword consistent with the fourth preset keyword in the second keyword group as the fourth target keyword, and obtain the fourth position information of the fourth target keyword in the returned information, according to the The fourth location information obtains the target return field in the return information.6.一种接口调用装置,其特征在于,包括:6. An interface calling device, characterized in that, comprising:第一获取单元,用于获取目标服务器的接口文档说明文件;a first obtaining unit, used for obtaining the interface document description file of the target server;第一提取单元,用于从所述接口文档说明文件中提取接口参数信息、返回字段类型要求信息以及返回字段长度要求信息;a first extraction unit, configured to extract interface parameter information, return field type requirement information and return field length requirement information from the interface document description file;第二获取单元,用于根据接口调用程序获取接口调用参数;a second obtaining unit, configured to obtain the interface calling parameters according to the interface calling program;第一发送单元,用于判断所述接口调用参数与所述接口参数信息进行比对是否一致;若所述接口调用参数与所述接口参数信息一致,将所述接口调用参数发送至所述目标服务器;a first sending unit, configured to judge whether the interface call parameters are consistent with the interface parameter information; if the interface call parameters are consistent with the interface parameter information, send the interface call parameters to the target server;第二提取单元,用于获取所述目标服务器的返回信息,根据所述返回信息获取目标返回字段,并提取所述目标返回字段的类型信息和长度信息;The second extraction unit is used to obtain the return information of the target server, obtain the target return field according to the return information, and extract the type information and length information of the target return field;第一提醒单元,用于若所述目标返回字段的类型信息与所述返回字段类型要求信息一致且所述目标返回字段的长度信息与所述返回字段长度要求信息一致,生成接口调用成功信息并输出所生成的接口调用成功信息。The first reminding unit is configured to generate interface invocation success information if the type information of the target return field is consistent with the return field type requirement information and the length information of the target return field is consistent with the return field length requirement information. Output the generated interface invocation success information.7.根据权利要求6所述的接口调用装置,其特征在于,所述装置还包括:7. The interface invocation device according to claim 6, wherein the device further comprises:第二提醒单元,用于若所述接口调用参数与所述接口参数信息不一致,生成接口调用参数错误提示信息并输出所生成的接口调用参数错误提示信息。The second reminding unit is configured to generate interface calling parameter error prompt information and output the generated interface calling parameter error prompt information if the interface calling parameter is inconsistent with the interface parameter information.8.根据权利要求6所述的接口调用装置,其特征在于,所述装置还包括:8. The interface invocation device according to claim 6, wherein the device further comprises:第三提醒单元,用于若所述目标返回字段的类型信息与所述返回字段类型要求信息不一致和/或所述目标返回字段的长度信息与所述返回字段长度要求信息不一致,生成接口调用返回字段错误提示信息。A third reminder unit, configured to generate an interface call return if the type information of the target return field is inconsistent with the return field type requirement information and/or the length information of the target return field is inconsistent with the return field length requirement information Field error message.9.一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至5中任一项所述的接口调用方法。9. A computer device comprising a memory, a processor and a computer program stored on the memory and running on the processor, wherein the processor implements the computer program as claimed in the claims The interface invocation method described in any one of 1 to 5.10.一种计算机可读存储介质,其特征在于,所述存储介质存储有计算机程序,所述计算机程序当被处理器执行时使所述处理器执行如权利要求1-5中任一项所述的接口调用方法。10. A computer-readable storage medium, characterized in that the storage medium stores a computer program, the computer program, when executed by a processor, causes the processor to execute the method according to any one of claims 1-5. The interface invocation method described above.
CN201910662547.0A2019-07-222019-07-22 Interface calling method, device, computer equipment and storage mediumActiveCN110532107B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201910662547.0ACN110532107B (en)2019-07-222019-07-22 Interface calling method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201910662547.0ACN110532107B (en)2019-07-222019-07-22 Interface calling method, device, computer equipment and storage medium

Publications (2)

Publication NumberPublication Date
CN110532107Atrue CN110532107A (en)2019-12-03
CN110532107B CN110532107B (en)2023-04-28

Family

ID=68661701

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201910662547.0AActiveCN110532107B (en)2019-07-222019-07-22 Interface calling method, device, computer equipment and storage medium

Country Status (1)

CountryLink
CN (1)CN110532107B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111045756A (en)*2019-12-102020-04-21中国工商银行股份有限公司Method, apparatus, computing device, and medium for generating interface service
CN111309593A (en)*2020-01-162020-06-19中国平安财产保险股份有限公司JSON interface verification method, device and equipment and computer readable storage medium
CN112380820A (en)*2020-11-172021-02-19深圳壹账通智能科技有限公司Automatic data backfilling method and device, electronic equipment and computer storage medium
CN113535832A (en)*2021-06-102021-10-22杭州未名信科科技有限公司 Cloud service data acquisition method, device, electronic device and medium
CN113535830A (en)*2020-04-212021-10-22中移信息技术有限公司 Interface automatic expansion method, device, device and storage medium
CN114647587A (en)*2022-03-302022-06-21中国银行股份有限公司 Method, apparatus, apparatus, storage medium and product for determining the correctness of an interface
CN114760236A (en)*2022-04-082022-07-15中国银行股份有限公司Interface checking method, device, storage medium and equipment
CN115509939A (en)*2022-10-242022-12-23平安银行股份有限公司 Interface testing method, device, storage medium and electronic equipment
CN119759361A (en)*2024-12-202025-04-04北京深势科技有限公司Processing method and device for checking service interface call information

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101013968A (en)*2005-11-292007-08-08阿尔卡特公司Automated interface testing framework
US20180342241A1 (en)*2017-05-252018-11-29Baidu Online Network Technology (Beijing) Co., Ltd .Method and Apparatus of Recognizing Field of Semantic Parsing Information, Device and Readable Medium
CN109446071A (en)*2018-09-262019-03-08深圳壹账通智能科技有限公司Interface test method, interface test device, electronic equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101013968A (en)*2005-11-292007-08-08阿尔卡特公司Automated interface testing framework
US20180342241A1 (en)*2017-05-252018-11-29Baidu Online Network Technology (Beijing) Co., Ltd .Method and Apparatus of Recognizing Field of Semantic Parsing Information, Device and Readable Medium
CN109446071A (en)*2018-09-262019-03-08深圳壹账通智能科技有限公司Interface test method, interface test device, electronic equipment and storage medium

Cited By (12)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111045756A (en)*2019-12-102020-04-21中国工商银行股份有限公司Method, apparatus, computing device, and medium for generating interface service
CN111045756B (en)*2019-12-102024-01-09中国工商银行股份有限公司Method, apparatus, computing device and medium for generating interface service
CN111309593A (en)*2020-01-162020-06-19中国平安财产保险股份有限公司JSON interface verification method, device and equipment and computer readable storage medium
CN113535830A (en)*2020-04-212021-10-22中移信息技术有限公司 Interface automatic expansion method, device, device and storage medium
CN112380820A (en)*2020-11-172021-02-19深圳壹账通智能科技有限公司Automatic data backfilling method and device, electronic equipment and computer storage medium
CN113535832A (en)*2021-06-102021-10-22杭州未名信科科技有限公司 Cloud service data acquisition method, device, electronic device and medium
CN113535832B (en)*2021-06-102024-08-02杭州未名信科科技有限公司 Cloud service data acquisition method, device, electronic device and medium
CN114647587A (en)*2022-03-302022-06-21中国银行股份有限公司 Method, apparatus, apparatus, storage medium and product for determining the correctness of an interface
CN114760236A (en)*2022-04-082022-07-15中国银行股份有限公司Interface checking method, device, storage medium and equipment
CN114760236B (en)*2022-04-082023-11-14中国银行股份有限公司Interface checking method, device, storage medium and equipment
CN115509939A (en)*2022-10-242022-12-23平安银行股份有限公司 Interface testing method, device, storage medium and electronic equipment
CN119759361A (en)*2024-12-202025-04-04北京深势科技有限公司Processing method and device for checking service interface call information

Also Published As

Publication numberPublication date
CN110532107B (en)2023-04-28

Similar Documents

PublicationPublication DateTitle
CN110532107B (en) Interface calling method, device, computer equipment and storage medium
CN111414407A (en) Data query method, device, computer equipment and storage medium for database
US10573317B2 (en)Speech recognition method and device
CN111538651B (en) Interface testing method, device, server and storage medium
CN108415998B (en)Application dependency relationship updating method, terminal, device and storage medium
CN110990346A (en)File data processing method, device, equipment and storage medium based on block chain
CN113010661A (en)Method, device and equipment for analyzing statement and storage medium
CN109845224B (en)Electronic device and method for operating an electronic device
CN116306396A (en) Chip verification method and device, equipment and medium
CN112363814A (en)Task scheduling method and device, computer equipment and storage medium
CN111651749A (en) Method, device, computer equipment and storage medium for retrieving account based on password
US20210407497A1 (en)Method, apparatus, electronic device and storage medium for speech recognition
CN114154153A (en)Malicious code detection method and device, electronic equipment and storage medium
CN114490400A (en)Method and device for processing test cases
CN112015466A (en)Information retrieval method, information retrieval device, computer equipment and storage medium
CN111124627B (en)Method and device for determining call initiator of application program, terminal and storage medium
CN107341105A (en)Information processing method, terminal and server
CN118821675A (en) Chip verification method, device, equipment and medium
CN110674224B (en) Entity data processing method, apparatus, device and computer-readable storage medium
CN115617800A (en) Data reading method, device, electronic device and storage medium
CN108683789A (en)contact information adding method, device, terminal and storage medium
CN113297087A (en)Test method and device
CN114329164A (en) Methods, apparatus, equipment, media and products for processing data
CN114840871A (en)Data desensitization method and device, electronic equipment and storage medium
CN109766499B (en)Group joining method and device and computer equipment

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant
TR01Transfer of patent right
TR01Transfer of patent right

Effective date of registration:20250430

Address after:Unit 3509, 35th Floor, 1333 Lujiazui Ring Road, Pudong New Area Pilot Free Trade Zone, Shanghai, 200135

Patentee after:Ping An Pay Electronic Payment Co.,Ltd.

Country or region after:China

Address before:Unit 2605, 26 / F, Zhaobang fund Rong building, No. 319, Fuhua Road, Futian street, Futian District, Shenzhen City, Guangdong Province

Patentee before:Pingan Payment Technology Service Co.,Ltd.

Country or region before:China


[8]ページ先頭

©2009-2025 Movatter.jp