CN114528044B - Interface calling method, device, equipment and medium - Google Patents

Interface calling method, device, equipment and medium Download PDF

Info

Publication number
CN114528044B
CN114528044B CN202210144667.3A CN202210144667A CN114528044B CN 114528044 B CN114528044 B CN 114528044B CN 202210144667 A CN202210144667 A CN 202210144667A CN 114528044 B CN114528044 B CN 114528044B
Authority
CN
China
Prior art keywords
parameter
mapping
field
target
interface
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
CN202210144667.3A
Other languages
Chinese (zh)
Other versions
CN114528044A (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.)
Shenzhen Lexin Software Technology Co Ltd
Original Assignee
Shenzhen Lexin Software Technology 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 Shenzhen Lexin Software Technology Co Ltd filed Critical Shenzhen Lexin Software Technology Co Ltd
Priority to CN202210144667.3A priority Critical patent/CN114528044B/en
Publication of CN114528044A publication Critical patent/CN114528044A/en
Application granted granted Critical
Publication of CN114528044B publication Critical patent/CN114528044B/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/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
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • 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 embodiment of the invention discloses an interface calling method, an interface calling device, interface calling equipment and a medium. The interface calling method comprises the following steps: responding to an interface call request of a target interface, and acquiring at least one target parameter entering field and target parameter entering data matched with the interface call request; acquiring a query mapping interface corresponding to a target interface, and acquiring a nesting type matched with the query mapping interface; the nesting type includes: nesting of the parameter entering fields and/or nesting of the parameter exiting fields; acquiring target parameter output data corresponding to a target parameter output field of a target interface according to the target parameter input field, the target parameter input data, the nesting type, the query mapping interface and the nesting processing result; and taking the target parameter-out data corresponding to the target parameter-out field of the target interface as a feedback result aiming at the interface call request. The technical scheme of the embodiment of the invention can avoid calling nested parameters through a newly added interface on the premise of not increasing the complexity of codes, and reduce the research and development workload, thereby rapidly responding to the service demand.

Description

Interface calling method, device, equipment and medium
Technical Field
The embodiment of the invention relates to the technical field of interface calling, in particular to an interface calling method, an interface calling device, interface calling equipment and an interface calling medium.
Background
Currently, in the heterogeneous collaboration, a standard interface of a third party is arranged and adapted with an interface of the partner.
However, the traditional interface calling mode requires a system to call interfaces for multiple times, protocol conversion is realized in a coding mode, interface nesting between multiple times of interface calling can increase the complexity of codes, and when the out-of-reference parameter in the partner interface has multi-layer set nested parameter definition, the requirement can only be realized through a newly-added interface, so that the service requirement cannot be responded in time, the research and development workload can be greatly increased, and the project period is prolonged.
Disclosure of Invention
The embodiment of the invention provides an interface calling method, device, equipment and medium, which are used for avoiding calling nested parameters through a newly added interface on the premise of not increasing the complexity of codes, reducing the workload of research and development and further rapidly responding to service demands.
In a first aspect, an embodiment of the present invention provides an interface calling method, including:
responding to an interface call request of a target interface, and acquiring at least one target parameter entering field matched with the interface call request and target parameter entering data respectively corresponding to each target parameter entering field;
Acquiring a query mapping interface corresponding to a target interface, and acquiring a nesting type matched with the query mapping interface; the nesting type includes: nesting of the parameter entering fields and/or nesting of the parameter exiting fields;
acquiring target parameter output data corresponding to at least one target parameter output field of the target interface according to the target parameter input field, the target parameter input data, the nesting type, the query mapping interface and the nesting processing result;
the nesting processing result comprises the following steps: a parameter entering nested processing result corresponding to the target parameter entering data and/or a parameter exiting nested processing result corresponding to the mapped parameter exiting data output by the query mapping interface;
and taking the target parameter-out data corresponding to at least one target parameter-out field of the target interface as a feedback result aiming at the interface call request.
In a second aspect, an embodiment of the present invention further provides an interface calling device, including:
the target entry parameter data acquisition module is used for responding to an interface call request of a target interface and acquiring at least one target entry parameter field matched with the interface call request and target entry parameter data respectively corresponding to each target entry parameter field;
the interface acquisition module is used for acquiring a query mapping interface corresponding to the target interface and acquiring a nesting type matched with the query mapping interface; the nesting type includes: nesting of the parameter entering fields and/or nesting of the parameter exiting fields;
The target parameter outputting data acquisition module is used for acquiring target parameter outputting data corresponding to at least one target parameter outputting field of the target interface according to the target parameter inputting field, the target parameter inputting data, the nesting type, the query mapping interface and the nesting processing result;
the nesting processing result comprises the following steps: a parameter entering nested processing result corresponding to the target parameter entering data and/or a parameter exiting nested processing result corresponding to the mapped parameter exiting data output by the query mapping interface;
and the feedback result determining module is used for taking the target parameter-outputting data corresponding to at least one target parameter-outputting field of the target interface as a feedback result for the interface calling request.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
one or more processors;
a storage means for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the interface invocation methods provided by any of the embodiments of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer storage medium, on which a computer program is stored, which when executed by a processor implements the interface calling method provided by any embodiment of the present invention.
According to the technical scheme of the embodiment, at least one target parameter entering field matched with the interface calling request and target parameter entering data respectively corresponding to each target parameter entering field are obtained through responding to the interface calling request of the target interface, the query mapping interface corresponding to the target interface is obtained, nesting types including parameter entering field nesting and/or parameter exiting field nesting matched with the query mapping interface are obtained, and accordingly target parameter exiting data corresponding to at least one target parameter exiting field of the target interface is obtained according to the target parameter entering field, the target parameter entering data, the nesting types, the query mapping interface and the nesting processing result, and further target parameter exiting data corresponding to at least one target parameter exiting field of the target interface is used as a feedback result for the interface calling request. When the target parameter entering field and/or the target parameter exiting field are nested, target parameter exiting data corresponding to the target parameter exiting field can be obtained according to the target parameter entering field, the target parameter entering data, the nesting type, the query mapping interface and the nesting processing result, and an interface for performing nested calling is not required to be configured for the field (the target parameter entering field and/or the target parameter exiting field) with the nesting, namely interface nesting among multiple interface calls is avoided, the problems that in the prior art, code complexity is high, when the parameter definition of multi-layer set nesting is carried out by the parameter entering parameter exiting parameter, service requirements cannot be responded in time due to the fact that only interfaces are added, research and development workload is large and project period is prolonged due to the fact that the nesting parameters are prevented from being called through the newly added interface are solved, and therefore the service requirements are responded rapidly.
Drawings
FIG. 1 is a flowchart of an interface calling method according to a first embodiment of the present invention;
FIG. 2 is a flowchart of an interface calling method according to a second embodiment of the present invention;
FIG. 3 is a flow chart of an interface call according to a second embodiment of the present invention;
FIG. 4 is a configuration interface of a target out-parameter field and an out-parameter mapping field according to a second embodiment of the present invention;
fig. 5 is a schematic diagram of an interface calling device according to a third embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof.
It should be further noted that, for convenience of description, only some, but not all of the matters related to the present invention are shown in the accompanying drawings. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart depicts operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently, or at the same time. Furthermore, the order of the operations may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figures. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Example 1
Fig. 1 is a flowchart of an interface calling method according to an embodiment of the present invention, where the method may be performed by an interface calling device, and the device may be implemented by software and/or hardware, and may be generally integrated in an electronic device, where the method is applicable to a case where no nested parameter is called by a new interface. The electronic device may be a terminal device, a server device, or the like, and the embodiment of the present invention does not limit the type of the electronic device that executes the interface calling method. Accordingly, as shown in fig. 1, the method includes the following operations:
s110, responding to an interface call request of a target interface, and acquiring at least one target entry field matched with the interface call request and target entry data respectively corresponding to each target entry field.
The target interface may be an interface that needs to be called, and is used for performing data call and/or data processing, etc. By way of example, the target interface may be an interface provided by the interface developer for the user to invoke, and the target interface may also interact with data from a third party interface. The interface call request may be a request to call an interface. The target entry field may be a target interface configured entry field. The target entry parameter may be data that has a correspondence with a target entry field and needs to be input to the target interface.
In the embodiment of the invention, after receiving the interface call request, the interface call request can be parsed to determine the target interface matched with the interface call request, so that the interface call request of the target interface is responded, the target entry field of the target interface is parsed, at least one target entry field obtained by parsing is used as the target entry field matched with the interface call request of the target interface, and the target entry data respectively corresponding to each target entry field is further determined according to the field input to the target interface.
S120, acquiring a query mapping interface corresponding to the target interface, and acquiring a nesting type matched with the query mapping interface.
The query mapping interface may be an interface capable of performing data interaction with the target interface and having a data query function. Illustratively, the query mapping interface may be an interface provided by a third party that cooperates with an interface developer of the target interface, or the like. The nesting type may include: the parameter entry field nesting, and/or the parameter exit field nesting. The entry field nesting may be a nesting of entry fields of the target interface configuration that exist to characterize a nesting relationship of the entry fields of the target interface. The parameter-out field nest may be a nest in which parameter-out fields of the target interface configuration exist for characterizing a nesting relationship of parameter-out fields of the target interface. Optionally, the parameter entry field nesting may comprise at least one layer nesting of parameter entry fields of the target interface configuration. The parameter out field nest may include at least one layer nest of parameter out fields of the target interface configuration. By way of example, the parameter-out field nesting can be understood that one parameter-out field of the target interface configuration is nested with a plurality of parameter-out subfields, and each parameter-out subfield can be further nested. For example, the out-parameter field address of the target interface configuration may be nested with province, city and street three out-parameter subfields. Similarly, the parameter-entering field nesting can be understood as that one parameter-entering field of the target interface configuration is nested with a plurality of parameter-entering subfields, and each parameter-entering subfields can be further nested.
In the embodiment of the invention, the interface type of the target interface can be determined according to the interface call request of the target interface, so that the query mapping interface corresponding to the interface type of the target interface is determined according to the interface type of the target interface, and further the configuration data of the target interface is analyzed to obtain the parameter entering field nesting and/or parameter exiting field nesting matched with the query mapping interface.
S130, obtaining target parameter output data corresponding to at least one target parameter output field of the target interface according to the target parameter input field, the target parameter input data, the nesting type, the query mapping interface and the nesting processing result.
The target parameter out field may be a parameter out field of the target interface configuration. The target parameter output data can be data output by the target interface with a corresponding relation with the parameter output data configured by the target interface. The nesting processing result may be data associated with the entry field of the target interface, as determined from the entry field of the target interface and the nesting type. The nested processing results may include: and the parameter entering nested processing result corresponds to the target parameter entering data and/or the parameter exiting nested processing result corresponds to the mapped parameter exiting data output by the query mapping interface. The processing result of the parameter entering nesting can be the processing result of the target parameter entering field for parameter entering field nesting and field mapping with the query mapping interface. The parameter-out nesting processing result can be the processing result of performing parameter-out field nesting on the target parameter-out field and performing field mapping with the query mapping interface. The mapping out parameter data may be data output by the query mapping interface and having a corresponding relationship with the target out parameter field. The mapped out parameter data may include an out parameter field name and out parameter data corresponding to the out parameter field name. For example, the parameter-out data corresponding to the parameter-out field name in the mapped parameter-out data may be regarded as target parameter-out data.
In the embodiment of the invention, whether the target parameter entering field has parameter entering field nesting can be determined first, if the target parameter entering field has parameter entering field nesting, a parameter entering nesting processing result is determined according to the target parameter entering field, the target parameter entering data and the parameter entering field nesting, and further, parameter mapping data is determined according to the parameter entering nesting processing result and the query mapping interface. And if the target parameter entering field does not have parameter entering field nesting, determining to map out parameter data according to the target parameter entering field, the target parameter entering data and the query mapping interface. After the mapping parameter-out data is obtained, whether the parameter-out field nesting exists in the target parameter-out field of the target interface is further judged. And if the object parameter out field of the object interface is nested, determining object parameter out data corresponding to at least one object parameter out field of the object interface according to parameter out nesting processing results corresponding to the mapped parameter out data. And if the object parameter out field of the object interface does not have parameter out field nesting, determining object parameter out data corresponding to at least one object parameter out field of the object interface according to the mapped parameter out data.
And S140, taking the target parameter-out data corresponding to at least one target parameter-out field of the target interface as a feedback result for the interface call request.
In the embodiment of the invention, the target parameter-outputting data corresponding to at least one target parameter-outputting field of the target interface can be used as the response data of the interface call request to feed back the interface call request, thereby realizing the combined display of the target parameter-outputting data and the corresponding target parameter-outputting field.
According to the technical scheme of the embodiment, at least one target parameter entering field matched with the interface calling request and target parameter entering data respectively corresponding to each target parameter entering field are obtained through responding to the interface calling request of the target interface, the query mapping interface corresponding to the target interface is obtained, nesting types including parameter entering field nesting and/or parameter exiting field nesting matched with the query mapping interface are obtained, and accordingly target parameter exiting data corresponding to at least one target parameter exiting field of the target interface is obtained according to the target parameter entering field, the target parameter entering data, the nesting types, the query mapping interface and the nesting processing result, and further target parameter exiting data corresponding to at least one target parameter exiting field of the target interface is used as a feedback result for the interface calling request. When the target parameter entering field and/or the target parameter exiting field are nested, target parameter exiting data corresponding to the target parameter exiting field can be obtained according to the target parameter entering field, the target parameter entering data, the nesting type, the query mapping interface and the nesting processing result, and an interface for performing nested calling is not required to be configured for the field (the target parameter entering field and/or the target parameter exiting field) with the nesting, namely interface nesting among multiple interface calls is avoided, the problems that in the prior art, code complexity is high, when the parameter definition of multi-layer set nesting is carried out by the parameter entering parameter exiting parameter, service requirements cannot be responded in time due to the fact that only interfaces are added, research and development workload is large and project period is prolonged due to the fact that the nesting parameters are prevented from being called through the newly added interface are solved, and therefore the service requirements are responded rapidly.
Example two
Fig. 2 is a flowchart of an interface calling method according to a second embodiment of the present invention, which is implemented based on the foregoing embodiment, and in this embodiment, a specific alternative implementation manner of obtaining at least one target entry field matched with an interface calling request and target entry parameters respectively corresponding to each target entry field is given. Accordingly, as shown in fig. 2, the method includes the following operations:
s210, responding to an interface call request of a target interface, displaying at least one target parameter entering field according to the interface call request, and receiving target parameter entering data input by a user and respectively corresponding to each target parameter entering field.
In the embodiment of the invention, after receiving the interface call request, the interface call request can be analyzed, the target interface matched with the interface call request is determined, and further, the target entry data configured by the target interface is determined, so that the target entry data are displayed, and a user can input data according to the target entry data, so that the target entry data which are input by the user and respectively correspond to each target entry field are obtained.
In an alternative embodiment of the present invention, before responding to the interface call request to the target interface, the method may further include: and responding to the target data query request, and generating an interface call request according to the target data query request.
The target data query request may be a data query request for performing data query through the target interface, and is used for generating an interface call request of the target interface.
In the embodiment of the invention, after receiving the target data query request sent by the user, the type of the required call interface can be determined by analyzing the target data query request, so that the interface call request for the target interface is generated according to the type of the required call interface.
For example, a user may send a target data query request for querying personal basic information to an application published by a partner cooperating with a third party through a terminal, the application may generate an interface call request according to the target data query request, so as to call an interface (target interface) of the partner for querying personal basic information through the interface call request, and further display a target entry field (e.g., mobile, valid code, etc.) of the interface for querying personal basic information on the user's terminal, and the user may input target entry data according to the target entry field. For example, when the target entry fields are "mobile" and "valid", the target entry data input by the user may be an 11-bit mobile phone number and a verification code with a preset data length, and the following request message is generated:
{
"Mobile": "11-bit cell phone number",
"vailcode": verification code of preset data length "
}
S220, acquiring a query mapping interface corresponding to the target interface, and acquiring a nesting type matched with the query mapping interface.
S230, obtaining target parameter output data corresponding to at least one target parameter output field of the target interface according to the target parameter input field, the target parameter input data, the nesting type, the query mapping interface and the nesting processing result.
In an optional embodiment of the invention, obtaining target parameter output data corresponding to at least one target parameter output field of the target interface according to the target parameter input field, the target parameter input data, the nesting type, the query mapping interface and the nesting processing result may include: when the nesting type is determined to be only the nesting of the parameter entering fields, acquiring a parameter entering mapping protocol, inquiring the parameter entering field mapping relation corresponding to the inquiring mapping interface according to the parameter entering mapping protocol, and acquiring at least one parameter entering mapping field which has the parameter entering field mapping relation with each target parameter entering field; the plurality of target parameter entering fields correspond to the same parameter entering mapping field; determining parameter-entering nested mapping data according to the parameter-entering mapping field and the target parameter-entering data; inputting the mapping data of the input parameter nest into a query mapping interface, and obtaining mapping parameter output data corresponding to each parameter output mapping field, which is output by the query mapping interface; and obtaining target parameter outputting data corresponding to at least one target parameter outputting field of the target interface according to the one-to-one correspondence between the parameter outputting mapping field and the target parameter outputting field and the mapping parameter outputting data.
Wherein the reference-in mapping protocol may be a mapping protocol of a target reference-in field. The parameter entry field mapping relationship may be a mapping relationship of a target parameter entry field and a parameter entry mapping field determined by a parameter entry mapping protocol. Illustratively, the mapping relationship of the entry field may include a mapping relationship of the target entry field and the entry field in the query mapping interface, a mapping relationship of the target entry field and the entry field of a third party interface other than the query mapping interface, and so on. The parameter entry map field may be a parameter entry field having a parameter entry field mapping relationship with the target parameter entry field. Illustratively, the parameter-in mapping field may include a parameter-in field in the query mapping interface having a parameter-in field mapping relationship with the target parameter-in field, a parameter-in field of a third party interface other than the query mapping interface having a parameter-in field mapping relationship with the target parameter-in field, and so on. The parameter entry map field of the different interface having the parameter entry field map relationship with the target parameter entry field may be the same or different. In general, the parameter entry mapping fields of different interfaces having parameter entry field mapping relation with the target parameter entry field are the same field, so as to facilitate mutual communication between the interfaces.
The parameter entering nested mapping data can be part of data in the parameter entering nested processing result, and is determined by parameter entering mapping protocol and target parameter entering data, and the data needs to be input to a query mapping interface. The out-parameter mapping field may be data having a correspondence with the target out-parameter field in out-parameter mapping data. For example, the out-parameter mapping field may include an out-parameter field of a query mapping interface having a mapping relationship with the target out-parameter field, and an out-parameter field of a third party interface other than the query mapping interface having a mapping relationship with the target out-parameter field. The out-parameter mapping fields of different interfaces having a mapping relationship with the target out-parameter fields may be the same or different. In general, the parameter-out mapping fields of different interfaces having a mapping relationship with the target parameter-out field are the same field, so as to facilitate mutual communication between the interfaces.
In the embodiment of the invention, the nesting type of the target interface can be determined first, if the nesting type of the target interface is the parameter entering nesting type, the parameter entering mapping protocol is further acquired, and further the parameter entering mapping protocol is analyzed to obtain the parameter entering field mapping relation corresponding to the query mapping interface, so that at least one parameter entering mapping field having the parameter entering field mapping relation with each target parameter entering field is determined, wherein a plurality of target parameter entering fields correspond to the same parameter entering mapping field. After obtaining at least one parameter-entering mapping field corresponding to each target parameter-entering field, determining parameter-entering nested mapping data according to parameter-entering mapping protocols, parameter-entering mapping fields and target parameter-entering data, inputting the parameter-entering nested mapping data into a query mapping interface, performing data query through the query mapping interface, outputting mapped parameter-exiting data corresponding to each parameter-exiting mapping field, analyzing mapped parameter-exiting data according to one-to-one correspondence between parameter-exiting mapping fields and target parameter-exiting fields, and determining parameter-exiting data corresponding to parameter-exiting mapping fields, thereby determining target parameter-exiting data corresponding to at least one target parameter-exiting field of the target interface according to one-to-one correspondence between parameter-exiting mapping fields and target parameter-exiting data corresponding to parameter-exiting mapping fields.
In an optional embodiment of the invention, obtaining target parameter output data corresponding to at least one target parameter output field of the target interface according to the target parameter input field, the target parameter input data, the nesting type, the query mapping interface and the nesting processing result may include: when the nesting type is determined to be only the nesting of the parameter outputting field, the parameter inputting mapping field and the target parameter inputting data are input into the query mapping interface together according to the one-to-one correspondence between the parameter inputting mapping field and the target parameter inputting field; obtaining mapping parameter outputting data corresponding to each parameter outputting mapping field and output by a query mapping interface; obtaining a parameter-outputting mapping protocol, inquiring parameter-outputting field mapping relation corresponding to the inquiring mapping interface according to the parameter-outputting mapping protocol, and obtaining at least one target parameter-outputting field having parameter-outputting field mapping relation with each parameter-outputting mapping field; the plurality of parameter-outputting mapping fields correspond to the parameter-outputting field of the same target; and forming out-parameter nested mapping data as target out-parameter data corresponding to at least one target out-parameter field according to the out-parameter mapping protocol and the out-parameter data.
Wherein the out-reference mapping protocol may be a mapping protocol of the target out-reference field. The out-parameter field mapping relationship may be a mapping relationship of a target out-parameter field and an out-parameter mapping field determined by an out-parameter mapping protocol. The parameter-out nested mapping data can be part of data in parameter-out nested processing results, and is determined by parameter-out mapping protocol and parameter-out mapping data and used for generating feedback results of interface calling requests.
In the embodiment of the invention, the nesting type of the target interface can be determined first, if the nesting type of the target interface is the out-of-parameter nesting type, the one-to-one correspondence between the in-parameter mapping field and the target in-parameter field can be further determined, and then the in-parameter mapping field and the target in-parameter data are input into the query mapping interface together according to the one-to-one correspondence between the in-parameter mapping field and the target in-parameter data, and the query mapping interface determines and outputs the mapped out-parameter data corresponding to each out-parameter mapping field according to the in-parameter mapping field and the target in-parameter data. After the mapping parameter output data corresponding to each parameter output mapping field output by the query mapping interface is obtained, the parameter output mapping protocol of the target interface can be further obtained, and further the parameter output mapping protocol is analyzed to obtain the parameter output field mapping relation corresponding to the query mapping interface, so that at least one target parameter output field having the parameter output field mapping relation with each parameter output mapping field is determined, wherein a plurality of parameter output mapping fields correspond to the same target parameter output field. After obtaining at least one target parameter-out field having parameter-out field mapping relation with each parameter-out mapping field, the parameter-out field mapping relation can be further determined according to the parameter-out mapping protocol, and parameter-out field nesting and parameter-out data are further mapped to determine parameter-out nesting mapping data, and the parameter-out nesting mapping data are further used as target parameter-out data corresponding to the at least one target parameter-out field.
For example, an interface of a partner cooperating with the third party may determine, according to a mapping protocol, a mapping field "phone" having a mapping relation with a reference field of "mobile" in the target reference field, and a mapping field "verificationode" having a mapping relation with a reference field of "vailcode" in the target reference field. The mobile and the phone have a one-to-one correspondence, the vailcode and the verificationcode have a one-to-one correspondence, and then the target parameter data is mapped to the corresponding position after the corresponding parameter mapping field, and the following request message is generated:
{
"phone": "11-bit cell phone number",
"verifiation ncode": verification code of preset data length "
}
After the request message generated by the partner interface is obtained, the phone number and the 11-bit mobile phone number in the request message and the verification code of the preset data length can be input to the query mapping interface, and the query mapping interface can output a following response message which can be used as mapping out parameter data.
If it can be determined that the "le_name" of the partner interface (e.g., the query mapping interface) has an play field mapping relationship with the target play field "name", the "le_age" has an play field mapping relationship with the target play field "age", the "le_b ankcardlist" has an play field mapping relationship with the target play field "bankcandlist", the "le_cardno" has an play field mapping relationship with the target play field "carbno", the "le_bankname" has an play field mapping relationship with the target play field "bankName", the "le_address" has an play field mapping relationship with the target play field "address", the "le_property" has an play field mapping relationship with the target play field "ci", and the "le_street" has an play field mapping relationship with the target play field "street", the response is made to the request for the response of the interface (e.g., the query mapping interface) according to the play mapping protocol:
Wherein, the 'bankCardList' and the 'address' have the parameter out field nested. According to the response message of the target interface, when the target parameter-out field is 'name', the target parameter-out data is 'poplar xxx', when the target parameter-out field is 'age', the target parameter-out data is '21', and so on, the method can be used for determining. Similarly, all target out parameter fields of the target interface for inquiring the personal basic information and target out parameter data corresponding to the target out parameter fields can be determined.
It should be noted that, the data formats of the in-parameter mapping protocol and the out-parameter mapping protocol may be json text formats, and the specific protocol formats of the in-parameter mapping protocol refer to the following:
targeFieldName: the name of the mapped-in field that needs to be mapped.
targeFieldType: the data type of the mapping-in field that needs to be mapped.
sourceFieldValue: the target that needs to be mapped is entered into the data.
sourceFieldType: the data type of the target-entry data that needs to be mapped.
Model: pattern of mapping.
The specific protocol format of the out-reference mapping protocol is referred to as follows:
targetfieldname-the name of the destination out field that needs to be mapped.
targeFieldType: the data type of the target out-reference field that needs to be mapped.
sourceFieldValue: the value corresponding to the parameter-out mapping field that needs to be mapped.
sourceFieldType: the data type of the value corresponding to the out-parameter mapping field to be mapped.
Model: pattern of mapping.
In an alternative embodiment of the present invention, obtaining target parameter output data corresponding to at least one target parameter output field of the target interface according to the target parameter input field, the target parameter input data, the nesting type, the query mapping interface and the nesting processing result may include obtaining a parameter input mapping protocol when determining that the nesting type is parameter input field nesting and parameter output field nesting, and obtaining at least one parameter input mapping field having a parameter input field mapping relation with each target parameter input field according to the parameter input mapping protocol query and query mapping interface; the plurality of target parameter entering fields correspond to the same parameter entering mapping field; determining parameter-entering nested mapping data according to the parameter-entering mapping field and the target parameter-entering data; inputting the mapping data of the input parameter nest into a query mapping interface, and obtaining mapping parameter output data corresponding to each parameter output mapping field, which is output by the query mapping interface; obtaining a parameter-outputting mapping protocol, inquiring parameter-outputting field mapping relation corresponding to the inquiring mapping interface according to the parameter-outputting mapping protocol, and obtaining at least one target parameter-outputting field having parameter-outputting field mapping relation with each parameter-outputting mapping field; the plurality of parameter-outputting mapping fields correspond to the parameter-outputting field of the same target; and forming out-parameter nested mapping data as target out-parameter data corresponding to at least one target out-parameter field according to the out-parameter mapping protocol and the out-parameter data.
In the embodiment of the invention, the nesting type of the target interface can be determined for the first time, if the nesting type of the target interface is the nesting of the ginseng fields and the nesting of the ginseng fields, the ginseng-entering mapping protocol can be further acquired, and further the ginseng-entering mapping protocol is analyzed to obtain the ginseng-entering field mapping relation corresponding to the query mapping interface, so that at least one ginseng-entering mapping field with the ginseng-entering field mapping relation of each target is determined, and the plurality of target ginseng-entering fields correspond to the same ginseng-entering mapping field. After obtaining at least one parameter-entering mapping field corresponding to each target parameter-entering field, determining parameter-entering nested mapping data according to a parameter-entering mapping protocol, parameter-entering mapping fields and target parameter-entering data, inputting the parameter-entering nested mapping data into a query mapping interface, performing data query through the query mapping interface, outputting mapped parameter-exiting data corresponding to each parameter-exiting mapping field, further obtaining parameter-exiting mapping protocol of a target interface, and further analyzing the parameter-exiting mapping protocol to obtain parameter-exiting field mapping relation corresponding to the query mapping interface, thereby determining at least one target parameter-exiting field (a plurality of parameter-exiting mapping fields correspond to the same target parameter-exiting field) having parameter-exiting field mapping relation with each parameter-exiting mapping field. After obtaining at least one target parameter-out field having a parameter-in field mapping relation with each parameter-out field, the parameter-out field mapping relation can be further determined according to the parameter-out mapping protocol, and then parameter-out nested mapping data is determined according to the parameter-out field mapping relation, parameter-out field nesting and parameter-out data mapping, and further parameter-out nested mapping data is used as target parameter-out data corresponding to the at least one target parameter-out field.
In an alternative embodiment of the present invention, before acquiring the mapping protocol, the method may further include: determining a mapping relation of the parameter entering fields corresponding to the query mapping interface; generating a parameter entering mapping protocol according to the target parameter entering field, the parameter entering mapping field and the parameter entering field mapping relation.
In the embodiment of the invention, before the parameter entering mapping protocol is acquired, the parameter entering field mapping relation between the target parameter entering data and the parameter entering mapping field can be firstly determined, namely the parameter entering field mapping relation between the target parameter entering data and the parameter entering mapping field is used as the parameter entering field mapping relation corresponding to the query mapping interface, and then the parameter entering mapping protocol is generated according to the target parameter entering field, the parameter entering mapping field and the parameter entering field mapping relation, so that the corresponding relation between the target parameter entering data nested in the parameter entering field and the parameter entering mapping field is determined according to the parameter entering mapping protocol, and the parameter entering nested mapping data input to the query mapping interface is determined according to the corresponding relation between the target parameter entering data and the parameter entering mapping field.
In an alternative embodiment of the present invention, before acquiring the parameter mapping protocol, the method may further include: determining a mapping relation of the parameter-out fields corresponding to the query mapping interface; generating a parameter-outputting mapping protocol according to the parameter-outputting field of the target, the parameter-outputting mapping field and the parameter-outputting field mapping relation.
In the embodiment of the invention, before the parameter-outputting mapping protocol is obtained, the parameter-outputting field mapping relation between the target parameter-outputting data and the parameter-outputting mapping field can be determined first, namely, the parameter-outputting field mapping relation between the target parameter-outputting data and the parameter-outputting mapping field is used as the parameter-outputting field mapping relation corresponding to the query mapping interface, and then the parameter-outputting mapping protocol is generated according to the target parameter-outputting field, the parameter-outputting mapping field and the parameter-outputting field mapping relation, so that the corresponding relation between the target parameter-outputting data nested in the parameter-outputting field and the parameter-outputting mapping field is determined according to the parameter-outputting mapping protocol, and the target parameter-outputting data is queried from the mapped parameter-outputting data according to the corresponding relation between the target parameter-outputting data and the parameter-outputting mapping field.
S240, taking the target parameter-out data corresponding to at least one target parameter-out field of the target interface as a feedback result aiming at the interface call request.
Fig. 3 is a schematic flow chart of an interface call provided in the second embodiment of the present invention, as shown in fig. 3, a parameter-entering mapping protocol may be read first, and then a target parameter-entering field is traversed, when a nesting type does not include parameter-entering field nesting, simple mapping (one-to-one mapping) of the parameter-entering mapping field and the target parameter-entering field may be completed through a one-to-one mapping relationship between the parameter-entering mapping field and the target parameter-entering field, and then a request message of a partner interface cooperating with a third party is determined according to the parameter-entering mapping field, the target parameter-entering field and the target parameter-entering data, and then a query mapping interface is invoked, and a response message of the partner interface cooperating with the third party is obtained, and further a parameter-entering mapping protocol is read, and then a target parameter-exiting field is traversed, so that whether there is a parameter-exiting field nesting is determined according to a response message (i.e. parameter-exiting mapping data) of the partner interface cooperating with the third party, and if there is a parameter-exiting field, then a sub-nesting is completed according to the parameter-exiting field, and then a sub-nesting is completed. If the target parameter-outputting field does not have parameter-outputting field nesting, the simple mapping of the parameter-outputting mapping field and the target parameter-outputting field is completed through the one-to-one mapping relation between the parameter-outputting mapping field and the target parameter-outputting field, and then a response message of the target interface is generated according to the mapping result and the mapping parameter-outputting data.
Fig. 4 is a configuration interface of a target parameter-out field and parameter-out mapping field provided in a second embodiment of the present invention, as shown in fig. 4, the target parameter-out field of the target interface is test-nd1 and test-nd2, the field type of test-nd1 is a string type, and the field type of test-nd2 is an array. The out-reference mapping field with out-reference field mapping relation to test-nd1 is $logic-out-mockTestlist.A, and the out-reference mapping field with out-reference field mapping relation to test-nd2 is $logic-out-mockTestlist.B. the test-nd2 has a parameter-out field nest, and two parameter-in subfields of the test-nd21 and the test-nd22 are nested, and the data types of the two parameter-in subfields are character strings. Optionally, the data types of the target in-parameter field and the target out-parameter field may include, but are not limited to, string type, shaping, array, enumeration, map type, and the like.
According to the technical scheme of the embodiment, at least one target parameter entering field is displayed according to an interface calling request in response to the interface calling request of the target interface, target parameter entering data corresponding to each target parameter entering field respectively input by a user is received, then a query mapping interface corresponding to the target interface is obtained, a nested type including parameter entering fields and/or parameter exiting field nesting matched with the query mapping interface is obtained, and accordingly target parameter exiting data corresponding to at least one target parameter exiting field of the target interface is obtained according to the target parameter entering field, the target parameter entering data, the nested type, the query mapping interface and a nested processing result, and further target parameter exiting data corresponding to at least one target parameter exiting field of the target interface is used as a feedback result for the interface calling request. When the target parameter entering field and/or the target parameter exiting field are nested, target parameter exiting data corresponding to the target parameter exiting field can be obtained according to the target parameter entering field, the target parameter entering data, the nesting type, the query mapping interface and the nesting processing result, and an interface for performing nested calling is not required to be configured for the field (the target parameter entering field and/or the target parameter exiting field) with the nesting, namely interface nesting among multiple interface calls is avoided, the problems that in the prior art, code complexity is high, when the parameter definition of multi-layer set nesting is carried out by the parameter entering parameter exiting parameter, service requirements cannot be responded in time due to the fact that only interfaces are added, research and development workload is large and project period is prolonged due to the fact that the nesting parameters are prevented from being called through the newly added interface are solved, and therefore the service requirements are responded rapidly.
It should be noted that any permutation and combination of the technical features in the above embodiments also belong to the protection scope of the present invention.
In the technical scheme of the embodiment of the invention, the acquisition, application and the like of the related user personal information all accord with the regulations of related laws and regulations, and the public sequence is not in common use.
Example III
Fig. 5 is a schematic diagram of an interface calling device according to a third embodiment of the present invention, as shown in fig. 5, where the device includes: the target input parameter data acquisition module 310, the interface acquisition module 320, the target output parameter data acquisition module 330, and the feedback result determination module 340, wherein:
a target entry parameter data obtaining module 310, configured to obtain, in response to an interface call request to a target interface, at least one target entry parameter field matched with the interface call request and target entry parameter data corresponding to each target entry parameter field respectively;
the interface obtaining module 320 is configured to obtain a query mapping interface corresponding to the target interface, and obtain a nesting type matched with the query mapping interface; the nesting type includes: nesting of the parameter entering fields and/or nesting of the parameter exiting fields;
a target out-of-reference data obtaining module 330, configured to obtain target out-of-reference data corresponding to at least one target out-of-reference field of the target interface according to the target in-reference field, the target in-reference data, the nesting type, the query mapping interface, and the nesting processing result;
The nesting processing result comprises the following steps: a parameter entering nested processing result corresponding to the target parameter entering data and/or a parameter exiting nested processing result corresponding to the mapped parameter exiting data output by the query mapping interface;
the feedback result determining module 340 is configured to use the target parameter output data corresponding to at least one target parameter output field of the target interface as a feedback result for the interface call request.
According to the technical scheme of the embodiment, at least one target parameter entering field matched with the interface calling request and target parameter entering data respectively corresponding to each target parameter entering field are obtained through responding to the interface calling request of the target interface, the query mapping interface corresponding to the target interface is obtained, nesting types including parameter entering field nesting and/or parameter exiting field nesting matched with the query mapping interface are obtained, and accordingly target parameter exiting data corresponding to at least one target parameter exiting field of the target interface is obtained according to the target parameter entering field, the target parameter entering data, the nesting types, the query mapping interface and the nesting processing result, and further target parameter exiting data corresponding to at least one target parameter exiting field of the target interface is used as a feedback result for the interface calling request. When the target parameter entering field and/or the target parameter exiting field are nested, target parameter exiting data corresponding to the target parameter exiting field can be obtained according to the target parameter entering field, the target parameter entering data, the nesting type, the query mapping interface and the nesting processing result, and an interface for performing nested calling is not required to be configured for the field (the target parameter entering field and/or the target parameter exiting field) with the nesting, namely interface nesting among multiple interface calls is avoided, the problems that in the prior art, code complexity is high, when the parameter definition of multi-layer set nesting is carried out by the parameter entering parameter exiting parameter, service requirements cannot be responded in time due to the fact that only interfaces are added, research and development workload is large and project period is prolonged due to the fact that the nesting parameters are prevented from being called through the newly added interface are solved, and therefore the service requirements are responded rapidly.
Optionally, the target parameter-exiting data obtaining module 330 is specifically configured to obtain a parameter-entering mapping protocol when determining that the nesting type is only parameter-entering field nesting, and query a parameter-entering field mapping relationship corresponding to the query mapping interface according to the parameter-entering mapping protocol, to obtain at least one parameter-entering mapping field having a parameter-entering field mapping relationship with each target parameter-entering field; the plurality of target parameter entering fields correspond to the same parameter entering mapping field; determining the parameter entering nested mapping data according to the parameter entering mapping field and the target parameter entering data; inputting the parameter-entering nested mapping data into a query mapping interface, and obtaining mapping parameter-exiting data corresponding to each parameter-exiting mapping field, which is output by the query mapping interface; and obtaining target parameter outputting data corresponding to at least one target parameter outputting field of the target interface according to the one-to-one correspondence between the parameter outputting mapping field and the target parameter outputting field and the mapping parameter outputting data.
Optionally, the target parameter-out data obtaining module 330 is specifically configured to, when determining that the nesting type is only parameter-out field nesting, input the parameter-in mapping field and the target parameter-in data together into the query mapping interface according to a one-to-one correspondence between the parameter-in mapping field and the target parameter-in field; obtaining mapping parameter output data corresponding to each parameter output mapping field, which is output by the query mapping interface; obtaining a parameter-outputting mapping protocol, inquiring parameter-outputting field mapping relation corresponding to the inquiring mapping interface according to the parameter-outputting mapping protocol, and obtaining at least one target parameter-outputting field with parameter-inputting field mapping relation of each parameter-outputting mapping field; the plurality of parameter-outputting mapping fields correspond to the parameter-outputting field of the same target; and forming parameter-out nested mapping data serving as target parameter-out data corresponding to at least one target parameter-out field according to the parameter-out mapping protocol and the mapped parameter-out data.
Optionally, the target parameter-exiting data obtaining module 330 is specifically configured to obtain a parameter-entering mapping protocol when determining that the nesting type is parameter-entering field nesting and parameter-exiting field nesting, and query a parameter-entering field mapping relationship corresponding to the query mapping interface according to the parameter-entering mapping protocol, to obtain at least one parameter-entering mapping field having a parameter-entering field mapping relationship with each target parameter-entering field; the plurality of target parameter entering fields correspond to the same parameter entering mapping field; determining the parameter entering nested mapping data according to the parameter entering mapping field and the target parameter entering data; inputting the parameter-entering nested mapping data into a query mapping interface, and obtaining mapping parameter-exiting data corresponding to each parameter-exiting mapping field, which is output by the query mapping interface; obtaining a parameter-outputting mapping protocol, inquiring parameter-outputting field mapping relation corresponding to the inquiring mapping interface according to the parameter-outputting mapping protocol, and obtaining at least one target parameter-outputting field with parameter-inputting field mapping relation of each parameter-outputting mapping field; the plurality of parameter-outputting mapping fields correspond to the parameter-outputting field of the same target; and forming parameter-out nested mapping data serving as target parameter-out data corresponding to at least one target parameter-out field according to the parameter-out mapping protocol and the mapped parameter-out data.
Optionally, the interface calling device may further include an interface calling request generating module, configured to respond to a target data query request, and generate an interface calling request according to the target data query request.
Optionally, the target entry parameter data obtaining module 310 is specifically configured to display at least one target entry parameter field according to the interface call request, and receive the target entry parameter data input by the user and corresponding to each target entry parameter field respectively.
Optionally, the interface calling device may further include a parameter-entering mapping protocol generating module, configured to determine a parameter-entering field mapping relationship corresponding to the query mapping interface; and generating the parameter entering mapping protocol according to the target parameter entering field, the parameter entering mapping field and the parameter entering field mapping relation.
Optionally, the interface calling device may further include a parameter-out mapping protocol generating module, configured to determine a parameter-out field mapping relationship corresponding to the query mapping interface; and generating the parameter-exiting mapping protocol according to the target parameter-exiting field, the parameter-exiting mapping field and the parameter-exiting field mapping relation.
The interface calling device can execute the interface calling method provided by any embodiment of the invention, and has the corresponding function modules and beneficial effects of executing the method. Technical details which are not described in detail in this embodiment can be referred to the interface calling method provided in any embodiment of the present invention.
Since the interface calling device described above is a device capable of executing the interface calling method in the embodiment of the present invention, based on the interface calling method described in the embodiment of the present invention, those skilled in the art can understand the specific implementation manner of the interface calling device in the embodiment of the present invention and various modifications thereof, so how the interface calling device implements the interface calling method in the embodiment of the present invention will not be described in detail herein. The device adopted by the person skilled in the art to implement the interface calling method in the embodiment of the present invention is within the scope of protection intended in the present application.
Example IV
Fig. 6 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. Fig. 6 shows a block diagram of an electronic device 412 suitable for use in implementing embodiments of the invention. The electronic device 412 shown in fig. 6 is only an example and should not be construed as limiting the functionality and scope of use of embodiments of the invention.
As shown in fig. 6, the electronic device 412 is in the form of a general purpose computing device. Components of electronic device 412 may include, but are not limited to: one or more processors 416, a storage 428, and a bus 418 that connects the various system components (including the storage 428 and the processors 416).
Bus 418 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include industry standard architecture (Industry Standard Architecture, ISA) bus, micro channel architecture (Micro Channel Architecture, MCA) bus, enhanced ISA bus, video electronics standards association (Video Electronics Standards Association, VESA) local bus, and peripheral component interconnect (Peripheral Component Interconnect, PCI) bus.
Electronic device 412 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by electronic device 412 and includes both volatile and nonvolatile media, removable and non-removable media.
The storage 428 may include computer system readable media in the form of volatile memory, such as random access memory (Random Access Memory, RAM) 430 and/or cache memory 432. The electronic device 412 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 434 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard disk drive"). Although not shown in fig. 6, a disk drive for reading from and writing to a removable nonvolatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from and writing to a removable nonvolatile optical disk (e.g., a Compact Disc-Read Only Memory (CD-ROM), digital versatile Disc (Digital Video Disc-Read Only Memory, DVD-ROM), or other optical media) may be provided. In such cases, each drive may be coupled to bus 418 via one or more data medium interfaces. Storage 428 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of embodiments of the invention.
Programs 436 having a set (at least one) of program modules 426 may be stored, for example, in storage 428, such program modules 426 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 426 typically carry out the functions and/or methods of the embodiments described herein.
The electronic device 412 may also communicate with one or more external devices 414 (e.g., keyboard, pointing device, camera, display 424, etc.), one or more devices that enable a user to interact with the electronic device 412, and/or any device (e.g., network card, modem, etc.) that enables the electronic device 412 to communicate with one or more other computing devices. Such communication may occur through an Input/Output (I/O) interface 422. Also, the electronic device 412 may communicate with one or more networks (e.g., a local area network (Local Area Network, LAN), a wide area network Wide Area Network, a WAN) and/or a public network, such as the internet) via the network adapter 420. As shown, network adapter 420 communicates with other modules of electronic device 412 over bus 418. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 412, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, disk array (Redundant Arrays of Independent Disks, RAID) systems, tape drives, data backup storage systems, and the like.
The processor 416 executes various functional applications and data processing by running a program stored in the storage device 428, for example, to implement the interface calling method provided by the above-described embodiment of the present invention: responding to an interface call request of a target interface, and acquiring at least one target parameter entering field matched with the interface call request and target parameter entering data respectively corresponding to each target parameter entering field; acquiring a query mapping interface corresponding to a target interface, and acquiring a nesting type matched with the query mapping interface; the nesting type includes: nesting of the parameter entering fields and/or nesting of the parameter exiting fields; acquiring target parameter output data corresponding to at least one target parameter output field of the target interface according to the target parameter input field, the target parameter input data, the nesting type, the query mapping interface and the nesting processing result; the nesting processing result comprises the following steps: a parameter entering nested processing result corresponding to the target parameter entering data and/or a parameter exiting nested processing result corresponding to the mapped parameter exiting data output by the query mapping interface; and taking the target parameter-out data corresponding to at least one target parameter-out field of the target interface as a feedback result aiming at the interface call request.
According to the technical scheme of the embodiment, at least one target parameter entering field matched with the interface calling request and target parameter entering data respectively corresponding to each target parameter entering field are obtained through responding to the interface calling request of the target interface, the query mapping interface corresponding to the target interface is obtained, nesting types including parameter entering field nesting and/or parameter exiting field nesting matched with the query mapping interface are obtained, and accordingly target parameter exiting data corresponding to at least one target parameter exiting field of the target interface is obtained according to the target parameter entering field, the target parameter entering data, the nesting types, the query mapping interface and the nesting processing result, and further target parameter exiting data corresponding to at least one target parameter exiting field of the target interface is used as a feedback result for the interface calling request. When the target parameter entering field and/or the target parameter exiting field are nested, target parameter exiting data corresponding to the target parameter exiting field can be obtained according to the target parameter entering field, the target parameter entering data, the nesting type, the query mapping interface and the nesting processing result, and an interface for performing nested calling is not required to be configured for the field (the target parameter entering field and/or the target parameter exiting field) with the nesting, namely interface nesting among multiple interface calls is avoided, the problems that in the prior art, code complexity is high, when the parameter definition of multi-layer set nesting is carried out by the parameter entering parameter exiting parameter, service requirements cannot be responded in time due to the fact that only interfaces are added, research and development workload is large and project period is prolonged due to the fact that the nesting parameters are prevented from being called through the newly added interface are solved, and therefore the service requirements are responded rapidly.
Example five
A fifth embodiment of the present invention further provides a computer storage medium storing a computer program, where the computer program when executed by a computer processor is configured to perform the interface calling method according to any one of the foregoing embodiments of the present invention: responding to an interface call request of a target interface, and acquiring at least one target parameter entering field matched with the interface call request and target parameter entering data respectively corresponding to each target parameter entering field; acquiring a query mapping interface corresponding to a target interface, and acquiring a nesting type matched with the query mapping interface; the nesting type includes: nesting of the parameter entering fields and/or nesting of the parameter exiting fields; acquiring target parameter output data corresponding to at least one target parameter output field of the target interface according to the target parameter input field, the target parameter input data, the nesting type, the query mapping interface and the nesting processing result; the nesting processing result comprises the following steps: a parameter entering nested processing result corresponding to the target parameter entering data and/or a parameter exiting nested processing result corresponding to the mapped parameter exiting data output by the query mapping interface; and taking the target parameter-out data corresponding to at least one target parameter-out field of the target interface as a feedback result aiming at the interface call request.
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an erasable programmable Read-Only Memory ((Erasable Programmable Read Only Memory, EPROM) or flash Memory), an optical fiber, a portable compact disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, radio Frequency (RF), etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (7)

1. An interface calling method, comprising;
responding to an interface call request of a target interface, and acquiring at least one target parameter entering field matched with the interface call request and target parameter entering data respectively corresponding to each target parameter entering field;
acquiring a query mapping interface corresponding to the target interface, and acquiring a nesting type matched with the query mapping interface; the nesting type includes: nesting of the parameter entering fields and/or nesting of the parameter exiting fields;
acquiring target parameter output data corresponding to at least one target parameter output field of the target interface according to the target parameter input field, the target parameter input data, the nesting type, the query mapping interface and the nesting processing result;
The nesting processing result comprises the following steps: a parameter entering nested processing result corresponding to the target parameter entering data and/or a parameter exiting nested processing result corresponding to the mapped parameter exiting data output by the query mapping interface;
taking target parameter output data corresponding to at least one target parameter output field of a target interface as a feedback result aiming at the interface call request;
according to the target entry field, the target entry data, the nesting type, the query mapping interface and the nesting processing result, obtaining target exit data corresponding to at least one target exit field of the target interface, including:
when the nesting type is determined to be only the nesting of the parameter entering fields, acquiring a parameter entering mapping protocol, inquiring the parameter entering field mapping relation corresponding to the inquiring mapping interface according to the parameter entering mapping protocol, and acquiring at least one parameter entering mapping field which has the parameter entering field mapping relation with each target parameter entering field; the plurality of target parameter entering fields correspond to the same parameter entering mapping field; determining the parameter entering nested mapping data according to the parameter entering mapping field and the target parameter entering data; inputting the parameter-entering nested mapping data into a query mapping interface, and obtaining mapping parameter-exiting data corresponding to each parameter-exiting mapping field, which is output by the query mapping interface; obtaining target parameter outputting data corresponding to at least one target parameter outputting field of a target interface according to the one-to-one correspondence between parameter outputting mapping fields and target parameter outputting fields and mapping parameter outputting data;
When the nesting type is determined to be only the nesting of the parameter outputting field, the parameter inputting mapping field and the target parameter inputting data are input into the query mapping interface together according to the one-to-one correspondence between the parameter inputting mapping field and the target parameter inputting field; obtaining mapping parameter output data corresponding to each parameter output mapping field, which is output by the query mapping interface; obtaining a parameter-outputting mapping protocol, inquiring parameter-outputting field mapping relation corresponding to the inquiring mapping interface according to the parameter-outputting mapping protocol, and obtaining at least one target parameter-outputting field with parameter-inputting field mapping relation of each parameter-outputting mapping field; the plurality of parameter-outputting mapping fields correspond to the parameter-outputting field of the same target; forming out-parameter nested mapping data as target out-parameter data corresponding to at least one target out-parameter field according to the out-parameter mapping protocol and the mapped out-parameter data;
when the nesting type is determined to be the parameter entering field nesting and the parameter exiting field nesting, acquiring a parameter entering mapping protocol, inquiring a parameter entering field mapping relation corresponding to the inquiring mapping interface according to the parameter entering mapping protocol, and acquiring at least one parameter entering mapping field which has a parameter entering field mapping relation with each target parameter entering field; the plurality of target parameter entering fields correspond to the same parameter entering mapping field; determining the parameter entering nested mapping data according to the parameter entering mapping field and the target parameter entering data; inputting the parameter-entering nested mapping data into a query mapping interface, and obtaining mapping parameter-exiting data corresponding to each parameter-exiting mapping field, which is output by the query mapping interface; obtaining a parameter-outputting mapping protocol, inquiring parameter-outputting field mapping relation corresponding to the inquiring mapping interface according to the parameter-outputting mapping protocol, and obtaining at least one target parameter-outputting field with parameter-inputting field mapping relation of each parameter-outputting mapping field; the plurality of parameter-outputting mapping fields correspond to the parameter-outputting field of the same target; and forming parameter-out nested mapping data serving as target parameter-out data corresponding to at least one target parameter-out field according to the parameter-out mapping protocol and the mapped parameter-out data.
2. The method of claim 1, further comprising, prior to said responding to the interface call request to the target interface:
responding to a target data query request, and generating an interface call request according to the target data query request;
the obtaining at least one target entry field matched with the interface call request and the target entry parameter data respectively corresponding to each target entry field includes:
and displaying at least one target entry field according to the interface call request, and receiving the target entry data input by a user and respectively corresponding to each target entry field.
3. The method of claim 1, further comprising, prior to said acquiring the incident mapping protocol:
determining a mapping relation of the parameter entering fields corresponding to the query mapping interface;
and generating the parameter entering mapping protocol according to the target parameter entering field, the parameter entering mapping field and the parameter entering field mapping relation.
4. The method of claim 1, further comprising, prior to said obtaining a parameter mapping protocol:
determining a mapping relation of parameter-out fields corresponding to the query mapping interface;
And generating the parameter-exiting mapping protocol according to the target parameter-exiting field, the parameter-exiting mapping field and the parameter-exiting field mapping relation.
5. An interface calling device, comprising:
the target entry parameter data acquisition module is used for responding to an interface call request of a target interface and acquiring at least one target entry parameter field matched with the interface call request and target entry parameter data respectively corresponding to each target entry parameter field;
the interface acquisition module is used for acquiring a query mapping interface corresponding to the target interface and acquiring a nesting type matched with the query mapping interface; the nesting type includes: nesting of the parameter entering fields and/or nesting of the parameter exiting fields;
the target parameter outputting data acquisition module is used for acquiring target parameter outputting data corresponding to at least one target parameter outputting field of the target interface according to the target parameter inputting field, the target parameter inputting data, the nesting type, the query mapping interface and the nesting processing result;
the nesting processing result comprises the following steps: a parameter entering nested processing result corresponding to the target parameter entering data and/or a parameter exiting nested processing result corresponding to the mapped parameter exiting data output by the query mapping interface;
The feedback result determining module is used for taking the target parameter-outputting data corresponding to at least one target parameter-outputting field of the target interface as a feedback result for the interface calling request;
the target parameter-output data acquisition module is specifically configured to acquire a parameter-input mapping protocol when determining that a nesting type is only parameter-input field nesting, and to query a parameter-input field mapping relationship corresponding to the query mapping interface according to the parameter-input mapping protocol, so as to acquire at least one parameter-input mapping field having a parameter-input field mapping relationship with each target parameter-input field; the plurality of target parameter entering fields correspond to the same parameter entering mapping field; determining the parameter entering nested mapping data according to the parameter entering mapping field and the target parameter entering data; inputting the parameter-entering nested mapping data into a query mapping interface, and obtaining mapping parameter-exiting data corresponding to each parameter-exiting mapping field, which is output by the query mapping interface; obtaining target parameter outputting data corresponding to at least one target parameter outputting field of a target interface according to the one-to-one correspondence between parameter outputting mapping fields and target parameter outputting fields and mapping parameter outputting data;
when the nesting type is determined to be only the nesting of the parameter outputting field, the parameter inputting mapping field and the target parameter inputting data are input into the query mapping interface together according to the one-to-one correspondence between the parameter inputting mapping field and the target parameter inputting field; obtaining mapping parameter output data corresponding to each parameter output mapping field, which is output by the query mapping interface; obtaining a parameter-outputting mapping protocol, inquiring parameter-outputting field mapping relation corresponding to the inquiring mapping interface according to the parameter-outputting mapping protocol, and obtaining at least one target parameter-outputting field with parameter-inputting field mapping relation of each parameter-outputting mapping field; the plurality of parameter-outputting mapping fields correspond to the parameter-outputting field of the same target; forming out-parameter nested mapping data as target out-parameter data corresponding to at least one target out-parameter field according to the out-parameter mapping protocol and the mapped out-parameter data;
When the nesting type is determined to be the parameter entering field nesting and the parameter exiting field nesting, acquiring a parameter entering mapping protocol, inquiring a parameter entering field mapping relation corresponding to the inquiring mapping interface according to the parameter entering mapping protocol, and acquiring at least one parameter entering mapping field which has a parameter entering field mapping relation with each target parameter entering field; the plurality of target parameter entering fields correspond to the same parameter entering mapping field; determining the parameter entering nested mapping data according to the parameter entering mapping field and the target parameter entering data; inputting the parameter-entering nested mapping data into a query mapping interface, and obtaining mapping parameter-exiting data corresponding to each parameter-exiting mapping field, which is output by the query mapping interface; obtaining a parameter-outputting mapping protocol, inquiring parameter-outputting field mapping relation corresponding to the inquiring mapping interface according to the parameter-outputting mapping protocol, and obtaining at least one target parameter-outputting field with parameter-inputting field mapping relation of each parameter-outputting mapping field; the plurality of parameter-outputting mapping fields correspond to the parameter-outputting field of the same target; and forming parameter-out nested mapping data serving as target parameter-out data corresponding to at least one target parameter-out field according to the parameter-out mapping protocol and the mapped parameter-out data.
6. An electronic device, the electronic device comprising:
one or more processors;
a storage means for storing one or more programs;
when executed by the one or more processors, causes the one or more processors to implement the interface invocation method of any of claims 1-4.
7. A computer storage medium having stored thereon a computer program, which when executed by a processor implements the interface invoking method as claimed in any of claims 1-4.
CN202210144667.3A 2022-02-17 2022-02-17 Interface calling method, device, equipment and medium Active CN114528044B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210144667.3A CN114528044B (en) 2022-02-17 2022-02-17 Interface calling method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210144667.3A CN114528044B (en) 2022-02-17 2022-02-17 Interface calling method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN114528044A CN114528044A (en) 2022-05-24
CN114528044B true CN114528044B (en) 2024-02-23

Family

ID=81623158

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210144667.3A Active CN114528044B (en) 2022-02-17 2022-02-17 Interface calling method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN114528044B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114860834B (en) * 2022-06-01 2024-03-26 北京字节跳动网络技术有限公司 Processing method, device, equipment and storage medium of association query request
CN115277128B (en) * 2022-07-13 2024-02-23 上海砾阳软件有限公司 Illegal request processing method and device and electronic equipment
CN117573762B (en) * 2024-01-15 2024-04-16 杭州数云信息技术有限公司 Data processing method and device of data connection platform, storage medium and server

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016165421A1 (en) * 2015-09-21 2016-10-20 中兴通讯股份有限公司 Method and apparatus for converting different interface protocol messages
CN111198813A (en) * 2018-11-20 2020-05-26 北京京东尚科信息技术有限公司 Interface testing method and device
CN111695840A (en) * 2019-03-11 2020-09-22 北京京东尚科信息技术有限公司 Method and device for realizing flow control
CN111752846A (en) * 2020-06-30 2020-10-09 深圳前海微众银行股份有限公司 Interface testing method and device
CN113076153A (en) * 2021-03-29 2021-07-06 北京京东振世信息技术有限公司 Interface calling method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016165421A1 (en) * 2015-09-21 2016-10-20 中兴通讯股份有限公司 Method and apparatus for converting different interface protocol messages
CN111198813A (en) * 2018-11-20 2020-05-26 北京京东尚科信息技术有限公司 Interface testing method and device
CN111695840A (en) * 2019-03-11 2020-09-22 北京京东尚科信息技术有限公司 Method and device for realizing flow control
CN111752846A (en) * 2020-06-30 2020-10-09 深圳前海微众银行股份有限公司 Interface testing method and device
CN113076153A (en) * 2021-03-29 2021-07-06 北京京东振世信息技术有限公司 Interface calling method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
OSS4.0网络编排系统接口自动化测试;张佐中等;电信技术;第77-79页 *

Also Published As

Publication number Publication date
CN114528044A (en) 2022-05-24

Similar Documents

Publication Publication Date Title
CN114528044B (en) Interface calling method, device, equipment and medium
CN110008045B (en) Method, device and equipment for aggregating microservices and storage medium
CN110489440B (en) Data query method and device
CN110263277B (en) Page data display method, page data updating device, page data equipment and storage medium
CN110647316B (en) Method and device for generating universal business object, computer equipment and storage medium
CN112860798B (en) Data processing method and device, electronic equipment and storage medium
CN111694866A (en) Data searching and storing method, data searching system, data searching device, data searching equipment and data searching medium
CN111737022A (en) Interface calling method, system, equipment and medium based on micro-service
CN112346794A (en) Interface calling method, device, equipment and medium
CN110377273B (en) Data processing method, device, medium and electronic equipment
CN112181542A (en) Function calling method and device, electronic equipment and storage medium
CN114327493A (en) Data processing method and device, electronic equipment and computer readable medium
CN112417016B (en) Data exchange method, system, equipment and storage medium
CN107992457B (en) Information conversion method, device, terminal equipment and storage medium
CN115795211A (en) Page display method, device, system, equipment and storage medium
CN113986995A (en) Request distribution method and device, storage medium and electronic equipment
CN114217790A (en) Interface scheduling method and device, electronic equipment and medium
CN114780519A (en) DBC file generation method, device, equipment and medium based on CAN communication
CN111813407B (en) Game development method, game running device and electronic equipment
CN113761588A (en) Data verification method and device, terminal equipment and storage medium
CN114490104A (en) Information forwarding method, device, equipment and medium in Android system module
CN112688863B (en) Gateway data processing method and device and electronic equipment
CN112445790B (en) Report data storage method, device, equipment and medium
CN109376023B (en) Method and equipment for generating calling information and issuing return code group
CN110865892A (en) Detection method and device for call interface, storage medium and electronic equipment

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