A method, device and medium for invoking a low-code data interface
By constructing database tables and utilizing authorized signature verification, low-code interface generation and invocation were achieved, solving the problems of long interface development cycles and complex maintenance, and enabling flexible interface permission management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-15
- Publication Date
- 2026-03-03
AI Technical Summary
In existing technologies, the development cycle of interfaces between production platforms or systems is long and the maintenance is complex, making it difficult to effectively apply low-code development technologies.
By confirming the target entity and its parameters, a database table is constructed and an interface is defined to generate the target interface. The interface call is verified using authorized signature information, supporting low-code interface generation and calling.
It enables low-code interface development, reduces the interface development cycle and maintenance complexity, and supports flexible interface call permission management.
Smart Images

Figure CN115168469B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a method, device, and medium for invoking a low-code data interface. Background Technology
[0002] An interface is an abstraction that an entity provides to the outside world. It is used to separate internal operations from external communication methods, so that it can be modified internally without affecting the way other entities interact with it. It is widely used in various types of software.
[0003] In existing technologies, when generating different interfaces between platforms or systems, it is necessary to frequently customize the coding for different interfaces according to customer or platform requirements, resulting in a long interface development cycle and high interface maintenance complexity.
[0004] Low-code development is an application technology that allows for the rapid generation of applications with little or no coding. It enables users to develop their own applications using easy-to-understand visual tools, significantly reducing the complexity of writing code.
[0005] Therefore, how to apply low-code development techniques to the generation and invocation of interfaces has become an urgent problem to be solved. Summary of the Invention
[0006] To address the aforementioned issues, this application proposes a low-code data interface invocation method, device, and medium, wherein the method includes:
[0007] Identify the target entity and its corresponding entity parameters; the entity parameters include at least one of entity name, field name, field type, field position, required field, index, and foreign key; construct a database table corresponding to the target entity based on the entity parameters; define the interface name, interface parameter set, and interface parameter format of the target interface based on the database table; generate the target interface corresponding to the target entity based on the interface name, interface parameter set, interface parameter format, and entity parameters; publish the target interface information and generate the authorization key for the target interface; confirm receipt of a target interface call request from a caller, and obtain the authorization signature information contained in the target interface call request; perform authorization verification on the caller based on the authorization signature information and the authorization key; if the verification is successful, allow the caller to call the target interface.
[0008] In one example, after allowing the caller to invoke the target interface, the method further includes: obtaining the calling parameters input by the caller and determining the interface parameter format corresponding to the calling parameters; determining a preset validation rule for the interface parameter format, and validating the calling parameters according to the validation rule; the validation rule includes at least one of interface parameter type and required parameters; the interface parameter type includes at least one of character type, numeric type, and time type; the required parameters are used to determine whether there is a corresponding calling parameter.
[0009] In one example, the method further includes: determining the caller's personalized customization needs; generating extended interfaces other than the general interfaces based on the personalized customization needs; the general interface types include: query basic interface, insert basic interface, update basic interface, and delete basic interface; the extended interface types include: data fuzzy search interface, data batch import interface, and data batch download interface.
[0010] In one example, defining the interface name of the target interface based on the database table specifically includes: obtaining the table name of the database table, which is generated from the entity name; determining the interface type of the target interface; generating the interface name by concatenating the table name and the interface type; and generating the interface parameter set based on the field list of the target entity.
[0011] In one example, after authorizing and verifying the caller based on the authorized signature information and the authorized key, the method further includes: determining the call interface name based on the call request and determining the corresponding call interface; obtaining the interface response status of the call interface and transmitting the interface response status to the caller; the interface response status is used to indicate whether the call interface was successfully called; if the call fails, obtaining the reason for the call failure of the call interface and transmitting the reason for the call failure to the caller.
[0012] In one example, constructing the database table corresponding to the target entity based on the entity parameters specifically includes: determining the entity parameters corresponding to the target entity; generating the database table creation statement corresponding to the target entity in the form of configuration parameters through dynamic SQL mapping; and generating the database table based on the table creation statement.
[0013] In one example, after publishing the target interface information and generating the authorization key for the target interface, the method further includes: determining the authorized caller of the target interface; and sending the shared encryption algorithm and the authorization key to the authorized caller so that the authorized caller can generate the authorization signature information based on the shared encryption algorithm and the authorization key.
[0014] In one example, the method further includes: generating a verification rule template based on the interface parameter name and the interface parameter format; the verification rule template includes at least one of an ID card template, a mobile phone number template, an email template, and an IP address template; when verifying the call parameter, determining a target rule template from multiple pre-stored verification rule templates based on the call parameter name, and verifying the call parameter.
[0015] This application also provides a low-code data interface invocation device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform: confirming a target entity and entity parameters corresponding to the target entity; the entity parameters including at least one of entity name, field name, field type, field position, whether required, index, and foreign key; constructing a database table corresponding to the target entity based on the entity parameters; defining an interface name, interface parameter set, and interface parameter format of the target interface based on the database table; generating the target interface corresponding to the target entity based on the interface name, the interface parameter set, the interface parameter format, and the entity parameters; publishing the target interface information and generating an authorization key for the target interface; determining that a target interface invocation request has been received from a caller, and obtaining authorization signature information contained in the target interface invocation request; and performing authorization verification on the caller based on the authorization signature information and the authorization key, and if the verification is successful, allowing the caller to invoke the target interface.
[0016] This application also provides a non-volatile computer storage medium storing computer-executable instructions, the computer-executable instructions being configured to: identify a target entity and entity parameters corresponding to the target entity; the entity parameters include at least one of entity name, field name, field type, field position, whether it is required, index, and foreign key; construct a database table corresponding to the target entity based on the entity parameters; define an interface name, interface parameter set, and interface parameter format of a target interface based on the database table; generate the target interface corresponding to the target entity based on the interface name, the interface parameter set, the interface parameter format, and the entity parameters; publish the target interface information and generate an authorization key for the target interface; determine that a target interface call request has been received from a caller, and obtain the authorization signature information contained in the target interface call request; perform authorization verification on the caller based on the authorization signature information and the authorization key, and if the verification is successful, allow the caller to call the target interface.
[0017] The method proposed in this application generates data tables based on data entity configuration parameters. After each data entity generates a data table, it undergoes logical mapping to generate a general data interface. Data interface authorization is granted based on platform users' usage requirements, and platform users invoke the interface using authorized signature information. This allows for flexible configuration and authorization of the general interface for data entities, effectively restricting interface call permissions. Attached Figure Description
[0018] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0019] Figure 1 This is a schematic diagram of a low-code data interface invocation method in an embodiment of this application;
[0020] Figure 2 This is a schematic diagram of a device structure for calling a low-code data interface according to an embodiment of this application. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0022] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0023] Figure 1 This diagram illustrates a low-code data interface invocation method provided in one or more embodiments of this specification. The process can be executed by a computing device in the relevant field, and certain input parameters or intermediate results within the process can be manually adjusted to help improve accuracy.
[0024] The analysis method involved in the embodiments of this application can be implemented by a terminal device or a server, and this application does not impose any special limitations on it. For ease of understanding and description, the following embodiments are all described in detail using a server as an example.
[0025] It should be noted that the server can be a single device or a system composed of multiple devices, i.e., a distributed server. This application does not make any specific limitations on this.
[0026] like Figure 1As shown, this application embodiment provides a low-code data interface invocation method, including:
[0027] S101: Confirm the target entity and the entity parameters corresponding to the target entity; the entity parameters include at least one of entity name, field name, field type, field position, whether it is required, index, and foreign key.
[0028] First, you need to configure the data entities, which means identifying the target entities and obtaining the corresponding entity parameters. Here, an entity refers to an objectively existing and distinguishable object or thing in the real world. In database terms, an entity often refers to a collection of things of a certain kind. It can be a concrete person or thing, or an abstract concept or relationship. An entity has many characteristics, each called a parameter. Each parameter has a value range, and its type can be integer, real number, or string. For example, a student has attributes such as student ID, name, age, and gender, with corresponding value ranges of character, string, integer, and string type. Entity parameters include at least one of the following: entity name, field name, field type, field position, required field, index, and foreign key.
[0029] S102: Construct the database table corresponding to the target entity based on the entity parameters.
[0030] After configuring the data entities, the corresponding database tables need to be generated based on the entity parameters. A database table is a collection of two-dimensional arrays used to represent and store the relationships between data objects; it consists of vertical columns and horizontal rows.
[0031] In one embodiment, when constructing the database table corresponding to the target entity based on entity parameters, it is first necessary to determine the entity parameters corresponding to the target entity, that is, which entity parameters the target entity contains. The database entity table is directly mapped to the configuration parameters. Specifically, the database table creation statement is generated through dynamic SQL mapping using parameters such as entity table name, field name, field length, data type, whether it is nullable, whether it is auto-increment, whether it is a primary key, index, and foreign key. The corresponding entity table is then generated through the table creation statement.
[0032] S103: Define the target interface's interface name, interface parameter set, and interface parameter format according to the database table.
[0033] After generating the database table corresponding to the target entity, you need to define the interface information such as the interface name, interface parameter set, and interface parameter format of the target interface based on the database table.
[0034] In one embodiment, when defining the interface name, the first step is to obtain the database table name, which can be generated from the entity name. Next, the interface type of the target interface is determined. The interface type is categorized based on its function, such as a data addition interface or a data deletion interface. Then, the interface name is generated by concatenating the table name and the interface type. For example, the table name `tableName` and the predefined interface type `type` are concatenated to generate the interface name `tableName_type`. The interface parameter set is generated based on the target entity's field list, and the interface parameter format corresponds to the field format.
[0035] S104: Generate the target interface corresponding to the target entity based on the interface name, the interface parameter set, the interface parameter format, and the entity parameters.
[0036] S105: Publish the target interface information and generate the authorization key for the target interface.
[0037] After generating the target interface corresponding to the target entity, the interface can be published, which means uploading the data interface. Furthermore, since current low-code data interfaces generally do not effectively support calls from external applications, an authorization key corresponding to the target interface can be generated after the interface is published.
[0038] S106: Determine that a target interface call request has been received from the caller, and obtain the authorization signature information contained in the target interface call request.
[0039] When a caller invokes the target interface, it will receive a call request from the target interface of the caller. This call request contains authorization signature information.
[0040] In one embodiment, after publishing the target interface and generating the authorization key for the target interface, the server determines the authorized callers of the target interface, i.e., which callers can call the target interface. Then, it sends the shared encryption algorithm and the authorization key to the authorized callers so that the authorized callers can generate authorized signature information based on the shared encryption algorithm and the authorization key. In other words, the authorized callers can use the signature algorithm to generate authorized signature information for interface calls.
[0041] S107: Based on the authorized signature information and the authorized key, the caller is authorized and verified. If the verification is successful, the caller is allowed to call the target interface.
[0042] The server verifies the authorization of the caller based on the obtained authorization signature information and the generated authorization key, i.e., digital signature verification. If the verification is successful, the caller is allowed to call the target interface.
[0043] In one embodiment, after allowing the caller to invoke the target interface, the method further includes: obtaining the call parameters input by the caller and determining the interface parameter format corresponding to the call parameters. Then, a preset validation rule for the interface parameter format is determined, and the call parameters are validated according to the validation rule. The validation rule includes at least one of interface parameter type and required parameters, where required parameters refer to whether a parameter is mandatory, used to determine whether a corresponding call parameter exists. The interface parameter type includes at least one of character, numeric, and time types.
[0044] Furthermore, the verification rule template is generated based on the interface parameter name and format. The verification rule template includes at least one of the following: ID card template, mobile phone number template, email template, and IP address template. When validating the call parameters, the server determines the target rule template from among several pre-stored verification rule templates based on the call parameter name, and then verifies the call parameters according to the target rule template. For example, if a call parameter named "email template" is found, the preset email verification template is determined, and the call parameter value is checked to see if it conforms to the email format. If it does, the verification passes.
[0045] The aforementioned verification rule template can be pre-stored in the computer device's storage. When verification of the calling parameters is required, the computer device can select the verification rule template from the storage device. Alternatively, the computer device can also obtain the verification rule template from other external devices. For example, the verification rule template can be stored in the cloud, and when verification of the calling parameters is required, the computer device can obtain the verification rule template from the cloud. This embodiment does not limit the method of obtaining the verification rule template.
[0046] In one embodiment, the low-code data interface generation method provided in this application can also be customized according to different user needs. In this case, it is first necessary to determine the caller's personalized customization needs, and then generate extended interfaces in addition to the general interfaces based on these personalized customization needs. The general interface types include: query basic interface, insert basic interface, update basic interface, and delete basic interface; the extended interface types include: data fuzzy search interface, data batch import interface, and data batch download interface.
[0047] In one embodiment, after authorizing and verifying the caller based on the authorization signature information and authorization key, it is also necessary to determine the call interface name and the corresponding call interface based on the call request, then obtain the interface response status of the call interface, and transmit the interface response status to the caller. The interface response status here is used to indicate whether the call interface was successfully invoked. If the call fails, the reason for the failure is obtained and transmitted to the caller.
[0048] The technical solutions provided in the embodiments of this specification generate data tables based on data entity configuration parameters. After each data entity generates a data table, a general data interface is generated through logical mapping. Data interface authorization is performed according to the platform user's requirements for using the data interface, and the platform user makes interface calls through authorization signature information. Flexible configuration and authorization can be performed for the general interface of the data entity, effectively restricting interface call permissions.
[0049] like Figure 2 As shown in the illustration, this application also provides a device for calling a low-code data interface, including:
[0050] At least one processor; and,
[0051] A memory communicatively connected to the at least one processor; wherein,
[0052] The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to:
[0053] Identify the target entity and the entity parameters corresponding to the target entity; the entity parameters include at least one of entity name, field name, field type, field position, whether it is required, index, and foreign key;
[0054] Based on the entity parameters, construct the database table corresponding to the target entity;
[0055] Define the target interface's interface name, interface parameter set, and interface parameter format based on the database table;
[0056] Based on the interface name, the interface parameter set, the interface parameter format, and the entity parameters, generate the target interface corresponding to the target entity;
[0057] Publish the target interface information and generate the authorization key for the target interface;
[0058] Determine that a target interface call request has been received from the caller, and obtain the authorization signature information contained in the target interface call request;
[0059] Based on the authorized signature information and the authorized key, the caller is authorized and verified. If the verification is successful, the caller is allowed to call the target interface.
[0060] This application embodiment also provides a non-volatile computer storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured as follows:
[0061] Identify the target entity and the entity parameters corresponding to the target entity; the entity parameters include at least one of entity name, field name, field type, field position, whether it is required, index, and foreign key;
[0062] Based on the entity parameters, construct the database table corresponding to the target entity;
[0063] Define the target interface's interface name, interface parameter set, and interface parameter format based on the database table;
[0064] Based on the interface name, the interface parameter set, the interface parameter format, and the entity parameters, generate the target interface corresponding to the target entity;
[0065] Publish the target interface information and generate the authorization key for the target interface;
[0066] Determine that a target interface call request has been received from the caller, and obtain the authorization signature information contained in the target interface call request;
[0067] Based on the authorized signature information and the authorized key, the caller is authorized and verified. If the verification is successful, the caller is allowed to call the target interface.
[0068] The various embodiments in this application 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 device and medium embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the description of the method embodiments.
[0069] The devices and media provided in this application are one-to-one with the methods. Therefore, the devices and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0070] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0071] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0072] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0073] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0074] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0075] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0076] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media 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 technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0077] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0078] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A low-code data interface invocation method, characterized in that, The method comprises the following steps: Confirming a target entity and an entity parameter corresponding to the target entity; the entity parameter comprises at least one of an entity name, a field name, a field type, a field position, whether to be filled in, an index, and a foreign key; According to the entity parameter, a database table corresponding to the target entity is constructed; According to the database table, an interface name, an interface parameter set, and an interface parameter format of a target interface are defined; According to the interface name, the interface parameter set, the interface parameter format, and the entity parameter, the target interface corresponding to the target entity is generated; The target interface information is published, and an authorization key of the target interface is generated; It is determined that a target interface calling request from a calling party is received, and authorization signature information contained in the target interface calling request is obtained; According to the authorization signature information and the authorization key, the calling party is authorized and verified, and if the verification is passed, the calling party is allowed to call the target interface; According to the database table, the interface name of the target interface is defined, which specifically comprises: The table name of the database table is obtained, and the table name is generated from the entity name; The interface type of the target interface is determined; According to the table name and the interface type, the interface name is spliced and generated, and the interface parameter set is generated according to the field list of the target entity; After the calling party is allowed to call the target interface, the method further comprises: The calling parameter input by the calling party is obtained, and the interface parameter format corresponding to the calling parameter is determined; A preset interface parameter format verification rule is determined, and the calling parameter is verified according to the verification rule; The verification rule at least comprises at least one of an interface parameter type and a mandatory parameter; The interface parameter type comprises at least one of a character type, a numerical value type, and a time type; The mandatory parameter is used to judge whether the corresponding calling parameter exists; According to the entity parameter, the database table corresponding to the target entity is constructed, which specifically comprises: The entity parameter corresponding to the target entity is determined; In the form of a configuration parameter, a database table building statement corresponding to the target entity is generated through dynamic SQL mapping; The database table is generated according to the table building statement; After the target interface information is published, and the authorization key of the target interface is generated, the method further comprises: The authorized calling party of the target interface is determined; The shared encryption algorithm and the authorization key are sent to the authorized calling party, so that the authorized calling party can generate the authorization signature information according to the shared encryption algorithm and the authorization key; The method further comprises: According to the interface parameter name and the interface parameter format, a verification rule template is generated; The verification rule template comprises at least one of an ID card template, a mobile phone number template, an email template, and an IP address template; When the calling parameter is verified, a target rule template is determined in a plurality of pre-stored verification rule templates according to the calling parameter name, and the calling parameter is verified.
2. The method of claim 1, wherein, The method further comprises: The individual customization demand of the calling party is determined; Generating an extended interface other than the general interface according to the personalized customization requirement; The general interface type comprises: a query basic interface, an insertion basic interface, an update basic interface, and a deletion basic interface; The extended interface type comprises: a data fuzzy retrieval interface, a data batch import interface, and a data batch download interface.
3. The method of claim 1, wherein, After the authorization verification of the calling party according to the authorization signature information and the authorization key, the method further comprises: Determining a calling interface name according to the calling request, and determining a corresponding calling interface; Obtaining an interface response state of the calling interface, and transmitting the interface response state to the calling party; the interface response state is used to show whether the calling interface is successfully called; If the calling fails, obtaining a calling failure reason of the calling interface, and transmitting the calling failure reason to the calling party.
4. A calling device of a low-coded data interface, characterized in that Comprise: At least one processor; And a memory connected with the at least one processor in communication; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the steps of the method according to any one of claims 1-3.
5. A non-volatile computer storage medium storing computer-executable instructions, characterized in that, The computer executable instructions are configured to execute the steps of the method according to any one of claims 1-3.
Citation Information
Patent Citations
Interface parameter verification method, device and equipment and storage medium
CN112306879A
Interface data processing method and device, equipment and storage medium
CN113642025A