Interface calling method and device

By using interface adapters to convert data in the software system, the problem of inter-module call failure caused by interface version incompatibility is solved, the system stability and compatibility is achieved, the deployment complexity is reduced, and it is suitable for a wide range of interface call scenarios.

CN119065706APending Publication Date: 2024-12-03MOORE THREADS TECHNOLOGY (CHENGDU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411148786.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

In modern large software systems, due to changes in business logic requirements and incompatibility of preset interface versions, the function call between modules fails, affecting the security and stability of the system. The existing technology requires additional transit servers and complex maintenance, which limits the Compatibility and usage scenarios.

Method used

A version adaptive interface call method is proposed. When the version information of the target interface is incompatible with the version information supported by the caller, the corresponding interface adapter is obtained to convert the data to ensure that the data complies with the two regulations and achieve the inability to version information. Compatible target interface calls.

Benefits of technology

It effectively solves the compatibility problem when interface calls, reduces the complexity of deployment and operation and maintenance, does not require a redirect server, and is suitable for any interface call forms and scenarios, improving development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119065706A_ABST
    Figure CN119065706A_ABST
Patent Text Reader

Abstract

The invention relates to an interface calling method and device, and the interface calling method applied to a calling party comprises the steps: obtaining the version information of a target interface of a called party; under the condition that the version information of the target interface is incompatible with the version information supported by the calling party, obtaining an interface adapter corresponding to the version information supported by the calling party; the interface adapter is used for converting data, so that the data before and after conversion respectively conform to the version information corresponding regulation of the target interface and the version information corresponding regulation supported by the calling party; and calling the target interface through the interface adapter. According to the method and the device, the interface adapter serves as a means for enhancing interface compatibility and can play a bridge role when the version information of the target interface is incompatible with the version information supported by the calling party, so that the calling party is helped to complete calling of the target interface incompatible with the version information; therefore, the compatibility problem during calling of various forms of interfaces is effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to an interface calling method and device. Background Art

[0002] Modern large-scale software systems are usually developed and run in a modular way. In the operating environment, modules perform logical coordination and data exchange by calling preset interfaces to complete the specified tasks. Due to changes in business logic requirements, preset interfaces usually need to be upgraded and modified, which often leads to the failure of inter-module function calls due to incompatible versions of the preset interface, affecting the security and stability of the entire system. Therefore, solving the compatibility problem when there are multiple versions of the called interface during software runtime is of great significance to the smooth and safe operation of the system. Summary of the invention

[0003] In view of this, the present disclosure proposes an interface calling method, device, electronic device, storage medium and computer program product.

[0004] According to one aspect of the present disclosure, there is provided an interface calling method, which is applied to a caller, and the method includes:

[0005] Get the version information of the target interface of the callee;

[0006] In the case where the version information of the target interface is incompatible with the version information supported by the caller, obtaining an interface adapter corresponding to the version information supported by the caller; the interface adapter is used to convert the data so that the data before and after the conversion conforms to the corresponding provisions of the version information of the target interface and the corresponding provisions of the version information supported by the caller respectively;

[0007] The target interface is called through the interface adapter.

[0008] In a possible implementation, the version information of the target interface includes: a current version number of the target interface and a minimum version number compatible with the target interface, and a version number between the current version number and the minimum version number;

[0009] and / or,

[0010] The version information supported by the caller includes: the version number of the target accessor of the caller; the target accessor is an accessor configured by the caller for calling an interface.

[0011] In a possible implementation manner, calling the target interface through the interface adapter includes:

[0012] Sending the target interface parameters to the called party through the interface adapter, so that the called party determines the target interface data based on the target interface parameters;

[0013] The target interface data is acquired through the interface adapter.

[0014] In a possible implementation manner, the target interface parameter includes a second interface parameter, and the target interface data includes a first interface data;

[0015] The sending of the target interface parameters to the called party through the interface adapter includes: converting the first interface parameters into second interface parameters through the interface adapter, and sending the second interface parameters to the called party; wherein the first interface parameters comply with the corresponding provisions of the version information supported by the calling party, and the second interface parameters comply with the corresponding provisions of the version information of the target interface;

[0016] The obtaining of the target interface data through the interface adapter includes: converting the first interface data into the second interface data through the interface adapter, and obtaining the second interface data; wherein the first interface data is determined by the called party based on the second interface parameters, the first interface data complies with the corresponding provisions of the version information of the target interface, and the second interface data complies with the corresponding provisions of the version information supported by the caller.

[0017] According to another aspect of the present disclosure, there is provided an interface calling method, which is applied to a called party, and the method comprises:

[0018] In the case where the version information of the target interface is incompatible with the version information supported by the caller, the target interface parameters are obtained from the interface adapter; the interface adapter corresponds to the version information supported by the caller and is used to convert the data so that the data before and after the conversion conforms to the corresponding provisions of the version information of the target interface and the corresponding provisions of the version information supported by the caller respectively;

[0019] Determining target interface data according to the target interface parameters;

[0020] The target interface data is returned to the interface adapter.

[0021] In a possible implementation manner, the target interface parameter includes a second interface parameter, and the target interface data includes a first interface data;

[0022] The acquiring the target interface parameter from the interface adapter includes: acquiring the second interface parameter from the interface adapter, the second interface parameter being obtained by converting the first interface parameter by the interface adapter, wherein the first interface parameter complies with the corresponding provisions of the version information supported by the caller, and the second interface parameter complies with the corresponding provisions of the version information of the target interface;

[0023] The determining the target interface data according to the target interface parameter comprises: determining the first interface data according to the second interface parameter;

[0024] Returning the target interface data to the interface adapter includes: returning the first interface data to the interface adapter so that the interface adapter converts the first interface data into second interface data; wherein the first interface data complies with the corresponding regulations of the version information of the target interface, and the second interface data complies with the corresponding regulations of the version information supported by the caller.

[0025] According to another aspect of the present disclosure, there is provided an interface calling method, which is applied to an interface manager, and the method includes:

[0026] Send the version information of the target interface of the callee to the caller;

[0027] In the case where the version information of the target interface is incompatible with the version information supported by the caller, determining an interface adapter corresponding to the version information supported by the caller; the interface adapter is used to convert the data so that the data before and after the conversion conforms to the corresponding provisions of the version information of the target interface and the corresponding provisions of the version information supported by the caller respectively;

[0028] The interface adapter is sent to the caller.

[0029] According to another aspect of the present disclosure, an interface calling device is provided, which is applied to a caller, and the device includes:

[0030] The acquisition module is used to obtain the version information of the target interface of the called party;

[0031] The acquisition module is further used to acquire an interface adapter corresponding to the version information supported by the caller when the version information of the target interface is incompatible with the version information supported by the caller; the interface adapter is used to convert the data so that the data before and after the conversion conforms to the corresponding provisions of the version information of the target interface and the corresponding provisions of the version information supported by the caller respectively;

[0032] A calling module is used to call the target interface through the interface adapter.

[0033] According to another aspect of the present disclosure, there is provided an interface calling device, which is applied to a called party, and the device includes:

[0034] an acquisition module, used for acquiring target interface parameters from an interface adapter when the version information of the target interface is incompatible with the version information supported by the caller; the interface adapter corresponds to the version information supported by the caller, and is used for converting data so that the data before and after the conversion respectively conform to the corresponding provisions of the version information of the target interface and the corresponding provisions of the version information supported by the caller;

[0035] A determination module, used to determine target interface data according to the target interface parameters;

[0036] The returning module is used to return the target interface data to the interface adapter.

[0037] According to another aspect of the present disclosure, there is provided an interface calling device, which is applied to an interface manager, and the device includes:

[0038] The sending module is used to send the version information of the target interface of the called party to the caller;

[0039] A determination module, used for determining an interface adapter corresponding to the version information supported by the caller when the version information of the target interface is incompatible with the version information supported by the caller; the interface adapter is used for converting data so that the data before and after the conversion conforms to the corresponding provisions of the version information of the target interface and the corresponding provisions of the version information supported by the caller respectively;

[0040] The sending module is also used to send the interface adapter to the caller.

[0041] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.

[0042] According to another aspect of the present disclosure, a non-volatile computer-readable storage medium is provided, on which computer program instructions are stored, wherein the computer program instructions implement the above method when executed by a processor.

[0043] According to another aspect of the present disclosure, a computer program product is provided, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0044] Through various aspects of the present disclosure, when the version information of the target interface is incompatible with the version information supported by the caller, the caller obtains an interface adapter corresponding to the version information supported by the caller; and calls the target interface through the interface adapter. Among them, the interface adapter is used to convert data so that the data before and after the conversion conforms to the corresponding regulations of the version information of the target interface and the regulations corresponding to the version information supported by the caller respectively; as a means of enhancing interface compatibility, the interface adapter can play a bridging role when the version information of the target interface is incompatible with the version information supported by the caller, so as to help the caller complete the call of the target interface with incompatible version information, thereby effectively solving compatibility problems in various forms of interface calls. As an example, the [current version, minimum version] interval is used to represent the version information of the target interface. In addition, the interface calling method is applicable to any interface calling form and usage scenario, and has a wider application; and there is no need to deploy a transit server, which reduces the complexity of deployment and operation and maintenance; the interface adapter can be developed and released together with the interface upgrade, and the compatibility upgrade is completed when the interface upgrade is completed, which facilitates the formulation of compatibility strategies; in this way, the developer of the called party only needs to pay attention to the compatibility issues of multiple versions of the interface, and the developer of the calling party only needs to pay attention to the development of the calling method of the current interface version, thereby improving the work efficiency of relevant personnel.

[0045] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.

[0047] Figure 1 A schematic diagram showing the structure of an interface calling system according to an embodiment of the present disclosure is shown;

[0048] Figure 2 A flowchart of an interface calling method according to an embodiment of the present disclosure is shown;

[0049] Figure 3 A flowchart of an interface calling method according to an embodiment of the present disclosure is shown;

[0050] Figure 4 A schematic diagram showing that the accessor version of the caller is incompatible with the interface version of the callee according to an embodiment of the present disclosure;

[0051] Figure 5 A schematic diagram showing calling an interface through an interface adapter according to an embodiment of the present disclosure is shown;

[0052] Figure 6A flowchart showing a caller calling a target interface through an interface adapter according to an embodiment of the present disclosure is shown;

[0053] Figure 7 A flowchart of an interface calling method according to an embodiment of the present disclosure is shown;

[0054] Figure 8 A structural diagram of an interface calling device according to an embodiment of the present disclosure is shown;

[0055] Fig. 9 A structural diagram showing another interface calling device according to an embodiment of the present disclosure;

[0056] Fig.10 A structural diagram showing another interface calling device according to an embodiment of the present disclosure;

[0057] Fig.11 A block diagram of an electronic device 1900 according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0058] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0059] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "exemplary", "in one embodiment", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0060] In the present application, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: including the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0061] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.

[0062] Modern large-scale software systems are usually developed and run in a modular way. In the operating environment, modules perform logical coordination and data exchange by calling preset interfaces to complete the specified tasks. Due to changes in business logic requirements, preset interfaces usually need to be upgraded and modified, which often leads to the failure of inter-module function calls due to incompatible versions of the preset interface, affecting the security and stability of the entire system. The factors that affect interface compatibility mainly include: interface name and position, number of parameters, parameter type, parameter passing order, structure of parameters and return values, etc.

[0063] Usually, the interface is assigned a version number to reflect the change of the interface, so as to find potential compatibility problems. When both the caller and the callee support the same or compatible version number, the interface call is safe and allowed, otherwise it is unsafe and prohibited. In order to solve the compatibility problem when there are multiple versions of the called interface during software operation, in one method, several servers that support calling different versions of interfaces are deployed in the system in advance, and a mapping relationship table between the interface version number and the server IP address is established. Before the interface is called, the interface information is queried first to obtain the interface version number it supports, and then the IP address of the server that supports the corresponding version is found according to the mapping relationship table. If there is no relevant record, it will prompt failure. Although this method solves the compatibility problem when calling multiple versions of interfaces to a certain extent, it has the following shortcomings: it requires additional calls to the transit server and maintains the mapping relationship between these servers and the interface version numbers, which increases the complexity of deployment and operation and maintenance; the server is a logical entity independent of the caller and the callee, and is the core dependency for completing the interface call, thus forming a key failure node of the system (that is, a server error will cause the entire function to fail), increasing the risk of system stability; it is only applicable to interfaces that return simple status results, and cannot support interfaces that return more complex data structures and have different return data structures for different versions, so the usage scenarios are limited; the interface between the caller and the transit server may also have compatibility issues.

[0064] In order to solve the above technical problems, the embodiment of the present disclosure provides a version-adaptive interface invocation method (Version-Adaptive Interface Invocation). When the version information of the target interface is incompatible with the version information supported by the caller, the caller obtains the interface adapter corresponding to the version information supported by the caller; and calls the target interface through the interface adapter. As a means of enhancing interface compatibility, the interface adapter can play a bridging role when the version information of the target interface is incompatible with the version information supported by the caller, so as to help the caller complete the call of the target interface with incompatible version information, thereby effectively solving the compatibility problem when calling various forms of interfaces. In addition, the interface calling method is applicable to any interface calling form and usage scenario, and is more widely used; and there is no need to deploy a transit server, which reduces the complexity of deployment and operation and maintenance; the interface adapter can be developed and released together with the interface upgrade, and the interface upgrade is completed when the compatibility upgrade is completed, which is convenient for formulating compatibility strategies; in this way, the developer of the called party only needs to pay attention to the compatibility problem of multiple versions of the interface, and the developer of the calling party only needs to pay attention to the development of the calling method of the current interface version, thereby improving the work efficiency of relevant personnel.

[0065] Figure 1 FIG. 2 is a schematic diagram showing a structure of an interface calling system according to an embodiment of the present disclosure. Figure 1As shown, the calling system 10 may include: a caller 101, a callee 102, and an interface manager 103; the number of the caller 101, the callee 102, and the interface manager 103 may be one or more, and there is no limitation on this.

[0066] The caller 101 represents a party that needs to call an interface. For example, the caller 101 can be a hardware entity or a software functional module, which is not limited to this. For example, the caller 101 can be a module, software, device, etc. that needs to call an external interface to complete a certain function. The interface represents a function, method, API (Application Programming Interface) or protocol unit that is called through a specific path to complete a certain function. As an example, the caller 101 can be configured with an accessor, which can be a code module, component or program segment that calls a specific interface. The caller 101 can call the specific interface through the accessor.

[0067] The callee 102 represents a party that provides an interface for the caller to use. Exemplarily, the callee 102 can be a hardware entity or a software functional module, which is not limited to this; for example, the callee 102 can be a module, software, device, etc.

[0068] The interface manager 103 represents a module, component or program segment responsible for managing and maintaining information such as version information of the interface of the callee 102. The interface version information may include an attribute identifier assigned to the interface in order to distinguish different modification batches of the same interface, such as a version number. As an example, the interface manager 103 may be integrated in the callee 102.

[0069] It should be noted that the caller 101, the callee 102, and the interface manager 103 can be configured in different physical entities respectively. In this scenario, the caller 101, the callee 102, and the interface manager 103 can establish a communication connection through the network, and the caller 101 can call the interface of the callee 102 in the form of a network interface call; the caller 101, the callee 102, and the interface manager 103 can also be partially or completely configured in the same physical entity. In this scenario, the caller 101 can call the interface of the callee 102 in the form of an address call. Exemplarily, the physical entity can be a computer device or node such as a terminal or a server, wherein the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, and basic cloud computing services such as big data and artificial intelligence platforms, etc. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, smart voice interaction device, smart home appliance and car terminal, etc.

[0070] It should be noted that the interface calling system described in the embodiment of the present disclosure is for the purpose of more clearly illustrating the technical solution of the embodiment of the present disclosure, and does not constitute a limitation on the application scenarios of the technical solution provided by the embodiment of the present disclosure. A person of ordinary skill in the art can know that the technical solution provided by the embodiment of the present disclosure is also applicable to similar technical problems in response to the emergence of other similar or new scenarios.

[0071] Figure 2 A flowchart of an interface calling method according to an embodiment of the present disclosure is shown. For example, the above Figure 1 One or more of the caller 101, the callee 102, and the interface manager 103 in the interface calling system are executed, such as Figure 2 As shown, the following steps may be included:

[0072] Step 201: The interface manager sends the version information of the target interface of the called party to the caller;

[0073] Exemplarily, the interface manager can send version information of the target interface of the called party to the caller in response to the caller's request; for example, when the caller expects to call interface A of the called party, it can send a request to the interface manager to obtain the version information of interface A. After receiving the request, the interface manager selects the version information of interface A from the managed version information and sends it to the caller; for example, the interface manager can send the version information of interface A to the caller via the network or other means.

[0074] It is understandable that in some scenarios, the called party can configure multiple interfaces. At a certain moment, the caller may expect to call a certain interface of the called party or call multiple interfaces at the same time. The target interface is any interface that the caller expects to call; for example, at a certain moment, the caller may expect to call a certain interface A of the called party, and the target interface is interface A; for another example, at a certain moment, the caller expects to call interface A and interface B at the same time, and the target interface is interface A or interface B.

[0075] It is understandable that in software development and system design, the interface is the bridge for communication between components, modules, programs or systems; over time, the interface may undergo multiple versions of iteration and update, for example, they can be distinguished by different version numbers, the larger the version number, the newer the version; this requires considering interface version compatibility when designing the interface, which indicates the ability of different versions of the interface to cooperate and interact with different versions of accessors, and compatibility includes backward compatibility or forward compatibility; backward compatibility means that when a new version of an interface is released, it can support calls to old versions of accessors without any modification of these accessors, that is, old versions of accessors can continue to access the new version of the interface normally; forward compatibility means that the old version of the interface can handle data in new formats or new features sent by the new version of the accessor. This compatibility method is usually more difficult to implement and less common, because it is necessary to design a sufficiently flexible interface without knowing what changes will occur in the future.

[0076] In a possible implementation, the version information of the target interface may include: the current version number of the target interface and the lowest version number compatible with the target interface, and the version number between the current version number and the lowest version number. For example, the current version number of the target interface may be 2.5, and at least one version number compatible with the target interface may be 2.4, 2.3, or 2.0; for another example, the current version number of the target interface may be 3.0, and at least one version number compatible with the target interface may be 2.9 or 3.1.

[0077] As an example, the version information of the target interface may include: the current version number of the target interface, the lowest version number compatible with the target interface, and the version number between the current version number of the target interface and the lowest version number compatible with the target interface. For example, the current version number of the target interface may be 2.5, the lowest version number compatible with the target interface is 2.0, and the version numbers between the current version number of the target interface and the lowest version number compatible with the target interface are 2.1, 2.2, 2.3, and 2.4.

[0078] Exemplarily, the interval [current version, minimum version] can be used to represent the version information of the target interface; wherein "current version" represents the current version number of the called target interface, and "minimum version" represents the minimum version number that the target interface can be compatible with. For example, the version information of the target interface [2.5, 2.0] represents that the version information of the target interface includes version numbers 2.0, 2.1, 2.2, 2.3, 2.4, and 2.5.

[0079] Step 202: The caller obtains the version information of the target interface of the callee.

[0080] In this step, the caller may receive the version information of the target interface of the callee sent by the interface manager.

[0081] Considering that the caller can complete the call to the callee interface through the accessor, in software development and system design, as the interface version is iterated and updated, the accessor will usually also undergo multiple versions of iteration and update. For example, different versions can be distinguished by different version numbers. The larger the version number, the newer the version. Usually, the version number of the accessor is the same as the version number of the interface to ensure that the data interaction between the caller and the callee can proceed smoothly, that is, the caller accessor and the callee interface with the same version number can normally interact with data. If the accessor version is not updated in time, it may affect the data interaction between the caller and the callee; in addition, considering the interface version compatibility, some accessors with smaller version numbers can continue to access the interface with a larger version number normally. As an example, the version information supported by the caller includes: the version number of the caller target accessor; for example, the version number of the target accessor can be 2.2. Among them, the target accessor is the accessor configured by the caller for calling the interface; it can be understood that the version number of the caller target accessor is the version number of the interface supported by the caller.

[0082] In a possible implementation, after obtaining the version information of the target interface of the called party, the caller can further determine whether the version information of the target interface is compatible with the version information supported by the caller. Exemplarily, the version number of the target accessor can be compared with the current version number of the target interface and at least one version number compatible with the target interface to determine whether the version information of the target interface is compatible with the version information supported by the caller; as an example, the version information of the target interface is incompatible with the version information supported by the caller, which may include: the version number of the target accessor is different from the current version number of the target interface and at least one version number compatible with the target interface; as another example, the version information of the target interface is compatible with the version information supported by the caller, which may include: the version number of the target accessor is the same as the current version number of the target interface, or is the same as any one of the at least one version number compatible with the target interface.

[0083] Exemplarily, the interval [current version, minimum version] is used to represent the version information of the target interface. When the version number of the target accessor of the caller is within the interval [current version, minimum version], the version information of the target interface is determined to be compatible with the version information supported by the caller, otherwise it is determined to be incompatible. For example, the version number of the target accessor can be 2.2, and the version information of the target interface is [2.5, 2.3]. At this time, 2.2 is not within the interval [2.5, 2.3], that is, the version number of the interface supported by the caller is not within the current version number of the target interface of the callee and the compatible version number range, then it can be determined that the version information of the target interface is incompatible with the version information supported by the caller.

[0084] Exemplarily, when the version information of the target interface is compatible with the version information supported by the caller, the caller can directly call the target interface, thereby improving the efficiency of the interface call; when the version information of the target interface is incompatible with the version information supported by the caller, continue to execute the following steps 203-206.

[0085] Step 203: When the version information of the target interface is incompatible with the version information supported by the caller, the interface manager determines an interface adapter corresponding to the version information supported by the caller.

[0086] Exemplarily, when the above-mentioned caller determines that the version information of the target interface is incompatible with the version information supported by the caller, the caller can send a request to the interface manager to obtain the interface adapter and the version information supported by the caller. The interface manager responds to the request and determines the interface adapter corresponding to the version information supported by the caller.

[0087] It is understandable that when the version of the interface is iterated and updated, there are corresponding regulations for each version, for example, the regulations of interface parameters and interface data (i.e., interface return value) may be included; wherein, interface parameters refer to the parameters passed to the function or method of the called party when the interface is called, and illustratively, the regulations of interface parameters may include the number of parameters, parameter types, parameter passing order, etc.; interface data refers to the return value after the function or method of the called party is executed, and illustratively, the regulations of interface data may include the type and structure of the return value, etc. For different versions, the corresponding regulations are different, and there is usually an achievable conversion logic between the corresponding regulations of different versions. Therefore, after the new version is released, the conversion logic between the corresponding regulations of the new version and the corresponding regulations of the old version can be used to realize the conversion of data, so that the data before and after the conversion conform to the corresponding regulations of the new version and the corresponding regulations of the old version respectively.

[0088] Among them, the interface adapter corresponding to the version information supported by the caller is used to convert the data so that the data before and after the conversion respectively conform to the corresponding provisions of the version information of the target interface and the provisions corresponding to the version information supported by the caller. Exemplarily, the data can be interactive data between the caller and the callee, such as interface parameters sent by the caller to the callee, interface data returned by the callee, etc.; the interface adapter corresponding to the version information supported by the caller can realize the conversion of the interactive data between the caller and the callee through the conversion logic between the provisions corresponding to the version information supported by the caller and the provisions corresponding to the version information of the target interface; as an example, for interface parameters, the interface adapter can convert interface parameters from conforming to the provisions corresponding to the version information supported by the caller to conforming to the provisions corresponding to the version information of the target interface; as another example, for interface data, the interface adapter can convert interface data from conforming to the provisions corresponding to the version information of the target interface to conforming to the provisions corresponding to the version information supported by the caller.

[0089] Exemplarily, the interface manager can pre-configure a corresponding interface adapter for each version of the target interface. In a possible implementation, the interface manager can periodically obtain the version information supported by the caller and the version information of the called interface; or, when the version information supported by the caller or the version information of the called interface changes, the interface manager can obtain the changed version information, thereby timely updating the interface version information and timely configuring the corresponding interface adapter.

[0090] As an example, an interface adapter can be represented by a triplet {interface identifier, version number of the caller accessor, version number of the callee interface}, where the interface identifier represents the callee interface, and different interfaces have different interface identifiers. In this way, an interface adapter can be uniquely represented by this triplet; thus, for a certain interface, when the version number of the caller accessor and the version number of the callee interface are known, the interface adapter corresponding to the version number of the caller accessor can be quickly determined by this triplet. For example, if the interface identifier of interface A is A, the version number of the caller accessor is 2.0, and the version number of the callee interface is 2.1, the interface adapter corresponding to the caller accessor version number of 2.0 can be uniquely represented by the triplet {A, 2.0, 2.1}.

[0091] Exemplarily, different interface adapters can be developed together with the upgrade of interface version or accessor version according to compatibility requirements. That is, when an interface version or accessor version is upgraded, its corresponding interface adapter can be upgraded together with it, so as to ensure that the compatibility is not affected after the interface version or accessor version is upgraded. For example, if the upgraded version number of the called party's interface A is 3, the historical version number of interface A is 1 or 2, and the accessor version is 1 or 2, then the interface adapters developed together with this interface A upgrade may include two types of interface adapters: {A, 1, 3} and {A, 2, 3}.

[0092] Step 204: The interface manager sends the interface adapter to the caller.

[0093] Exemplarily, the interface adapter sent by the interface manager can be in any form that can be directly or indirectly loaded and executed by the callee, such as binary code, source code, or intermediate code. In this way, the interface adapter can be used as a means to enhance interface compatibility in the form of a code patch, and complete the conversion of interactive data between the caller and the callee in conjunction with the conversion logic between the provisions corresponding to the version information supported by the built-in caller and the provisions corresponding to the version information of the target interface.

[0094] Step 205: When the version information of the target interface is incompatible with the version information supported by the caller, the caller obtains an interface adapter corresponding to the version information supported by the caller.

[0095] Exemplarily, after acquiring the interface adapter, the caller may load the interface adapter and determine the caller's compatibility with the interface adapter, and after successful loading, perform the following step 206 .

[0096] Step 206: The caller calls the target interface through the interface adapter.

[0097] In this step, the interface adapter can play a bridging role when the version information of the target interface is incompatible with the version information supported by the caller, thereby helping the caller to complete the call of the target interface with incompatible version information. The specific method of the caller calling the target interface through the interface adapter can be seen below.

[0098] In a possible implementation, the caller can store the acquired interface adapter for subsequent reuse, so that when the caller needs to call the target interface again, it can directly call the target interface through the interface adapter without re-acquiring the interface adapter each time.

[0099] In an embodiment of the present disclosure, when the version information of the target interface is incompatible with the version information supported by the caller, the caller obtains an interface adapter corresponding to the version information supported by the caller; and calls the target interface through the interface adapter. The interface adapter is used to convert data so that the data before and after the conversion conforms to the corresponding provisions of the version information of the target interface and the corresponding provisions of the version information supported by the caller respectively; as a means of enhancing interface compatibility, the interface adapter can serve as a bridge when the version information of the target interface is incompatible with the version information supported by the caller, so as to help the caller complete the call to the target interface with incompatible version information, thereby effectively solving compatibility issues during various forms of interface calls. As an example, the [current version, minimum version] interval is used to represent the version information of the target interface. In addition, the interface calling method is applicable to any interface calling form and usage scenario, and has a wider application; and there is no need to deploy a transit server, which reduces the complexity of deployment and operation and maintenance; the interface adapter can be developed and released together with the interface upgrade, and the compatibility upgrade is completed when the interface upgrade is completed, which facilitates the formulation of compatibility strategies; in this way, the developer of the called party only needs to pay attention to the compatibility issues of multiple versions of the interface, and the developer of the calling party only needs to pay attention to the development of the calling method of the current interface version, thereby improving the work efficiency of relevant personnel.

[0100] For example, Figure 3 A flowchart of an interface calling method according to an embodiment of the present disclosure is shown. For example, the above Figure 1 The interface calls the caller 101 in the system 10 to execute; Figure 3As shown, ① the caller obtains the version information of the called party's interface (i.e., the above step 202); ② the caller determines whether the version information of the called party's interface is compatible with the version information supported by the caller, and if so, executes ③ directly calling the interface; if not, executes ④ the caller obtains the required version of the interface adapter (i.e., the above step 205), that is, obtains the interface adapter corresponding to the version information supported by the caller, ⑤ the caller determines whether the interface adapter is successfully obtained, and if not, executes ⑧ reporting the interface call failure, and if successful, executes ⑥ the caller loads the interface adapter, and then executes ⑦ calling the called party's interface through the interface adapter (i.e., the above step 206).

[0101] Take the scenario where applications APP1 and APP2 need to call the interface of the service provider module SVC as an example. Applications APP1 and APP2 are the callers, and the service provider module SVC is the callee. The interface manager is integrated in the service provider module SVC, and can write the interface version information into the / etc / SVC / intfver file and the interface adapter information into the / etc / SVC / intfadpt file. The service provider module SVC provides an interface named intfA, which has two incompatible versions. The interface corresponding to each version is shown in Table 1 below. The structure of the intfA interface of version number 1 is S1, and the structure of the intfA interface of version number 2 is S2.

[0102] Table 1-Interfaces corresponding to different versions

[0103] Version Number interface 1 int intfA(struct S1); 2 int intfA(struct S2);

[0104] Assume that the service provider module SVC is configured with the interface intfA of version 2, and the executable module / usr / lib / libIntfA_1_2.so corresponding to the interface adapter {intfA, 1, 2}. The application APP1 is configured with the accessor of the interface intfA, version 1; the application APP2 is configured with the accessor of the intfA interface, version 2.

[0105] The steps for application APP1 to call interface intfA are as follows: application APP1 reads the interface version information through / etc / SVC / intfver and obtains the data: {intfA, 2, 2}, that is, the service provider module SVC supports interface intfA, the current version number of interface intfA is 2, and the minimum version number compatible with interface intfA is also 2. Since the accessor version number of interface intfA equipped by application APP1 is 1, application APP1 determines that the version information of interface intfA of service provider module SVC is incompatible with the version number of application APP1 accessor, and needs to use the interface adapter for calling. Application APP1 reads the interface adapter information corresponding to accessor version number 1 through / etc / SVC / intfadpt and obtains the data {intfA, 1, 3}- / usr / lib / libIntfA_1_2.so, that is, the interface adapter that supports the conversion between data that conforms to the corresponding provisions of intfA interface version number 1 and conforms to the corresponding provisions of version number 2 is implemented in / usr / lib / libIntfA_1_2.so. The application APP1 loads / usr / lib / libIntfA_1_2.so and exports the interface symbol of the adapter, which conforms to the form of intintfA (struct S1); the application APP1 calls the interface symbol exported by the interface adapter, thereby completing the call to the interface intfA.

[0106] The steps for application APP2 to call interface intfA are as follows: application APP2 reads the interface version information through / etc / SVC / intfver and obtains the data: {intfA,2,2}, that is, the service provider module SVC supports interface intfA, the current version number of interface intfA is 2, and the minimum version number compatible with interface intfA is also 2. Since the accessor version number of interface intfA equipped by application APP2 is 2, application APP2 determines that the version information of interface intfA of service provider module SVC is compatible with the version number of application APP2 accessor, and application APP2 can directly call interface intfA.

[0107] The following is a detailed description of possible implementations of the caller calling the target interface through the interface adapter in the above step 206.

[0108] Figure 4 A schematic diagram showing that the accessor version of the caller is incompatible with the interface version of the callee according to an embodiment of the present disclosure; Figure 4 As shown, the caller's accessor version number is 1, and the callee's interface version number is 2. The two are incompatible, and the caller cannot call the interface through the accessor. Figure 5A schematic diagram of calling an interface through an interface adapter according to an embodiment of the present disclosure is shown as follows: Figure 5 As shown, the interface adapter provides an interface with version number 1 (which can be called an intermediate interface) to the caller, implements an accessor with version number 2 (which can be called an intermediate accessor) on the called side, and completes the conversion of interactive data between the caller and the called party by cooperating with the built-in conversion logic between the provisions corresponding to version number 1 of the caller's accessor and the provisions corresponding to version number 2 of the called party's interface. The specific working process of the interface adapter is: the caller calls the interface (version number 1) provided by the interface adapter -> the interface adapter converts the interface parameters (from conforming to the provisions corresponding to version number 1 to conforming to the provisions corresponding to version number 2) -> the interface adapter calls the called party's interface (version number 2) through the accessor (version number 2) -> the called party returns the interface data to the accessor (version number 2) of the interface adapter -> the interface adapter converts the interface data (from conforming to the provisions corresponding to version number 2 to conforming to the provisions corresponding to version number 1) -> the interface adapter returns the interface data to the caller's accessor (version number 1) -> the interface call is completed.

[0109] Figure 6 A flowchart of a caller calling a target interface through an interface adapter according to an embodiment of the present disclosure is shown. For example, the above Figure 1 One or more of the caller 101, the callee 102, and the interface manager 103 in the interface calling system are executed, such as Figure 6 As shown, the following steps may be included:

[0110] Step 601: The caller sends the target interface parameters to the called party through the interface adapter, so that the called party determines the target interface data based on the target interface parameters.

[0111] Exemplarily, the target interface parameters comply with the corresponding provisions of the version information of the target interface.

[0112] As an example, the target interface parameters include second interface parameters, and the target interface data include first interface data; sending the target interface parameters to the called party through the interface adapter includes: converting the first interface parameters into second interface parameters through the interface adapter, and sending the second interface parameters to the called party; wherein the first interface parameters comply with the corresponding regulations of the version information supported by the caller, and the second interface parameters comply with the corresponding regulations of the version information of the target interface.

[0113] It is understandable that there are differences between the version information corresponding provisions supported by the caller and the version information corresponding provisions of the target interface, for example, there are differences in the number of parameters, parameter types, parameter passing order, etc. of the specified interface parameters. Therefore, the called party cannot directly receive the first interface parameters, and the first interface parameters are converted into second interface parameters through the conversion logic between the version information corresponding provisions supported by the caller and the version information corresponding provisions of the target interface built in the interface adapter. The converted second interface parameters comply with the version information corresponding provisions of the target interface so that they can be directly received by the called party.

[0114] Exemplarily, converting the first interface parameter into the second interface parameter through the interface adapter and sending the second interface parameter to the called party includes: calling the intermediate interface provided by the interface adapter through the target accessor to send the first interface parameter to the interface adapter; converting the first interface parameter into the second interface parameter through the interface adapter; calling the target interface through the intermediate accessor provided by the interface adapter to send the second interface parameter to the called party.

[0115] Step 602: The called party obtains target interface parameters from the interface adapter.

[0116] In this step, the called party obtains the target interface parameters from the interface adapter when the version information of the target interface is incompatible with the version information supported by the caller.

[0117] Exemplarily, the target interface parameters comply with the corresponding provisions of the version information of the target interface.

[0118] As an example, the target interface parameters include second interface parameters, and the target interface data include first interface data; obtaining the target interface parameters from the interface adapter includes: obtaining the second interface parameters from the interface adapter, and the second interface parameters are obtained by converting the first interface parameters by the interface adapter.

[0119] It can be understood that the second interface parameters obtained through conversion in the interface adapter comply with the corresponding provisions of the version information of the target interface, so that the called party can directly receive the second interface parameters.

[0120] Exemplarily, the acquiring the second interface parameter from the interface adapter includes: receiving, through the target interface, the second interface parameter sent by an intermediate accessor provided by the interface adapter.

[0121] Step 603: The called party determines the target interface data according to the target interface parameters.

[0122] Exemplarily, the target interface data complies with the corresponding regulations of the version information of the target interface.

[0123] As an example, the target interface parameters include second interface parameters, and the target interface data include first interface data; determining the target interface data according to the target interface parameters includes: determining the first interface data according to the second interface parameters.

[0124] Step 604: The called party returns the target interface data to the interface adapter.

[0125] Exemplarily, the target interface data complies with the corresponding regulations of the version information of the target interface.

[0126] As an example, the target interface parameters include second interface parameters, and the target interface data include first interface data; returning the target interface data to the interface adapter includes: returning the first interface data to the interface adapter so that the interface adapter converts the first interface data into second interface data; wherein the first interface data complies with the corresponding regulations of the version information of the target interface, and the second interface data complies with the corresponding regulations of the version information supported by the caller.

[0127] It is understandable that there are differences between the version information corresponding provisions supported by the caller and the version information corresponding provisions of the target interface, for example, there are differences in the types and structures of the specified interface data. Therefore, the caller cannot directly receive the first interface data, and the first interface data is converted into the second interface data through the conversion logic between the version information corresponding provisions supported by the caller and the version information corresponding provisions of the target interface built in the interface adapter. The converted second interface data complies with the version information corresponding provisions supported by the caller, so that the caller can directly receive it.

[0128] Exemplarily, returning the first interface data to the interface adapter includes: returning the first interface data to the intermediate accessor through the target interface.

[0129] Step 605: The caller obtains target interface data through the interface adapter.

[0130] As an example, the target interface parameters include second interface parameters, and the target interface data include first interface data; obtaining the target interface data through the interface adapter includes: converting the first interface data into second interface data through the interface adapter, and obtaining the second interface data; wherein the first interface data is determined by the called party based on the second interface parameters.

[0131] It can be understood that the second interface data obtained through conversion by the interface adapter conforms to the corresponding provisions of the version information supported by the caller, so that the caller can directly receive the second interface data.

[0132] Exemplarily, converting the first interface data into the second interface data through the interface adapter and obtaining the second interface data includes: receiving the first interface data through the intermediate accessor; converting the first interface data into the second interface data through the interface adapter; and obtaining the second interface data through the target accessor.

[0133] In the disclosed embodiment, the caller sends the target interface parameters to the callee through the interface adapter, the callee obtains the target interface parameters from the interface adapter, the callee determines the target interface data according to the target interface parameters, the callee returns the target interface data to the interface adapter, and the caller obtains the target interface data through the interface adapter. In this way, the conversion of the target interface parameters and the target interface data is completed through the conversion logic between the corresponding provisions of the version information supported by the caller built into the interface adapter and the corresponding provisions of the version information of the target interface. As a means of enhancing interface compatibility, the interface adapter can play a bridging role when the version information of the target interface is incompatible with the version information supported by the caller, so as to help the caller complete the call of the target interface with incompatible version information, thereby effectively solving the compatibility problems in various forms of interface calls.

[0134] For example, Figure 7 A flowchart of an interface calling method according to an embodiment of the present disclosure is shown. For example, the above Figure 1 One or more of the caller 101, the callee 102, and the interface manager 103 in the interface calling system are executed, such as Figure 7As shown, ① the caller obtains the version information of the called party's interface from the interface manager, and the version information is in the interval [current version, minimum version]. When the version number of the caller's accessor is in the interval [current version, minimum version], it is determined that the version number of the caller's accessor is compatible with the version information of the called party's interface, and then execute ②; otherwise, it is determined that the version number of the caller's accessor is incompatible with the version information of the called party's interface, and then execute ③. ② When the versions are compatible, the caller can directly call the called party's interface, and the interface parameters and interface return values ​​used in the calling process comply with the corresponding regulations of the called party's interface version number. ③ When the versions are incompatible, the caller obtains the target version of the interface adapter from the interface manager, where "target version" means the interface version number supported by the caller (the version number of the caller's accessor); the target version of the interface adapter returned by the interface manager can be a binary code module that can be directly loaded and executed after compilation, or it can be a source code. If the source code is returned, the caller compiles it into an executable module and then loads it. ④ When the caller calls the target version of the interface adapter, it calls and processes the return value of the callee's interface according to the version number of the caller's accessor, without caring about the actual version number of the callee's interface. For example, you can execute the above Figure 6 Steps 601-605 shown complete the interface call.

[0135] Based on the same inventive concept of the above method embodiment, the embodiment of the present disclosure further provides an interface calling device, which can be used to execute the technical solution described in the above method embodiment. For example, each step of the interface calling method shown in the above method embodiment can be executed.

[0136] Figure 8 A structural diagram of an interface calling device according to an embodiment of the present disclosure is shown as follows: Figure 8 As shown, applied to the caller, the device includes: a first acquisition module 801, used to obtain the version information of the target interface of the called party; the first acquisition module 801 is also used to obtain the interface adapter corresponding to the version information supported by the caller when the version information of the target interface is incompatible with the version information supported by the caller; the interface adapter is used to convert the data so that the data before and after the conversion respectively conforms to the corresponding regulations of the version information of the target interface and the corresponding regulations of the version information supported by the caller; a calling module 802 is used to call the target interface through the interface adapter.

[0137] In one possible implementation, the version information of the target interface includes: the current version number of the target interface and the minimum version number compatible with the target interface, and the version number between the current version number and the minimum version number; and / or, the version information supported by the caller includes: the version number of the caller target accessor; the target accessor is an accessor configured by the caller for calling the interface.

[0138] In a possible implementation, the calling module 802 is further used to: send the target interface parameters to the called party through the interface adapter, so that the called party determines the target interface data based on the target interface parameters; and obtain the target interface data through the interface adapter.

[0139] In one possible implementation, the target interface parameters include second interface parameters, and the target interface data include first interface data; the calling module 802 is also used to: convert the first interface parameters into second interface parameters through the interface adapter, and send the second interface parameters to the called party; wherein the first interface parameters comply with the corresponding provisions of the version information supported by the caller, and the second interface parameters comply with the corresponding provisions of the version information of the target interface; the calling module 802 is also used to: convert the first interface data into second interface data through the interface adapter, and obtain the second interface data; wherein the first interface data is determined by the called party based on the second interface parameters, the first interface data complies with the corresponding provisions of the version information of the target interface, and the second interface data complies with the corresponding provisions of the version information supported by the caller.

[0140] Fig. 9 A structural diagram of another interface calling device according to an embodiment of the present disclosure is shown as follows: Fig. 9 As shown, applied to the called party, the device includes: a second acquisition module 901, used to obtain target interface parameters from the interface adapter when the version information of the target interface is incompatible with the version information supported by the caller; the interface adapter corresponds to the version information supported by the caller, and is used to convert the data so that the data before and after the conversion respectively conforms to the corresponding regulations of the version information of the target interface and the corresponding regulations of the version information supported by the caller; a determination module 902, used to determine the target interface data according to the target interface parameters; and a return module 903, used to return the target interface data to the interface adapter.

[0141] In a possible implementation, the target interface parameters include second interface parameters, and the target interface data include first interface data; the second acquisition module 901 is also used to: obtain the second interface parameters from the interface adapter, and the second interface parameters are obtained by converting the first interface parameters by the interface adapter, wherein the first interface parameters comply with the corresponding provisions of the version information supported by the caller, and the second interface parameters comply with the corresponding provisions of the version information of the target interface; the determination module 902 is also used to: determine the first interface data according to the second interface parameters; the return module 903 is also used to: return the first interface data to the interface adapter, so that the interface adapter converts the first interface data into second interface data; wherein the first interface data complies with the corresponding provisions of the version information of the target interface, and the second interface data complies with the corresponding provisions of the version information supported by the caller.

[0142] Fig.10 A structural diagram of another interface calling device according to an embodiment of the present disclosure is shown as follows: Fig.10 As shown, applied to an interface manager, the device includes: a sending module 1001, used to send the version information of the target interface of the called party to the caller; a determining module 1002, used to determine the interface adapter corresponding to the version information supported by the caller when the version information of the target interface is incompatible with the version information supported by the caller; the interface adapter is used to convert data so that the data before and after the conversion respectively conforms to the corresponding regulations of the version information of the target interface and the corresponding regulations of the version information supported by the caller; the sending module 1001 is also used to send the interface adapter to the caller.

[0143] Above Figure 8-10 The technical effects and specific descriptions of the interface calling device shown and its various possible implementation methods can be found in the above-mentioned interface calling method, which will not be repeated here.

[0144] It should be understood that the division of the modules in the above device is only a division of logical functions, and in actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. In addition, the modules in the device can be implemented in the form of a processor calling software; for example, the device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or realize the functions of the modules of the device, wherein the processor is, for example, a general-purpose processor, such as a central processing unit (CPU) or a microprocessor, and the memory is a memory inside the device or a memory outside the device. Alternatively, the modules in the device can be implemented in the form of hardware circuits, and the functions of some or all modules can be realized by designing the hardware circuits, and the hardware circuits can be understood as one or more processors; for example, in one implementation, the hardware circuit is an application-specific integrated circuit (ASIC), and the functions of some or all modules above are realized by designing the logical relationship of the components in the circuit; for another example, in another implementation, the hardware circuit can be realized by a programmable logic device (PLD), taking a field programmable gate array (FPGA) as an example, which can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by a configuration file, so as to realize the functions of some or all modules above. All modules of the above device can be realized in the form of a processor calling software, or in the form of hardware circuits, or in part by a processor calling software, and the rest by hardware circuits.

[0145] In the embodiments of the present disclosure, the processor is a circuit with the ability to process signals. In one implementation, the processor may be a circuit with the ability to read and run instructions, such as a CPU, a microprocessor, a graphics processing unit (GPU), a digital signal processor (DSP), a neural-network processing unit (NPU), a tensor processing unit (TPU), etc.; in another implementation, the processor may implement certain functions through the logical relationship of a hardware circuit, and the logical relationship of the hardware circuit is fixed or reconfigurable, such as a hardware circuit implemented by an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the hardware circuit configuration can be understood as the process of the processor loading instructions to implement the functions of some or all of the above modules.

[0146] It can be seen that each module in the above device can be one or more processors (or processing circuits) configured to implement the above embodiment method, such as: CPU, GPU, NPU, TPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms. In addition, each module in the above device can be fully or partially integrated together, or can be implemented independently, which is not limited.

[0147] An embodiment of the present disclosure further provides an electronic device, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to implement the method of the above embodiment when executing the instructions.

[0148] Fig.11 1 is a block diagram of an electronic device 1900 according to an embodiment of the present disclosure. For example, the device 1900 may be provided as a server or a terminal device. Fig.11 , the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.

[0149] The electronic device 1900 may also include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output interface 1958 (I / O interface). The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.

[0150] An embodiment of the present disclosure provides a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method in the above embodiment is implemented.

[0151] An embodiment of the present disclosure provides a computer program product, which may include, for example, a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code; when the computer program product runs on a computer, the computer executes the method in the above embodiment.

[0152] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0153] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0154] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0155] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0156] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0157] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0158] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0159] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0160] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. An interface calling method, characterized in that: Applied to the caller, the method includes: Get the version information of the target interface of the callee; In the case where the version information of the target interface is incompatible with the version information supported by the caller, obtaining an interface adapter corresponding to the version information supported by the caller; the interface adapter is used to convert the data so that the data before and after the conversion conforms to the corresponding provisions of the version information of the target interface and the corresponding provisions of the version information supported by the caller respectively; The target interface is called through the interface adapter.

2. The method according to claim 1, characterized in that The version information of the target interface includes: the current version number of the target interface and the lowest version number compatible with the target interface, and the version number between the current version number and the lowest version number; and / or, The version information supported by the caller includes: the version number of the target accessor of the caller; the target accessor is an accessor configured by the caller for calling an interface.

3. The method according to claim 1, characterized in that The calling the target interface through the interface adapter includes: Sending the target interface parameters to the called party through the interface adapter, so that the called party determines the target interface data based on the target interface parameters; The target interface data is acquired through the interface adapter.

4. The method according to claim 3, characterized in that The target interface parameters include second interface parameters, and the target interface data include first interface data; The sending of the target interface parameters to the called party through the interface adapter includes: converting the first interface parameters into second interface parameters through the interface adapter, and sending the second interface parameters to the called party; wherein the first interface parameters comply with the corresponding provisions of the version information supported by the calling party, and the second interface parameters comply with the corresponding provisions of the version information of the target interface; The obtaining of the target interface data through the interface adapter includes: converting the first interface data into the second interface data through the interface adapter, and obtaining the second interface data; wherein the first interface data is determined by the called party based on the second interface parameters, the first interface data complies with the corresponding provisions of the version information of the target interface, and the second interface data complies with the corresponding provisions of the version information supported by the caller.

5. An interface calling method, characterized in that: Applied to the called party, the method comprises: In the case where the version information of the target interface is incompatible with the version information supported by the caller, the target interface parameters are obtained from the interface adapter; the interface adapter corresponds to the version information supported by the caller and is used to convert the data so that the data before and after the conversion conforms to the corresponding provisions of the version information of the target interface and the corresponding provisions of the version information supported by the caller respectively; Determining target interface data according to the target interface parameters; The target interface data is returned to the interface adapter.

6. The method according to claim 5, characterized in that The target interface parameters include second interface parameters, and the target interface data include first interface data; The acquiring the target interface parameter from the interface adapter includes: acquiring the second interface parameter from the interface adapter, the second interface parameter being obtained by converting the first interface parameter by the interface adapter, wherein the first interface parameter complies with the corresponding provisions of the version information supported by the caller, and the second interface parameter complies with the corresponding provisions of the version information of the target interface; The determining the target interface data according to the target interface parameter comprises: determining the first interface data according to the second interface parameter; Returning the target interface data to the interface adapter includes: returning the first interface data to the interface adapter so that the interface adapter converts the first interface data into second interface data; wherein the first interface data complies with the corresponding regulations of the version information of the target interface, and the second interface data complies with the corresponding regulations of the version information supported by the caller.

7. An interface calling method, characterized in that: Applied to an interface manager, the method comprises: Send the version information of the target interface of the callee to the caller; In the case where the version information of the target interface is incompatible with the version information supported by the caller, determining an interface adapter corresponding to the version information supported by the caller; the interface adapter is used to convert the data so that the data before and after the conversion conforms to the corresponding provisions of the version information of the target interface and the corresponding provisions of the version information supported by the caller respectively; The interface adapter is sent to the caller.

8. An interface calling device, characterized in that: Applied to the caller, the device comprises: The acquisition module is used to obtain the version information of the target interface of the called party; The acquisition module is further used to acquire an interface adapter corresponding to the version information supported by the caller when the version information of the target interface is incompatible with the version information supported by the caller; the interface adapter is used to convert the data so that the data before and after the conversion conforms to the corresponding provisions of the version information of the target interface and the corresponding provisions of the version information supported by the caller respectively; A calling module is used to call the target interface through the interface adapter.

9. An interface calling device, characterized in that: Applied to the called party, the device comprises: an acquisition module, used for acquiring target interface parameters from an interface adapter when the version information of the target interface is incompatible with the version information supported by the caller; the interface adapter corresponds to the version information supported by the caller, and is used for converting data so that the data before and after the conversion respectively conform to the corresponding provisions of the version information of the target interface and the corresponding provisions of the version information supported by the caller; A determination module, used to determine target interface data according to the target interface parameters; The returning module is used to return the target interface data to the interface adapter.

10. An interface calling device, characterized in that: Applied to an interface manager, the device comprises: The sending module is used to send the version information of the target interface of the called party to the caller; A determination module, used for determining an interface adapter corresponding to the version information supported by the caller when the version information of the target interface is incompatible with the version information supported by the caller; the interface adapter is used for converting data so that the data before and after the conversion conforms to the corresponding provisions of the version information of the target interface and the corresponding provisions of the version information supported by the caller respectively; The sending module is also used to send the interface adapter to the caller.

11. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to implement the method described in any one of claims 1 to 7 when executing the instructions stored in the memory.

12. A non-volatile computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.