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

Interface calling method, device, equipment and medium Download PDF

Info

Publication number
CN114528044A
CN114528044A CN202210144667.3A CN202210144667A CN114528044A CN 114528044 A CN114528044 A CN 114528044A CN 202210144667 A CN202210144667 A CN 202210144667A CN 114528044 A CN114528044 A CN 114528044A
Authority
CN
China
Prior art keywords
parameter
field
mapping
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.)
Granted
Application number
CN202210144667.3A
Other languages
Chinese (zh)
Other versions
CN114528044B (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

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • User Interface Of Digital Computer (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the invention discloses an interface calling method, an interface calling device, interface calling equipment and an interface calling medium. The interface calling method comprises the following steps: responding to an interface calling request of a target interface, and acquiring at least one target parameter entering field and target parameter entering data matched with the interface calling request; acquiring a query mapping interface corresponding to a target interface, and acquiring a nesting type matched with the query mapping interface; the nesting types include: nesting in a parameter field and/or nesting out of a parameter field; 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 data corresponding to the target parameter field of the target interface as a feedback result aiming at the interface calling 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 code complexity, and reduce the workload of research and development, thereby quickly responding to the service requirement.

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
At present, when the cooperation of different businesses is carried out, the standard interface of a third party is arranged and matched with the interface of a partner.
However, the conventional interface calling method requires the system to call the interface for multiple times, protocol conversion is realized by a coding method, the interface nesting among the multiple interface calls increases the complexity of codes, and when an output in a partner interface participates in parameter definition of multilayer set nesting, the requirement can be realized only by adding a new interface, so that the service requirement cannot be responded in time, the research and development workload is greatly increased, and the project period is prolonged.
Disclosure of Invention
Embodiments of the present invention provide an interface calling method, apparatus, device, and medium, so as to avoid calling nested parameters through a newly added interface and reduce the workload of research and development on the premise of not increasing the code complexity, thereby quickly responding to a service requirement.
In a first aspect, an embodiment of the present invention provides an interface calling method, including:
responding to an interface calling request of a target interface, and acquiring at least one target parameter field matched with the interface calling request and target parameter data respectively corresponding to each target parameter field;
acquiring a query mapping interface corresponding to a target interface, and acquiring a nesting type matched with the query mapping interface; the nesting types include: nesting in a parameter field and/or nesting out of a parameter field;
acquiring target parameter-entering data corresponding to at least one target parameter-exiting field of a target interface according to the target parameter-entering field, the target parameter-entering data, the nesting type, the query mapping interface and the nesting processing result;
wherein, the nesting processing result comprises: the parameter input nesting processing result corresponds to the target parameter input data and/or the parameter output nesting processing result corresponds to the mapping parameter output by the query mapping interface;
and taking the target parameter data corresponding to at least one target parameter field of the target interface as a feedback result aiming at the interface calling request.
In a second aspect, an embodiment of the present invention further provides an interface invoking device, including:
the target parameter data acquisition module is used for responding to an interface calling request of a target interface and acquiring at least one target parameter field matched with the interface calling request and target parameter data respectively corresponding to each target 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 types include: nesting a parameter entry field and/or nesting a parameter exit field;
the target parameter data acquisition module is used for acquiring target parameter data corresponding to at least one target parameter field of the target interface according to the target parameter field, the target parameter data, the nesting type, the query mapping interface and the nesting processing result;
wherein, the nesting processing result comprises: the parameter input nesting processing result corresponds to the target parameter input data and/or the parameter output nesting processing result corresponds to the mapping parameter output by the query mapping interface;
and the feedback result determining module is used for taking the target parameter data corresponding to at least one target parameter field of the target interface as a feedback result aiming at the interface calling request.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the interface call method provided by any embodiment of the invention.
In a fourth aspect, an embodiment of the present invention further provides a computer storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the interface calling method provided in any embodiment of the present invention.
According to the technical scheme of the embodiment, at least one target parameter input field matched with an interface calling request and target parameter input data respectively corresponding to each target parameter input field are obtained by responding to the interface calling request of a target interface, a query mapping interface corresponding to the target interface is further obtained, a nesting type which is matched with the query mapping interface and comprises parameter input field nesting and/or parameter output field nesting is obtained, therefore, the target parameter output data corresponding to at least one target parameter output field of the target interface is obtained 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 the target parameter output data corresponding to at least one target parameter output field of the target interface is further used as a feedback result aiming at the interface calling request. When the target parameter-in field and/or the target parameter-out field are/is nested, the target parameter-out data corresponding to the target parameter-out field can be obtained according to the target parameter-in field, the target parameter-in data, the nesting type, the query mapping interface and the nesting processing result, and an interface for nesting calling is not required to be configured for the field (the target parameter-in field and/or the target parameter-out field) with the nesting, so that the interface nesting among a plurality of interface calls is avoided, the problems that the code complexity caused by the interface nesting is high in the prior art, when the parameter definition of multi-layer set nesting is involved, the service requirement cannot be responded in time due to only newly increased interfaces, the research and development workload is large and the project period is prolonged are solved, and on the premise of not increasing the code complexity, the nested parameters are called by newly increased interfaces, the research and development workload is reduced, thereby responding quickly to traffic demands.
Drawings
Fig. 1 is a flowchart of an interface calling method according to an 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 schematic flowchart of an interface call according to a second embodiment of the present invention;
fig. 4 is a configuration interface of a target participation field and a participation mapping field according to a second embodiment of the present invention;
fig. 5 is a schematic diagram of an interface invoking 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 present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention.
It should be further noted that, for the convenience of description, only some but not all of the relevant aspects of the present invention are shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, subprograms, and the like.
Example one
Fig. 1 is a flowchart of an interface calling method according to an embodiment of the present invention, where the embodiment is applicable to a case where nested parameters are not called through a newly added interface, and the method may be executed by an interface calling apparatus, which may be implemented by software and/or hardware, and may be generally integrated in an electronic device. 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 call method. Accordingly, as shown in fig. 1, the method comprises the following operations:
s110, responding to an interface calling request of a target interface, and acquiring at least one target parameter field matched with the interface calling request and target parameter data corresponding to each target parameter field.
The target interface may be an interface that needs to be called, and is used for data calling and/or data processing, and the like. For example, the target interface may be an interface which is provided by the interface developer for the user to call, and the target interface may also perform data interaction with a third-party interface. The interface call request may be a request to call an interface. The target entry field may be an entry field of the target interface configuration. The target entry parameter data can be data which has a corresponding relation with the target entry parameter field and needs to be input into the target interface.
In the embodiment of the invention, after the interface calling request is received, the interface calling request can be analyzed, the target interface matched with the interface calling request is determined, so that the interface calling request of the target interface is responded, the target parameter-entering field of the target interface is analyzed, at least one analyzed target parameter-entering field is used as the target parameter-entering field matched with the interface calling request of the target interface, and the target parameter-entering data respectively corresponding to each target parameter-entering 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 can be an interface which can perform data interaction with the target interface and has a data query function. Illustratively, the query mapping interface may be an interface provided by a third party in cooperation with the interface developer of the target interface, or the like. The nesting type may include: in-argument field nesting, and/or out-argument field nesting. The embedding of the input parameter field can be the embedding of the input parameter field of the target interface configuration, and is used for representing the embedding relation of the input parameter field of the target interface. The out-parameter field nesting can be the nesting of the out-parameter field of the target interface configuration, and is used for representing the nesting relation of the out-parameter field of the target interface. Optionally, the argument field nesting can comprise at least one layer of nesting of argument fields of the target interface configuration. The out-of-field nesting may include at least one layer of nesting of out-of-fields of the target interface configuration. Illustratively, the out-reference field nesting may be understood as one out-reference field of the target interface configuration nesting a plurality of out-reference fields, each of which may be further nested. For example, the address field of the target interface configuration may be nested with three address fields, namely, pro, city and street. Similarly, the reference field nesting may be understood as that one reference field configured by the target interface is nested with a plurality of reference subfields, and each reference subfield may be further nested.
In the embodiment of the invention, the interface type of the target interface can be determined according to the interface calling request of the target interface, so that the corresponding query mapping interface is determined according to the interface type of the target interface, the configuration data of the target interface is analyzed, and the parameter input field nesting and/or parameter output field nesting matched with the query mapping interface are/is obtained.
S130, acquiring target parameter data corresponding to at least one target parameter field of the target interface according to the target parameter field, the target parameter data, the nesting type, the query mapping interface and the nesting processing result.
Wherein, the target argument field may be an argument field of the target interface configuration. The target parameter data may be data output by the target interface, which has a corresponding relationship with the parameter data configured by the target interface. The nested processing result may be data associated with the entry field of the target interface determined from the entry field of the target interface and the nesting type. The nesting processing result may include: and the parameter input nesting processing result corresponds to the target parameter input data and/or the parameter output nesting processing result corresponds to the mapping parameter output by the query mapping interface. The processing result of the embedding and nesting can be a processing result after embedding the embedding field in the target embedding field and carrying out field mapping with the query mapping interface. The processing result of the out-reference nesting can be the processing result after the out-reference field nesting is carried out on the target out-reference field and the field mapping is carried out on the target out-reference field and the query mapping interface. The mapping parameter data can be data which is output by the query mapping interface and has a corresponding relation with the target parameter field. The mapped out data may include an out-parameter field name and out-parameter data corresponding to the out-parameter field name. For example, the parameter data corresponding to the parameter field name in the mapped parameter data may be the target parameter data.
In the embodiment of the invention, whether the target parameter field has parameter field nesting or not can be determined firstly, if the target parameter field has parameter field nesting, a parameter nesting processing result is determined according to the target parameter field, the target parameter data and the parameter field nesting, and the parameter data is mapped according to the parameter nesting processing result and the query mapping interface. And if the target parameter input field does not have parameter input field nesting, determining the parameter mapping-out data according to the target parameter input field, the target parameter input data and the query mapping interface. And after the mapping parameter data is obtained, further judging whether parameter field nesting exists in a target parameter field of the target interface. And if the target parameter field of the target interface has parameter field nesting, determining target parameter data corresponding to at least one target parameter field of the target interface according to the parameter nesting processing result corresponding to the mapped parameter data. And if the target parameter field of the target interface does not have parameter field nesting, determining target parameter data corresponding to at least one target parameter field of the target interface according to the mapped parameter data.
And S140, taking the target parameter data corresponding to at least one target parameter field of the target interface as a feedback result aiming at the interface calling request.
In the embodiment of the present invention, the target parameter data corresponding to at least one target parameter field of the target interface may be used as response data of the interface call request to feed back the interface call request, so as to implement the combined display of the target parameter data and the corresponding target parameter field.
According to the technical scheme of the embodiment, at least one target parameter input field matched with an interface calling request and target parameter input data respectively corresponding to each target parameter input field are obtained by responding to the interface calling request of a target interface, a query mapping interface corresponding to the target interface is further obtained, a nesting type which is matched with the query mapping interface and comprises parameter input field nesting and/or parameter output field nesting is obtained, therefore, the target parameter output data corresponding to at least one target parameter output field of the target interface is obtained 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 the target parameter output data corresponding to at least one target parameter output field of the target interface is further used as a feedback result aiming at the interface calling request. When the target parameter-in field and/or the target parameter-out field are/is nested, the target parameter-out data corresponding to the target parameter-out field can be obtained according to the target parameter-in field, the target parameter-in data, the nesting type, the query mapping interface and the nesting processing result, and an interface for nesting calling is not required to be configured for the field (the target parameter-in field and/or the target parameter-out field) with the nesting, so that the interface nesting among a plurality of interface calls is avoided, the problems that the code complexity caused by the interface nesting is high in the prior art, when the parameter definition of multi-layer set nesting is involved, the service requirement cannot be responded in time due to only newly increased interfaces, the research and development workload is large and the project period is prolonged are solved, and on the premise of not increasing the code complexity, the nested parameters are called by newly increased interfaces, the research and development workload is reduced, thereby responding quickly to traffic demands.
Example two
Fig. 2 is a flowchart of an interface invoking method according to a second embodiment of the present invention, which is embodied based on the above embodiments, and in this embodiment, an optional implementation manner is provided for specifically acquiring at least one target entry field matched with an interface invoking request and target entry parameters respectively corresponding to each target entry field. Accordingly, as shown in fig. 2, the method comprises the following operations:
s210, responding to an interface calling request of a target interface, displaying at least one target parameter entering field according to the interface calling request, and receiving target parameter entering data which are input by a user and correspond to each target parameter entering field respectively.
In the embodiment of the invention, after the interface calling request is received, the interface calling request can be analyzed, the target interface matched with the interface calling request is determined, and the target parameter entering data configured by the target interface is further determined, so that the target parameter entering data is displayed for a user to input data according to the target parameter entering data, and the target parameter entering data which is input by the user and corresponds to each target parameter entering field is obtained.
In an optional 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 to generate 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 target data query request can be analyzed to determine the type of the interface required to be called, so as to generate the interface call request for the target interface according to the type of the interface required to be called.
For example, a user may send a target data query request for querying personal basic information to an application issued by a partner cooperating with a third party through a terminal, and 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 the personal basic information through the interface call request, and further display a target parameter field (e.g., mobile, vailcode, etc.) of the interface for querying the personal basic information on the terminal of the user, and the user may input target parameter data according to the target parameter field. For example, when the target entry field is "mobile" and "vailcode", the target entry parameter 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": a "mobile phone number of 11 digits",
"VAILCODE": "authentication 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.
And S230, acquiring target parameter-entering data corresponding to at least one target parameter-exiting field of the target interface according to the target parameter-entering field, the target parameter-entering data, the nesting type, the query mapping interface and the nesting processing result.
In an optional embodiment of the present invention, acquiring target parameter data corresponding to at least one target parameter field of a target interface according to a target parameter field, target parameter data, a nesting type, a query mapping interface, and a nesting processing result may include: when the nesting type is only determined to be the embedding of the parameter field, acquiring a parameter mapping protocol, inquiring parameter field mapping relations corresponding to the inquiry mapping interface according to the parameter mapping protocol, and acquiring at least one parameter mapping field which has parameter field mapping relations with all target parameter fields; a plurality of target parameter fields correspond to the same parameter mapping field; determining 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 acquiring mapping parameter-exiting data which are output by the query mapping interface and correspond to each parameter-exiting mapping field; and acquiring target parameter data corresponding to at least one target parameter field of the target interface according to the one-to-one correspondence between the parameter mapping field and the target parameter field and the parameter mapping data.
Wherein, the parameter mapping protocol can be a mapping protocol of the target parameter field. The parameter field mapping relationship may be a mapping relationship of a target parameter field and a parameter mapping field determined by a parameter mapping protocol. For example, the mapping relationship between the target parameter field and the parameter field in the query mapping interface, the mapping relationship between the target parameter field and the parameter field of the third-party interface other than the query mapping interface, and the like. The argument map field may be an argument field that has an argument field mapping relationship with the target argument field. For example, the entry mapping field may include an entry field in the query mapping interface having an entry field mapping relationship with the target entry field, an entry field of a third party interface other than the query mapping interface having an entry field mapping relationship with the target entry field, and the like. The enlistment-mapping fields of different interfaces that have an enlistment-field mapping relationship with the target enlistment field may be the same or different. Generally, the parameter mapping fields of different interfaces having parameter mapping relation with the target parameter field are the same field, so as to facilitate mutual communication between the interfaces.
The parameter-entering nesting mapping data can be partial data in the parameter-entering nesting processing result, and is determined by a parameter-entering mapping protocol and a target parameter-entering data and needs to be input to the query mapping interface. The argument map field may be data having a correspondence relationship with the target argument field in the argument map data. For example, the argument mapping field may include an argument field of a query mapping interface having a mapping relationship with the target argument field, and an argument field of a third party interface other than the query mapping interface having a mapping relationship with the target argument field. The argument mapping fields of different interfaces having a mapping relationship with the target argument field may be the same or different. Generally, the parameter mapping fields of different interfaces having mapping relation with the target parameter 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 firstly, if the nesting type of the target interface is the entry nesting type, the entry mapping protocol is further acquired, and then the entry mapping protocol is analyzed to obtain the entry field mapping relation corresponding to the query mapping interface, so that at least one entry mapping field having the entry field mapping relation with each target entry field is determined, wherein a plurality of target entry fields correspond to the same entry mapping field. After at least one parameter entry mapping field corresponding to each target parameter entry field is obtained, parameter entry nested mapping data can be determined according to a parameter entry mapping protocol, the parameter entry mapping fields and target parameter entry data, the parameter entry nested mapping data are input into a query mapping interface, data query is conducted through the query mapping interface, mapped parameter data corresponding to each parameter entry mapping field are output, the mapped parameter data are analyzed according to the one-to-one correspondence between the parameter entry mapping fields and the target parameter entry fields, parameter exit data corresponding to the parameter entry mapping fields are determined, and therefore target parameter exit data corresponding to at least one target parameter exit field of the target interface are determined according to the one-to-one correspondence between the parameter exit mapping fields and the target parameter exit fields and the parameter exit data corresponding to the parameter exit mapping fields.
In an optional embodiment of the present invention, acquiring target parameter data corresponding to at least one target parameter field of a target interface according to a target parameter field, target parameter data, a nesting type, a query mapping interface, and a nesting processing result may include: when the nesting type is determined to be only the nesting of the parameter-entering field, inputting the parameter-entering mapping field and the target parameter-entering data into the query mapping interface together according to the one-to-one correspondence between the parameter-entering mapping field and the target parameter-entering field; acquiring mapping parameter data which is output by the query mapping interface and corresponds to each parameter mapping field; acquiring a parameter mapping protocol, inquiring parameter field mapping relation corresponding to the query mapping interface according to the parameter mapping protocol, and acquiring at least one target parameter field having parameter field mapping relation with each parameter field; the multiple parameter-output mapping fields correspond to the same target parameter-output field; and forming the parameter-generating nested mapping data as target parameter-generating data corresponding to at least one target parameter-generating field according to the parameter-generating mapping protocol and the mapping parameter-generating data.
Wherein the argument mapping protocol may be a mapping protocol of a target argument field. The argument field mapping relationship may be a mapping relationship of a target argument field and an argument map field determined by an argument mapping protocol. The out-of-nesting mapping data can be partial data in the out-of-nesting processing result, and is determined through the out-of-nesting mapping protocol and the mapping out-of-data, and is used for generating a feedback result of the interface calling request.
In the embodiment of the invention, the nesting type of the target interface can be determined firstly, if the nesting type of the target interface is the parameter-out nesting type, the one-to-one correspondence between the parameter-in mapping field and the target parameter-in field can be further determined, the parameter-in mapping field and the target parameter-in data are input into the query mapping interface together according to the one-to-one correspondence between the parameter-in mapping field and the target parameter-in field, and the query mapping interface determines the mapping parameter-out data corresponding to each parameter-out mapping field according to the parameter-in mapping field and the target parameter-in data and outputs the mapping parameter-out data. After mapping parameter data corresponding to each parameter field output by the query mapping interface is acquired, a parameter mapping protocol of the target interface can be further acquired, and the parameter mapping protocol is analyzed to obtain a parameter field mapping relation corresponding to the query mapping interface, so that at least one target parameter field having the parameter field mapping relation with each parameter mapping field is determined, wherein a plurality of parameter mapping fields correspond to the same target parameter field. After obtaining at least one target parameter field having parameter field mapping relation with each parameter field, further determining parameter field mapping relation according to parameter field mapping protocol, further determining parameter nested mapping data according to parameter field mapping relation, parameter field nesting and mapping parameter data, and further using parameter nested mapping data as target parameter data corresponding to at least one target parameter field.
For example, an interface of a partner cooperating with a third party may determine, according to an argument mapping protocol, an argument mapping field "phone" having an argument field mapping relationship with "mobile" in the target argument field and an argument mapping field "vericationode" having an argument field mapping relationship with "code" in the target argument field. The mobile and the phone have a one-to-one correspondence, the variable and the verificationcode have a one-to-one correspondence, and then the target input parameter is mapped to the corresponding position behind the corresponding input parameter mapping field, and the following request message is generated:
{
"phone": a "mobile phone number of 11 digits",
"verificationcode": "authentication code of preset data length"
}
After the request message generated by the partner interface is obtained, "phone" and "11-bit mobile phone number" in the request message, and "verificationcode" and "verification code with preset data length" may be input to the query mapping interface, the query mapping interface may output the following response message, and the response message may be used as mapping parameter data.
Figure BDA0003508327550000101
Figure BDA0003508327550000111
If it can be determined according to the participation mapping protocol that "le _ name" of a partner interface (e.g., query mapping interface) has a participation field mapping relationship with a target participation field "name", that "le _ age" has a participation field mapping relationship with a target participation field "age", that "le _ bankCardList" has a participation field mapping relationship with a target participation field "bankCardList", that "le _ cardno" has a participation field mapping relationship with a target participation field "cardno", that "le _ bankcame" has a participation field mapping relationship with a target participation field "bankName", that "le _ address" has a participation field mapping relationship with a target participation field "address", that "le _ progress" has a participation field mapping relationship with a target participation field "progress", that "le _ city" has a participation field mapping relationship with a target participation field "history", "le _ city" has a participation field mapping relationship with a target participation field "string, then, according to the parameter mapping protocol and the parameter mapping data, a response message (a feedback result of the interface calling request) of the target interface can be obtained:
Figure BDA0003508327550000112
Figure BDA0003508327550000121
wherein, the parameter field nesting exists between the "bankCardList" and the "address". According to the response message of the target interface, when the target parameter field is determined to be 'name', the target parameter data is 'poplar xxx', and when the target parameter field is 'age', the target parameter data is '21', and so on. By analogy, all target parameter fields of the target interface for inquiring the personal basic information and target parameter data corresponding to the target parameter fields can be determined.
It should be noted that the data format of the entry-participation mapping protocol and the exit-participation mapping protocol may be a json text format, and the specific protocol format of the entry-participation mapping protocol refers to the following contents:
targeFieldName-the name of the in-parameter mapping field to be mapped.
targeFieldType: the type of data of the access map field that needs to be mapped.
sourceFieldValue: the target to be mapped is referenced to the data.
sourceFieldType: the data type of the target parameter data to be mapped.
Model: the mode of the mapping.
The specific protocol format of the mapping protocol is referred to as follows:
the targeFieldName is the name of the target argument field to be mapped.
targeFieldType: the data type of the target argument field that needs mapping.
sourceFieldValue: and the value corresponding to the out-reference mapping field needing mapping.
sourceFieldType: and the data type of the value corresponding to the out-reference mapping field needing mapping.
Model: the mode of the mapping.
In an optional embodiment of the present invention, the obtaining target parameter data corresponding to at least one target parameter field of the target interface according to the target parameter field, the target parameter data, the nesting type, the query mapping interface and the nesting processing result may include obtaining a parameter mapping protocol when it is determined that the nesting type is parameter field nesting and parameter field nesting, and querying a parameter field mapping relationship corresponding to the query mapping interface according to the parameter mapping protocol, and obtaining at least one parameter mapping field having a parameter field mapping relationship with each target parameter field; a plurality of target parameter fields correspond to the same parameter mapping field; determining 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 acquiring mapping parameter-exiting data which are output by the query mapping interface and correspond to each parameter-exiting mapping field; acquiring a parameter mapping protocol, inquiring parameter field mapping relation corresponding to the query mapping interface according to the parameter mapping protocol, and acquiring at least one target parameter field having parameter field mapping relation with each parameter field; the multiple parameter mapping fields correspond to the same target parameter field; and forming the parameter-generating nested mapping data as target parameter-generating data corresponding to at least one target parameter-generating field according to the parameter-generating mapping protocol and the mapping parameter-generating 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 entry field nesting and the exit field nesting, the entry mapping protocol can be further obtained, and then the entry mapping protocol is analyzed to obtain the entry field mapping relation corresponding to the query mapping interface, so that at least one entry mapping field having the entry field mapping relation with each target entry field is determined, and a plurality of target entry fields correspond to the same entry mapping field. After at least one parameter-entering mapping field corresponding to each target parameter-entering field is obtained, parameter-entering nested mapping data can be determined according to a parameter-entering mapping protocol, the parameter-entering mapping field and target parameter-entering data, the parameter-entering nested mapping data are input into a query mapping interface so as to perform data query through the query mapping interface, mapping parameter-exiting data corresponding to each parameter-exiting mapping field are output, a parameter-exiting mapping protocol of the target interface is further obtained, and the parameter-exiting mapping protocol is analyzed so as to obtain a parameter-exiting field mapping relation corresponding to the query mapping interface, so that at least one target parameter-exiting field (a plurality of parameter-exiting mapping fields correspond to the same target parameter-exiting field) having a parameter-exiting field mapping relation with each parameter-exiting mapping field is determined. After obtaining at least one target parameter field having parameter field mapping relation with each parameter field, further determining parameter field mapping relation according to parameter field mapping protocol, further determining parameter nested mapping data according to parameter field mapping relation, parameter field nesting and mapping parameter data, and further using parameter nested mapping data as target parameter data corresponding to at least one target parameter field.
In an optional embodiment of the present invention, before acquiring the ingress mapping protocol, the method may further include: determining a mapping relation of the parameter field corresponding to the query mapping interface; and generating a parameter mapping protocol according to the target parameter field, the parameter mapping field and the parameter field mapping relation.
In the embodiment of the present invention, before acquiring the parameter-entering mapping protocol, a parameter-entering field mapping relationship between the target parameter-entering data and the parameter-entering mapping field may be first determined, that is, the parameter-entering field mapping relationship between the target parameter-entering data and the parameter-entering mapping field is used as the parameter-entering field mapping relationship 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 relationship, so as to determine the corresponding relationship between the target parameter-entering data nested in the parameter-entering field and the parameter-entering mapping field according to the parameter-entering mapping protocol, and thus determine the parameter-entering nested mapping data input to the query mapping interface according to the corresponding relationship between the target parameter-entering data and the parameter-entering mapping field and the target parameter-entering data.
In an optional embodiment of the present invention, before obtaining the parameter mapping protocol, the method may further include: determining a parameter field mapping relation corresponding to the query mapping interface; and generating a parameter mapping protocol according to the target parameter field, the parameter mapping field and the parameter mapping relation.
In the embodiment of the present invention, before obtaining the parameter mapping protocol, a parameter field mapping relationship between the target parameter data and the parameter field may be first determined, that is, the parameter field mapping relationship between the target parameter data and the parameter field is used as the parameter field mapping relationship corresponding to the query mapping interface, and then the parameter mapping protocol is generated according to the target parameter field, the parameter field, and the parameter field mapping relationship, so as to determine a corresponding relationship between the target parameter data and the parameter field nested in the parameter field according to the parameter mapping protocol, and thus query the target parameter data from the mapped parameter data according to the corresponding relationship between the target parameter data and the parameter field.
S240, target parameter data corresponding to at least one target parameter field of the target interface is used as a feedback result aiming at the interface calling request.
Fig. 3 is a schematic flowchart of an interface invocation according to a second embodiment of the present invention, as shown in fig. 3, the method may first read an entry-parameter mapping protocol, and then traverse a target entry field, and when the nesting type does not include entry field nesting, may complete simple mapping (one-to-one mapping) between an entry-parameter mapping field and a target entry field through a one-to-one mapping relationship between the entry-parameter mapping field and the target entry field, and then determine a request packet of a partner interface cooperating with a third party according to the entry-parameter mapping field, the target entry field, and the target entry parameter data, and then invoke a query mapping interface, and input the entry-parameter mapping field and the target entry parameter data in the request packet to the query mapping interface, obtain a response packet of the partner interface cooperating with the third party, further read an exit-parameter mapping protocol, and traverse the target entry field, and if the target parameter field has parameter field nesting, determining the sub-field of the target parameter field nesting according to the parameter field nesting, traversing the sub-field of the target parameter field nesting and mapping until all the sub-fields of the target parameter field nesting complete mapping. And if the target parameter field does not have parameter field nesting, simply mapping the parameter field and the target parameter field according to the one-to-one mapping relation between the parameter field and the target parameter field, and generating a response message of the target interface according to the mapping result and the parameter mapping data.
Fig. 4 is a configuration interface of a target argument field and an argument mapping field according to a second embodiment of the present invention, as shown in fig. 4, the target argument fields of the target interface are test-nd1 and test-nd2, respectively, the field type of the test-nd1 is a string type, and the field type of the test-nd2 is an array. The argument map field with argument field mapping to test-nd1 is $ logic-out-mocktest.A and the argument map field with argument field mapping to test-nd2 is $ logic-out-mocktest.B. the test-nd2 has a parameter-out field nested with two parameter-in fields of test-nd21 and test-nd22, and the data types of the two parameter-in fields are character string types. Optionally, the data types of the target parameter field and the target parameter field may include, but are not limited to, a string type, a shaping type, an array type, an enumeration type, a map type, and the like.
According to the technical scheme of the embodiment, at least one target parameter input field is displayed according to an interface calling request of a target interface in response to the interface calling request of the target interface, and target parameter input data which are input by a user and respectively correspond to each target parameter input field are received, so that a query mapping interface corresponding to the target interface is obtained, a nesting type which is matched with the query mapping interface and comprises parameter input field nesting and/or parameter output field nesting is obtained, therefore, target parameter output data corresponding to at least one target parameter output field of the target interface are obtained according to the target parameter input field, the target parameter input data, the nesting type, the query mapping interface and a nesting processing result, and further the target parameter output data corresponding to at least one target parameter output field of the target interface are used as a feedback result aiming at the interface calling request. When the target parameter-in field and/or the target parameter-out field are/is nested, the target parameter-out data corresponding to the target parameter-out field can be obtained according to the target parameter-in field, the target parameter-in data, the nesting type, the query mapping interface and the nesting processing result, and an interface for nesting calling is not required to be configured for the field (the target parameter-in field and/or the target parameter-out field) with the nesting, so that the interface nesting among a plurality of interface calls is avoided, the problems that the code complexity caused by the interface nesting is high in the prior art, when the parameter definition of multi-layer set nesting is involved in the parameter participating, the service requirement cannot be responded in time due to only newly increased interfaces, the research and development workload is large and the project cycle is prolonged are solved, the nested parameters are prevented from being called by newly increased interfaces on the premise of not increasing the code complexity, the research and development workload is reduced, thereby responding quickly to traffic demands.
It should be noted that any permutation and combination between the technical features in the above embodiments also belong to the scope of the present invention.
In the technical scheme of the embodiment of the invention, the acquisition, application and the like of the personal information of the related user are in accordance with the regulations of related laws and regulations without violating the good customs of the public order.
EXAMPLE III
Fig. 5 is a schematic diagram of an interface invoking device according to a third embodiment of the present invention, and as shown in fig. 5, the interface invoking device includes: a target entry parameter data obtaining module 310, an interface obtaining module 320, a target exit parameter data obtaining module 330, and a feedback result determining module 340, wherein:
a target parameter data obtaining module 310, configured to, in response to an interface call request for a target interface, obtain at least one target parameter field matched with the interface call request and target parameter data corresponding to each target parameter field;
the interface acquisition module 320 is configured to acquire a query mapping interface corresponding to the target interface and acquire a nesting type matched with the query mapping interface; the nesting types include: nesting in a parameter field and/or nesting out of a parameter field;
a target parameter data acquiring module 330, configured to acquire target parameter data corresponding to at least one target parameter field of a target interface according to the target parameter field, the target parameter data, the nesting type, the query mapping interface, and the nesting processing result;
wherein, the nesting processing result comprises: the parameter input nesting processing result corresponds to the target parameter input data and/or the parameter output nesting processing result corresponds to the mapping parameter output by the query mapping interface;
and a feedback result determining module 340, configured to use the target parameter data corresponding to at least one target parameter 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 entry parameter field matched with an interface calling request and target entry parameter data respectively corresponding to each target entry parameter field are obtained in response to the interface calling request of a target interface, a query mapping interface corresponding to the target interface is further obtained, a nesting type including entry parameter field nesting and/or entry parameter field nesting matched with the query mapping interface is obtained, target entry parameter data corresponding to at least one target entry parameter field of the target interface are obtained according to the target entry parameter field, the target entry parameter data, the nesting type, the query mapping interface and a nesting processing result, and target exit parameter data corresponding to at least one target exit parameter field of the target interface are further used as a feedback result aiming at the interface calling request. When the target parameter-in field and/or the target parameter-out field are/is nested, the target parameter-out data corresponding to the target parameter-out field can be obtained according to the target parameter-in field, the target parameter-in data, the nesting type, the query mapping interface and the nesting processing result, and an interface for nesting calling is not required to be configured for the field (the target parameter-in field and/or the target parameter-out field) with the nesting, so that the interface nesting among a plurality of interface calls is avoided, the problems that the code complexity caused by the interface nesting is high in the prior art, when the parameter definition of multi-layer set nesting is involved, the service requirement cannot be responded in time due to only newly increased interfaces, the research and development workload is large and the project period is prolonged are solved, and on the premise of not increasing the code complexity, the nested parameters are called by newly increased interfaces, the research and development workload is reduced, thereby responding quickly to traffic demands.
Optionally, the target parameter data obtaining module 330 is specifically configured to, when it is determined that the nesting type is only parameter field nesting, obtain a parameter mapping protocol, query a parameter field mapping relationship corresponding to the query mapping interface according to the parameter mapping protocol, and obtain at least one parameter mapping field having a parameter field mapping relationship with each target parameter field; a plurality of target parameter fields correspond to the same parameter mapping field; determining 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 acquiring mapping parameter-exiting data which are output by the query mapping interface and correspond to each parameter-exiting mapping field; and acquiring target parameter data corresponding to at least one target parameter field of the target interface according to the one-to-one correspondence between the parameter mapping field and the target parameter field and the parameter mapping data.
Optionally, the target parameter-entering data obtaining module 330 is specifically configured to, when it is determined that the nesting type is only the parameter-entering field nesting, input the parameter-entering mapping field and the target parameter-entering data into the query mapping interface together according to the one-to-one correspondence between the parameter-entering mapping field and the target parameter-entering field; acquiring mapping parameter data which is output by the query mapping interface and corresponds to each parameter mapping field; acquiring a parameter mapping protocol, inquiring parameter field mapping relations corresponding to the inquiry mapping interface according to the parameter mapping protocol, and acquiring at least one target parameter field having parameter field mapping relations with each parameter field; the multiple parameter mapping fields correspond to the same target parameter field; and forming parameter-generating nested mapping data as target parameter-generating data corresponding to at least one target parameter-generating field according to the parameter-generating mapping protocol and the mapping parameter-generating data.
Optionally, the target parameter data obtaining module 330 is specifically configured to, when it is determined that the nesting type is parameter field nesting and parameter field nesting, obtain a parameter mapping protocol, query a parameter field mapping relationship corresponding to the query mapping interface according to the parameter mapping protocol, and obtain at least one parameter mapping field having a parameter field mapping relationship with each target parameter field; a plurality of target parameter fields correspond to the same parameter mapping field; determining 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 acquiring mapping parameter-exiting data which are output by the query mapping interface and correspond to each parameter-exiting mapping field; acquiring a parameter mapping protocol, inquiring parameter field mapping relations corresponding to the inquiry mapping interface according to the parameter mapping protocol, and acquiring at least one target parameter field having parameter field mapping relations with each parameter field; the multiple parameter-output mapping fields correspond to the same target parameter-output field; and forming parameter-generating nested mapping data as target parameter-generating data corresponding to at least one target parameter-generating field according to the parameter-generating mapping protocol and the mapping parameter-generating data.
Optionally, the interface invoking device may further include an interface invoking request generating module, configured to respond to the target data querying request and generate an interface invoking request according to the target data querying request.
Optionally, the target entry parameter data obtaining module 310 is specifically configured to display at least one target entry field according to the interface call request, and receive the target entry data input by the user and corresponding to each target entry field.
Optionally, the interface calling apparatus may further include a parameter mapping protocol generating module, configured to determine a parameter 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 apparatus may further include a parameter mapping protocol generation module, configured to determine a parameter field mapping relationship corresponding to the query mapping interface; and generating the parameter mapping protocol according to the target parameter field, the parameter mapping field and the parameter mapping relation.
The interface calling device can execute the interface calling method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in this embodiment, reference may be made 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, a person skilled in the art can understand the specific implementation of the interface calling device in the embodiment and various variations thereof, and therefore how the interface calling device implements the interface calling method in the embodiment of the present invention is not described in detail herein. The device used by those skilled in the art to implement the interface calling method in the embodiments of the present invention is within the scope of the present application.
Example four
Fig. 6 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. FIG. 6 illustrates a block diagram of an electronic device 412 that is suitable for use in implementing embodiments of the present invention. The electronic device 412 shown in fig. 6 is only an example and should not bring any limitations to the functionality and scope of use of the embodiments of the present invention.
As shown in fig. 6, the electronic device 412 is in the form of a general purpose computing device. The components of the electronic device 412 may include, but are not limited to: one or more processors 416, a storage device 428, and a bus 418 that couples the various system components including the storage device 428 and the processors 416.
Bus 418 represents one or more of any 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, such architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
Electronic device 412 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 412 and includes both volatile and nonvolatile media, removable and non-removable media.
Storage 428 may include computer system readable media in the form of volatile Memory, such as 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 and write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard drive"). Although not shown in FIG. 6, a magnetic 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 or writing to a removable, nonvolatile optical disk (e.g., a Compact disk-Read Only Memory (CD-ROM), a Digital Video disk (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 418 by one or more data media interfaces. Storage 428 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
Program 436 having a set (at least one) of program modules 426 may be stored, for example, in storage 428, such program modules 426 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination may comprise an implementation of a network environment. Program modules 426 generally perform the functions and/or methodologies of embodiments of the invention as 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.), with one or more devices that enable a user to interact with the electronic device 412, and/or with any devices (e.g., network card, modem, etc.) that enable the electronic device 412 to communicate with one or more other computing devices. Such communication may be 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 (LAN), Wide Area Network (WAN), and/or a public Network, such as the internet) via the Network adapter 420. As shown, network adapter 420 communicates with the other modules of electronic device 412 over bus 418. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 412, including but not limited to: microcode, device drivers, Redundant processing units, external disk drive Arrays, disk array (RAID) systems, tape drives, and data backup storage systems, to name a few.
The processor 416 executes various functional applications and data processing by executing programs stored in the storage device 428, for example, implementing the interface calling method provided by the above-described embodiment of the present invention: responding to an interface calling request of a target interface, and acquiring at least one target parameter field matched with the interface calling request and target parameter data respectively corresponding to each target parameter field; acquiring a query mapping interface corresponding to a target interface, and acquiring a nesting type matched with the query mapping interface; the nesting types include: nesting in a parameter field and/or nesting out of a parameter field; acquiring target parameter-entering data corresponding to at least one target parameter-exiting field of a target interface according to the target parameter-entering field, the target parameter-entering data, the nesting type, the query mapping interface and the nesting processing result; wherein, the nesting processing result comprises: the parameter input nesting processing result corresponds to the target parameter input data and/or the parameter output nesting processing result corresponds to the mapping parameter output by the query mapping interface; and taking the target parameter data corresponding to at least one target parameter field of the target interface as a feedback result aiming at the interface calling request.
According to the technical scheme of the embodiment, at least one target parameter input field matched with an interface calling request and target parameter input data respectively corresponding to each target parameter input field are obtained by responding to the interface calling request of a target interface, a query mapping interface corresponding to the target interface is further obtained, a nesting type which is matched with the query mapping interface and comprises parameter input field nesting and/or parameter output field nesting is obtained, therefore, the target parameter output data corresponding to at least one target parameter output field of the target interface is obtained 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 the target parameter output data corresponding to at least one target parameter output field of the target interface is further used as a feedback result aiming at the interface calling request. When the target parameter-in field and/or the target parameter-out field are/is nested, the target parameter-out data corresponding to the target parameter-out field can be obtained according to the target parameter-in field, the target parameter-in data, the nesting type, the query mapping interface and the nesting processing result, and an interface for nesting calling is not required to be configured for the field (the target parameter-in field and/or the target parameter-out field) with the nesting, so that the interface nesting among a plurality of interface calls is avoided, the problems that the code complexity caused by the interface nesting is high in the prior art, when the parameter definition of multi-layer set nesting is involved, the service requirement cannot be responded in time due to only newly increased interfaces, the research and development workload is large and the project period is prolonged are solved, and on the premise of not increasing the code complexity, the nested parameters are called by newly increased interfaces, the research and development workload is reduced, thereby responding quickly to traffic demands.
EXAMPLE five
An embodiment of the present invention further provides a computer storage medium storing a computer program, where the computer program is used to execute the interface calling method according to any one of the above embodiments of the present invention when executed by a computer processor: responding to an interface calling request of a target interface, and acquiring 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; acquiring a query mapping interface corresponding to a target interface, and acquiring a nesting type matched with the query mapping interface; the nesting types include: nesting in a parameter field and/or nesting out of a parameter field; acquiring target parameter-entering data corresponding to at least one target parameter-exiting field of a target interface according to the target parameter-entering field, the target parameter-entering data, the nesting type, the query mapping interface and the nesting processing result; wherein, the nesting processing result comprises: the parameter input nesting processing result corresponds to the target parameter input data and/or the parameter output nesting processing result corresponds to the mapping parameter output by the query mapping interface; and taking the target parameter data corresponding to at least one target parameter field of the target interface as a feedback result aiming at the interface calling request.
Computer storage media for embodiments of the invention may employ 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. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination 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 (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 the context of 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.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. 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 for aspects 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 + + or the like 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 latter scenario, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will appreciate that the present invention is not limited to the particular embodiments described herein, and that various obvious changes, rearrangements and substitutions will now be apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. An interface calling method, comprising;
responding to an interface calling request of a target interface, and acquiring at least one target parameter field matched with the interface calling request and target parameter data respectively corresponding to each target parameter field;
acquiring a query mapping interface corresponding to the target interface, and acquiring a nesting type matched with the query mapping interface; the nesting types include: nesting in a parameter field and/or nesting out of a parameter field;
acquiring target parameter-entering data corresponding to at least one target parameter-exiting field of a target interface according to the target parameter-entering field, the target parameter-entering data, the nesting type, the query mapping interface and the nesting processing result;
wherein, the nesting processing result comprises: the parameter input nesting processing result corresponds to the target parameter input data and/or the parameter output nesting processing result corresponds to the mapping parameter output by the query mapping interface;
and taking target parameter data corresponding to at least one target parameter field of the target interface as a feedback result aiming at the interface calling request.
2. The method of claim 1, wherein obtaining target parameter data corresponding to at least one target parameter field of a target interface according to a target parameter field, target parameter data, a nesting type, a query mapping interface, and a nesting processing result comprises:
when the nesting type is only determined to be the embedding of the parameter field, acquiring a parameter mapping protocol, inquiring parameter field mapping relations corresponding to the inquiry mapping interface according to the parameter mapping protocol, and acquiring at least one parameter mapping field which has parameter field mapping relations with all target parameter fields; a 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 parameter-entering nested mapping data into a query mapping interface, and acquiring mapping parameter-exiting data which are output by the query mapping interface and correspond to each parameter-exiting mapping field;
and acquiring target parameter data corresponding to at least one target parameter field of the target interface according to the one-to-one correspondence between the parameter mapping field and the target parameter field and the parameter mapping data.
3. The method of claim 1, wherein obtaining target parameter data corresponding to at least one target parameter field of a target interface according to a target parameter field, target parameter data, a nesting type, a query mapping interface, and a nesting processing result comprises:
when the nesting type is determined to be only the nesting of the parameter-out field, inputting the parameter-in mapping field and the parameter-in target data into the query mapping interface together according to the one-to-one correspondence between the parameter-in mapping field and the parameter-in target field;
acquiring mapping parameter data which is output by the query mapping interface and corresponds to each parameter mapping field;
acquiring a parameter mapping protocol, inquiring parameter field mapping relations corresponding to the inquiry mapping interface according to the parameter mapping protocol, and acquiring at least one target parameter field having parameter field mapping relations with each parameter field; the multiple parameter mapping fields correspond to the same target parameter field;
and forming parameter-generating nested mapping data as target parameter-generating data corresponding to at least one target parameter-generating field according to the parameter-generating mapping protocol and the mapping parameter-generating data.
4. The method of claim 1, wherein obtaining target parameter data corresponding to at least one target parameter field of a target interface according to a target parameter field, target parameter data, a nesting type, a query mapping interface, and a nesting processing result comprises:
when the nesting type is determined to be the parameter input field nesting and the parameter output field nesting, acquiring a parameter input mapping protocol, inquiring parameter input field mapping relations corresponding to the inquiry mapping interfaces according to the parameter input mapping protocol, and acquiring at least one parameter input mapping field having parameter input field mapping relations with all target parameter input fields; a plurality of target parameter fields correspond to the same parameter mapping field;
determining 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 acquiring mapping parameter-exiting data which are output by the query mapping interface and correspond to each parameter-exiting mapping field;
acquiring a parameter mapping protocol, inquiring parameter field mapping relations corresponding to the inquiry mapping interface according to the parameter mapping protocol, and acquiring at least one target parameter field having parameter field mapping relations with each parameter field; the multiple parameter-output mapping fields correspond to the same target parameter-output field;
and forming parameter-generating nested mapping data as target parameter-generating data corresponding to at least one target parameter-generating field according to the parameter-generating mapping protocol and the mapping parameter-generating data.
5. The method of any of claims 1-4, 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 calling request according to the target data query request;
the acquiring at least one target parameter entry field matched with the interface calling request and target parameter entry data respectively corresponding to each target parameter entry field comprises:
and displaying at least one target parameter entering field according to the interface calling request, and receiving the target parameter entering data which is input by a user and respectively corresponds to each target parameter entering field.
6. The method according to any of claims 2 or 4, further comprising, prior to said obtaining the access parameter mapping protocol:
determining a mapping relation of the parameter 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.
7. The method according to any of claims 3 or 4, further comprising, prior to said obtaining the parameter mapping protocol:
determining a parameter field mapping relation corresponding to the query mapping interface;
and generating the parameter mapping protocol according to the target parameter field, the parameter mapping field and the parameter mapping relation.
8. An interface invocation apparatus, comprising:
the target parameter data acquisition module is used for responding to an interface calling request of a target interface and acquiring at least one target parameter field matched with the interface calling request and target parameter data respectively corresponding to each target 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 types include: nesting in a parameter field and/or nesting out of a parameter field;
the target parameter data acquisition module is used for acquiring target parameter data corresponding to at least one target parameter field of the target interface according to the target parameter field, the target parameter data, the nesting type, the query mapping interface and the nesting processing result;
wherein, the nesting processing result comprises: the parameter input nesting processing result corresponds to the target parameter input data and/or the parameter output nesting processing result corresponds to the mapping parameter output by the query mapping interface;
and the feedback result determining module is used for taking the target parameter data corresponding to at least one target parameter field of the target interface as a feedback result aiming at the interface calling request.
9. An electronic device, characterized in that the electronic device comprises:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the interface call method as recited in any of claims 1-7.
10. A computer storage medium on which a computer program is stored, which program, when executed by a processor, implements the interface call method according to any one of claims 1 to 7.
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 true CN114528044A (en) 2022-05-24
CN114528044B 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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114860834A (en) * 2022-06-01 2022-08-05 北京字节跳动网络技术有限公司 Processing method, device, equipment and storage medium of associated query request
CN115277128A (en) * 2022-07-13 2022-11-01 上海砾阳软件有限公司 Illegal request processing method and device and electronic equipment
CN117573762A (en) * 2024-01-15 2024-02-20 杭州数云信息技术有限公司 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网络编排系统接口自动化测试", 电信技术, pages 77 - 79 *

Cited By (6)

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

Also Published As

Publication number Publication date
CN114528044B (en) 2024-02-23

Similar Documents

Publication Publication Date Title
CN114528044A (en) Interface calling method, device, equipment and medium
US20210256431A1 (en) Methods for unlocking shared bikes
CN112036824A (en) Business approval method, system, storage medium and electronic equipment
CN111626452B (en) Intelligent government affair processing method, device, terminal and medium
CN110263277B (en) Page data display method, page data updating device, page data equipment and storage medium
CN110489440B (en) Data query method and device
CN110781373B (en) List updating method and device, readable medium and electronic equipment
CN110647316B (en) Method and device for generating universal business object, computer equipment and storage medium
CN111338797A (en) Task processing method and device, electronic equipment and computer readable storage medium
CN111737022A (en) Interface calling method, system, equipment and medium based on micro-service
CN110597602A (en) Transaction processing method and device, computer equipment and storage medium
CN109697034A (en) A kind of method for writing data, device, electronic equipment and storage medium
CN110519373B (en) Method and device for pushing information
CN113986995A (en) Request distribution method and device, storage medium and electronic equipment
CN113807056B (en) Document name sequence error correction method, device and equipment
CN110377654B (en) Data request processing method and device, electronic equipment and computer-readable storage medium
CN111813407B (en) Game development method, game running device and electronic equipment
CN113919310A (en) Short message content determination method and device, electronic equipment and storage medium
CN113393288A (en) Order processing information generation method, device, equipment and computer readable medium
CN114546370A (en) Data docking method and related device
CN113761588A (en) Data verification method and device, terminal equipment and storage medium
CN112613955A (en) Order processing method and device, electronic equipment and storage medium
CN114490104A (en) Information forwarding method, device, equipment and medium in Android system module
CN112182083A (en) File generation method, device, equipment and storage medium
CN110046171B (en) System, method and apparatus for obtaining information

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