Method, system and equipment for carrying out optimal configuration on dynamically constructed service interface parameters and storage medium

By using template language to optimize the configuration of service interface parameters in dynamically building service systems, the problem of sub-interface parameter format mismatch is solved, a low-code solution is realized, the difficulty of work is simplified, and the flexibility and applicability of the system are improved. .

CN119356753APending Publication Date: 2025-01-24NARI INFORMATION & COMM TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411401110.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

When existing dynamic configuration methods deal with the specific input parameter format requirements of subinterfaces, it is difficult for other subinterface output formats, resulting in developers needing to manually write adaptive code, which increases work difficulty and inconvenience in system use.

Method used

The template language is used to optimize the dynamic construction service interface parameters, draws the graph chain executed by the parent interface through graphic, and uses the template language to configure the input and output data formula of each graphic. The template language engine combines the context environmental data during execution. The translation template language is a specific input and output parameter.

Benefits of technology

In the dynamic construction service system, the low -code method solves the problem of the sub -interface calling parameter format, which avoids the use of high code adaptation services, simplifies the difficulty of work, and improves the flexibility and application scenarios of the dynamic configuration interface. Essence

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356753A_ABST
    Figure CN119356753A_ABST
Patent Text Reader

Abstract

The invention discloses a method, a system, equipment and a storage medium for performing optimal configuration on parameters of a dynamically constructed service interface, and the method comprises the following steps: when the service interface is constructed in a dynamically constructed service system, performing optimal configuration on the parameters of the constructed service interface by using a template language, namely, using the template language in the configuration, referencing a context environment variable, and constructing the service interface in the dynamic constructed service system; the logic is self-defined; then, when the interface is executed, the template language engine translates the template statement into real input and output parameters according to self-defined logic in combination with the context environment variable value of the execution period, and the real input and output parameters are used for execution of the service interface; according to the method, the flexibility of configuring the input and output parameters during dynamic construction of the service interface is greatly improved, and the application scene of a dynamic construction service system for constructing a new interface is widened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of low-code software development, and specifically relates to a method, system, device and storage medium for optimizing the configuration of dynamically constructed service interface parameters using a template language. Background Art

[0002] With the popularity of microservice architecture, the business logic of the system is increasingly dispersed in different microservices. When implementing certain business scenarios, a single microservice API interface often cannot meet the needs of the scenario. Developers often need to combine and call multiple microservice API interfaces. To do this, they need to master different microservice API interface specifications, understand a lot of trivial API configurations, and handle dependencies, coordination, and exceptions between different API interfaces, which consumes a lot of energy. For this reason, service interface dynamic configuration technology has been introduced. Based on this technology, developers can use low-code configuration in the system to simply configure multiple sub-interfaces to build some parent interfaces.

[0003] Generally speaking, developers need to configure the sub-interfaces that the parent interface depends on and use some simple methods to configure the input parameters of these sub-interfaces, which simplifies some of the work. However, if the sub-interface has specific input parameter format requirements and cannot simply match the output format of other sub-interfaces, developers have to write adaptability code to meet the requirements of the sub-interface call. Although this can solve the problem, it increases the difficulty of the work and affects the convenience of using the dynamic configuration system, thereby reducing the willingness of developers to use the dynamic configuration system. Furthermore, the frequent use of high-code technology deviates from the original intention of the dynamic configuration system as a low-code design platform. Summary of the invention

[0004] Purpose of the invention: To solve the problems existing in the existing dynamic configuration methods, the present invention proposes a method, system, device and storage medium for optimizing the configuration of dynamically constructed service interface parameters using a template language.

[0005] Technical solution: A method for optimizing the configuration of dynamically constructed service interface parameters, comprising the following steps:

[0006] Step 1: Configure each sub-interface;

[0007] Step 2: Build the parent interface;

[0008] Step 3: Draw a graph chain executed by the parent interface in a graphical manner, wherein the graph chain is composed of multiple graph elements according to the execution logic of the parent interface; the supported graph element types include at least a start graph element, a sub-interface graph element, a parallel graph element, a branch graph element, a formula graph element, and an end graph element;

[0009] Step 4: Use the template language to configure the input data formula of the sub-interface element, use the template language to configure the input data formula of the branch element, use the template language to configure the input data formula and output data formula of the formula element, and use the template language to configure the output data formula of the end element;

[0010] Step 5: Configure the input data value of the start primitive, run and debug the parent interface graph chain, and the template language engine follows the graph chain, from the start primitive to the end primitive, in accordance with the reference rules, caches the execution period context data, and follows the conversion rules, combined with the execution period context data, and translates the formulas configured for each primitive in the graph chain into specific input and output parameters in turn, executes the primitive behavior, displays the primitive execution results, and completes the parent interface debugging;

[0011] Step 6: Release the successfully debugged parent interface.

[0012] Furthermore, the execution-period context data is one or more of: input data of a parent interface, input data of a child interface, output data of a child interface, and custom field data of a formula primitive.

[0013] Furthermore, the input data of the sub-interface includes: path, URL and input message.

[0014] Furthermore, the citation rules specifically include:

[0015] The template format of the input data referencing the parent interface is: {{P.IN.Field name}};

[0016] The template format of the input data referencing the sub-interface is: {{sub-interface instance name.PATH.path field name}}, {{sub-interface instance name.URL.url field name}}, {{sub-interface instance name.IN.input message field name}};

[0017] The template format for referencing the output data of a sub-interface is: {{sub-interface instance name.RES}}, {{sub-interface instance name.OUT.output message field name}};

[0018] The template format of custom field data that references a formula entity is: {{formula entity instance name.field name}}.

[0019] Furthermore, the conversion rules include: plain text and variable mixed conversion rules, object attribute conversion rules, HTML escape character conversion rules, implicit iteration conversion rules, anonymous function conversion rules, and control domain conversion rules.

[0020] The present invention discloses a system for optimizing and configuring parameters of a dynamically constructed service interface, comprising the following modules:

[0021] Interface repository module, used to configure, store and publish various sub-interfaces and parent interfaces;

[0022] A graph chain drawing module, used to draw a graph chain executed by a parent interface in a graphical manner, wherein the graph chain is composed of multiple graph elements according to the execution logic of the parent interface; the supported graph element types include at least a start graph element, a sub-interface graph element, a parallel graph element, a branch graph element, a formula graph element, and an end graph element;

[0023] A graphic element configuration module, used to configure the input data formula of the sub-interface graphic element using the template language, configure the input data formula of the branch graphic element using the template language, configure the input data formula and output data formula of the formula graphic element using the template language, and configure the output data formula of the end graphic element using the template language;

[0024] The debugging module is used to run and debug the parent interface graph chain: first configure the input data value of the starting graph element, and then make the template language engine follow the graph chain, from the starting graph element to the ending graph element, follow the reference rules, cache the execution period context environment data, and follow the conversion rules, combined with the execution period context environment data, translate the formulas configured by each graph element in the graph chain into specific input and output parameters in turn, execute the graph element behavior, display the graph element execution results, and complete the parent interface debugging;

[0025] The publishing module is used to manage the publishing of configured parent interfaces.

[0026] The present invention discloses a computer device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-disclosed method for optimizing the configuration of dynamic service interface parameters are implemented.

[0027] The present invention discloses a storage medium, wherein the storage medium stores a parameter optimization configuration program, and when the parameter optimization configuration program is executed by at least one processor, the steps of the method for optimizing the configuration of dynamic service interface parameters disclosed above are realized.

[0028] Beneficial effects: Compared with the prior art, the present invention has the following advantages:

[0029] (1) When constructing a service interface in a dynamically constructed service system, the method of the present invention uses a template language to optimize the configuration of the parameters of the constructed service interface, that is, the template language is used in the configuration, the context environment variables are referenced, and the logic is customized; when executing the interface, the template language is translated into real input and output parameters in accordance with the template language rules and the context environment of the execution period, so as to meet the specific format requirements of the sub-interface call, so that the entire dynamically configured interface can run normally, avoiding the use of high code to specially develop interface adaptation services, and achieving the goal of using low code to solve problems and simplify work difficulty in the dynamically constructed service system;

[0030] (2) The method of the present invention greatly improves the flexibility of configuring input and output parameters when dynamically constructing a service interface, and broadens the applicable scenarios in which a dynamic service construction system can construct new interfaces. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 A flowchart of a method for optimizing configuration of dynamically constructed service interface parameters using a template language described in the present invention;

[0032] Figure 2 This is a functional principle diagram of using a template language to dynamically configure and run services as described in the present invention. DETAILED DESCRIPTION

[0033] To make the purpose, technical solution and advantages of the present invention clearer, the following will further illustrate a method for optimizing the configuration of dynamically constructed service interface parameters using a template language proposed by the present invention in conjunction with the accompanying drawings of the present invention.

[0034] Embodiment 1:

[0035] Based on the original intention of "technical problems existing in low-code platforms should be solved by low-code methods first", this embodiment discloses a method for optimizing the configuration of dynamically constructed service interface parameters using template language. The main idea is: when constructing a service interface, use template language to optimize the configuration of the parameters of the constructed service interface, that is, use template language in the configuration, reference context environment variables, and customize logic; when executing the service interface, the template language engine combines the context environment variable values ​​of the execution period and translates the template language into real input and output parameters according to the custom logic for use by the service interface execution.

[0036] like Figure 1 Specifically, the method of this embodiment mainly includes the following steps:

[0037] Step 1: Register all possible dependent sub-interfaces, configure the sub-interface name, form, number of input parameters, etc., solidify this information and store it in the interface warehouse so that it can be reused when configuring the parent interface graph chain later;

[0038] Step 2: Build the parent interface, configure its name, form, number of input parameters, etc., solidify this information and store it in the interface warehouse, which can be used repeatedly when configuring the parent interface graph chain later;

[0039] Step 3: Draw the primitive logic sequence executed by the parent interface in a graphical manner. The primitive logic sequence includes multiple types of primitives, including: start, sub-interface, parallel, branch, formula, end, etc.;

[0040] Step 4: When dynamically configuring interface parameters, use the template language to configure the input data formula of the sub-interface entity, use the template language to configure the input data formula of the branch entity, use the template language to configure the input data formula and output data formula of the formula entity, and use the template language to configure the output data formula of the end entity.

[0041] The template language proposed in this embodiment can reference the numerical value of the context environment, specifically including: can reference the input message data of the parent interface; can reference the input data of the child interface, including: path, url and input message; can reference the output message data of the child interface; can reference the custom field data of the formula graphic element.

[0042] Step 5: Configure the input data value of the start primitive, run and debug the parent interface graph chain, and the template language engine follows the primitive logic sequence, from the start primitive to the end primitive, and follows the reference rules to cache the execution period context data. At the same time, it follows the conversion rules and combines the execution period context data to convert the formulas configured in each primitive into actual usable data in turn, so as to meet the specific format requirements of the child interface call; execute the primitive behavior, display the primitive execution results, and the displayed primitive execution results include the input data value and output data value of each primitive, and finally display the debugging conclusion of the parent interface;

[0043] In this step, the template language is converted into actual usable data to meet the specific format requirements of the sub-interface call, so that the entire dynamically configured interface can operate normally, avoiding the use of high-code to specially develop interface adaptation services, and achieving the goal of using low-code to solve problems and simplify work difficulty within the dynamically built service system.

[0044] The specific reference rules of the execution context data in the template language described in this embodiment are as follows:

[0045] (1) Reference the input data of the parent interface

[0046]

[0047] (2) Reference sub-interface input data

[0048]

[0049] (3) Quote the output data of the sub-interface

[0050]

[0051] (4) Custom field data that references formula entities

[0052]

[0053] The grammatical rules of the template language in this embodiment include the following:

[0054] Plain text and variables are mixed, including numbers, strings and other basic types, and operators can be used;

[0055] Object properties, which can access multi-level properties;

[0056] HTML escape character, can be escaped or not;

[0057] Implicit iteration can display the data as a whole;

[0058] Anonymous function, which can return a constant or expression calculation result;

[0059] Control domain, including negative value, field name traversal, array traversal, anonymous function with parameters, positive logic, negative logic, comments, etc.

[0060] This embodiment describes converting the template language into actually usable data. The complete conversion rules of the template language are as follows:

[0061] (1) Mixing plain text and variables

[0062]

[0063]

[0064] (2) Object attributes

[0065]

[0066] (3) HTML escape characters

[0067]

[0068] (4) Implicit iteration

[0069] title template Context After conversion overall *{{.}} "Hello!" *Hello!

[0070] (5) Anonymous functions

[0071]

[0072]

[0073] (6) Control Domain

[0074]

[0075]

[0076] The above tables all have three columns. The "Template" column is the template statement written when dynamically configuring parameters; the "Context" column is the specific values ​​of various fields during system runtime (execution period); the "After conversion" column replaces the variable content in {{...}} in the template with the specific context value for use by other sub-interfaces.

[0077] Step 6: In the interface repository, mark the successfully debugged parent interface as published and open access to the outside of the system; for debugging convenience, the system may allow the use of unpublished interfaces.

[0078] Now combined Figure 2 The case shown in further illustrates a method proposed by the present invention for optimizing the configuration of dynamically constructed service interface parameters using a template language.

[0079] like Figure 2 As shown in the figure, the parent interface dynamically configures the graph chain. The configured graph chain executes three sub-interfaces A, B, and C in sequence. Sub-interface A means obtaining the current date, sub-interface B means obtaining the current user ID, and sub-interface C means obtaining the achievements of a certain user on a certain date. Input parameters are configured for sub-interface C, that is, the formula described in the template language. Figure 2 The formula configured in references the output of subinterfaces A and B;

[0080] Run the parent interface graph chain. Before executing the C sub-interface, the execution of the A and B sub-interfaces has been completed, so the output values ​​of the A and B sub-interfaces have been obtained in the context environment. Based on these values, the template language engine converts the input parameter formula of the C sub-interface into the input parameter value of C, and then the C sub-interface starts to execute.

[0081] In this example, the format of the input parameters of the C sub-interface is different from the output of A and B, but on the basis of referencing the output data of A and B, a new format is assembled by the template language, thus meeting the requirements of the calling format of the C sub-interface. Therefore, the method of this embodiment solves the problem of sub-interface calling parameter format mismatch by using low-code means.

[0082] In summary, the method of this embodiment uses a template language to configure when dynamically configuring interface parameters; when executing the interface, it follows the template language rules and, in combination with the context of the execution period, converts the template statements into actually usable data, thereby meeting the specific format requirements of the sub-interface call, allowing the entire dynamically configured interface to operate normally, avoiding the use of high code to specifically develop interface adaptation services, and achieving the goal of using low code to solve problems and simplify work difficulty in a dynamically built service system.

Claims

1. A method for optimizing configuration of dynamically constructed service interface parameters, characterized in that: The following steps are involved: Step 1: Configure each sub-interface; Step 2: Build the parent interface; Step 3: Draw a graph chain executed by the parent interface in a graphical manner, wherein the graph chain is composed of multiple graph elements according to the execution logic of the parent interface; the supported graph element types include at least a start graph element, a sub-interface graph element, a parallel graph element, a branch graph element, a formula graph element, and an end graph element; Step 4: Use the template language to configure the input data formula of the sub-interface element, use the template language to configure the input data formula of the branch element, use the template language to configure the input data formula and output data formula of the formula element, and use the template language to configure the output data formula of the end element; Step 5: Configure the input data value of the start primitive, run and debug the parent interface graph chain, and the template language engine follows the graph chain, from the start primitive to the end primitive, in accordance with the reference rules, caches the execution period context data, and follows the conversion rules, combined with the execution period context data, and translates the formulas configured for each primitive in the graph chain into specific input and output parameters in turn, executes the primitive behavior, displays the primitive execution results, and completes the parent interface debugging; Step 6: Release the successfully debugged parent interface.

2. A method for optimizing configuration of dynamically constructed service interface parameters according to claim 1, characterized in that: The execution period context data is one or more of: input data of the parent interface, input data of the child interface, output data of the child interface, and custom field data of the formula primitive.

3. A method for optimizing configuration of dynamically constructed service interface parameters according to claim 2, characterized in that: The input data of the sub-interface includes: path, URL and input message.

4. A method for optimizing configuration of dynamically constructed service interface parameters according to claim 1, characterized in that: The citation rules specifically include: The template format of the input data referencing the parent interface is: {{P.IN.Field name}}; The template format of the input data referencing the sub-interface is: {{sub-interface instance name.PATH.path field name}}, {{sub-interface instance name.URL.url field name}}, {{sub-interface instance name.IN.input message field name}}; The template format for referencing the output data of a sub-interface is: {{sub-interface instance name.RES}}, {{sub-interface instance name.OUT.output message field name}}; The template format of custom field data that references a formula entity is: {{formula entity instance name.field name}}.

5. A method for optimizing configuration of dynamically constructed service interface parameters according to claim 1, characterized in that: The conversion rules include: plain text and variable mixed conversion rules, object attribute conversion rules, HTML escape character conversion rules, implicit iteration conversion rules, anonymous function conversion rules, and control domain conversion rules.

6. A system for optimizing configuration of dynamically constructed service interface parameters, characterized in that: Includes the following modules: Interface repository module, used to configure, store and publish various sub-interfaces and parent interfaces; A graph chain drawing module, used to draw a graph chain executed by a parent interface in a graphical manner, wherein the graph chain is composed of multiple graph elements according to the execution logic of the parent interface; the supported graph element types include at least a start graph element, a sub-interface graph element, a parallel graph element, a branch graph element, a formula graph element, and an end graph element; A graphic element configuration module, used to configure the input data formula of the sub-interface graphic element using the template language, configure the input data formula of the branch graphic element using the template language, configure the input data formula and output data formula of the formula graphic element using the template language, and configure the output data formula of the end graphic element using the template language; The debugging module is used to run and debug the parent interface graph chain: first configure the input data value of the starting graph element, and then make the template language engine follow the graph chain, from the starting graph element to the ending graph element, follow the reference rules, cache the execution period context environment data, and follow the conversion rules, combined with the execution period context environment data, translate the formulas configured by each graph element in the graph chain into specific input and output parameters in turn, execute the graph element behavior, display the graph element execution results, and complete the parent interface debugging; The publishing module is used to manage the publishing of configured parent interfaces.

7. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of a method for optimizing the configuration of dynamically constructed service interface parameters as described in any one of claims 1 to 5 when executing the computer program.

8. A storage medium, characterized in that: The storage medium stores an optimization configuration program, and when the optimization configuration program is executed by at least one processor, the steps of a method for optimizing configuration of dynamically constructed service interface parameters according to any one of claims 1 to 5 are implemented.