[go: up one dir, main page]

CN116781789B - API service generation method and device - Google Patents

API service generation method and device Download PDF

Info

Publication number
CN116781789B
CN116781789B CN202310520548.8A CN202310520548A CN116781789B CN 116781789 B CN116781789 B CN 116781789B CN 202310520548 A CN202310520548 A CN 202310520548A CN 116781789 B CN116781789 B CN 116781789B
Authority
CN
China
Prior art keywords
api service
target
configuration item
interface
data
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
CN202310520548.8A
Other languages
Chinese (zh)
Other versions
CN116781789A (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.)
Tianyun Rongchuang Data Science & Technology Beijing Co ltd
Original Assignee
Tianyun Rongchuang Data Science & Technology Beijing 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 Tianyun Rongchuang Data Science & Technology Beijing Co ltd filed Critical Tianyun Rongchuang Data Science & Technology Beijing Co ltd
Priority to CN202310520548.8A priority Critical patent/CN116781789B/en
Publication of CN116781789A publication Critical patent/CN116781789A/en
Application granted granted Critical
Publication of CN116781789B publication Critical patent/CN116781789B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • User Interface Of Digital Computer (AREA)

Abstract

The disclosure relates to an API service generation method and device, and relates to the technical field of data processing. Comprising the following steps: displaying an API service generation interface, wherein the API service generation interface comprises at least one configuration item; determining target configuration data corresponding to the target configuration item in response to user input of the target configuration item; generating a first API service based on the target configuration data; the target configuration items are one or more configuration items in the at least one configuration item, and the target configuration data comprises at least one of the following data corresponding to the first API service: the method comprises the steps of data source, parameter model of fields in the data source, query statement corresponding to the fields in the data source and business rules of API service. Embodiments of the present disclosure generate API services based on the visualized interface.

Description

API service generation method and device
Technical Field
The disclosure relates to the technical field of data processing, and in particular relates to an API service generation method and device.
Background
In recent years, in the era of digitalization, enterprises face a trend of digitalization transformation, business data are stored in different data systems, and a great challenge is brought to realizing data sharing. The method and the device have the advantages that the data security is ensured, and meanwhile, the capability of open sharing of enterprise data is rapidly improved, so that the method and the device are key to digital transformation of enterprises.
The data API (Application Programming Interface ) service can solve business interaction, provide data service to the outside, realize open sharing of data and ensure data security, so that the use of the data API service is a main means for enterprises to realize data sharing.
However, at present, a complete set of data API service is developed, and because of the complex business logic rules inside, developers need to spend a great deal of time to generate an API interface through programming according to different requirements, which results in long period of developing the data API service and high later maintenance cost.
Disclosure of Invention
In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a method and an apparatus for generating an API service, in which a business expert can automatically generate a data API service through a visualized operation, thereby reducing a development period of the data API service.
In order to achieve the above object, the technical solution provided by the embodiments of the present disclosure is as follows:
in a first aspect, a method for generating an API service is provided, including:
displaying an API service generation interface, wherein the API service generation interface comprises at least one configuration item;
determining target configuration data corresponding to a target configuration item in response to user input of the target configuration item;
Generating a first API service based on the target configuration data;
wherein the target configuration item is one or more configuration items in the at least one configuration item, and the target configuration data comprises at least one of the following data corresponding to the first API service: the system comprises a data source, a parameter model of a field in the data source, a query statement corresponding to the field in the data source and a business rule of an API service.
In a second aspect, there is provided an API service generating apparatus, including:
the display module is used for displaying an API service generation interface, wherein the API service generation interface comprises at least one configuration item;
the determining module is used for responding to the input of a user to the target configuration item and determining target configuration data corresponding to the target configuration item;
the generation module is used for generating a first API service based on the target configuration data; wherein the target configuration item is one or more configuration items in the at least one configuration item, and the target configuration data comprises at least one of the following data corresponding to the first API service: the system comprises a data source, a parameter model of a field in the data source, a query statement corresponding to the field in the data source and a business rule of an API service.
In a third aspect, there is provided an electronic device comprising: a third aspect of a processor, a memory, and a memory stored thereon provides an electronic device comprising: a processor, a memory and a computer program stored on the memory and executable on the processor, which when executed by the processor implements the API service generation method of the first aspect or any of its alternative embodiments.
In a fourth aspect, there is provided a computer-readable storage medium comprising: the computer readable storage medium stores thereon a computer program which, when executed by a processor, implements the API service generation method according to the first aspect or any optional implementation thereof.
In a fifth aspect, there is provided a computer program product comprising: the computer program product, when run on a computer, causes the computer to implement the API service generation method of the first aspect or any of its alternative embodiments.
According to the API service generation method provided by the embodiment of the disclosure, through displaying an API service generation interface, target configuration data corresponding to a target configuration item is determined in response to input of the target configuration item by a user; and generating a first API service based on the target configuration data. Through the scheme, the visual API service generation interface is adopted, and one or more function configuration items for generating the API service are displayed on the interface, so that when the user needs to generate the API service, the user can realize the visual generation of the API service by operating the function configuration items for generating the API service, thereby saving the development period of the API service and reducing the maintenance cost of the API service.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments of the present disclosure or the solutions in the prior art, the drawings that are required for the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
Fig. 1 is a flowchart of an API service generation method provided in an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of an interface for constructing a parametric model according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of a query statement setting interface according to an embodiment of the present disclosure;
fig. 4 is a schematic diagram of a business rule configuration interface provided in an embodiment of the present disclosure;
FIG. 5 is a schematic flow chart of an API service generation and application provided in an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of an API service publishing online interface provided by an embodiment of the present disclosure;
FIG. 7 is a schematic diagram of an API service approval interface provided by an embodiment of the present disclosure;
Fig. 8 is a schematic diagram of an API service generating apparatus according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, a further description of aspects of the present disclosure will be provided below. It should be noted that, without conflict, the embodiments of the present disclosure and features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced otherwise than as described herein; it will be apparent that the embodiments in the specification are only some, but not all, embodiments of the disclosure.
Currently, in the era of digitalization, enterprises face the trend of digitalization transformation, business data are stored in different data systems, and great challenges are brought to realizing data sharing. The method and the device have the advantages that the data security is ensured, and meanwhile, the capability of open sharing of enterprise data is rapidly improved, so that the method and the device are key to digital transformation of enterprises.
The data API (Application Programming Interface ) service can solve business interaction, provide data service to the outside, realize open sharing of data and ensure data security, so that the use of the data API service is a main means for enterprises to realize data sharing.
However, at present, a complete set of data API service is developed, and because of the complex business logic rules inside, developers need to spend a great deal of time to generate an API interface through programming according to different requirements, which results in long period of developing the data API service and high later maintenance cost.
In order to solve the above-mentioned problems, an embodiment of the present disclosure provides an API service generating method and apparatus, by displaying an API service generating interface, determining target configuration data corresponding to a target configuration item in response to user input of the target configuration item; and generating a first API service based on the target configuration data. Through the scheme, the visual API service generation interface is adopted, and one or more function configuration items for generating the API service are displayed on the interface, so that when the user needs to generate the API service, the user can realize the visual generation of the API service by operating the function configuration items for generating the API service, thereby saving the development period of the API service and reducing the maintenance cost of the API service.
Fig. 1 is a flowchart of an API service generation method according to an embodiment of the present disclosure. As shown in fig. 1, the API service generation method includes, but is not limited to, the following steps:
101. An API service generation interface is displayed.
In some embodiments, the API service generation interface includes at least one configuration item, wherein the configuration item is used to determine API service configuration data.
In some embodiments, the API service generation interface may be any functional interface in the process of generating an API service.
102. In response to user input of the target configuration item, target configuration data corresponding to the target configuration item is determined.
In some embodiments, the target configuration item may be at least one or more configuration items in the API service generation interface in step 101, and the target configuration data may be configuration data determined to generate the API service based on an input operation of the target configuration data by the user.
In some embodiments, the target configuration data includes at least one of the following data corresponding to the first API service: the system comprises a data source, a parameter model of a field in the data source, a query statement corresponding to the field in the data source and a business rule of an API service.
In some embodiments, when the API service generation interface is a data source management interface, configuration items of the data source management interface correspond to at least one form of data source, a target data source corresponding to the target configuration item is determined in response to user input of the configuration items, and configuration data for the target data source, that is, the target data source related to the API service is determined based on user selection operation of the configuration items. And performing configuration operation on the target data source to obtain configuration data of the target data source. The target data source may include any of the following forms: a data source in a relational database form, a data source in a KV cache form and a data source in an external interface form.
In the above embodiment, the data source corresponding to the API service business target is determined by the visualized data source management interface and displaying the function configuration item for determining the target data source on the interface, based on the input of the function configuration item for determining the target data source in the data source management interface. After the target data source is determined, the data can be acquired from the determined target data source by calling the API service, so that the data sharing is realized.
In some embodiments, the API service generating interface is a parameter model interface, and the configuration items of the interface are function configuration items corresponding to target fields in a target data source determined by the data source management interface, where the functions of the function configuration items include: field renaming, field type setting, field transfer direction setting, whether a field must transfer a setting, etc. And responding to the input of the user to the function configuration item, determining the function parameter corresponding to the function configuration item, and generating a parameter model corresponding to the target field in the target data source based on the function parameter.
For example, fig. 2 is a schematic diagram of a parameter model building interface provided in an embodiment of the present disclosure, where, as shown in fig. 2, the interface is divided into a left part and a right part, the left part is a database table 201, the right part is a selected field 202, a field selected from the target data source is determined in response to a user selecting the target data source in the database table 201, in the selected field 202, in response to an input of a configuration item 203, i.e. field renaming, an identification of the field selected from the target data source is changed to a content input in the configuration item, i.e. field renaming; in response to input of the configuration item 204, which is "field type", the type of field when the field selected from the target data source is an input field or an output field is determined; in response to input of the configuration item 205 of "field transfer direction", it is determined whether a field selected from the target data source is an input field or an output field; in response to input to the "field must pass" configuration item 206, it is determined whether a field selected from the target data source is a must pass field when the field is an input field or an output field. Based on the input of the function configuration items, a parametric model of the selected fields in the target data source is determined.
In the above embodiment, the function configuration items for determining the parameter model are displayed on the visualized parameter model interface, and the parameter model of the corresponding field of the data source is determined based on the input of the function configuration items on the parameter model interface, so that the setting of the parameter model can be realized in a visualized manner, and the man-machine interaction performance is improved. The parametric model of the corresponding field of the data source provides the field in the required format for the configuration of the subsequent business rules. After the parameter model is generated, when the API service is called to acquire data in the data source, the corresponding fields of the data in the data source are returned in the form of the fields defined in the parameter model.
In some embodiments, the API service generation interface provides an interface for the query statement, the functional configuration items of the interface being first configuration items in the target data source for making field selections and/or second configuration items for making field associations; based on the content input corresponding to the first configuration item and/or the second configuration item, a query statement corresponding to a field in the data source is determined. In the embodiment of the disclosure, when two or more tables are involved, field association is used, the second configuration item corresponding to the field association needs to be configured, and when only one table is used, the second configuration item corresponding to the field association does not need to be configured.
In some embodiments, a plurality of fields is determined from a target data source in response to user input of a first configuration item; determining, in response to user input for the second configuration item, an association policy corresponding to the plurality of fields; and determining query sentences corresponding to the fields based on the fields and the association strategies corresponding to the fields.
In some embodiments, there are three data sources, a relational database, a KV cache and an external interface, at the setup interface of the query statement. Based on the query statement of the data source, such as a relational database, a visual sql statement generation interface is provided, and based on the input of the corresponding configuration item of the query statement in the form of generating sql in the visual sql statement generation interface, the query statement of the sql class is generated. Based on query sentences corresponding to the data sources such as KV cache types, responding to the input of the redis configuration items, reading data through a redis command, and generating the query sentences of the data sources; based on the query statement of the data source, such as the external interface, the data is read through the configuration interface address in response to the input of the configuration item of the data source of the type, so that the query statement of the data source of the type is generated. Where sql (Structured Query Language: structured query language) is the language developed for operating databases. The method is originally developed for improving the database query efficiency, but can perform data query, and operations such as data insertion and deletion can be basically completed through sql. Redis is an open source, containing multiple data structures, supporting networks, memory-based, optionally persistent, key-value pair storage database written using ANSI C. Wherein ANSI C is a standard for the C language, which is promulgated by the American National Standards Institute (ANSI) and international organization for standardization (ISO). The C language is a general program design language facing to the process and abstract, and is widely applied to the bottom development. The C language can be compiled and processed in a simple manner into low-level memory. The C language is a high efficiency programming language that produces only a small amount of machine language to run without any running environment support.
In some embodiments, determining a plurality of fields from a target data source may include determining a data table corresponding to the fields, then determining a plurality of fields to be associated from the data table, determining a query statement corresponding to the plurality of fields based on the plurality of fields and an association policy corresponding to the plurality of fields, and associating a table in which the plurality of fields are located, where the method of associating the table includes: left association, right association, inner association, etc. The LEFT association is also called a LEFT external connection, which is one of external connection queries, and may also be called a LEFT connection, and the LEFT external connection is used to return all records in the LEFT table of the connection key, and records meeting the connection conditions in the right table. The RIGHT association is also called a RIGHT external connection (RIGHT JOIN), which is also one of the external connection queries, and may be referred to as a RIGHT connection. It is used to return all records in the right table of the connection key and records in the left table that meet the connection conditions. The internal association returns all matching records based on the values of the keys in the two tables.
Fig. 3 is a schematic diagram of a query statement setting interface provided by an embodiment of the present disclosure, where, as shown in fig. 3, the query statement setting interface includes 5 function columns including a database table 301, a selected table 302, a selected field 303, an association condition 304, and other conditions 305, where a target data source in the database table 301 includes a business district table, a supermarket commodity list table, and a consumption record table, and the selected table 302 displays the selected supermarket commodity list table and the consumption record table, and displays fields of "commodity name", "commodity number", and "commodity date of purchase" in the supermarket commodity list table; fields "name", "goods number", "consumption amount" in the consumption record table. In response to user input of the first item, determining the "name", "goods number" in the consumption record list and the "goods number", "goods name" in the supermarket goods list as selected fields, selecting the field "goods number" in the consumption record list under the left table in the association condition 304, selecting the field "goods number" in the supermarket goods list under the right table, performing left association, and defining selection criteria, grouping, statement ordering and the like for the field data in the selected field 303 in other conditions 305, and determining the query statement corresponding to the selected field through the input of the configuration items in the function columns of the pairs.
In the embodiment, the function configuration items for determining the query statement are displayed on the visual query statement setting interface, so that the setting of the query statement can be realized in a visual mode, and the man-machine interaction performance is improved. Through the input of the function configuration items for determining the query statement in the visual interface, the query statement corresponding to one or more fields is determined. After generating the query statement, when the API service is called to acquire data, the data corresponding to the field matched with the query statement can be retrieved from different database tables in the data source based on the query statement.
In some embodiments, the API service generation interface is a business rule configuration interface, the configuration items of the business rule configuration interface comprising: and applying the third configuration item of the query statement and the fourth configuration item of the application parameter model.
In some embodiments, a query statement to be business rule configured is determined in response to user input of a third configuration item, and a parametric model to participate in business rule configuration is determined in response to user input of a fourth configuration item. And configuring business rules of the API service based on the determined target query statement and the fields corresponding to the parameter model.
In some embodiments, based on the visualized operation, a rule definition mode is determined in a business rule setting interface corresponding to the input of a user for a rule form configuration item, and a business rule for API service is configured based on a query statement and a field corresponding to a parameter model by using the rule definition mode. The rule definition mode of the visualization is divided into: and defining the mode of rules such as a guide type decision set, a decision tree, a decision table, a grading card and the like.
Among rule strategies, the guide type decision set is a rule set formed by a group of common rules and circulation rules, and is a service rule implementation mode with highest use frequency. The guide type decision set is a designer provided by an engine, the configuration of common rules and circulation rules in the guide type decision set can be completed step by step through mouse clicking, and the service rules can be visualized to the maximum extent by matching with the guide type rule designer with high visualization, so that the complexity of rule configuration is reduced.
The decision tree is a tree structure, wherein each internal node represents a judgment on an attribute, each branch represents the output of a judgment result, and each leaf node represents a classification result.
The decision table is a tool for representing rules in a table form, is suitable for describing the conditions of processing and judging more, and is combined with each other and provided with various decision schemes, the decision table provides a precise and concise way for describing complex logic, and the multiple conditions and actions to be executed after the conditions are satisfied can be displayed in a graphical form.
In the financial wind control scene, the grading card is the most commonly used financial wind control model. Rule configuration in the form of a scoring card is a numerical representation after analysis of information about an individual or institution, for example representing the likelihood of risk of loss of the individual or institution due to the repudiation of credit activity, scoring is commonly used for risk management and assessment of individuals or institutions.
Fig. 4 is a schematic diagram of a business rule configuration interface according to an embodiment of the disclosure. As shown in fig. 4, the interface uses a wizard decision set to configure business rules, and a "save" button 401 in fig. 4 is used to save configured rule 1; a "test" button 402 for testing rule 1 of the configuration; an "Add rules" button 403 for adding one or more business rules; a "delete" button 404, for deleting business rule content of the row in which the button 404 is located; the "copy" button 405 is used to copy the content of the row where the button 405 is located, add one row of copied content and display the copied content. A selection block 406 for adding rule content for the "if" section, an addition block 407 for adding a row of business rules, "if" then "else" is the wizard decision set rule definition format, the corresponding section of which is the content of rule 1 configured in a wizard decision set based manner. The specific business rules can be understood as: when the input business district type is the core business district, carrying out user transaction inquiry; otherwise, prompting that the business turn type is wrong.
In the above embodiment, in the visualized business rule interface, the function configuration item for configuring the business rule is displayed, and based on the input of the function configuration item in the interface, the business rule corresponding to the API service is configured. The configuration of the API service business rules can be realized in a visual mode, and the man-machine interaction capability is improved. After the business rule configuration is completed, when the API service is called to perform data query, query sentences can be limited according to the set business rules of the API service so as to obtain data corresponding to fields matched with the business rules.
In some embodiments, after the business rules are configured, an orchestration decision flow is performed on the business rules, that is, orchestration is performed on the configured plurality of business rule execution logic, the flow direction of rule execution is specified,
by checking historical consumption record information of a certain user, determining a credit corresponding to the user information, and judging whether the user is a blacklist person or not, whether the user can continue normal consumption is determined.
103. Based on the target configuration data, a first API service is generated.
In some embodiments, configuration data for generating the API service is determined based on the visualized interface operations described in steps 101 through 102 above, and the first API service is generated based on the determined target configuration data.
Fig. 5 is a schematic flow chart of API service generation and application provided in an embodiment of the disclosure, where the method includes, but is not limited to, the following steps:
501. an API service generation interface is displayed.
502. And determining target configuration data corresponding to the target configuration item in response to input of the target configuration item by a user.
503. And generating a first API service based on the target configuration data.
In some embodiments, the descriptions of the steps 501 to 503 may refer to the descriptions of the steps 101 to 103, which are not repeated herein.
504. Displaying the API service release online interface.
In some embodiments, after generating the first API service based on the target configuration data, displaying an API service publishing online interface comprising a publishing control corresponding to at least one API service, wherein the at least one API publishing control comprises the first API service.
Exemplary, fig. 6 is a schematic diagram of an API service publishing online interface provided by an embodiment of the present disclosure, as shown in fig. 6, where the interface includes: a query track 601, configured to query an published API service, a switch list 602, configured to switch a presentation form of the API service, a search 603, configured to search a specified API service and present an online interface for the API service publication, 604 and 605 are API services presented in the online interface for the API service publication, where the API service corresponding to 604 includes: the identification of the API service "small credit", the fee type of the API service "free", the publisher of the API service "little king", the generation time of the API service "2023-03-30", the up status of the API service "not on line", 606 is an on-line control for publishing 604 the corresponding API service, 607 is an edit control for editing 604 the corresponding API service, and changing the content corresponding to the API service. "." corresponding 608 control, after clicking "more" is displayed for other functional processing of the API service corresponding to 604, such as viewing "call document" and "online node", "deactivate service", "download service package", etc. Similarly 605 controls. 605, the corresponding API service has issued an online, and the online status of the API service is "online. "2 pieces in total" means that there are only two API services in the current service list, and when the control "5 pieces/page" is used for the interface to have more than 5 API services, the number of API services corresponding to the input content is exposed in response to the input to the control. The control "1" is used for showing the number of pages of the current interface, if the interface has a plurality of API services, each page shows 5 API services, the number of pages is obtained by dividing the number of all the API services by 5, and the control "1 page is used for switching the API services for viewing other pages when the interface has a plurality of API services.
In some embodiments, the second API service is published in response to user input to a publication control corresponding to the second API service, which may be any one of the first API service or the at least one API service.
In some embodiments, publishing the second API service includes: and distributing the configured business rules corresponding to the single second API service or the business rules corresponding to the second API service outwards in a service mode.
In some embodiments, publishing the second API service includes: the message template is selected to define the input-output format of the time parameter of the second API service call. And setting calling cost of the second API service, and performing effective online operation on the second API service. The message templates may be set in a customized manner, which is not limited in the embodiments of the present disclosure.
In the above embodiment, the API service is released and online through the visualized API service release and online interface, and the function configuration item for releasing the API service is displayed on the interface. The release of the API service can be realized in a visual mode. Therefore, after the API service is released and online, the data in the data source can be acquired by using the API service after the release and online, so that the data sharing is realized.
505. Displaying an API service approval interface.
In some embodiments, before displaying the API service approval interface, an API service application interface is displayed, the API service application interface including at least one application control corresponding to the published API service. The published list of API services that can be applied is presented in the API service application interface. Responsive to an input by the applicant of an application control corresponding to a published API service that can be applied, determining a published API service corresponding to the application.
In some embodiments, an API service approval interface is displayed, the interface including an approval control corresponding to at least one published API service, the API service approval interface displaying at least one published API service of applicants' application.
Fig. 7 is a schematic diagram of an API service approval interface provided by an embodiment of the present disclosure, where, as shown in fig. 7, the interface includes 4 API service contents corresponding to 4 applicant account information, in fig. 7, 701 including a "service name" and a right input box, and 702 including a "applicant" and a right input box, when the content of an API service of a specific application is queried, conditions of the query input are reset 703, and the conditions are used to empty the content in input fields corresponding to 701 and 702, and query 704 is used to screen application records based on the content in input boxes in 701 and 702. The corresponding part 705 is an API service applied by a plurality of applicant, wherein the API service applied by each application includes: the identification of the API service is the content of the column of the "service name", the price of the single-use API service is the content of the column of the "default price (meta/times)", the applicant information of the application API service is the content corresponding to the column of the "applicant", "applicant mechanism". The approval condition of the applied API service is the content of the corresponding column of the approval state, the time of the application of the API service by the applicant is the content of the corresponding column of the application time, and the control corresponding to the application of the API service by the applicant is the control in the corresponding column of the operation. Different numbers of API services may be exposed at the approval service interface based on the content input of "4 bars in total", "5 bars/page", "1", "go to page 1" to these controls.
506. And responding to the input of the user to the approval control corresponding to the third API service, and acquiring the account information of the applicant of the third API service.
Wherein the third API service is any one of the at least one published API service.
In some embodiments, responsive to user input of an approval control corresponding to the third API service, applicant account information for applying for the third API service is determined. The information such as the mechanism, the application time and the like is also acquired.
507. And determining the use authority of the third API service corresponding to the applicant account information.
In some embodiments, in response to user input of an approval interface authentication control, whether to open service call permission is judged according to the account information of the applicant. When the service calling right is opened, a service token of a third API service corresponding to the account information of the applicant is determined in response to the input of the approver through the configuration item, wherein the service token is a unique identification of the service. Based on the service token, the applicant can obtain the required data from the data source using the interface corresponding to the third API service.
In some embodiments, in response to input of the approval interface authentication control by the user, when the right of the applicant account to use the third API service is opened, before the service token of the third API service corresponding to the applicant account information is determined in response to input of the configuration item by the approver, a call discount for the third API service is determined in response to input of the approval person to the call discount configuration item, and based on the call discount, the third API service fee of the applicant to use the application can be determined.
In some embodiments, the service tokens of the third API service may be uniformly managed, and the service tokens of the third API service may be directly distributed to other applicant accounts applying for the third API service.
In some embodiments, when it is determined that the applicant account information does not have the right to use the third API service, in response to the user input of the rejection configuration item, determining reject data that rejects the applicant from invoking the third API service, and based on the reject data, the applicant cannot acquire the required data from the data source using the third API service.
In the above embodiment, through the visualized service approval interface, the function configuration item for approving the API service is displayed on the interface, and based on the input of the function configuration item in the service approval interface, the authority corresponding to the service is allocated to the user who uses the API service, so that the user can obtain the data by calling the API service based on the authority allocated by the API service, and the returned data is the data in the authority corresponding to the API service, thereby ensuring the security of data sharing.
Fig. 8 is a schematic diagram of an API service generating apparatus according to an embodiment of the present disclosure, as shown in fig. 8, where the apparatus includes:
a display module 801, configured to display an API service generation interface, where the API service generation interface includes at least one configuration item;
A determining module 802, configured to determine target configuration data corresponding to a target configuration item in response to a user input of the target configuration item;
a generating module 803, configured to generate a first API service based on the target configuration data; wherein the target configuration item is one or more configuration items in the at least one configuration item, and the target configuration data comprises at least one of the following data corresponding to the first API service: the system comprises a data source, a parameter model of a field in the data source, a query statement corresponding to the field in the data source and a business rule of an API service.
In some embodiments, the API service generation interface is a data source management interface, the at least one configuration item corresponds to at least one form of data source, and the determining module 802 is specifically configured to: the method comprises the steps that in response to input of a target configuration item by a user, a target data source corresponding to the target configuration item is determined, and configuration data aiming at the target data source is obtained; the target data source comprises any of the following forms of data sources: a data source in a relational database form, a data source in a KV cache form and a data source in an external interface form.
In some embodiments, the API service generation interface is a build parameter model interface, the target configuration item is a function configuration item of a target field in the target data source, and the function configuration item corresponds to at least one of the following functions: field renaming, field type setting, field transfer direction setting, and whether the field is necessary to transfer or not; the determining module 802 is specifically configured to: and responding to the input of the user to the function configuration item, determining the function parameter corresponding to the function configuration item, and determining the parameter model corresponding to the target field in the target data source based on the function parameter.
In some embodiments, the API service generation interface sets an interface for a query statement, the target configuration item being a first configuration item for making field selections in a target data source and a second configuration item for making field associations; the determining module 802 is specifically configured to: determining, in response to user input for the second configuration item, an association policy corresponding to the plurality of fields; and determining query sentences corresponding to the fields based on the fields and the association strategies corresponding to the fields.
In some embodiments, the API service generation interface is a business rule configuration interface, the target configuration items including a third configuration item for making query statement selections and a fourth configuration item for making parametric model selections; the determining module 802 is specifically configured to: determining a target query statement in response to user input for the third configuration item; determining a target parametric model in response to user input for the fourth configuration item; and configuring business rules of the API service based on the target query statement and the field corresponding to the parameter model.
In some embodiments, the display module 801 is further configured to: displaying an API service release online interface, wherein the API service release online interface comprises release controls corresponding to at least one API service, and the at least one API service comprises the first API service;
In some embodiments, the API service generating means further comprises: and the publishing online module 804 is configured to publish a second API service in response to an input of a publishing control corresponding to the second API service by a user, where the second API service may be any one of the first API service or the at least one API service.
In some embodiments, the display module 801 is further configured to: displaying an API service approval interface, wherein the API service approval interface comprises: at least one published API service corresponds to an approval control.
In some embodiments, the API service generating means further comprises: the approval authentication module 805 is specifically configured to: responding to input of a user to an approval control corresponding to a third API service, and acquiring applicant account information of the third API service; and determining the use authority of the third service API corresponding to the applicant account information, wherein the third API service is any one of the at least one published API service.
The present application also provides a computer-readable storage medium having a computer program stored thereon. The computer-readable storage medium may be included in the electronic device described in the above embodiment or may exist alone. The computer program, when executed by the processor, implements each process of the API service generation method described above, and can achieve the same technical effects, and for avoiding repetition, will not be described herein.
Based on the same inventive concept, the embodiments of the present application also provide a computer program product, which when run on a computer, causes the computing device to implement the method of running the applet provided in the above embodiments.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media having computer-usable program code embodied therein.
The processor may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, etc., such as Read Only Memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
Computer readable media include both non-transitory and non-transitory, removable and non-removable storage media. Storage media may embody any method or technology for storage of information, which may be computer readable instructions, data structures, program modules, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims (9)

1. An API service generation method, comprising:
displaying an API service generation interface, wherein the API service generation interface comprises at least one configuration item;
determining target configuration data corresponding to a target configuration item in response to user input of the target configuration item;
generating a first API service based on the target configuration data;
wherein the target configuration item is one or more configuration items in the at least one configuration item, and the target configuration data comprises at least one of the following data corresponding to the first API service:
the system comprises a data source, a parameter model corresponding to a field in the data source, a query statement corresponding to the field in the data source and a business rule of an API service;
The API service generation interface is a business rule configuration interface, and the target configuration items comprise a third configuration item for carrying out query statement selection and a fourth configuration item for carrying out parameter model selection; the query statement is generated in a query statement setting interface based on a plurality of fields selected by a user and associated strategies corresponding to the plurality of fields;
the determining, in response to user input of a target configuration item, target configuration data corresponding to the target configuration item includes: determining a target query statement in response to user input for the third configuration item;
determining a target parametric model in response to user input for the fourth configuration item;
and configuring business rules of the API service based on the target query statement and the field corresponding to the target parameter model.
2. The method of claim 1, wherein the API service generation interface is a data source management interface, the at least one configuration item corresponding to at least one form of data source;
the determining, in response to user input of a target configuration item, target configuration data corresponding to the target configuration item includes: the method comprises the steps that in response to input of a target configuration item by a user, a target data source corresponding to the target configuration item is determined, and configuration data aiming at the target data source is obtained;
The target data source comprises any of the following forms of data sources:
a data source in a relational database form, a data source in a KV cache form and a data source in an external interface form.
3. The method of claim 1, wherein the API service generation interface is a build parameter model interface, the target configuration item is a function configuration item of a target field in a target data source, and the function configuration item corresponds to at least one of the following functions:
field renaming, field type setting, field transfer direction setting, and whether the field is necessary to transfer or not;
the determining, in response to user input of a target configuration item, target configuration data corresponding to the target configuration item includes: and responding to the input of the user to the function configuration item, determining the function parameter corresponding to the function configuration item, and determining the parameter model corresponding to the target field in the target data source based on the function parameter.
4. The method according to claim 1, wherein the API service generation interface provides an interface for a query statement, the target configuration item being a first configuration item in a target data source for field selection and/or a second configuration item for field association;
The determining, in response to user input of a target configuration item, target configuration data corresponding to the target configuration item includes: determining a plurality of fields from a target data source in response to user input of the first configuration item;
determining, in response to user input for the second configuration item, an association policy corresponding to the plurality of fields;
and determining query sentences corresponding to the fields based on the fields and the association strategies corresponding to the fields.
5. The method of claim 1, wherein after generating the first API service based on the target configuration data, the method further comprises:
displaying an API service release online interface, wherein the API service release online interface comprises release controls corresponding to at least one API service, and the at least one API service comprises the first API service;
and releasing the second API service in response to the input of the user to the release control corresponding to the second API service, wherein the second API service can be any one of the first API service or the at least one API service.
6. The method according to claim 1: wherein after generating the first API service based on the target configuration data, the method further comprises:
Displaying an API service approval interface, wherein the API service approval interface comprises: at least one approval control corresponding to the published API service;
responding to input of a user to an approval control corresponding to a third API service, and acquiring applicant account information of the third API service;
and determining the use authority of the third API service corresponding to the applicant account information, wherein the third API service is any one of the at least one published API service.
7. An API service generating apparatus, comprising:
the display module is used for displaying an API service generation interface, wherein the API service generation interface comprises at least one configuration item;
the determining module is used for responding to the input of a user to the target configuration item and determining target configuration data corresponding to the target configuration item;
the generation module is used for generating a first API service based on the target configuration data; wherein the target configuration item is one or more configuration items in the at least one configuration item, and the target configuration data comprises at least one of the following data corresponding to the first API service: the system comprises a data source, a parameter model of a field in the data source, a query statement corresponding to the field in the data source and a business rule of an API service;
The API service generation interface is a business rule configuration interface, and the target configuration items comprise a third configuration item for carrying out query statement selection and a fourth configuration item for carrying out parameter model selection; the query statement is generated in a query statement setting interface based on a plurality of fields selected by a user and associated strategies corresponding to the plurality of fields;
the determining module is specifically configured to: determining a target query statement in response to user input for the third configuration item;
determining a target parametric model in response to user input for the fourth configuration item;
and configuring business rules of the API service based on the target query statement and the field corresponding to the target parameter model.
8. An electronic device, comprising: a processor, a memory and a computer program stored on the memory and executable on the processor, which when executed by the processor implements the API service generation method of any one of claims 1 to 6.
9. A computer-readable storage medium, comprising: the computer-readable storage medium stores thereon a computer program which, when executed by a processor, implements the API service generation method of any one of claims 1 to 6.
CN202310520548.8A 2023-05-09 2023-05-09 API service generation method and device Active CN116781789B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310520548.8A CN116781789B (en) 2023-05-09 2023-05-09 API service generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310520548.8A CN116781789B (en) 2023-05-09 2023-05-09 API service generation method and device

Publications (2)

Publication Number Publication Date
CN116781789A CN116781789A (en) 2023-09-19
CN116781789B true CN116781789B (en) 2024-02-23

Family

ID=87988566

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310520548.8A Active CN116781789B (en) 2023-05-09 2023-05-09 API service generation method and device

Country Status (1)

Country Link
CN (1) CN116781789B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111708801A (en) * 2020-05-29 2020-09-25 北京金山云网络技术有限公司 Report generation method, device and electronic device
CN114741396A (en) * 2022-04-28 2022-07-12 北京远舢智能科技有限公司 Data service processing method and device, electronic equipment and storage medium
CN115438071A (en) * 2022-09-29 2022-12-06 上海品顺信息科技有限公司 Query statement generation method and device, storage medium and computer equipment
WO2023273073A1 (en) * 2021-06-29 2023-01-05 深圳前海微众银行股份有限公司 Report configuration method, apparatus and device, and computer storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210248143A1 (en) * 2020-02-10 2021-08-12 Citrix Systems, Inc. Automatically executing graphql queries on databases

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111708801A (en) * 2020-05-29 2020-09-25 北京金山云网络技术有限公司 Report generation method, device and electronic device
WO2023273073A1 (en) * 2021-06-29 2023-01-05 深圳前海微众银行股份有限公司 Report configuration method, apparatus and device, and computer storage medium
CN114741396A (en) * 2022-04-28 2022-07-12 北京远舢智能科技有限公司 Data service processing method and device, electronic equipment and storage medium
CN115438071A (en) * 2022-09-29 2022-12-06 上海品顺信息科技有限公司 Query statement generation method and device, storage medium and computer equipment

Also Published As

Publication number Publication date
CN116781789A (en) 2023-09-19

Similar Documents

Publication Publication Date Title
Kobrin Managing political risk assessment: Strategic response to environmental change
Karabag Factors impacting firm failure and technological development: A study of three emerging-economy firms
US11755606B2 (en) Dynamically updated data sheets using row links
US11816100B2 (en) Dynamically materialized views for sheets based data
JP7361609B2 (en) Integrated system for editing and simulating rules, version control, and business process management
US7574379B2 (en) Method and system of using artifacts to identify elements of a component business model
Bjeladinovic A fresh approach for hybrid SQL/NoSQL database design based on data structuredness
US20200175403A1 (en) Systems and methods for expediting rule-based data processing
CN116737137A (en) Business process generation method, device, computer equipment and storage medium
Martin et al. The Rise of the Knowledge Graph
US20070124275A1 (en) Considering transient data also in reports generated based on data eventually stored in a data-warehouse
CN116781789B (en) API service generation method and device
US10713016B1 (en) Method of implementing rules on visual language using visual blocks
CN118967162A (en) A method, device and equipment for reviewing marketing information
CN113850577A (en) Resource account processing method and device
Gao et al. [Retracted] Construction and Application of International Commercial Dispute Resolution Mechanism Model
Bitektine et al. Experiments in organization and management research
JP2001195288A (en) Trunk task package and method for selling the same
CN113094414A (en) Circulation map generation method and device
Shidaganti et al. Challenges in Banking and Solving Them Using RPA
Balcerek et al. Application of business rules mechanism in IT system projects
Li et al. Crowdsourcing background
CN113052675B (en) Data display method and device
Jones Driving Data Quality with Data Contracts: A comprehensive guide to building reliable, trusted, and effective data platforms
Tonkiss Postcapitalist politics?

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