API processing method and device, computer equipment, storage medium and program product
By using the reflection API mechanism to scan and generate the API of the target application, the problem of lack of standardized management and manual writing of documents in the existing API processing methods is solved, and the automatic generation and efficient management of API documents is realized, and the efficiency and accuracy of API processing is improved.
Patent Information
- Application Number
- CN202510136147.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-07
- Publication Date
- 2025-06-10
AI Technical Summary
The existing API processing methods lack a standardized management platform, which leads to developers need to manually register and manage APIs, resulting in duplication and redundant work; at the same time, API documents need to be written manually, which are prone to errors and untimely updates.
Provide an API processing method, using the reflection API mechanism to scan the target application's API, generate API documents, and feed the documents back to the developer for confirmation, realizing automatic generation and efficient management of API documents.
By introducing the reflection API mechanism, the automatic generation of API documents is realized, which reduces manual writing errors and redundancy, and improves the efficiency and accuracy of API processing.
Smart Images

Figure CN120122977A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to an API processing method, apparatus, computer device, storage medium, and program product. Background Art
[0002] With the rapid development of the Internet, the API (Application Programming Interface) is a standard means for data exchange and information sharing between various application programs.
[0003] However, there are still some problems in the current API processing methods. For example, there is no standard API management platform, and developers often need to manually register and manage APIs on different platforms, resulting in duplicate and redundant work, wasting time and energy; furthermore, currently, API documentation needs to be manually written, which is not only prone to errors but also has problems such as untimely updates. Summary of the Invention
[0004] Based on this, in view of the above technical problems, it is necessary to provide an API processing method, apparatus, computer device, storage medium, and program product that can achieve efficient API processing.
[0005] In a first aspect, this application provides an API processing method, which includes:
[0006] In response to the upload operation of the target application program of the API developer, scan the target API of the target application program based on the reflection API mechanism;
[0007] Generate the target API documentation of the target application program based on the scan result of the target API of the target application program;
[0008] Feed back the target API documentation of the target application program to the API developer for confirmation.
[0009] In one embodiment, scanning the target API of the target application program based on the reflection API mechanism includes:
[0010] Determine the target scan range according to the API information of the target application program; scan the code within the target scan range in the target application program based on the reflection API mechanism; wherein, the code within the target scan range includes the code of the target API.
[0011] In one embodiment, it includes:
[0012] In response to an API search request from an API requester, select a recommended API from candidate APIs; wherein, the API search request includes an API search keyword; display the function description information of the recommended API to the API requester.
[0013] In one embodiment, it includes:
[0014] In response to a management operation of any subscribed API by an API requester, manage the subscribed API; wherein, the management operation includes unsubscribing or modifying the subscription settings.
[0015] In one embodiment, it includes:
[0016] When it is detected that any subscribed API of the API requester has changed, push a message change reminder of the subscribed API to the API requester.
[0017] In one embodiment, it includes:
[0018] When the current time meets the API push time of the API requester, based on the function description information of the latest API in the API management platform, the function description information of the subscribed APIs corresponding to the API requester, and the function description information of the APIs that the API requester has unsubscribed from, perform personalized push to the API requester.
[0019] In a second aspect, the present application also provides an API processing device, and the device includes:
[0020] An interface scanning module, configured to, in response to an upload operation of a target application of an API developer, scan the target API of the target application based on the reflection API mechanism;
[0021] A document generation module, configured to generate a target API document of the target application based on the scanning result of the target API of the target application;
[0022] A document feedback module, configured to feedback the target API document of the target application to the API developer for confirmation.
[0023] In a third aspect, the present application also provides a computer device, including a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0024] In response to an upload operation of a target application of an API developer, scan the target API of the target application based on the reflection API mechanism;
[0025] Generate a target API document of the target application based on the scanning result of the target API of the target application;
[0026] Feedback the target API document of the target application to the API developer for confirmation.
[0027] Fourthly, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0028] In response to the upload operation of the target application of the API developer, scan the target API of the target application based on the reflection API mechanism;
[0029] Generate a target API document of the target application based on the scan result of the target API of the target application;
[0030] Feedback the target API document of the target application to the API developer for confirmation.
[0031] Fifthly, the present application also provides a computer program product, including a computer program. When the computer program is executed by a processor, the following steps are implemented:
[0032] In response to the upload operation of the target application of the API developer, scan the target API of the target application based on the reflection API mechanism;
[0033] Generate a target API document of the target application based on the scan result of the target API of the target application;
[0034] Feedback the target API document of the target application to the API developer for confirmation.
[0035] The above API processing method, device, computer device, storage medium and program product scan the target API interface of the target application based on the reflection API mechanism in response to the upload operation of the target application of the API developer, providing a data basis for the automatic generation of the target API document; further, a target API document of the target application can be generated based on the scan result of the target API interface of the target application, realizing the automatic generation of the target API document; finally, the target API document of the target application is feedback to the API developer for confirmation. This solution provides an implementation approach for automatically generating the target API document by introducing the reflection API mechanism; moreover, by feedbacking the target API document to the API developer for confirmation, the accuracy of the target API document is further ensured, realizing the high efficiency of API processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] To more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the accompanying drawings required for the description of the embodiments or related technologies. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0037] Figure 1 It is an application environment diagram of an API processing method provided in an embodiment of the present application;
[0038] Figure 2 It is a schematic flowchart of an API processing provided in an embodiment of the present application;
[0039] Figure 3 It is a schematic flowchart of scanning a target API provided in an embodiment of the present application;
[0040] Figure 4 It is a structural block diagram of an API processing device provided in an embodiment of the present application;
[0041] Figure 5 It is an internal structure diagram of a computer device provided in an embodiment of the present application. Specific embodiments
[0042] In order to make the objectives, technical solutions and advantages of the present application more clear and understandable, the following further details the present application in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0043] The API processing method provided in the embodiments of the present application can be applied to, for example Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or can be placed on the cloud or other network servers. The API developer uploads the target application to the application programming interface API management platform through the terminal 102; furthermore, the server 104 can scan the target API of the target application based on the reflection API mechanism, and generate the target API document of the target application based on the scanning result of the target API of the target application. Further, the target API document of the target application is fed back to the API developer for confirmation, that is, the server 104 responds to the upload operation of the target application of the API developer. Among them, the terminal 102 can be but is not limited to various personal computers, laptop computers, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart vehicle-mounted devices, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0044] In an exemplary embodiment, as Figure 2 shown, a method for processing an API is provided. This method is applied to the application programming interface API management platform. Taking the server 104 in Figure 1 as an example for description, it may include the following steps:
[0045] S201, in response to the upload operation of the target application of the API developer, scan the target API of the target application based on the reflection API mechanism.
[0046] Among them, the reflection API mechanism can obtain and operate on the structure of the code, such as classes, methods, attributes, etc.; the target API is the way for other software systems or applications to access the services in the target application in the target application, which defines the communication method between software components, and how the application requests and receives data, etc.
[0047] It should be noted that the target API can implement the process of interaction and data exchange between the target application and other applications; optionally, it is possible to implement the access of other applications to the services of the target application without knowing the specific implementation details inside the target application.
[0048] Exemplarily, the API developer can upload the target application of the API developer in the API management platform through the terminal 102, and send an upload request including the target application of the API developer to the server 104 by clicking the upload button; furthermore, after receiving the upload request, the server 104 scans the target APIs in the upload request based on the reflection API to extract information such as the request methods, parameters, and return values of each target API.
[0049] S202, generate a target API document for the target application based on the scanning results of the target APIs of the target application.
[0050] It should be noted that the target API document describes how to use and integrate the target API, that is, the target API document can be a technical content delivery document of the target API, which can help the API developer understand how to use, operate, and integrate a certain software library, framework, or system, including all relevant information of the target API, such as functions, classes, parameters, and return types.
[0051] Exemplarily, information such as the name, version number, target API document creation date, API endpoints, detailed descriptions of the request parameters for each API endpoint, response formats for each API endpoint, and error handling of the target API can be determined based on the scanning results of the target APIs of the target application; furthermore, a target API document for the target application can be generated based on the information such as the name, version number, target API document creation date, API endpoints, detailed descriptions of the request parameters for each API endpoint, response formats for each API endpoint, and error handling of the target API.
[0052] S203, feedback the target API document of the target application to the API developer for confirmation.
[0053] Exemplarily, the target API document of the target application can be fed back to the API developer in an online browsing manner through the terminal 102 for the API developer to confirm the target API document; optionally, an API document download function can also be provided to the API developer through the terminal 102.
[0054] The above API processing method scans the target API interfaces of the target application based on the reflection API mechanism in response to the upload operation of the target application by the API developer, providing a data basis for the automatic generation of the target API document. Further, the target API document of the target application can be generated based on the scanning results of the target API interfaces of the target application, realizing the automatic generation of the target API document. Finally, the target API document of the target application is fed back to the API developer for confirmation. This solution provides an implementation approach for automatically generating the target API document by introducing the reflection API mechanism. Moreover, by feeding back the target API document to the API developer for confirmation, the accuracy of the target API document is further ensured, realizing the high efficiency of API processing.
[0055] Based on the above embodiments, the embodiments of the present application will explain the above embodiment S201 in detail. Specifically, in the embodiments of the present application, the process of scanning the target API is involved, as Figure 3 shown, which specifically includes the following steps:
[0056] S301. Determine the target scanning range according to the API information of the target application.
[0057] Among them, the API information may include but is not limited to API endpoints, API endpoint-related annotations, and classes including API endpoint-related annotations, etc.; the target scanning range may represent the code range including all API endpoints of the target application; optionally, the target scanning range includes information such as all API endpoints of the target application, request parameters required by all API endpoints, and response formats corresponding to all API endpoints.
[0058] Exemplarily, the target scanning range of the target application can be determined according to API information such as all API endpoints to be scanned in the target application, request parameters required by each API endpoint, expected response formats and status codes of each API endpoint, such as the package name, class name, or method name to be scanned for the target application.
[0059] S302. Scan the code within the target scanning range in the target application based on the reflection API mechanism.
[0060] Among them, the code within the target scanning range includes the code of the target API.
[0061] Exemplarily, based on the reflection API mechanism, the code within the target scan range in the target application (such as structures like classes, methods, and fields in the target application) can be inspected and analyzed; for example, the code within the target scan range in the target application can be loaded, and reflection APIs (such as Class.getDeclaredMethods(), Class.getDeclaredFields(), and Class.getDeclaredConstructors()) can be used for traversal to achieve the scanning of the code within the target scan range in the target application.
[0062] In the embodiments of the present application, by introducing the reflection API mechanism, a solution is provided for realizing the automatic generation of API documents, laying a foundation for the convenient processing of APIs.
[0063] Based on the above embodiments, the process of responding to the API search by the API requester in the embodiments of the present application specifically includes:
[0064] In response to the API search request from the API requester, select a recommended API from the candidate APIs; display the function description information of the recommended API to the API requester.
[0065] Among them, the API search request may include but is not limited to API search keywords; optionally, the API search keywords may be keywords, tags, categories, filtering requirements, sorting requirements, etc.; the function description information may include but is not limited to information such as API type, API application scenario, API function, API technical specifications, and API version.
[0066] Exemplarily, the API requester can search for the APIs of interest through the search bar in the API management platform; furthermore, when the API requester enters the API search keywords in the search bar and clicks the search button, the terminal 102 sends an API search request to the server 104; further, after receiving the API search request, the server 104 can extract the API search keywords in the API search request. And based on the extracted API search keywords, select a recommended API that matches the API search keywords from the candidate APIs; finally, display the function description information of the recommended API to the API requester through the terminal 102 for the API requester to browse.
[0067] In the embodiments of the present application, by providing the API search function, a foundation is laid for realizing the efficiency of API processing and the convenience of API interaction.
[0068] Based on the above embodiments, the process of responding to the API requester's management and subscription of APIs in the embodiments of the present application specifically includes:
[0069] Manage the subscribed APIs in response to the management operations of any subscribed API by the API requester.
[0070] Among them, the management operations may include, but are not limited to, unsubscribing or modifying the subscription settings; optionally, the subscription settings may include, but are not limited to, message reminder methods and degrees of attention (high attention, general attention, and low attention), etc.
[0071] Exemplarily, the API requester can unsubscribe from any subscribed API, and further, the corresponding relationship between the API requester and the subscribed API can be cancelled, that is, the subscribed API is deleted from the subscription list of the API requester, and the API requester is deleted from the subscriber list of the subscribed API; furthermore, the API requester can also modify the subscription settings of any subscribed API, that is, the API requester can modify the message reminder method of any subscribed API, such as it can be modified to any one of receiving and reminding, only receiving without reminding, and not receiving and not reminding, and can also modify the degree of attention of any subscribed API, such as it can be modified to any one of high attention (the corresponding subscribed API can be pinned), general attention, and low attention (the corresponding subscribed API can be placed in the hidden folder).
[0072] Further, when it is detected that any subscribed API of the API requester has changed, a message change reminder of the subscribed API is pushed to the API requester.
[0073] Exemplarily, when it is detected that any subscribed API of the API requester has changed, such as the version of a certain subscribed API is updated and the latest API version is released; further, according to the subscription settings corresponding to the subscribed API, a message change reminder is sent to the API requester to ensure that the API requester can timely understand the changes of the subscribed API and keep the latest status when using the subscribed API.
[0074] Optionally, the method of sending the message change reminder can be through email, text message or other channels to send a timely update notice and reminder of the subscribed API to the API requester, in case the API requester misses important changes and improves the development efficiency.
[0075] In the embodiments of the present application, by introducing the management function of the subscribed API, a solution is provided for improving the management of the API.
[0076] Based on the above embodiments, the process of pushing APIs to the API requester in the embodiments of the present application specifically includes:
[0077] When the API push time of the API requester is met at the current time, personalized push is performed on the API requester based on the function description information of the latest API in the API management platform, the function description information of the subscribed APIs corresponding to the API requester, and the function description information of the APIs that the API requester has unsubscribed from.
[0078] Among them, the API push time can be set in advance and can be personalized according to information such as the frequency of the API requester logging in to the API management platform; the latest API can represent the API with the most views in the API management platform, or can represent the API that was newly uploaded on the API management platform, that is, the latest API can represent the API that is newly concerned by the API requester in the API management platform.
[0079] Exemplarily, if the API push time is the time interval for pushing APIs, when the time interval from the current time to the last time of performing API personalized push on the API requester meets the API push time, directly obtain the latest API in the API management platform at the current time, and select the API to be pushed to the API requester from the candidate APIs based on the function description information of the latest API, the function description information of the subscribed APIs corresponding to the API requester, and the function description information of the APIs that the API requester has unsubscribed from; optionally, the importance of the latest API, the subscribed APIs corresponding to the API requester, and the APIs that the API requester has unsubscribed from can be sorted according to a recommendation algorithm, and the API to be pushed to the API requester is determined from the candidate APIs. If the API push time is a fixed time node, such as 8:00 am every day, then when the current time meets the API push time of the API requester, personalized push is performed on the API requester based on the function description information of the latest API in the API management platform, the function description information of the subscribed APIs corresponding to the API requester, and the function description information of the APIs that the API requester has unsubscribed from.
[0080] In the embodiments of the present application, by introducing API personalized push, the activities of the API requester in the API management platform are enriched, the adhesion between the API requester and the API management platform is enhanced, and a foundation is laid for ultimately realizing the efficient processing of APIs.
[0081] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, there is no strict order limit for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0082] Based on the same inventive concept, an embodiment of the present application also provides an API processing device for implementing the above-mentioned API processing method. The solution provided by this device for solving problems is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the API processing device provided below can refer to the limitations on the API processing method in the above text, and will not be repeated here.
[0083] In an exemplary embodiment, as Figure 4 shown, an API processing device 1 is provided, including: an interface scanning module 10, a document generation module 20, and a document feedback module 30, where:
[0084] The interface scanning module 10 is configured to, in response to an upload operation of a target application program of an API developer, scan the target API of the target application program based on the reflection API mechanism.
[0085] The document generation module 20 is configured to generate a target API document of the target application program based on the scanning result of the target API of the target application program.
[0086] The document feedback module 30 is configured to feedback the target API document of the target application program to the API developer for confirmation.
[0087] In an embodiment, the interface scanning module 10 is specifically configured to:
[0088] Determine a target scanning range according to the API information of the target application program; scan the code within the target scanning range in the target application program based on the reflection API mechanism; where the code within the target scanning range includes the code of the target API.
[0089] In an embodiment, the API processing device 1 specifically further includes:
[0090] An API search module, configured to select a recommended API from candidate APIs in response to an API search request from an API requester; wherein, the API search request includes an API search keyword; and display function description information of the recommended API to the API requester.
[0091] In one embodiment, the API processing device 1 further specifically includes:
[0092] A subscribed API management module, configured to manage a subscribed API in response to a management operation of an API requester on any subscribed API; wherein, the management operation includes unsubscribing or modifying subscription settings.
[0093] In one embodiment, the subscribed API management module further specifically is configured to:
[0094] When detecting that any subscribed API of the API requester has changed, push a message change reminder of the subscribed API to the API requester.
[0095] In one embodiment, the API processing device 1 further specifically includes:
[0096] An API push module, configured to perform personalized push to the API requester based on function description information of the latest API in the API management platform, function description information of the subscribed APIs corresponding to the API requester, and function description information of the APIs that the API requester has unsubscribed from, when the current time meets the API push time of the API requester.
[0097] Each module in the above API processing device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor in the computer device in hardware form or be independent of it, or be stored in the memory in the computer device in software form, so as to be called by the processor to execute the operations corresponding to the above respective modules.
[0098] In an exemplary embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 5As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store API data. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. The computer program, when executed by the processor, implements an API processing method.
[0099] Those skilled in the art can understand that Figure 5 the structure shown in is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0100] In an exemplary embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented:
[0101] In response to the upload operation of the target application of the API developer, based on the reflection API mechanism, scan the target API of the target application;
[0102] Based on the scan result of the target API of the target application, generate the target API document of the target application;
[0103] Feed back the target API document of the target application to the API developer for confirmation.
[0104] In an embodiment, when the processor executes the computer program, the following steps are also implemented:
[0105] According to the API information of the target application, determine the target scan range; based on the reflection API mechanism, scan the code within the target scan range in the target application; where the code within the target scan range includes the code of the target API.
[0106] In an embodiment, when the processor executes the computer program, the following steps are also implemented:
[0107] In response to an API search request from an API requester, select a recommended API from candidate APIs; wherein, the API search request includes an API search keyword; and display the function description information of the recommended API to the API requester.
[0108] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0109] In response to a management operation of any subscribed API by the API requester, manage the subscribed API; wherein, the management operation includes unsubscribing or modifying the subscription settings.
[0110] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0111] When it is detected that any subscribed API of the API requester has changed, push a message change reminder of the subscribed API to the API requester.
[0112] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0113] When the current time meets the API push time of the API requester, based on the function description information of the latest API in the API management platform, the function description information of the subscribed APIs corresponding to the API requester, and the function description information of the APIs that the API requester has unsubscribed from, perform personalized push to the API requester.
[0114] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0115] In response to an upload operation of a target application program by an API developer, based on the reflection API mechanism, scan the target APIs of the target application program;
[0116] Based on the scan results of the target APIs of the target application program, generate a target API document for the target application program;
[0117] Feed back the target API document of the target application program to the API developer for confirmation.
[0118] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0119] According to the API information of the target application program, determine the target scan range; based on the reflection API mechanism, scan the code within the target scan range in the target application program; wherein, the code within the target scan range includes the code of the target APIs.
[0120] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0121] In response to an API search request from an API requester, select a recommended API from candidate APIs; wherein, the API search request includes API search keywords; display function description information of the recommended API to the API requester.
[0122] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0123] In response to a management operation on any subscribed API by an API requester, manage the subscribed API; wherein, the management operation includes unsubscribing or modifying subscription settings.
[0124] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0125] When it is detected that any subscribed API of the API requester has changed, push a message change reminder of the subscribed API to the API requester.
[0126] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0127] When the current time meets the API push time of the API requester, based on the function description information of the latest API in the API management platform, the function description information of the subscribed APIs corresponding to the API requester, and the function description information of the APIs that the API requester has unsubscribed from, perform personalized push to the API requester.
[0128] In one embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0129] In response to an upload operation of a target application program by an API developer, scan the target API of the target application program based on the reflection API mechanism;
[0130] Generate a target API document of the target application program based on the scan result of the target API of the target application program;
[0131] Feed back the target API document of the target application program to the API developer for confirmation.
[0132] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0133] Determine the target scanning range according to the API information of the target application; scan the code within the target scanning range in the target application based on the reflection API mechanism; wherein, the code within the target scanning range includes the code of the target API.
[0134] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0135] In response to an API search request from an API requester, select a recommended API from candidate APIs; wherein, the API search request includes an API search keyword; display the function description information of the recommended API to the API requester.
[0136] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0137] In response to a management operation of any subscribed API by an API requester, manage the subscribed API; wherein, the management operation includes unsubscribing or modifying the subscription settings.
[0138] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0139] When it is detected that any subscribed API of the API requester has changed, push a message change reminder of the subscribed API to the API requester.
[0140] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0141] When the current time meets the API push time of the API requester, perform personalized push to the API requester based on the function description information of the latest API in the API management platform, the function description information of the subscribed APIs corresponding to the API requester, and the function description information of the APIs that the API requester has unsubscribed.
[0142] It should be noted that the information (including but not limited to API developer information, API requester information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data that have been fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.
[0143] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0144] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0145] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. An API processing method, characterized in that: Applied to an application programming interface (API) management platform, the method includes: In response to an upload operation of a target application by an API developer, scanning a target API of the target application based on a reflection API mechanism; Generate a target API document of the target application based on the scanning result of the target API of the target application; The target API document of the target application is fed back to the API developer for confirmation.
2. The method according to claim 1, characterized in that The scanning of the target API of the target application based on the reflection API mechanism includes: Determine a target scanning range according to the API information of the target application; Based on the reflection API mechanism, the code within the target scanning range in the target application is scanned; wherein the code within the target scanning range includes the code of the target API.
3. The method according to claim 1, characterized in that The method further comprises: In response to an API search request from an API demander, selecting a recommended API from candidate APIs; wherein the API search request includes an API search keyword; The function description information of the recommended API is displayed to the API demander.
4. The method according to claim 3, characterized in that The method further comprises: In response to the management operation of the API demander on any subscription API, the subscription API is managed; wherein the management operation includes canceling a subscription or modifying subscription settings.
5. The method according to claim 4, characterized in that The method further comprises: When a change is detected in any subscription API of the API demander, a message reminder of the subscription API change is pushed to the API demander.
6. The method according to claim 3, characterized in that The method further comprises: When the current time meets the API push time of the API demander, personalized push is performed to the API demander based on the function description information of the latest API in the API management platform, the function description information of the subscribed API corresponding to the API demander, and the function description information of the API that the API demander has unsubscribed from.
7. An API processing device, characterized in that: The device comprises: An interface scanning module, configured to respond to an upload operation of a target application by an API developer and scan a target API of the target application based on a reflection API mechanism; A document generation module, used for generating a target API document of the target application based on the scanning result of the target API of the target application; The document feedback module is used to feed back the target API document of the target application to the API developer for confirmation.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.