CN112131020A - API interface generating method, calling method, device, equipment and medium - Google Patents

API interface generating method, calling method, device, equipment and medium Download PDF

Info

Publication number
CN112131020A
CN112131020A CN202010999881.8A CN202010999881A CN112131020A CN 112131020 A CN112131020 A CN 112131020A CN 202010999881 A CN202010999881 A CN 202010999881A CN 112131020 A CN112131020 A CN 112131020A
Authority
CN
China
Prior art keywords
interface
calling
api
parameters
database
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.)
Pending
Application number
CN202010999881.8A
Other languages
Chinese (zh)
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.)
Hangzhou Zhongyun Data Technology Co ltd
Huzhou Big Data Operation Co ltd
Hangzhou City Big Data Operation Co ltd
Original Assignee
Hangzhou Zhongyun Data Technology Co ltd
Huzhou Big Data Operation Co ltd
Hangzhou City Big Data Operation 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 Hangzhou Zhongyun Data Technology Co ltd, Huzhou Big Data Operation Co ltd, Hangzhou City Big Data Operation Co ltd filed Critical Hangzhou Zhongyun Data Technology Co ltd
Priority to CN202010999881.8A priority Critical patent/CN112131020A/en
Publication of CN112131020A publication Critical patent/CN112131020A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/541Client-server

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Stored Programmes (AREA)

Abstract

The invention belongs to the technical field of data processing, and particularly relates to an API (application program interface) interface generation method, a calling method, an API interface generation device, an API interface calling device, API interface calling equipment and an API interface calling medium. The API interface generation method comprises the following steps: acquiring a database field of a database, and setting interface parameters of the interface according to the database field, wherein the interface parameters include but are not limited to one or a combination of several interface request parameters and interface response parameters; and inputting the interface parameters into a preset position of preset interface program information to generate an interface, wherein the interface program information is executed when the interface is called by demand so as to use the interface to butt the corresponding database. According to the API interface generation method provided by the embodiment of the invention, the processes of developing and generating the interface on the server can be omitted, the generation efficiency of the interface is improved, the development cost is obviously reduced, and the method is very convenient for people to use.

Description

API interface generating method, calling method, device, equipment and medium
Technical Field
The invention belongs to the technical field of data processing, and particularly relates to an API (application program interface) interface generation method, a calling method, an API interface generation device, an API interface calling device, API interface calling equipment and an API interface calling medium.
Background
At present, when an application program on a mobile terminal (such as a mobile phone, a tablet computer, etc.) generates an interface, front-end personnel and background server personnel are required to develop and generate the interface; due to the difference between the development progress and the time of the interface, the two personnel can not well butt the interface, thereby influencing the development progress.
Meanwhile, for some application programs which only need a small number of interfaces for data interaction with the server, a background server worker develops a small number of interfaces needed by the application programs, and a large amount of development cost is wasted.
Disclosure of Invention
Embodiments of the present invention provide an API interface generating method, an API interface calling device, and an API interface calling medium, and aim to solve the problems of high cost and inflexibility in interface development and generation on a server in the prior art.
The embodiment of the invention is an API interface generating method realized in such a way, which comprises the following steps:
acquiring a database field of a database, and setting interface parameters of the interface according to the database field, wherein the interface parameters include but are not limited to one or a combination of several interface request parameters and interface response parameters;
inputting the interface parameters into a preset position of preset interface program information, generating corresponding URL information according to the interface parameters and the database fields, and generating an interface, wherein the interface program information is executed when the interface is called by a user, so that the interface is used for butting the corresponding database.
Preferably, the generated interface supports a custom SQL format, and the interface parameters are represented by placeholders instead of preset interface program information.
Another object of the embodiments of the present invention is to provide an API interface calling method, configured to call an interface formed by the API interface generating method, including the following steps:
receiving calling request information sent by a calling party, wherein the calling request information at least comprises a target interface parameter of a called target database;
inputting the target interface parameters into the interface program information;
and executing the interface program information to call the corresponding interface.
Preferably, the invoking request information further includes invoking party information of an invoking party, and after the step of receiving the invoking request information sent by the invoking party, the method further includes the following steps:
and determining whether the corresponding caller has the right to call the interface according to the caller information, wherein the determination mode includes but is not limited to whether the caller applies for calling or belongs to allowed calling, and if the caller has the right to call, the target interface parameter is allowed to be input into the interface program information.
Preferably, the step of executing the interface program information to call the corresponding interface specifically includes the following steps:
executing the interface program information to obtain a result set;
and returning the result set to a calling party as the interface response parameter.
Another object of an embodiment of the present invention is to provide an API interface generating apparatus, including:
the acquisition unit is used for setting interface parameters of the interface according to database fields when the database fields of a database are acquired, wherein the interface parameters include but are not limited to one or the combination of several interface request parameters and interface response parameters;
and the parameter setting unit is used for inputting the interface parameters into a preset position of preset interface program information to generate an interface, and the interface program information is executed when the interface is called by demand so as to use the interface to butt the corresponding database.
Another object of an embodiment of the present invention is to provide an API interface calling device, configured to call an interface formed by the API interface generating method, including:
the receiving verification unit is used for receiving calling request information sent by a calling party, wherein the calling request information at least comprises a target interface parameter of a called target database;
a parameter input unit for inputting the target interface parameter into the interface program information;
and the execution unit is used for executing the interface program information so as to call the corresponding interface.
It is a further object of embodiments of the present invention to provide a computer device, including a memory and a processor, the memory having stored therein a computer program, which, when executed by the processor, causes the processor to execute the steps of the API interface generating method and/or the API interface calling method.
It is a further object of embodiments of the present invention to provide a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, causes the processor to execute the steps of the API interface generating method and/or the API interface calling method.
Compared with the prior art that the interface needs to be researched and developed on the server and the interface needs to be generated, the API interface generation method provided by the embodiment of the invention can save the process of researching and developing the interface on the server, not only improves the generation efficiency of the interface, but also obviously reduces the development cost, and is very convenient for people to use.
Drawings
Fig. 1 is a flowchart of an API interface generation method according to an embodiment of the present invention;
fig. 2 is a flowchart of an API interface calling method according to an embodiment of the present invention;
FIG. 3 is a flowchart of another API interface calling method according to an embodiment of the present invention;
FIG. 4 is a flowchart of executing an interface query statement according to an embodiment of the present invention;
fig. 5 is a block diagram of an API interface generating apparatus according to an embodiment of the present invention;
fig. 6 is a block diagram of an API interface calling apparatus according to an embodiment of the present invention;
FIG. 7 is a block diagram showing an internal configuration of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention 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 invention and are not intended to limit the invention.
It will be understood that, as used herein, the terms "first," "second," and the like may be used herein to describe various elements, but these elements are not limited by these terms unless otherwise specified. These terms are only used to distinguish one element from another. For example, a first xx script may be referred to as a second xx script, and similarly, a second xx script may be referred to as a first xx script, without departing from the scope of the present application.
In the embodiment of the present invention, the API interface generation method and the API interface calling method may be applied to a terminal, and the terminal may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, and the like, but are not limited thereto.
Example one
As shown in fig. 1, in an embodiment, an API interface generation method is provided, and this embodiment is mainly illustrated by applying the method to the terminal. An API interface generation method may specifically include the following steps:
step S101, obtaining a database field of a database, and setting interface parameters of an interface according to the database field, wherein the interface parameters include but are not limited to one or a combination of several interface request parameters and interface response parameters;
step S102, inputting the interface parameters into the preset position of the preset interface program information, generating corresponding URL information according to the interface parameters and the database fields, and generating an interface, wherein the interface program information is executed when the interface is called by a user, so that the interface is used for butting the corresponding database.
The API interface generation method in the embodiment of the invention can support mainstream data sources in the prior art, such as mysql, oracle, sqlserver, hbase and other relational databases.
In the embodiment of the present invention, the API interface generation method is mainly applied to an HTTP network environment for example, where HTTP is a standard (TCP) for requests and responses of a client and a server. The client is an end user, and the server is a website. Using a Web browser, Web crawler, or other tool, the client initiates an HTTP request to a designated port (default port 80) on the server, which is called a user agent. The server on which the response is made stores resources such as HTML files and images. This answering server is the origin server. There may be multiple intermediate layers of http and several other network protocols, such as proxy, gateway, or tunnel, between the user agent and the origin server. Although the TCP/IP protocol is the most popular application on the internet, the HTTP protocol does not specify that it must be used and the layers it supports. Indeed, HTTP may be implemented on any other internet protocol, or on other networks. HTTP only assumes (its underlying protocols provide) reliable transport and any protocol that can provide such guarantees can be used. Typically, a request is initiated by the HTTP client to establish a TCP connection to a designated port (by default, 80 ports) of the server. The HTTP server listens for the request sent by the client at that port. Upon receiving the request, the server sends back (to the client) a status line, such as "HTTP/1.1200OK", and a message in response, the message body of which may be the requested file, an error message, or some other information. Resources requested by the HTTP or HTTPs protocols are identified by a uniform resource identifier.
In the embodiment of the present invention, the database field is mainly suitable for determining the database to which the database is directed, so the database field preferably can serve as a field for identifying and distinguishing, such as a field for attribute information of the database, or some field for uniquely determining target data, and those skilled in the art can simply select and design the field according to actual situations, which will not be described in further detail herein.
In the embodiment of the present invention, the preset interface program information includes the preset interface program, and the program can be executed and used only after the interface parameters are configured, so that the API interface generation method provided in the embodiment of the present invention can generate the interface only by performing simple parameter configuration, and by adopting the program presetting manner, excessive research and development and generation operations do not need to be performed on the server, thereby greatly reducing the interface cost.
In the embodiment of the invention, the generated interface supports a custom SQL format, the interface parameters are represented by placeholders in the preset interface program information instead, and the corresponding SQL can be generated according to different databases or different operation types. In the embodiment of the invention, MyBati is used for designing SQL format interface program information, is an excellent persistent layer framework, supports self-defined SQL, stored procedures and high-level mapping, avoids almost all JDBC codes, parameter setting and result set obtaining works, and can configure and map original types, interfaces and Java POJO (Plain Old Java Objects) into records in a database through simple XML or annotation. In addition, Mybatis-Plus (MP for short) can be used as an enhancement tool of Mybatis, and only enhancement is carried out on the basis of Mybatis without changing, so that the method is used for simplifying development and improving efficiency. Of course, it will be understood by those skilled in the art that the above-described frame format or software implementation is merely an example, and that many more implementations may be selected by those skilled in the art based on the actual circumstances.
Compared with the prior art that the interface is required to be researched and developed on the server, the API interface generation method provided by the embodiment of the invention can save the process of researching and developing the interface on the server, does not need to compile codes and deploy environment, and provides one-stop experience from interface generation to release by an interface development tool, thereby not only improving the generation efficiency of the interface, but also obviously reducing the development cost, and being very convenient for people to use.
Example two
As shown in fig. 2, in an embodiment, an API interface calling method is provided, which is mainly used for exemplifying the application of the method to the terminal in the embodiment, and is used for calling an interface formed by the API interface generating method in the embodiment of the present invention. An API interface calling method may specifically include the following steps:
step S201, receiving calling request information sent by a calling party, wherein the calling request information at least comprises a target interface parameter of a called target database;
step S202, inputting target interface parameters into interface program information;
step S203, the interface program information is executed to call the corresponding interface.
In the embodiment of the present invention, the call request information of the caller is used to determine the called data interface, which needs to provide the parameters of the target interface corresponding to the called target database. In connection with the foregoing embodiments, it is illustrated herein that after the target interface parameter is input into the interface program information, the interface program is triggered to perform normal access.
In this embodiment of the present invention, as shown in fig. 3, another API interface calling method provided in this embodiment of the present invention is different from that in fig. 2 in that the calling request information further includes calling party information of a calling party, and after receiving the calling request information sent by the calling party in step S201, the method further includes the following steps:
step S301, determining whether the corresponding caller has the right to call the interface according to the caller information, wherein the determining mode includes but is not limited to whether the caller has applied for calling or belongs to allowed calling, and if the caller has the right to call, the target interface parameter is allowed to be input into the interface program information.
In the embodiment of the present invention, if the call record has been previously recorded, the interface may be allowed to be used, and of course, the authentication may also be performed by a common authentication method, for example, by sending an authentication request to the caller to authenticate data, and then determining whether the caller is permitted or not according to the authentication data, a simple authorization authentication method may be selected and simply designed by those skilled in the art according to actual needs, and will not be described in detail.
In the embodiment of the present invention, as shown in fig. 4, which is a flowchart of executing an interface query statement in the embodiment of the present invention, step 203 is a step of executing interface program information to call a corresponding interface, and specifically includes the following steps:
step S401, executing interface program information and acquiring a result set;
and step S402, returning the result set to the caller as an interface response parameter.
In the embodiment of the invention, the result set is set in the interface response parameter value column, so that data can be returned to a calling party through an interface, meanwhile, in the process, calling record can be carried out, a calling record log is formed, and the calling is conveniently recorded so as to facilitate later-stage checking management and the like.
The API interface calling method provided by the embodiment of the invention can save the process of developing and generating the interface on the server by transmitting and receiving the interface parameters and matching with the API interface generating method in the previous embodiment, directly and flexibly call the interface, obviously reduce the development cost and be very convenient for people to use.
EXAMPLE III
As shown in fig. 5, in an embodiment, an API interface generating apparatus is provided, where the API interface generating apparatus may be integrated in a computer device or a terminal, and specifically may include:
an obtaining unit 510, configured to obtain a database field of a database, and set an interface parameter of the interface according to the database field, where the interface parameter includes, but is not limited to, one or a combination of several interface request parameters and interface response parameters;
a parameter setting unit 520, configured to input the interface parameter into a preset position of preset interface program information, generate corresponding URL information according to the interface parameter and the database field, and generate an interface, where the interface program information is executed when the interface is called, so as to use the interface to interface with a corresponding database.
The API interface generation method in the embodiment of the invention can support mainstream data sources in the prior art, such as mysql, oracle, sqlserver, hbase and other relational databases.
In the embodiment of the present invention, the API interface generation method is mainly applied to an HTTP network environment for example, where HTTP is a standard (TCP) for requests and responses of a client and a server. The client is an end user, and the server is a website. Using a Web browser, Web crawler, or other tool, the client initiates an HTTP request to a designated port (default port 80) on the server, which is called a user agent. The server on which the response is made stores resources such as HTML files and images. This answering server is the origin server. There may be multiple intermediate layers of http and several other network protocols, such as proxy, gateway, or tunnel, between the user agent and the origin server. Although the TCP/IP protocol is the most popular application on the internet, the HTTP protocol does not specify that it must be used and the layers it supports. Indeed, HTTP may be implemented on any other internet protocol, or on other networks. HTTP only assumes (its underlying protocols provide) reliable transport and any protocol that can provide such guarantees can be used. Typically, a request is initiated by the HTTP client to establish a TCP connection to a designated port (by default, 80 ports) of the server. The HTTP server listens for the request sent by the client at that port. Upon receiving the request, the server sends back (to the client) a status line, such as "HTTP/1.1200OK", and a message in response, the message body of which may be the requested file, an error message, or some other information. Resources requested by the HTTP or HTTPs protocols are identified by a uniform resource identifier.
In the embodiment of the present invention, the database field is mainly suitable for determining the database to which the database is directed, so the database field preferably can serve as a field for identifying and distinguishing, such as a field for attribute information of the database, or some field for uniquely determining target data, and those skilled in the art can simply select and design the field according to actual situations, which will not be described in further detail herein.
In the embodiment of the present invention, the preset interface program information includes the preset interface program, and the program can be executed and used only after the interface parameters are configured, so that the API interface generation method provided in the embodiment of the present invention can generate the interface only by performing simple parameter configuration, and by adopting the program presetting manner, excessive research and development and generation operations do not need to be performed on the server, thereby greatly reducing the interface cost.
In the embodiment of the invention, the generated interface supports a custom SQL format, the interface parameters are represented by placeholders in the preset interface program information instead, and the corresponding SQL can be generated according to different databases or different operation types. In the embodiment of the invention, MyBati is used for designing SQL format interface program information, is an excellent persistent layer framework, supports self-defined SQL, stored procedures and high-level mapping, avoids almost all JDBC codes, parameter setting and result set obtaining works, and can configure and map original types, interfaces and Java POJO (Plain Old Java Objects) into records in a database through simple XML or annotation. In addition, Mybatis-Plus (MP for short) can be used as an enhancement tool of Mybatis, and only enhancement is carried out on the basis of Mybatis without changing, so that the method is used for simplifying development and improving efficiency. Of course, it will be understood by those skilled in the art that the above-described frame format or software implementation is merely an example, and that many more implementations may be selected by those skilled in the art based on the actual circumstances.
Compared with the prior art that the interface is required to be researched and developed on the server, the API interface generation method provided by the embodiment of the invention can save the process of researching and developing the interface on the server, does not need to compile codes and deploy environment, and provides one-stop experience from interface generation to release by an interface development tool, thereby not only improving the generation efficiency of the interface, but also obviously reducing the development cost, and being very convenient for people to use.
Example four
As shown in fig. 6, in an embodiment, an API interface generating apparatus is provided, where the API interface generating apparatus may be integrated in a computer device or a terminal, and is used to invoke an interface formed by an API interface generating method in the embodiment of the present invention, and specifically includes:
a receiving verification unit 610, configured to receive call request information sent by a caller, where the call request information at least includes a target interface parameter of a called target database;
a parameter input unit 620, configured to input the target interface parameter into the interface program information;
the execution unit 630 is configured to execute the interface program information to call a corresponding interface.
In the embodiment of the present invention, the call request information of the caller is used to determine the called data interface, which needs to provide the parameters of the target interface corresponding to the called target database. In connection with the foregoing embodiments, it is illustrated herein that after the target interface parameter is input into the interface program information, the interface program is triggered to perform normal access.
In this embodiment of the present invention, the invoking request information further includes invoking party information of an invoking party, and after the receiving and verifying unit 610 receives the invoking request information sent by the invoking party, the following steps are further performed:
and determining whether the corresponding caller is authorized to call the interface according to the caller information, wherein the determination mode includes but is not limited to whether the caller applies for calling or belongs to allowed calling, and if the caller is authorized to call, target interface parameters are allowed to be input into the interface program information.
In the embodiment of the present invention, if the call record has been previously recorded, the interface may be allowed to be used, and of course, the authentication may also be performed by a common authentication method, for example, by sending an authentication request to the caller to authenticate data, and then determining whether the caller is permitted or not according to the authentication data, a simple authorization authentication method may be selected and simply designed by those skilled in the art according to actual needs, and will not be described in detail.
In this embodiment of the present invention, the step of executing the interface program information by the execution unit 630 to call the corresponding interface specifically includes:
executing the interface program information to obtain a result set;
and returning the result set to the caller as an interface response parameter.
In the embodiment of the invention, the result set is set in the interface response parameter value column, so that data can be returned to a calling party through an interface, meanwhile, in the process, calling record can be carried out, a calling record log is formed, and the calling is conveniently recorded so as to facilitate later-stage checking management and the like.
The API interface calling method provided by the embodiment of the invention can save the process of developing and generating the interface on the server by transmitting and receiving the interface parameters and matching with the API interface generating method in the previous embodiment, directly and flexibly call the interface, obviously reduce the development cost and be very convenient for people to use.
EXAMPLE five
In one embodiment, a computer device is proposed, the computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
acquiring a database field of a database, and setting interface parameters of the interface according to the database field, wherein the interface parameters include but are not limited to one or a combination of several interface request parameters and interface response parameters;
inputting the interface parameters into a preset position of preset interface program information, generating corresponding URL information according to the interface parameters and database fields, and generating an interface, wherein the interface program information is executed when the interface is called by demand so as to use the interface to butt joint a corresponding database; andor or
Receiving calling request information sent by a calling party, wherein the calling request information at least comprises a target interface parameter of a called target database;
inputting the target interface parameters into the interface program information;
and executing the interface program information to call the corresponding interface.
FIG. 7 is a diagram illustrating an internal structure of a computer device in one embodiment. The computer device may be specifically an independent physical server or a terminal, may also be a server cluster formed by a plurality of physical servers, and may be a cloud server providing basic cloud computing services such as a cloud server, a cloud database, a cloud storage, and a CDN. But not limited thereto, the smart phone, the tablet computer, the notebook computer, the desktop computer, the smart speaker, the smart watch, and the like may also be used. As shown in fig. 7, the computer apparatus includes a processor, a memory, a network interface, an input device, and a display screen linked by a system bus. Wherein the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program that, when executed by the processor, causes the processor to implement an API interface generation method and/or an API interface calling method. The internal memory may also have stored therein a computer program that, when executed by the processor, causes the processor to perform an API interface generation method and/or an API interface invocation method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
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.
Example four
In one embodiment, a computer readable storage medium is provided, having a computer program stored thereon, which, when executed by a processor, causes the processor to perform the steps of:
acquiring a database field of a database, and setting interface parameters of the interface according to the database field, wherein the interface parameters include but are not limited to one or a combination of several interface request parameters and interface response parameters;
inputting the interface parameters into a preset position of preset interface program information, generating corresponding URL information according to the interface parameters and database fields, and generating an interface, wherein the interface program information is executed when the interface is called by demand so as to use the interface to butt joint a corresponding database; andor or
Receiving calling request information sent by a calling party, wherein the calling request information at least comprises a target interface parameter of a called target database;
inputting the target interface parameters into the interface program information;
and executing the interface program information to call the corresponding interface.
It should be understood that, although the steps in the flowcharts of the embodiments of the present invention are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence 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 a portion of the steps in various embodiments 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 alternately with other steps or at least a portion of the sub-steps or stages of other steps.
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, and the program 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 show some embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (9)

1. An API interface generation method is characterized by comprising the following steps:
acquiring a database field of a database, and setting interface parameters of the interface according to the database field, wherein the interface parameters include but are not limited to one or a combination of several interface request parameters and interface response parameters;
inputting the interface parameters into a preset position of preset interface program information, generating corresponding URL information according to the interface parameters and the database fields, and generating an interface, wherein the interface program information is executed when the interface is called by a user, so that the interface is used for butting the corresponding database.
2. The API interface generating method according to claim 1, wherein the generated interface supports a custom SQL format, and the interface parameters are represented by placeholders instead of preset information of the interface program.
3. An API interface calling method for calling an interface formed by the API interface generating method of any one of claims 1 to 3, comprising the steps of:
receiving calling request information sent by a calling party, wherein the calling request information at least comprises a target interface parameter of a called target database;
inputting the target interface parameters into the interface program information;
and executing the interface program information to call the corresponding interface.
4. The API interface calling method of any one of claim 3 wherein said call request information further includes caller information of a caller, and wherein said step of receiving call request information sent by the caller further includes the steps of:
and determining whether the corresponding caller has the right to call the interface according to the caller information, wherein the determination mode includes but is not limited to whether the caller applies for calling or belongs to allowed calling, and if the caller has the right to call, the target interface parameter is allowed to be input into the interface program information.
5. The API interface invoking method according to any one of claim 3, wherein said step of executing said interface program information to invoke a corresponding interface specifically comprises the steps of:
executing the interface program information to obtain a result set;
and returning the result set to a calling party as the interface response parameter.
6. An API interface generating apparatus, comprising:
the acquisition unit is used for setting interface parameters of the interface according to database fields when the database fields of a database are acquired, wherein the interface parameters include but are not limited to one or the combination of several interface request parameters and interface response parameters;
and the parameter setting unit is used for inputting the interface parameters into a preset position of preset interface program information to generate an interface, and the interface program information is executed when the interface is called by demand so as to use the interface to butt the corresponding database.
7. An API interface calling device for calling an interface formed by the API interface generating method according to any one of claims 1 to 3, comprising:
the receiving verification unit is used for receiving calling request information sent by a calling party, wherein the calling request information at least comprises a target interface parameter of a called target database;
a parameter input unit for inputting the target interface parameter into the interface program information;
and the execution unit is used for executing the interface program information so as to call the corresponding interface.
8. A computer device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of the API interface generation method of any of claims 1 to 2 and/or the API interface calling method of any of claims 3 to 5.
9. A computer readable storage medium, having stored thereon a computer program which, when executed by a processor, causes the processor to perform the steps of the API interface generation method of any one of claims 1 to 2 and/or the API interface calling method of any one of claims 3 to 5.
CN202010999881.8A 2020-09-22 2020-09-22 API interface generating method, calling method, device, equipment and medium Pending CN112131020A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010999881.8A CN112131020A (en) 2020-09-22 2020-09-22 API interface generating method, calling method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010999881.8A CN112131020A (en) 2020-09-22 2020-09-22 API interface generating method, calling method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN112131020A true CN112131020A (en) 2020-12-25

Family

ID=73842239

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010999881.8A Pending CN112131020A (en) 2020-09-22 2020-09-22 API interface generating method, calling method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN112131020A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112835561A (en) * 2021-03-09 2021-05-25 吉林省裕林信息科技有限公司 Method, open platform, terminal and medium for quickly generating API service interface
CN112988132A (en) * 2021-02-25 2021-06-18 平安科技(深圳)有限公司 Automatic generation method and device of data interface, computer equipment and storage medium
CN113590097A (en) * 2021-07-30 2021-11-02 中电金信软件有限公司 API interface generation method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110032511A (en) * 2019-03-19 2019-07-19 深圳市买买提信息科技有限公司 A kind of interface test method and interface testing equipment
CN110286897A (en) * 2019-05-22 2019-09-27 深圳壹账通智能科技有限公司 API Visual Dynamic configuration method, device, equipment and storage medium
CN111104421A (en) * 2019-12-31 2020-05-05 新奥数能科技有限公司 Data query method and device based on data interface standard configuration
CN111198772A (en) * 2019-12-23 2020-05-26 中思博安科技(北京)有限公司 Method and system for generating application program interface API
CN111597246A (en) * 2020-05-28 2020-08-28 北京金堤科技有限公司 Bill generation method and device, storage medium and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110032511A (en) * 2019-03-19 2019-07-19 深圳市买买提信息科技有限公司 A kind of interface test method and interface testing equipment
CN110286897A (en) * 2019-05-22 2019-09-27 深圳壹账通智能科技有限公司 API Visual Dynamic configuration method, device, equipment and storage medium
CN111198772A (en) * 2019-12-23 2020-05-26 中思博安科技(北京)有限公司 Method and system for generating application program interface API
CN111104421A (en) * 2019-12-31 2020-05-05 新奥数能科技有限公司 Data query method and device based on data interface standard configuration
CN111597246A (en) * 2020-05-28 2020-08-28 北京金堤科技有限公司 Bill generation method and device, storage medium and electronic equipment

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988132A (en) * 2021-02-25 2021-06-18 平安科技(深圳)有限公司 Automatic generation method and device of data interface, computer equipment and storage medium
CN112988132B (en) * 2021-02-25 2021-12-21 平安科技(深圳)有限公司 Automatic generation method and device of data interface, computer equipment and storage medium
CN112835561A (en) * 2021-03-09 2021-05-25 吉林省裕林信息科技有限公司 Method, open platform, terminal and medium for quickly generating API service interface
CN113590097A (en) * 2021-07-30 2021-11-02 中电金信软件有限公司 API interface generation method and device, electronic equipment and storage medium
CN113590097B (en) * 2021-07-30 2022-11-29 中电金信软件有限公司 API interface generation method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US20220276910A1 (en) Dynamically integrating a client application with third-party services
US20230370464A1 (en) Systems and methods for controlling sign-on to web applications
CN112131020A (en) API interface generating method, calling method, device, equipment and medium
US8898764B2 (en) Authenticating user through web extension using token based authentication scheme
US9923929B2 (en) Systems and methods for in-session refresh of entitlements associated with web applications
US20100082771A1 (en) Mechanism for inserting trustworthy parameters into ajax via server-side proxy
US8126962B1 (en) Systems and methods for tracking user activity at website
US10069812B1 (en) Technique for facilitating auto login to a website
CN113381979B (en) Access request proxy method and proxy server
CN112860778B (en) Database management method, device, equipment and medium for desktop application program
US20090060178A1 (en) Management system for web service developer keys
CN112818014B (en) Block chain data analysis method and device and electronic equipment
US8195792B2 (en) Interfacing distinct services for providing web based document manipulation access
CN110611725B (en) Node access method, node access device, computer equipment and storage medium
US20150271197A1 (en) Providing multi-level password and phishing protection
US9665732B2 (en) Secure Download from internet marketplace
US8037067B1 (en) Systems and methods for tracking user activity at website
CN113626795A (en) Verification method and device of distributed system architecture, electronic equipment and storage medium
CN112925589B (en) Calling method and device of expansion interface
CN110716743B (en) Aggregation API development method and system suitable for multiparty collaborative development
CA2840305A1 (en) Mobile device with enhanced personal information management application for tracking user interactions
CN111190742A (en) Resource cooperation method and device, computer equipment and storage medium
CN111597573B (en) Page embedding method and device, computer equipment and storage medium
CN113987035A (en) Block chain external data access method, device, system, equipment and medium
CN111371643B (en) Authentication method, device 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