CN110083384B - Application programming interface creating method and device - Google Patents

Application programming interface creating method and device Download PDF

Info

Publication number
CN110083384B
CN110083384B CN201910218143.2A CN201910218143A CN110083384B CN 110083384 B CN110083384 B CN 110083384B CN 201910218143 A CN201910218143 A CN 201910218143A CN 110083384 B CN110083384 B CN 110083384B
Authority
CN
China
Prior art keywords
interface
application programming
information
generating
debugging
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910218143.2A
Other languages
Chinese (zh)
Other versions
CN110083384A (en
Inventor
宋天喜
郝文斌
丁忠伟
张磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Saiante Technology Service Co Ltd
Original Assignee
Ping An International Smart City Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An International Smart City Technology Co Ltd filed Critical Ping An International Smart City Technology Co Ltd
Priority to CN201910218143.2A priority Critical patent/CN110083384B/en
Publication of CN110083384A publication Critical patent/CN110083384A/en
Application granted granted Critical
Publication of CN110083384B publication Critical patent/CN110083384B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application relates to the field of development auxiliary tools in research and development management, in particular to a method and a device for creating an application programming interface. The method comprises the following steps: after receiving the interface creation request, reading the metadata of the database table according to the request; and then generating interface configuration parameter selection information, pushing the interface configuration parameter selection information to the user side, and then generating a corresponding application programming interface according to the interface configuration parameters fed back by the user side. In the scheme of this application, the user just need confirm interface information and just can generate corresponding interface, generates the interface through self-service mode, strengthens application development process's automation, intelligent level, reduces new demand business function development simultaneously, can labour saving and time saving province resource to promote the reliability and the stability that the interface was established, reduce the scale of program development system.

Description

Application programming interface creating method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for creating an application programming interface, a computer device, and a storage medium.
Background
An API (Application Programming Interface) is a predefined function that is intended to provide applications and developers the ability to access a set of routines based on certain software or hardware, without having to access source code or understand the details of the internal workings.
At present, the creation and release of API interfaces in the market are all completed by performing logic development in advance according to business requirements and then manually releasing the API interfaces on an API gateway.
The method is a mainstream method at present, can be applied to any scene, but has huge workload, and if the service requirement is continuously provided, the development and the release are required to be continuously carried out, so that the time, the labor and the resources are consumed.
Disclosure of Invention
In view of the above, it is necessary to provide a simple and easy application programming interface creation method, apparatus, computer device and storage medium.
A method of application programming interface creation, the method comprising:
receiving an interface creating request, wherein the interface creating request comprises a database table address corresponding to an application programming interface;
reading database table metadata according to the interface creation request, determining preset query conditions and preset output data according to the database table metadata, generating interface configuration parameter selection information according to the determined preset query conditions and the preset output data, and pushing the interface configuration parameter selection information to a user side;
receiving interface configuration parameters returned by the user side according to the interface configuration parameter selection information;
and generating a corresponding application programming interface according to the interface configuration parameters.
In one embodiment, before generating the corresponding application programming interface according to the interface configuration parameters, the method further includes:
auditing the interface configuration parameters;
when the auditing is passed, the step of generating a corresponding application programming interface according to the interface configuration parameters is carried out;
and when the verification is not passed, generating error prompt information, and returning to the step of pushing the interface configuration parameter selection information to the user side.
In one embodiment, the auditing the interface configuration parameters specifically includes:
scoring the availability of the application programming interface corresponding to the interface configuration parameter;
and when the availability score exceeds or is equal to a preset threshold value, judging that the audit is passed, and when the availability score is less than the preset threshold value, judging that the audit is not passed.
In one embodiment, the generating the corresponding application programming interface according to the interface configuration parameter specifically includes:
acquiring interface data table information, query condition information, output data information and interface signature information according to the interface configuration parameters;
and generating a corresponding interface according to the interface data table information, the query condition information and the output data information, and encrypting the corresponding interface according to the interface signature information.
In one embodiment, after generating the corresponding application programming interface according to the interface configuration parameters, the method further includes:
and receiving an interface debugging instruction, and performing interface debugging on the generated application programming interface according to the interface debugging instruction.
In one embodiment, the receiving an interface debugging instruction, and the interface debugging the generated application programming interface according to the interface debugging instruction specifically includes:
receiving an interface debugging instruction, wherein the interface debugging instruction comprises a debugging request parameter and a preset return parameter;
sending a debugging request parameter to the application programming interface;
acquiring a debugging return parameter of an application programming interface, and judging that the application programming interface is available when the debugging return parameter is the same as the preset return parameter; and when the debugging return parameter is different from the preset return parameter, adjusting the application programming interface according to the debugging return parameter, and returning to the step of receiving an interface debugging instruction.
In one embodiment, after generating the corresponding application programming interface according to the interface configuration parameters, the method further includes:
and releasing the generated application programming interface.
An application programming interface creation apparatus comprising:
the system comprises a request acquisition module, a database table creation module and a database management module, wherein the request acquisition module is used for receiving an interface creation request which comprises a database table address corresponding to an application programming interface;
the data pushing module is used for reading database table metadata according to the interface creating request, determining preset query conditions and preset output data according to the database table metadata, generating interface configuration parameter selection information according to the determined preset query conditions and the preset output data, and pushing the interface configuration parameter selection information to a user side;
the data receiving module is used for receiving the interface configuration parameters returned by the user side according to the interface configuration parameter selection information;
and the interface generating module is used for generating a corresponding application programming interface according to the interface configuration parameters.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
receiving an interface creating request, wherein the interface creating request comprises a database table address corresponding to an application programming interface;
reading database table metadata according to the interface creation request, determining a preset query condition and preset output data according to the database table metadata, generating interface configuration parameter selection information according to the preset query condition and the preset output data, and pushing the interface configuration parameter selection information to a user side;
receiving interface configuration parameters returned by the user side according to the interface configuration parameter selection information;
and generating a corresponding application programming interface according to the interface configuration parameters.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
receiving an interface creating request, wherein the interface creating request comprises a database table address corresponding to an application programming interface;
reading database table metadata according to the interface creation request, determining a preset query condition and preset output data according to the database table metadata, generating interface configuration parameter selection information according to the preset query condition and the preset output data, and pushing the interface configuration parameter selection information to a user side;
receiving interface configuration parameters returned by the user side according to the interface configuration parameter selection information;
and generating a corresponding application programming interface according to the interface configuration parameters.
According to the interface creating method, the interface creating device, the computer equipment and the storage medium, after the interface creating request is obtained, the metadata of the database table can be read according to the request; and then generating interface configuration parameter selection information, pushing the interface configuration parameter selection information to the user side, and then generating a corresponding application programming interface according to the interface configuration parameters fed back by the user side. In the scheme of this application, the user just need confirm interface information and just can generate corresponding interface, generates the interface through self-service mode, strengthens application development process's automation, intelligent level, reduces new demand business function development simultaneously, can labour saving and time saving province resource to promote the reliability and the stability that the interface was established, reduce the scale of program development system.
Drawings
FIG. 1 is a diagram of an application environment of a method of interface creation in one embodiment;
FIG. 2 is a flow diagram illustrating a method for interface creation in one embodiment;
FIG. 3 is a flowchart illustrating an interface creation method according to another embodiment;
FIG. 4 is a schematic sub-flow chart illustrating step S720 of FIG. 3 according to an embodiment;
FIG. 5 is a flowchart showing an interface creation method in still another embodiment;
FIG. 6 is a block diagram showing the configuration of an interface creating apparatus according to an embodiment;
FIG. 7 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The application programming interface creation method provided by the application can be applied to an application environment shown in fig. 1, wherein a user terminal 102 where a user is located communicates with a server through a network, the server 104 obtains an interface creation request submitted by the user terminal 102 through the network, after the server 104 receives the interface creation request, the interface creation request reads database table metadata, determines a preset query condition and preset output data according to the database table metadata, generates interface configuration parameter selection information according to the preset query condition and the preset output data, pushes the interface configuration parameter selection information to the user terminal 102, obtains interface configuration parameters fed back by the user terminal 102, and generates a corresponding interface according to the interface configuration parameters. The user terminal 102 may be, but is not limited to, various personal computers, notebook computers, smart phones, and tablet computers.
As shown in fig. 2, in one embodiment, the application programming interface creation method of the present application may be implemented by a server, and specifically includes the following steps:
and S200, the server receives an interface creating request, wherein the interface creating request comprises a database table address corresponding to the application programming interface.
The interface in the scheme is specifically referred to as an API, i.e., an application programming interface. The API may specifically be some predefined function that is intended to provide applications and developers the ability to access a set of routines based on certain software or hardware without having to access source code or understand the details of the internal working mechanisms. The interface creation request may be from a user side, where the user side refers to a port that initiates interface creation, and the user side may send a request to the server to create a corresponding API. The interface creation request refers to a request for creating an API interface by using a server, and the interface creation request may specifically include a database table address corresponding to an API interface application programming interface that a user desires to create, and information and other related information of a connected database inner table.
First, an interface creation request needs to be obtained, and the corresponding API can be created.
S400, the server side reads the metadata of the database table according to the interface creating request, determines preset query conditions and preset output data according to the metadata of the database table, generates interface configuration parameter selection information according to the preset query conditions and the preset output data, and pushes the interface configuration parameter selection information to the user side.
Metadata is data about data. In a database system, metadata can help database administrators and data warehouse developers to find data of interest to them very conveniently; metadata is data that describes the structure and method of building data within a data warehouse and can be divided into two categories depending on the purpose: technical metadata and business metadata. The interface creation request of the user corresponds to the database table metadata, i.e. the interface can be connected with the corresponding database internal table. The preset query condition refers to a field included in a query request which may be initiated by the user side through the interface, and the preset output data corresponds to the preset query condition and refers to output data corresponding to the query condition. The server can generate interface configuration parameter selection information according to the preset output data and the preset query condition and send the interface configuration parameter selection information to the user side.
After obtaining the interface creation request, the server may parse the interface creation request to obtain the information of the database internal tables contained therein, and then read the database table metadata according to the information of the database internal tables. And generating interface configuration parameter selection information according to the database table metadata, and pushing the interface configuration parameter selection information to the user side.
S600, receiving interface configuration parameters returned by the user side according to the interface configuration parameter selection information;
the interface configuration parameters refer to information which is confirmed and approved by the user side after the user side confirms the interface configuration parameter selection information, the user side can generate an interface information confirmation interface according to the interface configuration parameter selection information of the server, the interface is pushed to the user, the interface configuration parameters confirmed by the user are obtained, and then the confirmed interface configuration parameters are sent to the server side. The interface information confirmation interface is an interface containing a plurality of information to be confirmed, and comprises some information to be confirmed by a user, wherein the information to be confirmed comprises relevant information of database table metadata connected with the interface, including addresses, names and the like of the database table metadata, and data such as query conditions, output information and the like related to the interface generated according to the read database table metadata.
The user can select and determine the information to be confirmed on the interface information confirmation interface through the user side, namely, only the required condition is selected to create the corresponding interface, wherein the selection mainly refers to the selection of the query condition of the interface and the data related to the output information, then the selected interface information confirmation interface is fed back to the server side, and the server side can extract the interface configuration parameters from the user side to select the interface configuration parameter selection information from the interface information confirmation interface.
And S800, the server side generates a corresponding application programming interface according to the interface configuration parameters.
The corresponding application programming interface is an interface corresponding to the user interface creation request and the interface configuration parameters fed back by the user, and after the interface configuration parameters fed back from the user side are obtained, the corresponding interface required by the user can be generated according to the interface configuration parameters. In one embodiment, the manner of generating the interface may be determined according to the selected language, for example, if the API is created by using Java language, the corresponding interface may be created by using dynamic language or reflection.
According to the interface creating method, after the server side obtains the interface creating request, the metadata of the database table can be read according to the request; and then generating interface configuration parameter selection information, pushing the interface configuration parameter selection information to the user side, and then generating a corresponding application programming interface according to the interface configuration parameters fed back by the user side. In the scheme of this application, the user just need confirm interface information and just can generate corresponding interface, generates the interface through self-service mode, strengthens application development process's automation, intelligent level, reduces new demand business function development simultaneously, can labour saving and time saving province resource to promote the reliability and the stability that the interface was established, reduce the scale of program development system.
As shown in fig. 3, in one embodiment, after S600, the method further includes:
s720, the server side checks the interface configuration parameters;
when the audit is passed, the step S800 is carried out;
and when the verification is not passed, the step S740 is carried out, error prompt information is generated, and meanwhile, the step of pushing the interface configuration parameter selection information to the user side is returned.
The interface configuration parameters submitted by the integrated user may not meet the specification of the application programming interface, that is, the corresponding interface cannot be generated or the generated interface is not available, so that the interface configuration parameters fed back by the user side need to be checked to determine whether the interface configuration parameters are available. When the interface configuration parameters are checked, the success rate of generating the interface can be effectively improved.
As shown in fig. 4, in one embodiment, S720 includes:
s721, the availability score of the application programming interface corresponding to the interface configuration parameter is obtained.
And S723, when the availability score exceeds or is equal to the preset threshold value, judging that the audit is passed, and when the availability score is smaller than the preset threshold value, judging that the audit is not passed.
The interface availability can be judged by comparing various configuration information, the closer to the standard configuration, the higher the score corresponding to the interface is, and the interface availability score can judge whether the interface is available. The success rate of generating the interface can be effectively improved by auditing the configuration parameters of the interface. In one embodiment, after the preset audit model is passed, a step of manual audit is further included, and an audit worker can audit the interface confirmation information which passes the machine audit, and the step S800 is only entered if the machine audit and the manual audit are passed.
In one embodiment, S800 specifically includes:
and acquiring interface data table information, query condition information, output data information and interface signature information according to the interface configuration parameters.
And generating a corresponding interface according to the interface data table information, the query condition information and the output data information, and encrypting the corresponding interface according to the interface signature information.
The server side extracts interface data table information, inquiry condition information, output data information and interface signature information contained in the interface configuration parameters, then establishes a corresponding API function according to the interface data table information, the inquiry condition information and the output data information of the interface data table information to generate a corresponding interface, and then encrypts the interface based on the interface signature information confirmed by a user in the interface configuration parameters. Because the application program interface generally needs to be opened to a public network, certain safety requirements are required on the interface, and the interface needs to have the functions of preventing false installation attack, preventing tampering attack, preventing replay attack, preventing data information leakage and the like. The generated application programming interface needs to be encrypted according to the interface signature to ensure the security performance of the interface. In one embodiment, the interface signature specifically can acquire a plurality of parameters submitted by a user side, then the parameters are arranged into corresponding arrays, the arrays are subjected to iterative sequencing according to a dictionary, then the sequenced array elements are used as character strings, and then the character strings are subjected to salt value encryption to obtain the corresponding interface signature.
As shown in fig. 5, in one embodiment, after S800, the method further includes:
and S900, the server receives the interface debugging instruction, and performs interface debugging on the generated application programming interface according to the interface debugging instruction.
After the corresponding application programming interface is obtained, the interface needs to be debugged to ensure that the corresponding interface is available, whether the data link such as the interface data table information, the query condition information, the output data information and the like of the interface is correct, and whether the interface signature can be verified. The corresponding interface which is debugged is an available interface, and can be issued to the corresponding API gateway for the calling of the client, and the related data of the interface is required to be readjusted if the corresponding interface which does not pass is not passed, so that the availability of the interface and the correctness of the data link are ensured.
In one embodiment, the interface debugging of the interface debugging instruction on the corresponding interface specifically includes: the server receives an interface debugging instruction, wherein the interface debugging instruction comprises a debugging request parameter and a preset return parameter; sending a debugging request parameter to an application programming interface; acquiring a debugging return parameter of the application programming interface, and judging that the application programming interface is available when the debugging return parameter is the same as a preset return parameter; and when the debugging return parameter is different from the preset return parameter, adjusting the application programming interface according to the debugging return parameter, and returning to the step of receiving the interface debugging instruction.
The interface debugging instruction is used for indicating a server side to perform corresponding interface test, after a corresponding interface is generated, the server side can send corresponding interface completion information to a user side, the user side can send the interface debugging instruction to the server side, the interface debugging instruction comprises preset debugging request parameters and preset return parameters corresponding to the debugging request parameters, the debugging request parameters are parameters for inputting the interface, the preset return parameters are parameters to be returned by the interface according to preset rules, and whether a data link of the interface is correct or not can be determined by comparing the preset return parameters with actual debugging return parameters, so that the actual availability of the interface is determined.
In one embodiment, after S800, the method further includes: and releasing the generated application programming interface.
The application programming interface may be published to an API gateway, which is a server and the only entry to the system. From an object-oriented design point of view, it resembles an appearance pattern. The API gateway encapsulates the internal architecture of the system and provides a customized API for each client. It may also have other responsibilities such as authentication, monitoring, load balancing, caching, request fragmentation and management, static response handling. The key point of the API gateway mode is that all clients and consumers access the microservice through a unified gateway, and all non-business functions are processed at a gateway layer. Typically, the gateway is also an access API that provides REST/HTTP. The server registers and manages services through the API-GW. The relevant functions of the API interface can be realized only by publishing the API interface to the API gateway.
In one embodiment, a user wants to establish an application programming interface, and then sends an interface creation request to a server through a user terminal, and the server receives the interface creation request; the server side reads database table metadata according to the interface creation request, determines preset query conditions and preset output data according to the database table metadata, generates interface configuration parameter selection information according to the determined preset query conditions and the preset output data, and pushes the interface configuration parameter selection information to the user side; the user side generates an interface information confirmation interface according to the interface configuration parameter selection information, pushes the interface to the user, and sends the interface configuration parameters confirmed by the user to the server side; the server side receives interface configuration parameters fed back by the user side according to the interface information confirmation interface; acquiring the availability score of an application programming interface corresponding to the interface configuration parameter; and when the availability score exceeds or is equal to a preset threshold value, the audit is judged to be passed, and when the availability score is smaller than the preset threshold value, the audit is judged not to be passed. When the verification is passed, entering a step that a server side generates a corresponding application programming interface according to the interface configuration parameters; and when the verification is not passed, generating error prompt information, and returning to the step of pushing the interface configuration parameter selection information to the user side. Acquiring interface data table information, query condition information, output data information and interface signature information according to the interface configuration parameters; and generating a corresponding interface according to the interface data table information, the query condition information and the output data information, and encrypting the corresponding interface according to the interface signature information. And releasing the generated application programming interface. The server receives an interface debugging instruction, wherein the interface debugging instruction comprises a debugging request parameter and a preset return parameter; sending a debugging request parameter to an application programming interface; acquiring a debugging return parameter of the application programming interface, and judging that the application programming interface is available when the debugging return parameter is the same as a preset return parameter; and when the debugging return parameter is different from the preset return parameter, adjusting the application programming interface according to the debugging return parameter, and returning to the step of receiving the interface debugging instruction.
It should be understood that although the various steps in the flow charts of fig. 2-5 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-5 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
As shown in fig. 6, an application programming interface creating apparatus includes:
a request obtaining module 200, configured to receive an interface creation request, where the interface creation request includes a database table address corresponding to an application programming interface;
the data pushing module 400 is configured to read database table metadata according to the interface creation request, determine a preset query condition and preset output data according to the database table metadata, generate interface configuration parameter selection information according to the determined preset query condition and the preset output data, and push the interface configuration parameter selection information to the user side;
a data receiving module 600, configured to receive the interface configuration parameters returned by the user side according to the interface configuration parameter selection information;
the interface generating module 800 is configured to generate a corresponding application programming interface according to the interface configuration parameters.
In one embodiment, the server further comprises an interface information auditing module, and the interface information auditing module audits interface configuration parameters; when the audit is passed, the access interface generation module 270 executes the step of generating the corresponding application programming interface according to the interface configuration parameters; when the audit is not passed, an error prompt message is generated, and the return data pushing module 230 executes the step of pushing the interface configuration parameter selection information to the user side.
In one embodiment, the interface information auditing module is specifically configured to obtain an availability score of an application programming interface corresponding to the interface configuration parameter; and when the availability score exceeds or is equal to a preset threshold value, the audit is judged to be passed, and when the availability score is smaller than the preset threshold value, the audit is judged not to be passed.
In one embodiment, the interface generating module 270 is specifically configured to: acquiring interface data table information, query condition information, output data information and interface signature information according to the interface configuration parameters; and generating a corresponding interface according to the interface data table information, the query condition information and the output data information, and encrypting the corresponding interface according to the interface signature information.
In one embodiment, the server further includes an interface debugging module, configured to receive an interface debugging instruction, and perform interface debugging on the generated application programming interface according to the interface debugging instruction.
In one embodiment, the receiving, by the server, the interface debugging instruction, and performing interface debugging on the generated application programming interface according to the interface debugging instruction specifically includes: the interface debugging module receives an interface debugging instruction, wherein the interface debugging instruction comprises a debugging request parameter and a preset return parameter; sending a debugging request parameter to an application programming interface; acquiring a debugging return parameter of the application programming interface, and judging that the application programming interface is available when the debugging return parameter is the same as a preset return parameter; and when the debugging return parameter is different from the preset return parameter, adjusting the application programming interface according to the debugging return parameter, and returning to the step of receiving the interface debugging instruction.
In one embodiment, the server further includes an interface publishing module: and the generated application programming interface is used for publishing.
For specific limitations of the application programming interface creation apparatus, reference may be made to the above limitations of the interface creation method, which will not be described herein again. The modules in the application programming interface creation apparatus can be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement an application programming interface creation method.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
receiving an interface creating request, wherein the interface creating request comprises a database table address corresponding to an application programming interface;
reading database table metadata according to the interface creation request, determining preset query conditions and preset output data according to the database table metadata, generating interface configuration parameter selection information according to the determined preset query conditions and the preset output data, and pushing the interface configuration parameter selection information to a user side;
receiving interface configuration parameters fed back by a user side according to the interface configuration parameter selection information;
and generating a corresponding application programming interface according to the interface configuration parameters.
In one embodiment, the processor, when executing the computer program, further performs the steps of: auditing the interface configuration parameters; when the verification is passed, the step of generating a corresponding application programming interface according to the interface configuration parameters is carried out; and when the verification is not passed, generating error prompt information, and returning to the step of pushing the interface configuration parameter selection information to the user side.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring the availability score of an application programming interface corresponding to the interface configuration parameter; and when the availability score exceeds or is equal to a preset threshold value, the audit is judged to be passed, and when the availability score is smaller than the preset threshold value, the audit is judged not to be passed.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring interface data table information, query condition information, output data information and interface signature information according to the interface configuration parameters; and generating a corresponding interface according to the interface data table information, the query condition information and the output data information, and encrypting the corresponding interface according to the interface signature information.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and receiving an interface debugging instruction, and performing interface debugging on the generated application programming interface according to the interface debugging instruction.
In one embodiment, the processor, when executing the computer program, further performs the steps of: receiving an interface debugging instruction, wherein the interface debugging instruction comprises a debugging request parameter and a preset return parameter; sending a debugging request parameter to an application programming interface; acquiring a debugging return parameter of the application programming interface, and judging that the application programming interface is available when the debugging return parameter is the same as a preset return parameter; and when the debugging return parameter is different from the preset return parameter, adjusting the application programming interface according to the debugging return parameter, and returning to the step of receiving the interface debugging instruction.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and releasing the generated application programming interface.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
receiving an interface creating request, wherein the interface creating request comprises a database table address corresponding to an application programming interface;
reading database table metadata according to the interface creation request, determining preset query conditions and preset output data according to the database table metadata, generating interface configuration parameter selection information according to the determined preset query conditions and the preset output data, and pushing the interface configuration parameter selection information to a user side;
receiving interface configuration parameters fed back by a user side according to the interface configuration parameter selection information;
and generating a corresponding application programming interface according to the interface configuration parameters.
In one embodiment, the computer program when executed by the processor further performs the steps of: auditing the interface configuration parameters; when the verification is passed, the step of generating a corresponding application programming interface according to the interface configuration parameters is carried out; and when the verification is not passed, generating error prompt information, and returning to the step of pushing the interface configuration parameter selection information to the user side.
In one embodiment, the computer program when executed by the processor further performs the steps of: the availability score of the application programming interface corresponding to the interface configuration parameter is obtained; and when the availability score exceeds or is equal to a preset threshold value, the audit is judged to be passed, and when the availability score is smaller than the preset threshold value, the audit is judged not to be passed.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring interface data table information, query condition information, output data information and interface signature information according to the interface configuration parameters; and generating a corresponding interface according to the interface data table information, the query condition information and the output data information, and encrypting the corresponding interface according to the interface signature information.
In one embodiment, the computer program when executed by the processor further performs the steps of: and receiving an interface debugging instruction, and performing interface debugging on the generated application programming interface according to the interface debugging instruction.
In one embodiment, the computer program when executed by the processor further performs the steps of: receiving an interface debugging instruction, wherein the interface debugging instruction comprises a debugging request parameter and a preset return parameter; sending a debugging request parameter to an application programming interface; acquiring a debugging return parameter of the application programming interface, and judging that the application programming interface is available when the debugging return parameter is the same as a preset return parameter; and when the debugging return parameter is different from the preset return parameter, adjusting the application programming interface according to the debugging return parameter, and returning to the step of receiving the interface debugging instruction.
In one embodiment, the computer program when executed by the processor further performs the steps of: and releasing the generated application programming interface.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method of application programming interface creation, the method comprising:
receiving an interface creating request, wherein the interface creating request comprises a database table address corresponding to an application programming interface;
reading database table metadata according to the interface creation request, determining a preset query condition and preset output data according to the database table metadata, generating interface configuration parameter selection information according to the preset query condition and the preset output data, and pushing the interface configuration parameter selection information to a user side;
receiving interface configuration parameters returned by the user side according to the interface configuration parameter selection information;
generating a corresponding application programming interface according to the interface configuration parameters;
the generating of the corresponding application programming interface according to the interface configuration parameters comprises:
and generating a corresponding application programming interface in a dynamic language mode or a reflection mode according to the interface configuration parameters.
2. The method of claim 1, prior to generating the corresponding application programming interface according to the interface configuration parameters, further comprising:
auditing the interface configuration parameters;
when the auditing is passed, the step of generating a corresponding application programming interface according to the interface configuration parameters is carried out;
and when the verification is not passed, generating error prompt information, and returning to the step of pushing the interface configuration parameter selection information to the user side.
3. The method according to claim 2, wherein the auditing the interface configuration parameters specifically includes:
acquiring the availability score of the application programming interface corresponding to the interface configuration parameter;
and when the availability score exceeds or is equal to a preset threshold value, judging that the audit is passed, and when the availability score is less than the preset threshold value, judging that the audit is not passed.
4. The method of claim 1, wherein the generating a corresponding application programming interface according to the interface configuration parameters specifically comprises:
acquiring interface data table information, query condition information, output data information and interface signature information according to the interface configuration parameters;
and generating a corresponding interface according to the interface data table information, the query condition information and the output data information, and encrypting the corresponding interface according to the interface signature information.
5. The method of claim 1, after generating the corresponding application programming interface according to the interface configuration parameters, further comprising:
and receiving an interface debugging instruction, and performing interface debugging on the generated application programming interface according to the interface debugging instruction.
6. The method according to claim 5, wherein the receiving an interface debugging instruction, and the performing interface debugging on the generated application programming interface according to the interface debugging instruction specifically comprises:
receiving an interface debugging instruction, wherein the interface debugging instruction comprises a debugging request parameter and a preset return parameter;
sending a debugging request parameter to the application programming interface;
acquiring a debugging return parameter of an application programming interface, and judging that the application programming interface is available when the debugging return parameter is the same as the preset return parameter; and when the debugging return parameter is different from the preset return parameter, adjusting the application programming interface according to the debugging return parameter, and returning to the step of receiving an interface debugging instruction.
7. The method of claim 1, wherein receiving an interface debug instruction after generating a corresponding application programming interface according to the interface configuration parameters further comprises:
and releasing the generated application programming interface.
8. An application programming interface creation apparatus, comprising:
the system comprises a request acquisition module, a database table creation module and a database management module, wherein the request acquisition module is used for receiving an interface creation request which comprises a database table address corresponding to an application programming interface;
the data pushing module is used for reading database table metadata according to the interface creating request, determining preset query conditions and preset output data according to the database table metadata, generating interface configuration parameter selection information according to the preset query conditions and the preset output data, and pushing the interface configuration parameter selection information to a user side;
the data receiving module is used for receiving the interface configuration parameters returned by the user side according to the interface configuration parameter selection information;
the interface generating module is used for generating a corresponding application programming interface according to the interface configuration parameters;
the interface generation module is specifically configured to:
and generating a corresponding application programming interface in a dynamic language mode or a reflection mode according to the interface configuration parameters.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program implements the steps of the method of any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN201910218143.2A 2019-03-21 2019-03-21 Application programming interface creating method and device Active CN110083384B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910218143.2A CN110083384B (en) 2019-03-21 2019-03-21 Application programming interface creating method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910218143.2A CN110083384B (en) 2019-03-21 2019-03-21 Application programming interface creating method and device

Publications (2)

Publication Number Publication Date
CN110083384A CN110083384A (en) 2019-08-02
CN110083384B true CN110083384B (en) 2020-09-15

Family

ID=67413444

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910218143.2A Active CN110083384B (en) 2019-03-21 2019-03-21 Application programming interface creating method and device

Country Status (1)

Country Link
CN (1) CN110083384B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111652687A (en) * 2020-06-08 2020-09-11 上海敬贤信息科技有限公司 Online technical demand obtaining method
CN112947984B (en) * 2020-09-29 2024-05-14 深圳市明源云科技有限公司 Application program development method and device
CN112685021A (en) * 2020-12-28 2021-04-20 平安普惠企业管理有限公司 API (application program interface) generating method and device, computer equipment and storage medium
CN112837019A (en) * 2021-03-05 2021-05-25 上海中通吉网络技术有限公司 Express delivery track data pushing method, device and equipment
CN113766030B (en) * 2021-09-13 2023-05-26 城云科技(中国)有限公司 Automatic parameter entering method and device for interface constant parameters

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102122247A (en) * 2011-03-17 2011-07-13 深圳市同洲软件有限公司 Automatic code generating system and method
CN108108162B (en) * 2016-11-24 2020-05-12 腾讯科技(深圳)有限公司 Application programming interface generation method and device
CN108121606B (en) * 2016-11-26 2021-02-19 深圳壹账通智能科技有限公司 Method and device for generating coded data based on joint debugging interface

Also Published As

Publication number Publication date
CN110083384A (en) 2019-08-02

Similar Documents

Publication Publication Date Title
CN110083384B (en) Application programming interface creating method and device
CN109460527B (en) Product data configuration method, device, computer equipment and storage medium
CN109446068B (en) Interface test method, device, computer equipment and storage medium
CN110297672B (en) Page dynamic generation method and device, computer equipment and storage medium
CN110290212B (en) Service call recording method, device, computer equipment and storage medium
CN111695156A (en) Service platform access method, device, equipment and storage medium
CN109308285A (en) Database script management method, device, computer equipment and storage medium
CN110598380B (en) User right management method, device, computer equipment and storage medium
CN108365958B (en) Account login verification method and device, computer equipment and storage medium
CN110619206B (en) Operation and maintenance risk control method, system, equipment and computer readable storage medium
CN109684873B (en) Data access control method and device, computer equipment and storage medium
CN111666565A (en) Sandbox simulation test method and device, computer equipment and storage medium
CN110213392B (en) Data distribution method and device, computer equipment and storage medium
CN109413153B (en) Data crawling method and device, computer equipment and storage medium
CN112860778B (en) Database management method, device, equipment and medium for desktop application program
CN112651001A (en) Access request authentication method, device, equipment and readable storage medium
CN111090581A (en) Intelligent contract testing method and device, computer equipment and storage medium
CN112165448B (en) Service processing method, device, system, computer equipment and storage medium
CN113114674A (en) Service access method, device, equipment and storage medium
CN112528201A (en) Method and device for calling third-party platform, computer equipment and storage medium
CN110502242B (en) Code automatic generation method and device, computer equipment and storage medium
CN111125748A (en) Judgment method and device for unauthorized query, computer equipment and storage medium
CN112559352A (en) Interface test method, device, equipment and storage medium
CN110602051B (en) Information processing method based on consensus protocol and related device
CN111652720A (en) Cloud evidence obtaining method and device, computer equipment and storage medium

Legal Events

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

Effective date of registration: 20210129

Address after: 518066 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Patentee after: Shenzhen saiante Technology Service Co.,Ltd.

Address before: 1-34 / F, Qianhai free trade building, 3048 Xinghai Avenue, Mawan, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong 518000

Patentee before: Ping An International Smart City Technology Co.,Ltd.

TR01 Transfer of patent right