WO2019136813A1 - Api file management method, server, and storage medium - Google Patents

Api file management method, server, and storage medium Download PDF

Info

Publication number
WO2019136813A1
WO2019136813A1 PCT/CN2018/077655 CN2018077655W WO2019136813A1 WO 2019136813 A1 WO2019136813 A1 WO 2019136813A1 CN 2018077655 W CN2018077655 W CN 2018077655W WO 2019136813 A1 WO2019136813 A1 WO 2019136813A1
Authority
WO
WIPO (PCT)
Prior art keywords
api
file
api file
interface
server
Prior art date
Application number
PCT/CN2018/077655
Other languages
French (fr)
Chinese (zh)
Inventor
叶腾飞
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019136813A1 publication Critical patent/WO2019136813A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment

Definitions

  • the present application relates to the field of computer technologies, and in particular, to an application programming interface (API) file management method, a server, and a computer readable storage medium.
  • API application programming interface
  • the API file is a descriptive file about API interface calls.
  • Each API file includes API interface and API interface call instructions.
  • the present application provides an API file management method, a server, and a computer readable storage medium, which can perform real-time monitoring on an API interface, improve the readability of the code, and facilitate timely modification and notification of the client when the API interface is changed. .
  • an API file management method including:
  • Receiving step receiving an API file newly uploaded by the server
  • the judging step is: determining, according to the interface name in the API file, whether the interface is a stored API file that is changed by the interface, or a new API file, and if the interface is a stored API file, the prompt information in the preset format is sent to the client, and the process ends. If the API file is added, the process enters the allocation step;
  • Assignment step assign a label to the API code and API file of the newly added API interface, and establish a mapping relationship between the API code and the API file through the label;
  • Setup steps Set the association between the tag and the client address.
  • the method further comprises: separating the code of the API interface from the API file in the server, providing a code library storage API code, and an API file library storage API file.
  • the determining step further includes:
  • the API file Comparing the interface name of the newly uploaded API file with the interface name of the API file stored in the API file library. If the interface name of the newly uploaded API file is the same as the interface name of an API file stored in the API file library, then The API file is a stored API file of the interface change. If the interface name of the newly uploaded API file is different from the interface name of all the API files stored in the API file library, it is determined that the API file is a new API file.
  • the method further includes: after the setting of the association relationship between the label and the client address is completed, sending the feedback information in a preset format to the server.
  • the tags automatically generate a unique tag name based on the order of the tag list.
  • the present application also provides a server, the server includes: a memory, a processor, a display, and an API file management program stored on the memory and executable on the processor, where the API file management program is The processor executes, and the following steps can be implemented:
  • Receiving step receiving an API file newly uploaded by the server
  • the judging step is: determining, according to the interface name in the API file, whether the interface is a stored API file that is changed by the interface, or a new API file. If the interface of the stored API file is changed, the prompt information of the preset format is sent to the client, and the process ends. If the API file is added, the process enters the allocation step;
  • Assignment step assign a label to the API code and API file of the newly added API interface, and establish a mapping relationship between the API code and the API file through the label;
  • Setup steps Set the association between the tag and the client address.
  • the API file management program is executed by the processor, and further implements the steps of: separating the code of the API interface from the API file in the server, providing a code library storage API code, and an API file library storage API file.
  • the determining step further includes:
  • the API file Comparing the interface name of the newly uploaded API file with the interface name of the API file stored in the API file library. If the interface name of the newly uploaded API file is the same as the interface name of an API file stored in the API file library, then The API file is a stored API file of the interface change. If the interface name of the newly uploaded API file is different from the interface name of all the API files stored in the API file library, it is determined that the API file is a new API file.
  • the API file management program is executed by the processor, and the following steps are further implemented: after the setting of the association relationship between the tag and the client address is completed, the feedback information of the preset format is sent to the server.
  • the present application further provides a computer readable storage medium, where the computer readable storage medium includes an API file management program, and when the API file management program is executed by a processor, the foregoing can be implemented as described above. Any step in the API file management method.
  • the API file management method, the server and the computer readable storage medium proposed by the application by receiving an API file newly uploaded by the server, using the interface name in the API file to determine whether the interface is a stored API file changed, or is added
  • the API file if it is a stored API file of the interface change, sends a prompt message in a preset format to the client. If the API file is added, a label is added to the API code and the API file of the new API interface, and then the label is passed. Establish a mapping relationship between the API code and the API file, and finally set the association relationship between the tag and the client address, thereby effectively monitoring the API interface change, and modifying the changed API interface in time.
  • FIG. 1 is a schematic diagram of a preferred embodiment of a server of the present application.
  • FIG. 2 is a schematic diagram of an application environment of an API file management method according to the present application.
  • FIG. 3 is a block diagram showing a preferred embodiment of the API file management program in FIG. 1 or FIG. 2;
  • FIG. 4 is a flowchart of a preferred embodiment of an API file management method according to the present application.
  • FIG. 5 is a flowchart of a second embodiment of an API file management method according to the present application.
  • FIG. 1 it is a schematic diagram of a preferred embodiment of the server 1 of the present application.
  • the server 1 may be a server, a smart phone, a tablet computer, a personal computer, a portable computer, and other electronic devices having computing functions.
  • the server 1 includes a memory 11, a processor 12, a network interface 13, a communication bus 14, and an API file management program 10 stored on the memory 11 and executable on the processor 12.
  • the network interface 13 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is generally used to establish a communication connection between the server and other electronic devices.
  • Communication bus 14 is used to implement connection communication between these components.
  • the memory 11 includes at least one type of readable storage medium.
  • the at least one type of readable storage medium may be a non-volatile storage medium such as a flash memory, a hard disk, a multimedia card, a card type memory, or the like.
  • the memory 11 may be an internal storage unit of the server 1, such as a hard disk of the server 1.
  • the memory 11 may also be an external storage unit of the server 1, such as a plug-in hard disk equipped on the server 1, a smart memory card (SMC), and a secure digital ( Secure Digital, SD) cards, flash cards (FC cards), etc.
  • the memory 11 can be used not only for storing application software and various types of data installed in the server 1, such as an API file management program 10, an API interface code, an API file, etc., but also for temporarily Stores data that has been output or will be output, such as an interface class.
  • the processor 12 in some embodiments, may be a Central Processing Unit (CPU), microprocessor or other data processing chip for running program code or processing data stored in the memory 11, such as performing API file management.
  • CPU Central Processing Unit
  • microprocessor or other data processing chip for running program code or processing data stored in the memory 11, such as performing API file management.
  • the server 1 may also include a display, which may be referred to as a display screen or display unit.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an Organic Light-Emitting Diode (OLED) touch sensor.
  • OLED Organic Light-Emitting Diode
  • the display is used to display information processed in the server 1 and a work interface for displaying visualizations.
  • Figure 1 shows only server 1 having components 11-14 and computer program code for executing API file management program 10, but it should be understood that not all illustrated components may be implemented, alternative implementations may be more or more Less components.
  • the server 1 may further include an input unit such as a keyboard, a voice output device such as an audio, a headphone, and the like.
  • an input unit such as a keyboard
  • a voice output device such as an audio, a headphone, and the like.
  • the program code of the API file management program 10 is stored in the memory 11 as a computer storage medium.
  • the processor 12 executes the program code of the API file management program 10, the following steps are implemented:
  • Receiving step receiving an API file newly uploaded by the server
  • the judging step is: determining, according to the interface name in the API file, whether the interface is a stored API file that is changed by the interface, or a new API file, and if the interface is a stored API file, the prompt information in the preset format is sent to the client, and the process ends. If the API file is added, the process enters the allocation step;
  • Assignment step assign a label to the API code and API file of the newly added API interface, and establish a mapping relationship between the API code and the API file through the label;
  • Setup steps Set the association between the tag and the client address.
  • FIG. 2 it is a schematic diagram of an application environment of the API file management method of the present application.
  • the server 1 separates the API code from the API file, provides the API code library 15 to store the code of the API interface, and the API file library 16 stores the API file, but the API code library 15 and the API file library are collectively managed and distributed by the server 1.
  • the API file management program 10 receives an API file newly uploaded by the server 3, the API file management program 10 is started.
  • the API file is a descriptive file of an API interface, and each API file includes an API file interface name and an API interface call description, and the API interface call description includes a method, a function, a parameter, and the like in the API interface. .
  • the solution of the present application is explained by taking the face recognition interface as an example.
  • the API file management program 10 is started.
  • the server 3 refers to a provider of an API interface corresponding to the API file.
  • the client 4 refers to the caller of the API interface corresponding to the API file.
  • the server 3 provides a face recognition interface, and the client 4 invokes a face recognition interface for a face recognition application.
  • the API file management program 10 determines whether the API file is a stored API file of an interface change or a new API file by the interface name of the uploaded API file. If it is determined that the uploaded API file is a stored API file of the interface change, the interface change prompt information of the preset format is sent to the client 4. For example, if the API file is a stored API file whose face recognition API interface is changed by the interface name of the uploaded API file, the interface change prompt information is sent to the client 4, for example, “the face recognition API interface has been changed. The new interface is ***".
  • the specific judging method includes: comparing the interface name of the newly uploaded API file with the interface name of the API file stored in the API file library 16, if the interface name of the newly uploaded API file is stored in the API file library 16 If the interface name of an API file is the same, it is determined that the API file is a stored API file of the interface change. If the interface name of the newly uploaded API file is different from the interface name of all the API files stored in the API file library 16, it is determined.
  • This API file is a new API file.
  • the API interface name of the newly uploaded API file is a face recognition API interface. If the API file library 16 also stores the face recognition API interface, the newly uploaded API file and the API file library 16 store the API file API interface call. If the description is different, the uploaded API file is a stored API file of the interface change; if the API file library 16 does not store the face recognition API interface, the uploaded API file is a newly added API file.
  • the API file management program 10 assigns a label to the API code and the API file of the newly added API interface, and establishes a mapping relationship between the API code and the API file through the label.
  • the tag is a unique tag name automatically generated according to the order of the tag list 17, and the tag list refers to a file for storing tags.
  • the newly uploaded age prediction API interface file is a new API file
  • the largest tag number stored in the tag list is the tag 022
  • the API file management program 10 automatically generates a tag 023 according to the tag list 17 in order, and the tag is 023 is assigned to the API code and API file of the age prediction API interface, and the mapping relationship between the API code of the age prediction API interface and the API file is established through the tag 023.
  • the API file management program 10 sets the association relationship between the tag and the client 4 address, and sends a message prompting the interface change to the client 4 when the interface in the API file is changed.
  • the client 4 refers to the caller of the API interface corresponding to the API file. For example, the association relationship between the label 023 and the client address is set.
  • the interface change prompt information is sent to the client 4, for example, “the age prediction API interface has changed, and the new interface is *** ".
  • the API file management method proposed by the above embodiment is different from the rest style API file management method and the markdown file management method.
  • the rest style API file adds a large number of comments in the code, that is, the code is combined with the API file to reduce the code readability.
  • the markdown file and the API file mentioned in this article are separated from the API file, but the markdown file needs to be manually described.
  • the code and API file of the markdown file are managed by the backend and frontend respectively, and the update is not synchronized when the API interface is changed. The separation of human collaboration is poor.
  • the API files and code mentioned in this article are managed by the background. It can effectively monitor the changes or additions of the API interface, so that the client interface can be notified in time when the API interface is changed, to avoid code intrusion. .
  • the media file processing program 10 may also be divided into one or more modules, one or more modules are stored in the memory 11 and executed by one or more processors (this implementation) The example is executed by the processor 12) to complete the application.
  • FIG. 3 it is a block diagram of a preferred embodiment of the API file management program 10 of FIG. 1 or 2.
  • a module as referred to in this application refers to a series of computer program instructions that are capable of performing a particular function.
  • the API file management program 10 includes: a receiving module 110, a determining module 120, an allocating module 130, and a setting module 140.
  • the functions or operating steps implemented by the modules 110-140 are similar to the above. No more detailed, by way of example, such as:
  • the receiving module 110 is configured to receive an API file newly uploaded by the server;
  • the determining module 120 is configured to determine, according to the interface name in the API file, whether the interface is a stored API file that is changed by the interface, or a new API file, and if the interface is a stored API file, the prompt information of the preset format is sent to the client. The process ends. If the API file is added, the process enters the allocation step;
  • the distribution module 130 is configured to allocate a label for the API code and the API file of the newly added API interface, and establish a mapping relationship between the API code and the API file through the label;
  • the setting module 140 is configured to set an association relationship between the label and the client address.
  • FIG. 4 it is a flowchart of a preferred embodiment of the API file management method of the present application.
  • the implementation of the API file management method includes steps S10-S60:
  • step S10 when the API file management program 10 receives an API file newly uploaded by the server 3, the API file management program 10 is started.
  • the API file is a descriptive file of an API interface, and each API file includes an API file interface name and an API interface call description, and the API interface call description includes a method, a function, a parameter, and the like in the API interface. .
  • the solution of the present application is explained by taking the face recognition interface as an example.
  • the API file management program 10 is started.
  • the server 3 refers to a provider of an API interface corresponding to the API file.
  • the client 4 refers to the caller of the API interface corresponding to the API file.
  • the server 3 provides a face recognition interface, and the client 4 invokes a face recognition interface for a face recognition application.
  • step S20 the API file management program 10 determines whether the API file is a stored API file of the interface change or a new API file by using the interface name of the uploaded API file.
  • step S30 if it is determined that the uploaded API file is a stored API file of the interface change, step S40 is performed. If it is determined that the uploaded API file is a new API file, step S50 is performed.
  • the specific judging method includes: comparing the interface name of the newly uploaded API file with the interface name of the API file stored in the API file library 16, if the interface name of the newly uploaded API file is stored in the API file library 16 If the interface name of an API file is the same, it is determined that the API file is a stored API file of the interface change. If the interface name of the newly uploaded API file is different from the interface name of all the API files stored in the API file library 16, it is determined. This API file is a new API file.
  • the API interface name of the newly uploaded API file is a face recognition API interface. If the API file library 16 also stores the face recognition API interface, the newly uploaded API file and the API file library 16 store the API file API interface call. If the description is different, the uploaded API file is a stored API file of the interface change; if the API file library 16 does not store the face recognition API interface, the uploaded API file is a newly added API file.
  • step S40 the API file management program 10 sends the prompt information of the preset format to the client 4.
  • the API file is a stored API file whose face recognition API interface is changed by the interface name of the uploaded API file
  • the interface change prompt information is sent to the client 4, for example, “the face recognition API interface has been changed.
  • the new interface is ***".
  • step S50 if the uploaded API file is a newly added API file, the API file management program 10 assigns a label to the API code and the API file of the newly added API interface, and establishes a mapping relationship between the API code and the API file through the label.
  • the tag is a unique tag name automatically generated in order according to the tag list 17.
  • the newly uploaded age prediction API interface file is a new API file, and the largest tag number stored in the tag list is the tag 022, and the API file management program 10 automatically generates a tag 023 according to the tag list 17 in order, and the tag is 023 is assigned to the API code and API file of the age prediction API interface, and the mapping relationship between the API code of the age prediction API interface and the API file is established through the tag 023.
  • step S60 the API file management program 10 sets the association relationship between the tag and the client address, and sends a message prompting the interface change to the client 4 when the interface in the API file is changed.
  • the client 4 refers to the caller of the API interface corresponding to the API file. For example, the association relationship between the label 023 and the client address is set, and when the subsequent age prediction interface is changed, the interface change prompt information is sent to the client 4, for example, “the age prediction API interface has changed, and the new interface is *** ".
  • the API file management method proposed in the foregoing embodiment determines the API uploaded by the server 3, and if the API file is changed by the interface, sends the prompt information in the preset format to the client 4, and if it is a new API file, assigns a
  • the tag establishes a mapping relationship between the API code and the API file, and then binds the tag to the client address, thereby effectively monitoring the interface change, and can notify the client 4 in time to avoid code intrusion.
  • FIG. 5 it is a flowchart of the second embodiment of the API file management method of the present application.
  • the implementation of the API file management method includes steps S10-S70:
  • step S10 when the API file management program 10 receives an API file newly uploaded by the server 3, the API file management program 10 is started.
  • the API file is a descriptive file of an API interface, and each API file includes an API file interface name and an API interface call description, and the API interface call description includes a method, a function, a parameter, and the like in the API interface. .
  • the solution of the present application is explained by taking the face recognition item as an example.
  • the API file management program 10 is started.
  • the server 3 refers to a provider of an API interface corresponding to the API file.
  • the client 4 refers to the caller of the API interface corresponding to the API file.
  • the server 3 provides a face recognition interface, and the client 4 invokes a face recognition interface for a face recognition application.
  • step S20 the API file management program 10 determines whether the API file is a stored API file of the interface change or a new API file by using the interface name of the uploaded API file.
  • step S30 if it is determined that the uploaded API file is a stored API file of the interface change, step S40 is performed. If it is determined that the uploaded API file is a new API file, step S50 is performed.
  • the specific judging method includes: comparing the interface name of the newly uploaded API file with the interface name of the API file stored in the API file library 16, if the interface name of the newly uploaded API file is stored in the API file library 16 If the interface name of an API file is the same, it is determined that the API file is a stored API file of the interface change. If the interface name of the newly uploaded API file is different from the interface name of all the API files stored in the API file library 16, it is determined. This API file is a new API file.
  • the API interface name of the newly uploaded API file is a face recognition API interface. If the API file library 16 also stores the face recognition API interface, the newly uploaded API file and the API file library 16 store the API file API interface call. If the description is different, the uploaded API file is a stored API file of the interface change; if the API file library 16 does not store the face recognition API interface, the uploaded API file is a newly added API file.
  • step S40 the API file management program 10 sends the prompt information of the preset format to the client 4.
  • the API file is a stored API file whose face recognition API interface is changed by the interface name of the uploaded API file
  • the interface change prompt information is sent to the client 4, for example, “the face recognition API interface has been changed.
  • the new interface is ***".
  • step S50 if the uploaded API file is a newly added API file, the API file management program 10 assigns a label to the API code and the API file of the newly added API interface, and establishes a mapping relationship between the API code and the API file through the label.
  • the tag is a unique tag name automatically generated in order according to the tag list 17.
  • the newly uploaded age prediction API interface file is a new API file, and the largest tag number stored in the tag list is the tag 022, and the API file management program 10 automatically generates a tag 023 according to the tag list 17 in order, and the tag is 023 is assigned to the API code and API file of the age prediction API interface, and the mapping relationship between the API code of the age prediction API interface and the API file is established through the tag 023.
  • step S60 the API file management program 10 sets the association relationship between the tag and the client address, and sends a message prompting the interface change to the client 4 when the interface in the API file is changed.
  • the client address may be an IP address or a mailbox.
  • the client 4 refers to the caller of the API interface corresponding to the API file. For example, the association relationship between the label 023 and the client address is set.
  • the interface change prompt information is sent to the client 4, for example, “the age prediction API interface has changed, and the new interface is *** ".
  • step S70 after the setting relationship between the label and the client address is completed, the API file management program 10 sends the feedback information in the preset format to the server 3.
  • the feedback information may be sent to the server 3 by using a mailbox or a short message. For example, after the association between the label and the client address is set, the feedback information is sent to the mailbox of the server 3, for example, “the label corresponding to the newly added age prediction API interface is set”.
  • the failure prompt information may be set in the assigning step or the setting step, and the failure prompt for sending the preset format to the mailbox of the server 3 when the label is assigned or the association between the label and the client address fails.
  • Information and reasons for failure For example, if the association between the label and the client address fails, the feedback message is sent to the mailbox of the server 3, for example, the label setting corresponding to the newly added *** API interface fails, and the reason for the failure is ***, please handle it in time. Or "The new *** API interface *** failed for the following reasons: ***, please handle it in time.”
  • the API file management method proposed in this embodiment sends feedback information to the server 3 after setting the association relationship between the tag and the client address, thereby improving real-time monitoring of the API file management.
  • the API file update fails, it will be processed in time.
  • the embodiment of the present application further provides a computer readable storage medium, where the computer readable storage medium includes an API file management program 10, and when the API file management program 10 is executed by the processor, the following operations are implemented:
  • Receiving step receiving an API file newly uploaded by the server
  • the judging step is: determining, according to the interface name in the API file, whether the interface is a stored API file that is changed by the interface, or a new API file. If the interface of the stored API file is changed, the prompt information of the preset format is sent to the client, and the process ends. If the API file is added, the process enters the allocation step;
  • Assignment step assign a label to the API code and API file of the newly added API interface, and establish a mapping relationship between the API code and the API file through the label;
  • Setup steps Set the association between the tag and the client address.
  • the method further comprises: separating the code of the API interface from the API file in the server, providing a code library storage API code, and an API file library storage API file.
  • the determining step further includes:
  • the API file Comparing the interface name of the newly uploaded API file with the interface name of the API file stored in the API file library. If the interface name of the newly uploaded API file is the same as the interface name of an API file stored in the API file library, then The API file is a stored API file of the interface change. If the interface name of the newly uploaded API file is different from the interface name of all the API files stored in the API file library, it is determined that the API file is a new API file.
  • the method further includes: after the setting of the association relationship between the label and the client address is completed, sending the feedback information in a preset format to the server.
  • the tags automatically generate a unique tag name based on the order of the tag list.
  • the technical solution of the present application which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM as described above). , a disk, an optical disk, including a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the various embodiments of the present application.
  • a terminal device which may be a mobile phone, a computer, a server, or a network device, etc.

Abstract

The present application discloses an API file management method, a server, and a storage medium, said method comprising: receiving an API file newly uploaded by a server; determining, according to an interface name in the API file, whether the API file is a stored API file having a changed interface or a newly added API file; if the API file is a stored API file having a changed interface, sending, to a client, prompt information having a predetermined format, and ending the process; if the API file is a newly added API file, assigning a label to an API code of a newly added API interface and the API file, and establishing, by means of the label, a mapping relationship between the API code and the API file; and setting an association relationship between the label and the address of the client, so as to effectively monitor the interface migration and avoid code intrusion.

Description

API文件管理方法、服务器及存储介质API file management method, server and storage medium
优先权申明Priority claim
本申请要求于2018年01月11日提交中国专利局、申请号为201810026284.X,名称为“API文件管理方法、服务器及存储介质”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合本申请中。This application claims the priority of the Chinese Patent Application entitled "API File Management Method, Server and Storage Media" submitted by the Chinese Patent Office on January 11, 2018, with the application number 201810026284.X, the overall content of the Chinese patent application This application is incorporated by reference.
技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种应用程序接口(Application Programming Interface,API)文件管理方法、服务器及计算机可读存储介质。The present application relates to the field of computer technologies, and in particular, to an application programming interface (API) file management method, a server, and a computer readable storage medium.
背景技术Background technique
API文件是关于API接口调用的描述性文件,每个API文件包括API接口和API接口调用说明。目前,API文件的管理主要有两种,一种是在实现API接口的代码中加大量注释,通过工具自动生成rest风格的API文件,这种类型的API文件具有很强的代码入侵性,大大降低代码的可读性;另一种是创建markdown文件,在markdown文件中添加API接口描述,这种类型的API文件在接口变更的情况下难以及时修改,同时在多人协作、前后端分离的场景下,应用效果不佳。The API file is a descriptive file about API interface calls. Each API file includes API interface and API interface call instructions. At present, there are two main types of API file management. One is to add a lot of comments in the code that implements the API interface, and automatically generate rest style API files through tools. This type of API file has strong code intrusion. Reduce the readability of the code; the other is to create a markdown file, add API interface description in the markdown file, this type of API file is difficult to modify in time when the interface is changed, and at the same time, multi-person collaboration, front-end separation In the scenario, the application is not working well.
发明内容Summary of the invention
鉴于以上内容,本申请提供一种API文件管理方法、服务器及计算机可读存储介质,能够对API接口进行实时监控,提高代码的可读性,有利于API接口变更时及时进行修改和通知客户端。In view of the above, the present application provides an API file management method, a server, and a computer readable storage medium, which can perform real-time monitoring on an API interface, improve the readability of the code, and facilitate timely modification and notification of the client when the API interface is changed. .
为实现上述目的,本申请提供一种API文件管理方法,该方法包括:To achieve the above objective, the present application provides an API file management method, including:
接收步骤:接收服务端新上传的一份API文件;Receiving step: receiving an API file newly uploaded by the server;
判断步骤:根据API文件中的接口名称判断是接口变更的已存储API文件,还是新增的API文件,若是接口变更的已存储API文件,则发送预设格式的提示信息给客户端、流程结束,若是新增的API文件,则流程进入分配步骤;The judging step is: determining, according to the interface name in the API file, whether the interface is a stored API file that is changed by the interface, or a new API file, and if the interface is a stored API file, the prompt information in the preset format is sent to the client, and the process ends. If the API file is added, the process enters the allocation step;
分配步骤:为新增API接口的API代码及API文件分配一个标签,通过标签 建立API代码与API文件之间的映射关系;Assignment step: assign a label to the API code and API file of the newly added API interface, and establish a mapping relationship between the API code and the API file through the label;
设置步骤:设置该标签与客户端地址之间的关联关系。Setup steps: Set the association between the tag and the client address.
优选地,该方法还包括:在服务器中将API接口的代码与API文件进行分离,提供代码库存储API代码,API文件库存储API文件。Preferably, the method further comprises: separating the code of the API interface from the API file in the server, providing a code library storage API code, and an API file library storage API file.
优选地,所述判断步骤还包括:Preferably, the determining step further includes:
将新上传的API文件的接口名称与API文件库中存储的API文件的接口名称相比较,若新上传的API文件的接口名称与API文件库中存储的某个API文件的接口名称相同,则判断该API文件是接口变更的已存储API文件,若新上传的API文件的接口名称与API文件库中存储的所有API文件的接口名称不同,则判断该API文件是新增的API文件。Comparing the interface name of the newly uploaded API file with the interface name of the API file stored in the API file library. If the interface name of the newly uploaded API file is the same as the interface name of an API file stored in the API file library, then The API file is a stored API file of the interface change. If the interface name of the newly uploaded API file is different from the interface name of all the API files stored in the API file library, it is determined that the API file is a new API file.
优选地,该方法还包括:标签与客户端地址之间的关联关系设置完成后,发送预设格式的反馈信息给服务端。Preferably, the method further includes: after the setting of the association relationship between the label and the client address is completed, sending the feedback information in a preset format to the server.
优选地,所述标签是根据标签列表的顺序自动生成一个唯一的标记名称。Preferably, the tags automatically generate a unique tag name based on the order of the tag list.
此外,本申请还提供一种服务器,该服务器包括:存储器、处理器、显示器及存储在所述存储器上并可在所述处理器上运行的API文件管理程序,所述API文件管理程序被所述处理器执行,可实现如下步骤:In addition, the present application also provides a server, the server includes: a memory, a processor, a display, and an API file management program stored on the memory and executable on the processor, where the API file management program is The processor executes, and the following steps can be implemented:
接收步骤:接收服务端新上传的一份API文件;Receiving step: receiving an API file newly uploaded by the server;
判断步骤:根据API文件中的接口名称判断是接口变更的已存储API文件,还是新增的API文件,若是已存储API文件的接口变更,则发送预设格式的提示信息给客户端、流程结束,若是新增的API文件,则流程进入分配步骤;The judging step is: determining, according to the interface name in the API file, whether the interface is a stored API file that is changed by the interface, or a new API file. If the interface of the stored API file is changed, the prompt information of the preset format is sent to the client, and the process ends. If the API file is added, the process enters the allocation step;
分配步骤:为新增API接口的API代码及API文件分配一个标签,通过标签建立API代码与API文件之间的映射关系;Assignment step: assign a label to the API code and API file of the newly added API interface, and establish a mapping relationship between the API code and the API file through the label;
设置步骤:设置该标签与客户端地址之间的关联关系。Setup steps: Set the association between the tag and the client address.
优选地,所述API文件管理程序被所述处理器执行,还实现如下步骤:在服务器中将API接口的代码与API文件进行分离,提供代码库存储API代码,API文件库存储API文件。Preferably, the API file management program is executed by the processor, and further implements the steps of: separating the code of the API interface from the API file in the server, providing a code library storage API code, and an API file library storage API file.
优选地,所述判断步骤还包括:Preferably, the determining step further includes:
将新上传的API文件的接口名称与API文件库中存储的API文件的接口名称相比较,若新上传的API文件的接口名称与API文件库中存储的某个API 文件的接口名称相同,则判断该API文件是接口变更的已存储API文件,若新上传的API文件的接口名称与API文件库中存储的所有API文件的接口名称不同,则判断该API文件是新增的API文件。Comparing the interface name of the newly uploaded API file with the interface name of the API file stored in the API file library. If the interface name of the newly uploaded API file is the same as the interface name of an API file stored in the API file library, then The API file is a stored API file of the interface change. If the interface name of the newly uploaded API file is different from the interface name of all the API files stored in the API file library, it is determined that the API file is a new API file.
优选地,所述API文件管理程序被所述处理器执行,还实现如下步骤:标签与客户端地址之间的关联关系设置完成后,发送预设格式的反馈信息给服务端。Preferably, the API file management program is executed by the processor, and the following steps are further implemented: after the setting of the association relationship between the tag and the client address is completed, the feedback information of the preset format is sent to the server.
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质中包括API文件管理程序,所述API文件管理程序被处理器执行时,可实现如上所述API文件管理方法中的任意步骤。In addition, in order to achieve the above object, the present application further provides a computer readable storage medium, where the computer readable storage medium includes an API file management program, and when the API file management program is executed by a processor, the foregoing can be implemented as described above. Any step in the API file management method.
本申请提出的API文件管理方法、服务器及计算机可读存储介质,通过接收服务端新上传的一份API文件,利用API文件中的接口名称判断是接口变更的已存储API文件,还是新增的API文件,若是接口变更的已存储API文件,则发送预设格式的提示信息给客户端,若是新增的API文件,则为新增API接口的API代码及API文件分配一个标签,接着通过标签建立API代码与API文件之间的映射关系,最后设置该标签与客户端地址之间的关联关系,从而实现对API接口变更的有效监控,及时对变更的API接口进行修改。The API file management method, the server and the computer readable storage medium proposed by the application, by receiving an API file newly uploaded by the server, using the interface name in the API file to determine whether the interface is a stored API file changed, or is added The API file, if it is a stored API file of the interface change, sends a prompt message in a preset format to the client. If the API file is added, a label is added to the API code and the API file of the new API interface, and then the label is passed. Establish a mapping relationship between the API code and the API file, and finally set the association relationship between the tag and the client address, thereby effectively monitoring the API interface change, and modifying the changed API interface in time.
附图说明DRAWINGS
图1为本申请服务器较佳实施例的示意图;1 is a schematic diagram of a preferred embodiment of a server of the present application;
图2为本申请API文件管理方法的应用环境示意图;2 is a schematic diagram of an application environment of an API file management method according to the present application;
图3为图1或图2中API文件管理程序较佳实施例的模块示意图;3 is a block diagram showing a preferred embodiment of the API file management program in FIG. 1 or FIG. 2;
图4为本申请API文件管理方法较佳实施例的流程图;4 is a flowchart of a preferred embodiment of an API file management method according to the present application;
图5为本申请API文件管理方法第二实施例的流程图。FIG. 5 is a flowchart of a second embodiment of an API file management method according to the present application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The implementation, functional features and advantages of the present application will be further described with reference to the accompanying drawings.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限 定本申请。It is understood that the specific embodiments described herein are merely illustrative of the application and are not intended to limit the application.
如图1所示,是本申请服务器1较佳实施例的示意图。As shown in FIG. 1, it is a schematic diagram of a preferred embodiment of the server 1 of the present application.
在本实施例中,服务器1可以是服务器、智能手机、平板电脑、个人电脑、便携计算机以及其它具有运算功能的电子设备。In this embodiment, the server 1 may be a server, a smart phone, a tablet computer, a personal computer, a portable computer, and other electronic devices having computing functions.
该服务器1包括:存储器11、处理器12、网络接口13、通信总线14及存储在存储器11上并可在所述处理器12上运行的API文件管理程序10。The server 1 includes a memory 11, a processor 12, a network interface 13, a communication bus 14, and an API file management program 10 stored on the memory 11 and executable on the processor 12.
其中,网络接口13可选地可以包括标准的有线接口、无线接口(如WI-FI接口),通常用于在该服务器与其它电子设备之间建立通信连接。通信总线14用于实现这些组件之间的连接通信。The network interface 13 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is generally used to establish a communication connection between the server and other electronic devices. Communication bus 14 is used to implement connection communication between these components.
存储器11至少包括一种类型的可读存储介质。所述至少一种类型的可读存储介质可为如闪存、硬盘、多媒体卡、卡型存储器等的非易失性存储介质。在一些实施例中,所述存储器11可以是所述服务器1的内部存储单元,例如该服务器1的硬盘。在另一些实施例中,所述存储器11也可以是所述服务器1的外部存储单元,例如所述服务器1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card,FC)等。The memory 11 includes at least one type of readable storage medium. The at least one type of readable storage medium may be a non-volatile storage medium such as a flash memory, a hard disk, a multimedia card, a card type memory, or the like. In some embodiments, the memory 11 may be an internal storage unit of the server 1, such as a hard disk of the server 1. In other embodiments, the memory 11 may also be an external storage unit of the server 1, such as a plug-in hard disk equipped on the server 1, a smart memory card (SMC), and a secure digital ( Secure Digital, SD) cards, flash cards (FC cards), etc.
在本实施例中,所述存储器11不仅可以用于存储安装于所述服务器1的应用软件及各类数据,例如API文件管理程序10、API接口代码、API文件等,还可以用于暂时地存储已经输出或者将要输出的数据,如接口类。In this embodiment, the memory 11 can be used not only for storing application software and various types of data installed in the server 1, such as an API file management program 10, an API interface code, an API file, etc., but also for temporarily Stores data that has been output or will be output, such as an interface class.
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU),微处理器或其它数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行API文件管理程序10的计算机程序代码等。The processor 12, in some embodiments, may be a Central Processing Unit (CPU), microprocessor or other data processing chip for running program code or processing data stored in the memory 11, such as performing API file management. The computer program code of the program 10, and the like.
优选地,该服务器1还可以包括显示器,显示器可以称为显示屏或显示单元。在一些实施例中显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及有机发光二极管(Organic Light-Emitting Diode,OLED)触摸器等。显示器用于显示在服务器1中处理的信息以及用于显示可视化的工作界面。Preferably, the server 1 may also include a display, which may be referred to as a display screen or display unit. In some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an Organic Light-Emitting Diode (OLED) touch sensor. The display is used to display information processed in the server 1 and a work interface for displaying visualizations.
图1仅示出了具有组件11-14以及执行API文件管理程序10的计算机程序代码的服务器1,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。Figure 1 shows only server 1 having components 11-14 and computer program code for executing API file management program 10, but it should be understood that not all illustrated components may be implemented, alternative implementations may be more or more Less components.
优选地,该服务器1还可以包括输入单元比如键盘(Keyboard)、语音输 出装置比如音响、耳机等。Preferably, the server 1 may further include an input unit such as a keyboard, a voice output device such as an audio, a headphone, and the like.
在图1所示的服务器1实施例中,作为一种计算机存储介质的存储器11中存储API文件管理程序10的程序代码,处理器12执行API文件管理程序10的程序代码时,实现如下步骤:In the embodiment of the server 1 shown in FIG. 1, the program code of the API file management program 10 is stored in the memory 11 as a computer storage medium. When the processor 12 executes the program code of the API file management program 10, the following steps are implemented:
接收步骤:接收服务端新上传的一份API文件;Receiving step: receiving an API file newly uploaded by the server;
判断步骤:根据API文件中的接口名称判断是接口变更的已存储API文件,还是新增的API文件,若是接口变更的已存储API文件,则发送预设格式的提示信息给客户端、流程结束,若是新增的API文件,则流程进入分配步骤;The judging step is: determining, according to the interface name in the API file, whether the interface is a stored API file that is changed by the interface, or a new API file, and if the interface is a stored API file, the prompt information in the preset format is sent to the client, and the process ends. If the API file is added, the process enters the allocation step;
分配步骤:为新增API接口的API代码及API文件分配一个标签,通过标签建立API代码与API文件之间的映射关系;Assignment step: assign a label to the API code and API file of the newly added API interface, and establish a mapping relationship between the API code and the API file through the label;
设置步骤:设置该标签与客户端地址之间的关联关系。Setup steps: Set the association between the tag and the client address.
本实施例中,如图2所示,是本申请API文件管理方法的应用环境示意图。服务器1将API代码与API文件进行分离,提供API代码库15存储API接口的代码,API文件库16存储API文件,但API代码库15与API文件库由服务器1统一管理分配。当API文件管理程序10接收到服务端3新上传的一份API文件时,启动API文件管理程序10。其中,所述API文件是API接口的描述性文件,每个API文件包括API文件接口名称和API接口调用说明,所述API接口调用说明包括API接口中的方法、类的功能、参数等相关说明。以人脸识别接口为例对本申请的方案进行解释,当接收到服务端3新上传一份关于人脸识别API接口的API文件时,启动API文件管理程序10。所述服务端3指该API文件对应的API接口的提供方。所述客户端4指该API文件对应的API接口的调用方。例如,服务端3提供人脸识别接口,客户端4调用人脸识别接口进行人脸识别应用。In this embodiment, as shown in FIG. 2, it is a schematic diagram of an application environment of the API file management method of the present application. The server 1 separates the API code from the API file, provides the API code library 15 to store the code of the API interface, and the API file library 16 stores the API file, but the API code library 15 and the API file library are collectively managed and distributed by the server 1. When the API file management program 10 receives an API file newly uploaded by the server 3, the API file management program 10 is started. The API file is a descriptive file of an API interface, and each API file includes an API file interface name and an API interface call description, and the API interface call description includes a method, a function, a parameter, and the like in the API interface. . The solution of the present application is explained by taking the face recognition interface as an example. When the server 3 is newly uploaded with an API file about the face recognition API interface, the API file management program 10 is started. The server 3 refers to a provider of an API interface corresponding to the API file. The client 4 refers to the caller of the API interface corresponding to the API file. For example, the server 3 provides a face recognition interface, and the client 4 invokes a face recognition interface for a face recognition application.
API文件管理程序10通过上传的API文件的接口名称判断该API文件是接口变更的已存储API文件,还是新增的API文件。假设判断出上传的API文件是接口变更的已存储API文件,则发送预设格式的接口变更提示信息给客户端4。例如,通过上传的API文件的接口名称判断该API文件是人脸识别API接口变更的已存储的API文件,则向客户端4发送接口变更提示信息,如“人脸识别API接口已发生变更,新的接口为***”。其中,具体的判断方 法包括:将新上传的API文件的接口名称与API文件库16中存储的API文件的接口名称相比较,若新上传的API文件的接口名称与API文件库16中存储的某个API文件的接口名称相同,则判断该API文件是接口变更的已存储API文件,若新上传的API文件的接口名称与API文件库16中存储的所有API文件的接口名称不同,则判断该API文件是新增API文件。例如,新上传的API文件的API接口名称为人脸识别API接口,若API文件库16中同样存储人脸识别API接口,但新上传的API文件与API文件库16中存储API文件的API接口调用说明不同,则说明上传的API文件是接口变更的已存储API文件;若API文件库16中没有存储人脸识别API接口,则说明上传的API文件是新增的API文件。The API file management program 10 determines whether the API file is a stored API file of an interface change or a new API file by the interface name of the uploaded API file. If it is determined that the uploaded API file is a stored API file of the interface change, the interface change prompt information of the preset format is sent to the client 4. For example, if the API file is a stored API file whose face recognition API interface is changed by the interface name of the uploaded API file, the interface change prompt information is sent to the client 4, for example, “the face recognition API interface has been changed. The new interface is ***". The specific judging method includes: comparing the interface name of the newly uploaded API file with the interface name of the API file stored in the API file library 16, if the interface name of the newly uploaded API file is stored in the API file library 16 If the interface name of an API file is the same, it is determined that the API file is a stored API file of the interface change. If the interface name of the newly uploaded API file is different from the interface name of all the API files stored in the API file library 16, it is determined. This API file is a new API file. For example, the API interface name of the newly uploaded API file is a face recognition API interface. If the API file library 16 also stores the face recognition API interface, the newly uploaded API file and the API file library 16 store the API file API interface call. If the description is different, the uploaded API file is a stored API file of the interface change; if the API file library 16 does not store the face recognition API interface, the uploaded API file is a newly added API file.
假设上传的API文件是新增的API文件,API文件管理程序10为新增API接口的API代码及API文件分配一个标签,通过标签建立API代码与API文件之间的映射关系。其中,所述标签是根据标签列表17的顺序自动生成的一个唯一的标记名称,所述标签列表是指用于存储标签的文件。例如,新上传的年龄预测API接口文件为新增的API文件,标签列表中存储最大的标签号为标签022,则API文件管理程序10根据标签列表17按顺序自动生成一个标签023,并将标签023分配给年龄预测API接口的API代码和API文件,通过标签023建立起年龄预测API接口的API代码与API文件的映射关系。Assuming that the uploaded API file is a new API file, the API file management program 10 assigns a label to the API code and the API file of the newly added API interface, and establishes a mapping relationship between the API code and the API file through the label. The tag is a unique tag name automatically generated according to the order of the tag list 17, and the tag list refers to a file for storing tags. For example, the newly uploaded age prediction API interface file is a new API file, and the largest tag number stored in the tag list is the tag 022, and the API file management program 10 automatically generates a tag 023 according to the tag list 17 in order, and the tag is 023 is assigned to the API code and API file of the age prediction API interface, and the mapping relationship between the API code of the age prediction API interface and the API file is established through the tag 023.
API文件管理程序10设置该标签与客户端4地址之间的关联关系,为后续当该API文件中的接口变更时,发送提示接口变更的信息给客户端4。其中,所述客户端4指该API文件对应的API接口的调用方。例如,设置标签023与客户端地址之间的关联关系,当后续年龄预测接口变更时,向客户端4发送接口变更提示信息,如“年龄预测API接口已发生变更,新的接口为***”。The API file management program 10 sets the association relationship between the tag and the client 4 address, and sends a message prompting the interface change to the client 4 when the interface in the API file is changed. The client 4 refers to the caller of the API interface corresponding to the API file. For example, the association relationship between the label 023 and the client address is set. When the subsequent age prediction interface is changed, the interface change prompt information is sent to the client 4, for example, “the age prediction API interface has changed, and the new interface is *** ".
上述实施例提出的API文件管理方法与rest风格的API文件管理方法、markdown文件管理方法不同,rest风格的API文件是在代码中添加大量注释,即代码与API文件相结合,降低代码可读性;markdown文件与本文提及的API文件都是代码与API文件相分离,但markdown文件需手动描述,markdown文件的代码与API文件分别由后端、前端管理,API接口变更时更新不同步且多人协作的分离场景下表现较差,本文提及的API文件与代码均由后台管理,能够有效监控API接口的变更或新增,从而使得API接口变更时及时通 知客户端4,避免代码入侵性。The API file management method proposed by the above embodiment is different from the rest style API file management method and the markdown file management method. The rest style API file adds a large number of comments in the code, that is, the code is combined with the API file to reduce the code readability. The markdown file and the API file mentioned in this article are separated from the API file, but the markdown file needs to be manually described. The code and API file of the markdown file are managed by the backend and frontend respectively, and the update is not synchronized when the API interface is changed. The separation of human collaboration is poor. The API files and code mentioned in this article are managed by the background. It can effectively monitor the changes or additions of the API interface, so that the client interface can be notified in time when the API interface is changed, to avoid code intrusion. .
可选地,在其他的实施例中,媒体文件处理程序10还可以被分割为一个或者多个模块,一个或者多个模块被存储于存储器11中,并由一个或多个处理器(本实施例为处理器12)所执行,以完成本申请。Optionally, in other embodiments, the media file processing program 10 may also be divided into one or more modules, one or more modules are stored in the memory 11 and executed by one or more processors (this implementation) The example is executed by the processor 12) to complete the application.
如图3所示,是图1或图2中API文件管理程序10较佳实施例的模块示意图。本申请所称的模块是指能够完成特定功能的一系列计算机程序指令段。As shown in FIG. 3, it is a block diagram of a preferred embodiment of the API file management program 10 of FIG. 1 or 2. A module as referred to in this application refers to a series of computer program instructions that are capable of performing a particular function.
在本实施例中,API文件管理程序10包括:接收模块110、判断模块120、分配模块130及设置模块140,所述模块110-140所实现的功能或操作步骤均与上文类似,此处不再详述,示例性地,例如其中:In this embodiment, the API file management program 10 includes: a receiving module 110, a determining module 120, an allocating module 130, and a setting module 140. The functions or operating steps implemented by the modules 110-140 are similar to the above. No more detailed, by way of example, such as:
接收模块110,用于接收服务端新上传的一份API文件;The receiving module 110 is configured to receive an API file newly uploaded by the server;
判断模块120,用于根据API文件中的接口名称判断是接口变更的已存储API文件,还是新增的API文件,若是接口变更的已存储API文件,则发送预设格式的提示信息给客户端、流程结束,若是新增的API文件,则流程进入分配步骤;The determining module 120 is configured to determine, according to the interface name in the API file, whether the interface is a stored API file that is changed by the interface, or a new API file, and if the interface is a stored API file, the prompt information of the preset format is sent to the client. The process ends. If the API file is added, the process enters the allocation step;
分配模块130,用于为新增API接口的API代码及API文件分配一个标签,通过标签建立API代码与API文件之间的映射关系;The distribution module 130 is configured to allocate a label for the API code and the API file of the newly added API interface, and establish a mapping relationship between the API code and the API file through the label;
设置模块140,用于设置该标签与客户端地址之间的关联关系。The setting module 140 is configured to set an association relationship between the label and the client address.
如图4所示,是本申请API文件管理方法较佳实施例的流程图。As shown in FIG. 4, it is a flowchart of a preferred embodiment of the API file management method of the present application.
在本实施例中,处理器12执行存储器11中存储的API文件管理程序10的计算机程序时实现API文件管理方法包括步骤S10-S60:In the present embodiment, when the processor 12 executes the computer program of the API file management program 10 stored in the memory 11, the implementation of the API file management method includes steps S10-S60:
步骤S10,当API文件管理程序10接收到服务端3新上传的一份API文件时,启动API文件管理程序10。其中,所述API文件是API接口的描述性文件,每个API文件包括API文件接口名称和API接口调用说明,所述API接口调用说明包括API接口中的方法、类的功能、参数等相关说明。以人脸识别接口为例对本申请的方案进行解释,当接收到服务端3新上传一份关于人脸识别API接口的API文件时,启动API文件管理程序10。所述服务端3指该API文件对应的API接口的提供方。所述客户端4指该API文件对应的API接口的调用方。例如,服务端3提供人脸识别接口,客户端4调用人脸识别接口进行人脸识别应用。In step S10, when the API file management program 10 receives an API file newly uploaded by the server 3, the API file management program 10 is started. The API file is a descriptive file of an API interface, and each API file includes an API file interface name and an API interface call description, and the API interface call description includes a method, a function, a parameter, and the like in the API interface. . The solution of the present application is explained by taking the face recognition interface as an example. When the server 3 is newly uploaded with an API file about the face recognition API interface, the API file management program 10 is started. The server 3 refers to a provider of an API interface corresponding to the API file. The client 4 refers to the caller of the API interface corresponding to the API file. For example, the server 3 provides a face recognition interface, and the client 4 invokes a face recognition interface for a face recognition application.
步骤S20,API文件管理程序10通过上传的API文件的接口名称判断该API文件是接口变更的已存储API文件,还是新增的API文件。In step S20, the API file management program 10 determines whether the API file is a stored API file of the interface change or a new API file by using the interface name of the uploaded API file.
步骤S30,假设判断出上传的API文件是接口变更的已存储API文件,则执行步骤S40。假设判断出上传的API文件是新增的API文件,则执行步骤S50。其中,具体的判断方法包括:将新上传的API文件的接口名称与API文件库16中存储的API文件的接口名称相比较,若新上传的API文件的接口名称与API文件库16中存储的某个API文件的接口名称相同,则判断该API文件是接口变更的已存储API文件,若新上传的API文件的接口名称与API文件库16中存储的所有API文件的接口名称不同,则判断该API文件是新增API文件。例如,新上传的API文件的API接口名称为人脸识别API接口,若API文件库16中同样存储人脸识别API接口,但新上传的API文件与API文件库16中存储API文件的API接口调用说明不同,则说明上传的API文件是接口变更的已存储API文件;若API文件库16中没有存储人脸识别API接口,则说明上传的API文件是新增的API文件。In step S30, if it is determined that the uploaded API file is a stored API file of the interface change, step S40 is performed. If it is determined that the uploaded API file is a new API file, step S50 is performed. The specific judging method includes: comparing the interface name of the newly uploaded API file with the interface name of the API file stored in the API file library 16, if the interface name of the newly uploaded API file is stored in the API file library 16 If the interface name of an API file is the same, it is determined that the API file is a stored API file of the interface change. If the interface name of the newly uploaded API file is different from the interface name of all the API files stored in the API file library 16, it is determined. This API file is a new API file. For example, the API interface name of the newly uploaded API file is a face recognition API interface. If the API file library 16 also stores the face recognition API interface, the newly uploaded API file and the API file library 16 store the API file API interface call. If the description is different, the uploaded API file is a stored API file of the interface change; if the API file library 16 does not store the face recognition API interface, the uploaded API file is a newly added API file.
步骤S40,API文件管理程序10发送预设格式的提示信息给客户端4。例如,通过上传的API文件的接口名称判断该API文件是人脸识别API接口变更的已存储的API文件,则向客户端4发送接口变更提示信息,如“人脸识别API接口已发生变更,新的接口为***”。In step S40, the API file management program 10 sends the prompt information of the preset format to the client 4. For example, if the API file is a stored API file whose face recognition API interface is changed by the interface name of the uploaded API file, the interface change prompt information is sent to the client 4, for example, “the face recognition API interface has been changed. The new interface is ***".
步骤S50,若上传的API文件是新增的API文件,API文件管理程序10为新增API接口的API代码及API文件分配一个标签,通过标签建立API代码与API文件之间的映射关系。其中,所述标签是根据标签列表17按顺序自动生成的一个唯一的标记名称。例如,新上传的年龄预测API接口文件为新增的API文件,标签列表中存储最大的标签号为标签022,则API文件管理程序10根据标签列表17按顺序自动生成一个标签023,并将标签023分配给年龄预测API接口的API代码和API文件,通过标签023建立起年龄预测API接口的API代码与API文件的映射关系。In step S50, if the uploaded API file is a newly added API file, the API file management program 10 assigns a label to the API code and the API file of the newly added API interface, and establishes a mapping relationship between the API code and the API file through the label. Wherein, the tag is a unique tag name automatically generated in order according to the tag list 17. For example, the newly uploaded age prediction API interface file is a new API file, and the largest tag number stored in the tag list is the tag 022, and the API file management program 10 automatically generates a tag 023 according to the tag list 17 in order, and the tag is 023 is assigned to the API code and API file of the age prediction API interface, and the mapping relationship between the API code of the age prediction API interface and the API file is established through the tag 023.
步骤S60,API文件管理程序10设置该标签与客户端地址之间的关联关系,为后续当该API文件中的接口变更时,发送提示接口变更的信息给客户端4。其中,所述客户端4指该API文件对应的API接口的调用方。例如,设置标签023与客户端地址之间的关联关系,当后续年龄预测接口变更时, 向客户端4发送接口变更提示信息,如“年龄预测API接口已发生变更,新的接口为***”。In step S60, the API file management program 10 sets the association relationship between the tag and the client address, and sends a message prompting the interface change to the client 4 when the interface in the API file is changed. The client 4 refers to the caller of the API interface corresponding to the API file. For example, the association relationship between the label 023 and the client address is set, and when the subsequent age prediction interface is changed, the interface change prompt information is sent to the client 4, for example, “the age prediction API interface has changed, and the new interface is *** ".
上述实施例提出的API文件管理方法,对服务端3上传的API进行判断,若是接口变更的API文件,则发送预设格式的提示信息给客户端4,若是新增的API文件,则分配一个标签并建立API代码与API文件之间的映射关系,再将该标签与客户端地址绑定,从而有效监控接口变更,能够及时通知客户端4,避免代码入侵性。The API file management method proposed in the foregoing embodiment determines the API uploaded by the server 3, and if the API file is changed by the interface, sends the prompt information in the preset format to the client 4, and if it is a new API file, assigns a The tag establishes a mapping relationship between the API code and the API file, and then binds the tag to the client address, thereby effectively monitoring the interface change, and can notify the client 4 in time to avoid code intrusion.
如图5所示,是本申请API文件管理方法第二实施例的流程图。As shown in FIG. 5, it is a flowchart of the second embodiment of the API file management method of the present application.
在本实施例中,处理器12执行存储器11中存储的API文件管理程序10的计算机程序时实现API文件管理方法包括步骤S10-S70:In the present embodiment, when the processor 12 executes the computer program of the API file management program 10 stored in the memory 11, the implementation of the API file management method includes steps S10-S70:
步骤S10,当API文件管理程序10接收到服务端3新上传的一份API文件时,启动API文件管理程序10。其中,所述API文件是API接口的描述性文件,每个API文件包括API文件接口名称和API接口调用说明,所述API接口调用说明包括API接口中的方法、类的功能、参数等相关说明。以人脸识别项目为例对本申请的方案进行解释,当接收到服务端3新上传一份关于人脸识别API接口的API文件时,启动API文件管理程序10。所述服务端3指该API文件对应的API接口的提供方。所述客户端4指该API文件对应的API接口的调用方。例如,服务端3提供人脸识别接口,客户端4调用人脸识别接口进行人脸识别应用。In step S10, when the API file management program 10 receives an API file newly uploaded by the server 3, the API file management program 10 is started. The API file is a descriptive file of an API interface, and each API file includes an API file interface name and an API interface call description, and the API interface call description includes a method, a function, a parameter, and the like in the API interface. . The solution of the present application is explained by taking the face recognition item as an example. When the server 3 is newly uploaded with an API file about the face recognition API interface, the API file management program 10 is started. The server 3 refers to a provider of an API interface corresponding to the API file. The client 4 refers to the caller of the API interface corresponding to the API file. For example, the server 3 provides a face recognition interface, and the client 4 invokes a face recognition interface for a face recognition application.
步骤S20,API文件管理程序10通过上传的API文件的接口名称判断该API文件是接口变更的已存储API文件,还是新增的API文件。In step S20, the API file management program 10 determines whether the API file is a stored API file of the interface change or a new API file by using the interface name of the uploaded API file.
步骤S30,假设判断出上传的API文件是接口变更的已存储API文件,则执行步骤S40。假设判断出上传的API文件是新增的API文件,则执行步骤S50。其中,具体的判断方法包括:将新上传的API文件的接口名称与API文件库16中存储的API文件的接口名称相比较,若新上传的API文件的接口名称与API文件库16中存储的某个API文件的接口名称相同,则判断该API文件是接口变更的已存储API文件,若新上传的API文件的接口名称与API文件库16中存储的所有API文件的接口名称不同,则判断该API文件是新增API文件。例如,新上传的API文件的API接口名称为人脸识别API接口,若API文件库16中同样存储人脸识别API接口,但新上传的API文件与API文件库16中存储API文件的API 接口调用说明不同,则说明上传的API文件是接口变更的已存储API文件;若API文件库16中没有存储人脸识别API接口,则说明上传的API文件是新增的API文件。In step S30, if it is determined that the uploaded API file is a stored API file of the interface change, step S40 is performed. If it is determined that the uploaded API file is a new API file, step S50 is performed. The specific judging method includes: comparing the interface name of the newly uploaded API file with the interface name of the API file stored in the API file library 16, if the interface name of the newly uploaded API file is stored in the API file library 16 If the interface name of an API file is the same, it is determined that the API file is a stored API file of the interface change. If the interface name of the newly uploaded API file is different from the interface name of all the API files stored in the API file library 16, it is determined. This API file is a new API file. For example, the API interface name of the newly uploaded API file is a face recognition API interface. If the API file library 16 also stores the face recognition API interface, the newly uploaded API file and the API file library 16 store the API file API interface call. If the description is different, the uploaded API file is a stored API file of the interface change; if the API file library 16 does not store the face recognition API interface, the uploaded API file is a newly added API file.
步骤S40,API文件管理程序10发送预设格式的提示信息给客户端4。例如,通过上传的API文件的接口名称判断该API文件是人脸识别API接口变更的已存储的API文件,则向客户端4发送接口变更提示信息,如“人脸识别API接口已发生变更,新的接口为***”。In step S40, the API file management program 10 sends the prompt information of the preset format to the client 4. For example, if the API file is a stored API file whose face recognition API interface is changed by the interface name of the uploaded API file, the interface change prompt information is sent to the client 4, for example, “the face recognition API interface has been changed. The new interface is ***".
步骤S50,若上传的API文件是新增的API文件,API文件管理程序10为新增API接口的API代码及API文件分配一个标签,通过标签建立API代码与API文件之间的映射关系。其中,所述标签是根据标签列表17按顺序自动生成的一个唯一的标记名称。例如,新上传的年龄预测API接口文件为新增的API文件,标签列表中存储最大的标签号为标签022,则API文件管理程序10根据标签列表17按顺序自动生成一个标签023,并将标签023分配给年龄预测API接口的API代码和API文件,通过标签023建立起年龄预测API接口的API代码与API文件的映射关系。In step S50, if the uploaded API file is a newly added API file, the API file management program 10 assigns a label to the API code and the API file of the newly added API interface, and establishes a mapping relationship between the API code and the API file through the label. Wherein, the tag is a unique tag name automatically generated in order according to the tag list 17. For example, the newly uploaded age prediction API interface file is a new API file, and the largest tag number stored in the tag list is the tag 022, and the API file management program 10 automatically generates a tag 023 according to the tag list 17 in order, and the tag is 023 is assigned to the API code and API file of the age prediction API interface, and the mapping relationship between the API code of the age prediction API interface and the API file is established through the tag 023.
步骤S60,API文件管理程序10设置该标签与客户端地址之间的关联关系,为后续当该API文件中的接口变更时,发送提示接口变更的信息给客户端4。其中,所述客户端地址可以是IP地址或邮箱。所述客户端4指该API文件对应的API接口的调用方。例如,设置标签023与客户端地址之间的关联关系,当后续年龄预测接口变更时,向客户端4发送接口变更提示信息,如“年龄预测API接口已发生变更,新的接口为***”。In step S60, the API file management program 10 sets the association relationship between the tag and the client address, and sends a message prompting the interface change to the client 4 when the interface in the API file is changed. The client address may be an IP address or a mailbox. The client 4 refers to the caller of the API interface corresponding to the API file. For example, the association relationship between the label 023 and the client address is set. When the subsequent age prediction interface is changed, the interface change prompt information is sent to the client 4, for example, “the age prediction API interface has changed, and the new interface is *** ".
步骤S70,标签与客户端地址之间的关联关系设置完成后,API文件管理程序10发送预设格式的反馈信息给服务端3。其中,所述反馈信息可以通过邮箱或短信方式给服务端3。例如,标签与客户端地址之间的关联关系设置完成后,向服务端3的邮箱发送反馈信息,如“新增的年龄预测API接口对应的标签设置完毕”。In step S70, after the setting relationship between the label and the client address is completed, the API file management program 10 sends the feedback information in the preset format to the server 3. The feedback information may be sent to the server 3 by using a mailbox or a short message. For example, after the association between the label and the client address is set, the feedback information is sent to the mailbox of the server 3, for example, “the label corresponding to the newly added age prediction API interface is set”.
在另一个实施例中,还可以在分配步骤或设置步骤设置失败提示信息,用于在分配标签或设置标签与客户端地址关联关系失败时,向服务端3的邮箱发送预设格式的失败提示信息及失败原因。例如,设置标签与客户端地址关联关系失败时,向服务端3的邮箱发送反馈信息,如“新增的***API接口 对应的标签设置失败,失败原因为***,请及时处理”或“新增的***API接口***失败,原因如下:***,请及时处理”。In another embodiment, the failure prompt information may be set in the assigning step or the setting step, and the failure prompt for sending the preset format to the mailbox of the server 3 when the label is assigned or the association between the label and the client address fails. Information and reasons for failure. For example, if the association between the label and the client address fails, the feedback message is sent to the mailbox of the server 3, for example, the label setting corresponding to the newly added *** API interface fails, and the reason for the failure is ***, please handle it in time. Or "The new *** API interface *** failed for the following reasons: ***, please handle it in time."
相比于第一实施例,本实施例提出的API文件管理方法,在设置完标签与客户端地址之间的关联关系之后向服务端3发送反馈信息,提高对API文件管理的实时监控,使API文件更新失败时及时进行处理。Compared with the first embodiment, the API file management method proposed in this embodiment sends feedback information to the server 3 after setting the association relationship between the tag and the client address, thereby improving real-time monitoring of the API file management. When the API file update fails, it will be processed in time.
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质中包括API文件管理程序10,所述API文件管理程序10被处理器执行时实现如下操作:In addition, the embodiment of the present application further provides a computer readable storage medium, where the computer readable storage medium includes an API file management program 10, and when the API file management program 10 is executed by the processor, the following operations are implemented:
接收步骤:接收服务端新上传的一份API文件;Receiving step: receiving an API file newly uploaded by the server;
判断步骤:根据API文件中的接口名称判断是接口变更的已存储API文件,还是新增的API文件,若是已存储API文件的接口变更,则发送预设格式的提示信息给客户端、结束流程,若是新增的API文件,则流程进入分配步骤;The judging step is: determining, according to the interface name in the API file, whether the interface is a stored API file that is changed by the interface, or a new API file. If the interface of the stored API file is changed, the prompt information of the preset format is sent to the client, and the process ends. If the API file is added, the process enters the allocation step;
分配步骤:为新增API接口的API代码及API文件分配一个标签,通过标签建立API代码与API文件之间的映射关系;Assignment step: assign a label to the API code and API file of the newly added API interface, and establish a mapping relationship between the API code and the API file through the label;
设置步骤:设置该标签与客户端地址之间的关联关系。Setup steps: Set the association between the tag and the client address.
优选地,该方法还包括:在服务器中将API接口的代码与API文件进行分离,提供代码库存储API代码,API文件库存储API文件。Preferably, the method further comprises: separating the code of the API interface from the API file in the server, providing a code library storage API code, and an API file library storage API file.
优选地,所述判断步骤还包括:Preferably, the determining step further includes:
将新上传的API文件的接口名称与API文件库中存储的API文件的接口名称相比较,若新上传的API文件的接口名称与API文件库中存储的某个API文件的接口名称相同,则判断该API文件是接口变更的已存储API文件,若新上传的API文件的接口名称与API文件库中存储的所有API文件的接口名称不同,则判断该API文件是新增API文件。Comparing the interface name of the newly uploaded API file with the interface name of the API file stored in the API file library. If the interface name of the newly uploaded API file is the same as the interface name of an API file stored in the API file library, then The API file is a stored API file of the interface change. If the interface name of the newly uploaded API file is different from the interface name of all the API files stored in the API file library, it is determined that the API file is a new API file.
优选地,该方法还包括:标签与客户端地址之间的关联关系设置完成后,发送预设格式的反馈信息给服务端。Preferably, the method further includes: after the setting of the association relationship between the label and the client address is completed, sending the feedback information in a preset format to the server.
优选地,所述标签是根据标签列表的顺序自动生成一个唯一的标记名称。Preferably, the tags automatically generate a unique tag name based on the order of the tag list.
本申请之计算机可读存储介质的具体实施方式与上述API文件管理方法的具体实施方式大致相同,在此不再赘述。The specific implementation manner of the computer readable storage medium of the present application is substantially the same as the specific implementation manner of the foregoing API file management method, and details are not described herein again.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the embodiments of the present application are merely for the description, and do not represent the advantages and disadvantages of the embodiments.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。It is to be understood that the term "comprises", "comprising", or any other variants thereof, is intended to encompass a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a series of elements includes those elements. It also includes other elements not explicitly listed, or elements that are inherent to such a process, device, item, or method. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, the device, the item, or the method that comprises the element.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better. Implementation. Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM as described above). , a disk, an optical disk, including a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the various embodiments of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其它相关的技术领域,均同理包括在本申请的专利保护范围内。The above is only a preferred embodiment of the present application, and thus does not limit the scope of the patent application, and the equivalent structure or equivalent process transformation made by the specification and the drawings of the present application, or directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of this application.

Claims (20)

  1. 一种API文件管理方法,应用于服务器,服务器与服务端及客户端相连接,其特征在于,所述方法包括:An API file management method is applied to a server, and the server is connected to the server and the client, and the method includes:
    接收步骤:接收服务端新上传的一份API文件;Receiving step: receiving an API file newly uploaded by the server;
    判断步骤:根据API文件中的接口名称判断是接口变更的已存储API文件,还是新增的API文件,若是接口变更的已存储API文件,则发送预设格式的提示信息给客户端、流程结束,若是新增的API文件,则流程进入分配步骤;The judging step is: determining, according to the interface name in the API file, whether the interface is a stored API file that is changed by the interface, or a new API file, and if the interface is a stored API file, the prompt information in the preset format is sent to the client, and the process ends. If the API file is added, the process enters the allocation step;
    分配步骤:为新增API接口的API代码及API文件分配一个标签,通过标签建立API代码与API文件之间的映射关系;Assignment step: assign a label to the API code and API file of the newly added API interface, and establish a mapping relationship between the API code and the API file through the label;
    设置步骤:设置该标签与客户端地址之间的关联关系。Setup steps: Set the association between the tag and the client address.
  2. 根据权利要求1所述的API文件管理方法,其特征在于,该方法还包括:在服务器中将API接口的代码与API文件进行分离,提供代码库存储API代码,API文件库存储API文件。The API file management method according to claim 1, further comprising: separating the code of the API interface from the API file in the server, providing the code library storage API code, and the API file library storage API file.
  3. 根据权利要求2所述的API文件管理方法,其特征在于,所述API文件是API接口的描述性文件,每个API文件包括API文件接口名称和API接口调用说明。The API file management method according to claim 2, wherein the API file is a descriptive file of an API interface, and each API file includes an API file interface name and an API interface call description.
  4. 根据权利要求3所述的API文件管理方法,其特征在于,所述API接口调用说明包括:方法、类的功能、参数的相关说明。The API file management method according to claim 3, wherein the API interface call description comprises: a method, a function of the class, and a related description of the parameter.
  5. 根据权利要求1所述的API文件管理方法,其特征在于,所述判断步骤还包括:The API file management method according to claim 1, wherein the determining step further comprises:
    将新上传的API文件的接口名称与API文件库中存储的API文件的接口名称相比较,若新上传的API文件的接口名称与API文件库中存储的某个API文件的接口名称相同,则判断该API文件是接口变更的已存储API文件,若新上传的API文件的接口名称与API文件库中存储的所有API文件的接口名称不同,则判断该API文件是新增的API文件。Comparing the interface name of the newly uploaded API file with the interface name of the API file stored in the API file library. If the interface name of the newly uploaded API file is the same as the interface name of an API file stored in the API file library, then The API file is a stored API file of the interface change. If the interface name of the newly uploaded API file is different from the interface name of all the API files stored in the API file library, it is determined that the API file is a new API file.
  6. 根据权利要求1所述的API文件管理方法,其特征在于,该方法还包括:标签与客户端地址之间的关联关系设置完成后,发送预设格式的反馈信息给服务端。The API file management method according to claim 1, further comprising: sending the feedback information of the preset format to the server after the association between the label and the client address is completed.
  7. 根据权利要求6任一项所述的API文件管理方法,其特征在于,所述标签是根据标签列表的顺序自动生成一个唯一的标记名称。The API file management method according to any one of claims 6 to 4, wherein the tag automatically generates a unique tag name according to the order of the tag list.
  8. 一种服务器,其特征在于,所述服务器包括:存储器、处理器及显示器,所述存储器上存储有API文件管理程序,所述API文件管理程序被所述处理器执行,可实现如下步骤:A server, comprising: a memory, a processor and a display, wherein the memory stores an API file management program, and the API file management program is executed by the processor, and the following steps can be implemented:
    接收步骤:接收服务端新上传的一份API文件;Receiving step: receiving an API file newly uploaded by the server;
    判断步骤:根据API文件中的接口名称判断是接口变更的已存储API文件,还是新增的API文件,若是接口变更的已存储API文件,则发送预设格式的提示信息给客户端、流程结束,若是新增的API文件,则流程进入分配步骤;The judging step is: determining, according to the interface name in the API file, whether the interface is a stored API file that is changed by the interface, or a new API file, and if the interface is a stored API file, the prompt information in the preset format is sent to the client, and the process ends. If the API file is added, the process enters the allocation step;
    分配步骤:为新增API接口的API代码及API文件分配一个标签,通过标签建立API代码与API文件之间的映射关系;Assignment step: assign a label to the API code and API file of the newly added API interface, and establish a mapping relationship between the API code and the API file through the label;
    设置步骤:设置该标签与客户端地址之间的关联关系。Setup steps: Set the association between the tag and the client address.
  9. 根据权利要求8所述的服务器,其特征在于,所述API文件管理程序被所述处理器执行,还实现如下步骤:在服务器中将API接口的代码与API文件进行分离,提供代码库存储API代码,API文件库存储API文件。The server according to claim 8, wherein said API file management program is executed by said processor, and further comprising: separating a code of an API interface from an API file in a server, and providing a code library storage API Code, API file library storage API file.
  10. 根据权利要求9所述的服务器,其特征在于,所述API文件是API接口的描述性文件,每个API文件包括API文件接口名称和API接口调用说明。The server according to claim 9, wherein the API file is a descriptive file of an API interface, and each API file includes an API file interface name and an API interface call description.
  11. 根据权利要求10所述的服务器,其特征在于,所述API接口调用说明包括:方法、类的功能、参数的相关说明。The server according to claim 10, wherein the API interface call description comprises: a method, a function of a class, and a related description of the parameter.
  12. 根据权利要求8所述的服务器,其特征在于,所述判断步骤还包括:The server according to claim 8, wherein the determining step further comprises:
    将新上传的API文件的接口名称与API文件库中存储的API文件的接口名称相比较,若新上传的API文件的接口名称与API文件库中存储的某个API文件的接口名称相同,则判断该API文件是接口变更的已存储API文件,若新上传的API文件的接口名称与API文件库中存储的所有API文件的接口名称不同,则判断该API文件是新增的API文件。Comparing the interface name of the newly uploaded API file with the interface name of the API file stored in the API file library. If the interface name of the newly uploaded API file is the same as the interface name of an API file stored in the API file library, then The API file is a stored API file of the interface change. If the interface name of the newly uploaded API file is different from the interface name of all the API files stored in the API file library, it is determined that the API file is a new API file.
  13. 根据权利要求8所述的服务器,其特征在于,所述API文件管理程序被所述处理器执行,还实现如下步骤:标签与客户端地址之间的关联关系设置完成后,发送预设格式的反馈信息给服务端。The server according to claim 8, wherein the API file management program is executed by the processor, and the following steps are further implemented: after the association between the label and the client address is completed, the preset format is sent. Feedback to the server.
  14. 根据权利要求13所述的服务器,其特征在于,所述标签是根据标签列表的顺序自动生成一个唯一的标记名称。The server according to claim 13, wherein said tag automatically generates a unique tag name in accordance with the order of the tag list.
  15. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质 中包括API文件管理程序,所述统API文件管理程序被处理器执行时实现如下步骤:A computer readable storage medium, comprising: an API file management program, wherein the system API file management program is executed by a processor to implement the following steps:
    接收步骤:接收服务端新上传的一份API文件;Receiving step: receiving an API file newly uploaded by the server;
    判断步骤:根据API文件中的接口名称判断是接口变更的已存储API文件,还是新增的API文件,若是接口变更的已存储API文件,则发送预设格式的提示信息给客户端、流程结束,若是新增的API文件,则流程进入分配步骤;The judging step is: determining, according to the interface name in the API file, whether the interface is a stored API file that is changed by the interface, or a new API file, and if the interface is a stored API file, the prompt information in the preset format is sent to the client, and the process ends. If the API file is added, the process enters the allocation step;
    分配步骤:为新增API接口的API代码及API文件分配一个标签,通过标签建立API代码与API文件之间的映射关系;Assignment step: assign a label to the API code and API file of the newly added API interface, and establish a mapping relationship between the API code and the API file through the label;
    设置步骤:设置该标签与客户端地址之间的关联关系。Setup steps: Set the association between the tag and the client address.
  16. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述API文件管理程序被所述处理器执行,还实现如下步骤:在服务器中将API接口的代码与API文件进行分离,提供代码库存储API代码,API文件库存储API文件。The computer readable storage medium according to claim 15, wherein said API file management program is executed by said processor, and further comprising: separating a code of an API interface from an API file in a server, providing Code library storage API code, API file library storage API file.
  17. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述API文件是API接口的描述性文件,每个API文件包括API文件接口名称和API接口调用说明。The computer readable storage medium according to claim 16, wherein the API file is a descriptive file of an API interface, and each API file includes an API file interface name and an API interface call description.
  18. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述判断步骤还包括:The computer readable storage medium according to claim 15, wherein the determining step further comprises:
    将新上传的API文件的接口名称与API文件库中存储的API文件的接口名称相比较,若新上传的API文件的接口名称与API文件库中存储的某个API文件的接口名称相同,则判断该API文件是接口变更的已存储API文件,若新上传的API文件的接口名称与API文件库中存储的所有API文件的接口名称不同,则判断该API文件是新增的API文件。Comparing the interface name of the newly uploaded API file with the interface name of the API file stored in the API file library. If the interface name of the newly uploaded API file is the same as the interface name of an API file stored in the API file library, then The API file is a stored API file of the interface change. If the interface name of the newly uploaded API file is different from the interface name of all the API files stored in the API file library, it is determined that the API file is a new API file.
  19. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述API文件管理程序被所述处理器执行,还实现如下步骤:标签与客户端地址之间的关联关系设置完成后,发送预设格式的反馈信息给服务端。The computer readable storage medium according to claim 15, wherein the API file management program is executed by the processor, and further, the step of: sending the association relationship between the tag and the client address is completed, and then sending The feedback information of the preset format is sent to the server.
  20. 根据权利要求19所述的计算机可读存储介质,其特征在于,所述标签是根据标签列表的顺序自动生成一个唯一的标记名称。A computer readable storage medium according to claim 19, wherein said tag automatically generates a unique tag name based on the order of the tag list.
PCT/CN2018/077655 2018-01-11 2018-02-28 Api file management method, server, and storage medium WO2019136813A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810026284.XA CN108427560A (en) 2018-01-11 2018-01-11 API file management methods, server and storage medium
CN201810026284.X 2018-01-11

Publications (1)

Publication Number Publication Date
WO2019136813A1 true WO2019136813A1 (en) 2019-07-18

Family

ID=63155881

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/077655 WO2019136813A1 (en) 2018-01-11 2018-02-28 Api file management method, server, and storage medium

Country Status (2)

Country Link
CN (1) CN108427560A (en)
WO (1) WO2019136813A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109144501A (en) * 2018-08-30 2019-01-04 杭州数澜科技有限公司 A kind of method and system generating API by label
CN109710301A (en) * 2018-11-30 2019-05-03 福建天泉教育科技有限公司 A kind of method and terminal of automatic relatively interface document difference
CN111198818B (en) * 2019-12-30 2023-02-24 北京中网易企秀科技有限公司 Information acquisition method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101814084A (en) * 2010-01-11 2010-08-25 北京世纪高通科技有限公司 API (Application Programming Interface) management method and system
CN104484216A (en) * 2014-12-29 2015-04-01 广州唯品会网络技术有限公司 Method and device for generating service interface document and on-line test tool
CN107291459A (en) * 2017-06-09 2017-10-24 深圳市金立通信设备有限公司 A kind of method and server for arranging information

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090210861A1 (en) * 2008-02-20 2009-08-20 Mariana Alupului Dita doclet tool and method for extracting and analyzing api documentation
CN103049271B (en) * 2012-12-27 2016-01-27 微梦创科网络科技(中国)有限公司 The method and apparatus of the description document of automatic generation api interface
CN105045577B (en) * 2015-06-29 2018-12-18 用友优普信息技术有限公司 The reminding method of interface change and the prompt system of interface change

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101814084A (en) * 2010-01-11 2010-08-25 北京世纪高通科技有限公司 API (Application Programming Interface) management method and system
CN104484216A (en) * 2014-12-29 2015-04-01 广州唯品会网络技术有限公司 Method and device for generating service interface document and on-line test tool
CN107291459A (en) * 2017-06-09 2017-10-24 深圳市金立通信设备有限公司 A kind of method and server for arranging information

Also Published As

Publication number Publication date
CN108427560A (en) 2018-08-21

Similar Documents

Publication Publication Date Title
WO2020220638A1 (en) Method and apparatus for associating link system with log system, and storage medium
WO2019104973A1 (en) Cross-language invoking method, server, and storage medium
WO2020140683A1 (en) Task scheduling method and apparatus, computer device, and storage medium
WO2019062182A1 (en) Data synchronization device and method, and computer readable storage medium
CN110427252B (en) Task scheduling method, device and storage medium based on task dependency relationship
WO2022027867A1 (en) Mdc-based multithreaded link tracking method and apparatus, and computer-readable storage medium
WO2019075774A1 (en) Device parameter configuration method and apparatus, computer device and storage medium
WO2019148722A1 (en) Electronic device, data migrating and calling method and storage medium
WO2019179026A1 (en) Electronic device, method for automatically generating cluster access domain name, and storage medium
WO2019061991A1 (en) Multi-element universal model platform modeling method, electronic device, and computer readable storage medium
US10110549B2 (en) Method, server and electronic devices of synchronizing notification messages for electronic devices
WO2019136813A1 (en) Api file management method, server, and storage medium
WO2020082558A1 (en) Function name-based breakpoint setting method, device, computer apparatus, and storage medium
WO2020015170A1 (en) Interface invoking method and apparatus, and computer-readable storage medium
CN106528301B (en) Method and device for updating timeout waiting duration
WO2019041441A1 (en) Updating device and method for list view and computer-readable storage medium
US11061669B2 (en) Software development tool integration and monitoring
WO2021121407A1 (en) Capacity changing method and apparatus for virtual machine
WO2021169275A1 (en) Sdn network device access method and apparatus, computer device, and storage medium
WO2021013056A1 (en) Microservice-based data processing method and apparatus, and device and readable storage medium
WO2017084490A1 (en) Method and device for downloading data
WO2019062180A1 (en) Network-based task transfer method, and device and storage medium
WO2017124801A1 (en) Method, device, and system for initiating vnf instantiation
WO2019062020A1 (en) Asynchronous task unified processing method and apparatus, and storage medium
WO2022142008A1 (en) Data processing method and apparatus, electronic device, and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18900373

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 12.10.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18900373

Country of ref document: EP

Kind code of ref document: A1