CN113703862A - Configuration-based interface calling method, device, equipment and storage medium - Google Patents

Configuration-based interface calling method, device, equipment and storage medium Download PDF

Info

Publication number
CN113703862A
CN113703862A CN202110783169.9A CN202110783169A CN113703862A CN 113703862 A CN113703862 A CN 113703862A CN 202110783169 A CN202110783169 A CN 202110783169A CN 113703862 A CN113703862 A CN 113703862A
Authority
CN
China
Prior art keywords
interface
request
configuration file
calling
party
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
CN202110783169.9A
Other languages
Chinese (zh)
Other versions
CN113703862B (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.)
New H3C Big Data Technologies Co Ltd
Original Assignee
New H3C Big Data Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Big Data Technologies Co Ltd filed Critical New H3C Big Data Technologies Co Ltd
Priority to CN202110783169.9A priority Critical patent/CN113703862B/en
Publication of CN113703862A publication Critical patent/CN113703862A/en
Application granted granted Critical
Publication of CN113703862B publication Critical patent/CN113703862B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The disclosure provides a configuration-based interface calling method, device, equipment and storage medium, which are used for solving the technical problem of low interface docking and use efficiency. According to the method and the device, the local service code and the calling code of the third-party interface are decoupled through the customized interface configuration file, the interface calling request is constructed according to the request method, the request path and the request parameter configured by the interface configuration file, the required result data of the target field is analyzed and extracted from the result response data according to the corresponding relation of the target field configured in the interface configuration file, the writing of repeated codes is reduced, and the docking and using efficiency based on the interface capability among manufacturers is improved.

Description

Configuration-based interface calling method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of cloud computing technologies, and in particular, to a configuration-based interface calling method, apparatus, device, and storage medium.
Background
At present, cloud computing is more and more popular, numerous manufacturers provide rich cloud capacity through REST APIs (Representational State Transfer Application interfaces), but each manufacturer provides different REST APIs for platforms, systems and applications, calling methods and data analysis methods of the various REST API interfaces are different, if the cloud capacity of different manufacturers needs to be integrated, different codes need to be written to access the REST APIs of each manufacturer and system, data processing of the REST APIs provided by each manufacturer needs to be analyzed in a hard coding mode in the codes, a large number of codes need to be written to process different REST APIs of different manufacturers, and even different versions of the REST APIs of the same manufacturer need to be written to process different codes, so that time, labor and errors are wasted and easy to occur. In addition, since the calls and data handling of the REST API are hard-coded in the code, any minor changes to the REST API may result in the need to rewrite the code, recompile the debugging. Due to the technical defects, the cloud capability of each manufacturer cannot be efficiently connected and used.
Disclosure of Invention
In view of this, the present disclosure provides a configuration-based interface calling method, apparatus, device and storage medium, which are used to solve the technical problem of low interface docking and use efficiency.
Based on one aspect of the embodiments of the present disclosure, the present disclosure provides a configuration-based interface calling method, which implements calling and parsing of a third-party interface based on an interface configuration file, and includes:
reading and analyzing an interface configuration file and an interface parameter file; the interface configuration file is configured with a request method, a request path and a request parameter for calling a third-party interface, and a corresponding relation between a local target field and a target field in response result data of the third-party interface; the interface parameter file is used for providing parameter values for the request parameters configured in the interface configuration file;
constructing a URL (uniform resource locator) for calling the third-party interface based on a request path and request parameters configured by the interface configuration file, and constructing a request body of the interface; generating and initiating an interface calling request of the third-party interface based on the constructed URL for calling the third-party interface, an interface request method configured by an interface configuration file and the constructed request body;
and after receiving the response result data returned by the third-party interface, assigning the value of the target field in the response result data to the local target field according to the corresponding relation between the local target field configured in the interface configuration file and the target field in the response result data of the third-party interface.
Further, the construction mode of the request body is carried out based on the configuration in the interface configuration file.
Further, the third-party interface is a presentation layer state transition application program interface (REST) API interface.
Further, the interface configuration file and the interface parameter file adopt a JSON format.
On the other hand, the present disclosure further provides a device for invoking an interface based on configuration, where the device invokes and parses a third-party interface based on an interface configuration file, and the device includes:
the configuration file analysis module is used for reading and analyzing the interface configuration file and the interface parameter file; the interface configuration file is configured with a request method, a request path and a request parameter for calling a third-party interface, and a corresponding relation between a local target field and a target field in response result data of the third-party interface; the interface parameter file is used for providing parameter values for the request parameters configured in the interface configuration file;
the interface calling module is used for constructing and calling a URL (uniform resource locator) of the third-party interface based on a request path and request parameters configured by an interface configuration file and constructing a request body of the interface; generating and initiating an interface calling request of the third-party interface based on the constructed URL for calling the third-party interface, an interface request method configured by an interface configuration file and the constructed request body;
and the result data extraction module is used for assigning the value of the target field in the response result data to the local target field according to the corresponding relation between the local target field configured in the interface configuration file and the target field in the response result data of the third-party interface after receiving the response result data returned by the third-party interface.
According to another embodiment of the present disclosure, the interface calling module constructs the request body based on a configuration in an interface configuration file.
According to another embodiment of the present disclosure, the third-party interface is a presentation layer state transition application program interface REST API interface.
According to another embodiment of the present disclosure, the interface configuration file and the interface parameter file adopt JSON format.
The disclosure provides a configuration-based interface calling method, device, equipment and storage medium, which are used for solving the technical problem of low interface docking and use efficiency. According to the method and the device, the local service code and the calling code of the third-party interface are decoupled through the customized interface configuration file, the interface calling request is constructed according to the request method, the request path and the request parameter configured by the interface configuration file, the required result data of the target field is analyzed and extracted from the result response data according to the corresponding relation of the target field configured in the interface configuration file, the writing of repeated codes is reduced, and the docking and using efficiency based on the interface capability among manufacturers is improved.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments of the present disclosure or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present disclosure, and other drawings can be obtained by those skilled in the art according to the drawings of the embodiments of the present disclosure.
Fig. 1 is a flowchart illustrating steps of a configuration-based interface calling method according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of an apparatus according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an electronic device implementing a configuration-based interface calling method according to an embodiment of the present disclosure.
Detailed Description
The terminology used in the embodiments of the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the embodiments of the present disclosure. As used in the embodiments of the present disclosure, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. The term "and/or" as used in this disclosure is meant to encompass any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information in the embodiments of the present disclosure, such information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of embodiments of the present disclosure. Depending on the context, moreover, the word "if" as used may be interpreted as "at … …" or "when … …" or "in response to a determination".
The disclosure aims to provide a configuration-based interface calling method, which aims to access any REST API and complete data processing through a single and stable processing framework, and no different codes need to be developed for different manufacturer systems, so that stable and efficient delivery of software projects is ensured.
Fig. 1 is a flowchart of steps of a configuration-based interface calling method according to an embodiment of the present disclosure, where the method calls and analyzes a third-party interface based on an interface configuration file, and includes the following steps:
s101, reading and analyzing an interface configuration file and an interface parameter file; the interface configuration file is configured with a request method, a request path and a request parameter for calling a third-party interface, and a corresponding relation between a local target field and a target field in response result data of the third-party interface; the interface parameter file is used for providing parameter values for the request parameters configured in the interface configuration file;
s102, constructing a URL (uniform resource locator) for calling the third-party interface based on a request path and request parameters configured by an interface configuration file, and constructing a request body of the interface; generating and initiating an interface calling request of the third-party interface based on the constructed URL for calling the third-party interface, an interface request method configured by an interface configuration file and the constructed request body;
and S103, after response result data returned by the third-party interface is received, assigning the value of the target field in the response result data to the local target field according to the corresponding relation between the local target field configured in the interface configuration file and the target field in the response result data of the third-party interface.
The plurality of different third party interfaces correspond to different interface configuration files and interface parameter files. For different third-party interfaces, only the interface configuration files matched with the third-party interfaces need to be written, and local service codes and the like do not need to be modified.
The present disclosure provides a unified third-party interface calling and data transformation framework based on configuration files, which can be implemented by any web development tools such as spring boot, flash, tornado, play, and the like. The framework can decouple the local service code and the calling code of the third-party interface through the customized interface configuration file, construct an interface calling request according to the request method, the request path and the request parameters configured by the interface configuration file, and analyze and extract the required result data of the target field from the result response data according to the corresponding relation of the target field configured in the interface configuration file, thereby reducing the writing of repeated codes and improving the interface-based docking and using efficiency among manufacturers.
The following description will be made by taking a REST API interface descriptors, which is provided by a certain cloud manufacturer, for example, to query detailed information of one or more Elastic Computer Service (ECS) instances, to describe a specific implementation process:
s201, acquiring an interface use instruction from an interface provider;
the usage description of the interface is generally available from the official website of the interface provider, and for example, the information that can be extracted from the description of the Desscribes interfaces includes: request methods, interface request paths, etc.; the address is the uniform resource locator URL of the interface, etc.
An example of a DescripteInstances call given by a provider is as follows:
https://ecs.xxx.com/?Action=DescribeInstances&RegionId=cn-hangzhou&PageSize=1PageNumber=1。
as can be seen from the interface description, the request method of the interface is Get, the necessary request parameters of the interface are shown in table 1, and PageSize and PageNumber in the example are optional page size and page number parameters:
TABLE 1
Figure BDA0003157770250000051
After calling the Desscribes interfaces, the JSON format response result data returned by the interfaces are exemplified as follows:
Figure BDA0003157770250000061
Figure BDA0003157770250000071
wherein, the "Instances" tag in the interface request that can include the interface response includes an "Instance" tag that identifies multiple Instances in the area specified by the RegionId, and the "Instance" tag includes various attributes of the service Instance inside.
S202, establishing an interface configuration file in a JSON format matched with interface DescripteInstances based on the interface description of an interface provider;
one embodiment of the present disclosure generates the interface configuration file in JSON format, which is a subset based on ECMAScript (JS specification established by european computer association), and stores and represents data in a text form completely unrelated to programming language, and is a simple and efficient data representation and exchange form. JSON is simple and clear in hierarchical structure, easy to understand, read, write and use, and easy to analyze and generate various computer platforms and computer languages.
Based on the API interface description, an interface configuration file of the descriptors interfaces is created, which is exemplified as follows:
Figure BDA0003157770250000072
Figure BDA0003157770250000081
wherein "API" is a tag identifying the configuration of the API interface; the "method" tag is used to configure the request method; the "url" label is used to configure the request path of the interface; the "request _ parameters" tag is used for configuring the request parameters and parameter types of the calling interface; the "response _ base" tag is used to configure the resolved tag location in the interface response; the "response _ parser" tag is used to configure the conversion method of the interface response data, and includes a corresponding relationship between the local target field name and the target field name in the interface response result data, for example, the local target field "id" corresponds to the content of the target field "InstanceId" tag in the interface response data.
S203, before calling the DescriptInstances interface, generating an interface parameter file of the DescriptInstances interface according to the parameters and the parameter types specified in the interface configuration file, wherein the interface parameter file is used for providing parameter values for the request parameters specified in the interface configuration file;
s203, reading an interface request method, a request path and a request parameter from an interface configuration file of the DescriptieInstances interface, and reading a parameter value of the request parameter from an interface parameter file of the DescriptieInstances interface;
s204, constructing a complete Uniform Resource Locator (URL) for calling the DescriptInstances interface based on the request path and the request parameter read from the interface configuration file of the DescriptInstances interface;
s205, constructing a request body of the DescriptInstances interface, and generating and initiating an interface call request of the DescriptInstances interface based on the URL of the call interface, the interface request method and the request body.
The method comprises the steps that a unified REST API interface processing framework is provided, interface configuration files of Desscribes interfaces are analyzed in the processing framework, information of the REST API interfaces needing to be called is obtained, the information comprises a request method (API. method), a request path (API. url), request parameters (API. request _ parameters) and the like, the framework uses the information for initiating parameters of the REST API interface calling requests, and finally correct interface calling requests are initiated.
In the following example, the invokeCommonRestAPI function constructs a descriptor instructions interface call request based on a descriptor instructions interface configuration file and an interface parameter file, and the return value of the invokeCommonRestAPI function is interface response data after the interface is called:
Figure BDA0003157770250000091
Figure BDA0003157770250000101
the ObjectMapper object is used for reading a legal JSON character string and converting the JSonnode object into a JSonnode object. JsonNode is a class in Java that represents JSON, and is constructed by ObjectMapper from the contents within the "api" tag in the interface configuration file specified by apiConfig. And the Objectmapper constructs a Json object for reading the contents of the interface parameter file according to the interface parameter file specified by the apiValue. After reading the interface parameters and the parameter values from the interface configuration file and the interface parameter file, the URL of the complete calling interface, i.e. aip _ URL in the example, is spliced with the request path. Finally, an interface call request of the DescriptInstances interface is generated and initiated by the exchange function based on parameters such as the URL (uniform resource locator) of the call interface, namely aip _ URL, the interface request method httpMethod, the request body httpEntity and the like, and the return result of the exchange function is interface response data.
The construction mode of the request body httpEntity can be configured in the interface configuration file. For example, according to the interface description of different third-party interfaces, key configuration information of the construction request body, such as tag contents of "Content-Type", "Accept", and the like, is configured in the interface configuration file.
S206, after response result data returned by the DescripteInstances interface is received, the corresponding relation between the local target field configured in the interface configuration file and the target field in the response result data of the third-party interface is read, and the value of the target field in the response result data is assigned to the local target field according to the corresponding relation.
The interface configuration file based on the DescripteInstances interface analyzes the response result data, the response result data returned by the DescripteInstances interface is converted into a local standard and unified form, and the example of completing the data processing is as follows:
Figure BDA0003157770250000111
Figure BDA0003157770250000121
the common responseParser function has an input parameter apiConfig as an interface configuration file of the DescripteseInstances interface, and a responseValue parameter as a response result data file returned by the interface after calling the DescripteseInstances interface. The "response _ base" tag in the interface configuration file specifies the tag "instances. The "response _ parser" tag in the interface configuration file indicates the target field to be parsed from the interface response result data, and the corresponding relationship between the local target field name and the target field in the interface response result data.
The common responseprarer function reads interface response result data into a basedValue object, reads parameters needing analysis from an interface configuration file to generate a responseprarer object, then reads a Value of a target field in the responseprarer from the basedValue, and stores a read target field result into a result object, wherein a Key in a Key-Value pair (Key-Value) contained in the result object is a locally and uniformly named target field name, and the Value is a return Value corresponding to the local target field in the response result data.
For example, the "response _ server" tag in the interface configuration file of the Descriptesenstances interface includes a configuration "name: instanceName: String", meaning that the local target field "name" corresponds to the target field "instanceName" in the interface response result data, the target field type is a String String type, the local target field name "is a local unified attribute name specified by the processing frame, and the instanceName is an attribute name of the interface provider. Finally, the common responseprarer function takes the 'name' as a Key, takes the tag Value of the 'InstanceName' in the response result data as Value, and writes the Value into a result object, and finally the result object contains the Key-Value pairs of all local target fields set by all 'response _ parser' tags.
In the embodiment, based on the JSON configuration file, the part butted with the interface provided by the third party is separated, the corresponding relation between the locally unified target field and the target field of the interface provider is established by configuring the interface calling method through the interface configuration file, the code called by the interface can be prevented from being hard coded into the service code, stable and robust API interface calling and analysis can be realized, when the interface version is changed, the service code does not need to be modified, only the JSON configuration file needs to be updated, convenience is brought to development of various platforms, software and tools which need to access the API interfaces provided by a plurality of third parties, writing of repeated codes is reduced, and efficient butting and use of cloud capability based on the API interfaces among manufacturers are improved.
Fig. 2 is a schematic structural diagram of an interface invoking device based on configuration according to an embodiment of the present disclosure, and each functional module in the device 200 may be implemented by software, hardware, or a combination of software and hardware. The present disclosure also provides a device for calling an interface based on configuration, where the device 200 implements calling and parsing of a third-party interface based on an interface configuration file, and the device 200 includes:
a configuration file analysis module 201, configured to read and analyze an interface configuration file and an interface parameter file; the interface configuration file is configured with a request method, a request path and a request parameter for calling a third-party interface, and a corresponding relation between a local target field and a target field in response result data of the third-party interface; the interface parameter file is used for providing parameter values for the request parameters configured in the interface configuration file;
the interface calling module 202 is used for constructing and calling a URL (uniform resource locator) of the third-party interface based on a request path and request parameters configured by an interface configuration file and constructing a request body of the interface; generating and initiating an interface calling request of the third-party interface based on the constructed URL for calling the third-party interface, an interface request method configured by an interface configuration file and the constructed request body;
and the result data extraction module 203 is configured to, after receiving the response result data returned by the third party interface, assign a value of the target field in the response result data to the local target field according to a corresponding relationship between the local target field configured in the interface configuration file and the target field in the response result data of the third party interface.
Further, the third party interface is a presentation layer state transition application program interface REST API interface. The interface configuration file and the interface parameter file adopt JSON format.
In another embodiment of the present disclosure, the interface invocation module 202 constructs the request body based on the configuration in the interface configuration file.
Fig. 3 is a schematic structural diagram of an electronic device for implementing a configuration-based interface calling method according to an embodiment of the present disclosure, where the device 300 includes: a processor 310, such as a Central Processing Unit (CPU), a communication bus 320, a communication interface 340, and a storage medium 330. Wherein the processor 310 and the storage medium 330 may communicate with each other through a communication bus 320. The storage medium 330 stores therein a computer program that, when executed by the processor 310, performs the functions of the steps of the methods provided by the present disclosure.
The storage medium may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. In addition, the storage medium may be at least one memory device located remotely from the processor. The Processor may be a general-purpose Processor including a Central Processing Unit (CPU), a Network Processor (NP), etc.; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
It should be recognized that embodiments of the present disclosure can be realized and implemented by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory memory. The method may be implemented in a computer program using standard programming techniques, including a non-transitory storage medium configured with the computer program, where the storage medium so configured causes a computer to operate in a specific and predefined manner. Each program may be implemented in a high level procedural or object oriented programming language to communicate with a computer system. However, the program(s) can be implemented in assembly or machine language, if desired. In any case, the language may be a compiled or interpreted language. Furthermore, the program can be run on a programmed application specific integrated circuit for this purpose. Further, operations of processes described by the present disclosure may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes described in this disclosure (or variations and/or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions and may be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) executing collectively on one or more processors, by hardware, or combinations thereof. The computer program includes a plurality of instructions executable by one or more processors.
Further, the method may be implemented in any type of computing platform operatively connected to a suitable interface, including but not limited to a personal computer, mini computer, mainframe, workstation, networked or distributed computing environment, separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, and the like. Aspects of the disclosure may be embodied in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, optically read and/or write storage medium, RAM, ROM, or the like, such that it may be read by a programmable computer, which when read by the storage medium or device, is operative to configure and operate the computer to perform the procedures described herein. Further, the machine-readable code, or portions thereof, may be transmitted over a wired or wireless network. The invention described in this disclosure includes these and other different types of non-transitory computer-readable storage media when such media include instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor. The disclosure also includes the computer itself when programmed according to the methods and techniques described in this disclosure.
The above description is only an example of the present disclosure and is not intended to limit the present disclosure. Various modifications and variations of this disclosure will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure should be included in the protection scope of the present disclosure.

Claims (10)

1. A configuration-based interface calling method is characterized in that the method realizes calling and analysis of a third-party interface based on an interface configuration file, and the method comprises the following steps:
reading and analyzing an interface configuration file and an interface parameter file; the interface configuration file is configured with a request method, a request path and a request parameter for calling a third-party interface, and a corresponding relation between a local target field and a target field in response result data of the third-party interface; the interface parameter file is used for providing parameter values for the request parameters configured in the interface configuration file;
constructing a URL (uniform resource locator) for calling the third-party interface based on a request path and request parameters configured by the interface configuration file, and constructing a request body of the interface; generating and initiating an interface calling request of the third-party interface based on the constructed URL for calling the third-party interface, an interface request method configured by an interface configuration file and the constructed request body;
and after receiving the response result data returned by the third-party interface, assigning the value of the target field in the response result data to the local target field according to the corresponding relation between the local target field configured in the interface configuration file and the target field in the response result data of the third-party interface.
2. The method of claim 1,
the construction mode of the request body is carried out based on the configuration in the interface configuration file.
3. The method of claim 1,
and the third-party interface is a presentation layer state conversion application program interface REST API interface.
4. The method of claim 1,
the interface configuration file and the interface parameter file adopt JSON format.
5. A configuration-based interface calling device is characterized in that the device calls and analyzes a third-party interface based on an interface configuration file, and the device comprises:
the configuration file analysis module is used for reading and analyzing the interface configuration file and the interface parameter file; the interface configuration file is configured with a request method, a request path and a request parameter for calling a third-party interface, and a corresponding relation between a local target field and a target field in response result data of the third-party interface; the interface parameter file is used for providing parameter values for the request parameters configured in the interface configuration file;
the interface calling module is used for constructing and calling a URL (uniform resource locator) of the third-party interface based on a request path and request parameters configured by an interface configuration file and constructing a request body of the interface; generating and initiating an interface calling request of the third-party interface based on the constructed URL for calling the third-party interface, an interface request method configured by an interface configuration file and the constructed request body;
and the result data extraction module is used for assigning the value of the target field in the response result data to the local target field according to the corresponding relation between the local target field configured in the interface configuration file and the target field in the response result data of the third-party interface after receiving the response result data returned by the third-party interface.
6. The apparatus of claim 5,
the interface calling module constructs the request body based on the configuration in the interface configuration file.
7. The apparatus of claim 5,
and the third-party interface is a presentation layer state conversion application program interface REST API interface.
8. The apparatus of claim 5,
the interface configuration file and the interface parameter file adopt JSON format.
9. An electronic device is characterized by comprising a processor, a communication interface, a storage medium and a communication bus, wherein the processor, the communication interface and the storage medium are communicated with each other through the communication bus;
a storage medium for storing a computer program;
a processor for performing the method steps of any one of claims 1 to 4 when executing a computer program stored on a storage medium.
10. A storage medium on which a computer program is stored which, when being executed by a processor, carries out the method steps of any one of claims 1 to 4.
CN202110783169.9A 2021-07-12 2021-07-12 Configuration-based interface calling method, device, equipment and storage medium Active CN113703862B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110783169.9A CN113703862B (en) 2021-07-12 2021-07-12 Configuration-based interface calling method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110783169.9A CN113703862B (en) 2021-07-12 2021-07-12 Configuration-based interface calling method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113703862A true CN113703862A (en) 2021-11-26
CN113703862B CN113703862B (en) 2024-08-06

Family

ID=78648482

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110783169.9A Active CN113703862B (en) 2021-07-12 2021-07-12 Configuration-based interface calling method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113703862B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113989011A (en) * 2021-12-28 2022-01-28 深圳华锐金融技术股份有限公司 Market data processing method and device, computer equipment and readable storage medium
CN114969482A (en) * 2022-05-30 2022-08-30 中国平安财产保险股份有限公司 Method for automatically completing request by online configuration interface and related equipment thereof
CN115269066A (en) * 2022-09-19 2022-11-01 平安银行股份有限公司 Interface calling method, device and storage medium
CN115811513A (en) * 2023-02-08 2023-03-17 广州市玄武无线科技股份有限公司 Third-party interface request design method, device and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018201978A1 (en) * 2017-05-04 2018-11-08 平安科技(深圳)有限公司 Interface call data processing method, apparatus, computer device and storage medium
US20190230169A1 (en) * 2018-01-24 2019-07-25 Salesforce.Com, Inc. INTEGRATING THIRD-PARTY VENDORS' APIs
CN110780855A (en) * 2019-09-29 2020-02-11 苏州浪潮智能科技有限公司 Method, device and system for uniformly managing and controlling interface
CN111258884A (en) * 2020-01-08 2020-06-09 福建博思软件股份有限公司 System for automatically generating interface accuracy verification script
CN111638983A (en) * 2020-05-28 2020-09-08 深圳壹账通智能科技有限公司 Interface calling method, interface calling device and terminal equipment
CN112015483A (en) * 2020-08-07 2020-12-01 北京浪潮数据技术有限公司 POST request parameter automatic processing method and device and readable storage medium
CN112422566A (en) * 2020-11-18 2021-02-26 青岛海尔科技有限公司 Remote call processing method and device, storage medium and electronic device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018201978A1 (en) * 2017-05-04 2018-11-08 平安科技(深圳)有限公司 Interface call data processing method, apparatus, computer device and storage medium
US20190230169A1 (en) * 2018-01-24 2019-07-25 Salesforce.Com, Inc. INTEGRATING THIRD-PARTY VENDORS' APIs
CN110780855A (en) * 2019-09-29 2020-02-11 苏州浪潮智能科技有限公司 Method, device and system for uniformly managing and controlling interface
CN111258884A (en) * 2020-01-08 2020-06-09 福建博思软件股份有限公司 System for automatically generating interface accuracy verification script
CN111638983A (en) * 2020-05-28 2020-09-08 深圳壹账通智能科技有限公司 Interface calling method, interface calling device and terminal equipment
CN112015483A (en) * 2020-08-07 2020-12-01 北京浪潮数据技术有限公司 POST request parameter automatic processing method and device and readable storage medium
CN112422566A (en) * 2020-11-18 2021-02-26 青岛海尔科技有限公司 Remote call processing method and device, storage medium and electronic device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
马强;刘佩林;: "基于编程语言结构的通用配置代码生成方法", 计算机工程, no. 18, 20 September 2010 (2010-09-20) *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113989011A (en) * 2021-12-28 2022-01-28 深圳华锐金融技术股份有限公司 Market data processing method and device, computer equipment and readable storage medium
CN114969482A (en) * 2022-05-30 2022-08-30 中国平安财产保险股份有限公司 Method for automatically completing request by online configuration interface and related equipment thereof
CN115269066A (en) * 2022-09-19 2022-11-01 平安银行股份有限公司 Interface calling method, device and storage medium
CN115811513A (en) * 2023-02-08 2023-03-17 广州市玄武无线科技股份有限公司 Third-party interface request design method, device and storage medium

Also Published As

Publication number Publication date
CN113703862B (en) 2024-08-06

Similar Documents

Publication Publication Date Title
CN109976761B (en) Software development kit generation method and device and terminal equipment
CN110162296B (en) Method and device for generating application programming interface document and terminal equipment
CN113703862A (en) Configuration-based interface calling method, device, equipment and storage medium
CN108156022B (en) Service calling method and device and electronic equipment
CN108108162B (en) Application programming interface generation method and device
CN110489120B (en) Page development method based on components and server
CN111428462A (en) Communication protocol template construction method and terminal equipment
CN111026931B (en) Data query method, device, equipment and medium
CN108829467B (en) Third-party platform docking implementation method, device, equipment and storage medium
CN112765023A (en) Test case generation method and device
CN110688096B (en) Method and device for constructing application program containing plug-in, medium and electronic equipment
US11321090B2 (en) Serializing and/or deserializing programs with serializable state
US11366704B2 (en) Configurable analytics for microservices performance analysis
US20220284371A1 (en) Method, device and medium for a business function page
CN110647316A (en) Method and device for generating universal business object, computer equipment and storage medium
CN116028028B (en) Request function generation method, device, equipment and storage medium
CN102693238B (en) Widget application process, system and multimedia terminal
CN110109671A (en) A kind of webpack label sizes pattern conversion method and device
CN113391972A (en) Interface testing method and device
CN117850792A (en) Intelligent contract analysis method and device and computer equipment
CN112699027A (en) Interface testing method, device, equipment and readable storage medium
CN109240660B (en) Access method of advertisement data, storage medium, electronic device and system
CN113626001B (en) API dynamic arrangement method and device based on script
CN115982199A (en) Data query method, server, device and storage medium
CN112104544B (en) Method and device for sending dynamic mail based on Freemarker

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