Form generation method and device, electronic device and storage medium
By pre-configuring form configuration files and custom component templates, the problems of repeated development and logical inconsistency in cross-end form development are solved, and logical reuse and business consistency are achieved in the cross-end form generation process.
Patent Information
- Application Number
- CN202111566606.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-20
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2041-12-20
AI Technical Summary
The existing cross-end form development solution has a large amount of repetitive development work and leads to logical inconsistencies between different ends due to development costs.
By obtaining the pre-configured form configuration file, which contains the form elements, element description information and business logic corresponding to the terminal, the initial page form is generated, and business interaction and logic verification are performed based on state change trigger events to generate the target page form. Custom component templates and extended logic are used to handle special scenarios.
It achieves the reuse of logic in the cross-terminal form generation process, reduces the workload of repeated development, ensures the consistency of multi-terminal business functions, and reduces multi-terminal development costs during business upgrades.
Smart Images

Figure CN114253537B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of software development, and in particular to a form generation method, a form generation device, an electronic device, and a computer-readable storage medium. Background Art
[0002] With the development of the internet, both personal computers (PCs) and mobile devices have a significant user base. However, some complex management systems, such as Enterprise Resource Planning (ERP) and Project Management Professional (PMP) certification systems, are generally only supported on PCs. Migrating to mobile devices is prohibitively expensive, tantamount to developing a whole new system.
[0003] Existing cross-end solutions such as the Trao framework and the Uniapp framework can only cross-end between Hypertext Markup Language 5 (HTML 5) / mini programs / native platforms, and cannot achieve cross-end development from PC to mobile terminals.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the Invention
[0005] The purpose of the present disclosure is to provide a form generation method, a form generation device, an electronic device and a computer-readable storage medium, thereby overcoming, at least to a certain extent, the problems of existing cross-end form development solutions, such as large repetitive development workload and logical inconsistencies between different ends due to development costs.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by practice of the present disclosure.
[0007] According to a first aspect of the present disclosure, a form generation method is provided, comprising: obtaining a preconfigured form configuration file; the form configuration file comprising form elements corresponding to a plurality of different types of terminals, element description information of the form elements, and form business logic; generating a corresponding initial page form at each terminal based on the element description information of the form elements; in response to a state change trigger event for the form element, triggering form business interaction of the initial page form based on the state change trigger event and the form business logic; performing logic verification processing on the initial page form that generates the form business interaction in each terminal to obtain a logic verification result, and generating a corresponding target page form at each terminal according to the logic verification result.
[0008] In an exemplary embodiment of the present disclosure, the above method also includes: obtaining a custom component template corresponding to each terminal; generating the custom component template based on the extended implementation logic of the corresponding terminal; injecting the custom component template into the initial page form to perform component parsing processing at a specific page position of the initial page form to obtain an initial custom component; determining the component interaction logic and component verification logic corresponding to the initial custom component; generating a custom component at a specific page position based on the page interaction logic and component verification logic to obtain a target page form.
[0009] In an exemplary embodiment of the present disclosure, before obtaining a pre-configured form configuration file, the above method also includes: determining the form elements used for form generation, performing abstract description processing on the form elements, and obtaining a corresponding element description file; the element description file includes element description information; determining the state information and state transition logic of the form elements, and generating the form interaction logic according to the state information and state transition logic; determining the verification logic corresponding to the form elements, and generating the corresponding verification source file according to the verification logic; obtaining a pre-written custom extension logic, and generating a form configuration file according to the element description file, the form interaction logic, the verification source file and the custom extension logic.
[0010] In an exemplary embodiment of the present disclosure, form elements include general form elements and specific end form elements; performing abstract description processing on the form elements to obtain corresponding element description files, including: performing abstract description processing on the general form elements to obtain the general element structure and general element attributes of the general form elements; generating the general element configuration of the general form elements based on the general element structure and the general element attributes; performing abstract description processing on the specific end form elements to obtain the specific element structure and specific element attributes of the specific end form elements; generating the specific element configuration of the specific end form elements based on the specific element structure and the specific element attributes; and generating the element description file based on the general element configuration and the specific element configuration.
[0011] In an exemplary embodiment of the present disclosure, the state information and state transition logic of a form element are determined, and the form interaction logic is generated based on the state information and the state transition logic, including: determining multiple candidate states corresponding to the form element, and determining candidate state information of each candidate state; the candidate state information includes a state identifier and a state trigger source; obtaining a business requirement document, and arranging the state logic based on the business requirement document, the state identifier, and the state trigger source to obtain the state transition logic; and determining the form interaction logic based on the dynamic conversion result corresponding to the state transition logic.
[0012] In an exemplary embodiment of the present disclosure, form elements include general form elements and specific end form elements; a corresponding initial page form is generated at each terminal based on element description information of the form elements, including: respectively determining the form parsing engine and terminal component library corresponding to each terminal; when the element type is a general form element, obtaining the general element configuration based on the form configuration file; the form parsing engine generates the corresponding initial page form at each terminal according to the general element configuration and each terminal component library; when the element type is a specific end form element, obtaining the specific element configuration based on the form configuration file; the form parsing engine generates the corresponding initial page form at each terminal according to the specific element configuration and each terminal component library.
[0013] In an exemplary embodiment of the present disclosure, a form business interaction of an initial page form is triggered based on a state change triggering event and form business logic, including: determining the current state of a form element; performing state switching processing on the current state based on the state change triggering event and form business logic to obtain a corresponding state switching result; and performing form business interaction according to the state switching result.
[0014] In an exemplary embodiment of the present disclosure, a logical verification process is performed on the initial page form that generates the form business interaction in each terminal, including: in response to a form verification request for the form business interaction, obtaining the form verification logic from the form configuration file; obtaining the form parsing engine of each terminal, and having the form parsing engine parse the form verification logic to obtain a corresponding verification logic parsing file; executing the verification logic parsing file to determine the form verification result based on the form verification request.
[0015] According to a second aspect of the present disclosure, a form generation device is provided, comprising: a configuration file acquisition module for acquiring a preconfigured form configuration file; the form configuration file comprising form elements corresponding to a plurality of different types of terminals, element description information of the form elements, and form business logic; an initial form generation module for generating a corresponding initial page form at each terminal based on the element description information of the form elements; a form business interaction module for triggering, in response to a state change trigger event for the form element, form business interaction of the initial page form based on the state change trigger event and the form business logic; and a target form generation module for performing logic verification processing on the initial page form generating the form business interaction in each terminal to obtain a logic verification result, so as to generate a corresponding target page form at each terminal according to the logic verification result.
[0016] In an exemplary embodiment of the present disclosure, the form generation device also includes a component generation module, which is used to obtain a custom component template corresponding to each terminal; the custom component template is generated based on the extended implementation logic of the corresponding terminal; the custom component template is injected into the initial page form to perform component parsing processing at a specific page position of the initial page form to obtain an initial custom component; the component interaction logic and component verification logic corresponding to the initial custom component are determined; and a custom component is generated at a specific page position based on the page interaction logic and component verification logic to obtain a target page form.
[0017] In an exemplary embodiment of the present disclosure, the form generation device also includes a configuration file generation module, which is used to determine the form elements used for form generation, perform abstract description processing on the form elements, and obtain corresponding element description files; the element description files include element description information; determine the state information and state transition logic of the form elements, and generate form interaction logic based on the state information and state transition logic; determine the verification logic corresponding to the form elements, and generate corresponding verification source files based on the verification logic; obtain pre-written custom extension logic, and generate a form configuration file based on the element description file, form interaction logic, verification source file and custom extension logic.
[0018] In an exemplary embodiment of the present disclosure, the configuration file generation module includes an element file generation unit, which is used to perform abstract description processing on the general form element to obtain the general element structure and general element attributes of the general form element; generate the general element configuration of the general form element based on the general element structure and general element attributes; perform abstract description processing on the specific end form element to obtain the specific element structure and specific element attributes of the specific end form element; generate the specific element configuration of the specific end form element based on the specific element structure and specific element attributes; and generate an element description file based on the general element configuration and the specific element configuration.
[0019] In an exemplary embodiment of the present disclosure, the configuration file generation module includes an interaction logic determination unit for determining multiple candidate states corresponding to form elements and determining candidate state information for each candidate state; the candidate state information includes a state identifier and a state trigger source; obtaining a business requirement file, and performing state logic arrangement based on the business requirement file, the state identifier, and the state trigger source to obtain state transition logic; and determining the form interaction logic based on the dynamic transition result corresponding to the state transition logic.
[0020] In an exemplary embodiment of the present disclosure, the initial form generation module includes an initial form generation unit, which is used to respectively determine the form parsing engine and terminal component library corresponding to each terminal; when the element type is a general form element, the general element configuration is obtained based on the form configuration file; the form parsing engine generates a corresponding initial page form at each terminal according to the general element configuration and each terminal component library; when the element type is a specific terminal form element, the specific element configuration is obtained based on the form configuration file; the form parsing engine generates a corresponding initial page form at each terminal according to the specific element configuration and each terminal component library.
[0021] In an exemplary embodiment of the present disclosure, the form business interaction module includes a form business interaction unit, which is used to determine the current state of the form element; perform state switching processing on the current state based on the state change trigger event and the form business logic to obtain the corresponding state switching result; and perform form business interaction according to the state switching result.
[0022] In an exemplary embodiment of the present disclosure, the target form generation module includes a logic verification unit for obtaining form verification logic from a form configuration file in response to a form verification request for a form business interaction; obtaining a form parsing engine of each terminal, and having the form parsing engine parse the form verification logic to obtain a corresponding verification logic parsing file; and executing the verification logic parsing file to determine a form verification result based on the form verification request.
[0023] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the form generation method according to any one of the above items is implemented.
[0024] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the form generating method according to any one of the above items is implemented.
[0025] The technical solution provided by the present disclosure may have the following beneficial effects:
[0026] The form generation method in the exemplary embodiment of the present disclosure, on the one hand, can implement most of the form interaction logic in the form generation process based on a configuration method by pre-configuring the page element description information and the form business logic in the form configuration file. On the other hand, since the form business interaction in the page form is triggered based on the form business logic in the form configuration file, the business logic can be reused to the greatest extent on multiple ends, reducing duplication and reducing the workload of repeated development, while ensuring the consistency of business functions on both ends. On another hand, since the form business logic is stored in the form configuration file, when the business is upgraded later, it can be developed once based on the form configuration file, so that the business logic of multiple ends remains consistent, reducing the cost of developing multiple ends separately.
[0027] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and those skilled in the art can derive other drawings based on these drawings without inventive effort. In the drawings:
[0029] Figure 1 The following diagram schematically shows the effects of the currently used cross-end form construction solution and the form generation method of the present disclosure.
[0030] Figure 2 The flowchart of the form generation method according to the exemplary embodiment of the present disclosure is schematically shown.
[0031] Figure 3 The figure schematically shows an overall implementation diagram of a form generation method according to an exemplary embodiment of the present disclosure.
[0032] Figure 4 The flowchart of generating corresponding custom components in each terminal based on custom logic according to an exemplary embodiment of the present disclosure is schematically shown.
[0033] Figure 5 The flowchart of generating corresponding custom components across terminals based on a form configuration file according to an exemplary embodiment of the present disclosure is schematically shown.
[0034] Figure 6 The flowchart of injecting validation logic code into a form configuration file according to an exemplary embodiment of the present disclosure is schematically shown.
[0035] Figure 7The flowchart schematically shows a process for implementing business logic processing based on form data submitted by a page form according to an exemplary embodiment of the present disclosure.
[0036] Figure 8 A schematic diagram is shown of page elements with different display styles and the same return data format in different terminals according to an exemplary embodiment of the present disclosure.
[0037] Figure 9 A flowchart of generating an initial page form based on a general element configuration and a specific element configuration according to an exemplary embodiment of the present disclosure is schematically shown.
[0038] Figure 10 A flowchart for implementing form business logic according to an exemplary embodiment of the present disclosure is schematically shown.
[0039] Figure 11 A block diagram schematically shows a form generating apparatus according to an exemplary embodiment of the present disclosure.
[0040] Figure 12 A block diagram of an electronic device according to an exemplary embodiment of the present disclosure is schematically shown.
[0041] Figure 13 A schematic diagram schematically illustrates a computer-readable storage medium according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0042] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be embodied in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art. Like reference numerals in the drawings represent like or similar parts, and thus repetitive description thereof will be omitted.
[0043] In addition, the described features, structures or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, well-known structures, methods, devices, implementations, materials or operations are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0044] The blocks shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. Specifically, these functional entities may be implemented in software, or in one or more software-hardened modules, or in different networks and / or processor devices and / or microcontroller devices.
[0045] To implement business systems that meet requirements for both PC and mobile devices, the following implementation options are typically used: One approach is to develop systems specific to each terminal. This approach offers the advantage of preventing interference between systems on different terminals. Each terminal utilizes its own appropriate basic component library, enabling a better interactive experience across different terminals. However, this approach carries high development costs and a long development cycle, requiring significant manual intervention to maintain logical consistency across both terminals. Future business upgrades will result in a significant development workload. Another approach is to develop a component library with a screen-adaptive solution. This solution can enable cross-terminal services, but this type of component library is limited in functionality and offers a poor user experience. Furthermore, some existing visual development platforms can support page building for either PC or mobile devices, but these platforms cannot achieve cross-PC / mobile page building.
[0046] refer to Figure 1 , Figure 1 The following diagram schematically shows the effects of the currently adopted cross-terminal form construction solution and the form generation method disclosed in the present invention. In implementation solution 1, developers can perform development operations on the PC and mobile terminals respectively according to business needs. Due to development cost issues, the mobile terminal version developed is usually a shortened version of the PC terminal, and there are inconsistencies in the business logic of the two ends. Therefore, in the form generation method disclosed in the present invention, developers implement a form generation solution that can be logically reused on the PC and mobile terminals according to business needs, and both ends are complete versions with completely consistent business logic.
[0047] Based on this, in this example embodiment, a form generation method is first provided. The form generation method of the present disclosure can be implemented using a server, or the method described in the present disclosure can be implemented using a terminal device. The terminals described in the present disclosure may include mobile terminals such as mobile phones, tablet computers, laptops, PDAs, personal digital assistants (PDAs), and fixed terminals such as desktop computers. Figure 2 The following schematically illustrates a flow chart of a form generation method according to some embodiments of the present disclosure. Figure 2 , the form generation method may include the following steps:
[0048] Step S210: obtaining a pre-configured form configuration file; the form configuration file includes form elements corresponding to a plurality of different types of terminals, element description information of the form elements, and form business logic.
[0049] In an exemplary embodiment of the present disclosure, a form configuration file may be a configuration file used to generate page forms on multiple different terminals. The form configuration file may include element description information of form elements corresponding to multiple different types of terminals and form business logic for business interaction. For example, different types of terminals may include PC terminals, mobile terminals or other application terminals. The present disclosure does not impose any special restrictions on the specific types of terminals. Form elements may be basic elements used to generate page forms on different terminals. For example, form elements may include text elements, single-choice elements, multiple-choice elements, date elements, and the like. Element description information may be relevant content information describing form elements. For example, element description information may include information such as the display style of form elements and element type. Form business logic may be the logic used by the form for business interaction.
[0050] refer to Figure 3 , Figure 3 The schematic diagram shows the overall scheme implementation diagram of the form generation method according to the exemplary embodiment of the present disclosure. Before implementing cross-end development of forms, developers can pre-configure form configuration files corresponding to the forms built on different ends. For example, a visual building platform can be provided. First, based on the visual building platform, the form elements used to build the page form are determined through online construction. Form elements can include basic types and composite types (also known as complex types). For example, basic type form elements can include: text, single choice, multiple choice, switch, file upload, date, date range, counter, cascade selection, text display, custom components, buttons, etc.; composite types can include objects, arrays, etc., and composite types can contain basic type and composite type form elements. The above form elements can cover the vast majority of business scenarios, and can meet the display requirements of various form pages through free combination. After determining the form elements, the element description information corresponding to each form element can be determined, for example, the structure information and attribute information contained in the element.
[0051] Secondly, after the page form is displayed normally on the PC or mobile terminal, the form interaction logic between the page forms needs to be bound, that is, the actual business logic. For example, when certain conditions are met, the entry of a form element can be disabled. Therefore, the form business logic can be configured in advance through the visual construction platform and stored in the form configuration file.
[0052] Step S220 : generating a corresponding initial page form on each terminal based on the element description information of the form element.
[0053] In an exemplary embodiment of the present disclosure, the initial page form may be a page form generated in a terminal according to element description information of the form elements.
[0054] Continue to refer Figure 3 After determining the form elements used to generate the page form, the element description information corresponding to the above form elements can be obtained from the form configuration file, and then the initial page form can be generated on the corresponding terminal based on the above element description information. For example, when a page form is generated on a PC and a mobile terminal respectively, the initial page form can be rendered on the corresponding terminal page through the front-end parsing engine of the PC and mobile terminals respectively, and based on the relevant element description information of the form elements in the page form.
[0055] Step S230 : In response to a state change triggering event for a form element, triggering a form business interaction of the initial page form based on the state change triggering event and the form business logic.
[0056] In an exemplary embodiment of the present disclosure, a state change trigger event may be a trigger event corresponding to a state change of a page form during the generation of a page form. For example, a state change trigger event may be an event corresponding to a user operation on a page element, causing a state change of other page elements in the page form. A form business interaction may be a business interaction between forms, for example, state linkage interaction between multiple forms.
[0057] When a user performs an action on a page element, a state change trigger event corresponding to the action can be generated. For example, when a user unchecks a radio button on a page, other display boxes on the page are hidden. In this scenario, the state change trigger event can be the event corresponding to the user unchecking a radio button. When the radio button is unchecked, some display boxes on the page are hidden. That is, the state change of the radio button will cause the style of the display box component to change. Therefore, there is interaction logic between the radio button and the display box. Based on the above state change trigger event and the form business logic pre-configured in the form configuration file, the form business interaction of the initial page form can be implemented.
[0058] Step S240 , performing logic verification processing on the initial page form generating the form business interaction in each terminal to obtain a logic verification result, and generating a corresponding target page form in each terminal according to the logic verification result.
[0059] In an exemplary embodiment of the present disclosure, the logic verification process may be a verification process performed on the interaction logic of the form business interaction when the initial page form undergoes a form business interaction. The logic verification result may be the result corresponding to the logic verification process. The target page form may be a new page form generated based on the form business interaction after the logic verification process passes.
[0060] After the form business interaction is performed in response to the state change trigger event, for example, when the user clicks submit or changes the form content, the logic verification processing of the initial page form in the corresponding end will be triggered. In addition, since the verification logic used in the logic verification processing is pre-configured in the form configuration file through the visual configuration platform, when the logic verification processing is triggered, the verification logic corresponding to the state change trigger event can be obtained from the form configuration file to perform logic verification processing. For example, during the execution of the page form, the corresponding verification logic script is obtained from the form configuration file, and the script is parsed by the form engine. After the user triggers the logic verification, the script is executed and the logic verification result is returned. When the logic verification result is that the verification passes, the form can be submitted and the corresponding target page form is generated. When the logic verification result is that the verification fails, an error prompt message is displayed on the target page of the corresponding end, and the submission of the form is blocked.
[0061] According to the form generation method in this example embodiment, on the one hand, by pre-configuring the page element description information and the form business logic in the form configuration file, most of the form interaction logic in the form generation process can be implemented based on a configuration method. On the other hand, since the form business interaction in the page form is triggered based on the form business logic in the form configuration file, the business logic can be reused to the greatest extent on multiple ends, reducing duplication and reducing the workload of repeated development, while ensuring the consistency of business functions on both ends. On the other hand, since the form business logic is stored in the form configuration file, when the business is upgraded later, it can be developed once based on the form configuration file, so that the business logic of multiple ends remains consistent, reducing the cost of developing multiple ends separately.
[0062] The form generation method in this exemplary embodiment will be further described below.
[0063] In an exemplary embodiment of the present disclosure, a custom component template corresponding to each terminal is obtained; the custom component template is generated based on the extended implementation logic of the corresponding terminal; the custom component template is injected into the initial page form to perform component parsing processing at a specific page position of the initial page form to obtain an initial custom component; the component interaction logic and component verification logic corresponding to the initial custom component are determined; and a custom component is generated at a specific page position based on the page interaction logic and the component verification logic to obtain a target page form.
[0064] Among them, the custom component template can be a template used to generate a custom component in a page form. The extended implementation logic can be a special logic in an actual business scenario that cannot be generated through configuration, such as the organization of interface data, dynamic addition of Document Object Model (DOM) elements, etc. Component parsing processing can be a process in which the front-end engine parses related files such as custom template components to generate a visual custom component in the target page. The initial custom component can be a visual component displayed on the page after component parsing processing. The component interaction logic can be the logic corresponding to the business interaction between the initial custom components. The component verification logic can be the logic used for verification processing of the business interaction logic of the initial custom component. The custom component can be a component that maintains consistency in the business logic generated by multiple terminals based on the page interaction logic and the component verification logic.
[0065] In actual business, there is a certain amount of special logic that cannot be completed through configuration. For this business logic that cannot be completed through configuration, you can use custom coding to write extended implementation logic. Specifically, based on the code file written in the visual construction platform, the code file is packaged and stored in the form configuration file. It runs in parallel with the element description information, interactive business logic, and verification logic obtained through configuration, serving as a supplement to the existing logic.
[0066] refer to Figure 4 , Figure 4 This schematic diagram illustrates a flow chart for generating corresponding custom components on each terminal based on custom logic, according to an exemplary embodiment of the present disclosure. When generating page forms on different terminals, pre-configured element description information, form business logic, and custom-written extension implementation logic can be obtained from the form configuration file. The front-end parsing engine on each terminal then performs rendering processing based on the obtained element description information and logic file, generating the corresponding custom component on the target page.
[0067] Further, refer to Figure 5 , Figure 5 The following diagram schematically illustrates a flow chart for generating corresponding custom components across different terminals based on a form configuration file, according to an exemplary embodiment of the present disclosure. In actual applications, there are scenarios where special processing is required for individual items in a form. For example, the extended implementation logic may be mobile phone verification code logic, which cannot be accurately described through configuration. Therefore, special processing is required for form items. First, define one of the items in the form configuration file as a custom component. Developers can first identify the form elements that require special processing and then separately write this custom component based on the extended implementation logic.
[0068] Specifically, you can first obtain the custom component template corresponding to each terminal, and inject the custom component template into the initial page form. For example, you can inject the custom component template into the initial page form through a slot. The front-end parsing engine will identify the custom component template and parse the specific position in the initial page form. The initial custom component generated by the above processing will be displayed and interacted as part of the page form.
[0069] In addition, in order to maintain the consistency of the business logic of custom components generated on different ends, the parameter format of custom components can be agreed in advance. Custom components can use the business interaction logic and verification logic in the page form to avoid inconsistent business logic between different ends. The form generation method provided by the present disclosure can improve development efficiency by quickly configuring some common form business logic and completing form business functions. In addition, personalized extension implementation logic can be implemented through low-code injection, which can complete some extended business logic that cannot be handled by configuration. The above solution can adapt to more complex interaction scenarios.
[0070] In an exemplary embodiment of the present disclosure, a form element for form generation is determined, and an abstract description processing is performed on the form element to obtain a corresponding element description file; the element description file includes element description information; the state information and state transition logic of the form element are determined, and the form interaction logic is generated according to the state information and the state transition logic; the verification logic corresponding to the form element is determined, and the corresponding verification source file is generated according to the verification logic; the pre-written custom extension logic is obtained, and a form configuration file is generated according to the element description file, the form interaction logic, the verification source file, and the custom extension logic.
[0071] Among them, the element description file can be a file generated after abstract description processing of page elements, and the element description file can include information such as the display style and form structure of each page element. The state information can be relevant information about the element state of the form element, and the state information can include state identification, state name, default value and trigger source, etc. The state transition logic can be the logic based on which a certain form element transitions from a first state to a second state. The form interaction logic can be the logic based on which the state changes between form elements occur. The verification source file can be a source file written for the verification logic. The custom extension logic can be a custom-written extension implementation logic.
[0072] Before performing cross-terminal form generation processing, you can use the visual construction platform to perform visual construction, declarative configuration, and low-code custom development to determine the element description information and form business logic required for form elements during the form generation process, and store them in the form configuration file to generate page forms in various types of terminals based on the form configuration file.
[0073] First, the form elements used for form generation are identified and abstractly described to create an element description file. This abstract description process allows the form structure and attributes of these elements to be accurately described, accurately describing their business meaning across different terminal types (e.g., PC and mobile). By using the most appropriate basic component library on each terminal, we can maintain a better interactive form and user experience.
[0074] Next, the state information of each form element is determined. For example, the state information of each form element may include a state identifier, a state name, and a state value. After determining the state information of each form element, the state transition logic for state transitions between different form elements can be further determined. This state transition logic may include the element states, logical arrangement relationships, and component change methods of the form elements. Based on this state information and state transition logic, form interaction logic can be generated. When a state change of a form element is detected, the final result of the state transition can be determined in real time through pre-arranged logical relationships and applied to the corresponding form element to implement interactive actions within the page form.
[0075] Another complex part of page forms is validation logic. This logic can trigger a logical check after a user clicks Submit or changes form content. If the validation logic isn't met, an error message is displayed and the form isn't submitted. For each form element, you can create a validation source file with the validation logic for each element. Once completed, the validation source files are packaged.
[0076] Furthermore, in actual business, there is a certain amount of special business logic that cannot be completed through configuration. For this type of business logic, corresponding custom extension logic can be written based on the visual construction platform.
[0077] After obtaining the element description file, form interaction logic, validation source file, and custom extension logic, you can store the above content in the configuration file to generate the form configuration file. For example, the validation logic can be added to the form configuration file through code injection. Figure 6 , Figure 6 The flowchart of injecting the verification logic code into the form configuration file according to the exemplary embodiment of the present disclosure is schematically shown. After the verification logic is obtained by online writing, the verification logic can be added to the form configuration file by code injection.
[0078] In an exemplary embodiment of the present disclosure, an abstract description process is performed on a general form element to obtain a general element structure and general element attributes of the general form element; a general element configuration of the general form element is generated based on the general element structure and general element attributes; an abstract description process is performed on a specific end form element to obtain a specific element structure and specific element attributes of the specific end form element; a specific element configuration of the specific end form element is generated based on the specific element structure and specific element attributes; and an element description file is generated based on the general element configuration and the specific element configuration.
[0079] Among them, a general form element can be a form element that can be used universally when generated on multiple terminals, that is, the element configuration of a certain form element is used on multiple terminals. A general element structure can be the specific structure of a general form element. General element attributes can be the relevant attributes of a general form element. General element configuration can be the corresponding configuration content of a general form element. A specific terminal form element can be a form element that is applicable to a specific terminal during the form generation process. For example, a certain form element is only applicable to the PC terminal and not to the mobile terminal. A specific element structure can be the specific structure of a specific terminal form element. A specific element attribute can be the relevant attributes of a specific terminal form element. A specific element configuration can be the corresponding configuration content of a specific terminal form element.
[0080] The form configuration file will distinguish between the general attributes of form items and the specific attributes of specific terminals. General attributes can be effective in multiple types of terminals at the same time, while specific attributes will only be effective in their respective terminals. When generating an element description file, general form elements and specific terminal form elements can be determined separately. For each form element, there is a corresponding form structure and form attributes. Therefore, the corresponding form structure and form attributes can be determined for general form elements and specific terminal form elements respectively. Based on the determined general element structure and general element attributes, the corresponding general element configuration can be generated. Based on the determined specific element structure and specific element attributes, the specific element configuration is generated. The general element configuration and the specific terminal element configuration together constitute the element description file.
[0081] For example, a label can be a universal form element. Its functionality remains consistent across both desktop and mobile devices, and subsequent changes to the business only require a single modification for the element to take effect. For example, a specific element configuration can be the display style for different terminal types, such as font size. This configuration requires different values for each terminal, allowing for different configurations to be configured on each terminal.
[0082] Since subsequent business processing can be performed on the initial page form when generating the initial page form, the initial page form can be connected to the access system for subsequent business processing. After the user submits the form, the form data can be sorted and passed to the access system. The access system will execute its subsequent logic (such as saving to the database, etc.) according to the actual business situation. Figure 7 , Figure 7 The following schematically illustrates a flow chart for implementing business logic processing based on form data submitted by a page form according to an exemplary embodiment of the present disclosure. When a user submits a page form, the form data in the submitted page form will be returned in a standard data format, and business logic processing will be performed based on the form data in the returned standard data format.
[0083] refer to Figure 8 , Figure 8 This diagram illustrates page elements with different display styles and the same return data format across different terminals, according to an exemplary embodiment of the present disclosure. Both the PC and mobile terminals contain form elements for "Promotion Method," "Promotion Platform," and "Target Audience," and these form elements return data in the same format. For developers, the consistent format of returned data across terminals allows for maximum code reuse.
[0084] In an exemplary embodiment of the present disclosure, multiple candidate states corresponding to form elements are determined, and candidate state information of each candidate state is determined; the candidate state information includes a state identifier and a state trigger source; a business requirement document is obtained, and state logic is arranged according to the business requirement document, the state identifier, and the state trigger source to obtain state transition logic; and the form interaction logic is determined according to the dynamic transition result corresponding to the state transition logic.
[0085] Among them, the candidate state can be an optional state corresponding to a form element. The candidate state information can be the relevant information corresponding to the candidate state. The state identifier can be a keyword used to record a specific state, and the state identifier is globally unique. The state name can record the business state name of the state, so that its business logic can be intuitively displayed when writing the state; the state value usually only supports true (true) and false (false), and the state of the array changes according to the changes of the form elements in the array. The state trigger source can be the source of the trigger event that causes the state change; for example, the state trigger source can include page-based triggering and code-based triggering. The business requirement file can be the requirement file corresponding to the implementation of certain specific businesses in the form generation process. The dynamic conversion result can be the state conversion result generated after the trigger event of the state transition of a form element occurs.
[0086] After determining the status information of each form element, the corresponding state transition logic can be determined. For example, the present disclosure provides two ways to change the current state of a form element: (1) page triggering. For example, the user selects an option. (2) code method to change the state. For example, by obtaining data through an interface to change the state, such as changing the identity of the currently logged-in user. When multiple states of a form element are determined, a business requirement file can be obtained, and the state logic can be arranged according to the actual business in the business requirement file. For example, the supported logic includes: and (&&), or (||), not (!) and brackets (). Through state arrangement, a complex combination of multiple states can be achieved, and the state transition logic can be obtained. Then, based on the real-time status of each state and combined with the state transition logic, the final result can be dynamically generated, returning true or false, so as to implement the form interaction logic according to the generated dynamic conversion result.
[0087] For example, component properties can be changed according to dynamic conversion results. The changeable properties include: component-show / hide, component-enable / disable, component assignment, component options-show / hide, component options-enable / disable, component options-uncheck, and custom state monitoring state can realize personalized business logic through logic arrangement.
[0088] In an exemplary embodiment of the present disclosure, the form parsing engine and terminal component library corresponding to each terminal are determined respectively; when the element type is a general form element, the general element configuration is obtained based on the form configuration file; the form parsing engine generates a corresponding initial page form at each terminal according to the general element configuration and each terminal component library; when the element type is a specific terminal form element, the specific element configuration is obtained based on the form configuration file; the form parsing engine generates a corresponding initial page form at each terminal according to the specific element configuration and each terminal component library.
[0089] The form parsing engine may be a code snippet for parsing a form configuration file and generating a page form in a target page. The terminal component library may be a component library that defines page components corresponding to the terminal.
[0090] refer to Figure 9 , Figure 9 A flowchart illustrating the generation of an initial page form based on general and specific element configurations according to an exemplary embodiment of the present disclosure is schematically shown. When generating page forms on a PC and a mobile device, the PC's front-end parsing engine and basic component library can generate a page form on the target page on the PC based on the PC's specific and general element configurations. Alternatively, the mobile device's front-end parsing engine and basic component library can generate a page form on the target page on the mobile device based on the mobile device's specific and general element configurations.
[0091] In an exemplary embodiment of the present disclosure, the current state of a form element is determined; a state switching process is performed on the current state based on a state change trigger event and form business logic to obtain a corresponding state switching result; and form business interaction is performed according to the state switching result.
[0092] The current state may be the current specific state of the form element. The state switching process may be the switching process of switching the form element from one state to another. The state switching result may be the result obtained after the state switching process is performed on the form element.
[0093] refer to Figure 10 , Figure 10 The following schematically illustrates a flowchart for implementing form business logic according to an exemplary embodiment of the present disclosure. For a candidate state of a form element, the element state can be changed through user operations, code changes (such as database value retrieval and custom judgment, etc.). For each candidate state, a global state can be corresponding, and the corresponding current state can be monitored in the form item that needs to be changed. If the current state changes, the final result of the calculation state is output in real time through the pre-arranged logical relationship, and acts on the form item to realize the interactive action on the page.
[0094] State logic orchestration is used because there are some complex interaction scenarios in actual business, such as a field being controlled by multiple other factors. Logic orchestration can be used to freely combine the logical relationships in the business and cover the widest range of business scenarios. Through state orchestration processing, the logical relationships of the pages can be freely arranged to implement the page interaction logic in most scenarios, and most of the interaction needs in actual business can be realized without limiting business attributes. Configurable development of the business can be achieved in multiple scenarios. In addition, this solution can unify the business logic configuration, reduce the amount of code development, and make the business logic transparent. Product personnel, testers, and operations personnel involved in the entire life cycle of software development can also test the business logic or write part of the business logic, reducing the probability of system errors and improving system stability.
[0095] The above solution can be effective on both PC and mobile terminals. It only needs to be configured once and it will take effect on both ends at the same time, thus ensuring the consistency of business logic.
[0096] In an exemplary embodiment of the present disclosure, in response to a form verification request for a form business interaction, the form verification logic is obtained from a form configuration file; the form parsing engine of each terminal is obtained, and the form parsing engine parses and processes the form verification logic to obtain a corresponding verification logic parsing file; the verification logic parsing file is executed to determine the form verification result based on the form verification request.
[0097] The form verification request may be a request for logic verification of the form business interaction of the initial page form. The verification logic parsing file may be a file obtained by parsing the form verification logic.
[0098] When the user clicks Submit or changes the form content, a logical check is triggered, generating a corresponding logical check request. In response to the logical check request, the form verification logic is retrieved from the form configuration file. The form engine parses the obtained form verification logic to obtain the corresponding verification logic parsing file. This verification logic parsing file is executed and the form verification result is returned. For example, if the form is submitted after the verification passes, an error message will be displayed if the verification fails, and the form submission will be prevented.
[0099] Through the above processing method, the verification logic of the PC and mobile terminals can use the same set of codes, thereby ensuring logical consistency and reducing repeated development. For future business upgrades, only one code modification is required to ensure code consistency on both ends.
[0100] In summary, a preconfigured form configuration file is obtained; the form configuration file includes form elements, element descriptions of the form elements, and form business logic corresponding to multiple different types of terminals; a corresponding initial page form is generated on each terminal based on the element descriptions of the form elements; in response to a state change trigger event for the form elements, form business interaction of the initial page form is triggered based on the state change trigger event and the form business logic; a logic verification process is performed on the initial page form generating the form business interaction in each terminal, obtaining a logic verification result, and then generating a corresponding target page form on each terminal based on the logic verification result. On the one hand, by preconfiguring the page element description information and form business logic in the form configuration file, most of the form interaction logic in the form generation process can be implemented in a configuration-based manner. On the other hand, because the form business interaction in the page form is triggered based on the form business logic in the form configuration file, business logic can be reused to the greatest extent possible across multiple terminals, reducing duplication and repeated development workload while ensuring consistency of business functions on both terminals. On the other hand, because the form business logic is stored in the form configuration file, subsequent business upgrades can be developed once based on the form configuration file, maintaining consistency in business logic across multiple terminals and reducing the cost of separate development for multiple terminals.
[0101] It should be noted that although the steps of the method of the present invention are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in this specific order, or that all steps must be performed to achieve the desired results. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0102] In addition, in this exemplary embodiment, a form generating device is also provided. Figure 11 The form generating apparatus 1100 may include: a configuration file acquiring module 1110 , an initial form generating module 1120 , a form business interaction module 1130 and a target form generating module 1140 .
[0103] Specifically, the configuration file acquisition module 1110 is used to obtain a pre-configured form configuration file; the form configuration file includes form elements corresponding to multiple different types of terminals, element description information of the form elements, and form business logic; the initial form generation module 1120 is used to generate a corresponding initial page form in each terminal based on the element description information of the form elements; the form business interaction module 1130 is used to respond to a state change trigger event for the form element, and trigger the form business interaction of the initial page form based on the state change trigger event and the form business logic; the target form generation module 1140 is used to perform logic verification processing on the initial page form that generates form business interaction in each terminal, obtain a logic verification result, and generate a corresponding target page form in each terminal according to the logic verification result.
[0104] In an exemplary embodiment of the present disclosure, the form generation device also includes a component generation module, which is used to obtain a custom component template corresponding to each terminal; the custom component template is generated based on the extended implementation logic of the corresponding terminal; the custom component template is injected into the initial page form to perform component parsing processing at a specific page position of the initial page form to obtain an initial custom component; the component interaction logic and component verification logic corresponding to the initial custom component are determined; and a custom component is generated at a specific page position based on the page interaction logic and component verification logic to obtain a target page form.
[0105] In an exemplary embodiment of the present disclosure, the form generation device also includes a configuration file generation module, which is used to determine the form elements used for form generation, perform abstract description processing on the form elements, and obtain corresponding element description files; the element description files include element description information; determine the state information and state transition logic of the form elements, and generate form interaction logic based on the state information and state transition logic; determine the verification logic corresponding to the form elements, and generate corresponding verification source files based on the verification logic; obtain pre-written custom extension logic, and generate a form configuration file based on the element description file, form interaction logic, verification source file and custom extension logic.
[0106] In an exemplary embodiment of the present disclosure, the configuration file generation module includes an element file generation unit, which is used to perform abstract description processing on the general form element to obtain the general element structure and general element attributes of the general form element; generate the general element configuration of the general form element based on the general element structure and general element attributes; perform abstract description processing on the specific end form element to obtain the specific element structure and specific element attributes of the specific end form element; generate the specific element configuration of the specific end form element based on the specific element structure and specific element attributes; and generate an element description file based on the general element configuration and the specific element configuration.
[0107] In an exemplary embodiment of the present disclosure, the configuration file generation module includes an interaction logic determination unit for determining multiple candidate states corresponding to form elements and determining candidate state information for each candidate state; the candidate state information includes a state identifier and a state trigger source; obtaining a business requirement file, and performing state logic arrangement based on the business requirement file, the state identifier, and the state trigger source to obtain state transition logic; and determining the form interaction logic based on the dynamic transition result corresponding to the state transition logic.
[0108] In an exemplary embodiment of the present disclosure, the initial form generation module includes an initial form generation unit, which is used to respectively determine the form parsing engine and terminal component library corresponding to each terminal; when the element type is a general form element, the general element configuration is obtained based on the form configuration file; the form parsing engine generates a corresponding initial page form at each terminal according to the general element configuration and each terminal component library; when the element type is a specific terminal form element, the specific element configuration is obtained based on the form configuration file; the form parsing engine generates a corresponding initial page form at each terminal according to the specific element configuration and each terminal component library.
[0109] In an exemplary embodiment of the present disclosure, the form business interaction module includes a form business interaction unit, which is used to determine the current state of the form element; perform state switching processing on the current state based on the state change trigger event and the form business logic to obtain the corresponding state switching result; and perform form business interaction according to the state switching result.
[0110] In an exemplary embodiment of the present disclosure, the target form generation module includes a logic verification unit for obtaining form verification logic from a form configuration file in response to a form verification request for a form business interaction; obtaining a form parsing engine of each terminal, and having the form parsing engine parse the form verification logic to obtain a corresponding verification logic parsing file; and executing the verification logic parsing file to determine a form verification result based on the form verification request.
[0111] The specific details of the virtual modules of each of the above-mentioned form generating devices have been described in detail in the corresponding form generating methods, and thus will not be repeated here.
[0112] It should be noted that although the detailed description above mentions several modules or units of the form generation device, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in a single module or unit. Conversely, the features and functions of a single module or unit described above can be further divided and embodied by multiple modules or units.
[0113] In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
[0114] Those skilled in the art will appreciate that various aspects of the present invention may be implemented as systems, methods, or program products. Accordingly, various aspects of the present invention may be implemented as a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or a combination of hardware and software embodiments, which may be collectively referred to herein as "circuits," "modules," or "systems."
[0115] Refer to the following Figure 12 12 is a diagram to describe an electronic device 1200 according to such an embodiment of the present disclosure. Figure 12 The electronic device 1200 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0116] like Figure 12 As shown, electronic device 1200 is implemented as a general-purpose computing device. Components of electronic device 1200 may include, but are not limited to, the aforementioned processing units 1210, the aforementioned storage units 1220, a bus 1230 connecting various system components (including storage units 1220 and processing units 1210), and a display unit 1240.
[0117] The storage unit stores program codes, which can be executed by the processing unit 1210, so that the processing unit 1210 performs the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification.
[0118] The storage unit 1220 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 1221 and / or a cache memory unit 1222 , and may further include a read-only memory unit (ROM) 1223 .
[0119] The storage unit 1220 may also include a program / utility 1224 having a set of program modules 1225, such program modules 1225 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include an implementation of a network environment.
[0120] The bus 1230 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0121] The electronic device 1200 can also communicate with one or more external devices 1270 (e.g., a keyboard, a pointing device, a Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 1200, and / or any device that enables the electronic device 1200 to communicate with one or more other computing devices (e.g., a router, a modem, etc.). Such communication can occur via an input / output (I / O) interface 1250. Furthermore, the electronic device 1200 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 1260. As shown, the network adapter 1260 communicates with other modules of the electronic device 1200 via a bus 1230. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 1200, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0122] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
[0123] In exemplary embodiments of the present disclosure, a computer-readable storage medium is also provided, storing a program product capable of implementing the aforementioned methods of this specification. In some possible embodiments, various aspects of the present invention may also be implemented in the form of a program product comprising program code. When the program product is executed on a terminal device, the program code is configured to cause the terminal device to perform the steps according to various exemplary embodiments of the present invention described in the "Exemplary Methods" section of this specification.
[0124] refer to Figure 13 , a program product 1300 for implementing the above-described method according to an embodiment of the present invention is described. The program product 1300 may be a portable compact disc read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0125] The program product may be implemented in any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0126] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0127] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0128] The program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and the like, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0129] Furthermore, the above-described figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention and are not intended to be limiting. It is readily understood that the processes illustrated in the above-described figures do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0130] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow from the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the claims.
[0131] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A form generation method, characterized in that: include: Obtaining a pre-configured form configuration file; the form configuration file includes form elements corresponding to multiple different types of terminals, element description information of the form elements, and form business logic; generating a corresponding initial page form on each of the terminals based on the element description information of the form element; In response to a state change triggering event for the form element, triggering a form business interaction of the initial page form based on the state change triggering event and the form business logic; The initial page form generating the form business interaction in each terminal is logically checked to obtain a logic check result, so as to generate a corresponding target page form in each terminal according to the logic check result, and the business logic of the target page form of each terminal is consistent.
2. The method according to claim 1, characterized in that The method further comprises: Obtaining a custom component template corresponding to each of the terminals; wherein the custom component template is generated based on an extended implementation logic of the corresponding terminal; Injecting the custom component template into the initial page form to perform component parsing processing at a specific page position of the initial page form to obtain an initial custom component; Determine the component interaction logic and component verification logic corresponding to the initial custom component; A custom component is generated at the specific page location based on the page interaction logic and the component verification logic to obtain a target page form.
3. The method according to claim 1, characterized in that Before obtaining the pre-configured form configuration file, the method further includes: Determining a form element for form generation, performing abstract description processing on the form element, and obtaining a corresponding element description file; the element description file includes the element description information; Determine the state information and state transition logic of the form element, and generate form interaction logic according to the state information and the state transition logic; Determine the verification logic corresponding to the form element, and generate a corresponding verification source file according to the verification logic; A pre-written custom extension logic is obtained, and the form configuration file is generated according to the element description file, the form interaction logic, the verification source file and the custom extension logic.
4. The method according to claim 3, characterized in that The form elements include general form elements and specific end form elements; Perform abstract description processing on the form element to obtain the corresponding element description file, including: Performing abstract description processing on the general form element to obtain the general element structure and general element attributes of the general form element; Generate a general element configuration of the general form element according to the general element structure and the general element attributes; Performing abstract description processing on the specific end form element to obtain a specific element structure and specific element attributes of the specific end form element; Generate a specific element configuration of the specific end form element according to the specific element structure and the specific element attribute; The element description file is generated according to the general element configuration and the specific element configuration.
5. The method according to claim 3, characterized in that Determining the state information and state transition logic of the form element, and generating form interaction logic according to the state information and the state transition logic, including: Determine multiple candidate states corresponding to the form element, and determine candidate state information for each candidate state; the candidate state information includes a state identifier and a state trigger source; Obtaining a business requirement document, and performing state logic arrangement according to the business requirement document, the state identifier, and the state trigger source to obtain state transition logic; The form interaction logic is determined according to the dynamic conversion result corresponding to the state conversion logic.
6. The method according to claim 1, characterized in that The form elements include general form elements and specific end form elements; Generating a corresponding initial page form on each of the terminals based on the element description information of the form element includes: Determining the form parsing engine and terminal component library corresponding to each terminal; When the element type is a general form element, obtaining a general element configuration based on the form configuration file; The form parsing engine generates a corresponding initial page form on each terminal according to the common element configuration and each terminal component library; When the element type is a specific end form element, obtaining a specific element configuration based on the form configuration file; The form parsing engine generates a corresponding initial page form on each terminal according to the specific element configuration and each terminal component library.
7. The method according to claim 1, characterized in that Triggering the form business interaction of the initial page form based on the state change triggering event and the form business logic includes: Determining a current state of the form element; Performing state switching processing on the current state based on the state change triggering event and the form business logic to obtain a corresponding state switching result; The form business interaction is performed according to the state switching result.
8. The method according to claim 1, characterized in that Performing logic verification processing on the initial page form generating the form business interaction in each terminal, including: In response to a form verification request for the form business interaction, obtaining form verification logic from the form configuration file; Obtaining a form parsing engine of each terminal, and having the form parsing engine parse the form verification logic to obtain a corresponding verification logic parsing file; The verification logic parsing file is executed to determine a form verification result based on the form verification request.
9. A form generating device, characterized in that: include: A configuration file acquisition module is used to acquire a pre-configured form configuration file; the form configuration file includes form elements corresponding to multiple different types of terminals, element description information of the form elements, and form business logic; An initial form generating module, configured to generate a corresponding initial page form on each of the terminals based on the element description information of the form elements; A form business interaction module, configured to respond to a state change trigger event for the form element and trigger the form business interaction of the initial page form based on the state change trigger event and the form business logic; The target form generation module is used to perform logic verification on the initial page form that generates form business interaction in each terminal, obtain logic verification results, and generate corresponding target page forms in each terminal according to the logic verification results. The business logic of the target page forms of each terminal is consistent.
10. An electronic device, characterized in that: include: processor; as well as A memory having computer-readable instructions stored thereon, wherein the computer-readable instructions, when executed by the processor, implement the form generating method according to any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the form generating method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Form page document generation method and device and form page rendering method and device
CN110889270A
Form interface adaptation display method and device and storage medium
CN112711414A