CN112015496B - Interface calling method and device, computer equipment and storage medium - Google Patents

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

Info

Publication number
CN112015496B
CN112015496B CN202010901803.XA CN202010901803A CN112015496B CN 112015496 B CN112015496 B CN 112015496B CN 202010901803 A CN202010901803 A CN 202010901803A CN 112015496 B CN112015496 B CN 112015496B
Authority
CN
China
Prior art keywords
interface
service access
access party
party
functional
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010901803.XA
Other languages
Chinese (zh)
Other versions
CN112015496A (en
Inventor
魏华亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China 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 Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202010901803.XA priority Critical patent/CN112015496B/en
Publication of CN112015496A publication Critical patent/CN112015496A/en
Application granted granted Critical
Publication of CN112015496B publication Critical patent/CN112015496B/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/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Landscapes

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

Abstract

The invention provides an interface calling method, an interface calling device, computer equipment and a storage medium. The method comprises the following steps: receiving an acquisition request of a standard interface converter sent by a service access party; sending an environment detection plug-in to a service access party, wherein the environment detection plug-in is used for detecting the characteristic information of the service access party; receiving a detection result sent by an environment detection plug-in; analyzing the detection result to obtain the characteristic information of the service access party; determining a functional interface provided by a service access party according to the characteristic information of the service access party; encapsulating the interface docking program to form a standard interface converter, wherein the standard interface converter is used for converting a functional interface provided by a service access party into a standard functional interface; and sending the standard interface converter to the service access party so that the service party calls the functional interface provided by the service access party by calling the standard functional interface. The invention can reduce the complexity of the service access in different application environments and reduce the service maintenance cost.

Description

Interface calling method and device, computer equipment and storage medium
Technical Field
The present invention relates to the field of service access technologies, and in particular, to a method and an apparatus for invoking an interface related to service access, a computer device, and a storage medium.
Background
In the prior art, in order to reduce repeated development of services, more and more projects can be accessed to different application environments, and for the projects of the type, the inventor researches and discovers that on one hand, the types of the same product are more and more diversified, and specifically comprise types such as PC web, android App, IOS App, various small programs, fast application and the like; on the other hand, there are more and more different products related to the same project, resulting in more and more complex application environments for project access. When interfaces with the same function are provided by different application environments, the adopted standards are not consistent, for example, when the interfaces of the application environments are called to acquire system hardware capability, js bridge or scheme call may be used in the App environment, wxapi call may be used in the WeChat environment, and the capability may not exist in the web side. Therefore, in order to adapt to different application environments, multiple layers of judgment are generally required in a project according to an accessed application environment, hard coding is performed in the project, and a functional interface provided by a service access party is called for different service access parties, so that a large amount of codes irrelevant to core functions are generated in the project, and the access cost is high. In addition, for the same application environment, when the interface of the application environment is changed, the release version corresponding to the project needs to be changed, and in each version, regression verification needs to be performed on all scenes, so that the maintenance cost is high.
Therefore, providing an interface calling method, apparatus, computer device and storage medium reduces complexity of service access in different application environments and reduces service maintenance cost, which is a technical problem that needs to be solved in the art urgently.
Disclosure of Invention
The present invention is directed to an interface calling method, an interface calling apparatus, a computer device, and a storage medium, which are used to solve the above technical problems in the prior art.
In one aspect, the present invention provides an interface calling method for achieving the above object.
The interface calling method comprises the following steps: receiving an acquisition request of a standard interface converter sent by a service access party; sending an environment detection plug-in to the service access party, wherein the environment detection plug-in is used for detecting the characteristic information of the service access party; receiving a detection result sent by the environment detection plug-in; analyzing the detection result to obtain the characteristic information of the service access party; determining a functional interface provided by the service access party according to the characteristic information of the service access party; encapsulating an interface docking program to form the standard interface converter, wherein the standard interface converter is used for converting a functional interface provided by the service access party into a standard functional interface; and sending the standard interface converter to the service access party so that the service party calls the functional interface provided by the service access party by calling the standard functional interface.
Further, the feature information includes a product type of the service access party, and the step of determining the functional interface provided by the service access party according to the feature information of the service access party includes: and searching a functional interface corresponding to the product type of the service access party in a preset corresponding relation list of the product type and the functional interface.
Further, the feature information includes identification information of the service access party, and the step of determining the functional interface provided by the service access party according to the feature information of the service access party includes: acquiring an interface list of the service access party according to the identification information of the service access party; and acquiring the functional interface provided by the service access party in the interface list.
Further, the feature information includes identification information of the service access party, and the step of determining the functional interface provided by the service access party according to the feature information of the service access party includes: capturing a description document of the service access party according to the identification information of the service access party; performing text analysis on the description document, and extracting interface description contents including interface meanings, reference-out meanings and reference-in meanings; and determining the functional interface provided by the service access party in the interface description content.
Further, the feature information further includes version information of the service access party, and after the step of encapsulating an interface docking program to form the standard interface converter, the interface calling method further includes: and caching the standard interface converter and the corresponding relation between the standard interface converter and the characteristic information.
Further, the obtaining request of the standard interface converter includes interface function parameters, and the step of determining the functional interface provided by the service access party according to the feature information of the service access party includes: and determining the functional interface which is provided by the service access party and accords with the interface functional parameters according to the characteristic information of the service access party.
Further, the step of determining the functional interface provided by the service access party according to the feature information of the service access party further includes: when determining that the functional interface of the service access party does not conform to the interface functional parameters, searching for compatible strategies corresponding to the interface functional parameters; an alternate functional interface is determined based on the compatibility policy.
Further, when the environment detection plug-in detects the feature information of the service access party, the feature information of the service access party is determined according to the feature value of the service access party, or the feature information of the service access party is determined according to whether the service access party has a preset function.
Further, after the step of receiving the detection result sent by the environment detection plugin, before the step of determining the functional interface provided by the service access party according to the feature information of the service access party, the interface calling method further includes: when the detection result is analyzed to obtain the information of detection failure, a characteristic request is sent to the service party; and receiving the characteristic information of the service access party sent by the service party.
Further, the service access party is configured to respond to a page open operation and obtain page response data, where the page response data includes an instruction for triggering sending of the obtaining request.
In another aspect, the present invention provides an interface invoking device for achieving the above-mentioned object.
The interface calling device comprises: the first receiving module is used for receiving an acquisition request of the standard interface converter sent by a service access party; the first sending module is used for sending an environment detection plug-in to the service access party, wherein the environment detection plug-in is used for detecting the characteristic information of the service access party; the second receiving module is used for receiving the detection result sent by the environment detection plug-in; the analysis module is used for analyzing the detection result to obtain the characteristic information of the service access party; the determining module is used for determining a functional interface provided by the service access party according to the characteristic information of the service access party; the encapsulation module is used for encapsulating an interface docking program to form the standard interface converter, wherein the standard interface converter is used for converting the functional interface provided by the service access party into a standard functional interface; and the second sending module is used for sending the standard interface converter to the service access party so that the service party calls the functional interface provided by the service access party by calling the standard functional interface.
In another aspect, to achieve the above object, the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of the method when executing the computer program.
In a further aspect, to achieve the above object, the present invention further provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the above method.
The interface calling method, device, computer equipment and storage medium provided by the invention, when a business party needs to call an interface of a certain function in business logic, only a standard function interface is called without paying attention to the difference of actually provided function interfaces of different business access parties, the difference is realized by an access platform, in an initialization process related to the calling of the standard function interface, the business access party sends an acquisition request of the standard interface converter to the access platform, the access platform firstly sends an environment detection plug-in to the business access party after receiving the acquisition request to detect the characteristic information of the business access party, after the detection is finished, the detection result is sent to the access platform, the access platform receives the detection result sent by the environment detection plug-in and analyzes the detection result to obtain the characteristic information of the business access party, after the characteristic information of the business access party is obtained, the function interface which can be actually provided by the business access party is determined according to the characteristic information of the business access party, then the interface docking program can be packaged according to the function interface provided by the business access party and the standard function interface called by the business access party can be formed, and the interface which business access party needs to be changed based on the difference of the actually provided business interface of the business access party, therefore, no matter which business access party, the business interface is changed in the business interface, the business access party, the business interface which needs to be changed in the calling and the business interface, the business access party, the complexity of service access in different application environments is reduced, and the service maintenance cost is reduced.
Drawings
Various additional advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart of an interface calling method according to an embodiment of the present invention;
fig. 2 is a block diagram of an interface invoking device according to a second embodiment of the present invention;
fig. 3 is a hardware structure diagram of a computer device according to a third embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to solve the technical problems of high complexity and high maintenance cost of different service access environments in the prior art, the invention provides an interface calling method, a device, computer equipment and a storage medium, wherein in the interface calling method, a cross-environment access platform is provided, and through the access platform, the interface calling difference between a service party and a service access party is shielded, so that the service party only needs to pay attention to the realization of self service without paying attention to the difference of the service access party (namely, application environment), concretely, when the access platform receives an acquisition request of a standard interface converter sent by the service access party, firstly an environment detection plug-in is sent to the service access party, the environment detection plug-in is used for detecting the characteristic information of the service access party, after the detection is finished, the detection result is sent to the access platform, the access platform receives the detection result sent by the environment detection plug-in and analyzes the detection result, the method comprises the steps of obtaining the characteristic information of a service access party, determining a function interface provided by the service access party according to the characteristic information of the service access party after obtaining the characteristic information of the service access party, packaging an interface docking program according to the function interface provided by the service access party and a preset standard function interface to form a standard interface converter, and sending the standard interface converter to the service access party, wherein the standard interface converter is used for converting the function interface provided by the service access party into the standard function interface, the standard function interface is the function interface called by the service party, and for the service party, no matter which service access party, the unified standard function interface can be called, and the service party can call the function interface provided by the service access party by calling the standard function interface based on the standard interface converter adapted to the service access party, that is, the service side does not need to pay attention to the interface call difference of different service access sides.
Specific embodiments of the interface calling method, apparatus, computer device, and storage medium provided by the present invention will be described in detail below.
Example one
The embodiment of the invention provides an interface calling method, the execution main body of the interface calling method is an access platform, and through the method, the interface calling difference between a business party and a business access party can be shielded, so that the business party only needs to pay attention to the realization of self business, and does not need to pay attention to the difference of the business access party (namely, application environment), thereby reducing the complexity of business access under different application environments and reducing the maintenance cost of the business. Specifically, fig. 1 is a flowchart of an interface calling method according to an embodiment of the present invention, and as shown in fig. 1, the interface calling method includes steps S101 to S106 as follows:
step S101: and receiving an acquisition request of the standard interface converter sent by the service access party.
Optionally, in the running process of the service access party, in response to an opening operation of a user on a certain page, the service access party obtains page response data from the service party background server, where the page response data includes an instruction for triggering sending of an obtaining request of the standard interface converter, so that the service access party sends the obtaining request to the access platform.
Step S102: and sending the environment detection plug-in to the service access party.
The environment detection plug-in is used for detecting the characteristic information of the service access party.
When receiving the acquisition request, the access platform first sends the environment detection plug-in to the service access party, optionally, the environment detection plug-in can be used as a page plug-in, and in the process of page initialization, the environment detection plug-in automatically detects feature information of the service access party, for example, the feature information is information representing that the service access party is an APP, information representing that the service access party is a computer terminal, or information representing that the service access party is an applet.
Optionally, when the environment detection plug-in automatically detects the feature information of the service access party, the environment detection plug-in may detect the feature information of the service access party in real time, so as to detect the current feature information of the service access party.
Optionally, when detecting the feature information of the service access party, the environment detection plugin may determine the feature information of the service access party according to the feature value of the service access party, specifically, for example, perform feature value detection according to usergage; or, determining the feature information of the service access party according to whether the service access party has a preset function, and if a certain preset function is supported, positioning the corresponding feature information.
And after the environment detection plug-in completes detection, sending a detection result to the access platform.
Step S103: and receiving a detection result sent by the environment detection plug-in.
Step S104: and analyzing the detection result to obtain the characteristic information of the service access party.
And after receiving the detection result, the access platform analyzes the detection result to obtain the characteristic information of the service access party.
Step S105: and determining the functional interface provided by the service access party according to the characteristic information of the service access party.
In this step, according to the feature information of the service access party, the functional interfaces actually provided by the service access party are determined, including the method name, the access parameters, and the access parameters of the functional interfaces.
When the acquisition request includes interface function parameters, in the step, firstly, a plurality of function interfaces provided by the service access party are determined according to the characteristic information of the service access party, and then, the function interfaces conforming to the interface function parameters are screened out from the function interfaces.
Step S106: and packaging the interface docking program to form the standard interface converter.
The standard interface converter is used for converting the functional interface provided by the service access party into a standard functional interface.
Optionally, the service party may configure a standard function interface on the access platform, and also include information such as a method name, an exit parameter, and an entry parameter of the interface function interface, and when the service party configures a plurality of standard function interfaces on the access platform, the configuration information further includes an interface function parameter.
When the acquisition request includes the interface function parameters, on one hand, it is determined that the service access party can actually provide the interface which conforms to the interface function parameter function parameters, and for convenience of description, the following description is a first interface; on the other hand, the standard function interface corresponding to the interface function parameter called by the service party is determined, and for convenience of description, the following description is a second interface.
And then, aiming at the interface difference between the first interface and the second interface, packaging an interface docking program to form a standard interface converter, and converting the first interface into the second interface through the standard interface converter.
Optionally, the standard interface translator is a js SDK code block.
Step S107: and sending the standard interface converter to the service access party so that the service party calls the functional interface provided by the service access party by calling the standard functional interface.
By adopting the interface calling method provided by the embodiment, when a service party needs to call an interface of a certain function in service logic, only a standard function interface needs to be called without paying attention to the difference of actually provided function interfaces of different service access parties, the difference is realized by an access platform, in an initialization process related to the calling of the standard function interface, the service access party sends an acquisition request of the standard interface converter to the access platform, the access platform firstly sends an environment detection plug-in to the service access party after receiving the acquisition request so as to detect the characteristic information of the service access party, after the detection is finished, the detection result is sent to the access platform, the access platform receives the detection result sent by the environment detection plug-in and analyzes the detection result so as to obtain the characteristic information of the service access party, after the characteristic information of the service access party is obtained, the function interface which can be actually provided by the service access party is determined according to the characteristic information of the service access party, then the interface docking program is packaged according to the function interface provided by the service access party and the standard function interface called by the service access party, the service access party can maintain the difference of the service access party without changing the actual access interface, and the difference of the service access party even when the service access party calls the difference and the service interface need to be changed in the service logic, the complexity of service access in different application environments is reduced, and the service maintenance cost is reduced.
Optionally, in step S105, the feature information includes a product type of the service access party, and the step of determining the functional interface provided by the service access party according to the feature information of the service access party includes: and searching a functional interface corresponding to the product type of the service access party in a preset corresponding relation list of the product type and the functional interface.
Specifically, the service party may maintain a first correspondence table between product types and function interfaces on the access platform, where the product types may include PC web, android App, IOS App, multiple applets, fast applications, and the like. For example, for an interface with the same function, different product types correspond to different function interfaces, specifically, for an interface with a recording function, a PC web, an Android App, an IOS App, a variety of applets, and a fast application correspond to different function interfaces respectively. In this step, a functional interface corresponding to the product type of the service access party may be found in the first mapping relationship table.
By adopting the interface calling method provided by the embodiment, when a business party accesses business access parties with different product types, interface calling difference caused by product type difference does not need to be concerned, when a new product type business access party is added, only the corresponding relation table needs to be modified, and business codes of the business party do not need to be correspondingly modified.
Optionally, in step S105, the feature information includes identification information of the service access party, and the step of determining the functional interface provided by the service access party according to the feature information of the service access party includes: acquiring an interface list of a service access party according to the identification information of the service access party; and acquiring the functional interface provided by the service access party in the interface list.
Specifically, the service party may maintain, on the access platform, an interface list of each service access party and a second correspondence table in which identification information corresponds to the interface list, where the identification information may be a unique identification and information specifying a specific service access party, and the interface list is a list of all interfaces that a certain service access party can provide. In this step, an interface list corresponding to the identification information of the service access party may be found in the second mapping table, and then the functional interface provided by the service access party is obtained in the interface list.
By adopting the interface calling method provided by the embodiment, when a service party accesses different service access parties, interface calling difference caused by different service access parties does not need to be concerned, when a new service access party is added, only the corresponding relation table needs to be modified, and meanwhile, the interface list of the new service access party is added, and service codes of the service party do not need to be correspondingly changed.
Optionally, in step S105, the feature information includes identification information of the service access party, and the step of determining the functional interface provided by the service access party according to the feature information of the service access party includes: capturing a description document of the service access party according to the identification information of the service access party; performing text analysis on the description document, and extracting interface description contents including interface meanings, reference-out meanings and reference-in meanings; the functional interface provided by the service access party is determined in the interface description.
Specifically, the access platform sets a document capturing crawler, when determining the functional interface provided by the service access party, the access platform can capture a description document of the service access party according to the identification information of the service access party, then perform intelligent text analysis on the description document, extract interface description contents related to the interface, wherein the interface description contents comprise interface meanings, out-going and in-going meanings and the like, and then determine the functional interface provided by the service access party in the interface description contents. Further, when the acquisition request includes the interface function parameter, according to the interface function parameter, determining a function interface conforming to the interface function parameter in the interface description content.
By adopting the interface calling method provided by the embodiment, when the business party accesses different business access parties, interface calling differences caused by different business access parties do not need to be concerned, when a new business access party is added, only the description document of the new business access party needs to be captured, and the business code of the business party does not need to be correspondingly changed.
Optionally, in an embodiment, in step S105, the feature information includes identification information of the service access party, and the step of determining the functional interface provided by the service access party according to the feature information of the service access party includes: acquiring an interface list of a service access party according to the identification information of the service access party; when the interface list is obtained, obtaining a functional interface provided by a service access party in the interface list, and when the interface list cannot be obtained, capturing a description document of the service access party according to the identification information of the service access party; performing text analysis on the description document, and extracting interface description contents including interface meanings, reference-out meanings and reference-in meanings; the functional interface provided by the service access party is determined in the interface description.
Further optionally, on the basis of any one of the foregoing embodiments, the feature information further includes version information of a service access party, and after the step of encapsulating the interface docking program to form the standard interface converter, the interface calling method further includes: and caching the standard interface converter and the corresponding relation between the standard interface converter and the characteristic information.
Specifically, when the feature information further includes version information of the service access party, after a standard interface converter is formed, the standard interface converter is cached, and meanwhile, the corresponding relation between the standard interface converter and the current feature information is cached, so that when the access platform receives the same feature information in the subsequent process, the standard interface converter in the cache can be directly issued to the service access party, and the generation process of the intermediate standard interface converter is not required to be executed.
By adopting the interface calling method provided by the embodiment, the standard interface converter can be obtained through the cache aiming at the service access party with the same version information, namely the completely same service application environment, so that the response speed of the access platform is improved.
Optionally, in an embodiment, when the obtaining request includes an interface function parameter, the step of determining the functional interface provided by the service access party according to the feature information of the service access party further includes: when determining that the functional interface of the service access party does not accord with the interface functional parameter, namely the service access party can not provide the functional interface which accords with the interface functional parameter, searching a compatible strategy corresponding to the interface functional parameter; an alternate functional interface is determined based on the compatibility policy.
Specifically, during the actual development and operation process of the service access party, part of the functional interfaces may be unable to be provided, based on which, a compatibility policy for the part of the functional interfaces is maintained on the access platform, that is, when it is determined that the service access party is unable to provide a functional interface that meets the interface functional parameters, a compatibility policy corresponding to the interface functional parameters is searched, and a substitute functional interface is found through the compatibility policy to perform compatibility processing, so as to ensure the availability of the function.
Optionally, if a substitute functional interface cannot be found, the access platform may capture a description document of the service access party in real time, as described above, determine the functional interface provided by the service access party based on the description document, and if any functional interface cannot be determined yet, prompt that the function of the service party is unavailable, and automatically send an alert to the service party, thereby optimizing the service flow.
Optionally, in an embodiment, after the step of receiving the detection result sent by the environment detection plug-in, and before the step of determining the functional interface provided by the service access party according to the feature information of the service access party, the interface calling method further includes: when the detection result is analyzed to obtain the information of detection failure, a characteristic request is sent to a service party; and receiving the characteristic information of the service access party sent by the service party.
Example two
Corresponding to the first embodiment, the second embodiment of the present invention provides an interface invoking device, and reference may be made to the first embodiment for corresponding technical features and corresponding technical effects, which are not described herein again. Fig. 2 is a block diagram of an interface invoking device according to a second embodiment of the present invention, as shown in fig. 2, the interface invoking device includes: a first receiving module 201, a first sending module 202, a second receiving module 203, a parsing module 204, a determining module 205, an encapsulating module 206, and a second sending module 207.
The first receiving module 201 is configured to receive an acquisition request of a standard interface converter sent by a service access party; the first sending module 202 is configured to send an environment detection plug-in to the service access party, where the environment detection plug-in is configured to detect feature information of the service access party; the second receiving module 203 is configured to receive a detection result sent by the environment detection plug-in; the analysis module 204 is configured to analyze the detection result to obtain feature information of the service access party; the determining module 205 is configured to determine a functional interface provided by the service access party according to the feature information of the service access party; the encapsulating module 206 is configured to encapsulate an interface docking program to form the standard interface converter, where the standard interface converter is configured to convert a functional interface provided by the service access party into a standard functional interface; and the second sending module 207 is configured to send the standard interface converter to the service access party, so that the service party invokes the functional interface provided by the service access party by invoking the standard functional interface.
Further, the feature information includes a product type of the service access party, and when the determining module 205 determines the functional interface provided by the service access party according to the feature information of the service access party, the specifically executed steps include: and searching a functional interface corresponding to the product type of the service access party in a preset corresponding relation list of the product type and the functional interface.
Further, the feature information includes identification information of the service access party, and when the determining module 205 determines the functional interface provided by the service access party according to the feature information of the service access party, the specifically executed steps include: acquiring an interface list of the service access party according to the identification information of the service access party; and acquiring the functional interface provided by the service access party in the interface list.
Further, the feature information includes identification information of the service access party, and when the determining module 205 determines the functional interface provided by the service access party according to the feature information of the service access party, the specifically executed steps include: capturing a description document of the service access party according to the identification information of the service access party; performing text analysis on the description document, and extracting interface description contents including interface meanings, reference-out meanings and reference-in meanings; and determining the functional interface provided by the service access party in the interface description content.
Further, the feature information further includes version information of the service access party, and the interface calling apparatus further includes a cache module, configured to cache the standard interface converter and a corresponding relationship between the standard interface converter and the feature information after an interface docking program is encapsulated by an encapsulation module 206 to form the standard interface converter.
Further, the obtaining request of the standard interface converter includes interface function parameters, and when the determining module 205 determines the functional interface provided by the service access party according to the feature information of the service access party, the specifically executed steps include: and determining the functional interface which is provided by the service access party and accords with the interface functional parameters according to the characteristic information of the service access party.
Further, when the determining module 205 determines the functional interface provided by the service access party according to the feature information of the service access party, the specifically executed steps further include: when determining that a functional interface of a service access party does not accord with interface functional parameters, searching for compatible strategies corresponding to the interface functional parameters; and determining an alternative functional interface according to the compatible strategy.
Further, when the environment detection plug-in detects the feature information of the service access party, the feature information of the service access party is determined according to the feature value of the service access party, or the feature information of the service access party is determined according to whether the service access party has a preset function.
Further, the interface calling method further includes a processing module, where the processing module is configured to, after the second receiving module 203 receives the detection result sent by the environment detection plug-in, before the determining module 205 determines the functional interface provided by the service access party according to the feature information of the service access party, when the detection result is analyzed to obtain information of detection failure, send a feature request to the service party; and receiving the characteristic information of the service access party sent by the service party.
Further, the service access party is configured to respond to a page open operation and obtain page response data, where the page response data includes an instruction for triggering sending of the obtaining request.
EXAMPLE III
A third embodiment further provides a computer device, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server or a rack server (including an independent server or a server cluster formed by multiple servers) capable of executing programs, and the like. As shown in fig. 3, the computer device 01 of the present embodiment at least includes but is not limited to: a memory 011 and a processor 012, which are communicatively connected to each other via a system bus, as shown in fig. 3. It is noted that fig. 3 only shows the computer device 01 having a component memory 011 and a processor 012, but it is to be understood that not all shown components are required and that more or less components can instead be implemented.
In this embodiment, the memory 011 (i.e., a readable storage medium) includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the storage 011 can be an internal storage unit of the computer device 01, such as a hard disk or a memory of the computer device 01. In other embodiments, the memory 011 can also be an external storage device of the computer device 01, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), etc. provided on the computer device 01. Of course, the memory 011 can also include both internal and external memory units of the computer device 01. In this embodiment, the memory 011 is generally used for storing an operating system and various application software installed in the computer device 01, such as the interface calling device of the second embodiment. Further, the memory 011 can also be used to temporarily store various kinds of data that have been output or are to be output.
The processor 012 may be a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor, or other data Processing chip in some embodiments. The processor 012 is generally used to control the overall operation of the computer device 01. In this embodiment, the processor 012 is configured to run a program code stored in the memory 011 or process data, for example, an interface calling method, an apparatus, a computer device, and a storage medium.
Example four
The fourth embodiment further provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application store, etc., on which a computer program is stored, which when executed by a processor implements corresponding functions. The computer-readable storage medium of this embodiment is used to store an interface calling apparatus, and when executed by a processor, implements the interface calling method of the first embodiment.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a component of' 8230; \8230;" does not exclude the presence of another like element in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. An interface calling method, comprising:
receiving an acquisition request of a standard interface converter sent by a service access party, wherein the acquisition request comprises interface function parameters;
sending an environment detection plug-in to the service access party, wherein the environment detection plug-in is used for detecting the characteristic information of the service access party, and the characteristic information comprises the product type and/or identification information and version information of the service access party;
receiving a detection result sent by the environment detection plug-in;
analyzing the detection result to obtain the characteristic information of the service access party;
determining a functional interface provided by the service access party according to the characteristic information of the service access party;
encapsulating an interface docking program to form the standard interface converter, wherein the standard interface converter is used for converting a functional interface provided by the service access party into a standard functional interface; and
sending the standard interface converter to the service access party so that the service party calls the functional interface provided by the service access party by calling the standard functional interface;
further, encapsulating the interface docking program to form the standard interface converter comprises: determining a standard function interface corresponding to the interface function parameter called by a service party; and encapsulating an interface docking program according to the interface difference between the functional interface and the standard functional interface to form a standard interface converter.
2. The interface calling method according to claim 1, wherein the step of determining the functional interface provided by the service access party according to the feature information of the service access party comprises:
and searching a functional interface corresponding to the product type of the service access party in a preset corresponding relation list of the product type and the functional interface.
3. The interface calling method according to claim 1, wherein the step of determining the functional interface provided by the service access party according to the feature information of the service access party comprises:
acquiring an interface list of the service access party according to the identification information of the service access party;
and acquiring the functional interface provided by the service access party in the interface list.
4. The interface calling method according to claim 1, wherein the feature information includes identification information of the service access party, and the step of determining the functional interface provided by the service access party according to the feature information of the service access party includes:
capturing a description document of the service access party according to the identification information of the service access party;
performing text analysis on the description document, and extracting interface description contents including interface meanings, reference-out meanings and reference-in meanings;
and determining the functional interface provided by the service access party in the interface description content.
5. The interface call method according to any one of claims 2 to 4, wherein after the step of encapsulating an interface docking program to form the standard interface translator, the interface call method further comprises:
and caching the standard interface converter and the corresponding relation between the standard interface converter and the characteristic information.
6. The interface calling method according to claim 1, wherein the step of determining the functional interface provided by the service access party according to the feature information of the service access party comprises:
and determining the functional interface which is provided by the service access party and accords with the interface functional parameters according to the characteristic information of the service access party.
7. The interface calling method according to claim 6, wherein the step of determining the functional interface provided by the service access party according to the feature information of the service access party further comprises:
when determining that the functional interface of the service access party does not conform to the interface functional parameters, searching for compatible strategies corresponding to the interface functional parameters;
an alternate functional interface is determined based on the compatibility policy.
8. An interface invocation apparatus, comprising:
the first receiving module is used for receiving an acquisition request of a standard interface converter sent by a service access party, wherein the acquisition request comprises interface function parameters;
the system comprises a first sending module, a second sending module and a service access party, wherein the first sending module is used for sending an environment detection plug-in to the service access party, the environment detection plug-in is used for detecting the characteristic information of the service access party, and the characteristic information comprises the product type and/or the identification information and the version information of the service access party;
the second receiving module is used for receiving the detection result sent by the environment detection plug-in;
the analysis module is used for analyzing the detection result to obtain the characteristic information of the service access party;
the determining module is used for determining a functional interface provided by the service access party according to the characteristic information of the service access party;
the encapsulation module is used for encapsulating an interface docking program to form the standard interface converter, wherein the standard interface converter is used for converting a functional interface provided by the service access party into a standard functional interface; and
the second sending module is used for sending the standard interface converter to the service access party so that the service party calls the functional interface provided by the service access party by calling the standard functional interface;
further, the encapsulation module is further configured to: determining a standard function interface corresponding to the interface function parameter called by a service party; and encapsulating an interface docking program according to the interface difference between the functional interface and the standard functional interface to form a standard interface converter.
9. A computer arrangement comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that: the computer program when executed by a processor implements the steps of the method of any one of claims 1 to 7.
CN202010901803.XA 2020-09-01 2020-09-01 Interface calling method and device, computer equipment and storage medium Active CN112015496B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010901803.XA CN112015496B (en) 2020-09-01 2020-09-01 Interface calling method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010901803.XA CN112015496B (en) 2020-09-01 2020-09-01 Interface calling method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112015496A CN112015496A (en) 2020-12-01
CN112015496B true CN112015496B (en) 2022-11-15

Family

ID=73516219

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010901803.XA Active CN112015496B (en) 2020-09-01 2020-09-01 Interface calling method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112015496B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113608801A (en) * 2021-07-19 2021-11-05 上海浦东发展银行股份有限公司 Interface calling method and device, computer equipment and storage medium
CN113849562A (en) * 2021-09-16 2021-12-28 支付宝(杭州)信息技术有限公司 Method and device for accessing external service system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107463409A (en) * 2017-08-11 2017-12-12 深圳乐信软件技术有限公司 A kind of interface conversion method, interface convertor, storage medium and electric terminal
CN109783249A (en) * 2018-12-13 2019-05-21 中国平安财产保险股份有限公司 Platform cut-in method and device, terminal and computer readable storage medium
CN111143087A (en) * 2019-12-18 2020-05-12 中国平安财产保险股份有限公司 Interface calling method and device, storage medium and server
CN111274045A (en) * 2020-01-14 2020-06-12 平安银行股份有限公司 Multi-platform docking method and device, computer equipment and readable storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050172282A1 (en) * 2004-01-30 2005-08-04 Michael Shenfield System and method for publishing and accessing application APIs on a generic terminal
JP3822223B2 (en) * 2004-07-29 2006-09-13 シャープ株式会社 TEST SYSTEM, CLIENT DEVICE AND RELAY DEVICE INCLUDED IN THE SYSTEM, COMMUNICATION DEVICE TESTING METHOD, AND PROGRAM FOR MAKING COMPUTER FUNCTION AS CLIENT DEVICE OR RELAY DEVICE
CN108282519A (en) * 2017-12-29 2018-07-13 深圳中兴网信科技有限公司 Interface realizing method, Interface for System based on middleware

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107463409A (en) * 2017-08-11 2017-12-12 深圳乐信软件技术有限公司 A kind of interface conversion method, interface convertor, storage medium and electric terminal
CN109783249A (en) * 2018-12-13 2019-05-21 中国平安财产保险股份有限公司 Platform cut-in method and device, terminal and computer readable storage medium
CN111143087A (en) * 2019-12-18 2020-05-12 中国平安财产保险股份有限公司 Interface calling method and device, storage medium and server
CN111274045A (en) * 2020-01-14 2020-06-12 平安银行股份有限公司 Multi-platform docking method and device, computer equipment and readable storage medium

Also Published As

Publication number Publication date
CN112015496A (en) 2020-12-01

Similar Documents

Publication Publication Date Title
CN112015496B (en) Interface calling method and device, computer equipment and storage medium
CN110601880A (en) Cloud platform, service processing method, command interface and computer equipment
CN111191243B (en) Vulnerability detection method, vulnerability detection device and storage medium
CN108363588B (en) Method for realizing interaction between web and native function, electronic device and readable storage medium
CN113672224A (en) Method and device for generating small program page code and computer equipment
CN112153152A (en) Management method and system of algorithm service interface
CN111935104A (en) Internet of things equipment illegal access detection method and device and computer equipment
CN111694640A (en) Data processing method and device, electronic equipment and storage medium
CN108170537B (en) Game API realization method, device, interface server and readable storage medium
CN108509228B (en) Page loading method, terminal equipment and computer readable storage medium
CN105074670A (en) Log output control device, method, and program
CN111722994A (en) Task request response method and device
CN110881030A (en) Logstack-based method and device for recording operation logs of web service administrator
CN116226259A (en) Method for taking object model as unified standard output interface, electronic equipment and medium
CN114116520B (en) Algorithm evaluation method, device, gateway and storage medium
CN116302808A (en) Method, device, equipment and storage medium for capturing and processing abnormal information
US7644316B2 (en) System, method and program for managing browser scripts sent from server to client
CN114244826A (en) Webpage identification information sharing method and device, storage medium and processor
CN112287643B (en) Message monitoring method, device, equipment and computer readable storage medium
CN111475763B (en) Webpage running method and device, storage medium and equipment
CN111563038A (en) SDK test method, device, computer equipment and computer readable storage medium
CN111459608A (en) Application system deployment method and device, computer equipment and storage medium
CN114936898B (en) Management system, method, equipment and storage medium based on spot supply
CN111079392A (en) Automatic filling method and device for webpage form, storage medium and electronic equipment
CN112835654B (en) Method, device and processor for calling functions in dynamic link library

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