Interface generation method and apparatus

By inputting configuration information into the target page and converting it into the target protocol and syntax, the application programming interface is automatically generated, solving the problem of repeatedly writing interface code and achieving efficient interface generation and data table operations.

CN115525284BActive Publication Date: 2026-07-21TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2021-06-24
Publication Date
2026-07-21

Smart Images

  • Figure CN115525284B_ABST
    Figure CN115525284B_ABST
Patent Text Reader

Abstract

The application discloses an interface generation method and device, and relates to the technical field of Internet databases.The method comprises the following steps: displaying a target page, wherein the target page comprises a target area and interface creation identification information; determining target configuration information in response to a trigger instruction for the target area; obtaining a target protocol and a target syntax corresponding to the target configuration information in response to a trigger instruction for the interface creation identification information; converting the target configuration information into information of the target protocol based on first mapping information; converting the target configuration information into information of the target syntax based on second mapping information; and generating an application programming interface corresponding to the target configuration information based on the information of the target protocol and the information of the target syntax.The application avoids repeatedly writing interface codes, and improves the generation efficiency of the interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet database technology, and in particular to an interface generation method and apparatus. Background Technology

[0002] In related technologies, when performing frequent operations such as adding, deleting, querying, and modifying data tables in a database, it is usually necessary to repeatedly write interface code to handle these operations. This results in a large number of personnel engaging in repetitive development and maintenance, which fails to achieve effective utilization of personnel and efficient operation, causing a great waste of human resources and reducing the efficiency of interface generation.

[0003] Therefore, it is necessary to provide an interface generation method and apparatus to avoid repeatedly writing interface code and improve the efficiency of interface generation. Summary of the Invention

[0004] This application provides an interface generation method and apparatus that can avoid repeatedly writing interface code and improve the efficiency of interface generation.

[0005] On the one hand, this application provides an interface generation method, the method comprising:

[0006] The target page is displayed, which includes a target area and interface creation identification information; the target area is used to input target configuration information; the target configuration information consists of fields with preset protocols and preset syntax.

[0007] In response to a trigger command to create identification information for the interface, the target protocol and target syntax corresponding to the target configuration information are obtained;

[0008] Based on the first mapping information, the target configuration information is converted into target protocol information; the first mapping information represents the mapping relationship between the fields of the preset protocol and the fields of the target protocol.

[0009] Based on the second mapping information, the target configuration information is converted into target syntax information; the second mapping information represents the mapping relationship between the fields of the preset syntax and the fields of the target syntax.

[0010] Based on the information of the target protocol and the information of the target syntax, an application programming interface corresponding to the target configuration information is generated.

[0011] On the other hand, an interface generation apparatus is provided, the apparatus comprising:

[0012] The target page display module is used to display the target page, which includes a target area and interface creation identification information; the target area is used to input target configuration information; the target configuration information consists of fields of preset protocol and preset syntax.

[0013] The target protocol acquisition module is used to acquire the target protocol and target syntax corresponding to the target configuration information in response to a trigger command that creates identification information for the interface;

[0014] The first conversion module is used to convert the target configuration information into target protocol information based on the first mapping information; the first mapping information represents the mapping relationship between the fields of the preset protocol and the fields of the target protocol.

[0015] The second conversion module is used to convert the target configuration information into target syntax information based on the second mapping information; the second mapping information represents the mapping relationship between the fields of the preset syntax and the fields of the target syntax.

[0016] The interface generation module is used to generate an application programming interface corresponding to the target configuration information based on the information of the target protocol and the information of the target syntax.

[0017] On the other hand, an interface generation device is provided, the device including a processor and a memory, the memory storing at least one instruction or at least one program segment, the at least one instruction or the at least one program segment being loaded and executed by the processor to implement the interface generation method as described above.

[0018] On the other hand, a computer storage medium is provided that stores at least one instruction or at least one program, which is loaded and executed by a processor to implement the interface generation method described above.

[0019] On the other hand, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the aforementioned interface generation method.

[0020] The interface generation method and apparatus provided in this application have the following technical effects:

[0021] The target page displayed in this application includes a target area for inputting target configuration information and interface creation identification information. The target configuration information consists of fields of a preset protocol and a preset syntax. Then, in response to a trigger command on the interface creation identification information, the target protocol and target syntax corresponding to the target configuration information are obtained. This enables the acquisition of the preset target protocol and target syntax through the user's trigger command. Based on the first mapping information, the target configuration information is converted into target protocol information. Based on the second mapping information, the target configuration information is converted into target syntax information. Based on the target protocol information and the target syntax information, an application programming interface (API) corresponding to the target configuration information is generated. Thus, the target configuration information undergoes protocol conversion and syntax conversion to generate the corresponding API. Using the technical solution of this application, only configuration information needs to be input on the page to automatically generate an API interface based on the target protocol and target syntax. This application avoids repeatedly writing interface code, improves the efficiency of interface generation, and the generated interface has good QPS (queries per second) performance. Attached Figure Description

[0022] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a schematic diagram of an interface generation system provided in an embodiment of this application;

[0024] Figure 2 This is a flowchart illustrating an interface generation method provided in an embodiment of this application;

[0025] Figure 3 This is a flowchart illustrating a method for displaying an original page according to an embodiment of this application;

[0026] Figure 4 This is a flowchart illustrating a method for creating a target data table according to an embodiment of this application;

[0027] Figure 5 This is a flowchart illustrating a method for demonstrating the above-mentioned application programming interface, provided in an embodiment of this application.

[0028] Figure 6 This is a flowchart illustrating a method for processing information query requests provided in an embodiment of this application;

[0029] Figure 7This is a flowchart illustrating a method for constructing a target plugin based on a plugin protocol, as provided in an embodiment of this application.

[0030] Figure 8 This is a schematic diagram of the interface of a target page provided in an embodiment of this application;

[0031] Figure 9 This is a schematic diagram of an original page provided in an embodiment of this application;

[0032] Figure 10 This is a schematic diagram of the interface for the attribute information of a target data table provided in an embodiment of this application;

[0033] Figure 11 This is an architecture diagram of an interface generation system provided in an embodiment of this application;

[0034] Figure 12 This is a protocol design diagram provided in an embodiment of this application;

[0035] Figure 13 This is a schematic diagram showing the QPS of the application programming interface corresponding to different test cycles of the embodiments of this application and the prior art;

[0036] Figure 14 This is a schematic diagram of the structure of an interface generation device provided in an embodiment of this application;

[0037] Figure 15 This is a schematic diagram of another interface generation device provided in an embodiment of this application;

[0038] Figure 16 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation

[0039] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0040] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0041] Please see Figure 1 , Figure 1 This is a schematic diagram of an interface generation system provided in an embodiment of this application, such as... Figure 1 As shown, the interface generation system may include at least server 01 and client 02.

[0042] Specifically, in this embodiment, server 01 may include a standalone server, a distributed server, or a server cluster composed of multiple servers. It may also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Server 01 may include a network communication unit, a processor, and a memory, etc. Specifically, server 01 can be used to: convert the target configuration information into target protocol information based on first mapping information; the first mapping information represents the mapping relationship between fields of a preset protocol and fields of the target protocol; convert the target configuration information into target syntax information based on second mapping information; the second mapping information represents the mapping relationship between fields of a preset syntax and fields of the target syntax; generate an application programming interface (API) based on the target protocol information and the target syntax information; receive an information query request sent by client 02 and determine the target API corresponding to the request; and process the target request based on the target API.

[0043] Specifically, in this embodiment, the client 02 may include physical devices such as smartphones, desktop computers, tablets, laptops, digital assistants, smart wearable devices, and in-vehicle terminals, and may also include software running on the physical device, such as web pages provided to users by service providers, or applications provided to users by such service providers. Specifically, the client 02 can be used to send information query requests to the server.

[0044] The following describes one interface generation method of this application. Figure 2 This is a flowchart illustrating an interface generation method provided in an embodiment of this application. This specification provides the operational steps of the method described in the embodiments or flowcharts, but based on conventional or non-inventive labor, more or fewer operational steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many steps and does not represent the only possible execution order. In actual system or server product execution, the methods shown in the embodiments or drawings can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment).

[0045] Specific examples Figure 2 As shown, the method may include:

[0046] S201: Display the target page, which includes the target area and interface creation identification information; the target area is used to input target configuration information; the target configuration information consists of fields of preset protocol and preset syntax.

[0047] In this embodiment of the application, the target page can be a page in a visual configuration platform, such as... Figure 8 As shown, the target page can be the configuration page for creating a new table, and the configuration information can be one or more. This configuration information can include table base information (BaseInfo), column information (Columns), inter-table relationships (Relations), and custom operation names (Actions) for the interface. The target area is used to input this configuration information. Table base information can include the table name and table description. The table name can be used to input the names of one or more data tables, and the table description is used to input remarks about the data tables. Column information can be field information, and inter-table relationships can be relationships between multiple data tables, such as multiple orders corresponding to the same user. The interface creation identifier can be a "Save" button on the target page; when this button is triggered, the interface corresponding to the configuration information is generated. The target configuration information consists of one or more fields with preset protocols and preset syntax. The target configuration information is used to generate application programming interfaces; when the target configuration information is the configuration information for a data table, it can also be used to generate the data table.

[0048] In some embodiments, before displaying the target page, such as Figure 3 As shown, the above method also includes:

[0049] S2001: Display the original page, which includes database selection information;

[0050] In this embodiment, the original page can be the previous page corresponding to the target page, and the database selection information is used to determine the target database; the target page can be jumped to by triggering the database selection information of the original page.

[0051] In this embodiment of the application, the original page may further include an environment information configuration area, and the above method may further include:

[0052] In response to a trigger command for configuring environmental information in the area, the target environmental information is determined.

[0053] In this embodiment, the environment information configuration area can be used to determine the database's usage environment, such as a development environment, a testing environment, a pre-release environment, etc. This area can have pre-set options for users to choose from, or users can manually input information for configuration. In practical applications, multiple environments can be set for one database according to requirements, or one environment can be set for multiple databases.

[0054] In one specific embodiment, the original page can be Figure 9 The page shown can be used to determine the database corresponding to the configuration information; it includes an environment information configuration area, which includes environment information options such as development environment, testing environment, and pre-release environment for users to select.

[0055] S2003: In response to a database selection instruction triggered based on the above database selection information, the target database corresponding to the above database selection instruction is displayed; the display page of the target database includes data table creation identification information.

[0056] In this embodiment, the database selection information can be pre-configured database options or information input by the user to determine the database. For example, the user-input information may include database description information, type, port, character set, etc. The data table creation identifier information can be a button for adding a data table.

[0057] In this embodiment of the application, the target database can be quickly determined by the database selection information configured on the original page, thereby quickly creating the application programming interface.

[0058] In this embodiment of the application, the display page of the target database may also include target environment information, through which the usage environment corresponding to the target database can be known.

[0059] In some embodiments, the above method further includes:

[0060] Obtain the protocol and syntax corresponding to the target database mentioned above;

[0061] The protocol corresponding to the above target database is determined to be the preset protocol corresponding to the above target configuration information;

[0062] The syntax corresponding to the target database is determined to be the preset syntax corresponding to the target configuration information.

[0063] In this embodiment of the application, each database corresponds to a protocol and syntax, and the protocol and syntax corresponding to the configuration information in the database are the same as the protocol and syntax corresponding to the database.

[0064] In some embodiments, the above-mentioned display of the target page includes:

[0065] In response to the trigger command to create new identifier information for the above data table, the target page corresponding to the above target database is displayed.

[0066] In this embodiment of the application, the user can click on the above data table to create new identification information, thereby displaying the target page corresponding to the target database for determining the target configuration information.

[0067] In some embodiments, after displaying the target page, the method further includes:

[0068] In response to the trigger command for the aforementioned target area, the target configuration information is determined.

[0069] In this embodiment, the user can input target configuration information in the target area, or select target configuration information through preset information in the target area.

[0070] In some embodiments, after displaying the target page, the method further includes:

[0071] S2021: In response to the trigger command for the above target area, determine the target configuration information of multiple data tables and the association relationship between the above multiple data tables.

[0072] In this embodiment of the application, the user can determine the relationship between multiple data tables in the target area; for example, multiple data tables can be multiple orders corresponding to the same user, and the relationship between the multiple data tables is that they correspond to the same user identification information.

[0073] S2023: Based on the object-relational mapping database, the relationships between the above multiple data tables are converted into target statements corresponding to the structured query language.

[0074] In this application embodiment, Structured Query Language (SQL) is a database query and programming language used to access data and query, update and manage relational database systems.

[0075] S203: In response to the trigger command to create identification information for the above interface, obtain the target protocol and target syntax corresponding to the above target configuration information.

[0076] In this embodiment, the target protocol is constructed based on a domain-specific language (DSL), which is a computer language focused on a specific application domain. Users can click the aforementioned interface to create identification information triggering instructions, thereby obtaining the target protocol corresponding to the target configuration information. This target protocol is a preset protocol, such as the protocol applicable to the system corresponding to this method. The triggering instruction for creating identification information on the aforementioned interface can be a user click operation on the interface to create identification information.

[0077] S205: Based on the first mapping information, the above target configuration information is converted into target protocol information; the above first mapping information represents the mapping relationship between the fields of the preset protocol and the fields of the target protocol.

[0078] In this embodiment, metadata from different databases (e.g., the relational database management system MySQL) and various protocols can be read and converted into the format of the target protocol, thereby smoothing out differences. Metadata can include table relationships, field information, etc. For example, MySQL's built-in information schema database describes the metadata of all databases, including table relationships and field information; by reading this information, it can be converted into the target protocol.

[0079] In this embodiment, the target protocol can be GraphQL or RESTful. GraphQL is a specification for describing requested data; it is a protocol, not storage. GraphQL itself does not directly provide backend storage capabilities; it is not bound to any database or storage engine. It can utilize existing code and technologies for data source management. RESTful is a design style and development approach for web applications, based on HTTP, and can be defined using XML or JSON formats. RESTful is suitable for scenarios where mobile internet vendors use it as a business interface to implement the function of third-party OTT calls to mobile network resources, with action types including adding, modifying, and deleting the called resources.

[0080] S207: Based on the second mapping information, the above target configuration information is converted into target syntax information; the above second mapping information represents the mapping relationship between the fields of the preset syntax and the fields of the target syntax.

[0081] In this embodiment, the target syntax can be ORM, which is a technique that uses instance objects to perform operations on relational databases. ORM is an abbreviation for "Object / Relational Mapping," mapping the database to objects. Alternatively, the target syntax can be TYPE ORM, an open-source framework known for its stable performance, active community, and broad applicability.

[0082] In this application embodiment, there are multiple types of application programming interfaces. When generating interfaces, fields of different preset protocols are converted into fields of the target protocol, and fields of different preset syntaxes are converted into fields of the target syntax, thereby improving the accuracy of generating interface types.

[0083] S209: Based on the information of the target protocol and the information of the target syntax, generate the application programming interface corresponding to the target configuration information.

[0084] In this embodiment, the application programming interface (API) can be a Web Application Programming Interface (Web API) invoked over a network. Web APIs can extend browser functionality, greatly simplify complex functions, and provide simple syntax for complex code. The target configuration information can be configuration information for multiple APIs; that is, multiple Web APIs can be generated through a single target configuration, enabling the generation of multiple APIs at once, thereby improving the efficiency of API generation.

[0085] In this application embodiment, the application programming interface can be a cascading interface for multiple table associations. For complex scenarios, such as when it is necessary to perform CRUD operations on multiple data tables in the same database simultaneously in one interface, a cascading interface can be generated based on the multi-table association relationship to enable one interface to operate on the contents of multiple data tables at the same time.

[0086] In this embodiment of the application, the above-mentioned generation of the application programming interface corresponding to the target configuration information based on the target protocol information and the target syntax information includes:

[0087] Based on the information of the target protocol, the target syntax, and the target statement, the cascading interfaces corresponding to the multiple data tables are generated.

[0088] In this embodiment of the application, after generating the cascading interfaces corresponding to the multiple data tables based on the target protocol information, the target syntax information, and the target statement, the method further includes:

[0089] Receive terminal sending information operation requests for the above-mentioned multiple data tables;

[0090] The above cascading interface is used to process information operation requests from the aforementioned multiple data tables.

[0091] In this embodiment of the application, the generated cascading interface can be used to operate on multiple related data tables, thereby improving the efficiency of data table operations.

[0092] In this embodiment of the application, there can be multiple application programming interfaces (APIs), and multiple APIs can be generated based on a single target configuration information.

[0093] In some implementations, such as Figure 4 As shown, after generating the application programming interface corresponding to the target configuration information based on the target protocol information and the target syntax information, the above method further includes:

[0094] S2011: Based on the above application programming interface, create the target data table corresponding to the above target configuration information.

[0095] In this embodiment of the application, the configuration information can be the configuration information of the data table. An application programming interface can be generated based on the target configuration information, and a corresponding target data table can be created.

[0096] In some embodiments, creating the target data table corresponding to the target configuration information based on the application programming interface described above may include:

[0097] Based on the aforementioned application programming interfaces, multiple target data tables corresponding to the target configuration information are created.

[0098] In the embodiments of this application, an application programming interface can correspond to one or more target data tables, and a target data table can correspond to one or more application programming interfaces.

[0099] In some embodiments, such as Figure 5 As shown, after creating the target data table corresponding to the target configuration information based on the above application programming interface, the above method further includes:

[0100] S2013: Display the attribute information of the target data table, including the identification information of the application programming interface.

[0101] In this embodiment, the attribute information of the target data table may include database connection information, data table summary information, data table details (including data table ID, name, creation time, update time, etc.), various interfaces generated by the data table, such as Web APIs; wiki documentation corresponding to the interfaces; mock data for interface debugging, etc.; a wiki is an open hypertext system on the internet that allows for collaborative creation by multiple users. Different identification information can be set for different application programming interfaces.

[0102] In this application embodiment, the target data table shown may include one or more; such as Figure 10 As shown in the figure, the attribute information of multiple data tables is displayed, including data table ID, name, creation time, update time, etc., and may also include application programming interface identification information such as Web APIs and mocks.

[0103] S2015: In response to a trigger command that identifies the above application programming interface, display the above application programming interface.

[0104] In this embodiment, the application programming interface (API) can be displayed to the programmer user based on the programmer's trigger command, thus facilitating the programmer to call it according to actual needs. The trigger command for the identification information of the aforementioned API can be a user's click operation on the identification information of the API, which jumps to the corresponding API, such as... Figure 10 As shown, when a user triggers the "Wiki" identifier in the diagram, they can be redirected to the interface corresponding to the wiki document. The interface includes a list retrieval interface, an add interface, and an update interface. The method of this application can quickly generate various interfaces, including but not limited to Web APIs such as query, batch query, add, batch add, update, batch update, delete, and batch delete.

[0105] In this embodiment of the application programming interface, there are multiple interfaces, such as... Figure 6 As shown, after generating the application programming interface corresponding to the target configuration information based on the target protocol information and the target syntax information, the method further includes:

[0106] S20101: Receive multiple information query requests sent by multiple terminals;

[0107] In this embodiment of the application, the local server can be a backend server for multiple terminals, and the local server can receive information query requests sent by multiple terminals; the information query request can carry information for determining the interface, thereby facilitating the subsequent determination of the request processing interface.

[0108] S20103: When the content of multiple information query requests is the same, merge the multiple information query requests into one target request;

[0109] In this embodiment of the application, when the information query request is an order query request, the same content of multiple information query requests means querying the same order, and the merged target request can carry information such as the order number.

[0110] S20105: Determine the target application programming interface corresponding to the above target request;

[0111] In this embodiment of the application, the corresponding target application programming interface can be determined by the interface association information carried in the target request.

[0112] S20107: Process the above target request based on the above target application programming interface.

[0113] In this embodiment of the application, instead of merging the information query requests, each information query request can be processed separately based on the target application programming interface.

[0114] In this embodiment, merging requests for the same information can improve interface processing efficiency and save processing time. Compared to the unmerged request scheme, the merged scheme further improves the performance of the processing system and reduces the time spent processing requests. In real-world environments, high concurrency requests are common. For example, after a trending event, the search volume for certain keywords can increase significantly. This application stores requests that arrive within a certain timeframe. Once these requests are detected as identical, they are merged to improve performance, reduce request time, and enhance the overall performance of the system.

[0115] In this embodiment of the application, processing the target request based on the target application programming interface includes:

[0116] Based on the aforementioned target application programming interface, locate the target file corresponding to the target request.

[0117] In this embodiment of the application, the above method further includes:

[0118] Files are stored using a cache database.

[0119] Accordingly, based on the aforementioned target application programming interface, the target file corresponding to the target request is located, including:

[0120] Based on the aforementioned target application programming interface, the target file corresponding to the target request is searched in the cache database.

[0121] In this embodiment of the application, by constructing a cache database, querying the original database can be avoided, thereby improving the efficiency of querying target files and the processing efficiency of the interface.

[0122] In the embodiments of this application, such as Figure 7 As shown, before generating the application programming interface corresponding to the target configuration information based on the target protocol information and the target syntax information, the method further includes:

[0123] S2081: Build Plug-in Protocol;

[0124] In this embodiment of the application, the plugin protocol is a protocol with a preset format; the plugin protocol can be built based on the needs of third-party users.

[0125] S2083: Construct the target plugin by taking at least one functional parameter in accordance with the format of the above plugin protocol.

[0126] In this embodiment of the application, one or more functional parameters are constructed into a target plugin according to the format of the above-mentioned plugin protocol; the target plugin can implement different functions based on different functional parameters, such as file upload, custom gateway, etc.; based on the plugin protocol, more rich capabilities can be quickly extended to the application programming interface.

[0127] Based on the information of the target protocol and the target syntax, the above-mentioned application programming interface corresponding to the target configuration information is generated, including:

[0128] Based on the information of the target protocol, the target syntax, and the target plugins mentioned above, construct the application programming interface corresponding to the target configuration information.

[0129] In this embodiment, the application programming interface (API) can be extended with more functions through the target plugin; specifically, the built API can be equipped with corresponding functions according to the user's actual needs, thereby making the API applicable to more application scenarios.

[0130] In this application embodiment, the system architecture diagram corresponding to the method is as follows: Figure 11As shown, this includes: a plugin system, a protocol layer, and a kernel layer. The plugin system is a mechanism designed for various complex scenarios, in addition to the core capabilities of this system. By exposing some interfaces and hooks, third-party users can quickly extend more rich capabilities based on the plugin protocol, such as file upload and custom gateways. For example, plugins can include proxy plugins, upload plugins, environment variable plugins, and utility function plugins. The protocol layer is a unified protocol designed to bridge the differences between various backend protocols. External interfaces can interface with this system by adapting to this protocol. This system's protocol can be converted to the GraphQL protocol. GraphQL is an API query language, a specification for describing requested data. It is a protocol, not storage. GraphQL itself does not directly provide backend storage capabilities; it is not bound to any database or storage engine. It can utilize existing code and technology for data source management. The kernel layer comprises two parts: a custom flow and a database core. The core enables integration with various databases, generates Web APIs, and connects with third-party open-source ORM frameworks such as Object Relational Mapping (ORM). The flow enables automated processing of custom event flows conforming to Directed Acyclic Graph (DAG) relationships. Web APIs are application programming interfaces accessed via the network; they extend browser functionality, greatly simplify complex features, and provide simple syntax for complex code. ORM is a programming technique used to convert data between different types of systems within object-oriented programming languages.

[0131] like Figure 11 As shown, this system incorporates open-source frameworks such as ORM and GraphQL for the target syntax as plugins, and independently implements a parsing engine. This engine can automatically generate Web APIs for specific protocols based on parsing rules, and can convert them into ORM calls to manage data. For example... Figure 12As shown, the preset protocol corresponding to the database is transformed into a graph query language protocol pattern through a data mapping table at the protocol layer, and then transformed into a target syntax entity through a table pattern. Then, the graph query language protocol pattern and the target syntax entity are combined to obtain the graph query language application programming interface. This system supports various database types, including relational database management systems (MySQL), remote dictionary service protocols (Redis), distributed file storage databases (MongoDB), MariaDB (MariaDB is a fork of MySQL, mainly maintained by the open-source community, and licensed under the GPL for full compatibility with MySQL), Postgres (a powerful, open-source client / server relational database management system), CockroachDB, lightweight databases (SQLite), Microsoft relational database management system (Microsoft SQL Server), Oracle (a relational database management system), SAP Hana (an in-memory computing platform supporting enterprise on-premises and cloud deployment modes), and JavaScript-specific in-memory databases (sql.js). It also supports various backend service protocols, such as remote procedure calls (RPC) and message queues.

[0132] After various databases and different protocols are converted into protocols that conform to the specifications of this system, the system generates database entities and GraphQL protocols through mapping and transformation. Finally, specific protocols in Web APIs can be GraphQL, RESTful, etc.

[0133] In this embodiment, the query-per-second (QPS) performance of the application programming interface (API) generated by this application was tested. QPS is a common metric for measuring the search traffic received by an information retrieval system (such as a search engine or database) in one second. This term is more widely used in any request-response system. The API was tested with 100 concurrent requests, totaling 500 requests; the implementation was repeated 10 times; and the same requests were made to an API generated by Strapi, an open-source headless content management system. Strapi is an open-source headless content management system (Headless CMS). High-traffic systems must pay attention to their QPS to determine when to scale the system to handle more load. For interfaces without merged request processing, the query-per-second performance of this application is twice that of the prior art; for interfaces with merged request processing, such as... Figure 13 As shown, line a represents the QPS (queries per second) of the application programming interface (API) under different test counts in this application, line b represents the average QPS of the API under different test counts in this application, line c represents the QPS of the API under different test counts in the prior art Straapi, and line d represents the average QPS of the API under different test counts in the prior art Straapi. It can be seen that the query per second of this application is increased to approximately 10 times that of the prior art Straapi.

[0134] As can be seen from the technical solutions provided by the embodiments of this application above, the target page displayed in the embodiments of this application includes a target area for inputting target configuration information and interface creation identification information; the target configuration information consists of fields of preset protocol and preset syntax; then, in response to the trigger command of the interface creation identification information, the target protocol and target syntax corresponding to the target configuration information are obtained; thereby realizing the acquisition of preset target protocol and target syntax through the user's trigger command; based on the first mapping information, the target configuration information is converted into target protocol information; based on the second mapping information, the target configuration information is converted into target syntax information; based on the target protocol information and the target syntax information, the application programming interface corresponding to the target configuration information is generated; thereby performing protocol conversion and syntax conversion on the target configuration information to generate the corresponding application programming interface. Using the technical solution of this application, only configuration information needs to be input on the page to automatically generate API interfaces based on the target protocol and target syntax. This application avoids repeatedly writing interface code, improves the efficiency of interface generation, and the generated interface has good QPS (queries per second) performance.

[0135] This application also provides an interface generation device, such as... Figure 14 As shown, the device includes:

[0136] The target page display module 1410 is used to display a target page, which includes a target area and interface creation identification information; the target area is used to input target configuration information; the target configuration information consists of fields of preset protocol and preset syntax.

[0137] The target protocol acquisition module 1420 is used to acquire the target protocol and target syntax corresponding to the target configuration information in response to a trigger instruction that creates identification information for the interface;

[0138] The first conversion module 1430 is used to convert the target configuration information into target protocol information based on the first mapping information; the first mapping information represents the mapping relationship between the fields of the preset protocol and the fields of the target protocol.

[0139] The second conversion module 1440 is used to convert the target configuration information into target syntax information based on the second mapping information; the second mapping information represents the mapping relationship between the fields of the preset syntax and the fields of the target syntax.

[0140] The interface generation module 1450 is used to generate an application programming interface corresponding to the target configuration information based on the information of the target protocol and the information of the target syntax.

[0141] In some embodiments, the above-described apparatus may further include:

[0142] The original page display module is used to display the original page, which includes database selection information;

[0143] The target database display module is used to respond to a database selection instruction triggered based on the aforementioned database selection information and display the target database corresponding to the aforementioned database selection instruction; the display page of the aforementioned target database includes data table creation identification information.

[0144] In some embodiments, the target page display module includes:

[0145] The target page display unit is used to display the target page corresponding to the target database in response to the trigger command for creating identification information for the aforementioned data table.

[0146] In some embodiments, the above-described apparatus may further include:

[0147] The information acquisition module is used to acquire the protocol and syntax corresponding to the target database;

[0148] A preset protocol determination module is used to determine the protocol corresponding to the target database as the preset protocol corresponding to the target configuration information;

[0149] The preset syntax determination module is used to determine the syntax corresponding to the target database as the preset syntax corresponding to the target configuration information.

[0150] In some embodiments, such as Figure 15 As shown, the device may further include:

[0151] Module 1510, the plugin protocol building module, is used to build plugin protocols;

[0152] The target plugin building module 1520 is used to build a target plugin by taking at least one functional parameter in accordance with the format of the plugin protocol.

[0153] Accordingly, the interface generation module 1450 includes:

[0154] The interface construction unit 14510 is used to construct the application programming interface corresponding to the target configuration information based on the information of the target protocol, the information of the target syntax, and the target plugin.

[0155] In some embodiments, the apparatus may further include:

[0156] The target data table creation module is used to create the target data table corresponding to the target configuration information mentioned above, based on the aforementioned application programming interface.

[0157] In some embodiments, the apparatus may further include:

[0158] The attribute information display module is used to display the attribute information of the target data table, including the identification information of the application programming interface.

[0159] The interface display module is used to display the application programming interface in response to the trigger command of the identification information of the above application programming interface.

[0160] In some embodiments, the apparatus may further include:

[0161] The association determination module is used to determine the target configuration information of multiple data tables and the association relationships between the multiple data tables in response to a trigger command for the target region.

[0162] The target statement conversion module is used to convert the relationships between the multiple data tables into target statements corresponding to the structured query language based on the object relational mapping database.

[0163] In some embodiments, the interface generation module includes:

[0164] The cascading interface generation unit is used to generate cascading interfaces corresponding to the multiple data tables based on the information of the target protocol, the information of the target syntax, and the target statement.

[0165] In some embodiments, the apparatus may further include:

[0166] The information operation request receiving module is used to receive information operation requests for the multiple data tables sent by the terminal;

[0167] The information operation request processing module is used to process information operation requests from the multiple data tables based on the cascading interface.

[0168] In some embodiments, there are multiple application programming interfaces, and the apparatus may further include:

[0169] The request interface module is used to receive multiple information query requests sent by multiple terminals;

[0170] The request merging module is used to merge multiple information query requests into a single target request when the content of the requests is the same.

[0171] The interface determination module is used to determine the target application programming interface corresponding to the above target request;

[0172] The target request processing module is used to process the target request based on the target application programming interface.

[0173] The apparatus and method embodiments described herein are based on the same inventive concept.

[0174] This application provides an interface generation device, which includes a processor and a memory. The memory stores at least one instruction or at least one program segment, which is loaded and executed by the processor to implement the interface generation method provided in the above method embodiments.

[0175] Embodiments of this application also provide a computer storage medium, which can be disposed in a terminal to store at least one instruction or at least one program related to implementing an interface generation method in the method embodiments. The at least one instruction or at least one program is loaded and executed by the processor to implement the interface generation method provided in the above method embodiments.

[0176] This application also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the interface generation method provided in the above-described method embodiments.

[0177] Optionally, in this embodiment, the storage medium may be located at at least one of the multiple network servers in a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0178] The memory described in this application embodiment can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for the functions, etc.; the data storage area may store data created according to the use of the device, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory may also include a memory controller to provide the processor with access to the memory.

[0179] The interface generation method embodiments provided in this application can be executed on mobile terminals, computer terminals, servers, or similar computing devices. Taking running on a server as an example, Figure 16 This is a hardware structure block diagram of a server for an interface generation method provided in an embodiment of this application. For example... Figure 16As shown, the server 1600 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 1610 (CPUs 1610 may include, but are not limited to, microprocessors (MCUs) or programmable logic devices (FPGAs), a memory 1630 for storing data, and one or more storage media 1620 (e.g., one or more mass storage devices) for storing application programs 1623 or data 1622. The memory 1630 and storage media 1620 may be temporary or persistent storage. The program stored in the storage media 1620 may include one or more modules, each module may include a series of instruction operations on the server. Furthermore, the CPU 1610 may be configured to communicate with the storage media 1620 and execute the series of instruction operations stored in the storage media 1620 on the server 1600. Server 1600 may also include one or more power supplies 1660, one or more wired or wireless network interfaces 1650, one or more input / output interfaces 1640, and / or one or more operating systems 1621, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0180] The input / output interface 1640 can be used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of server 1600. In one example, input / output interface 1640 includes a network interface controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In one example, input / output interface 1640 can be a radio frequency (RF) module for wireless communication with the Internet.

[0181] Those skilled in the art will understand that Figure 16 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, server 1600 may also include... Figure 16 The more or fewer components shown, or having the same Figure 16 The different configurations shown.

[0182] As can be seen from the embodiments of the interface generation method, apparatus, or storage medium provided in this application, the target page displayed in this application includes a target area for inputting target configuration information and interface creation identification information; the target configuration information consists of fields of a preset protocol and a preset syntax; then, in response to a trigger command on the interface creation identification information, the target protocol and target syntax corresponding to the target configuration information are obtained; thereby realizing the acquisition of the preset target protocol and target syntax through the user's trigger command; based on the first mapping information, the target configuration information is converted into target protocol information; based on the second mapping information, the target configuration information is converted into target syntax information; based on the target protocol information and the target syntax information, the application programming interface corresponding to the target configuration information is generated; thereby performing protocol conversion and syntax conversion on the target configuration information to generate the corresponding application programming interface. Using the technical solution of this application, only configuration information needs to be input on the page to automatically generate an API interface based on the target protocol and target syntax. This application avoids repeatedly writing interface code, improves the efficiency of interface generation, and the generated interface has good QPS (queries per second) performance.

[0183] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0184] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, devices, and storage media are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0185] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer storage medium, such as a read-only memory, a disk, or an optical disk.

[0186] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. An interface generation method, characterized in that, The method includes: The target page is displayed, which includes a target area and interface creation identification information; the target area is used to input target configuration information; the target configuration information consists of fields of preset protocol and preset syntax; the preset protocol is the protocol corresponding to the target database, and the preset syntax is the syntax corresponding to the target database; the target database is determined by database selection information, which is the information in the previous page corresponding to the target page; In response to a trigger command to create identification information for the interface, the target protocol and target syntax corresponding to the target configuration information are obtained; Based on the first mapping information, the target configuration information is converted into target protocol information; the first mapping information represents the mapping relationship between the fields of the preset protocol and the fields of the target protocol. Based on the second mapping information, the target configuration information is converted into target syntax information; the second mapping information represents the mapping relationship between the fields of the preset syntax and the fields of the target syntax. Based on the information of the target protocol and the information of the target syntax, an application programming interface corresponding to the target configuration information is generated.

2. The method according to claim 1, characterized in that, Before displaying the target page, the method further includes: Display the original page, which includes database selection information; In response to a database selection instruction triggered based on the database selection information, the target database corresponding to the database selection instruction is displayed; the display page of the target database includes data table creation identification information; Accordingly, the target page to be displayed includes: In response to a trigger command to create new identifier information for the data table, the target page corresponding to the target database is displayed.

3. The method according to claim 2, characterized in that, The method further includes: Obtain the protocol and syntax corresponding to the target database; The protocol corresponding to the target database is determined to be the preset protocol corresponding to the target configuration information; The syntax corresponding to the target database is determined to be the preset syntax corresponding to the target configuration information.

4. The method according to claim 1, characterized in that, Before generating the application programming interface corresponding to the target configuration information based on the target protocol information and the target syntax information, the method further includes: Build a plugin protocol; Construct the target plugin by specifying at least one functional parameter according to the format of the plugin protocol; The step of generating the application programming interface corresponding to the target configuration information based on the target protocol information and the target syntax information includes: Based on the information of the target protocol, the information of the target syntax, and the target plugin, construct the application programming interface corresponding to the target configuration information.

5. The method according to any one of claims 1-4, characterized in that, After generating the application programming interface corresponding to the target configuration information based on the target protocol information and the target syntax information, the method further includes: Based on the application programming interface, a target data table corresponding to the target configuration information is created.

6. The method according to claim 5, characterized in that, After creating the target data table corresponding to the target configuration information based on the application programming interface, the method further includes: Display the attribute information of the target data table, including the identification information of the application programming interface; In response to a trigger command that identifies the application programming interface, the application programming interface is displayed.

7. The method according to any one of claims 1-4, characterized in that, After displaying the target page, the method further includes: In response to a trigger command for the target region, target configuration information for multiple data tables and the relationships between the multiple data tables are determined. Based on the object-relational mapping database, the relationships between the multiple data tables are converted into target statements corresponding to the structured query language; Accordingly, generating the application programming interface corresponding to the target configuration information based on the target protocol information and the target syntax information includes: Based on the information of the target protocol, the information of the target syntax, and the target statement, cascading interfaces corresponding to the multiple data tables are generated.

8. The method according to claim 7, characterized in that, After generating the cascading interfaces corresponding to the multiple data tables based on the information of the target protocol, the information of the target syntax, and the target statement, the method further includes: Receive the information operation requests of the multiple data tables sent by the receiving terminal; The cascading interface is used to process information operation requests from the multiple data tables.

9. The method according to any one of claims 1-4, characterized in that, The application programming interfaces (APIs) are multiple. After generating the API corresponding to the target configuration information based on the target protocol information and the target syntax information, the method further includes: Receive multiple information query requests from multiple terminals; When the content of the multiple information query requests is the same, the multiple information query requests are merged into a single target request; Determine the target application programming interface corresponding to the target request; The target request is processed based on the target application programming interface.

10. An interface generation apparatus, characterized in that, The device includes: The target page display module is used to display a target page, which includes a target area and interface creation identification information. The target area is used to input target configuration information. The target configuration information consists of fields of a preset protocol and a preset syntax. The preset protocol is the protocol corresponding to the target database, and the preset syntax is the syntax corresponding to the target database. The target database is determined by database selection information, which is the information in the previous page corresponding to the target page. The target protocol acquisition module is used to acquire the target protocol and target syntax corresponding to the target configuration information in response to a trigger command that creates identification information for the interface; The first conversion module is used to convert the target configuration information into target protocol information based on the first mapping information; the first mapping information represents the mapping relationship between the fields of the preset protocol and the fields of the target protocol. The second conversion module is used to convert the target configuration information into target syntax information based on the second mapping information; the second mapping information represents the mapping relationship between the fields of the preset syntax and the fields of the target syntax. The interface generation module is used to generate an application programming interface corresponding to the target configuration information based on the information of the target protocol and the information of the target syntax.

11. The apparatus according to claim 10, characterized in that, The device further includes: The original page display module is used to display the original page, which includes database selection information; The target database display module is used to display the target database corresponding to the database selection instruction in response to a database selection instruction triggered based on the database selection information; the display page of the target database includes data table creation identification information; The target page display module includes: The target page display unit is used to display the target page corresponding to the target database in response to a trigger command that creates identification information for the data table.

12. The apparatus according to claim 11, characterized in that, The device further includes: The information acquisition module is used to acquire the protocol and syntax corresponding to the target database; A preset protocol determination module is used to determine the protocol corresponding to the target database as the preset protocol corresponding to the target configuration information; The preset syntax determination module is used to determine the syntax corresponding to the target database as the preset syntax corresponding to the target configuration information.

13. The apparatus according to claim 10, characterized in that, The device further includes: The plugin protocol building module is used to build plugin protocols; The target plugin building module is used to build a target plugin by taking at least one functional parameter according to the format of the plugin protocol; The interface generation module includes an interface construction unit, used to construct an application programming interface corresponding to the target configuration information based on the information of the target protocol, the information of the target syntax, and the target plugin.

14. The apparatus according to any one of claims 10-13, characterized in that, The device further includes: The target data table creation module is used to create a target data table corresponding to the target configuration information based on the application programming interface.

15. The apparatus according to claim 14, characterized in that, The device further includes: The attribute information display module is used to display the attribute information of the target data table, including the identification information of the application programming interface; The interface display module is used to display the application programming interface in response to a trigger command that identifies the identification information of the application programming interface.

16. The apparatus according to any one of claims 10-13, characterized in that, The device further includes: The association relationship determination module is used to determine the target configuration information of multiple data tables and the association relationship between the multiple data tables in response to the trigger command of the target area; The target statement conversion module is used to convert the relationships between the multiple data tables into target statements corresponding to the structured query language based on the object relational mapping database. The interface generation module includes a cascading interface generation unit, used to generate cascading interfaces corresponding to the multiple data tables based on the information of the target protocol, the information of the target syntax, and the target statement.

17. The apparatus according to claim 16, characterized in that, The device further includes: The information operation request receiving module is used to receive information operation requests for the multiple data tables sent by the terminal; The information operation request processing module is used to process information operation requests from the multiple data tables based on the cascading interface.

18. The apparatus according to any one of claims 10-13, characterized in that, The application programming interface is multiple, and the device further includes: The request interface module is used to receive multiple information query requests sent by multiple terminals; The request merging module is used to merge the multiple information query requests into a single target request when the request content of the multiple information query requests is the same. The interface determination module is used to determine the target application programming interface corresponding to the target request; The target request processing module is used to process the target request based on the target application programming interface.

19. An interface generation device, characterized in that, The device includes a processor and a memory, the memory storing at least one instruction, which is loaded and executed by the processor to implement the interface generation method as described in any one of claims 1-9.

20. A computer storage medium, characterized in that, The computer storage medium stores at least one instruction, which is loaded and executed by a processor to implement the interface generation method as described in any one of claims 1-9.

21. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium, which are executed by a processor to implement the interface generation method as described in any one of claims 1-9.