Form generation method and device, electronic equipment and storage medium
By receiving form component configuration and generating database tables, the problems of high cost of form modification and low configuration efficiency in the prior art are solved, and the efficient form generation and consistency of data flow are achieved.
Patent Information
- Application Number
- CN202411695897.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-03-14
AI Technical Summary
The existing form generation methods have problems such as high modification cost and low configuration efficiency. Especially when information changes in the form, developers need to modify the underlying logical code and re-publish it.
By receiving the sequential configuration of the form components, a database table is generated, and the fields and fields types to be structured are determined according to the component name and identity, the database table is automatically processed to generate the target form.
Reduces the cost of form modification and improves the efficiency of form configuration, so that developers only need to pay attention to the configuration operations of form components, no need to pay attention to complex structures and field settings, ensures the consistency between the target form and the database table, and achieves efficient data flow.
Smart Images

Figure CN119623443A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a form generation method, device, electronic device and storage medium. Background Art
[0002] In today's era of rapid development of information technology, electronic forms have been widely used on various electronic platforms such as web pages and mobile applications due to their many advantages such as easy and quick filling out, efficient data processing, and easy dissemination and sharing.
[0003] At present, most of the existing form generation methods are achieved through code development. The specific operation process is generally that before developers start writing code, they must first clarify the information to be collected, and formulate corresponding rules for each information to be collected, such as determining the type of each information, setting relevant restrictions, planning the linkage relationship between information, and the processing and storage of each information; then, in the actual code writing process, the previously determined information to be collected and the corresponding rules must be filled in the code one by one; finally, by running the written code program, the form can be successfully created.
[0004] However, when using the existing form generation method, if a certain information in the form is changed, the developer needs to modify the underlying logic code and republish the modified code. The existing form generation method has problems such as high modification cost and low configuration efficiency. Summary of the invention
[0005] The present application provides a form generation method, device, electronic device and storage medium, which can reduce the cost of form modification and improve the efficiency of form configuration.
[0006] In a first aspect, the present application provides a form generation method, comprising:
[0007] Receiving a database table obtained after sequentially configuring at least one form component, the database table includes a component name and a component identifier corresponding to each form component;
[0008] For the current form component, determine the field to be structured according to the component name, and determine the field type of the field to be structured according to the component identifier;
[0009] The database table is processed based on the to-be-structured fields corresponding to each of the form components and the field types of the to-be-structured fields to generate a target form.
[0010] In a second aspect, the present application provides a form generating device, the device comprising:
[0011] A configuration module, used for receiving a database table obtained after sequentially configuring at least one form component, wherein the database table includes a component name and a component identifier corresponding to each form component;
[0012] A determination module, configured to determine, for a current form component, a field to be structured according to the component name, and determine a field type of the field to be structured according to the component identifier;
[0013] The processing module is used to process the database table based on the to-be-structured fields corresponding to each of the form components and the field types of the to-be-structured fields to generate a target form.
[0014] In a third aspect, the present application further provides an electronic device, the electronic device comprising:
[0015] at least one processor; and
[0016] a memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the form generation method described in any embodiment of the present application.
[0018] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the form generation method described in any embodiment of the present application when executed.
[0019] In a fifth aspect, the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the form generation method described in any embodiment of the present application.
[0020] The form generation solution provided in the embodiment of the present application first configures at least one form component in sequence, so that developers only need to focus on the configuration operation of each form component according to business needs, without having to focus on the complex structure of the form to be generated and the setting of all fields, which helps to save development time and improve form generation efficiency; secondly, the method of determining the field to be structured by the component name corresponding to each form component and determining the field type of the field to be structured according to the component identifier to process the database table to generate the target form helps to ensure the consistency between the target form and the database table, so that data can be efficiently transferred between form filling and database storage; further, in the maintenance stage, the database table can automatically update the corresponding field update by simply modifying the corresponding configuration information of a certain form component, without modifying the underlying logic code, thereby achieving the beneficial effects of improving form generation efficiency, reducing form modification costs and improving form configuration efficiency.
[0021] It should be noted that the above computer instructions may be stored in whole or in part on a computer-readable storage medium, wherein the computer-readable storage medium may be packaged together with the processor of the form generating device, or may be packaged separately from the processor of the form generating device, which is not limited in this application.
[0022] The description of the second, third, fourth and fifth aspects of the present application can refer to the detailed description of the first aspect; and the beneficial effects of the description of the second, third, fourth and fifth aspects can refer to the beneficial effect analysis of the first aspect, which will not be repeated here.
[0023] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description.
[0024] It is understandable that before using the technical solutions disclosed in the embodiments of this application, the type, scope of use, and usage scenarios of the personal information involved in this application 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. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0026] Figure 1It is a flowchart of the form generation method provided in the embodiment of the present application;
[0027] Figure 2 It is a schematic diagram of an interface for configuring a form component provided in an embodiment of the present application;
[0028] Figure 3 A schematic diagram of an interface for modifying target field information provided in this embodiment;
[0029] Figure 4 is a structural schematic diagram of a form generating device provided in an embodiment of the present application;
[0030] Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the present application will be clearly and completely described below in conjunction with the drawings in the present embodiment. Obviously, the described embodiment is only a part of the embodiment of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present application.
[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0033] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only the parts related to the present application, rather than all structures, are shown in the accompanying drawings.
[0034] Figure 1A flowchart of a form generation method provided in an embodiment of the present application is provided. This embodiment is applicable to the case of generating an electronic form from the developer's perspective. The method can be executed by a form generation device, which can be implemented in the form of hardware and / or software and integrated in an electronic device that executes the method. Preferably, the electronic device in the embodiment of the present application can be a server, or a computer device, etc.
[0035] refer to Figure 1 The form generation method of this embodiment includes but is not limited to the following steps:
[0036] S110: receiving and sequentially configuring at least one form component to obtain a database table.
[0037] From the perspective of user interaction and function realization, form components can be interpreted as: independent units in a form that can be directly seen and operated by users and used to complete specific information collection or function realization. For example, form components contained in a database table may include text boxes, drop-down menus, radio buttons, check boxes, and date pickers.
[0038] The purpose of configuring at least one form component in this embodiment is that, since the form component only represents a general interactive element in the initial state, for example, the text box only provides an area for inputting text, and the drop-down box only provides the function of selecting options, etc., they themselves do not have actual meaning for specific business scenarios. Therefore, the form component needs to be configured according to the actual business scenario, such as setting the name of the text box component to "employee name" or "customer order number", etc., so that the specific meaning of the data collected by the component in the business scenario can be clarified, and the data usage of each form component is defined. Further, according to business needs, different data needs to follow specific format requirements. By configuring the relevant properties of the form component, such as setting the data type (text type, numeric type, date type, etc.), length limit, whether it is required, etc., the data format entered by the user can be standardized. For example, for a "mobile phone number" form component, its data type is configured as numeric type and the length is 11 digits, and it is set as a required item, so that the mobile phone number entered by the user meets the correct format requirements, avoiding data processing problems caused by non-standard formats, such as being able to proceed more smoothly in subsequent data storage, query, analysis and other operations.
[0039] After configuring each form component on the configuration side, the server side can generate a database table based on the submitted configuration information, and obtain the database table including the component name and component identifier corresponding to each form component. In this embodiment, developers only need to focus on the configuration operation of each form component according to business needs, without having to focus on the complex structure of the form to be generated and the settings of all fields, which helps save development time and improve form generation efficiency.
[0040] Among them, the component name can be the name after the form component is named. For example, when the name and gender information need to be counted in an information statistics business scenario, the component name of the "text box" form component is "name", and the current "name" is the component name of the text box form component; if the component name of the "selector" form component is "gender", and "male" and "female" are set in the drop-down menu, the current "gender" is the component name of the "selector component". The component name in this embodiment is obtained after configuring each form component; the component identification is used to indicate the type, characteristics and role of each component in the entire form system and subsequent data processing flow. Through the component identification system, various operations and data related to it can be quickly identified and processed. The component identification is a unique identifier formulated for each form component during the design phase. For example, taking the "digital input box" form component as an example, the corresponding component identification is "001". When the server receives the current component identification, it can be clearly understood that the field type corresponding to the current component is a numeric type, etc.
[0041] For a preferred implementation, please refer to Figure 2 , Figure 2 It is a schematic diagram of an interface for configuring a form component provided in this embodiment. Specifically, the specific implementation method of receiving the database table obtained after sequentially configuring at least one form component provided in this embodiment can be implemented by referring to the following steps a) to c):
[0042] a) determining the current form component as a target component, and upon receiving the target component determined based on a preset operation from the component selection area of the first interface, displaying the to-be-configured information of the target component in the component configuration area.
[0043] based on Figure 2 It can be seen that, before configuring the form component, the present embodiment pre-sets a visualization interface to implement visualization configuration of the form component based on the visualization interface. The visualization interface provided by the present embodiment may include a component selection area, a middle area, and a component configuration area.
[0044] Specifically, the component selection area is used to display various form components available for selection, such as text boxes, drop-down boxes, radio buttons, and check boxes, and is intuitively presented in list form or icon form, making it easy for users to select form components according to actual business needs.
[0045] The above-mentioned middle area is used to determine the target component. Specifically, when a form component is detected to be moved from the component selection area to the middle area based on a preset operation, the current form component can be determined as the target component. The preset operation can be drag and drop operations; for example, when the middle area detects that the icon of a form component (such as an icon representing "information text") is dragged to the middle area, the "information text" form component is determined to be the target component.
[0046] The component configuration area is used to display the information to be configured of the selected target component. Among them, the corresponding information template to be configured is pre-set for each form component in the form component setting stage. This information may include component name, data type, whether it is required, default value, prompt information, etc. according to the different uses of the component. Then, when the information to be configured of the target component is displayed in the component configuration area, it is displayed according to the pre-set information template to be configured. Exemplarily, taking the "information text" form component as the target component, the information to be configured that can be displayed in the corresponding information template to be configured can be: component name (such as information text); display name (such as name); data type (can be set to "text type" by default); whether it is required (can be set to "yes"); prompt information (such as "please enter your user name") and other contents. Optionally, for other types of form components, the corresponding information to be configured may also include configuration contents such as value acquisition method and verification strategy. The content of the information to be configured corresponding to each form component displayed in the component configuration area is not limited here.
[0047] b) receiving the configuration of the target component from the component configuration area, generating component configuration information of the target form component, and storing the component configuration information of the target form component to the second interface.
[0048] After the developer implements the configuration operation of the target component in the first interface according to business needs, in order not to affect the configuration of the next form component, the solution provided in this embodiment can store the component configuration information of the current target form component in the second interface. Specifically, the method of storing the component configuration information of the target form component from the first interface to the second interface can be that the first interface includes a "temporary save" button, so that after receiving the temporary save indication corresponding to the "temporary save" button, the component configuration information of the target form component is stored in the second interface, and the information to be configured set in the component configuration area in the first interface is initialized, so as not to affect the configuration operation of the next form component.
[0049] c) Determine the next form component as the target component, and repeatedly perform the operation of displaying the target component's information to be configured in the component configuration area when receiving the target component determined based on the preset operation from the component selection area of the first interface, until at least one form component is fully configured, and obtain the database table based on the component configuration information corresponding to each form component in the second interface.
[0050] Usually a form contains multiple types of form components, or the same type of form component is used multiple times, such as a text box component, which can be used to describe multiple fields such as "name", "home address" and "education". Therefore, after setting up a form component, you need to repeat steps a) and b) for the next form component until all components required for the target form are configured.
[0051] When all form components are configured, a database table is obtained based on the component configuration information corresponding to each form component in the second interface. Specifically, the system will automatically build the structure of the database table based on these stored component configuration information, such as the name and data type of each component. For example, if there is configuration information for form components such as "employee name" (text type), "employee age" (integer type), and "department" (text type); then after all form components are configured, you can click the "Save" button in the first interface to submit the component configuration information set by the developer for each form component to the server, so that the server generates a database table based on the component configuration information set for each form component.
[0052] Based on the method provided in this embodiment of sequentially configuring at least one form component to obtain a database table, developers can intuitively see the available form components and quickly see the information to be configured in the configuration area after selecting. This visual operation method greatly improves the speed of configuring form components; and in the process of setting up the form, developers only need to focus on the configuration operations of each form component according to business needs, without having to pay attention to the complex structure of the form to be generated and the settings of all fields, which helps to save development time and improve form generation efficiency.
[0053] S120: For the current form component, determine the field to be structured according to the component name, and determine the field type of the field to be structured according to the component identifier.
[0054] During the form component design phase, a mapping relationship between the form component name and the field to be structured in the database table can be pre-established. Therefore, when the component name of the current form component is received, the field to be structured can be determined through the pre-defined mapping relationship. For example, the pre-defined component name is "name of the person filling out the form" corresponding to the "create_uname" field in the database table as the field to be structured. When the component name of "name of the person filling out the form" is received, the system will parse the component name by querying the pre-established mapping relationship, thereby determining that the corresponding field to be structured is "create_uname", so that the data of this field can be processed and stored later.
[0055] By determining the field type of the field to be structured based on the component identifier, it is possible to ensure that the data entered into the field complies with the corresponding format specifications, thereby achieving accurate storage. For example, for the "date" field, once its field type is determined to be a date (datetime) type, all data entered into the field must comply with the date format requirements, so that the format of the date data will remain consistent throughout the entire data processing process, avoiding subsequent data processing problems caused by confusing data formats, such as inconsistent date formats when generating reports, which may lead to report errors. Similarly, for other data types such as text, integer, etc., clear field types also prompt data to be processed in a unified format at all stages, improving the standardization and consistency of data.
[0056] In another preferred embodiment, in this embodiment, the implementation method of determining the field type of the field to be structured according to the component identifier can be: determining whether the current form component needs to be structured according to the component identifier; if necessary, determining the component type of the current form component according to the component identifier, so as to determine the field type of the field to be structured according to the component type, and the component type corresponds to the field type. In this embodiment, the field type is converted according to the component type of the form component to ensure that the type of the library table field matches the data type collected by the form component, which is convenient for subsequent data storage and processing.
[0057] Since the component type corresponding to each form component has been preset in the configuration stage, after obtaining the database table, the component type corresponding to the current component can be directly obtained according to the known component identifier, so as to convert the field type of the structured field according to the component type.
[0058] Since not all form components need to be structured, first determine whether the current form component needs to be structured based on the component identifier. For example, for the "container" form component, it is a style component and does not need to be structured; for the "information text" form component, it generally involves fixed text and dynamic text, among which, in the dynamic text, it is dynamic data and needs to be converted to a character (varchar) type according to the component identifier of the "information text"; in the fixed text, it is static data and does not need to be structured, etc. The specific current text identifier is dynamic text or static text, which can be known when configuring the form component; for the "single-line input box" form component, the corresponding component type is varchar type; the corresponding component type of the "digital input box" form component is converted to an integer (int) type; the corresponding component type of the "multi-line input box" form component is text (text) type, etc. The specific component types corresponding to each form component are not listed here one by one.
[0059] Optionally, in this embodiment, when configuring the form component, some field attributes may also be set, such as length, decimal point, whether it can be empty, primary key and other information using fixed values, etc., so as to obtain more detailed configuration information in the obtained database table.
[0060] S130: Process the database table based on the to-be-structured fields and the field types of the to-be-structured fields corresponding to each form component to generate a target form.
[0061] Based on the setting rules provided in this embodiment, developers only need to pay attention to component style and logic processing when configuring form components, without having to worry about data storage methods and data processing methods. The solution provided in this embodiment can automatically obtain a database table based on the configured form component, and further generate a target form based on the set structured processing rules. Therefore, during the maintenance phase, the database table can automatically update the corresponding fields by simply modifying the corresponding configuration information of a form component in the target form, without modifying the underlying logic code, thereby achieving the beneficial effect of reducing the modification cost of the form.
[0062] A preferred embodiment, the solution provided by this embodiment, after generating the target form, will publish the target form to collect information based on the target form. Then, when the user fills in the information based on the target form, in order to improve the standardized storage of the data filled in by the user and to facilitate data query and in the back end, the solution provided by this embodiment, the target form includes at least one field name, and the following operations can be performed after the target form is generated:
[0063] Receive the field data filled in by the user based on the target field name; perform structured processing on the field data according to the field type corresponding to the target field name to obtain the target field data; store the target field data mapping in the component name corresponding to the target field name, and the field name and the component name correspond to each other.
[0064] The target field name is any field in at least one field name. For example, if the target field name contained in the target form is determined to be "name", when the target form is filled in by the user, such as "Zhang San", in order to accurately store "Zhang San" in the corresponding position to the corresponding position of the component name "name", the field data is structured by the field type corresponding to the target field name to determine the storage, thereby avoiding confusion and errors in data storage and maintaining the standardization and consistency of data storage.
[0065] In another optional manner, when the target form provided in this embodiment is published to users, default field rules can also be set. The default field rules stipulate that all forms must automatically initialize several fields that are not related to the form configuration when they are structured, such as creation time, update time, creator, status, etc. The addition of these default fields further improves the structure of the database table and provides more basic information for the management of form data, such as facilitating data tracing, understanding data change history, clarifying responsible persons, and monitoring data status.
[0066] In order to intuitively demonstrate that the solution provided by this embodiment can reduce maintenance costs, specifically, this solution may also include: receiving an editing operation on the corresponding field information in the target form based on the editing control in the third interface displaying the target form, and updating the target form according to the editing operation. Among them, the third interface is a schematic diagram of the structured information corresponding to the generated target form displayed to developers. The third interface may include information such as the field name, field remarks, field type, component name, component identification, whether it is empty, query index, etc. obtained according to steps S110 to S130. Furthermore, when there is a need to change the information currently displayed, such as deleting a component or changing a field type, the corresponding editing operation can be achieved by operating the "edit" control key corresponding to the field information to be changed.
[0067] Preferably, the editing operation provided in this embodiment may include a modification operation, a new addition operation and a deletion operation.
[0068] Specifically, when the editing operation is a modification operation, the solution provided by this embodiment is: displaying the field configuration information of the target field information on the fourth interface, the field configuration information including at least one of the field name, field description, field type, indexing method, component name and component type; receiving modifications to the field configuration information on the fourth interface, obtaining updated field information, and displaying the updated field information on the third interface.
[0069] Please refer to Figure 3 , Figure 3 A schematic diagram of an interface for modifying target field information provided in this embodiment. Figure 3 In the example scenario, if the corresponding field information of "Project Name" needs to be modified, all field configuration information of "Project Name" is displayed through the fourth interface. Taking the initial index establishment as "Yes" as an example, if it needs to be changed to "No" this time, click the "Save" button in the fourth interface, and change the "Establish Index" control key in the corresponding row of "Project Name" from gray to lit in the third interface. The solution provided in this embodiment does not need to change the underlying logic code when there is a need for modification, thereby reducing maintenance costs.
[0070] In another preferred embodiment, the target form provided in this embodiment includes an unpublished form and a published form, wherein the unpublished form indicates that the current form has not been published to the corresponding web page or platform for user application from the developer's perspective; the published form indicates that the current form has been published to the corresponding web page or platform and has been applied by the user, and then the corresponding data filled in by the user is obtained based on the published form.
[0071] The solution provided by this embodiment, when the editing operation is a deletion operation, when the target form is an unpublished form, receives a deletion operation on a target field in the target form, obtains a first update form, and updates the target form based on the first update form; when the target form is a published form, receives a deletion operation on a target field in the target form, obtains a second update form, updates the target form based on the second update form, and stores field data corresponding to the target field.
[0072] Specifically, the deletion operation can be explained as follows: when the form is not published, the developer can directly delete the corresponding structured field. If the component is deleted, the structured field of the current component will be deleted synchronously; when the form is published, when a form component is revised and deleted, the field can be soft-deleted, that is, it is only hidden in the visual interface, and the instance data generated historically will not be deleted. For example, if the published form contains an "address" field, but after a period of time, it is no longer necessary to collect the content corresponding to the current field, the "address" field can be deleted, and the associated form component is also deleted. In this way, a new form is obtained after the deletion. When it is published again based on the new form, the historical "address" data filled in based on the old form will be stored and will not be deleted.
[0073] In another preferred embodiment, the form generation solution provided in this embodiment can also include a single table or multiple tables embedded in the target form according to business needs. Specifically, the embedded single table or multiple tables are called sub-tables. When the component identifier includes the sub-table identifier, the solution provided in this embodiment can also implement corresponding configuration operations on the sub-table name of the sub-table and the information to be collected in the sub-table during the form component configuration stage, so that the sub-table can be associated with the main table as an independent field of the target, and the sub-table management entrance can be set for display, etc.
[0074] The form generation method provided in this embodiment first configures at least one form component in sequence, so that developers only need to focus on the configuration operation of each form component according to business needs, without having to focus on the complex structure of the form to be generated and the setting of all fields, which helps to save development time and improve form generation efficiency; secondly, the method of processing the database table to generate the target form by determining the field to be structured by the component name corresponding to each form component and determining the field type of the field to be structured according to the component identifier helps to ensure the consistency between the target form and the database table, so that data can be efficiently transferred between form filling and database storage; further, in the maintenance stage, the database table can automatically update the corresponding field update by simply modifying the corresponding configuration information of a certain form component, without modifying the underlying logic code, thereby achieving the beneficial effects of improving form generation efficiency, reducing form modification costs and improving form configuration efficiency.
[0075] Figure 4 Schematic diagram of a form generation device provided in an embodiment of the present application, which is suitable for executing the form generation method provided in an embodiment of the present application. Figure 4 As shown, the device may specifically include: a configuration module 410, a determination module 420 and a processing module 430, wherein:
[0076] Configuration module 410, configured to receive a database table obtained after sequentially configuring at least one form component, wherein the database table includes a component name and a component identifier corresponding to each form component;
[0077] The determination module 420 is used to determine, for the current form component, a field to be structured according to the component name, and to determine a field type of the field to be structured according to the component identifier;
[0078] The processing module 430 is used to process the database table based on the to-be-structured fields corresponding to each of the form components and the field types of the to-be-structured fields to generate a target form.
[0079] The form generation device provided in this embodiment first configures at least one form component in sequence, so that developers only need to focus on the configuration operation of each form component according to business needs, without having to focus on the complex structure of the form to be generated and the setting of all fields, which helps to save development time and improve form generation efficiency; secondly, the database table is processed to generate a target form by determining the field to be structured by the component name corresponding to each form component, and determining the field type of the field to be structured according to the component identifier, which helps to ensure the consistency between the target form and the database table, so that data can be efficiently transferred between form filling and database storage; further, in the maintenance stage, the database table can automatically update the corresponding field update by simply modifying the corresponding configuration information of a certain form component, without modifying the underlying logic code, thereby achieving the beneficial effects of improving form generation efficiency, reducing form modification costs, and improving form configuration efficiency.
[0080] In one embodiment, the configuration module 410 is specifically used to determine that the current form component is the target component, and when receiving the target component determined based on the preset operation from the component selection area of the first interface, display the to-be-configured information of the target component in the component configuration area; receive the configuration of the target component from the component configuration area, obtain the component configuration information of the target form component, and store the component configuration information of the target form component to the second interface; determine the next form component as the target component, and repeatedly perform the operation of displaying the to-be-configured information of the target component in the component configuration area when receiving the target component determined based on the preset operation from the component selection area of the first interface, until at least one of the form components is fully configured, and obtain the database table based on the component configuration information corresponding to each form component in the second interface.
[0081] In one embodiment, the determination module 420 is specifically used to determine whether the current form component needs to be structured according to the component identifier; if necessary, the component type of the current form component is determined according to the component identifier, so as to determine the field type of the field to be structured according to the component type, and the component type corresponds to the field type.
[0082] In one embodiment, the target form includes at least one field name; the device provided by this embodiment further includes: a receiving module and a mapping module, wherein:
[0083] A receiving module, used for receiving field data filled in by a user based on a target field name, wherein the target field name is any field in at least one of the field names;
[0084] The processing module is further used to perform structural processing on the field data according to the field type corresponding to the target field name to obtain the target field data;
[0085] A mapping module is used to store the target field data mapping in the component name corresponding to the target field name, and the field name corresponds to the component name.
[0086] In one embodiment, the device further comprises an editing module;
[0087] The editing module is used to receive an editing operation on the corresponding field information in the target form based on an editing control in a third interface showing the target form, and update the target form according to the editing operation.
[0088] In one embodiment, the editing operation includes a modification operation;
[0089] The editing module is specifically used to display the field configuration information of the target field information on the fourth interface, wherein the field configuration information includes at least one of the field name, field description, field type, indexing method, component name and component type; receive the modification of the field configuration information on the fourth interface, obtain the updated field information, and display the updated field information on the third interface.
[0090] In one embodiment, the target form includes an unpublished form and a published form; and the editing operation includes a deletion operation.
[0091] The editing module is further specifically configured to receive a deletion operation on a target field in the target form when the target form is an unpublished form, obtain a first update form, and update the target form based on the first update form.
[0092] In one embodiment, the target form includes a published form;
[0093] The editing module is further specifically used to obtain a second update form upon receiving a delete operation on a target field in the target form, update the target form based on the second update form, and store field data corresponding to the target field.
[0094] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the functional modules described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0095] An embodiment of the present application also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the form generation method described in any embodiment of the present application.
[0096] An embodiment of the present application further provides a computer-readable medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the form generation method described in any embodiment of the present application when executed.
[0097] Reference below Figure 5 , Figure 5 1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, and shows a schematic diagram of the structure of a computer system 500 suitable for implementing the electronic device in an embodiment of the present application. Figure 5 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0098] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0099] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.
[0100] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present application are executed.
[0101] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer 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 of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, etc., or any suitable combination of the above.
[0102] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0103] The modules and / or units involved in the embodiments described in the present application may be implemented by software or by hardware. The modules and / or units described may also be arranged in a processor, for example, it may be described as follows: a processor includes a configuration module, a determination module, and a processing module. The names of these modules do not, in some cases, constitute limitations on the modules themselves.
[0104] As another aspect, the present application also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by a device, the device includes: receiving a database table obtained after sequentially configuring at least one form component, the database table includes a component name and a component identifier corresponding to each form component; for the current form component, determining a field to be structured according to the component name, and determining a field type of the field to be structured according to the component identifier; processing the database table based on the field to be structured and the field type of the field to be structured corresponding to each form component, and generating a target form.
[0105] According to the technical solution of this embodiment, the method of generating a target form by processing the database table in a manner of determining the field to be structured by the component name corresponding to each form component and determining the field type of the field to be structured according to the component identifier helps to ensure the consistency between the target form and the database table, so that data can flow efficiently between form filling and database storage; further, in the maintenance stage, the database table can automatically update the corresponding field update only by modifying the corresponding configuration information of a certain form component, without modifying the underlying logic code, thereby achieving the beneficial effects of improving form generation efficiency, reducing form modification costs and improving form configuration efficiency.
[0106] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A form generation method, characterized in that: include: Receiving a database table obtained after sequentially configuring at least one form component, the database table includes a component name and a component identifier corresponding to each form component; For the current form component, determine the field to be structured according to the component name, and determine the field type of the field to be structured according to the component identifier; The database table is processed based on the to-be-structured fields corresponding to each of the form components and the field types of the to-be-structured fields to generate a target form.
2. The form generation method according to claim 1, characterized in that: The receiving and sequentially configuring at least one form component to obtain a database table includes: Determine the current form component as a target component, and when receiving the target component determined based on a preset operation from the component selection area of the first interface, display the to-be-configured information of the target component in the component configuration area; Receiving the configuration of the target component from the component configuration area, obtaining the component configuration information of the target form component, and storing the component configuration information of the target form component to the second interface; Determine the next form component as the target component, and repeatedly perform the operation of displaying the information to be configured of the target component in the component configuration area when receiving the target component determined based on the preset operation from the component selection area of the first interface, until at least one of the form components is fully configured, and obtain the database table based on the component configuration information corresponding to each form component in the second interface.
3. The form generation method according to claim 1, characterized in that: The determining the field type of the to-be-structured field according to the component identifier includes: Determining whether the current form component needs to be structured according to the component identifier; If necessary, the component type of the current form component is determined according to the component identifier, so as to determine the field type of the field to be structured according to the component type, and the component type corresponds to the field type.
4. The form generation method according to claim 1, characterized in that: The target form includes at least one field name. After the database table is processed based on the to-be-structured fields and the field types of the to-be-structured fields respectively corresponding to each of the form components to generate the target form, the method further includes: receiving field data filled in by a user based on a target field name, wherein the target field name is any field in at least one of the field names; Performing structural processing on the field data according to the field type corresponding to the target field name to obtain the target field data; The target field data mapping is stored in the component name corresponding to the target field name, and the field name corresponds to the component name.
5. The form generation method according to claim 1, characterized in that: The method further comprises: receiving, in a third interface displaying the target form, an editing operation on corresponding field information in the target form based on an editing control, and updating the target form according to the editing operation; Accordingly, the editing operation includes a modification operation; The updating of the target form according to the editing operation comprises: Displaying field configuration information of the target field information on the fourth interface, the field configuration information including at least one of a field name, a field description, a field type, an indexing method, a component name, and a component type; The modification of the field configuration information is received on the fourth interface, and updated field information is obtained, so as to display the updated field information on the third interface.
6. The form generation method according to claim 5, characterized in that: The editing operation includes a deletion operation; The target form includes an unpublished form; The updating of the target form according to the editing operation comprises: A delete operation on a target field in the target form is received, a first update form is obtained, and the target form is updated based on the first update form.
7. The form generation method according to claim 6, characterized in that: The target form includes a published form; The updating of the target form according to the editing operation comprises: A delete operation on a target field in the target form is received, a second update form is obtained, the target form is updated based on the second update form, and field data corresponding to the target field is stored.
8. A form generating device, characterized in that: include: A configuration module, used for receiving a database table obtained after sequentially configuring at least one form component, wherein the database table includes a component name and a component identifier corresponding to each form component; A determination module, configured to determine, for a current form component, a field to be structured according to the component name, and a field type of the field to be structured according to the component identifier; The processing module is used to process the database table based on the to-be-structured fields corresponding to each of the form components and the field types of the to-be-structured fields to generate a target form.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the form generating method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the form generation method as described in any one of claims 1 to 7 is implemented.