API calling method, system and device and storage medium
By building a mapping conversion platform, customizing and managing API mapping conversion rules, the cumbersome API calls development process is solved, the development efficiency and flexibility are improved, and the need for source code modification and testing is reduced.
Patent Information
- Application Number
- CN202411117696.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-12-13
AI Technical Summary
When calling different APIs in the prior art, developers need to manually adjust and modify the mapping conversion rules in the application source code, resulting in cumbersome and inefficient development process. Each time the API changes, it needs to be retested and launched, which increases the difficulty of development.
A mapping conversion platform has been built, allowing developers to customize and manage API mapping conversion rules on the platform. The application side can obtain and use these rules directly from the platform, reducing the need for source code modification and testing.
It shortens the API development and modification process, improves the development efficiency of the application side, reduces the error rate, and allows the application side to flexibly call various APIs.
Smart Images

Figure CN119127167A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an API calling method, system, device and storage medium. Background Art
[0002] Different Application Programming Interfaces (APIs) may have different parameter format requirements for input / output parameters. Therefore, when the application calls different third-party APIs, it is necessary to adjust the format of the input / output parameters accordingly so that the input / output parameters used by the application to call the target API meet the parameter format requirements of the target API.
[0003] At present, developers usually add mapping conversion rules that meet the parameter format requirements of the target API to the source code of the application side according to the parameter format requirements of the target API, and then convert the input / output parameters of the application side through the mapping conversion rules, so as to successfully call the target API. However, this conversion method requires developers to modify the source code of the application side to modify the mapping conversion rules every time the API is changed, and the modified source code of the application side needs to be retested and put online, which greatly prolongs the development process of calling the API on the application side, making the development steps cumbersome, and thus reducing the development efficiency for API calls. Summary of the invention
[0004] Multiple aspects of the present application provide an API calling method, system, device and storage medium to shorten the development process of calling the API, improve the development efficiency of the application side, and realize flexible calling of the API.
[0005] In a first aspect, an embodiment of the present application provides an API calling method, which is applicable to an application end, wherein the application end is communicated with a mapping conversion platform, and includes:
[0006] In response to a call event for a target API, determining source input parameter information required to call the target API;
[0007] Sending a request for obtaining a target mapping conversion rule corresponding to the target API to the mapping conversion platform, so that the mapping conversion platform returns the target mapping conversion rule corresponding to the target API, wherein the mapping conversion platform pre-generates and maintains a mapping conversion rule corresponding to at least one API;
[0008] According to the received target mapping conversion rule corresponding to the target API, the source input parameter information is converted into the target input parameter information supported by the target API, and a call to the target API is initiated according to the target input parameter information.
[0009] In a second aspect, an embodiment of the present application provides an API calling method, applicable to a mapping conversion platform, including:
[0010] Receiving a request for obtaining a target mapping conversion rule corresponding to the target API sent by an application terminal in communication with the mapping conversion platform;
[0011] According to the acquisition request, acquiring a target mapping conversion rule corresponding to the target API from mapping conversion rules corresponding to at least one API generated and maintained in advance;
[0012] The target mapping conversion rule is provided to the application end, so that the application end converts the source input parameter information required for calling the target API into the target input parameter information supported by the target API according to the target mapping conversion rule, so as to call the target API.
[0013] In a third aspect, an embodiment of the present application further provides an API calling system, comprising: an application end, and a mapping conversion platform and at least one server end in communication connection with the application end, wherein the at least one server end is used to provide an API, and the number of the application ends is one or more;
[0014] The application end is used to respond to a call event for a target API, determine the source input parameter information required to call the target API; send a request to obtain a target mapping conversion rule corresponding to the target API to the mapping conversion platform, convert the source input parameter information into target input parameter information supported by the target API according to the received target mapping conversion rule corresponding to the target API, and request the target server to call the target API according to the target input parameter information;
[0015] The mapping conversion platform is used to pre-generate and maintain mapping conversion rules corresponding to at least one API; respond to a request for obtaining a target mapping conversion rule corresponding to the target API sent by the application end, obtain the target mapping conversion rule corresponding to the target API from the mapping conversion rules corresponding to the at least one API, and return the target mapping conversion rule to the application end;
[0016] The target server is used to receive the target input parameter information sent by the application, and respond to the application's call to the target API based on the target input parameter information; wherein the target server is the server that provides the target API.
[0017] In a fourth aspect, an embodiment of the present application further provides an electronic device, including: a memory, a processor, and a communication component;
[0018] In response to a call event for a target API, determining source input parameter information required to call the target API;
[0019] Sending, through the communication component, a request for obtaining a target mapping conversion rule corresponding to a target API to a mapping conversion platform that is communicatively connected to the electronic device, so that the mapping conversion platform returns the target mapping conversion rule corresponding to the target API, wherein the mapping conversion platform pre-generates and maintains a mapping conversion rule corresponding to at least one API;
[0020] According to the received target mapping conversion rule corresponding to the target API, the source input parameter information is converted into the target input parameter information supported by the target API, and a call to the target API is initiated according to the target input parameter information.
[0021] In a fifth aspect, an embodiment of the present application further provides a mapping conversion platform, including: a memory, a processor, and a communication component;
[0022] Receiving, through the communication component, a request for obtaining a target mapping conversion rule corresponding to the target API sent by an application terminal in communication connection with the mapping conversion platform;
[0023] According to the acquisition request, acquiring a target mapping conversion rule corresponding to the target API from mapping conversion rules corresponding to at least one API generated and maintained in advance;
[0024] The target mapping conversion rule is provided to the application end, so that the application end converts the source input parameter information required for calling the target API into the target input parameter information supported by the target API according to the target mapping conversion rule, so as to call the target API.
[0025] In a sixth aspect, an embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which, when executed by one or more processors, causes the one or more processors to execute the aforementioned API calling method.
[0026] In the embodiment of the present application, a platform for parameter mapping conversion for calling API is constructed to separate the configuration work of mapping conversion rules related to calling API in at least one application-side source code, so that the developers of each application-side source code can customize the corresponding mapping conversion rules for each API of the corresponding application-side on the mapping conversion platform, and each application-side can directly call the required target mapping conversion rules from the mapping conversion platform according to the actual API calling requirements. It is no longer necessary for each application-side developer to develop the mapping conversion rules of each API in the source code separately and modify the mapping conversion rules of the corresponding API in the source code when the API changes, eliminating the need to perform source code testing / retesting, re-online and other operations required for developing and modifying the API in the source code, shortening the API development and modification process, thereby effectively improving the development efficiency of the application side. In addition, the mapping conversion rules corresponding to multiple APIs are configured on the mapping conversion platform, so that the application side can flexibly call various APIs based on the mapping conversion platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0028] Figure 1 A schematic diagram of the structure of an API calling system provided for an exemplary embodiment of the present application;
[0029] Figure 2 A schematic diagram of an API configuration interface provided for an exemplary embodiment of the present application;
[0030] Figure 3 A schematic diagram of a mapping conversion configuration interface provided for an exemplary embodiment of the present application;
[0031] Figure 4 An API call process in an application scenario provided by an exemplary embodiment of the present application;
[0032] Figure 5 A schematic diagram of the structure of another API calling system provided for an exemplary embodiment of the present application;
[0033] Figure 6 A flowchart of an API calling method provided for another exemplary embodiment of the present application;
[0034] Figure 7 A flowchart of another API calling method provided for another exemplary embodiment of the present application;
[0035] Figure 8A schematic diagram of the structure of an electronic device provided for another exemplary embodiment of the present application;
[0036] Fig. 9 A structural schematic diagram of a mapping conversion platform provided for yet another exemplary embodiment of the present application. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0038] At present, when the application needs to request to call different APIs from the server, the developer needs to develop or modify the logic code of the mapping conversion rules corresponding to the API in the application source code in advance, and test / retest the developed or modified source code and put it online, which makes the development or modification steps of the application calling the API cumbersome and reduces the development or modification efficiency. In view of the above problems, this embodiment provides a solution. The basic idea is to abstract and tool the configuration logic associated with the mapping conversion required for calling the API in at least one application source code, build a platform for parameter mapping conversion for the API, and the developer of each application source code can customize the corresponding mapping conversion rules for each API of the corresponding application on the mapping conversion platform. Each application can directly call the required target mapping conversion rules from the mapping conversion platform according to the actual API call requirements. It is no longer necessary for the developer of each application to develop the mapping conversion rules of each API in the source code and modify the mapping conversion rules of the corresponding API in the source code when the API changes, which saves the testing / retesting of the source code and re-online operations required to develop and modify the API in the source code, shortens the development and modification process of the API, and effectively improves the development efficiency of the application. In addition, mapping conversion rules corresponding to multiple APIs are configured on the mapping conversion platform, so that the application end can flexibly call various APIs based on the mapping conversion platform.
[0039] The technical solution provided by the embodiments of the present application is described in detail below in conjunction with the accompanying drawings.
[0040] Before going into detail, the technical concepts involved in this embodiment are briefly explained.
[0041] Application Programming Interface (API): is a set of definitions, programs and protocols that can be used to build software applications so that they can interact with another software application without accessing its source code or understanding the details of its internal working mechanism. In short, API is a bridge for communication between software. API can be used to call a function of another software application from within one software application.
[0042] Figure 1 This is a schematic diagram of the structure of an API calling system provided by an exemplary embodiment of the present application. Figure 1 As shown, the system includes: an application end 10, a mapping conversion platform 11 and a server end 12.
[0043] In this embodiment, the application end 10 refers to an electronic device that can display a web page. The web page can be an H5 page or an application program interface, such as a computer, a smart phone, a tablet computer or a wearable device. On the web page of the application end 10, a call can be initiated to the API provided by the server end 12. In the embodiment of the present application, the number of application ends 10 can be one or more. Each server end 12 is a computer device that can respond to the call request of the application end 10 and provide API call services to the application end 10, and generally has the ability to undertake and guarantee services. The mapping conversion platform 11 is a platform for generating and maintaining the mapping conversion rules corresponding to each API. The mapping conversion platform 11 can be presented in the form of tool components, websites, etc., which are not limited here.
[0044] Among them, the application end 10 and the server end 12 can be connected wirelessly or by wire, and one application end 10 can be connected to multiple server ends 12 for communication. Optionally, the application end 10 can be connected to the server end 12 through a mobile network, and the mobile network can be any one of 2G (GSM), 3G (WCDMA, TD-SCDMA, CDMA2000, UTMS), 4G (LTE), 5G, etc.; it can also be connected to the server end 12 through wireless methods such as Bluetooth, WiFi, infrared, etc. The mapping conversion platform 11 can be mounted on the application end 10, or it can be connected to the application end 10 by wire or wireless. That is, the mapping conversion platform 11 can run on the application end 10, or it can run on other electronic devices other than the application end 10. However, there is no connection relationship between the mapping conversion platform 11 and the server end 12.
[0045] Based on this connection relationship, the application end 10 can respond to the call event for the target API, determine the source input parameter information required for calling the target API, and send a request to obtain the target mapping conversion rule corresponding to the target API to the mapping conversion platform 11, so that the mapping conversion platform 11 returns the target mapping conversion rule corresponding to the target API. Among them, the application end 10 may include multiple API controls, and in response to the user's click operation on the target API control on the application end 10, the parameter information associated with the target API control can be determined as the source input parameter information required for calling the target API.
[0046] The source code of the application end 10 may include the rule calling interface information provided by the mapping conversion platform 11. Based on this, in an optional implementation method of obtaining the target mapping conversion rule corresponding to the target API from the mapping conversion platform 11, based on the rule calling interface information, a request for obtaining the target mapping conversion rule corresponding to the target API may be sent to the rule calling interface corresponding to the rule calling interface information in the mapping conversion platform 11, so that the mapping conversion platform 11 can respond to the acquisition request, and obtain the target mapping conversion rule corresponding to the target API from the mapping conversion rules corresponding to at least one API that is pre-generated and maintained; and receive the target mapping conversion rule provided by the rule calling interface in the mapping conversion platform 11. The acquisition request may carry a target API identifier, so that the mapping conversion platform 11 determines the target API pointed to by the target API identifier, and searches for the target mapping conversion rule corresponding to the target API from the mapping conversion rules corresponding to at least one API.
[0047] In this embodiment, the rule calling interface allows the application end to exchange data in a variety of different ways, and can support different data formats (such as JSON, XML, etc.) and transmission protocols (such as HTTP, WebSocket, etc.), so that the mapping conversion platform can easily communicate with different application ends, improving the adaptability and flexibility of the mapping conversion platform. In addition, data transmission through the rule calling interface can more easily achieve security control, which can ensure the security and integrity of the target mapping conversion rules during the transmission process.
[0048] On this basis, the supply end 10 can convert the source input parameter information required for calling the target API into the target input parameter information supported by the target API according to the target mapping conversion rule corresponding to the received target API.
[0049] Optionally, after receiving the target mapping conversion rule corresponding to the target API, the target code segment used to describe the calling logic of the target API can be searched in the source code of the application end 10 according to the received target mapping conversion rule, and the logic code of the target mapping conversion rule can be inserted into the preset position associated with the logic code in the target code segment. The preset position can be the head position of the target code segment, or the position where the mapping conversion is performed in the target code segment, or the insertion position pre-specified by the developer, etc. The logic code inserted at the preset position is run to convert the source input parameter information into the target input parameter information supported by the target API according to the target mapping conversion rule. Here, the logic code can be run alone, or the source code after the logic code is inserted can be run, and when the target code segment is run, the logic code is loaded and run. This embodiment does not limit this.
[0050] In this way, the logic code of the target mapping conversion rule can be perfectly matched with the source code of the application side without damaging the original execution logic in the source code. There is no need to debug the source code repeatedly, which can effectively reduce the possibility of errors while ensuring development efficiency. In addition, the target server is unaware of the addition of mapping conversion rules, and the application side and the target server side can still interact according to the original logic code, which can effectively ensure the normal operation of the interaction function between the application side and the target server side.
[0051] Among them, the source input parameter information may include but is not limited to the source input parameter name, source input parameter type and source input parameter node attributes. Based on this, in the process of converting the source input parameter information into the target input parameter information supported by the target API according to the target mapping conversion rule, the source input parameter name, source input parameter type and source input parameter node attributes contained in the source input parameter information can be parsed, and according to the input parameter name conversion information, input parameter type conversion information and input parameter node attribute conversion information in the target mapping conversion rule, the source input parameter name, source input parameter type and source input parameter node attributes are converted into the target input parameter name, target input parameter type and target input parameter node attributes respectively, and then according to the organizational structure of the input parameter information, the target input parameter name, target input parameter type and target input parameter node attributes are combined to obtain the target input parameter information supported by the target API.
[0052] Furthermore, the application end 10 may request to call the target API from the target server end 12 that provides the target API based on the target input parameter information. In the process of calling the target API, the application end 10 may carry the target input parameter information in the target API call request and send it to the target server end 12 corresponding to the target API, so that the target server end 12 can respond to the target API call request and generate response information corresponding to the target input parameter information, and the response information includes the source output parameter information supported by the target API. The target server end 12 may return the response information corresponding to the target input parameter information to the application end 10, so that the application end 10 can convert the source output parameter information in the response information into the target output parameter information needed by itself according to the target mapping conversion rules corresponding to the target API previously obtained from the mapping conversion platform 11, and then use the target output parameter information to implement the call of the target API.
[0053] Similar to the description of source input parameter information in the previous text, source output parameter information may include but is not limited to source output parameter name, source output parameter type and source output parameter node attributes. Based on this, in the process of converting the source output parameter information into the target output parameter information required by itself according to the target mapping conversion rule, the source output parameter name, source output parameter type and source output parameter node attributes contained in the source output parameter information can be parsed, and according to the output parameter name conversion information, output parameter type conversion information and output parameter node attribute conversion information in the target mapping conversion rule, the source output parameter name, source output parameter type and source output parameter node attributes are converted into the target output parameter name, target output parameter type and target output parameter node attributes respectively, and then according to the organizational structure of the output parameter information, the target output parameter name, target output parameter type and target output parameter node attributes are combined to obtain the target output parameter information supported by the target API.
[0054] Accordingly, in this embodiment, a mapping conversion platform for generating and maintaining mapping conversion rules corresponding to each API is provided, and the mapping conversion platform undertakes the configuration and modification of the mapping conversion rules that originally need to be executed in at least one application-side source code. Accordingly, a communication connection is established between the application end and the mapping conversion platform, so that the application end can directly call the mapping conversion rules on the mapping conversion platform. In this way, the developers of the source code of each application end can map the mapping conversion rules corresponding to each custom API of the corresponding application end on the mapping conversion platform, and each application end can directly call the required target mapping conversion rules from the mapping conversion platform according to the actual API call requirements. It is no longer necessary for the developers of each application end to develop the logic code of the mapping conversion rules of each API in the source code and modify the logic code of the mapping conversion rules of the corresponding API in the source code when the API changes, which saves the repeated debugging and repeated online of the source code, can reduce the workload of developers, thereby improving the efficiency of the development and modification of the application-side API, and also reduces the error rate caused by modifying the source code.
[0055] Figure 2 A schematic diagram of an API configuration interface provided by an exemplary embodiment of the present application. The mapping conversion platform 11 can pre-generate and maintain mapping conversion rules corresponding to at least one API. Figure 2 As shown, an API configuration interface is displayed on the mapping conversion platform 11, and developers can add information such as the API name (i.e., platform interface name), code (i.e., platform interface code), and API source classification on the API configuration interface to accurately declare the identity of the first API, which can be any one of the at least one API generated on the mapping conversion platform 11. After configuring the target API information, click the confirmation button to jump to the mapping conversion configuration interface and continue to configure the mapping conversion rules corresponding to the target API.
[0056] Figure 3 The following is a schematic diagram of a mapping conversion configuration interface provided by an exemplary embodiment of the present application. Figure 3 As shown, in response to the mapping conversion configuration operation initiated on the API configuration interface for the first API, the mapping conversion configuration interface bound to the first API can be displayed. In response to the parameter information configuration operation initiated on the mapping conversion configuration interface, at least one source input parameter information, at least one target input parameter information, at least one source output parameter information, and at least one target output parameter information corresponding to the first API can be determined. In response to the matching operation between at least one source input parameter information and at least one target input parameter information, at least one source input parameter information and at least one target input parameter information corresponding to each matching operation can be obtained; similarly, in response to the matching operation between at least one source output parameter information and at least one target output parameter information, at least one source output parameter information and at least one target output parameter information corresponding to each matching operation can be obtained. A mapping relationship is added between at least one source input parameter information and at least one target input parameter information corresponding to each matching operation, and between at least one source output parameter information and at least one target output parameter information corresponding to each matching operation, so as to obtain the target mapping conversion rule corresponding to the first API. The matching operation includes but is not limited to matching by connecting lines, matching by dragging to the same parameter group, and matching by clicking to establish a mapping relationship. Furthermore, after the mapping conversion rule is obtained, the logic code of the mapping conversion rule can be automatically generated.
[0057] In this embodiment, the mapping conversion rules can be customized on the mapping conversion platform through visual matching operations such as dragging, clicking, and connecting, so that at least one application end can flexibly adapt to different APIs, which greatly reduces the technical requirements for developers of each application end. Even non-developers who do not understand technology can easily get started, greatly improving the flexibility of configuration. In addition, this visual development method does not require modification of the source code, which alleviates the problem that the modified code is prone to errors due to different coding habits of different developers, and effectively improves the accuracy of development.
[0058] In addition, in the process of configuring mapping conversion rules, taking the mapping conversion between input parameters as an example, the number of source input parameter information and target input parameter information can be the same or different. When the number of source input parameter information and target input parameter information is different, the source input parameter information / target input parameter information can be connected to empty information to achieve the deletion or addition of input parameter information during the mapping conversion process. The number of parameters contained in the source input parameter information and the number of parameters contained in the target input parameter information may not be exactly the same. For example, the source input parameter information contains 3 data and the target input parameter information contains 2 data. For some data that has a low correlation with the API call, such as the remark information contained in the source input parameter information, you can selectively not perform mapping conversion to reduce the configuration work of developers, thereby improving development efficiency.
[0059] Among them, the source input parameter information or the target input parameter information may include source input parameter node attributes or target input parameter node attributes. The source input parameter node attributes or the target input parameter node attributes may be "root node", "parent node" and "child node", etc., that is, the mapping conversion rules in this embodiment can also be applied to tree-structured data. For example, the data as the root node in the source input parameter information can be converted into the data as the parent node in the target input parameter information. Of course, it can also be applied to data that is not a tree structure, just omit the configuration of the parameter node attributes. The source output parameter information or the target output parameter information may include source output parameter node attributes or target output parameter node attributes. For specific descriptions, please refer to the relevant descriptions of the source input parameter node attributes or the target input parameter node attributes. In order to save space, they will not be repeated here.
[0060] Furthermore, the source input parameter information, the target input parameter information, the source output parameter information, and the target output parameter information may be collectively referred to as parameter information. In one embodiment of the present application, the Json-schema format or other formats may be used to describe the data structure corresponding to the parameter information, and the mapping conversion required to be performed in the API call process may be implemented based on the data results and the mapping conversion rules. Among them, the Json-schema format may include fields such as title and type, title is used to describe the parameter remarks, type is used to describe the parameter type, and the parameter type may be 'string', 'number', 'array', 'object', 'boolean', etc., wherein, if type is array, the items attribute under it is used to describe the data structure of the array item, and if type is object, the properties under it are used to describe the data structure of the object property item, and required describes whether it is a necessary field.
[0061] It should be noted that the converted parameter information can also be used to perform extended design on the mapping conversion platform 11, so as to use the target output parameter information for other functions other than calling the API.
[0062] Accordingly, in this embodiment, the "custom configuration layer" is extracted from the source code, and developers can separately configure the mapping conversion rules corresponding to the API on the mapping conversion platform outside the source code, so that at least one application end can adapt to different APIs, thereby improving the flexibility of development of each application end, liberating developers, and effectively improving the development efficiency of the application end.
[0063] Figure 4 This is an API call process in an application scenario provided by an exemplary embodiment of the present application. Figure 4 As shown, an e-commerce application can be run on the application side, and the target server side can be a server side that provides logistics query services for the logistics application side. Users can query logistics in the e-commerce application by calling the logistics API provided by the target server side in the e-commerce application.
[0064] In this application scenario, a "Logistics Information" button may be displayed on the display interface of the e-commerce application. The e-commerce application may determine the source input parameter information required to call the logistics API in response to the user's click on the "Logistics Information" button. For example, the source input parameter information may be "{user: 001, type: 'string'}". A request to obtain the target mapping conversion rule corresponding to the logistics API is sent to the mapping conversion platform, so that the mapping conversion platform responds to the acquisition request, obtains the target mapping conversion rule corresponding to the logistics API from the mapping conversion rules corresponding to at least one API generated and maintained in advance, and returns the target mapping conversion rule to the e-commerce application. The e-commerce application may convert the source input parameter information into the target input parameter information according to the target mapping conversion rule. For example, the target input parameter information may be "{id: 01, type: 'number'}". Send a logistics API call request with target input parameter information to the target server, so that the target server can find the logistics information with id 01 from the logistics query service provided by the logistics application according to the target input parameter information and return it to the e-commerce application as the source output parameter information. For example, the source output parameter information can be "{city_name:BJ, type:'string'}". After receiving the source output parameter information provided by the target server, the application can continue to convert the source output parameter information into the target output parameter information according to the target mapping conversion rules corresponding to the logistics API. For example, the target output parameter information can be "{city:BJ, type:'boolean'}", and use the target output parameter information to perform rendering and other operations to display the logistics information that the user wants to query on the display interface of the e-commerce application.
[0065] Figure 5 This is a schematic diagram of another API calling system provided by an exemplary embodiment of the present application. Figure 5As shown, the mapping conversion platform can also serve as a "transfer processing station" between the application end and the target service end. The application end 50 can send a call request for the target API to the mapping conversion platform 51, and the call request includes the source input parameter information provided by the application end 50; after receiving the call request, the mapping conversion platform 51 can obtain the target mapping conversion rule corresponding to the target API from the mapping conversion rule corresponding to at least one preset API, convert the source input parameter information into the target input parameter information supported by the target API according to the target mapping conversion rule, and send the target input parameter information to the target service end 52, so that the target service end 52 can generate the response information corresponding to the target input parameter information. The target service end 52 can return the response information corresponding to the generated target input parameter information to the mapping conversion platform, and the response information includes the source output parameter information provided by the target service end 52; after receiving the response information, the mapping conversion platform 51 can convert the source output parameter information in the response information into the target output parameter information according to the target mapping conversion rule corresponding to the target API, and return the target output parameter information to the application end 50, so that the application end 50 can use the target output parameter information to implement the call of the target API. Among them, the number of application ends 50 can be one or more.
[0066] Figure 6 A flowchart of an API calling method provided by another exemplary embodiment of the present application. This method is described from the perspective of the application end, refer to Figure 6 , the method comprising:
[0067] S600, in response to a call event for a target API, determining source input parameter information required for calling the target API;
[0068] S601, sending a request for obtaining a target mapping conversion rule corresponding to a target API to a mapping conversion platform, so that the mapping conversion platform returns the target mapping conversion rule corresponding to the target API, wherein the mapping conversion platform pre-generates and maintains at least one mapping conversion rule corresponding to each API;
[0069] S602, according to the target mapping conversion rule corresponding to the received target API, convert the source input parameter information into the target input parameter information supported by the target API, and initiate a call to the target API according to the target input parameter information.
[0070] In an optional embodiment, the source code of the application end includes rule calling interface information provided by the mapping conversion platform. In the process of requesting the mapping conversion platform to send a request for obtaining the target mapping conversion rule corresponding to the target API so that the mapping conversion platform returns the target mapping conversion rule corresponding to the target API, the method may further include:
[0071] Based on the rule calling interface information, a request for obtaining a target mapping conversion rule corresponding to a target API is sent to a rule calling interface corresponding to the rule calling interface information in a mapping conversion platform, so that the mapping conversion platform responds to the request for obtaining a target mapping conversion rule corresponding to the target API from mapping conversion rules corresponding to at least one API generated and maintained in advance;
[0072] Receive the target mapping conversion rule provided by the rule calling interface in the mapping conversion platform.
[0073] In an optional embodiment, in the process of converting the source input parameter information into the target input parameter information supported by the target API according to the received target mapping conversion rule corresponding to the target API, the method may further include:
[0074] In the source code of the application, find the target code segment that describes the calling logic of the target API;
[0075] Inserting the logic code of the target mapping conversion rule into a preset position associated with the logic code in the target code segment;
[0076] Run the logic code inserted at the preset position to convert the source input parameter information into the target input parameter information supported by the target API according to the target mapping conversion rules.
[0077] In an optional embodiment, the source input parameter information includes a source input parameter name, a source input parameter type, and a source input parameter node attribute. In the process of converting the source input parameter information into target input parameter information supported by the target API according to the target mapping conversion rule, the method may further include:
[0078] Parse the source input parameter name, source input parameter type, and source input parameter node attributes contained in the source input parameter information;
[0079] According to the input parameter name conversion information, input parameter type conversion information and input parameter node attribute conversion information in the target mapping conversion rule, the source input parameter name, source input parameter type and source input parameter node attribute are converted into the target input parameter name, target input parameter type and target input parameter node attribute respectively;
[0080] According to the organizational structure of the input parameter information, the target input parameter name, target input parameter type, and target input parameter node attributes are combined to obtain the target input parameter information supported by the target API.
[0081] In an optional embodiment, in the process of initiating a call to a target API according to the target input parameter information, the method may further include:
[0082] The target input parameter information is carried in the target API call request and sent to the target server corresponding to the target API, so that the target server responds to the target API call request and generates response information corresponding to the target input parameter information;
[0083] Receive the response information corresponding to the target input parameter information returned by the target server, which includes the source output parameter information supported by the target API;
[0084] According to the target mapping conversion rules, the source output parameter information is converted into the target output parameter information required by itself.
[0085] In an optional embodiment, the source parameter information includes the source parameter name, source parameter type and source parameter node attribute. In the process of converting the source parameter information into the target parameter information required by itself according to the target mapping conversion rule, the method may further include:
[0086] Parse the source parameter name, source parameter type and source parameter node attributes contained in the source parameter information;
[0087] According to the output parameter name conversion information, output parameter type conversion information and output parameter node attribute conversion information in the target mapping conversion rule, the source output parameter name, source output parameter type and source output parameter node attribute are converted into the target output parameter name, target output parameter type and target output parameter node attribute respectively;
[0088] According to the organizational structure of the output parameter information, the target output parameter name, target output parameter type, and target output parameter node attributes are combined to obtain the target output parameter information supported by the target API.
[0089] Figure 7 A flowchart of an API calling method provided by another exemplary embodiment of the present application. This method is described from the perspective of a mapping conversion platform, refer to Figure 7 , the method comprising:
[0090] S700, receiving a request for obtaining a target mapping conversion rule corresponding to a target API sent by an application terminal that is in communication with a mapping conversion platform;
[0091] S701, according to the received acquisition request, acquiring a target mapping conversion rule corresponding to a target API from mapping conversion rules corresponding to at least one API generated and maintained in advance;
[0092] S702, providing the target mapping conversion rule to the application end, so that the application end converts the source input parameter information required for calling the target API into the target input parameter information supported by the target API according to the target mapping conversion rule, so as to call the target API.
[0093] In this embodiment, for the mapping conversion rules corresponding to at least one API pre-generated on the mapping conversion platform, the generation process may be:
[0094] Display the API configuration interface;
[0095] In response to a mapping conversion configuration operation initiated on the API configuration interface for a first API, displaying a mapping conversion configuration interface bound to the first API, where the first API is any one of the at least one API;
[0096] In response to the parameter information configuration operation initiated on the mapping conversion configuration interface, determining at least one source input parameter information, at least one target input parameter information, at least one source output parameter information, and at least one target output parameter information corresponding to the first API;
[0097] In response to a matching operation between at least one source input parameter information and at least one target input parameter information, obtaining at least one source input parameter information and at least one target input parameter information corresponding to each matching operation; in response to a matching operation between at least one source output parameter information and at least one target output parameter information, obtaining at least one source output parameter information and at least one target output parameter information corresponding to each matching operation;
[0098] A mapping relationship is added between at least one source input parameter information and at least one target input parameter information corresponding to each matching operation, and between at least one source output parameter information and at least one target output parameter information corresponding to each matching operation, so as to obtain a mapping conversion rule corresponding to the first API.
[0099] It should be noted that the execution subject of each step of the method provided in the above embodiment can be the same device, or the method can be executed by different devices. For example, the execution subject of steps S600 to S602 can be device A; for another example, the execution subject of steps S600 and S601 can be device A, and the execution subject of step S602 can be device B; and so on.
[0100] In addition, in some of the processes described in the above embodiments and the accompanying drawings, multiple operations appearing in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this document or may be executed in parallel, and the sequence numbers of the operations, such as S600, S601, etc., are only used to distinguish between different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel.
[0101] Figure 8 A schematic diagram of the structure of an electronic device provided by another exemplary embodiment of the present application. The electronic device is a device running the application end mentioned above, such as Figure 8 As shown, the electronic device includes: a memory 80, a processor 81 and a communication component 82.
[0102] The processor 81 is coupled to the memory 80 and the communication component 82, and is used to execute one or more computer instructions in the memory 80 to:
[0103] In response to a call event for a target API, determine source input parameter information required to call the target API;
[0104] Sending a request for obtaining a target mapping conversion rule corresponding to a target API to a mapping conversion platform through a communication component 82, so that the mapping conversion platform returns a target mapping conversion rule corresponding to the target API, wherein the mapping conversion platform pre-generates and maintains a mapping conversion rule corresponding to at least one API;
[0105] According to the target mapping conversion rule corresponding to the received target API, the source input parameter information is converted into the target input parameter information supported by the target API, and a call to the target API is initiated based on the target input parameter information.
[0106] In an optional embodiment, the source code of the application end includes rule calling interface information provided by the mapping conversion platform. In the process of requesting the mapping conversion platform to send an acquisition request for the target mapping conversion rule corresponding to the target API so that the mapping conversion platform returns the target mapping conversion rule corresponding to the target API, the processor 81 is further used to:
[0107] Based on the rule calling interface information, a request for obtaining a target mapping conversion rule corresponding to a target API is sent to a rule calling interface corresponding to the rule calling interface information in a mapping conversion platform, so that the mapping conversion platform responds to the request for obtaining a target mapping conversion rule corresponding to the target API from mapping conversion rules corresponding to at least one API generated and maintained in advance;
[0108] Receive the target mapping conversion rule provided by the rule calling interface in the mapping conversion platform.
[0109] In an optional embodiment, in the process of converting the source input parameter information into the target input parameter information supported by the target API according to the received target mapping conversion rule corresponding to the target API, the processor 81 is further configured to:
[0110] In the source code of the application, find the target code segment that describes the calling logic of the target API;
[0111] Inserting the logic code of the target mapping conversion rule into a preset position associated with the logic code in the target code segment;
[0112] Run the logic code inserted at the preset position to convert the source input parameter information into the target input parameter information supported by the target API according to the target mapping conversion rules.
[0113] In an optional embodiment, the source input parameter information includes a source input parameter name, a source input parameter type, and a source input parameter node attribute. In the process of converting the source input parameter information into target input parameter information supported by the target API according to the target mapping conversion rule, the processor 81 is further used to:
[0114] Parse the source input parameter name, source input parameter type and source input parameter node attributes contained in the source input parameter information;
[0115] According to the input parameter name conversion information, input parameter type conversion information and input parameter node attribute conversion information in the target mapping conversion rule, the source input parameter name, source input parameter type and source input parameter node attribute are converted into the target input parameter name, target input parameter type and target input parameter node attribute respectively;
[0116] According to the organizational structure of the input parameter information, the target input parameter name, target input parameter type, and target input parameter node attributes are combined to obtain the target input parameter information supported by the target API.
[0117] In an optional embodiment, in the process of initiating a call to the target API according to the target input parameter information, the processor 81 is further configured to:
[0118] The target input parameter information is carried in the target API call request and sent to the target server corresponding to the target API, so that the target server responds to the target API call request and generates response information corresponding to the target input parameter information;
[0119] Receive the response information corresponding to the target input parameter information returned by the target server, which includes the source output parameter information supported by the target API;
[0120] According to the target mapping conversion rules, the source output parameter information is converted into the target output parameter information required by itself.
[0121] In an optional embodiment, the source parameter information includes the source parameter name, the source parameter type and the source parameter node attribute. In the process of converting the source parameter information into the target parameter information required by itself according to the target mapping conversion rule, the processor 81 is further used to:
[0122] Parse the source parameter name, source parameter type and source parameter node attributes contained in the source parameter information;
[0123] According to the output parameter name conversion information, output parameter type conversion information and output parameter node attribute conversion information in the target mapping conversion rule, the source output parameter name, source output parameter type and source output parameter node attribute are converted into the target output parameter name, target output parameter type and target output parameter node attribute respectively;
[0124] According to the organizational structure of the output parameter information, the target output parameter name, target output parameter type, and target output parameter node attributes are combined to obtain the target output parameter information supported by the target API.
[0125] Further, if Figure 8 As shown, the electronic device also includes other components such as a display 83 and a power supply component 84. Figure 8 Only some components are shown schematically, which does not mean that the electronic device only includes Figure 8 Components shown.
[0126] Fig. 9 A structural diagram of a mapping conversion platform provided by another exemplary embodiment of the present application is shown below. Fig. 9 As shown, the mapping conversion platform includes: a memory 90 , a processor 91 and a communication component 92 .
[0127] The processor 91 is coupled to the memory 90 and the communication component 92, and is used to execute one or more computer instructions in the memory 90 to:
[0128] Receiving, via the communication component 92, a request for obtaining a target mapping conversion rule corresponding to a target API, sent by an application terminal in communication connection with the mapping conversion platform;
[0129] According to the received acquisition request, a target mapping conversion rule corresponding to the target API is acquired from mapping conversion rules corresponding to at least one API generated and maintained in advance;
[0130] The target mapping conversion rule is provided to the application side, so that the application side can convert the source input parameter information required for calling the target API into the target input parameter information supported by the target API according to the target mapping conversion rule, so as to call the target API.
[0131] In an optional embodiment, in the process of pre-generating a mapping conversion rule corresponding to at least one API, the processor 91 is further configured to:
[0132] Display the API configuration interface;
[0133] In response to a mapping conversion configuration operation initiated on the API configuration interface for a first API, displaying a mapping conversion configuration interface bound to the first API, where the first API is any one of the at least one API;
[0134] In response to the parameter information configuration operation initiated on the mapping conversion configuration interface, determining at least one source input parameter information, at least one target input parameter information, at least one source output parameter information, and at least one target output parameter information corresponding to the first API;
[0135] In response to a matching operation between at least one source input parameter information and at least one target input parameter information, obtaining at least one source input parameter information and at least one target input parameter information corresponding to each matching operation; in response to a matching operation between at least one source output parameter information and at least one target output parameter information, obtaining at least one source output parameter information and at least one target output parameter information corresponding to each matching operation;
[0136] A mapping relationship is added between at least one source input parameter information and at least one target input parameter information corresponding to each matching operation, and between at least one source output parameter information and at least one target output parameter information corresponding to each matching operation, so as to obtain a mapping conversion rule corresponding to the first API.
[0137] Further, if Fig. 9 As shown, the mapping conversion platform also includes other components such as a display 93 and a power supply component 94. Fig. 9 Only some components are shown schematically, which does not mean that the mapping conversion platform only includes Fig. 9 Components shown.
[0138] It is worth noting that the technical details in the above-mentioned embodiments of the application side and / or the mapping conversion platform can be referred to the relevant descriptions of the actions of the application side and / or the mapping conversion platform in the aforementioned API calling method embodiments. In order to save space, they will not be repeated here, but this should not cause a loss in the scope of protection of this application.
[0139] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed, can implement the steps in the above method embodiment that can be executed by the application end and / or the mapping conversion platform.
[0140] Above Figure 8-9 The memory in the computer is used to store computer programs and can be configured to store various other data to support operations on the computing platform. Examples of such data include instructions for any application or method operating on the computing platform, contact data, phone book data, messages, pictures, videos, etc. The memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0141] Above Figure 8-9The communication component in is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0142] Above Figure 8-9 The display in the embodiment includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
[0143] Above Figure 8-9 The power supply component in the device provides power to various components of the device where the power supply component is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device where the power supply component is located.
[0144] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0145] The present application is described 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 application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0146] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0147] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0148] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0149] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0150] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0151] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0152] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. An API calling system, characterized in that: include: An application end, and a mapping conversion platform and at least one server end in communication with the application end, wherein the at least one server end is used to provide an API, and the number of the application end is one or more; The application end is used to respond to a call event for a target API and determine source input parameter information required to call the target API; Sending a request to the mapping conversion platform for obtaining the target mapping conversion rule corresponding to the target API, converting the source input parameter information into the target input parameter information supported by the target API according to the received target mapping conversion rule corresponding to the target API, and requesting the target server to call the target API according to the target input parameter information; The mapping conversion platform is used to pre-generate and maintain mapping conversion rules corresponding to at least one API; respond to a request for obtaining a target mapping conversion rule corresponding to the target API sent by the application end, obtain the target mapping conversion rule corresponding to the target API from the mapping conversion rules corresponding to the at least one API, and return the target mapping conversion rule to the application end; The target server is used to receive the target input parameter information sent by the application, and respond to the application's call to the target API based on the target input parameter information; wherein the target server is a server that provides the target API.
2. The system according to claim 1, characterized in that Also includes: The application end is also used to receive response information corresponding to the target input parameter information returned by the target server end, and the response information includes source output parameter information supported by the target API; according to the target mapping conversion rule, the source output parameter information is converted into the target output parameter information required by itself.
3. An API calling method, characterized in that: Applicable to an application end, the application end is communicatively connected with a mapping conversion platform, and the method includes: In response to a call event for a target API, determining source input parameter information required to call the target API; Sending a request for obtaining a target mapping conversion rule corresponding to the target API to the mapping conversion platform, so that the mapping conversion platform returns the target mapping conversion rule corresponding to the target API, wherein the mapping conversion platform pre-generates and maintains a mapping conversion rule corresponding to at least one API; According to the received target mapping conversion rule corresponding to the target API, the source input parameter information is converted into the target input parameter information supported by the target API, and a call to the target API is initiated according to the target input parameter information.
4. The method according to claim 3, characterized in that The source code of the application end includes rule calling interface information provided by the mapping conversion platform, and the acquisition request for the target mapping conversion rule corresponding to the target API is sent to the mapping conversion platform so that the mapping conversion platform returns the target mapping conversion rule corresponding to the target API, including: Based on the rule calling interface information, a request for obtaining a target mapping conversion rule corresponding to the target API is sent to a rule calling interface corresponding to the rule calling interface information in the mapping conversion platform, so that the mapping conversion platform responds to the acquisition request and obtains the target mapping conversion rule corresponding to the target API from the mapping conversion rules corresponding to at least one API generated and maintained in advance; Receive the target mapping conversion rule provided by the rule calling interface in the mapping conversion platform.
5. The method according to claim 3, characterized in that: The converting the source input parameter information into target input parameter information supported by the target API according to the received target mapping conversion rule corresponding to the target API includes: In the source code of the application end, searching for a target code segment for describing the calling logic of the target API; Inserting the logic code of the target mapping conversion rule into a preset position associated with the logic code in the target code segment; The logic code inserted at the preset position is run to convert the source input parameter information into target input parameter information supported by the target API according to the target mapping conversion rule.
6. The method according to claim 5, characterized in that The source input parameter information includes a source input parameter name, a source input parameter type, and a source input parameter node attribute. Converting the source input parameter information into target input parameter information supported by the target API according to the target mapping conversion rule includes: Parsing the source input parameter name, source input parameter type and source input parameter node attributes contained in the source input parameter information; According to the input parameter name conversion information, input parameter type conversion information and input parameter node attribute conversion information in the target mapping conversion rule, the source input parameter name, source input parameter type and source input parameter node attribute are converted into the target input parameter name, target input parameter type and target input parameter node attribute respectively; According to the organizational structure of the input parameter information, the target input parameter name, the target input parameter type and the target input parameter node attribute are combined to obtain the target input parameter information supported by the target API.
7. The method according to any one of claims 3 to 6, characterized in that: Initiating a call to the target API according to the target input parameter information, including: The target input parameter information is carried in the target API call request and sent to the target server corresponding to the target API, so that the target server responds to the target API call request and generates response information corresponding to the target input parameter information; Receive response information corresponding to the target input parameter information returned by the target server, wherein the response information includes source output parameter information supported by the target API; According to the target mapping conversion rule, the source output parameter information is converted into the target output parameter information required by itself.
8. The method according to claim 7, characterized in that The source parameter information includes the source parameter name, source parameter type and source parameter node attribute. According to the target mapping conversion rule, the source parameter information is converted into the target parameter information required by itself, including: Parsing the source parameter name, source parameter type and source parameter node attribute contained in the source parameter information; According to the output parameter name conversion information, output parameter type conversion information and output parameter node attribute conversion information in the target mapping conversion rule, the source output parameter name, source output parameter type and source output parameter node attribute are converted into the target output parameter name, target output parameter type and target output parameter node attribute respectively; According to the organizational structure of the output parameter information, the target output parameter name, the target output parameter type and the target output parameter node attribute are combined to obtain the target output parameter information supported by the target API.
9. An API calling method, characterized in that: Applicable to a mapping conversion platform, the method includes: Receiving a request for obtaining a target mapping conversion rule corresponding to a target API sent by an application terminal that is in communication with the mapping conversion platform; According to the acquisition request, acquiring a target mapping conversion rule corresponding to the target API from mapping conversion rules corresponding to at least one API generated and maintained in advance; The target mapping conversion rule is provided to the application end, so that the application end converts the source input parameter information required for calling the target API into the target input parameter information supported by the target API according to the target mapping conversion rule, so as to call the target API.
10. The method according to claim 9, characterized in that Generate at least one mapping conversion rule corresponding to each API in advance, including: Display the API configuration interface; In response to a mapping conversion configuration operation initiated on the API configuration interface for a first API, displaying a mapping conversion configuration interface bound to the first API, where the first API is any one of the at least one API; In response to the parameter information configuration operation initiated on the mapping conversion configuration interface, determining at least one source input parameter information, at least one target input parameter information, at least one source output parameter information, and at least one target output parameter information corresponding to the first API; In response to a matching operation between the at least one source input parameter information and the at least one target input parameter information, obtaining at least one source input parameter information and at least one target input parameter information corresponding to each matching operation; in response to a matching operation between the at least one source output parameter information and the at least one target output parameter information, obtaining at least one source output parameter information and at least one target output parameter information corresponding to each matching operation; A mapping relationship is added between at least one source input parameter information and at least one target input parameter information corresponding to each matching operation, and between at least one source output parameter information and at least one target output parameter information corresponding to each matching operation, so as to obtain a mapping conversion rule corresponding to the first API.
11. An electronic device, characterized in that: Includes memory, processor, and communication components; The memory is used to store one or more computer instructions; The processor is coupled to the memory and the communication component and is configured to execute the one or more computer instructions for: In response to a call event for a target API, determining source input parameter information required to call the target API; Sending, through the communication component, a request for obtaining a target mapping conversion rule corresponding to the target API to a mapping conversion platform that is communicatively connected to the electronic device, wherein the mapping conversion platform pre-generates and maintains a mapping conversion rule corresponding to at least one API; According to the received target mapping conversion rule corresponding to the target API, the source input parameter information is converted into the target input parameter information supported by the target API, and a call to the target API is initiated according to the target input parameter information.
12. A mapping conversion platform, characterized in that: Includes memory, processor, and communication components; Receiving, through the communication component, a request for obtaining a target mapping conversion rule corresponding to a target API, sent by an application terminal that is in communication connection with the mapping conversion platform; According to the acquisition request, acquiring a target mapping conversion rule corresponding to the target API from mapping conversion rules corresponding to at least one API generated and maintained in advance; The target mapping conversion rule is provided to the application end, so that the application end converts the source input parameter information required for calling the target API into the target input parameter information supported by the target API according to the target mapping conversion rule, so as to call the target API.
13. A computer-readable storage medium storing computer instructions, characterized in that: When the computer instructions are executed by one or more processors, the one or more processors are caused to execute the API calling method described in any one of claims 3-10.
