CN112631694B - API (application program interface) encapsulation calling method and system - Google Patents

API (application program interface) encapsulation calling method and system Download PDF

Info

Publication number
CN112631694B
CN112631694B CN202011445437.8A CN202011445437A CN112631694B CN 112631694 B CN112631694 B CN 112631694B CN 202011445437 A CN202011445437 A CN 202011445437A CN 112631694 B CN112631694 B CN 112631694B
Authority
CN
China
Prior art keywords
interface
api
configuration file
calling
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011445437.8A
Other languages
Chinese (zh)
Other versions
CN112631694A (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.)
Yuanguang Software Co Ltd
Original Assignee
Yuanguang Software 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 Yuanguang Software Co Ltd filed Critical Yuanguang Software Co Ltd
Priority to CN202011445437.8A priority Critical patent/CN112631694B/en
Publication of CN112631694A publication Critical patent/CN112631694A/en
Application granted granted Critical
Publication of CN112631694B publication Critical patent/CN112631694B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application relates to an API (application program interface) encapsulation calling method and system, which solve the problems that in the prior art, the original manual encapsulation of an API is required to be manually introduced and configuration is dependent. The method comprises the following steps: reading a first interface configuration file of an API interface, and automatically acquiring an interface name, an interface request type, a sample request parameter and a sample return parameter of the API interface; adding the overtime and interception modes corresponding to the interface request type in the local configuration file into the first interface configuration file to generate a second interface configuration file; adding the API directory information in the configuration file into an API directory file; and scanning and matching the calling mode, the interface name and the interface request type of the API interface to be called in the API directory file, calling the API interface according to the sample request parameter after the scanning information is successfully matched, matching the return parameter of the API interface with the sample return parameter, taking the second interface configuration file as a new configuration file if the matching is successful, and ending the encapsulation calling.

Description

API (application program interface) encapsulation calling method and system
Technical Field
The present application relates to the field of computer technologies, and in particular, to an API interface encapsulation calling method and system.
Background
The API (Application Programming Interface, application program interface) is a number of predefined functions or conventions that refer to the engagement of different components of a software system. To provide a set of routines that applications and developers can access based on certain software or hardware without having to access source code or understand the details of the internal operating mechanisms.
At present, the main flow of API encapsulation call is as follows: firstly, storing an API interface under a catalog of an item; then configuring development environment, test environment, production environment and the like; packaging the request, configuring a request mode, requesting parameters, methods and the like; setting timeout and request interception; then introducing a corresponding API function into the page; an API interface is called. That is, the API package is still in the original state, and most of the processing methods remain in the manual package and then uploaded to the server. Manual introduction and configuration dependency are required at call time.
Therefore, a method and a system for quick encapsulation and convenient calling of a general API are lacking in the prior art.
Disclosure of Invention
In view of the above analysis, the embodiments of the present application aim to provide an API interface package calling method and system, so as to solve the problem that the existing API original manual package requires manual introduction and configuration dependency.
In one aspect, an embodiment of the present application provides an API interface encapsulation calling method, including:
reading a first interface configuration file of an API interface, and automatically acquiring an interface name, an interface request type, a sample request parameter and a sample return parameter of the API interface;
adding the overtime and interception modes corresponding to the interface request type in the local configuration file into the first interface configuration file to generate a second interface configuration file;
adding the API directory information in the first interface configuration file and the local configuration file to an API directory file;
and scanning and matching the calling mode, the interface name and the interface request type of the API interface to be called in the API directory file, calling the API interface according to the sample request parameter after the scanning information is successfully matched, matching the return parameter of the API interface with the sample return parameter, and taking the second interface configuration file as a new configuration file if the matching is successful, and ending the encapsulation calling.
Further, the sample request parameter is a call message for calling an API interface; and the sample return parameter is data returned after calling the API interface.
Further, the API catalog information includes: interface name, interface request type, sample request parameters, sample return parameters, timeout and interception mode.
Further, the method further comprises the following steps: and scanning and matching a calling mode, an interface name and an interface request type of an API interface to be called in the API directory file, generating a third interface configuration file if the scanning information is not successfully matched, adding the interface name, the interface request type, the overtime and the interception mode of the API interface to be called into the third interface configuration file, judging whether a return parameter is correct according to the input request parameter, if the return parameter is correct, calling is successful, adding the request parameter and the return parameter into the third interface configuration file, and taking the third interface configuration file as a new configuration file, and ending the encapsulation.
Further, after the call is successful, the API directory information in the third interface configuration file is added into the API directory file.
Further, after the encapsulation is finished, the second or third interface configuration file includes basic information of the API interface for identification in the subsequent encapsulation, where the basic information includes an interface name of the API, an interface request type, a sample request parameter, a sample return parameter, a timeout and an interception mode.
Further, part of parameters in the second or third interface configuration file are modified, and subsequent encapsulation of the API interface is achieved.
In another aspect, an embodiment of the present application provides an API interface package calling system, including:
the interface configuration file information acquisition module is used for reading a first interface configuration file of the API interface and automatically acquiring an interface name, an interface request type, a sample request parameter and a sample return parameter of the API interface;
the local configuration file information matching module is used for adding the overtime and interception modes corresponding to the interface request types in the local configuration file into the first interface configuration file to generate a second interface configuration file;
an API catalog file updating module, configured to add API catalog information in the first interface configuration file and the native configuration file to an API catalog file;
and the API interface automatic test calling module is used for scanning and matching the calling mode, the interface name and the interface request type of the API interface to be called in the API directory file, calling the API interface according to the sample request parameter after the scanning information is successfully matched, matching the return parameter of the API interface with the sample return parameter, and storing the second interface configuration file as a new configuration file after the matching is successful.
Further, the method further comprises the following steps: and the API interface configuration file updating module is used for scanning and matching the calling mode, the interface name and the interface request type of the API interface to be called in the API directory file, generating a third interface configuration file if the scanning information is not successfully matched, adding the interface name, the interface request type, the overtime and the interception mode of the API interface to be called into the third interface configuration file, judging whether the return parameter is correct according to the input request parameter, if the return parameter is correct, calling is successful, adding the request parameter and the return parameter into the third interface configuration file, and storing the third interface configuration file as a new configuration file.
Further, after the third interface configuration file is updated and generated by the API interface configuration file updating module, the API directory information needs to be added to the API directory file by the API directory file updating module.
Compared with the prior art, the application has at least one of the following beneficial effects:
(1) Complicated configuration and uploading during packaging of the API interface are avoided, and filling type packaging is realized; the packaging is completed, and automatic test call is carried out for verification, so that the process of packaging the interface is completed.
(2) When updating and calling the API interface, the coding and calling real-time association and the real-time updating are realized without manually updating and adding the dependence.
(3) Time is saved in packaging and calling of the API interface, and many errors are avoided.
In the application, the technical schemes can be mutually combined to realize more preferable combination schemes. Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and drawings.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. It will be apparent to those of ordinary skill in the art that the drawings in the following description are exemplary only and that other implementations can be obtained from the extensions of the drawings provided without inventive effort.
FIG. 1 is a flow chart of an API interface encapsulation calling method according to an embodiment of the application;
FIG. 2 is a schematic diagram of an API interface package calling system according to another embodiment of the present application;
fig. 3 is a schematic hardware structure of an electronic device executing the API encapsulation calling method according to the embodiment of the present application.
Detailed Description
The following detailed description of preferred embodiments of the application is made in connection with the accompanying drawings, which form a part hereof, and together with the description of the embodiments of the application, are used to explain the principles of the application and are not intended to limit the scope of the application.
As shown in fig. 1, in one embodiment of the present application, an API interface encapsulation calling method is disclosed, including:
s10, reading a first interface configuration file of an API (application program interface), and automatically acquiring an interface name, an interface request type, a sample request parameter and a sample return parameter of the API;
specifically, the sample request parameter is a call message for calling the API interface, for example: the call message of the login interface is an account and a password, and can be in a key_value or json format:
key_value format: username = aaaa & pass word=123456
json format: { 'username': aaaa ',' password ': 123456' };
the sample return parameter is the data returned after calling the API interface;
the interface request type refers to a request mode of an interface, and comprises the following steps: get request, which is used to acquire information and is mostly used to inquire data; post requests may result in the creation of new resources, submitting data (e.g., submitting forms, uploading files) to a specified resource location for request; in addition, the method also comprises a put request and a delete request.
Alternatively, the first interface profile companion interface of the API interface may be multiplexed by other items.
S20, adding a timeout and interception mode corresponding to the interface request type in the local configuration file to the first interface configuration file to generate a second interface configuration file;
specifically, the configuration file of the local machine is preset; the configuration file of the machine needs to be manually maintained to configure different overtime and interception modes corresponding to each request type, the maintenance is needed for the machine or all the projects continuously for a long time, the maintenance can be used when different projects encapsulate different APIs, the maintenance frequency is not too high, the process of continuous accumulation and expansion is realized, and the automatic addition of the API interface can be realized on the premise that the file is maintained well. Alternatively, the native configuration file may be an XML file.
The overtime refers to that if the interface request is not fed back in a specified time, the service is interrupted to be called, the overtime is prompted, or the service is re-called; interception is to intercept non-login state accesses, non-rights accesses, such as: and checking token, and detecting a login state.
S30, adding the API directory information in the first interface configuration file and the local configuration file to an API directory file; specifically, the API catalog information includes: interface name, interface request type, sample request parameters, sample return parameters, timeout and interception mode. The API directory file is related codes and project configuration information which are automatically generated after two steps of S10 and S20 are carried out.
S40, scanning and matching the calling mode, the interface name and the interface request type of the API interface to be called in the API directory file. Specifically, the calling modes are the calling modes such as 'native ajax', 'ajax in jquery', 'fetch based on promiscuous design', and the like, and the different calling modes need to set information such as request lines, requests, request bodies, received responses, and the like. Corresponding to the calling mode in the interface configuration file, the processing is carried out according to the specified mode.
And S50, after the scanning information is successfully matched, calling an API (application program interface) according to the sample request parameter, matching the return parameter of the API with the sample return parameter, and if the matching is successful, taking the second interface configuration file as a new configuration file, and ending the encapsulation calling.
S60, scanning and matching a calling mode, an interface name and an interface request type of an API interface to be called in the API directory file, generating a third interface configuration file if the scanning information is not matched successfully, adding the interface name, the interface request type, the overtime and the interception mode of the API interface to be called into the third interface configuration file, judging whether a return parameter is correct according to the input request parameter, if the return parameter is correct, calling is successful, adding the request parameter and the return parameter into the third interface configuration file, and taking the third interface configuration file as a new configuration file, and finishing packaging.
Specifically, if the scan information is not successfully matched, the problem caused by the lack of relevant information or other unpredictable factors in the corresponding interface configuration file is described. The encapsulation by the S50 step is needed to perfect the relevant information and test call. Only if the parameters are not matched, the interface configuration file needs to be filled with the input parameters, and the request parameters are recorded for the next packaging. The third profile is generated on the basis of the original profile and retains the old profile, which may need to be referenced later, but the old profile is retained in a limited number.
After the call is successful, the API directory information in the newly generated third interface configuration file is added into the API directory file, and the automatic test call in the step S40 is carried out again.
After the encapsulation is finished, the second or third interface configuration file comprises basic information of an API interface for identification in the subsequent encapsulation, wherein the basic information comprises an interface name, an interface request type, a sample request parameter, a sample return parameter, a timeout and an interception mode of the API. In addition, part of parameters in the second or third interface configuration file are modified, so that the subsequent encapsulation of the API interface can be realized.
As shown in fig. 2, another embodiment of the present application provides an API interface package calling system, including: the system comprises an interface configuration file information acquisition module 110, a local configuration file information matching module 120, an API directory file updating module 130 and an API interface automatic test calling module 140.
An interface configuration file information obtaining module 110, configured to read a first interface configuration file of an API interface, and automatically obtain an interface name, an interface request type, a sample request parameter, and a sample return parameter of the API interface;
the local configuration file information matching module 120 is configured to add a timeout and interception mode corresponding to the interface request type in the local configuration file to the first interface configuration file, and generate a second interface configuration file;
an API catalog file updating module 130, configured to add API catalog information in the first interface configuration file and the native configuration file to an API catalog file;
and the API automatic test and call module 140 is configured to scan and match a call mode, an interface name and an interface request type of an API to be called in the API directory file, call the API according to the sample request parameter after the scan information is successfully matched, match a return parameter of the API with the sample return parameter, and save the second interface configuration file as a new configuration file after the match is successful.
Specifically, the API interface encapsulates the calling system, and further includes: the API interface configuration file updating module 150 is configured to scan and match a calling mode, an interface name and an interface request type of an API interface to be called in the API directory file, if the scan information is not matched successfully, generate a third interface configuration file, add the interface name, the interface request type, the timeout and the interception mode of the API interface to be called into the third interface configuration file, determine whether a return parameter is correct according to the input request parameter, if the return parameter is correct, call successfully, add the request parameter and the return parameter into the third interface configuration file, and save the third interface configuration file as a new configuration file.
After the third interface configuration file is updated by the API interface configuration file updating module 150, the API directory information needs to be added to the API directory file by the API directory file updating module 130.
The description of API interface encapsulation calls follows by way of specific example:
(1) The method comprises the steps of reading an API first interface configuration file, obtaining an API interface with an interface name of "API interface one", and taking post login operation as an example of an obtained interface request type:
sample request parameters:
the sample return parameters are: the 200 status code represents success.
(2) And reading the XML configuration file, matching the request type of the interface as post login operation, and intercepting the access rights of all pages except the login page in a corresponding token interception mode. And adding the API request response timeout time to be 10s, and setting the maximum recall time to be 3 times.
(3) The interface name, interface request type, sample request parameters, sample return parameters, timeout and interception mode are added to the API catalog in the project.
(4) And scanning the acquired interface name and the interface request type in the API catalog, automatically calling a logic method of the API according to the acquired username and the password as sample request parameters, and ending encapsulation after the successful state code is fed back 200 by the interface, or else, ending failure.
(5) If the corresponding interface name and the request type are not scanned in the API catalog, the popup window manually inputs the usernames and the password, automatically calls the Login method of the API according to the input usernames and the password serving as sample request parameters, and finishes encapsulation after the interface feeds back 200 a successful status code.
(6) After the completion, the generated configuration file contains the interface name (API interface I), the interface request type (post, login operation), the request parameters (username and password, http:// API. Xxxx. Com/login /) and the return parameters (200 state codes represent success) of the API in the steps, and also contains the newly added interception mode and timeout response in (2), and the request parameters and the return parameters input in (5).
In the API packaging calling process, the test case is automatically tested to detect whether the API is successfully packaged into the project, the configuration file is packaged, and the generated configuration file is to be reused later or modified and reused.
Referring to fig. 3, another embodiment of the present application further provides an electronic device for executing the API interface package calling method in the above embodiment. The electronic device includes:
one or more processors 710, and a memory 720, one processor 710 being illustrated in fig. 3.
The electronic device that executes the API interface package calling method may further include: an input device 730 and an output device 740.
Processor 710, memory 720, input device 730, and output device 740 may be connected by a bus or other means, for example in fig. 3.
The memory 720 is used as a non-volatile computer readable storage medium for storing a non-volatile software program, a non-volatile computer executable program, and modules, such as program instructions/modules (units) corresponding to the API interface package calling method in the embodiment of the present application. The processor 710 executes various functional applications of the server and data processing by running non-volatile software programs, instructions and modules stored in the memory 720, i.e., implements the method embodiment icon display method described above.
Memory 720 may include a storage program area that may store an operating system, at least one application program required for functionality, and a storage data area; the storage data area may store the acquired number information of the reminder of the application program, etc. In addition, memory 720 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 720 may optionally include memory located remotely from processor 710, which may be connected to the list item operated processing device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 730 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the API interface package invocation system. The output device 740 may include a display device such as a display screen.
The one or more modules are stored in the memory 720 that, when executed by the one or more processors 710, perform the API interface encapsulation calling method of any of the method embodiments described above.
The product can execute the method provided by the embodiment of the application, and has the corresponding functional modules and beneficial effects of the execution method. Technical details not described in detail in this embodiment can be found in the methods provided by the embodiments of the present application.
The electronic device of embodiments of the present application may exist in a variety of forms including, but not limited to:
(1) A mobile communication device: such devices are characterized by mobile communication capabilities and are primarily aimed at providing voice, data communications. Such terminals include: smart phones (e.g., iPhone), multimedia phones, functional phones, and low-end phones, etc.
(2) Ultra mobile personal computer device: such devices are in the category of personal computers, having computing and processing functions, and generally also having mobile internet access characteristics. Such terminals include: PDA, MID, and UMPC devices, etc., such as iPad.
(3) Portable entertainment device: such devices may display and play multimedia content. Such devices include audio, video players (e.g., iPod), palm game consoles, electronic books, and smart toys and portable car navigation devices.
(4) And (3) a server: the configuration of the server includes a processor, a hard disk, a memory, a system bus, and the like, and the server is similar to a general computer architecture, but is required to provide highly reliable services, and thus has high requirements in terms of processing capacity, stability, reliability, security, scalability, manageability, and the like.
(5) Other electronic devices with reminding item recording function.
The above-described apparatus embodiments are merely illustrative, wherein the units (modules) illustrated as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The embodiment of the application provides a non-transitory computer readable storage medium, which stores computer executable instructions, wherein when the computer executable instructions are executed by electronic equipment, the electronic equipment is caused to execute the API interface encapsulation calling method in any of the method embodiments.
Embodiments of the present application provide a computer program product, wherein the computer program product comprises a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, wherein the program instructions, when executed by an electronic device, cause the electronic device to perform the API interface encapsulation calling method in any of the method embodiments described above.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. An API interface encapsulation calling method, comprising:
reading a first interface configuration file of an API interface, and automatically acquiring an interface name, an interface request type, a sample request parameter and a sample return parameter of the API interface;
adding the overtime and interception modes corresponding to the interface request type in the local configuration file into the first interface configuration file to generate a second interface configuration file;
adding the API directory information in the first interface configuration file and the local configuration file to an API directory file;
scanning and matching a calling mode, an interface name and an interface request type of an API interface to be called in the API directory file, calling the API interface according to the sample request parameter after the scanning information is successfully matched, matching the return parameter of the API interface with the sample return parameter, if the matching is successful, taking the second interface configuration file as a new configuration file, finishing encapsulation calling, if the scanning information is not successfully matched, generating a third interface configuration file, adding the interface name, the interface request type, the overtime and the interception mode of the API interface to be called into the third interface configuration file, judging whether the return parameter is correct according to the input request parameter, if the return parameter is correct, calling is successful, adding the request parameter and the return parameter into the third interface configuration file, and taking the third interface configuration file as the new configuration file, and finishing encapsulation;
after the call is successful, the API directory information in the third interface configuration file is added into the API directory file to carry out automatic test call;
the local configuration file, the first interface configuration file, the second interface configuration file and the third interface configuration file are XML files.
2. The method for encapsulating and calling an API according to claim 1, wherein said sample request parameter is a call message for calling an API; and the sample return parameter is data returned after calling the API interface.
3. The API interface package calling method as recited in claim 1, wherein said API catalog information comprises: interface name, interface request type, sample request parameters, sample return parameters, timeout and interception mode.
4. The method for calling the API interface package according to claim 1, wherein after the package is completed, the second or third interface configuration file includes basic information of the API interface for identification at the time of subsequent package, the basic information includes an interface name of the API, an interface request type, a sample request parameter, a sample return parameter, a timeout and an interception mode.
5. The method according to claim 1, wherein modifying a part of parameters in the second or third interface configuration file implements subsequent encapsulation of an API interface.
6. An API interface encapsulation calling system, comprising:
the interface configuration file information acquisition module is used for reading a first interface configuration file of the API interface and automatically acquiring an interface name, an interface request type, a sample request parameter and a sample return parameter of the API interface;
the local configuration file information matching module is used for adding the overtime and interception modes corresponding to the interface request types in the local configuration file into the first interface configuration file to generate a second interface configuration file;
an API catalog file updating module, configured to add API catalog information in the first interface configuration file and the native configuration file to an API catalog file;
the API interface automatic test calling module is used for scanning and matching a calling mode, an interface name and an interface request type of an API interface to be called in the API directory file, calling the API interface according to the sample request parameter after the scanning information is successfully matched, matching the return parameter of the API interface with the sample return parameter, storing the second interface configuration file as a new configuration file after the matching is successful, generating a third interface configuration file if the scanning information is not successfully matched, adding the interface name, the interface request type, the overtime and the interception mode of the API interface to be called into the third interface configuration file, judging whether the return parameter is correct according to the input request parameter, if the return parameter is correct, calling is successful, adding the request parameter and the return parameter into the third interface configuration file, and ending the packaging; after the call is successful, the API directory information in the third interface configuration file is added into the API directory file to carry out automatic test call;
the local configuration file, the first interface configuration file, the second interface configuration file and the third interface configuration file are XML files.
7. The API interface package calling system of claim 6, further comprising:
and the API interface configuration file updating module is used for scanning and matching the calling mode, the interface name and the interface request type of the API interface to be called in the API directory file, generating a third interface configuration file if the scanning information is not successfully matched, adding the interface name, the interface request type, the overtime and the interception mode of the API interface to be called into the third interface configuration file, judging whether the return parameter is correct according to the input request parameter, adding the request parameter and the return parameter into the third interface configuration file if the return parameter is correct, and storing the third interface configuration file as a new configuration file.
8. The API encapsulated call system of claim 7, wherein the API interface profile updating module is configured to update the third interface profile and then add API directory information to the API directory file via the API directory file updating module.
CN202011445437.8A 2020-12-11 2020-12-11 API (application program interface) encapsulation calling method and system Active CN112631694B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011445437.8A CN112631694B (en) 2020-12-11 2020-12-11 API (application program interface) encapsulation calling method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011445437.8A CN112631694B (en) 2020-12-11 2020-12-11 API (application program interface) encapsulation calling method and system

Publications (2)

Publication Number Publication Date
CN112631694A CN112631694A (en) 2021-04-09
CN112631694B true CN112631694B (en) 2023-08-11

Family

ID=75309580

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011445437.8A Active CN112631694B (en) 2020-12-11 2020-12-11 API (application program interface) encapsulation calling method and system

Country Status (1)

Country Link
CN (1) CN112631694B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113766030B (en) * 2021-09-13 2023-05-26 城云科技(中国)有限公司 Automatic parameter entering method and device for interface constant parameters

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106484421A (en) * 2016-10-11 2017-03-08 武汉斗鱼网络科技有限公司 A kind of method and system quickly generating api interface
WO2017054531A1 (en) * 2015-09-30 2017-04-06 中兴通讯股份有限公司 Yang model-based compiling method, and corresponding interface, component, and system
CN106598851A (en) * 2016-12-05 2017-04-26 广州唯品会信息科技有限公司 Software interface test method and system
CN107423041A (en) * 2016-03-31 2017-12-01 阿里巴巴集团控股有限公司 Method and apparatus for realizing application programming interface configuration and calling
CN109857404A (en) * 2019-01-11 2019-06-07 平安科技(深圳)有限公司 The packaging method and device of SDK interface, storage medium, electronic equipment
CN110196733A (en) * 2019-06-06 2019-09-03 深圳市伊欧乐科技有限公司 A kind of default API document structure tree method, apparatus, equipment and storage medium
CN110333897A (en) * 2019-05-09 2019-10-15 重庆天蓬网络有限公司 A kind of interface allocation method, device, medium and electronic equipment
CN110489101A (en) * 2019-07-15 2019-11-22 北京字节跳动网络技术有限公司 Interface analogy method, system, medium and electronic equipment
CN110688142A (en) * 2019-10-10 2020-01-14 星环信息科技(上海)有限公司 Method, device and storage medium for publishing application programming interface
CN110908890A (en) * 2018-09-18 2020-03-24 亿阳信通股份有限公司 Automatic test method and device for interface
CN110990269A (en) * 2019-11-26 2020-04-10 苏宁云计算有限公司 Interface testing method, device and system
CN111488285A (en) * 2020-04-15 2020-08-04 北京字节跳动网络技术有限公司 Interface testing method and device, electronic equipment and computer readable storage medium
CN111782546A (en) * 2020-07-23 2020-10-16 北京斗米优聘科技发展有限公司 Automatic interface testing method and device based on machine learning
CN112035163A (en) * 2020-09-03 2020-12-04 北京字节跳动网络技术有限公司 Software development kit configuration method, device and storage medium
CN112052038A (en) * 2020-09-09 2020-12-08 云账户技术(天津)有限公司 Method and device for generating front-end interface

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104978176B (en) * 2014-04-10 2019-03-08 腾讯科技(北京)有限公司 Application programming interfaces call method, device and computer readable storage medium
US10839011B2 (en) * 2018-04-18 2020-11-17 International Business Machines Corporation Application programing interface document generator

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017054531A1 (en) * 2015-09-30 2017-04-06 中兴通讯股份有限公司 Yang model-based compiling method, and corresponding interface, component, and system
CN107423041A (en) * 2016-03-31 2017-12-01 阿里巴巴集团控股有限公司 Method and apparatus for realizing application programming interface configuration and calling
CN106484421A (en) * 2016-10-11 2017-03-08 武汉斗鱼网络科技有限公司 A kind of method and system quickly generating api interface
CN106598851A (en) * 2016-12-05 2017-04-26 广州唯品会信息科技有限公司 Software interface test method and system
CN110908890A (en) * 2018-09-18 2020-03-24 亿阳信通股份有限公司 Automatic test method and device for interface
CN109857404A (en) * 2019-01-11 2019-06-07 平安科技(深圳)有限公司 The packaging method and device of SDK interface, storage medium, electronic equipment
CN110333897A (en) * 2019-05-09 2019-10-15 重庆天蓬网络有限公司 A kind of interface allocation method, device, medium and electronic equipment
CN110196733A (en) * 2019-06-06 2019-09-03 深圳市伊欧乐科技有限公司 A kind of default API document structure tree method, apparatus, equipment and storage medium
CN110489101A (en) * 2019-07-15 2019-11-22 北京字节跳动网络技术有限公司 Interface analogy method, system, medium and electronic equipment
CN110688142A (en) * 2019-10-10 2020-01-14 星环信息科技(上海)有限公司 Method, device and storage medium for publishing application programming interface
CN110990269A (en) * 2019-11-26 2020-04-10 苏宁云计算有限公司 Interface testing method, device and system
CN111488285A (en) * 2020-04-15 2020-08-04 北京字节跳动网络技术有限公司 Interface testing method and device, electronic equipment and computer readable storage medium
CN111782546A (en) * 2020-07-23 2020-10-16 北京斗米优聘科技发展有限公司 Automatic interface testing method and device based on machine learning
CN112035163A (en) * 2020-09-03 2020-12-04 北京字节跳动网络技术有限公司 Software development kit configuration method, device and storage medium
CN112052038A (en) * 2020-09-09 2020-12-08 云账户技术(天津)有限公司 Method and device for generating front-end interface

Also Published As

Publication number Publication date
CN112631694A (en) 2021-04-09

Similar Documents

Publication Publication Date Title
RU2595890C2 (en) Method and device for execution of user activity commands
CN107807841B (en) Server simulation method, device, equipment and readable storage medium
CN110149363A (en) A kind of information push method, device and storage medium
CN108089985B (en) Method, device and equipment for verifying interface return parameters and readable storage medium
CN112199300A (en) Interface testing method and device, electronic equipment and storage medium
CN113672441A (en) Method and device for testing intelligent equipment
CN112631694B (en) API (application program interface) encapsulation calling method and system
CN110320378B (en) Method, apparatus, device and computer readable storage medium for applying for a quality control test
CN110515924B (en) Database operation logic verification method, device, equipment and readable storage medium
CN112749355B (en) Page display method, device, terminal, server and storage medium
CN114647412A (en) Content display method and terminal equipment
CN112035163A (en) Software development kit configuration method, device and storage medium
CN112650689A (en) Test method, test device, electronic equipment and storage medium
CN109766123B (en) Application program packaging method and device
CN110874278A (en) Embedding method of external system, workflow system, device and storage medium
CN107864038B (en) Certificate management method, device, equipment and computer readable storage medium
CN112069430B (en) Quick application preview method and device, electronic equipment and storage medium
WO2015062494A1 (en) Method and device for sdk uploading and downloading of a file
CN115016836A (en) Component version management method and device, electronic equipment and system
RU2595763C2 (en) Method and apparatus for managing load on basis of android browser
CN112685071A (en) Application program repairing method, device, equipment and storage medium
CN112083945A (en) NPM installation package update prompting method and device, electronic equipment and storage medium
CN116303062B (en) Service interface testing method and device, terminal equipment and readable storage medium
CN112235784B (en) vSIM-based code number management method, device and equipment
CN105677453B (en) Task processing method and device for task platform

Legal Events

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