CN112131022B - Open API management method, device, system and computer readable storage medium - Google Patents

Open API management method, device, system and computer readable storage medium Download PDF

Info

Publication number
CN112131022B
CN112131022B CN202011006713.0A CN202011006713A CN112131022B CN 112131022 B CN112131022 B CN 112131022B CN 202011006713 A CN202011006713 A CN 202011006713A CN 112131022 B CN112131022 B CN 112131022B
Authority
CN
China
Prior art keywords
information
api
open
open interface
interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011006713.0A
Other languages
Chinese (zh)
Other versions
CN112131022A (en
Inventor
马会明
张惠丽
张咏雪
李慧玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen ZNV Technology Co Ltd
Nanjing ZNV Software Co Ltd
Original Assignee
Shenzhen ZNV Technology Co Ltd
Nanjing ZNV Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen ZNV Technology Co Ltd, Nanjing ZNV Software Co Ltd filed Critical Shenzhen ZNV Technology Co Ltd
Priority to CN202011006713.0A priority Critical patent/CN112131022B/en
Publication of CN112131022A publication Critical patent/CN112131022A/en
Application granted granted Critical
Publication of CN112131022B publication Critical patent/CN112131022B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses an open API management method, which comprises the following steps: acquiring API information of an open interface, and determining return information of the open interface based on the API information; determining registration information of the open interface based on the API information and the return information, and registering the open interface based on the registration information; and storing the registration information into a storage medium corresponding to the open interface. The invention also discloses an open API management device, a system and a computer readable storage medium. The invention determines the registration information corresponding to the open interface by acquiring the API information and the return information of the open interface, and stores the registration information in the storage medium of the system so as to finish the registration flow of the open interface in batches, thereby realizing the efficient registration and maintenance of the open interface and further achieving the purpose of efficiently managing the API.

Description

Open API management method, device, system and computer readable storage medium
Technical Field
The present invention relates to the field of open management of internet interfaces, and in particular, to an open API management method, apparatus, system, and computer readable storage medium.
Background
The API (Application Programming Interface ) is a convention for the joining of the different components of the software system. The open API refers to an open application programming interface, mutual communication between computer software can be realized through the open API, and manufacturers need to manage, count, limit current, authenticate and the like the open API, and register and release the open API in an open platform to open the outside. With the increasing demands for knowledge sharing and efficient development, the number of open API manufacturers and open APIs is also increasing sharply, and the call management and maintenance amounts of APIs are also increasing sharply with rapid iteration and change of services. Therefore, how to manage the open API becomes a major research direction for each large manufacturer. However, the open API management method in the prior art is difficult to adapt to the rapidly growing demands of APIs in the economic age of sharing.
Currently, open APIs are typically managed by a manual manner, which requires a technician to enter API information one by one. However, under normal conditions, the number of open APIs is large, the APIs are managed manually, the workload is large, the time consumption is long, and the APIs cannot be in effect in time after being updated, so that the timeliness is poor; moreover, the API parameters are complex, and the problems of parameter omission, type disorder and the like are easy to occur by manually inputting a large number of input and output parameters, so that the accuracy is low; this management method requires technicians to understand the code, and requires high technical demands on open API maintainers.
Disclosure of Invention
The invention mainly aims to provide an open API management method, device, system and computer readable storage medium, aiming at efficiently registering and maintaining an open interface so as to achieve the purpose of efficiently managing APIs.
In order to achieve the above object, the present invention provides an open API management method, including the steps of:
acquiring API information of an open interface, and determining return information of the open interface based on the API information;
Determining registration information of the open interface based on the API information and the return information, and registering the open interface based on the registration information;
and storing the registration information into a storage medium corresponding to the open interface.
Preferably, the step of determining return information of the open interface based on the API information includes:
Preprocessing the API information to obtain an API list corresponding to the API information, and displaying the API list on a display interface;
Detecting whether edit content input based on the API list is received;
if yes, updating the API information corresponding to the open interface based on the editing content and the API list;
and calling the open interface based on the updated API information to obtain the return information corresponding to the open interface.
Preferably, the step of preprocessing the API information to obtain an API list corresponding to the API information includes:
and determining the interface name of each open interface, and extracting and integrating the API information based on the interface name to obtain an API list corresponding to the API information.
Preferably, the step of calling the open interface to obtain the return information corresponding to the open interface based on the updated API information includes:
calling each open interface based on the updated API information to determine a response result corresponding to each open interface;
Formatting the response result to obtain a formatted result, and receiving prompt information input for the formatted result;
and determining the return information of the open interface based on the formatting result and the prompt information.
Preferably, the step of saving the registration information in a storage medium corresponding to the open interface includes:
Classifying the registration information based on a preset classification rule to obtain classification information corresponding to the open interfaces, and determining whether each open interface is registered;
If yes, determining a registration mechanism of the open interface as an updating mechanism, and storing the classification information into a storage medium corresponding to the open interface, wherein the updating mechanism is used for updating the registration information stored in the storage medium of the open interface based on the classification information;
If not, determining that the registration mechanism of the open interface is an insertion mechanism, and storing the classification information into a storage medium corresponding to the open interface, wherein the insertion mechanism refers to inserting the classification information into the storage medium of the open interface.
Preferably, after the step of saving the registration information in the storage medium corresponding to the open interface, the open API management method further includes:
Monitoring whether the API information of the open interface is changed or not;
if yes, determining a changed target interface, and determining target interface information corresponding to the target interface;
and registering the target interface based on the target interface information, and updating registration information stored in a storage medium of the target interface.
Preferably, before the step of obtaining the API information of the open interface and determining the return information of the open interface based on the API information, the open API management method further includes:
receiving basic configuration information of the open interface and description information corresponding to the basic configuration information, and determining error return information defined for the open interface;
And determining API information of the open interface based on the basic configuration information, the description information and the error return information.
In addition, in order to achieve the above object, the present invention also provides an open API management apparatus comprising:
the information determining module is used for acquiring the API information of the open interface and determining the return information of the open interface based on the API information;
The determining and registering module is used for determining the registering information of the open interface based on the API information and the return information and registering the open interface based on the registering information;
and the registration storage module is used for storing the registration information into a storage medium corresponding to the open interface.
Preferably, the information determining module is further configured to:
Preprocessing the API information to obtain an API list corresponding to the API information, and displaying the API list on a display interface;
Detecting whether edit content input based on the API list is received;
if yes, updating the API information corresponding to the open interface based on the editing content and the API list;
and calling the open interface based on the updated API information to obtain the return information corresponding to the open interface.
Preferably, the information determining module is further configured to:
and determining the interface name of each open interface, and extracting and integrating the API information based on the interface name to obtain an API list corresponding to the API information.
Preferably, the information determining module is further configured to:
calling each open interface based on the updated API information to determine a response result corresponding to each open interface;
Formatting the response result to obtain a formatted result, and receiving prompt information input for the formatted result;
and determining the return information of the open interface based on the formatting result and the prompt information.
Preferably, the registration keeping module is further configured to:
Classifying the registration information based on a preset classification rule to obtain classification information corresponding to the open interfaces, and determining whether each open interface is registered;
If yes, determining a registration mechanism of the open interface as an updating mechanism, and storing the classification information into a storage medium corresponding to the open interface, wherein the updating mechanism is used for updating the registration information stored in the storage medium of the open interface based on the classification information;
If not, determining that the registration mechanism of the open interface is an insertion mechanism, and storing the classification information into a storage medium corresponding to the open interface, wherein the insertion mechanism refers to inserting the classification information into the storage medium of the open interface.
Preferably, the open API management device further includes a monitoring update module, and the monitoring update module is further configured to:
Monitoring whether the API information of the open interface is changed or not;
if yes, determining a changed target interface, and determining target interface information corresponding to the target interface;
and registering the target interface based on the target interface information, and updating registration information stored in a storage medium of the target interface.
Preferably, the open API management device further includes an information configuration module, and the information configuration module is further configured to:
receiving basic configuration information of the open interface and description information corresponding to the basic configuration information, and determining error return information defined for the open interface;
And determining API information of the open interface based on the basic configuration information, the description information and the error return information.
In addition, to achieve the above object, the present invention also provides an open API management system, including: the system comprises a memory, a processor and an open API manager stored on the memory and executable on the processor, wherein the open API manager implements the steps of the open API management method as described above when executed by the processor.
In addition, in order to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon an open API management program which, when executed by a processor, implements the steps of the open API management method as described above.
According to the open API management method, the return information of the open interface is determined according to the API information by acquiring the API information of the open interface; determining registration information of an open interface according to the API information and the corresponding return information, and registering the open interface; and storing the registration information into a storage medium corresponding to the open interface. The invention determines the registration information corresponding to the open interface by acquiring the API information and the return information of the open interface, and stores the registration information in the storage medium to finish the registration flow of the open interface in batches, thereby realizing the efficient registration and maintenance of the open interface and further achieving the purpose of efficiently managing the API.
Drawings
FIG. 1 is a schematic diagram of a system architecture of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart of a first embodiment of an open API management method according to the present invention;
FIG. 3 is a flowchart of a second embodiment of an open API management method according to the present invention;
FIG. 4 is a functional block diagram of an open API management apparatus according to a preferred embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic system architecture diagram of a hardware running environment according to an embodiment of the present invention.
The system of the embodiment of the invention comprises an interface configuration service module, an interface monitoring service module, an information extraction service module, an information analysis service module, an interface description service module, an interface interpretation service module, an interface test service module, an interface storage service module and the like.
As shown in fig. 1, the system may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Those skilled in the art will appreciate that the system architecture shown in fig. 1 is not limiting of the system and may include more or fewer components than shown, or certain components may be combined, or a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and an open API management program may be included in a memory 1005, which is a type of computer storage medium.
The operating system is a program for managing and controlling the open API management system and software resources, and supports the operation of a network communication module, a user interface module, the open API management program and other programs or software; the network communication module is used to manage and control the network interface 1004; the user interface module is used to manage and control the user interface 1003.
In the open API management system shown in fig. 1, the open API management system calls an open API management program stored in a memory 1005 through a processor 1001 and performs operations in various embodiments of the open API management method described below.
Based on the above hardware structure, the embodiment of the open API management method is provided.
Referring to fig. 2, fig. 2 is a flowchart of a first embodiment of an open API management method according to the present invention, where the open API management method includes:
step S10, acquiring API information of an open interface, and determining return information of the open interface based on the API information;
Step S20, determining the registration information of the open interface based on the API information and the return information, and registering the open interface based on the registration information;
And step S30, storing the registration information into a storage medium corresponding to the open interface.
The open API management method is applied to open API management systems of various manufacturers, particularly open API management systems with frequent API changes, and for convenience of description, the open API management system of the invention is abbreviated as an API system. In this embodiment, the API system includes an interface configuration service module, an interface monitoring service module, an information extraction service module, an information analysis service module, an interface description service module, an interface interpretation service module, an interface test service module, an interface storage service module, and the like, where the interface configuration service module is configured to configure open API interface information in a code; the interface monitoring service module is used for monitoring whether the API information in the code is changed or not; the information extraction service module is used for extracting API information in the codes; the information analysis service module is used for analyzing the extracted API information and extracting key points to obtain a corresponding API list; the interface description service module is used for displaying the API analysis information and adding auxiliary description information; the interface test service module is used for providing an open interface test function and analyzing a returned result; the interface interpretation service module is used for providing an open API registration information interpretation service; and the interface storage service module is used for providing a storage function of the API registration information. The method for hierarchically managing the open APIs through the modules ensures that maintenance personnel can finish registration and maintenance on the open interfaces under the condition that the maintenance personnel do not understand the service and the code, thereby reducing the workload and the working complexity of the maintenance personnel.
The open API management system of this embodiment determines the corresponding return information by acquiring the API information of the open interface, thereby determining the registration information of the open interface, registering the open interface, and registering the open interface in the API system by storing the corresponding registration information in the storage medium.
The following will explain each step in detail:
step S10, acquiring API information of an open interface, and determining return information of the open interface based on the API information;
in this embodiment, a Swagger (a service framework) plug-in is configured in advance, and all API information in the open interface can be obtained by accessing the Swagger interface, and return information corresponding to the open interface is determined according to the API information.
It will be appreciated that, before step S10, the API management method further includes:
Step a1, receiving basic configuration information of the open interface and description information corresponding to the basic configuration information, and determining error return information defined for the open interface;
In this embodiment, the API system receives basic configuration information of the open interfaces, description information corresponding to the basic configuration information, and determines error return information defined by each open interface. In the implementation, a worker with configuration authority, such as a developer, integrates the Swagger plug-in by using a programming algorithm according to specific business requirements, and inputs basic configuration information of an open interface, description information corresponding to the basic configuration information and error return information according to the Swagger plug-in requirements. Basic configuration information includes request URL (Uniform Resource Locator, uniform resource locator, also called web page address), request mode, parameter name, parameter location, parameter type, parameter default value, etc.; description information corresponding to the basic configuration information refers to a functional description added for the basic configuration information, such as API classification, upper request limit of API per second or per minute, whether it is necessary, etc.; the error return information comprises error return codes and error descriptions, the error codes and the error descriptions are in one-to-one correspondence, and different error codes correspond to different error descriptions, and can be set according to actual service requirements when the method is implemented.
And a step a2 of determining API information of the open interface based on the basic configuration information, the description information and the error return information.
In this embodiment, the basic configuration information, the description information corresponding to the basic configuration information, and the return information form API information of the open interface.
Specifically, in step S10, the step of determining the return information of the open interface based on the API information includes:
step b1, preprocessing the API information to obtain an API list corresponding to the API information, and displaying the API list on a display interface;
In this embodiment, all the obtained API information is preprocessed to obtain a corresponding API list, and the API list is displayed on the display interface.
Further, in step b1, the step of preprocessing the API information to obtain an API list corresponding to the API information includes:
and b11, determining the interface name of each open interface, and extracting and integrating the API information based on the interface name to obtain an API list corresponding to the API information.
In this embodiment, the API information is preprocessed, the interface name of each open interface is determined, the API information is extracted by the interface name, so as to determine the interface information corresponding to each open interface, and the extracted API information is integrated to obtain an API list corresponding to the API information.
Step b2, detecting whether edit content input based on the API list is received;
in this embodiment, the API system provides an editing function, and a person having editing authority, that is, an editor such as a maintainer, can select editing according to the API list information displayed on the display interface, and input corresponding editing content, or can select not editing, so that the API system needs to detect whether the editing content input for the API list is received.
Step b3, if yes, updating the API information corresponding to the open interface based on the editing content and the API list;
In this embodiment, if the edit content input for the API list is received, the API information of the open interface is updated according to the input edit content and the API list; if the editing content input for the API list is not received, namely the editing content is blank, the API information updated by the open interface is not changed. In the implementation, an editor can edit the description information corresponding to each open interface in the API list, for example, edit the upper request limit of an API of a certain open interface in the API list, i.e. change the upper request limit of the API per second or minute; no editing of the API list is possible.
And b4, calling the open interface based on the updated API information to obtain return information corresponding to the open interface.
In this embodiment, all open interfaces are sequentially called according to the updated API information, so as to obtain corresponding return information.
Further, step b4 includes:
Step b41, calling each open interface based on the updated API information to determine a response result corresponding to each open interface;
In this embodiment, according to the updated API information, each open interface is called, so as to determine a response result corresponding to each open interface, where the response result includes a return code and corresponding description information. In the specific implementation, the error return information of each open interface is obtained, the response result corresponding to each open interface is matched with the error return information, if the corresponding error return information can be matched, the open interface call failure is indicated, and the cause of the open interface call failure can be determined according to the error return code and the error description in the error return information; if the corresponding error return information is not matched, the open interface call is successful.
Step b42, formatting the response result to obtain a formatted result, and receiving prompt information input for the formatted result;
In this embodiment, if the format of the response result is inconsistent, in order to facilitate docking, the format of the response result needs to be formatted, that is, the format of the response result needs to be unified and normalized to obtain a corresponding formatted result, it can be understood that the format type of the response result changes, the returned result is formatted, the returned result can be displayed more intuitively, and an editing function is provided to receive prompt information input by an editor aiming at the formatted result, so as to prompt other staff to analyze the response result conveniently.
And step b43, determining the return information of the open interface based on the formatting result and the prompt information.
In this embodiment, the formatted result and the corresponding prompt information form the return information of the open interface, so that the return information of the open interface can be determined according to the formatted result and the prompt information.
Step S20, determining the registration information of the open interface based on the API information and the return information, and registering the open interface based on the registration information;
in this embodiment, the registration information corresponding to the open interface is determined by integrating the API information and the return information, and the open interface is registered according to the registration information, so as to complete the registration flow of the open interface in batches.
And step S30, storing the registration information into a storage medium corresponding to the open interface.
In this embodiment, after the registration of the open interface is completed, the registration information is further stored in a storage medium corresponding to the API system, where the storage medium may be designed to store various tables, including a registry, a parameter table, and other various documents.
Specifically, step S30 further includes:
Step c1, classifying the registration information based on a preset classification rule to obtain classification information corresponding to the open interfaces, and determining whether each open interface is registered;
In this embodiment, after the registration of the open interface is completed, the registration information is classified according to a preset classification rule to obtain classification information corresponding to the open interface, and in a specific implementation, the registration information of the open interface may be classified into URL related information, parameter related information, return information, and the like, where the URL related information of the open interface includes URL, a request mode, a request protocol, URL description information, and the like; parameter related information such as request parameter type, default value, format, description information corresponding to the parameter, etc.; return information such as request examples, prompt information of request examples, etc.; and determining whether each open interface is registered, it can be understood that the API information obtained through the Swagger interface is the API information of all open interfaces, and some open interfaces are already registered and some open interfaces are not yet registered, so that it is also necessary to determine whether each open interface is registered.
Step c2, if yes, determining that the registration mechanism of the open interface is an updating mechanism, and storing the classification information into a storage medium corresponding to the open interface;
In this embodiment, if the open interface has already been registered, it is determined that the registration mechanism of the open interface is an update mechanism, where the update mechanism refers to updating the registration information stored in the storage medium of the open interface according to the classification information. It can be understood that when the open interface is registered, the registration information is determined according to the API information corresponding to the open interface, so that the open interface is registered, although the open interface has been registered, the API information corresponding to the open interface may be changed, and the URL of the open interface is the unique identifier determined by the open interface, so that the registration information stored in the storage medium of the open interface needs to be updated, and then the classification information is stored in the storage medium corresponding to the open interface according to the URL of the open interface.
Step c3, if not, determining that the registration mechanism of the open interface is an insertion mechanism, and storing the classification information into a storage medium corresponding to the open interface.
In this embodiment, if it is determined that the open interface is not registered, the registration mechanism of the open interface is determined to be an insertion mechanism, and the classification information is saved in a storage medium corresponding to the open interface, where the insertion mechanism refers to inserting the classification information into the storage medium of the open interface.
In addition, regardless of the update mechanism or the insertion mechanism, the classification information is stored in the storage medium of the open interface, and when the storage medium is stored in a table form in the implementation, URL related information and return information in the classification information can be stored in the registry, parameter related information can be stored in the parameter table, and other related information can be stored in other related tables.
According to the open API management method, the return information of the open interface is determined by acquiring the API information of the open interface and based on the API information; determining registration information of the open interface based on the API information and the return information, and generating a registration command corresponding to the open interface based on the registration information; and executing the registration command and storing the registration information into a storage medium of the open interface. The invention determines the registration information corresponding to the open interface by acquiring the API information and the return information of the open interface, and stores the registration information in the storage medium so as to realize efficient registration and maintenance of the open interface, thereby achieving the purpose of efficiently managing the API.
Further, based on the first embodiment of the open API management method of the present invention, a second embodiment of the open API management method of the present invention is provided.
Referring to fig. 3, fig. 3 is a flowchart illustrating a second embodiment of an open API management method according to the present invention;
The second embodiment of the open API management method differs from the first embodiment of the open API management method in that after step S10, the open API management method further includes:
Step d, determining the registration information of the open interface based on the open API request information and the return information, and registering the open interface based on a preset registration mechanism and the registration information;
in this embodiment, the open API request information refers to basic configuration information, description information corresponding to the basic configuration information, and API registration information of an open interface formed by the open API request information and corresponding return information; the preset registration mechanism comprises one-key registration and re-registration, wherein the one-key registration mechanism refers to one-key registration of an unregistered open interface into an API system, and the re-registration mechanism refers to re-registration of the registered open interface into the API system if the API registration information corresponding to the open interface changes, namely, updating the registration information corresponding to the open interface.
And e, classifying the registration information to obtain corresponding classification information, and storing the classification information into a storage medium corresponding to the open interface.
In this embodiment, the registration information is classified, and in a specific implementation, the registration information of the open interface may be classified into URL related information, request parameter related information, return information, and the like, where the URL related information of the open interface includes URL address, request mode, request protocol, URL interface description information, interface classification, and the like; request parameter related information such as request parameter type, default value, format, description information corresponding to parameters, etc.; return information such as request examples, prompt information of request examples, etc.; whether one-key registration or re-registration is performed, storing the corresponding classification information into a storage medium of an open interface, wherein storing the corresponding classification information into the storage medium through the open interface registered by the one-key registration mechanism means that the classification information is respectively inserted into the corresponding storage medium; storing the corresponding categorization information in the storage medium through the open interface registered by the re-registration mechanism refers to updating the API registration information stored in the storage medium according to the categorization information. Specifically, the classification information is stored in a storage medium, and the URL related information and the return information can be respectively inserted into or updated with API registration information; inserting or updating the request parameter related information into the API parameters respectively; other registration information is inserted into or updated with other API-related information, etc., to save the API registration information to a storage medium of the API system.
According to the open API management method, the registration information of the open interface is determined according to the open API request information and the corresponding return information, the registration information of the open interface is classified through a one-key registration or re-registration mechanism, corresponding classification information is obtained, and the classification information is stored in a storage medium to register the open interface in an API system in batches. According to the invention, the open interfaces are registered in batches into the API system through the one-key registration mechanism or the re-registration mechanism, so that the registration efficiency of the API system is improved.
Further, based on the first embodiment of the open API management method of the present invention, a third embodiment of the open API management method of the present invention is provided.
The second embodiment of the open API management method differs from the first and second embodiments of the open API management method in that, after step S30, the open API management method further includes:
Step f, monitoring whether the API information of the open interface is changed;
Step g, if yes, determining a changed target interface, and determining target interface information corresponding to the target interface;
And h, registering the target interface based on the target interface information, and updating registration information stored in a storage medium of the target interface.
According to the open API management method, after registration information is stored in the storage medium corresponding to the open interface, whether the API information of the open interface is changed is monitored, if yes, a changed target API is determined, the target API is registered, namely the target API is registered again, the registration information stored in the storage medium corresponding to the target API is updated, and accuracy and timeliness of the API information are guaranteed.
The following will explain each step in detail:
Step f, monitoring whether the API information of the open interface is changed;
In this embodiment, the open API management method further includes monitoring whether the API information of the open interface is changed, and in a specific implementation, whether the API information of the open interface is changed may be monitored in a timing or real-time manner by pre-configuring the monitoring time.
Step g, if yes, determining a changed target interface, and determining target interface information corresponding to the target interface;
In this embodiment, if it is monitored that the API information is changed, for example, parameters of the open interface are changed, a corresponding response result format is changed, etc., the changed target interface is determined, and the changed target interface information is determined.
And h, registering the target interface based on the target interface information, and updating registration information stored in a storage medium of the target interface.
In this embodiment, the target interface is registered according to the changed target interface information, and the registration information stored in the storage medium corresponding to the target interface is updated, that is, the API information stored in the previous registration is updated according to the changed target interface information.
According to the open API management method, whether the API information of the open interface is changed is monitored, if yes, the target interface is registered, registration information stored in a storage medium corresponding to the target interface is updated, the open interface is more flexibly registered, and the registration and maintenance efficiency of the API is further improved.
The invention also provides an open API management device. Referring to fig. 4, the open API management apparatus of the present invention includes:
The information determining module 10 is configured to obtain API information of an open interface, and determine return information of the open interface based on the API information;
a determining registration module 20, configured to determine registration information of the open interface based on the API information and the return information, and register the open interface based on the registration information;
And the registration saving module 30 is configured to save the registration information into a storage medium corresponding to the open interface.
Preferably, the information determining module is further configured to:
Preprocessing the API information to obtain an API list corresponding to the API information, and displaying the API list on a display interface;
Detecting whether edit content input based on the API list is received;
if yes, updating the API information corresponding to the open interface based on the editing content and the API list;
and calling the open interface based on the updated API information to obtain the return information corresponding to the open interface.
Preferably, the information determining module is further configured to:
and determining the interface name of each open interface, and extracting and integrating the API information based on the interface name to obtain an API list corresponding to the API information.
Preferably, the information determining module is further configured to:
calling each open interface based on the updated API information to determine a response result corresponding to each open interface;
Formatting the response result to obtain a formatted result, and receiving prompt information input for the formatted result;
and determining the return information of the open interface based on the formatting result and the prompt information.
Preferably, the registration keeping module is further configured to:
Classifying the registration information based on a preset classification rule to obtain classification information corresponding to the open interfaces, and determining whether each open interface is registered;
If yes, determining a registration mechanism of the open interface as an updating mechanism, and storing the classification information into a storage medium corresponding to the open interface, wherein the updating mechanism is used for updating the registration information stored in the storage medium of the open interface based on the classification information;
If not, determining that the registration mechanism of the open interface is an insertion mechanism, and storing the classification information into a storage medium corresponding to the open interface, wherein the insertion mechanism refers to inserting the classification information into the storage medium of the open interface.
Preferably, the open API management device further includes a monitoring update module, and the monitoring update module is further configured to:
Monitoring whether the API information of the open interface is changed or not;
if yes, determining a changed target interface, and determining target interface information corresponding to the target interface;
and registering the target interface based on the target interface information, and updating registration information stored in a storage medium of the target interface.
Preferably, the open API management device further includes an information configuration module, and the information configuration module is further configured to:
receiving basic configuration information of the open interface and description information corresponding to the basic configuration information, and determining error return information defined for the open interface;
And determining API information of the open interface based on the basic configuration information, the description information and the error return information.
The invention also provides a computer readable storage medium.
The computer-readable storage medium of the present invention stores therein an open API management program which, when executed by a processor, implements the steps of the open API management method described above.
The method implemented when the open API management program running on the processor is executed may refer to various embodiments of the open API management method of the present invention, which are not described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing an end system (which may be a mobile phone, a computer, a server, an air conditioner, or a network system, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein, or any application, directly or indirectly, in the field of other related technology.

Claims (7)

1. An open API management method, characterized in that the open API management method comprises the steps of:
acquiring API information of an open interface, and determining return information of the open interface based on the API information;
Determining registration information of the open interface based on the API information and the return information, and registering the open interface based on the registration information;
storing the registration information into a storage medium corresponding to the open interface;
Before the step of obtaining the API information of the open interface and determining the return information of the open interface based on the API information, the open API management method further includes:
receiving basic configuration information of the open interface and description information corresponding to the basic configuration information, and determining error return information defined for the open interface;
Determining API information of the open interface based on the basic configuration information, the description information and the error return information;
the step of determining return information of the open interface based on the API information includes:
Preprocessing the API information to obtain an API list corresponding to the API information, and displaying the API list on a display interface;
Detecting whether edit content input based on the API list is received;
if yes, updating the API information corresponding to the open interface based on the editing content and the API list;
Calling the open interface based on the updated API information to obtain return information corresponding to the open interface;
The step of calling the open interface based on the updated API information to obtain the return information corresponding to the open interface comprises the following steps:
calling each open interface based on the updated API information to determine a response result corresponding to each open interface;
Formatting the response result to obtain a formatted result, and receiving prompt information input for the formatted result;
and determining the return information of the open interface based on the formatting result and the prompt information.
2. The method for managing open APIs according to claim 1, wherein said step of preprocessing said API information to obtain an API list corresponding to said API information comprises:
and determining the interface name of each open interface, and extracting and integrating the API information based on the interface name to obtain an API list corresponding to the API information.
3. The open API management method as recited in claim 1, wherein said step of saving said registration information in a storage medium corresponding to said open interface comprises:
Classifying the registration information based on a preset classification rule to obtain classification information corresponding to the open interfaces, and determining whether each open interface is registered;
If yes, determining a registration mechanism of the open interface as an updating mechanism, and storing the classification information into a storage medium corresponding to the open interface, wherein the updating mechanism is used for updating the registration information stored in the storage medium of the open interface based on the classification information;
If not, determining that the registration mechanism of the open interface is an insertion mechanism, and storing the classification information into a storage medium corresponding to the open interface, wherein the insertion mechanism refers to inserting the classification information into the storage medium of the open interface.
4. The open API management method as recited in claim 1, further comprising, after said step of saving said registration information in a storage medium corresponding to said open interface:
Monitoring whether the API information of the open interface is changed or not;
if yes, determining a changed target interface, and determining target interface information corresponding to the target interface;
and registering the target interface based on the target interface information, and updating registration information stored in a storage medium of the target interface.
5. An open API managing apparatus, comprising:
The information determining module is used for receiving basic configuration information of an open interface and description information corresponding to the basic configuration information and determining error return information defined for the open interface; determining API information of the open interface based on the basic configuration information, the description information and the error return information; the method comprises the steps of acquiring API information of an open interface and determining return information of the open interface based on the API information; preprocessing the API information to obtain an API list corresponding to the API information, and displaying the API list on a display interface; detecting whether edit content input based on the API list is received; if yes, updating the API information corresponding to the open interface based on the editing content and the API list; calling the open interface based on the updated API information to obtain return information corresponding to the open interface; calling each open interface based on the updated API information to determine a response result corresponding to each open interface; formatting the response result to obtain a formatted result, and receiving prompt information input for the formatted result; determining the return information of the open interface based on the formatting result and the prompt information;
The determining and registering module is used for determining the registering information of the open interface based on the API information and the return information and registering the open interface based on the registering information;
and the registration storage module is used for storing the registration information into a storage medium corresponding to the open interface.
6. An open API management system, said open API management system comprising: a memory, a processor and an open API hypervisor stored on the memory and executable on the processor, the open API hypervisor when executed by the processor implementing the steps of the open API management method of any of claims 1 to 4.
7. A computer readable storage medium, wherein an open API management program is stored on the computer readable storage medium, which when executed by a processor implements the steps of the open API management method according to any one of claims 1 to 4.
CN202011006713.0A 2020-09-22 2020-09-22 Open API management method, device, system and computer readable storage medium Active CN112131022B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011006713.0A CN112131022B (en) 2020-09-22 2020-09-22 Open API management method, device, system and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011006713.0A CN112131022B (en) 2020-09-22 2020-09-22 Open API management method, device, system and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN112131022A CN112131022A (en) 2020-12-25
CN112131022B true CN112131022B (en) 2024-05-14

Family

ID=73842821

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011006713.0A Active CN112131022B (en) 2020-09-22 2020-09-22 Open API management method, device, system and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112131022B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024119962A1 (en) * 2022-12-07 2024-06-13 华为云计算技术有限公司 Method and apparatus for analyzing and managing api, and computing device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101976188A (en) * 2010-05-26 2011-02-16 天津大学 OpenApi data automatic loading system oriented to AJAX protocol
WO2012169775A2 (en) * 2011-06-09 2012-12-13 주식회사 피씨엔 System and method for providing an open api-based content service interface
CN103220259A (en) * 2012-01-20 2013-07-24 华为技术有限公司 Using method, call method, device and system of Oauth application programming interface (API)
CN105635151A (en) * 2015-12-31 2016-06-01 深圳中兴网信科技有限公司 Open platform access method and open platform access system
CN107872484A (en) * 2016-09-27 2018-04-03 中国电信股份有限公司 REST API fast registration methods, devices and systems
CN108768965A (en) * 2018-05-14 2018-11-06 武汉天喻教育科技有限公司 A kind of education cloud open service application integrating system and method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101605967B1 (en) * 2014-10-08 2016-03-24 한국과학기술원 Sevice method and system for managing transaction using application property

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101976188A (en) * 2010-05-26 2011-02-16 天津大学 OpenApi data automatic loading system oriented to AJAX protocol
WO2012169775A2 (en) * 2011-06-09 2012-12-13 주식회사 피씨엔 System and method for providing an open api-based content service interface
CN103220259A (en) * 2012-01-20 2013-07-24 华为技术有限公司 Using method, call method, device and system of Oauth application programming interface (API)
CN105635151A (en) * 2015-12-31 2016-06-01 深圳中兴网信科技有限公司 Open platform access method and open platform access system
CN107872484A (en) * 2016-09-27 2018-04-03 中国电信股份有限公司 REST API fast registration methods, devices and systems
CN108768965A (en) * 2018-05-14 2018-11-06 武汉天喻教育科技有限公司 A kind of education cloud open service application integrating system and method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"‘互联网+’环境下港口企业开放数据应用平台研究";冉青云;《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》;全文 *

Also Published As

Publication number Publication date
CN112131022A (en) 2020-12-25

Similar Documents

Publication Publication Date Title
CN108108297B (en) Method and device for automatic testing
CN110019486B (en) Data acquisition method, device, equipment and storage medium
CN109840206B (en) Data testing method, device, terminal and storage medium
US8869111B2 (en) Method and system for generating test cases for a software application
CN111068328B (en) Game advertisement configuration form generation method, terminal equipment and medium
CN110825634A (en) Parameter quality checking method, device and equipment and computer readable storage medium
CN111475417A (en) Automatic testing method, device, equipment and storage medium
CN111475390A (en) Log collection system deployment method, device, equipment and storage medium
CN111475401A (en) Test method and related equipment
CN113934832A (en) Interactive processing method, device, equipment, medium and program product based on session
CN112131022B (en) Open API management method, device, system and computer readable storage medium
CN115617780A (en) Data import method, device, equipment and storage medium
CN112383507A (en) Firewall policy management method, device and system and computer readable storage medium
CN111679851A (en) Demand code management method, apparatus, system and computer readable storage medium
CN112770108B (en) Performance test method, device and system and computer readable storage medium
CN113268409B (en) Method, apparatus, device and medium for tracking logical nodes during automated testing
CN114090365A (en) Method, device and equipment for performing function test by using dynamic link library
US20030135496A1 (en) Management program, method and apparatus for business process definition
CN110413518B (en) Control object library generation method and device and computer readable storage medium
CN111538542B (en) System configuration method and related device
CN110727436A (en) Operation interface script execution method and device, terminal equipment and storage medium
CN111722881B (en) Resource expansion method, system and device of container cloud platform
CN114115826A (en) Code generation method, terminal and readable storage medium
CN112612469A (en) Interface element processing method and device and electronic equipment
CN110674119A (en) Data processing method, system and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant