Custom configuration methods for API interfaces, terminal devices, and storage media
By rendering the graphical user interface on a low-code platform, detecting and configuring API metadata, business flow chart data and data mapping rule sets, and generating a custom API interface, the problem of unintuitive and difficult configuration interface of the existing low-code platform is solved, and flexible business logic configuration and complex scenario response are achieved.
Patent Information
- Application Number
- CN202411842525.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-04
AI Technical Summary
The existing low-code platform is limited to predefined options, and the configuration interface is not intuitive enough, which increases the difficulty of API interface configuration and cannot meet complex business needs.
By rendering the graphical user interface, API metadata, business flow chart data and data mapping rulesets are detected, corresponding interface configuration operations are performed, custom API interfaces are generated, and mapped with preset databases.
It significantly reduces the difficulty of API interface configuration, and users can flexibly deal with complex and changeable business scenarios through intuitive and visual methods, and generate custom API interfaces that conform to specific business logic.
Smart Images

Figure CN119759336A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of data processing, and in particular relates to a user-defined configuration method of an API interface, a terminal device and a storage medium. Background Art
[0002] With the development of information technology, low-code platforms are favored because they simplify the development process and support non-professional developers. Interface customization is one of its key features.
[0003] Existing low-code platforms are limited to predefined options, and the configuration interface is not intuitive enough, which increases the difficulty of configuration. A new technical means is needed to solve the above technical problems. Summary of the invention
[0004] In view of this, the embodiments of the present invention provide a custom configuration method of an API interface, a terminal device and a storage medium, which can solve the problem that the low-code platform in the related art is limited to predefined options and cannot meet complex business needs. In addition, the configuration interface is not intuitive enough, which increases the difficulty of configuration.
[0005] A first aspect of the present invention provides a method for customizing an API interface, comprising:
[0006] Rendering the graphical user interface;
[0007] Based on the graphical user interface, when API metadata is detected, the interface configuration operation is performed according to the API metadata to obtain the basic API interface;
[0008] Based on the graphical user interface, when the dragging of the selected business process diagram data is detected, the basic API interface is updated according to the business process diagram data to obtain the custom API interface;
[0009] Based on the graphical user interface, when a data mapping rule set is detected, a mapping operation is performed between the custom API interface and the preset database according to the data mapping rule set to obtain a target API interface.
[0010] Optionally, in a first implementation of the first aspect of the present invention, based on the graphical user interface, when a data mapping rule set is detected, after the step of performing a mapping operation on the custom API interface and the preset database according to the data mapping rule set to obtain the target API interface, the method further includes:
[0011] Based on the graphical user interface, when a test instruction is detected, an API interface functional test is performed on the target API interface.
[0012] Optionally, in a second implementation of the first aspect of the present invention, based on the graphical user interface, when a test instruction is detected, the step of performing an API interface function test on the target API interface includes:
[0013] Provide API interface test configuration options based on graphical user interface;
[0014] Based on the API interface test configuration option settings, when the test parameters and expected results are detected, the API interface functional test is performed on the target API interface according to the test parameters and expected results.
[0015] Optionally, in a third implementation of the first aspect of the present invention, based on the graphical user interface, when a data mapping rule set is detected, after the step of performing a mapping operation on the custom API interface and the preset database according to the data mapping rule set to obtain the target API interface, the method further includes:
[0016] Based on the graphical user interface, when a permission adjustment instruction is detected, a permission adjustment operation is performed on the target API interface, and the permission adjustment operation includes at least one of setting access permission level, restricting access IP address, defining access time period, and setting access times.
[0017] Optionally, in a fourth implementation of the first aspect of the present invention, based on the graphical user interface, when the business process diagram data specified by the drag operation is detected, the basic API interface is updated according to the business process diagram data to obtain the custom API interface, the step includes:
[0018] Parse the business process diagram data to obtain element sets and element relationships;
[0019] Generate basic API interface based on element collection and element relationship.
[0020] Optionally, in a fifth implementation of the first aspect of the present invention, based on the graphical user interface, when a data mapping rule set is detected, after the step of performing a mapping operation on the custom API interface and the preset database according to the data mapping rule set to obtain the target API interface, the method further includes:
[0021] When a save instruction of a target API interface is detected, a target API interface document corresponding to the target API interface is generated, and the target API interface document includes an interface address, request parameters, response parameters, and an error code;
[0022] Output the target API interface document. The target API interface document formats include HTML, PDF, and Markdown.
[0023] Optionally, in a sixth implementation of the first aspect of the present invention, based on the graphical user interface, when a data mapping rule set is detected, a mapping operation is performed on the custom API interface and the preset database according to the data mapping rule set to obtain the target API interface. The method includes:
[0024] Based on the graphical user interface, when a deployment instruction is detected, the target API interface is deployed to the operating environment specified by the deployment instruction, and the operating environment includes a cloud platform, a local server, a virtual machine or a container.
[0025] Optionally, in a seventh implementation of the first aspect of the present invention, based on the graphical user interface, when a data mapping rule set is detected, after the step of performing a mapping operation on the custom API interface and the preset database according to the data mapping rule set to obtain the target API interface, the method further includes:
[0026] Detect the running status of the target interface in real time and obtain performance data, including the number of calls, response time, and error rate.
[0027] In a second aspect, an embodiment of the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the custom configuration method of the above-mentioned API interface when executing the computer program.
[0028] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the custom configuration method of the above-mentioned API interface are implemented.
[0029] In a fourth aspect, an embodiment of the present invention provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute the above-mentioned custom configuration method of the API interface.
[0030] The beneficial effects of the embodiments of the present invention compared with the prior art are: rendering a graphical user interface; based on the graphical user interface, when API metadata is detected, the interface configuration operation is performed according to the API metadata to obtain a basic API interface; based on the graphical user interface, when the dragged selected business process diagram data is detected, the basic API interface is updated according to the business process diagram data to obtain a custom API interface; based on the graphical user interface, when a data mapping rule set is detected, the custom API interface is mapped with the preset database according to the data mapping rule set to obtain a target API interface. Through the rendered graphical user interface, the user can update the basic API interface by dragging the selected business process diagram data according to actual needs, thereby obtaining a custom API interface that conforms to specific business logic. The user can flexibly respond to complex and changing business scenarios. Based on the graphical user interface, the complex API interface configuration process can also be presented to the user in an intuitive and visual manner. The user does not need to have an in-depth understanding of the complex code and configuration options, and can complete the interface configuration through simple drag and click operations, which significantly reduces the difficulty of interface configuration. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0032] Figure 1 A schematic diagram of an embodiment of a method for customizing configuration of an API interface in an embodiment of the present invention;
[0033] Figure 2 This is a schematic diagram of a specific embodiment of step S201 of the method for customizing configuration of an API interface in an embodiment of the present invention;
[0034] Figure 3 This is a schematic diagram of a specific embodiment of step S102 of the method for customizing configuration of an API interface in an embodiment of the present invention;
[0035] Figure 4 It is a schematic diagram of a specific embodiment after step S104 of the method for customizing configuration of an API interface in an embodiment of the present invention;
[0036] Figure 5 The figure is a schematic diagram of an embodiment of a terminal device in an embodiment of the present invention. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are protected by the present invention.
[0038] It should be noted that the terms "include", "comprises" and "have" and any variations thereof in the specification and claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, terminal, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices. In the claims, specifications and drawings of the present invention, relational terms such as "first" and "second" are merely used to distinguish one entity / operation / object from another entity / operation / object, and do not necessarily require or imply any such real-time relationship or order between these entities / operations / objects.
[0039] Reference to an "embodiment" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiment may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0040] With the development of information technology, low-code platforms are favored because they simplify the development process and support non-professional developers. Interface customization is one of its key features.
[0041] Existing low-code platforms are limited to predefined options, and the configuration interface is not intuitive enough, which increases the difficulty of configuration. A new technical means is needed to solve the above technical problems.
[0042] In view of this, an embodiment of the present invention provides a custom configuration method, terminal device and storage medium for an API interface. Through a rendered graphical user interface, a user can update the basic API interface by dragging and dropping the selected business process diagram data according to actual needs, thereby obtaining a custom API interface that conforms to specific business logic. Users can flexibly respond to complex and changing business scenarios. Based on the graphical user interface, the complex API interface configuration process can also be presented to the user in an intuitive and visual manner. Users do not need to have an in-depth understanding of complex codes and configuration options, and can complete the interface configuration through simple drag and click operations, which significantly reduces the difficulty of interface configuration.
[0043] In order to illustrate the technical solution of the present invention, specific embodiments are provided below for illustration.
[0044] Figure 1 The present invention provides a method for implementing a custom configuration flow of an API interface, which can be applied to a terminal device, such as a mobile phone, a tablet computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, etc.
[0045] Specifically, the above-mentioned custom configuration method of the API interface may include the following steps S101 to S103.
[0046] Step S101, rendering a graphical user interface.
[0047] In an embodiment of the present invention, after the custom configuration program of the API interface is started, a graphical user interface is loaded and rendered. The graphical user interface provides clear and intuitive menus and options, allowing users to navigate and configure the API interface.
[0048] Optionally, add interactive elements (such as buttons, drop-down menus, sliders, etc.) to make the GUI more intuitive and easy to use. For example, provide a live preview function for the API interface configuration so that users can see the real-time effect during the configuration process.
[0049] Optionally, the graphical user interface can be adaptively laid out according to the screen size and resolution of different devices to provide a good user experience on a variety of devices.
[0050] Optionally, allow users to select different theme colors or styles to meet personalized visual needs.
[0051] Step S102, based on the graphical user interface, when API metadata is detected, an interface configuration operation is performed according to the API metadata to obtain a basic API interface.
[0052] In an embodiment of the present invention, when a user enters or selects API metadata (such as interface name, request method, path, etc.) in a graphical user interface, the terminal device detects these inputs and starts to perform interface configuration operations, including creating the basic structure of the interface, setting the request and response formats, etc.
[0053] Optionally, when the user enters API metadata, real-time verification is performed to ensure that the input data complies with the specification.
[0054] Optionally, an API interface template is provided, and users can select the template as a starting point and then modify and customize it according to their needs.
[0055] Optionally, the user's previous configuration history is recorded to allow the user to restore to the previous configuration state.
[0056] Step S103, based on the graphical user interface, when it is detected that the business process diagram data is dragged and selected, the basic API interface is updated according to the business process diagram data to obtain a custom API interface.
[0057] In an embodiment of the present invention, a user can select business process diagram data in a graphical user interface by dragging. The terminal device should detect these drag operations and parse the business process diagram data to obtain element sets and element relationships. Then, the API interface is updated based on this information to include user-defined business logic.
[0058] Optionally, a business process diagram editor is integrated to allow users to draw and edit business process diagrams directly in a graphical interface.
[0059] Optionally, an element library is preset, including various business logic components, data processing components, etc. Users can drag elements from the library to the business process diagram.
[0060] Optionally, version control is performed on the business process diagram, allowing users to save different versions and switch or compare the differences between different versions at any time.
[0061] Optionally, based on the elements that the user has dragged into the business process diagram, related elements or components are recommended to simplify the configuration process.
[0062] Step S104, based on the graphical user interface, when a data mapping rule set is detected, a mapping operation is performed on the custom API interface and the preset database according to the data mapping rule set to obtain a target API interface.
[0063] In an embodiment of the present invention, after the user configures the data mapping rule set in the graphical user interface, the terminal device detects that the user has selected the data mapping rule set, and performs a mapping operation between the custom API interface and the preset database according to the data mapping rule set, including determining which fields in the database correspond to the request and response parameters of the API interface, and setting data conversion rules.
[0064] Optionally, the running status of the target interface is detected in real time to obtain performance data, including the number of calls, response time, and error rate. By collecting and analyzing performance data, users can better understand the performance bottlenecks and bottlenecks of the target API interface, so as to perform targeted performance optimization.
[0065] Optionally, in addition to basic field mapping, more complex data mapping rule sets can be supported, such as data conversion, data filtering, and data validation, etc. This enables the API interface to handle more complex data operations.
[0066] Optionally, a database connection management tool is provided to allow users to configure and manage connection information to a preset database.
[0067] Optionally, when configuring a data mapping rule set, a data mapping preview function is provided to display the mapping relationship between source data and target data to help users verify the correctness of the mapping.
[0068] The beneficial effects of the embodiments of the present invention compared with the prior art are: rendering a graphical user interface; based on the graphical user interface, when API metadata is detected, the interface configuration operation is performed according to the API metadata to obtain a basic API interface; based on the graphical user interface, when the dragged selected business process diagram data is detected, the basic API interface is updated according to the business process diagram data to obtain a custom API interface; based on the graphical user interface, when a data mapping rule set is detected, the custom API interface is mapped with the preset database according to the data mapping rule set to obtain a target API interface. Through the rendered graphical user interface, the user can update the basic API interface by dragging the selected business process diagram data according to actual needs, thereby obtaining a custom API interface that conforms to specific business logic. The user can flexibly respond to complex and changing business scenarios. Based on the graphical user interface, the complex API interface configuration process can also be presented to the user in an intuitive and visual manner. The user does not need to have an in-depth understanding of the complex code and configuration options, and can complete the interface configuration through simple drag and click operations, which significantly reduces the difficulty of interface configuration.
[0069] The configuration of traditional API interfaces is usually a complex and time-consuming process. Developers need to manually write interface codes, configure parameters, process data mapping, etc. before testing the interface. Based on this, the present invention proposes an optional embodiment.
[0070] The following specific implementation is also included after step S101.
[0071] Step S201, based on the graphical user interface, when a test instruction is detected, an API interface function test is performed on the target API interface.
[0072] In an embodiment of the present invention, a user may trigger a test instruction through a graphical user interface, such as clicking a "test" button or selecting an "execute test" option.
[0073] The terminal device prepares the test environment, including test data, simulated requests, etc., according to the user's configuration or default settings. The terminal device sends a simulated request to the target API interface and captures the interface's response. The interface's response is verified and compared based on the preset test parameters and expected results.
[0074] The terminal device records key information during the test, including request parameters, response parameters, error information, etc. The test results are compared with the expected results to determine whether the test passes.
[0075] The terminal device displays the test results to the user through a graphical user interface, including whether the test passed, error details (if any), performance data (such as response time), etc.
[0076] In the embodiment of the present invention, by integrating API interface function testing in the configuration process, potential problems in the interface can be discovered and repaired in a timely manner, thereby improving the stability of the API interface.
[0077] The testing of API interfaces usually relies on special testing tools or scripts, which requires developers to have certain testing knowledge and experience. At the same time, the testing process is often separated from the configuration process of the API interface, resulting in the testing work lagging behind the development process, making it difficult to find and fix problems in time. Based on this, the present invention proposes an optional embodiment.
[0078] Figure 2 This is a schematic diagram of a specific implementation of step S201 of the method for customizing configuration of an API interface in an embodiment of the present invention. Step S201 also includes the following specific implementation methods.
[0079] Step S2011: providing API interface test configuration options based on a graphical user interface.
[0080] In an embodiment of the present invention, a user accesses the API interface test configuration area through a graphical user interface. The user can set test parameters such as request method (GET, POST, etc.), request header, request body, etc. according to test requirements.
[0081] The user can set the expected result, including the expected response status code, response body content, response header information, etc. The terminal device saves the user's test configuration option settings.
[0082] The user triggers the test instruction through the graphical user interface, such as clicking a "start test" button.
[0083] Step S2012, based on the API interface test configuration option settings, when the test parameters and expected results are detected, the API interface function test is performed on the target API interface according to the test parameters and expected results.
[0084] In an embodiment of the present invention, the terminal device prepares a test environment according to the test parameters set by the user, such as simulating request data, configuring necessary network conditions, etc.
[0085] The terminal device sends a simulated request to the target API interface and captures the interface's response.
[0086] The terminal device compares the captured response with the expected result set by the user to determine whether the test passes.
[0087] The terminal device records key information during the test, including request parameters, response parameters, error information, etc.
[0088] The terminal device displays the test results to the user through a graphical user interface, including whether the test passed, error details (if any), performance data (such as response time), etc.
[0089] In the embodiment of the present invention, the API interface test configuration options are provided through the graphical user interface, and the user can flexibly set the test parameters and expected results according to actual needs, so as to adapt to different test scenarios. In addition, the expected results set by the user are compared with the responses captured by the terminal device, so as to accurately determine whether the test has passed, reducing the possibility of misjudgment.
[0090] Traditional rights management methods (such as configuration files, database tables, etc.) lack intuitiveness and ease of use, increasing the difficulty of management and maintenance. Based on this, the present invention proposes an optional embodiment.
[0091] After step S104, the following specific implementation is also included.
[0092] Step S202, based on the graphical user interface, when a permission adjustment instruction is detected, a permission adjustment operation is performed on the target API interface, and the permission adjustment operation includes at least one of setting access permission level, restricting access IP address, defining access time period, and setting access times.
[0093] In an embodiment of the present invention, a user has access rights to the management area through a graphical user interface.
[0094] The user selects the target API interface and triggers a permission adjustment instruction, such as clicking the "Modify Permissions" button.
[0095] The terminal device detects the user's permission adjustment instruction and enters the permission adjustment process.
[0096] The terminal device displays permission adjustment configuration options on the GUI, such as setting access permission levels (such as public, private, restricted, etc.), limiting access IP addresses, defining access time periods, setting access times, etc.
[0097] The user selects or enters the corresponding permission adjustment parameters according to actual needs.
[0098] The terminal device saves the permission adjustment parameters entered by the user.
[0099] The terminal device adjusts the permission parameters input by the user and updates the permission settings of the target API interface. The terminal device can interact with the authorized terminal device to ensure the consistency of the permission adjustment.
[0100] After the terminal device is updated, the permission adjustment result is fed back to the user, such as "Permission adjustment successful" or "Permission adjustment failed, please try again".
[0101] Users can verify whether the permission adjustment is effective through the GUI or other methods. For example, users can try to access the target API interface using different access conditions (such as different IP addresses, different time periods) to verify whether the permission adjustment works as expected.
[0102] In the embodiment of the present invention, access to the API interface can be strictly controlled through permission adjustment to prevent unauthorized access and data leakage. In addition, users can flexibly set different access permission levels, restrict access IP addresses, define access time periods, set access times, etc. according to actual needs to adapt to different application scenarios.
[0103] Traditional API interface development methods usually involve a lot of manual coding work, and developers need to write complex codes to implement business logic and data processing. This method is not only time-consuming and labor-intensive, but also prone to errors and omissions. Based on this, the present invention proposes an optional embodiment.
[0104] Figure 3 This is a schematic diagram of a specific implementation of step S102 of the method for customizing configuration of an API interface in an embodiment of the present invention. Step S102 also includes the following specific implementation methods.
[0105] Step S1021, parse the business process diagram data to obtain element sets and element relationships.
[0106] In an embodiment of the present invention, the GUI detects the dragging operation of the user and identifies the dragged business process diagram data. The dragged business process diagram data is parsed to extract the element set and element relationship therein. The elements represent different business logics, data processing steps, etc., and the element relationship describes the execution order or dependency relationship between these elements.
[0107] Step S1022: Generate a basic API interface based on the element set and element relationship.
[0108] In the embodiment of the present invention, according to the element set and element relationship obtained by parsing, the basic API interface is generated or updated and converted into a custom API interface. The obtained custom API interface performs data processing and business operations according to the logic described in the business process diagram.
[0109] In the embodiment of the present invention, the API interface is generated or updated by dragging the business process diagram data, which simplifies the development process of the API interface, reduces the workload of manual coding, and thus improves development efficiency.
[0110] Traditional API interface development processes often lack complete documentation support. Developers usually only focus on API implementation and functional testing, while ignoring document writing and updating. This causes great difficulties for API users and maintainers in understanding and using APIs. Based on this, the present invention proposes an optional embodiment.
[0111] Figure 4 This is a schematic diagram of a specific implementation after step S104 of the method for customizing configuration of an API interface in an embodiment of the present invention. After step S104, the following specific implementation methods are also included.
[0112] Step S203, when a save instruction of a target API interface is detected, a target API interface document corresponding to the target API interface is generated, and the target API interface document includes an interface address, request parameters, response parameters, and an error code.
[0113] In the implementation manner of the present invention, the terminal device has completed the mapping operation between the target API interface and the preset database according to the data mapping rule set. At this time, the target API interface has the ability to interact with the database.
[0114] After receiving the save command, the terminal device generates the target API interface document corresponding to the target API interface. The document contains information such as the interface address, request parameters, response parameters, and error codes.
[0115] The terminal device automatically fills in various parts of the interface document according to the definition and mapping rules of the target API interface. For example, the interface address is generated according to the URL path of the API, and the request parameters and response parameters are determined according to the input and output data structure of the API.
[0116] Step S204, outputting the target API interface document, the target API interface document may be in the format of HTML, PDF, or Markdown.
[0117] In the embodiment of the present invention, the terminal device provides a variety of output formats for users to choose, including HTML, PDF, Markdown, etc. Users can choose a suitable output format according to their needs.
[0118] The terminal device outputs the generated API interface document to the specified location or device according to the output format selected by the user. It can be a local file terminal device, a network storage location or a printing device, etc.
[0119] In the embodiment of the present invention, by generating an API interface document, the terminal device can provide a detailed interface description for the API user, so that the user can better understand the function and usage of the API, thereby improving the usability of the API.
[0120] Traditional API interface development methods usually involve a lot of manual coding work, and developers need to write complex codes to implement business logic and data processing. This method is not only time-consuming and labor-intensive, but also prone to errors and omissions. Based on this, the present invention proposes an optional embodiment.
[0121] Step S102 also includes the following specific implementation methods.
[0122] Step S1021, parse the business process diagram data to obtain element sets and element relationships.
[0123] In an embodiment of the present invention, the GUI detects the dragging operation of the user and identifies the dragged business process diagram data. The dragged business process diagram data is parsed to extract the element set and element relationship therein. The elements represent different business logics, data processing steps, etc., and the element relationship describes the execution order or dependency relationship between these elements.
[0124] Step S1022: Generate a basic API interface based on the element set and element relationship.
[0125] In the embodiment of the present invention, according to the element set and element relationship obtained by parsing, the basic API interface is generated or updated and converted into a custom API interface. The obtained custom API interface performs data processing and business operations according to the logic described in the business process diagram.
[0126] In the embodiment of the present invention, the API interface is generated or updated by dragging the business process diagram data, which simplifies the development process of the API interface, reduces the workload of manual coding, and thus improves development efficiency.
[0127] The traditional API interface deployment process usually involves complex manual configuration and script execution. Users need to understand the configuration requirements of the target operating environment, the code structure and dependencies of the API interface, etc., in order to correctly complete the deployment operation. This is time-consuming, labor-intensive, and prone to errors. Based on this, the present invention proposes an optional embodiment.
[0128] After step S104, the following specific implementation is also included.
[0129] Step S205, based on the graphical user interface, when a deployment instruction is detected, the target API interface is deployed to the operating environment specified by the deployment instruction, and the operating environment includes a cloud platform, a local server, a virtual machine or a container.
[0130] In an embodiment of the present invention, when a deployment instruction issued by a user through a graphical user interface is detected, the terminal device prepares corresponding deployment resources according to the operating environment specified by the user. This may include creating a virtual machine or container instance on the cloud platform, configuring the operating environment of the local server, etc. The deployment instruction is triggered by the user selecting a deployment option on the GUI, specifying the operating environment (such as a cloud platform, a local server, a virtual machine or a container), and confirming the deployment.
[0131] The terminal device packages the target API interface and its related dependencies, configuration files, etc. into a deployable unit. For example, the API interface code, database connection information, log configuration, etc. are packaged into one or more files or directories.
[0132] The terminal device deploys the packaged API interface to the prepared operating environment, which may include uploading files to the server, starting the API interface service in a virtual machine or container, etc.
[0133] Optionally, the operating status of the target interface is detected in real time to obtain performance data, which includes the number of calls, response time, and error rate.
[0134] In the embodiment of the present invention, the deployment options and instructions provided by the graphical user interface allow users to easily complete the deployment operation of the API interface without manually configuring and running complex scripts or commands, which significantly improves the efficiency and accuracy of deployment.
[0135] like Figure 5 , which is a schematic diagram of a terminal device provided in an embodiment of the present invention. The terminal device 5 may include: a processor 501, a memory 502, and a computer program 503 stored in the memory 502 and executable on the processor 501, such as a custom configuration program for an API interface. When the processor 501 executes the computer program 503, the steps in the custom configuration embodiments of the above-mentioned API interfaces are implemented.
[0136] The computer program may be divided into one or more modules / units, one or more modules / units are stored in the memory 502 and executed by the processor 501 to complete the present invention. One or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.
[0137] The terminal device may include, but is not limited to, a processor 501 and a memory 502. Those skilled in the art will appreciate that Figure 5It is only an example of a terminal device and does not constitute a limitation of the terminal device. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include input and output devices, network access devices, buses, etc.
[0138] The processor 501 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0139] The memory 502 may be an internal storage unit of the terminal device, such as a hard disk or memory of the terminal device. The memory 502 may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device. Further, the memory 502 may also include both an internal storage unit of the terminal device and an external storage device. The memory 502 is used to store computer programs and other programs and data required by the terminal device. The memory 502 may also be used to temporarily store data that has been output or is to be output.
[0140] It should be noted that, for the convenience and brevity of description, the structure of the above-mentioned terminal device can also refer to the specific description of the structure in the method embodiment, which will not be repeated here.
[0141] An embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned custom configuration method of the API interface can be implemented.
[0142] An embodiment of the present invention provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned custom configuration method of the API interface when executing the computer program product.
[0143] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0144] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0145] In the embodiments provided by the present invention, it should be understood that the disclosed terminal devices and methods can be implemented in other ways. For example, the terminal device embodiments described above are only exemplary. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0146] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0147] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0148] If the above integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The above computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above method embodiments when executed by the processor. Among them, the above computer program includes computer program code, and the above computer program code can be in source code form, object code form, executable file or some intermediate form. The above computer-readable medium may include: any entity or device capable of carrying the above computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the above computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0149] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the above embodiments, a person skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.
Claims
1. A custom configuration method for an API interface, characterized in that: include: Rendering the graphical user interface; Based on the graphical user interface, when API metadata is detected, an interface configuration operation is performed according to the API metadata to obtain a basic API interface; Based on the graphical user interface, when it is detected that the business process diagram data is dragged and selected, the basic API interface is updated according to the business process diagram data to obtain a custom API interface; Based on the graphical user interface, when a data mapping rule set is detected, a mapping operation is performed between the custom API interface and a preset database according to the data mapping rule set to obtain a target API interface.
2. The method for customizing the API interface according to claim 1, wherein: After the step of detecting a data mapping rule set based on the graphical user interface and mapping the custom API interface to a preset database according to the data mapping rule set to obtain a target API interface, the method further includes: Based on the graphical user interface, when a test instruction is detected, an API interface function test is performed on the target API interface.
3. The method for customizing the API interface according to claim 2, wherein: The step of performing API interface function testing on the target API interface when a test instruction is detected based on the graphical user interface includes: Providing API interface test configuration options based on the graphical user interface; Based on the API interface test configuration option settings, when test parameters and expected results are detected, the API interface functional test is performed on the target API interface according to the test parameters and the expected results.
4. The method for customizing the API interface according to claim 1, wherein: After the step of detecting a data mapping rule set based on the graphical user interface and mapping the custom API interface to a preset database according to the data mapping rule set to obtain a target API interface, the method further includes: Based on the graphical user interface, when a permission adjustment instruction is detected, a permission adjustment operation is performed on the target API interface, and the permission adjustment operation includes at least one of setting access permission level, restricting access IP address, defining access time period, and setting access times.
5. The method for customizing the API interface according to claim 1, wherein: The step of updating the basic API interface according to the business process diagram data to obtain the custom API interface when the business process diagram data specified by the drag operation is detected based on the graphical user interface comprises: Parsing the business process diagram data to obtain element sets and element relationships; The basic API interface is generated according to the element set and the element relationship.
6. The method for customizing the API interface according to claim 1, wherein: After the step of detecting a data mapping rule set based on the graphical user interface and mapping the custom API interface to a preset database according to the data mapping rule set to obtain a target API interface, the method further includes: When a save instruction of the target API interface is detected, a target API interface document corresponding to the target API interface is generated, wherein the target API interface document includes an interface address, request parameters, response parameters, and an error code; Output the target API interface document, the target API interface document format includes HTML, PDF, Markdown.
7. The method for customizing the API interface according to claim 1, wherein: After the step of detecting a data mapping rule set based on the graphical user interface and mapping the custom API interface to a preset database according to the data mapping rule set to obtain a target API interface, the method includes: Based on the graphical user interface, when a deployment instruction is detected, the target API interface is deployed to the operating environment specified by the deployment instruction, and the operating environment includes a cloud platform, a local server, a virtual machine or a container.
8. The method for customizing the API interface according to claim 1, wherein: After the step of detecting a data mapping rule set based on the graphical user interface and mapping the custom API interface to a preset database according to the data mapping rule set to obtain a target API interface, the method further includes: The operating status of the target interface is detected in real time to obtain performance data, which includes the number of calls, response time, and error rate.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method for customizing the API interface as claimed in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for customizing the API interface as claimed in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Method and related device for realizing API (Application Program Interface) docking based on custom domain event
CN121166287A