Form generation method and device, readable storage medium and computer program product
By obtaining and processing the configuration files and linkage logic information of the form components, automatically adjusting the interaction status and content of the form components, the problem of complexity and maintenance difficulty of dynamic form interaction functions in the existing technology is solved, and development efficiency and user experience are improved .
Patent Information
- Application Number
- CN202411154387.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-12-13
AI Technical Summary
In the prior art, the implementation of dynamic interactive functions of forms requires developers to manually write complex logical code, resulting in large amount of code, chaotic structure, difficult maintenance and expansion, and high linkage error rate, affecting user experience.
By obtaining the configuration file of the form component, calling the form model to render the initial form, and generating a processing model based on the linkage logic information, automatically adjusting the interaction status and content of the associated components in response to changes in the fill data, and dynamic form updates are achieved.
It significantly reduces the amount of linkage code written by developers, improves the flexibility of maintaining and scaling of forms, reduces the linkage error rate, and improves the user's filling experience.
Smart Images

Figure CN119129552A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of form management, and in particular to a form generation method, a computer device, a readable storage medium, and a computer program product. Background Art
[0002] The form is the key interface for data exchange between users and the system. With the diversification of business needs, form design is becoming increasingly complex, and it is usually necessary to implement dynamic interaction functions, that is, some components in the form are updated in real time depending on the changes of other components. For example, when a user selects a province on the registration interface, the city list component corresponding to the province will be displayed; for another example, when a user selects different product categories, the price range component will be adjusted accordingly.
[0003] In related technologies, if you want to implement the dynamic interaction function of the form, you need to write logic code for the relationship between each form item one by one. However, this will increase the amount of code written by the developer, and when changing the form items, it will also cause confusion in the code structure, which is not conducive to the maintenance and expansion of the form and reduces development efficiency. If the logic code of the form item deviates, then when the user fills in the form, there will be linkage errors, affecting the user's filling experience. Summary of the invention
[0004] In order to solve one of the above technical problems, the present disclosure provides a form generation method, a computer device, a readable storage medium and a computer program product.
[0005] According to one aspect of the present disclosure, a method for generating a form is provided, comprising: obtaining a configuration file about each form component, the configuration file comprising control structure information and linkage logic information of the form component; calling a form model to render the corresponding form component according to the configuration file, generating an initial form that displays or enables at least part of the form component, the initial form displays, hides, enables or disables the corresponding form component according to the initial interaction state in the control structure information; generating a processing model for determining a target interaction state and initial content of the form component according to the linkage logic information in each of the configuration files; and in response to changed fill data in the initial form, triggering the processing model to determine an associated component corresponding to the fill data and its target interaction state and initial content, generating a target form, the associated component presenting the initial content in the target form with the target interaction state.
[0006] In some embodiments, the calling form model renders the corresponding form components according to the configuration file to generate an initial form that displays or enables at least some of the form components, including: calling the form model to render the form components according to the configuration file, the control structure information of the configuration file including the control type, name, location index, initial content and the initial interaction state; classifying each of the form components into a corresponding component container according to the control type; based on the initial interaction state, displaying, hiding, enabling or disabling the corresponding form components to form the initial form that includes a plurality of the component containers and displays or enables at least some of the form components.
[0007] In some embodiments, the processing model for determining the target interaction state and the initial content of the form component is generated according to the linkage logic information in each of the configuration files, including: configuring a monitoring unit, the monitoring unit being used to monitor the changes of the fill data in the form component associated with the linkage logic information; configuring a conditional expression, the conditional expression being used to filter the associated components that use the changes of the fill data as the linkage timing in the multiple linkage logic information, and matching the target interaction state and the initial content that are suitable for the fill data for the associated components; and configuring an execution unit, the execution unit being used to adjust the associated component to the target interaction state, and control the associated component to display the initial content.
[0008] In some embodiments, configuring the conditional expression includes: integrating multiple linkage logic information to form multiple linkage sets including associated components, linkage timing, target interaction status and initial content; configuring a processing type and a processing function suitable for the processing type for the conditional expression, including: when the conditional expression is a function type, configuring a first processing function for the conditional expression; or, when the conditional expression is a string type, configuring a linkage expression and a second processing function for the conditional expression, and the processing types include function type, string type, Boolean type and array type.
[0009] In some embodiments, in response to the change in the filled data in the initial form, the processing model is triggered to determine the associated component corresponding to the filled data, its target interaction state and the initial content, and generate a target form, including: calling the conditional expression to determine the associated component in the linkage set with the change of the filled data as the linkage timing, as well as the target interaction state and the initial content of the associated component; calling the execution unit to adjust the associated component to the target interaction state, and present the initial content, to obtain the target form.
[0010] In some embodiments, the calling of the conditional expression to determine the associated component in the linkage set with the occurrence of the change of the fill data as the linkage timing, as well as the target interaction state and the initial content of the associated component, includes: when the conditional expression is a function type, calling the first processing function to analyze the fill data and the linkage set, and determining the associated component, the target interaction state, and the initial content that match the fill data; or, when the conditional expression is a string type, determining whether the linkage expression contains a start identifier and a pointing identifier; if the linkage expression includes the start identifier and the pointing identifier, extracting the expression body of the linkage expression, and converting the expression body into a target expression using the fill data and the linkage set; calling the second processing function to analyze the target expression, and determining the associated component, the target interaction state, and the initial content that match the fill data.
[0011] In some implementations, the method further includes: constructing a configuration structure, wherein the configuration structure is used to constrain the content and format of the configuration file.
[0012] According to another aspect of the present disclosure, a computer device is provided, comprising: a memory storing execution instructions; and a processor executing the execution instructions stored in the memory, so that the processor executes the form generation method of any of the above-mentioned embodiments.
[0013] According to another aspect of the present disclosure, a readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, it is used to implement the form generation method as described in any of the above embodiments.
[0014] According to another aspect of the present disclosure, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, it is at least used to implement the form generation method as described in any of the above embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The accompanying drawings illustrate exemplary embodiments of the present disclosure and together with the description serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.
[0016] Figure 1 It is a schematic diagram of an application scenario of the form generation method according to an embodiment of the present disclosure.
[0017] Figure 2 It is a schematic diagram of the architecture of a method for generating a form according to an embodiment of the present disclosure.
[0018] Figure 3 It is a schematic diagram of the rendering process of the initial form according to an embodiment of the present disclosure.
[0019] Figure 4 It is a schematic diagram of the working process of the processing model according to the embodiment of the present disclosure.
[0020] Figure 5 It is a flow chart of a method for generating a form according to an embodiment of the present disclosure.
[0021] Figure 6 It is a block diagram of a form generation device according to an embodiment of the present disclosure.
[0022] Figure 7 It is a schematic diagram of the structure of a computer device equipped with a form generating device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0023] The present disclosure is further described in detail below in conjunction with the accompanying drawings and examples. It is understood that the specific examples described herein are only used to explain the relevant content, rather than to limit the present disclosure. It should also be noted that, for ease of description, only the parts related to the present disclosure are shown in the accompanying drawings.
[0024] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure can be combined with each other. The technical solution of the present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0025] The form is a key interface for data exchange between users and systems, and has the function of dynamic interaction, that is, some components in the form are updated in real time depending on changes in other components. For example, when a user selects a province in the registration interface, a city list component corresponding to the province will be displayed. However, in the related art, when updating these dynamic forms, developers are usually required to manually write complex dependency logic code to monitor changes in the field values of the dependent components, and trigger updates to the associated target components accordingly. Obviously, the aforementioned method greatly increases the amount of code, and is also prone to cause confusion in the code structure, which brings great challenges to later maintenance and expansion. Especially when the dependency logic of each form item changes frequently, developers have to repeatedly modify these tightly coupled logic codes, which greatly reduces development efficiency and increases the error rate.
[0026] Figure 1 Schematic diagram of an application scenario of a method for generating a form according to an embodiment of the present disclosure. Figure 1As shown, it includes a server 100 and a terminal device 200. The server 100 can be a cloud server or a physical server, which includes a corresponding processor and a memory. The terminal device 200 can be a portable mobile device, such as a smart terminal device of a form developer, or a portable computer, a desktop computer, or other devices. The server 100 and the terminal device 200 can communicate through a network, Bluetooth, or other methods. The developer passes in multiple configuration files about the form through the terminal device 200 equipped with a maintenance terminal. The server 100 renders the initial form and builds a processing model based on the control structure information and linkage logic information in the configuration file; each form component in the initial form is displayed, hidden, enabled or disabled according to the initial interaction state of the configuration file, and the corresponding style is presented according to the remaining control structure information of the configuration file. The processing model determines the linkage logic between each form component according to the linkage logic information. When a form changes, it will be automatically triggered to determine the associated components to be linked according to the changed fill data, as well as the corresponding target interaction state and initial content; then, the associated component presents the initial content in the target interaction state to form a target form. Finally, the target form will be presented to the user's client.
[0027] It is understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the type, scope of use, and usage scenarios of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations. For example, in response to receiving the user's active request, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require the acquisition and use of the user's personal information. The user can autonomously choose whether to provide personal information to the software or hardware such as the terminal device 200, application, server or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message. As an optional but non-limiting implementation method, in response to receiving the user's active request, the method of sending the prompt message to the user can be, for example, a pop-up window, and the prompt information can be presented in the form of text in the pop-up window. In addition, the pop-up window can also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the terminal device 200. The above notification and the process of obtaining user authorization are only illustrative and do not constitute a limitation on the implementation method of the present disclosure. Other methods that meet relevant laws and regulations can also be applied to the implementation method of the present disclosure. It is also understandable that the data involved in the technical solution of the present disclosure (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0028] Figure 2Schematic diagram of the form generation method according to the embodiment of the present disclosure. In order to solve the above problems, the present disclosure proposes a solution that greatly reduces the developer's linkage code writing and improves the flexibility of form maintenance and expansion. Figure 2 This section explains how to create a form.
[0029] In order to reduce the amount of code required by form developers and improve the convenience and universality of creating forms, the present disclosure pre-sets a configuration structure, configures a form model, and a model building mechanism for processing models. In the process of generating an initial form or adding or deleting form components, developers only need to provide configuration files for the corresponding form components or delete existing configuration files. Obviously, in this way, developers can create or maintain forms more conveniently and flexibly, eliminating cumbersome code development, and reducing the linkage error rate of the form, thereby improving the filling experience of users.
[0030] The configuration structure includes at least the first and second levels. The first level focuses on the logic and data binding of the form component, such as the control type, component name, location index, dependent components and target fill data, etc. The second level focuses on the display details of the form component, including the initial content (such as the option list), initial interaction state, verification rules and feedback information. Developers can form a configuration file for any form component by entering the corresponding parameter values according to the configuration structure. The configuration structure is used to constrain the content and format of the configuration file to facilitate the identification of the linkage logic of each form component and to accurately determine the rendering parameters of the form component during rendering.
[0031] Specifically, the control types include drop-down selection boxes, input boxes, single-choice confirmation buttons, multiple-choice confirmation buttons, date pickers, etc., which are used to indicate the input method of the form component. The name of the component is used to identify the form component, such as "region". The position index is used to indicate the position of the form component in the form. The change of the target fill data of the dependent component constitutes the linkage opportunity of the form component, which will trigger the change of the interaction state and initial content of the form component. The target fill data is not unique, and each target fill data corresponds to the corresponding target interaction state and initial content; for example, when the dependent component is "country" and the fill data is the target fill data "country X", then the initial content of the current form component will become the "city list" corresponding to country X.
[0032] The initial content is the initial information that the form displays to the user. For example, when the form component is an input box, the initial content can be an input rule prompt or input guide for the form component; when the form component is a drop-down selection box, the initial content can be a selection list. The interaction state is used to limit the scope of interaction between the user and the form, including display, hide, enable, and disable. As the data filled in the form changes, the interaction state of each form component changes accordingly, so that the form component is displayed, hidden, enabled, or disabled in the form according to the linkage timing, and finally the linkage between the form and the user is realized. The initial interaction state is the expected state of each form item in the initial form when it is created. As the data filled in the form matches the linkage timing of each component, the initial interaction state will change to the target interaction state. For example, the initial interactive state of the "city" component is "hidden". When the fill data "country X" is written into the "country" component, the "city" component changes from the initial interactive state to the target interactive state, and the selection list corresponding to "country X" is presented in the form for the user to continue filling in. The display, hiding, enabling or disabling of the form component is controlled by the interactive state, making the form neater and the user's interactive experience with the form stronger. The validation rule provides a standard for the effectiveness of the filled data in the form component; for example, when the form component is an input box and the name is "name", the validation rule can be "should be greater than or equal to two characters", etc., so that the filled data meets the collection requirements of the corresponding form component and avoids invalid input. Feedback information is an error prompt for the filled data. When the filled data does not meet the validation rules, different error prompts are generated according to its error type. The data in the second level are uniformly placed in formConfig (form configuration file) to manage the parameters of all components in the form.
[0033] Each form component corresponds to a unique configuration object. When developers generate configuration objects according to the configuration structure, they can obtain the control structure information and linkage logic information about the form component. The control structure information refers to the control type, name, and location index in the first level, as well as the initial content, initial interaction state, verification rules, and feedback information in the second level; the linkage logic information refers to the dependent components and target filling data (i.e. linkage timing) in the first level.
[0034] After obtaining the configuration files of each form component, the form model is called to render according to the control structure information in the configuration file to obtain the form component. The rendered form component is presented with the set control type, name, initial content, and initial interaction state, and is displayed, hidden, disabled, or enabled on the form. Of course, when rendering the form component, the form component is also placed in the corresponding component container according to the control type of the form component. Finally, all component containers are placed in the form container, and the form model outputs the initial form. Placing each form component in different containers according to type can ensure that components with the same space type follow the same style and layout rules, while avoiding conflicts between different styles, which is conducive to the maintenance and management of forms.
[0035] Figure 3 It is a schematic diagram of the rendering process of the initial form according to an embodiment of the present disclosure.
[0036] like Figure 3 As shown, the configuration file of control type A is rendered as form component 1 and placed in component container A that supports control type A. Of course, the remaining components of control type A will also be placed in the container. Similarly, configuration file n of control type B is placed in component container B that supports control type B. Of course, the remaining components of control type B will also be placed in the container. Among them, n represents the total number of configuration files and form components, and the configuration files and form components correspond one to one. The component container can be set to multiple according to the type of control type, and there is no restriction here. All component containers are placed in the form container, and then an initial form containing various form components can be generated.
[0037] In some implementations, after the initial form is created, if the developer needs to add or delete items in the form, the developer can set a configuration file for the corresponding form component according to the configuration structure, or delete the form component to be deleted in the component container. When adding form components, the form model will render according to the configuration file, and place the rendered form component in the corresponding component container according to its control type, and display, hide, disable or enable it on the form to iterate the form.
[0038] The initial form is a static form. If you want to interact with users and reduce the amount of code written by developers, you need to build a model that can automatically update the component interaction status and initial content according to the associated logic information. Therefore, after obtaining the configuration file of the form component, a processing model will also be built according to the linkage logic information.
[0039] Specifically, if the configuration file of the form component has associated logic information preset, it proves that the form component has a requirement for dynamic update, and a dynamic identifier can be set for the component. Then, a monitoring unit is configured for these form components with dynamic identifiers. The monitoring unit is used to monitor changes in the data filled in the form, so as to trigger the conditional expression in time to perform subsequent linkage recognition and other operations.
[0040] Furthermore, multiple linkage logic information is integrated to form multiple linkage sets including related components, linkage timing, target interaction status and initial content.
[0041] Further, a conditional expression is configured. The conditional expression is set according to the logical complexity of all linkage logic information in the form, and has the ability to determine the associated components and their target interaction states and initial contents according to the changed fill data. The expression can be of function type, string type, Boolean type, and array type. Function-type conditional expressions have higher flexibility and customization capabilities, and are suitable for complex linkage logic scenarios, such as adjusting prices according to the region and time selected by the number of users. String-type conditional expressions have the advantages of being concise, easy to understand and maintain. This expression can use the identifiers "{{" and "}}" to wrap the expression body in a simple template string form to determine whether the filled data matches the linkage timing. It is suitable for scenarios with simple linkage logic, such as displaying the weather according to the city selected by the user. Boolean-type conditional expressions can quickly determine the interactive states of each form component, such as display, hide, enable, and disable. There are only two states, true and false, and are suitable for simple state judgment scenarios. Array-type conditional expressions are suitable for scenarios that rely on multiple form components. It can list all components that need to be monitored. When any of these components changes, linkage updates can be triggered. For example, when both the country selection box and the city selection box are selected, the detailed address input box is displayed. Developers can determine the type of conditional expression based on their needs to implement applications in various linkage logic scenarios.
[0042] Furthermore, if the conditional expression is a function type, a first processing function needs to be set for the conditional expression. The function takes the filled data and the linkage set generated according to the linkage logic information as input, determines the associated component whose linkage timing is the change of the filled data, and the target interaction state and initial content corresponding to the component under the condition of the filled data. The first processing function can be set according to the complexity of the linkage logic, and is not limited here.
[0043] If the conditional expression is of string type, a linkage expression and a second processing function are configured for the conditional expression. The expression body of the linkage expression is used to limit the variables and their linkage timing. When the fill data changes, the fill data is input into the linkage expression to generate the target expression. The second processing function can process parameters in the form of strings and is used to analyze the associated components of the variables (fill data) in the target expression and its target interaction state and initial content.
[0044] Of course, a default value will also be set, and when the conditional expression is of other types, the default value can be returned.
[0045] Furthermore, the execution unit is configured to locate the associated component according to the output result of the conditional expression, adjust the associated component to the target interaction state, and determine the initial content presented by it.
[0046] After configuring the monitoring unit, conditional expression, and execution unit, you can obtain the processing model containing these units. Figure 4 This is a schematic diagram of the working process of the processing model according to the embodiment of the present disclosure. Figure 4 Describe the working process of the processing model.
[0047] When the monitoring unit monitors the changes in the filled data in the form, the conditional expression will be triggered for analysis. First, the type of the conditional expression is determined. If the conditional expression is a function type, the pre-configured first processing function is called to analyze the filled data and the linkage set. The first processing function can be used to determine the associated components, as well as the target interaction state and initial content under the current filled data conditions. For example, the linkage timing of "city" is the value change of the "country" component. The change logic of the target interaction state is that if the value of the "country" component exists, the "city" component is displayed; if the value of the "country" component does not exist, the "city" component is hidden. The logic for determining the initial content is to determine the corresponding city list based on different values in the "country" component. Furthermore, if the "country" component has a change in the filled data, the first processing function determines that the associated component is the "city" component, and determines the target interaction state and initial content based on the content of the filled data.
[0048] The conditional expression of string type has the identifiers "{{" and "}}", as well as the start indication "rootValue" and the pointing identifier "fromdata". Therefore, if the conditional expression is not a function type, it is necessary to determine whether the conditional expression has a start identifier and a pointing identifier. If the conditional expression has a start identifier and a pointing identifier, it is determined to be a string type, and then the identifiers "{{" and "}}" are removed to extract the expression body. Then, the fill data and the linkage set are substituted into the expression body to obtain the target expression. The second processing function is called to analyze the target expression, determine the associated components, and the target interaction state and initial content under the current fill data conditions.
[0049] Of course, if the conditional expression is not a function type and does not have a start indication and a pointer identification, then the conditional expression is deemed to be other and the default value is returned.
[0050] The execution unit of the processing model will complete the update of the form component and the generation of the target form according to the output result of the conditional expression. The target form contains the associated components in the target interactive state, the dependent components of the associated components, and the changed fill data.
[0051] Figure 5 The flowchart of the method for generating a form according to the embodiment of the present disclosure is shown in FIG. Based on the above technical solution, the present disclosure proposes a method for generating a form M100, comprising:
[0052] Step S110, obtaining a configuration file about each form component, the configuration file includes the control structure information and linkage logic information of the form component; step S120, calling the form model to render the corresponding form component according to the configuration file, generating an initial form that displays or enables at least part of the form components, the initial form displays, hides, enables or disables the corresponding form components according to the initial interaction state in the control structure information; step S130, generating a processing model for determining the target interaction state and initial content of the form component according to the linkage logic information in each configuration file; and step S140, in response to the changed fill data in the initial form, triggering the processing model to determine the associated components corresponding to the fill data and their target interaction state and initial content, generating a target form, and the associated components present the initial content in the target form with the target interaction state.
[0053] The specific implementation of each step of the form generation method M100 can refer to the introduction of the form generation method above, which will not be repeated here. Figure 6 4 is a block diagram of a form generating device 100 according to an embodiment of the present disclosure.
[0054] refer to Figure 6 , discloses a form generation device 100, comprising:
[0055] The acquisition module 110 is used to acquire configuration files about each form component, where the configuration files include control structure information and linkage logic information of the form component;
[0056] The rendering module 120 is used to call the form model to render the corresponding form components according to the configuration file, generate an initial form that displays or enables at least some of the form components, and the initial form displays, hides, enables or disables the corresponding form components according to the initial interaction state in the control structure information;
[0057] The logic configuration module 130 is used to generate a processing model for determining the target interaction state and initial content of the form component according to the linkage logic information in each configuration file;
[0058] Application module 140 is used to respond to the changes in the filled data in the initial form, trigger the processing model to determine the associated components corresponding to the filled data and their target interaction states and initial contents, generate a target form, and the associated components present the initial contents in the target form in the target interaction state.
[0059] In some embodiments, the execution steps of the rendering module 120 are: calling the form model to render the form component according to the configuration file, the control structure information of the configuration file includes the control type, name, location index, initial content and initial interaction state; classifying each form component into a corresponding component container according to the control type; based on the initial interaction state, displaying, hiding, enabling or disabling the corresponding form component to form an initial form that includes multiple component containers and displays or enables at least some form components.
[0060] In some embodiments, the logic configuration module 130 includes: configuring a monitoring unit, the monitoring unit is used to monitor the fill data of the form component associated with the linkage logic information; configuring a conditional expression, the conditional expression is used to filter the associated components in multiple linkage logic information that use the change of the fill data as the linkage timing, and match the associated components with the target interaction state and initial content that are suitable for the fill data; and configuring an execution unit, the execution unit is used to adjust the associated component to the target interaction state, and control the associated component to display the initial content.
[0061] In some embodiments, configuring the conditional expression includes: integrating multiple linkage logic information to form multiple linkage sets including associated components, linkage timing, target interaction status and initial content; configuring a processing type and a processing function suitable for the processing type for the conditional expression, including: when the conditional expression is a function type, configuring a first processing function for the conditional expression; or, when the conditional expression is a string type, configuring a linkage expression and a second processing function for the conditional expression, and the processing types include function type, string type, Boolean type and array type.
[0062] In some embodiments, the application module 140 includes: when the fill data changes, calling the conditional expression to determine the associated components in the linkage set that use the change in the fill data as the linkage opportunity, as well as the target interaction state and initial content of the associated components; calling the execution unit to adjust the associated components to the target interaction state, and present the initial content to obtain the target form.
[0063] Specifically, when the conditional expression is a function type, the first processing function is called to analyze the filling data and the linkage set to determine the associated components, target interaction status and initial content that match the filling data; or, when the conditional expression is a string type, it is determined whether the linkage expression contains a start identifier and a pointing identifier; if the linkage expression includes a start identifier and a pointing identifier, the expression body of the linkage expression is extracted, and the expression body is converted into a target expression using the filling data and the linkage set; the second processing function is called to analyze the target expression to determine the associated components, target interaction status and initial content that match the filling data.
[0064] In some implementations, the method further includes: constructing a configuration structure, where the configuration structure is used to constrain the content and format of the configuration file.
[0065] The various modules of the form generation device 100 are arranged to implement the various steps of the form generation method, and the implementation principle thereof may refer to the above.
[0066] The execution subject of the form generation method in the specific implementation manner of the present disclosure may be a computer device such as an intelligent terminal device, a portable computer, a desktop computer, etc.
[0067] Therefore, based on any of the above embodiments, the present disclosure further provides a computer device, which can execute the form generation method of any of the embodiments described above in the present disclosure, and the form generation device 100 of any of the embodiments described above can be configured on the computer device.
[0068] Figure 7 It is a schematic diagram of the structure of a computer device equipped with a form generating device according to an embodiment of the present disclosure.
[0069] The hardware structure of the computer device 1000 can be implemented using a bus architecture. The bus architecture can include any number of interconnecting buses and bridges, depending on the specific application and overall design constraints of the hardware. The bus 1100 connects various circuits including one or more processors 1200, memory 1300, and / or hardware modules together. The bus 1100 can also connect various other circuits 1400 such as peripherals, voltage regulators, power management circuits, external antennas, etc.
[0070] The bus 1100 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one connecting line is used in the figure, but it does not mean that there is only one bus or one type of bus. The present disclosure also provides a readable storage medium, in which a computer program is stored, and the computer program is used to implement the above method when executed by a processor. "Readable storage medium" may be any device that can contain, store, communicate, propagate or transmit a program for use in an instruction execution system, device or equipment or in combination with these instruction execution systems, devices or equipment. More specific examples of readable storage media include the following: an electrical connection portion (electronic device) having one or more wirings, a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable read-only memory (CDROM), etc.
[0071] The present disclosure also provides a computer program product. The method of the present disclosure can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed, the process or function of the present disclosure is executed in whole or in part.
[0072] The computer program or instructions may be stored in a readable storage medium or transmitted from one readable storage medium to another readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The readable storage medium may be any available medium that can be accessed or a data storage device such as a server, data center, etc. that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disk; it may also be a semiconductor medium, such as a solid state drive. The computer readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.
[0073] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, computer devices, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0074] The present disclosure is described with reference to flowcharts and / or block diagrams of methods, computer devices, and computer program products according to the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0075] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0076] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0077] In the description of this specification, the description with reference to the terms "one embodiment / method", "some embodiments / methods", "example", "specific example", or "some examples" etc. means that the specific features, structures, or characteristics described in conjunction with the embodiment / method or example are included in at least one embodiment / method or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment / method or example. Moreover, the specific features, structures, or characteristics described may be combined in any one or more embodiments / methods or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments / methods or examples described in this specification and features of different embodiments / methods or examples, unless they are contradictory.
[0078] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, "plurality" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0079] Those skilled in the art should understand that the above embodiments are only for the purpose of clearly illustrating the present disclosure, and are not intended to limit the scope of the present disclosure. For those skilled in the art, other changes or modifications may be made based on the above disclosure, and these changes or modifications are still within the scope of the present disclosure.
Claims
1. A method for generating a form, characterized in that: include: Obtaining a configuration file for each form component, wherein the configuration file includes control structure information and linkage logic information of the form component; Calling the form model to render the corresponding form components according to the configuration file, generating an initial form that displays or enables at least part of the form components, wherein the initial form displays, hides, enables or disables the corresponding form components according to the initial interaction state in the control structure information; generating a processing model for determining a target interaction state and an initial content of the form component according to the linkage logic information in each of the configuration files; and In response to the changed filled data in the initial form, the processing model is triggered to determine the associated component corresponding to the filled data and its target interaction state and the initial content, and a target form is generated. The associated component presents the initial content in the target form in the target interaction state.
2. The method for generating a form according to claim 1, characterized in that: The calling form model renders the corresponding form component according to the configuration file to generate an initial form that displays or enables at least part of the form component, including: Calling the form model to render the form component according to the configuration file, wherein the control structure information of the configuration file includes control type, name, position index, initial content and the initial interaction state; Classify each of the form components into a corresponding component container according to the control type; Based on the initial interaction state, the corresponding form components are displayed, hidden, enabled or disabled to form the initial form that includes a plurality of component containers and displays or enables at least some of the form components.
3. The method for generating a form according to claim 1, characterized in that: The step of generating a processing model for determining a target interaction state and an initial content of the form component according to the linkage logic information in each of the configuration files includes: Configure a monitoring unit, the monitoring unit is used to monitor the filling data of the form component associated with the linkage logic information; configuring a conditional expression, the conditional expression being used to filter out associated components whose linkage timing is the change of the filling data from the plurality of linkage logic information, and matching the target interaction state and the initial content adapted to the filling data for the associated components; and An execution unit is configured, where the execution unit is used to adjust the associated component to the target interaction state and control the associated component to display the initial content.
4. The method for generating a form according to claim 3, characterized in that: Configuring the conditional expression includes: Integrate the plurality of linkage logic information to form a plurality of linkage sets including associated components, linkage timings, target interaction states and initial contents; A processing type and a processing function suitable for the processing type are configured for the conditional expression, including: when the conditional expression is a function type, a first processing function is configured for the conditional expression; or, when the conditional expression is a string type, a linkage expression and a second processing function are configured for the conditional expression, and the processing types include function type, string type, Boolean type and array type.
5. The method for generating a form according to claim 4, characterized in that: The step of responding to the changed filling data in the initial form, triggering the processing model to determine the associated components corresponding to the filling data and the target interaction state and the initial content thereof, and generating a target form includes: When the filling data changes, calling the conditional expression to determine the associated component in the linkage set with the change of the filling data as the linkage opportunity, as well as the target interaction state and the initial content of the associated component; The execution unit is called to adjust the associated component to the target interaction state, and present the initial content to obtain the target form.
6. The method for generating a form according to claim 5, characterized in that: The calling of the conditional expression to determine the associated component with the fill data as the linkage opportunity in the linkage set, as well as the target interaction state and the initial content of the associated component, includes: When the conditional expression is a function type, calling the first processing function to analyze the filling data and the linkage set, and determining the associated components matching the filling data, the target interaction state, and the initial content; or, When the conditional expression is of string type, determine whether the linkage expression contains a start identifier and a pointing identifier; if the linkage expression includes the start identifier and the pointing identifier, extract the expression body of the linkage expression, and convert the expression body into a target expression using the fill data and the linkage set; call the second processing function to analyze the target expression, and determine the associated components that match the fill data, the target interaction state, and the initial content.
7. The form generation method according to claim 1, characterized in that: Also includes: A configuration structure is constructed, wherein the configuration structure is used to constrain the content and format of the configuration file.
8. A computer device, characterized in that: include: A memory storing execution instructions; as well as A processor, wherein the processor executes the execution instruction stored in the memory, so that the processor executes the form generation method according to any one of claims 1 to 7.
9. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, it is used to implement the form generation method according to any one of claims 1 to 7.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program is used to at least implement the form generation method according to any one of claims 1 to 7.
