Visual interface configuration method and device, equipment and program product
By declaring type constraint information and dynamic data source configuration in the low-code development platform, the flexibility problem of form configuration in the visual interface is solved, and the real-time updating of enumeration items and the transparency of configuration are realized, thereby improving development efficiency and the flexibility of business logic.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING BAILONGMA TECHNOLOGY CO LTD
- Filing Date
- 2026-01-12
- Publication Date
- 2026-05-12
AI Technical Summary
Low-code development platforms cannot flexibly complete the mapping configuration and logical definition between request parameters and other dynamic variables in the form in the visual interface, resulting in low development efficiency and rigid business logic.
By obtaining the initial form fields in the visualization interface, declaring type constraint information, configuring the data source configuration entity of the enumeration items, and mapping and associating them according to the input parameter definition, the input parameter values are obtained in real time to update the enumeration item list, and dynamic data source configuration is supported.
It enables flexible requests and data updates based on parameters at runtime, improving configuration transparency and autonomy, reducing the risk of runtime errors, and enhancing development efficiency and business logic flexibility.
Smart Images

Figure CN122018901A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of form configuration technology, and more specifically to methods, apparatus, devices, and program products for configuring visual interfaces. Background Technology
[0002] Low-code development platforms are becoming increasingly popular due to their ability to significantly lower the development threshold and improve application building efficiency, and are widely used for the rapid construction of various business forms and data interaction scenarios. To configure optional values for form fields, low-code development platforms generally adopt methods such as pre-setting static enumeration items or binding fixed data source configuration entities. Specifically, developers or business configurers typically define a fixed list of options for form components such as dropdowns and radio buttons during the design phase, or simply associate them with a predefined data query interface with fixed parameters. This model constitutes the mainstream technical solution for handling form field enumeration items in current low-code platforms.
[0003] However, this approach struggles to support dynamic enumeration items that need to change in real time and be retrieved asynchronously based on the form context. When an enumeration item request requires parameters, it is impossible to intuitively and flexibly complete the mapping configuration and logical definition between the request parameters and other dynamic variables in the form within the visual interface. When the form is running, it is impossible to automatically update the enumeration items based on changes in parameter mapping relationships and enumeration data triggered by parameter changes, resulting in reduced development efficiency and rigid business logic. Summary of the Invention
[0004] This invention provides a configuration method, apparatus, device, and program product for a visual interface, in order to solve the problem that related technologies rely on static enumeration items when configuring forms in a visual interface, and cannot make flexible requests and data updates based on parameters at runtime.
[0005] In a first aspect, the present invention provides a method for configuring a visual interface, the method comprising: Obtain the initial form fields of the form in the visualization interface, declare type constraint information for the initial form fields, and obtain the first form field; The form is run based on the first form field, and the enumeration items of the form at runtime are obtained. The data source configuration entity of the enumeration items is configured to obtain the input parameter definition of the data source configuration entity. Based on the input parameter definition, the input parameters of the data source configuration entity are mapped and associated with the variables in the form to obtain the mapping relationship between the input parameters and the variables; When rendering the form, the input parameter value corresponding to the input parameter is obtained in real time according to the mapping relationship, and a request is sent to the data source configuration entity based on the input parameter value. The optional enumeration item list composed of the enumeration items of the first form field is updated based on the data returned by the request.
[0006] This invention obtains the first form field by acquiring the initial form fields from the visual interface and declaring type constraint information for these fields. Based on this first form field, the form is run, and the enumeration items of the form during runtime are obtained. The data source configuration entity for the enumeration items is configured to obtain the input parameter definitions of the data source configuration entity. Based on the input parameter definitions, the input parameters of the data source configuration entity are mapped and associated with the variables in the form, resulting in a mapping relationship between the input parameters and variables. When rendering the form, the input parameter values corresponding to the input parameters are obtained in real time according to the mapping relationship, and a request is sent to the data source configuration entity based on the input parameter values. The optional enumeration item list, composed of the enumeration items of the first form field, is updated based on the data returned by the request. This invention allows users to declare enumeration data types during configuration and flexibly bind them to dynamic data source configuration entities. Through the mapping relationship between input parameters and variables, the optional enumeration list of form fields can be updated when the form is run, thus solving the technical defects of traditional low-code platforms where form configuration relies on static enumeration items and cannot flexibly request and update data based on parameters.
[0007] In one optional implementation, the input parameter definition includes the data source configuration entity type, input parameter declaration, and output mapping rules of the data source configuration entity. The step of mapping and associating the input parameters of the data source configuration entity with the variables in the form according to the input parameter definition includes: Read the input parameter declaration of the data source configuration entity, extract available variables from the form to construct a variable candidate set, the variable candidate set containing at least candidate form fields other than the currently configured first form field; Select the variable corresponding to the candidate form field from the variable candidate set to establish a direct mapping relationship, or establish an indirect mapping relationship based on parameter expressions.
[0008] In one optional implementation, establishing the expression-based indirect mapping relationship includes: Obtain a natural language description from user input; Semantic parsing is performed on the natural language description to extract semantic elements related to form field operations in the natural language description, and the target fields of the semantic elements are obtained; The target field is matched with the candidate form fields in the variable candidate set, and the successfully matched candidate form fields are filtered out. Invoke a preset expression template, and generate a parameter expression in the expression template based on the successfully matched candidate form fields and the semantic elements; An indirect mapping relationship between the input and the variable is established based on the parameter expression.
[0009] In one optional implementation, the step of initiating a request to the data source configuration entity based on the input parameter value, and updating the optional enumeration item list composed of the enumeration items of the first form field based on the data returned by the request, includes: A request is sent to the data source configuration entity based on the input parameter value. If the request fails, the list of optional enumeration items consisting of the enumeration items of the first form field is retained, and an alarm message is generated. The alarm message includes the field identifier of the request. If the request is successful, the list of optional enumeration items, consisting of the enumeration items of the first form field, is updated based on the data returned by the request.
[0010] In an alternative implementation, after updating the list of optional enumeration items consisting of the enumeration items of the first form field based on the data returned by the request, the method further includes: Detect whether the user has performed a historical selection operation on any of the enumeration items in the list of optional enumeration items, and obtain the detection result; Based on the detection results, a consistency check is performed on the updated list of optional enumeration items.
[0011] In one optional implementation, the consistency check of the updated optional enumeration list based on the detection result includes: If the detection result indicates that the user has performed the historical selection operation on any of the enumeration items in the list of optional enumeration items, then the enumeration item on which the user performed the historical selection operation is determined as the target enumeration item. Obtain the change in the input parameter value of the target enumeration item, and resend the request to the data source configuration entity based on the change in the input parameter value; Receive the target enumeration item list returned by the request, and determine whether the target enumeration item is contained in the target enumeration item list; If not, then the target enumeration item is removed from the list of optional enumeration items; if yes, then the list of optional enumeration items is determined to have passed the consistency check.
[0012] In an optional implementation, the consistency check of the updated optional enumeration item list based on the detection result further includes: If the detection result indicates that the user has not performed the historical selection operation on any of the enumeration items in the optional enumeration item list, and the first form field has enabled the default selection configuration, then the first enumeration item in the optional enumeration item list will be used as the target enumeration item. Obtain the change in the input parameter value of the target enumeration item, and resend the request to the data source configuration entity based on the change in the input parameter value; Receive the target enumeration item list returned by the request, and determine whether the target enumeration item is contained in the target enumeration item list; If not, then the target enumeration item is removed from the list of optional enumeration items; if yes, then the list of optional enumeration items is determined to have passed the consistency check.
[0013] Secondly, the present invention provides a configuration device for a visual interface, the device comprising: The field acquisition module is used to acquire the initial form fields of the form in the visualization interface, declare type constraint information for the initial form fields, and obtain the first form field; The entity configuration module is used to run the form based on the first form field, obtain the enumeration items of the form at runtime, configure the data source configuration entity of the enumeration items, and obtain the input parameter definition of the data source configuration entity. The mapping and association module is used to map and associate the input parameters of the data source configuration entity with the variables in the form according to the input parameter definition, so as to obtain the mapping relationship between the input parameters and the variables. The enumeration item update module is used to obtain the input parameter value corresponding to the input parameter in real time according to the mapping relationship when rendering the form, and to send a request to the data source configuration entity based on the input parameter value, and update the optional enumeration item list composed of the enumeration items of the first form field based on the data returned by the request.
[0014] Thirdly, the present invention provides an electronic device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the configuration method of the visual interface of the first aspect or any corresponding embodiment described above.
[0015] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the configuration method of the visual interface of the first aspect or any corresponding embodiment described above.
[0016] Fifthly, the present invention provides a computer program product, including computer instructions, which are used to configure a computer to execute a visual interface of the first aspect or any corresponding embodiment described above. Attached Figure Description
[0017] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating a method for configuring a visual interface according to an embodiment of the present invention; Figure 2 This is a structural block diagram of a configuration device for a visual interface according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.
[0021] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0022] Low-code development platforms are becoming increasingly popular due to their ability to significantly lower the development threshold and improve application building efficiency, and are widely used for the rapid construction of various business forms and data interaction scenarios. To implement optional value configuration for form fields, low-code development platforms generally adopt methods such as pre-setting static enumeration items or binding fixed data source configuration entities. Specifically, developers or business configurers typically define a fixed list of options for form components such as dropdowns and radio buttons during the design phase, or simply associate them with a predefined data query interface with fixed parameters.
[0023] However, this approach struggles to support dynamic enumeration items that need to change in real time and be retrieved asynchronously based on the form context. When an enumeration item request requires parameters, it is impossible to intuitively and flexibly complete the mapping configuration and logical definition between the request parameters and other dynamic variables in the form within the visual interface. When the form is running, it is impossible to automatically update the enumeration items based on changes in parameter mapping relationships and enumeration data triggered by parameter changes, resulting in reduced development efficiency and rigid business logic.
[0024] Based on this, the present invention provides an embodiment of a configuration method for a visual interface. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0025] This embodiment provides a method for configuring a visual interface. Figure 1 This is a flowchart of a method for configuring a visual interface according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps: Step S101: Obtain the initial form fields of the form in the visualization interface, declare type constraint information for the initial form fields, and obtain the first form field.
[0026] Step S102: Run the form based on the first form field, obtain the enumeration items of the form at runtime, configure the data source configuration entity of the enumeration items, and obtain the input parameter definition of the data source configuration entity.
[0027] Step S103: Based on the input parameter definition, map and associate the input parameters of the data source configuration entity with the variables in the form to obtain the mapping relationship between the input parameter variables.
[0028] Step S104: When rendering the form, the input parameter value corresponding to the input parameter is obtained in real time according to the mapping relationship, and a request is sent to the data source configuration entity based on the input parameter value. The optional enumeration item list composed of the enumeration items of the first form field is updated based on the data returned by the request.
[0029] The visualization interface configuration method provided in this embodiment obtains the initial form fields of the form in the visualization interface, declares type constraint information for the initial form fields to obtain the first form fields; runs the form based on the first form fields, and obtains the enumeration items of the form at runtime, configures the data source configuration entity of the enumeration items to obtain the input parameter definition of the data source configuration entity; maps and associates the input items of the data source configuration entity with the variables in the form according to the input parameter definition to obtain the mapping relationship between the input items and the variables; when rendering the form, obtains the input parameter value corresponding to the input parameter in real time according to the mapping relationship, and sends a request to the data source configuration entity according to the input parameter value; updates the optional enumeration item list composed of the enumeration items of the first form fields based on the data returned by the request. This invention allows users to declare the enumeration data type and flexibly bind the dynamic data source configuration entity during configuration. Through the mapping relationship between the input items and the variables, the optional enumeration list of the form fields can be updated when the form is run, thereby solving the technical defects of traditional low-code platforms where form configuration depends on static enumeration items and cannot flexibly request and update data according to parameters.
[0030] For step S101, the initial form fields of the form in the visualization interface are obtained, and type constraint information is declared for the initial form fields to obtain the first form field.
[0031] In existing technologies, the final value type of fields is typically implicitly agreed upon by developers in the business code, but this crucial type information is completely hidden in the field configuration interface. This prevents later maintenance personnel from intuitively understanding the data contract of the fields from the configuration level. Furthermore, it easily leads to hidden errors, such as unexpected data type conversions or mismatches during data transfer. These errors often only surface at runtime or even after data submission, resulting in high debugging costs. Finally, the lack of explicit, machine-readable type definitions prevents the provision of intelligent assistance and security checks for more advanced configurations.
[0032] Therefore, this embodiment explicitly declares the enumeration attributes of form fields in the visual configuration interface. Specifically, when creating or editing the initial form fields in a form, in addition to filling in basic information such as field labels and codes, type constraint information is explicitly declared for the dynamic enumeration items to be used, resulting in the first form field. In this embodiment, the type constraint information includes the enumeration value data type and the return structure type.
[0033] The enumeration value data type refers to the data unit format (ValueType) that constitutes the actual value (Value) in the enumeration item. In this embodiment, it can include basic types such as strings and numbers. For example, it can be configured as ValueType=1 to represent the string type and ValueType=2 to represent the number type. The returned structure type refers to the data organization format returned by the data source configuration entity interface for constructing the enumeration item list, in order to adapt to the data format restrictions of different form controls such as drop-down selection boxes, cascading selectors, or tree selectors.
[0034] This embodiment ensures that the final output type of fields conforms to the declared type by declaring enumerated value data type constraints on the fields, regardless of the original data returned by the data source configuration entity. Secondly, when configuring the output mapping rules of the data source configuration entity, declaring enumerated value data type constraints on the mapping type of enumerated items guides how to correctly map the original fields returned by the interface to display labels recognizable by front-end controls and actual values with type safety guarantees. More importantly, when the input parameters for the data source configuration entity request are processed from other field values through parameter expressions, declaring the return structure type provides clear type boundaries for the generation and validation of parameter expressions. This elevates data types, originally hidden in the code, to a visible configuration metadata layer, enhancing the transparency and maintainability of the configuration, achieving end-to-end type constraints on the data flow, and fundamentally reducing runtime errors caused by implicit type conventions.
[0035] For step S102, the form is run based on the first form field, and the enumeration items of the form are obtained at runtime. The data source configuration entity of the enumeration items is configured to obtain the input parameter definition of the data source configuration entity.
[0036] In existing technologies, developers are required to write specific request code logic, and the binding relationship between the data enumeration interface required for form fields and the data source configuration entity configuration code is hard-coded in the program. This makes it impossible for configuration personnel to flexibly switch or select different data source configuration entities according to business needs.
[0037] Therefore, in this embodiment, the simulated run or preview of the form is triggered in the design state of the low-code platform based on the first form field whose type declaration has been completed. When it is necessary to configure the source of its runtime dynamic enumeration item for the first form field, the data source configuration entity of the enumeration item is configured.
[0038] Specifically, a predefined data source configuration entity configuration code from the server is assigned to the current first form field. This data source configuration entity configuration code uniquely points to a separately managed data source configuration entity. Through the mapping relationship between the data source configuration entity configuration code and the data source configuration entity, the first form field will automatically inherit the input parameter definitions of the data source configuration entity, including but not limited to the data source configuration entity type, input parameter declarations, and output mapping rules.
[0039] The data source configuration entity refers to the standardized interface metadata definition that is independently stored and managed in the backend of the low-code platform. It is used to abstract data services that can provide enumerated data into parameterized configuration templates that can be reused by front-end form fields.
[0040] Next, based on the inherited input parameter declarations, the value of each input parameter is configured, that is, the assignment rules are defined; and the data type of the enumeration value of the first form field is specified, thereby realizing the separation of interface definition and parameter assignment logic.
[0041] Therefore, this embodiment decouples the form front-end configuration from the back-end data interface by binding the data source configuration entity, thereby enabling independent and flexible selection and replacement of the dynamically enumerated data source configuration entity for form fields, enhancing configuration autonomy. Moreover, by inheriting predefined interfaces, it ensures the standardization and consistency of data interaction and eliminates errors that may be introduced by manually writing request code.
[0042] For step S103, the variables in the form of the input parameters of the data source configuration entity are mapped and associated according to the input parameter definition to obtain the mapping relationship between the input parameter variables.
[0043] In existing technologies, the source of input parameter values is usually limited to hard-coded constants or direct reference to the original value of a form field; once any processing of the field value is required, the corresponding data processing logic must be manually written in the code, resulting in deep coupling between configuration and code, cumbersome changes and easy errors.
[0044] In this embodiment, the input parameter definition includes the data source configuration entity type, input parameter declaration, and output mapping rules of the data source configuration entity. Based on the input parameter definition, the input parameters of the data source configuration entity are mapped and associated with the variables in the form, including: reading the input parameter declaration of the data source configuration entity, extracting available variables from the form to construct a variable candidate set, the variable candidate set containing at least candidate form fields other than the currently configured first form field; selecting the variables corresponding to the candidate form fields from the variable candidate set to establish a direct mapping relationship, or to establish an indirect mapping relationship based on parameter expressions.
[0045] Specifically, in this embodiment, the input parameter definition defined by the data source configuration entity includes the data source configuration entity type, input parameter declarations, and data output mapping rules. Mapping configuration is performed based on the input parameter definitions. Specifically, the input parameter declarations in the data source configuration entity are first read, and then available variables that can be used for assignment are scanned and extracted from the currently configured form to construct a variable candidate set. The variable candidate set specifically refers to the set of context elements that can provide valid data during form runtime. It contains at least all candidate form fields except for the first form field of the currently configured dynamic enumeration item, thereby avoiding circular dependencies and self-referencing errors.
[0046] After constructing the variable candidate set, a mapping relationship is established for each input parameter, including direct mapping relationships and indirect mapping relationships based on parameter expressions. Specifically, the input parameter declaration is analyzed, and a mappability determination is performed. If the data type required by a certain input parameter is completely consistent with the data type of a candidate form field in the variable candidate set, and the assignment process requires no additional data processing (e.g., the input parameter requires a string type, and the value of the candidate field is itself a string), then establishing a direct mapping relationship is allowed and recommended. That is, the value of the input parameter will directly reference the value of the matched form field at runtime. Conversely, if the input parameter value requires processing such as truncation, concatenation, calculation, or format conversion of the candidate form field value to obtain the target input parameter value, then an indirect mapping relationship must be established by configuring parameter expressions. The parameter expressions define the conversion logic from the source field value to the target input parameter value. For example, if the input parameter expenseType is a string and the form contains a field B that is also a string, a direct mapping can be established; if the input parameter orgPrefix needs to obtain the first 6 digits of its organization code, and the source field A is a complete organization code string, then an expression such as LEFT(fieldA,6) needs to be configured to complete the indirect mapping.
[0047] A parameter expression is a set of predefined or extensible rules for transforming and operating on data, enabling complex parameter value generation logic to be implemented by combining functions and field variables without writing underlying code.
[0048] Therefore, this embodiment achieves flexible definition within a visual interface by introducing automated variable candidate set construction and mapping determination. Through built-in expression capabilities, it supports complex parameter processing requirements, thereby enabling the description of arbitrary parameter logic needed for dynamic enumeration item requests and improving configuration flexibility.
[0049] In one embodiment, when establishing an indirect mapping relationship based on expressions, the user's input natural language description is obtained, semantic parsing is performed on the natural language description to extract semantic elements related to form field operations, and the target field of the semantic elements is obtained; the target field is matched with candidate form fields in the variable candidate set, and the successfully matched candidate form fields are filtered out; a preset expression template is called, and a parameter expression is generated in the expression template based on the successfully matched candidate form fields and semantic elements; an indirect mapping relationship between input and parameter variables is established based on the parameter expression.
[0050] Specifically, when a user selects the automatically generated path, the system obtains the user's input in natural language and extracts the user's parameter value intent from the natural language description. For example, if the input is "extract the first 6 digits of the organization code as the reimbursement subject query condition", the system performs semantic parsing on the natural language description, identifying and extracting semantic elements related to data operations from the user's input text. Semantic elements include, but are not limited to, target field semantics, operation intent, and parameter constraint information. Among them, target field semantics indicates which data object to operate on, such as "organization code", operation intent indicates what kind of processing to perform, such as "extract the first N digits", and parameter constraint information indicates the specific parameters of the operation, such as "first 6 digits".
[0051] Next, the extracted target field semantics are matched against a pre-built variable candidate set. This candidate set excludes the field currently being configured, effectively preventing circular dependencies. During matching, the data type of the candidate field is verified to support the operation intent; for example, the "truncation" operation requires the source field to be a string or similar type. The validity of parameter constraints is also verified; for example, is "6" a valid number for the truncation length? If a match fails or any verification fails, the process terminates with a clear message to prevent the generation of invalid or incorrect configurations.
[0052] After successful matching and validation, based on the operation intent, a template matching the function description is selected from a pre-set expression function template library. For example, for the operation intent of "truncating the first N digits", the LEFT or SUBSTRING function template is selected. Next, the paths and parameter values of the successfully matched candidate form fields are used as actual parameters and filled into the corresponding positions of the template to synthesize a parameter expression. The parameter expression is then used to establish an indirect mapping relationship between the input parameters and form variables.
[0053] In addition, this embodiment also allows users to directly select candidate form fields from the variable candidate set and select templates from the preset expression function template library. The selected candidate form field path and parameter value are used as actual parameters and filled into the corresponding position of the template to synthesize a parameter expression. The parameter expression is used to establish an indirect mapping relationship between input parameters and form variables.
[0054] This embodiment combines natural language parsing, structured semantic matching, type safety verification, and expression template synthesis to lower the technical threshold for complex parameter processing logic in dynamic enumeration item configuration. This allows users to directly participate in configuration using natural language they are familiar with. At the same time, strict automated verification ensures the accuracy and security of the generated results, improving the configuration efficiency and flexibility of the low-code platform in complex business scenarios.
[0055] Furthermore, in existing technologies, the validation of expressions or mapping configurations is usually limited to syntax validation, i.e., checking whether the expression format is correct, while semantic and logical validation is lacking. Potential errors in the configuration, such as type mismatches, out-of-bounds function parameters, and business logic errors, can only be exposed during user operations, leading to difficulties in problem localization, long repair cycles, impaired user experience, and high trial-and-error and maintenance costs.
[0056] Therefore, in this embodiment, mock input data, or Mock data, is provided for the source form fields upon which the parameter expressions depend. Mock input data indicates sample data constructed for testing purposes to simulate real runtime values. Mock input data can be obtained in two ways: by automatically generating generic samples based on the data type declared in the fields; or by having the user input representative sample values that are closer to the actual scenario.
[0057] After acquiring simulated input data, the parameter expression to be validated is executed, followed by multi-dimensional validation. First, exception and null value validation is performed to confirm that the parameter expression completes calculation correctly without throwing runtime exceptions and that the result is not null. Second, type compatibility validation is performed, comparing the data type of the parameter expression's calculation result with the type required by the data source input parameter declaration for the simulated input data to ensure a perfect match; for example, if the input parameter requires a string, the result must also be a string. Finally, business logic rationality validation is performed, applying business rules to the parameter expression's calculation result based on the specific operational intent; for example, for the "truncate the first 6 characters" operation, the validated result string length must be exactly 6. Only after all the above validation levels pass can the current configuration scheme be saved.
[0058] Therefore, this test performs multi-dimensional validation on the parameter expressions to be validated after simulating input data. It can proactively discover and intercept configuration defects that are syntactically correct but logically incorrect or type incompatible before the configuration is saved, reducing the risk of runtime failures caused by configuration errors and fundamentally reducing the trial and error costs of later debugging and maintenance, thus ensuring the reliability of applications delivered by the low-code platform.
[0059] Regarding step S104, when rendering the form, the input parameter values corresponding to the input parameters are obtained in real time according to the mapping relationship, and a request is sent to the data source configuration entity based on the input parameter values. The list of optional enumeration items composed of the enumeration items of the first form field is updated based on the data returned by the request.
[0060] In existing technologies, the request triggering logic, dependency listening, and exception handling for dynamic enumerations are typically implemented by users in a scattered, single-point manner within their business code. Exception handling is often crude, either throwing simple errors that render the current field or even the entire page unusable, or lacking consistent user prompts, causing problems to be silently ignored, resulting in poor user experience and difficulty in troubleshooting.
[0061] Therefore, in this embodiment of the invention, initiating a request to the data source configuration entity based on the input parameter value, and updating the optional enumeration item list composed of the enumeration items of the first form field based on the data returned by the request, includes: initiating a request to the data source configuration entity based on the input parameter value; if the request fails, retaining the current optional enumeration item list composed of the enumeration items of the first form field and generating alarm information, the alarm information containing the field identifier of the request; if the request succeeds, updating the optional enumeration item list composed of the enumeration items of the first form field based on the data returned by the request.
[0062] Specifically, during configuration saving, users can configure request preconditions for the first form field. These preconditions are typically defined in the field metadata, such as requiring certain dependent form fields to have values, thus ensuring that requests are initiated at the appropriate time. Next, the source fields that all input parameter mappings depend on are extracted, forming a dependency monitoring list. During form runtime, changes in the values of dependent fields associated with the input parameter mappings of the data source configuration entity are monitored in real time. Dependent fields do not include the first form field itself. When a change in the value of any dependent field is detected, the corresponding input parameter value is recalculated based on the latest value after the change, and a request is initiated to the data source configuration entity based on the recalculated input parameter value to update the optional enumeration list composed of the enumeration items of the first form field.
[0063] When a request fails due to network or server errors, the overall operation of the form is not interrupted, and the current enumeration list items of the first form field are retained, allowing the user to select from the existing options in the enumeration list items. This prevents the first form field from becoming completely unusable due to temporary failures. Furthermore, a request failure message is generated, which at least includes the identifier of the field where the request failed, to quickly locate the problem.
[0064] This embodiment achieves real-time updates of enumerated data through dependency listening, ensuring that the front-end application can still maintain maximum availability and maintainability when some services are unstable.
[0065] In existing technologies, validation logic is typically written to filter invalid values when field values change, and logic is written to automatically select the first item when the enumeration list is updated. This scattered, hard-coded approach is not only inefficient in development, but also prone to data errors or interaction problems due to logical omissions or inconsistencies.
[0066] Therefore, in this embodiment, after updating the list of optional enumeration items composed of the enumeration items of the first form field based on the data returned by the request, it is detected whether the user has performed a historical selection operation on any enumeration item in the list of optional enumeration items, and the detection result is obtained; the updated list of optional enumeration items is then checked for consistency based on the detection result.
[0067] If the detection result indicates that the user has performed a historical selection operation on any enumeration item in the optional enumeration item list, then the enumeration item on which the user performed the historical selection operation is determined as the target enumeration item; the change in the input parameter value of the target enumeration item is obtained, and a new request is sent to the data source configuration entity based on the change in the input parameter value; the target enumeration item list returned by the request is received, and it is determined whether the target enumeration item is contained in the target enumeration item list; if not, the target enumeration item is cleared from the optional enumeration item list; if yes, the optional enumeration item list is determined to have passed the consistency check.
[0068] Specifically, if a user has previously selected a value from the optional enumeration list, that value becomes the target enumeration item. When a change in the dependent input parameters necessitates a new request for and retrieval of the target enumeration list, it is determined whether the new target optional enumeration list still contains the target enumeration item. If the previously selected target enumeration item is no longer in the target optional enumeration list, it is removed from the optional enumeration item list, thus ensuring that the submitted data always originates from the latest and valid enumeration set, preventing the submission of invalid or outdated data.
[0069] If the detection result indicates that the user did not perform a historical selection operation on any enumeration item in the optional enumeration item list, and the first form field has the default selection configuration enabled, then the first enumeration item in the optional enumeration item list is taken as the target enumeration item; the change of the input parameter value of the target enumeration item is obtained, and a new request is sent to the data source configuration entity based on the change of the input parameter value; the target enumeration item list returned by the request is received, and it is determined whether the target enumeration item is contained in the target enumeration item list; if not, the target enumeration item is cleared from the optional enumeration item list; if yes, the optional enumeration item list is determined to have passed the consistency check.
[0070] Specifically, if a user does not select a value from the previous optional enumeration list, and if the administrator of the visualization interface has enabled the default selection function for the first form field during configuration, and the first form field is currently in an editable state, then after obtaining the new target optional enumeration list, the first item in the optional enumeration list will be set as the target enumeration item for the first form field. If the target enumeration item is no longer in the target optional enumeration list, then the target enumeration item will be removed from the optional enumeration item list, thereby ensuring that the submitted data always comes from the latest and valid enumeration set, preventing the submission of invalid or outdated data.
[0071] Therefore, this embodiment fundamentally eliminates the risk of submitting invalid data due to changes in the data source by validating the data, thus ensuring the accuracy and reliability of business data. On the other hand, the optional default selection function optimizes the user's initialization experience when filling out the form, thereby enhancing user satisfaction.
[0072] This embodiment also provides a configuration device for a visual interface, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0073] This embodiment provides a configuration device with a visual interface, such as Figure 2 As shown, it includes: The field acquisition module 201 is used to obtain the initial form fields of the form in the visualization interface, declare type constraint information for the initial form fields, and obtain the first form field.
[0074] The entity configuration module 202 is used to run the form based on the first form field, obtain the enumeration items of the form at runtime, configure the data source configuration entity of the enumeration items, and obtain the input parameter definition of the data source configuration entity.
[0075] The mapping and association module 203 is used to map and associate the input parameters of the data source configuration entity with the variables in the form according to the input parameter definition, so as to obtain the mapping relationship between the input parameter variables.
[0076] The enumeration item update module 204 is used to obtain the input parameter value corresponding to the input parameter in real time according to the mapping relationship when rendering the form, and to send a request to the data source configuration entity based on the input parameter value, and update the optional enumeration item list composed of the enumeration items of the first form field based on the data returned by the request.
[0077] In some optional implementations, the input parameter definition includes the data source configuration entity type, input parameter declaration, and output mapping rules of the data source configuration entity. The mapping association module 203 is specifically used to read the input parameter declaration of the data source configuration entity, extract available variables from the form to construct a variable candidate set, the variable candidate set containing at least candidate form fields other than the currently configured first form field; and select variables corresponding to the candidate form fields from the variable candidate set to establish a direct mapping relationship or establish an indirect mapping relationship based on parameter expressions.
[0078] In some optional implementations, the mapping and association module 203 is specifically used to obtain the natural language description input by the user; perform semantic parsing on the natural language description to extract semantic elements related to form field operations in the natural language description, and obtain the target field of the semantic elements; match the target field with the candidate form fields in the variable candidate set, and filter out the successfully matched candidate form fields; call a preset expression template, and generate a parameter expression in the expression template based on the successfully matched candidate form fields and semantic elements; and establish an indirect mapping relationship between the input and parameter variables based on the parameter expression.
[0079] In some optional implementations, the enumeration item update module 204 is specifically used to initiate a request to the data source configuration entity based on the input parameter value. If the request fails, the current list of optional enumeration items composed of the enumeration items of the first form field is retained, and an alarm message is generated, which includes the field identifier of the request. If the request succeeds, the list of optional enumeration items composed of the enumeration items of the first form field is updated based on the data returned by the request.
[0080] In some alternative implementations, after the enumeration item update module 204, the apparatus further includes: The verification module is used to detect whether the user has performed a historical selection operation on any enumeration item in the list of optional enumeration items, and obtain the detection result; based on the detection result, the updated list of optional enumeration items is checked for consistency.
[0081] In some optional implementations, the verification module includes: The first verification unit is used to determine the enumeration item for which the user performed a historical selection operation as the target enumeration item if the detection result indicates that the user has performed a historical selection operation on any enumeration item in the list of optional enumeration items; obtain the change of the input parameter value of the target enumeration item, and re-send a request to the data source configuration entity based on the change of the input parameter value; receive the target enumeration item list returned by the request, and determine whether the target enumeration item list contains the target enumeration item; if not, remove the target enumeration item from the list of optional enumeration items; if yes, determine that the list of optional enumeration items has passed the consistency check.
[0082] The second verification unit is used to determine the first enumeration item in the optional enumeration item list as the target enumeration item if the detection result indicates that the user has not performed a historical selection operation on any enumeration item in the optional enumeration item list and the first form field has the default selection configuration enabled; obtain the change of the input parameter value of the target enumeration item, and re-send a request to the data source configuration entity based on the change of the input parameter value; receive the target enumeration item list returned by the request, and determine whether the target enumeration item list contains the target enumeration item; if not, remove the target enumeration item from the optional enumeration item list; if yes, determine that the optional enumeration item list has passed the consistency check.
[0083] The configuration device for the visual interface provided in this embodiment of the invention can execute the configuration method for the visual interface provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method execution. Further functional descriptions of the various modules and units described above are the same as in the corresponding embodiments described above, and will not be repeated here.
[0084] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.
[0085] The following is a detailed reference. Figure 3 The diagram illustrates a structural schematic suitable for implementing an electronic device according to embodiments of the present invention. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 301, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 302 or a program loaded from memory 308 into random access memory (RAM) 303. The RAM 303 also stores various programs and data required for the operation of the electronic device. The processor 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0086] Typically, the following devices can be connected to I / O interface 305: input devices 306 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 307 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 308 including, for example, magnetic tapes, hard disks, etc.; and communication devices 309. Communication device 309 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.
[0087] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 309, or installed from a memory 308, or installed from a ROM 302. When the computer program is executed by the processor 301, it performs the functions defined in the configuration method of the visual interface of the embodiments of the present invention.
[0088] Figure 3 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of the present invention.
[0089] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the configuration method of the visual interface shown in the above embodiments is implemented.
[0090] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0091] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for configuring a visual interface, characterized in that, The method includes: Obtain the initial form fields of the form in the visualization interface, declare type constraint information for the initial form fields, and obtain the first form field; The form is run based on the first form field, and the enumeration items of the form at runtime are obtained. The data source configuration entity of the enumeration items is configured to obtain the input parameter definition of the data source configuration entity. Based on the input parameter definition, the input parameters of the data source configuration entity are mapped and associated with the variables in the form to obtain the mapping relationship between the input parameters and the variables; When rendering the form, the input parameter value corresponding to the input parameter is obtained in real time according to the mapping relationship, and a request is sent to the data source configuration entity based on the input parameter value. The optional enumeration item list composed of the enumeration items of the first form field is updated based on the data returned by the request.
2. The method according to claim 1, characterized in that, The input parameter definition includes the data source configuration entity type, input parameter declaration, and output mapping rules of the data source configuration entity. Mapping and associating the input parameters of the data source configuration entity with the variables in the form based on the input parameter definition includes: Read the input parameter declaration of the data source configuration entity, extract available variables from the form to construct a variable candidate set, the variable candidate set containing at least candidate form fields other than the currently configured first form field; Select the variable corresponding to the candidate form field from the variable candidate set to establish a direct mapping relationship, or establish an indirect mapping relationship based on parameter expressions.
3. The method according to claim 2, characterized in that, The establishment of the indirect mapping relationship based on the expression includes: Obtain a natural language description from user input; Semantic parsing is performed on the natural language description to extract semantic elements related to form field operations in the natural language description, and the target fields of the semantic elements are obtained; The target field is matched with the candidate form fields in the variable candidate set, and the successfully matched candidate form fields are filtered out. Invoke a preset expression template, and generate a parameter expression in the expression template based on the successfully matched candidate form fields and the semantic elements; An indirect mapping relationship between the input and the variable is established based on the parameter expression.
4. The method according to claim 1, characterized in that, The step of initiating a request to the data source configuration entity based on the input parameter value, and updating the optional enumeration item list composed of the enumeration items of the first form field based on the data returned by the request, includes: A request is sent to the data source configuration entity based on the input parameter value. If the request fails, the list of optional enumeration items consisting of the enumeration items of the first form field is retained, and an alarm message is generated. The alarm message includes the field identifier of the request. If the request is successful, the list of optional enumeration items, consisting of the enumeration items of the first form field, is updated based on the data returned by the request.
5. The method according to claim 1, characterized in that, After updating the list of optional enumeration items consisting of the enumeration items of the first form field based on the data returned by the request, the method further includes: Detect whether the user has performed a historical selection operation on any of the enumeration items in the list of optional enumeration items, and obtain the detection result; Based on the detection results, a consistency check is performed on the updated list of optional enumeration items.
6. The method according to claim 5, characterized in that, The consistency check of the updated list of optional enumeration items based on the detection results includes: If the detection result indicates that the user has performed the historical selection operation on any of the enumeration items in the list of optional enumeration items, then the enumeration item on which the user performed the historical selection operation is determined as the target enumeration item. Obtain the change in the input parameter value of the target enumeration item, and resend the request to the data source configuration entity based on the change in the input parameter value; Receive the target enumeration item list returned by the request, and determine whether the target enumeration item is contained in the target enumeration item list; If not, then the target enumeration item is removed from the list of optional enumeration items; if yes, then the list of optional enumeration items is determined to have passed the consistency check.
7. The method according to claim 5, characterized in that, The consistency check of the updated list of optional enumeration items based on the detection results further includes: If the detection result indicates that the user has not performed the historical selection operation on any of the enumeration items in the optional enumeration item list, and the first form field has enabled the default selection configuration, then the first enumeration item in the optional enumeration item list will be used as the target enumeration item. Obtain the change in the input parameter value of the target enumeration item, and resend the request to the data source configuration entity based on the change in the input parameter value; Receive the target enumeration item list returned by the request, and determine whether the target enumeration item is contained in the target enumeration item list; If not, then the target enumeration item is removed from the list of optional enumeration items; if yes, then the list of optional enumeration items is determined to have passed the consistency check.
8. A configuration device with a visual interface, characterized in that, The device includes: The field acquisition module is used to acquire the initial form fields of the form in the visualization interface, declare type constraint information for the initial form fields, and obtain the first form field; The entity configuration module is used to run the form based on the first form field, obtain the enumeration items of the form at runtime, configure the data source configuration entity of the enumeration items, and obtain the input parameter definition of the data source configuration entity. The mapping and association module is used to map and associate the input parameters of the data source configuration entity with the variables in the form according to the input parameter definition, so as to obtain the mapping relationship between the input parameters and the variables. The enumeration item update module is used to obtain the input parameter value corresponding to the input parameter in real time according to the mapping relationship when rendering the form, and to send a request to the data source configuration entity based on the input parameter value, and update the optional enumeration item list composed of the enumeration items of the first form field based on the data returned by the request.
9. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the configuration method of the visual interface according to any one of claims 1 to 7.
10. A computer program product, characterized in that, It includes computer instructions for causing a computer to execute the configuration method of the visual interface according to any one of claims 1 to 7.