A dynamic form generation method and system based on field format double-layer mapping
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 海看网络科技(山东)股份有限公司
- Filing Date
- 2026-05-09
- Publication Date
- 2026-06-09
AI Technical Summary
Existing technologies lack flexibility in generating service application documents, cannot achieve multiple output formats for the same single-choice field, have high processing costs for complex fields, and lack a systematic field and format mapping mechanism, resulting in high development and maintenance costs and poor scalability.
A dynamic form generation method based on a two-layer mapping of field formats is adopted. Through the first layer mapping between field identifiers and values, combined with the second layer mapping between field types and fill formats, multiple forms of rendering of the same field value are achieved. More than ten field types are handled uniformly, and standardized documents containing dynamic tables and images are automatically generated.
It enables multiple rendering formats for the same field value, reduces code redundancy, improves generation efficiency and flexibility, supports dynamic table expansion and automatic image embedding, and generates documents with a unified and standardized format, suitable for various application scenarios.
Smart Images

Figure CN122174818A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of form generation and document processing technology, specifically a dynamic form generation method and system based on a two-layer mapping of field formats. Background Technology
[0002] Service application documents often need to be automatically generated into standardized Word documents based on form data. The traditional method uses fixed template filling technology, replacing preset placeholders with form data to complete document generation. However, this method lacks flexibility; the selected result of the same radio button field cannot be output in different formats such as Chinese characters, checkmarks, or checkboxes according to business needs; complex fields such as radio buttons with input boxes and dynamic tables require separate development and adaptation logic, resulting in high development and maintenance costs; input content for options with input boxes cannot be dynamically filled or styled; dynamic tables cannot automatically expand rows and copy styles; and embedded images require manual handling.
[0003] In existing technologies, front-end component libraries only solve the form display problem and cannot achieve diversified rendering of data into documents; tools such as POI and Freemarker can achieve template filling, but lack a deep linkage mechanism with form fields. Some solutions attempt to achieve simple rendering by customizing placeholders, but they have not established a systematic field and format mapping mechanism, cannot achieve multiple forms of output for the same field, and require writing a lot of customized code for complex scenarios, resulting in poor scalability.
[0004] Therefore, there is an urgent need for a technical solution that can enable flexible configuration of form fields, unified processing of multiple types of fields, and automated and accurate document generation to overcome the limitations of traditional methods. Summary of the Invention
[0005] The purpose of this invention is to provide a dynamic form generation method and system based on a two-layer mapping of field formats. It realizes multi-form rendering of the same field value, uniformly processes more than ten field types, and automatically generates standardized documents containing dynamic tables and images, significantly improving generation efficiency and flexibility.
[0006] To achieve the above objectives, the present invention employs the following technical solution: On the one hand, this invention provides a dynamic form generation method based on a two-layer mapping of field formats, comprising the following steps: Step S1: Receive and parse the JSON format form configuration and form data transmitted from the front end, extract field identifiers, field types, fill formats and user input values, and build a mapping relationship between fields and configuration parameters; Step S2: Perform a two-layer field-format mapping. The first layer of mapping associates the corresponding user input value with the field identifier, and the second layer of mapping determines the rendering style of the field value in the target document based on the combination of field type and fill format. Step S3: Call the corresponding processing logic according to the field type. Render the text of the basic text type field according to the rendering style. Execute polymorphic rendering of the selection type field. Extract the image path information of the media type field. Trigger the dynamic table processing flow for the composite type field. Step S4: For the list grouping field in the composite type field, identify the starting row, starting column and maximum number of columns of the corresponding table in the target document template, fill the table data into the placeholder row, and dynamically add table rows according to the number of data rows. Perform the two-level mapping of step S2 on each field in the newly added row. Step S5: For the media type field, identify the corresponding image path placeholder, obtain the image file from the object storage service, and embed the image into the corresponding position in the target document; Step S6: Integrate the processing results of steps S2 to S5, perform full rendering on the target document template, including generating conditional underlines, to generate and output a standardized Word document containing the rendering style, dynamic tables and embedded images.
[0007] Preferably, in step S2, the rendering style determined by the second layer mapping includes, for single-selection fields or multi-selection fields: When the fill format is Chinese characters, output the text of the selected option; When the fill format is checkmark fill, a checkmark symbol is added after the text of the selected option, and a blank placeholder is added after the text of the unselected option. When the fill format is checkbox fill, a box with a checkmark indicates the selected option, and a box without a checkmark indicates the unselected option.
[0008] Preferably, in step S3, the field types involved in calling the corresponding processing logic according to the field type include: single-line text type, multi-line text type, mobile phone number type, ID card number type, date type, year and month type, single selection type, multiple selection type, single selection with input box type, multiple selection with input box type, single image type, multiple image type, list grouping type, and grouping field type.
[0009] Preferably, in step S3, when performing option polymorphic rendering on the selection type field, the processing of options with input boxes is also included, specifically: Iterate through the option list of the selection type field. When a preset identifier option is detected in the option list, an input box placeholder composed of the field identifier and a preset suffix is automatically generated after the display text of the preset identifier option. During the document rendering stage, by recognizing the input box placeholder, the user's custom text content entered in the corresponding input box at the front end of the form is dynamically filled into the placeholder position, and an underline style is automatically added below the custom text content; The automatic underline style is achieved through a separate underline control placeholder, which is associated with the input box placeholder.
[0010] Preferably, in step S4, the dynamic addition of new table rows includes the following steps: Step S41: Read the predefined table placeholder rows in the target document template, wherein the placeholder rows include field placeholders for the corresponding list grouping fields; Step S42: Calculate the number of new table rows required based on the number of data rows in the list grouping fields of the form data submitted by the user; Step S43: Based on the required number of new table rows, add the same number of table rows below the placeholder row by copying them row by row; Step S44: For each newly added table row, iterate through all the cells inside it, and copy the font style, border style, and alignment style of the cells corresponding to the placeholder row and apply them to the corresponding cells of the newly added row. Step S45: Fill the corresponding data in the form data into the corresponding cell placeholders of the newly added row according to the field-format two-layer mapping rule in step S2.
[0011] Preferably, in step S5, embedding the image into the corresponding location of the target document includes the following steps: Step S51: Extract the storage path string of the image in the object storage service from the image path placeholder corresponding to the media type field; Step S52: When the stored path string contains several image paths separated by commas, split the stored path string by commas to obtain each independent image path; Step S53: Read the corresponding binary data stream of each image sequentially according to each independent image path through the client interface of the object storage service; Step S54: Call the image addition method provided by the document operation tool to embed the read image binary data stream into the corresponding paragraph or cell placeholder position in the target document one by one; Step S55: When calling the image addition method, read the image width and image height values preset in the JSON configuration for the media type field, convert the image width and image height values into standard image size units applicable to the document operation tool, and then pass them as parameters.
[0012] Preferably, in step S6, generating the conditional underline specifically includes: The system determines whether to add an underline to the current text content by using a preset first underline control placeholder. When the value of the first underline control placeholder is true, the system calls the font style interface of the document rendering module to enable the underline effect for the corresponding text content. When the value of the first underline control placeholder is false, the system does not enable the underline effect for the corresponding text content. By using a preset second underline control placeholder, a blank placeholder area with an underline style is pre-generated in the document. This blank placeholder area is used to align and concatenate with user-defined text content with input box options in subsequent steps.
[0013] On the other hand, the present invention also provides a dynamic form generation system based on a two-layer field format mapping, for implementing the dynamic form generation method based on a two-layer field format mapping as described above, including: The JSON configuration parsing module is used to receive and parse the form configuration and form data transmitted from the front end, and extract field identifiers, field types, fill formats and user input values; The field-format two-level mapping module performs a first-level mapping to associate field identifiers with user input values, and performs a second-level mapping to determine the document rendering style of field values based on a combination of field type and fill format. The multi-type field processing module is used to call the corresponding rendering or processing logic for basic text type fields, selection type fields, media type fields and composite type fields according to the field type. The dynamic table generation module is used to identify the table structure corresponding to the list grouping fields in the target document template, and perform table data filling, dynamic row expansion and style copying operations; The automatic image embedding module is used to extract image paths from the media type field, read images from the object storage service, and embed them into the corresponding location in the target document; The document rendering and output module integrates the processing results of each module, performs full rendering of the target document template, and outputs a standardized Word document. The infrastructure layer includes Kafka message queue components, Redis caching components, Nacos configuration center components, Quartz scheduled task components, and MinIO object storage components. This infrastructure layer provides basic service support for asynchronous communication, data caching, configuration management, task scheduling, and object storage for the JSON configuration parsing module, field-format two-layer mapping module, multi-type field processing module, dynamic table generation module, image automatic embedding module, and document rendering and output module.
[0014] Preferably, the Kafka message queue component is connected to the JSON configuration parsing module, and is used to asynchronously receive form data and document generation task messages and pass the messages to the JSON configuration parsing module for processing; The Redis caching component is connected to the JSON configuration parsing module and the field-format two-layer mapping module respectively. It is used to cache the form configuration data parsed by the JSON configuration parsing module and to provide the field-format two-layer mapping module with fast reading of field mapping rules. The Nacos configuration center component is connected to the JSON configuration parsing module, the multi-type field processing module, the dynamic table generation module, and the automatic image embedding module, respectively, and is used to store and dynamically update the rendering rules, table processing parameters, and image size configurations required by each module. The Quartz scheduled task component is connected to the JSON configuration parsing module and serves as the execution entry point for periodically triggering batch document generation tasks. The MinIO object storage component is connected to the image automatic embedding module, and is used to receive and store image resources uploaded from the form, and provide an interface for reading image files according to the request of the image automatic embedding module.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention uses a two-layer mapping between field identifiers and values, and field types and formats. The same single-selection field can be output in three forms: Chinese characters, checkmarks, or checkboxes, depending on the configuration. This meets the document display needs of different business scenarios and solves the problem of the single rendering style in traditional methods.
[0016] 2. This invention constructs a unified processing framework covering basic types, selection types, media types, and composite types, eliminating the need to develop separate adaptation logic for each field and reducing code redundancy; when business changes occur, only the JSON configuration needs to be adjusted, without modifying the core code.
[0017] 3. This invention can automatically expand rows and copy styles in dynamic tables, automatically identify and embed images, and automatically add underline placeholders to input box options. The entire process requires no manual intervention, and the generated Word documents have a uniform and standardized format.
[0018] 4. The modular design of this invention facilitates the addition of new field types and functional expansions, and can be adapted to various application scenarios such as government services, enterprise offices, and Internet services. Attached Figure Description
[0019] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a flowchart illustrating the execution of dynamically adding new table rows according to the present invention; Figure 3 This is a flowchart illustrating the process of embedding images into a target document according to the present invention. Figure 4 This is a schematic diagram of the system structure of the present invention. Detailed Implementation
[0020] The present invention will be further illustrated below with reference to specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. Furthermore, it should be understood that after reading the teachings of this invention, those skilled in the art can make various alterations or modifications to the invention, and these equivalent forms also fall within the scope defined in this application.
[0021] In this invention, terms such as "upper," "lower," "left," "right," "front," "back," "vertical," "horizontal," "side," and "bottom" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. These terms are used only to facilitate the description of the structural relationships of the various components or elements of this invention and do not specifically refer to any component or element in this invention. They should not be construed as limiting the invention.
[0022] Example: like Figure 1 As shown, this embodiment provides a dynamic form generation method based on a two-layer mapping of field formats, specifically including the following steps: 1. System environment setup and technology stack integration: This process involves setting up the server runtime environment, installing JDK and MySQL basic components, configuring system runtime parameters, deploying a Kafka cluster and configuring corresponding topics for asynchronously receiving form data and document generation task messages, deploying a Redis caching service with set expiration times to store parsed form configurations and field mapping rules, deploying a Nacos service, creating a form configuration namespace to manage dynamic configuration parameters such as rendering rules, table processing parameters, and image size configurations, deploying a Quartz scheduled task framework, configuring scheduled task parameters to trigger batch document generation tasks on a regular basis, deploying a MinIO object storage service, configuring buckets and access permissions to receive and store image resources uploaded from forms, introducing the POI tool for Word document manipulation and image embedding, and introducing the Jackson JSON parser to parse JSON data transmitted from the front end. The final system initialization configuration is completed, establishing communication links between modules.
[0023] 2. JSON configuration-driven form data reception and parsing: The front-end configures the form structure and rendering rules according to business requirements, generating configuration data in JSON format. This data includes form steps, field identifiers, field types, fill formats, default values, and other parameters. Users fill in data in the front-end form, including text input, option selection, and image uploads. The front-end integrates the entered data with the form configuration and sends it to the back-end in JSON format. The back-end receives the JSON data through a JSON configuration parsing module, validates the data, filters invalid data, formats field parameters, extracts field identifiers, field types, fill formats, and user input values, establishes an association mapping between field identifiers and user input values, constructs a mapping relationship between fields and configuration parameters, and stores the parsed form configuration data in a Redis cache for easy subsequent retrieval.
[0024] 2. Execution of the field-format two-layer mapping mechanism: The field-format two-layer mapping module retrieves form configuration and data from Redis and performs the first layer of mapping: uniquely matching fields with corresponding user input values through field identifiers to ensure accurate retrieval of field values; it then performs the second layer of mapping: determining the rendering style of the field value in the target document based on the combination of field type and fill format. For single-selection or multi-selection fields, the rendering style determined by the second-level mapping specifically includes: When the fill format is Chinese characters, output the text of the selected option; When the fill format is checkmark fill, a checkmark symbol is added after the text of the selected option, and a blank placeholder is added after the text of the unselected option. When the fill format is checkbox fill, a box with a checkmark indicates the selected option, and a box without a checkmark indicates the unselected option.
[0025] 4. Unified processing of multiple form field types and polymorphic rendering of options: The multi-type field processing module identifies the category of a field based on its type and calls the corresponding processing logic. The field types involved in this embodiment include: single-line text type, multi-line text type, mobile phone number type, ID card number type, date type, year and month type, single selection type, multiple selection type, single selection with input box type, multiple selection with input box type, single image type, multiple image type, list grouping type, and grouping field type. For basic text type fields, perform standardized text rendering according to the defined rendering style; For the media type field, extract the image path information and pass it to the image automatic embedding module for processing; For composite data types, the data is passed to the dynamic table generation module for processing. When performing polymorphic option rendering on selection type fields, the option rendering is completed by selecting Chinese character fill, checkmark fill, or checkbox fill method according to the fill format parameters. For single or multiple selection fields with input boxes, special processing is also included: Iterate through the option list of the selection type field. When the option list contains a preset identifier option (such as the "Other" option), automatically generate an input box placeholder composed of the field identifier and a preset suffix after the display text of the preset identifier option. During the document rendering stage, by recognizing the input box placeholder, the user's custom text content entered in the corresponding input box at the front end of the form is dynamically filled into the placeholder position, and an underline style is automatically added below the custom text content; The automatic underline style is achieved through a separate underline control placeholder, which is associated with the input box placeholder. This ensures that when user-defined text content is present, the position and length of the added underline in the document are appropriate for the custom text content.
[0026] 5. Dynamic table generation and filling: like Figure 2 As shown, the dynamic table generation module receives the configuration and data for the list grouping fields and performs the following steps: Read the predefined table placeholder rows in the target document template. These placeholder rows contain field placeholders for the corresponding list grouping fields. Calculate the number of new table rows required based on the number of data rows in the grouping field of the list in the form data submitted by the user; Based on the required number of new table rows, add the same number of table rows below the placeholder row by copying them row by row; For each newly added table row, iterate through all the cells inside it, and copy the font style, border style, and alignment style of the cells corresponding to the placeholder row and apply them to the corresponding cells of the newly added row to ensure that the table style is consistent. Fill the corresponding data in the form data into the corresponding cell placeholders in the new row according to the field-format two-layer mapping rules described in step 3, ensuring that each field in the table supports multi-form rendering according to the configuration.
[0027] 6. Automatically embed images within Word documents: like Figure 3 As shown, the automatic image embedding module identifies the image path placeholder corresponding to the media type field from the placeholders configured in the JSON and performs the following steps: Extract the image's storage path string in the MinIO object storage service from the image path placeholder corresponding to the media type field; When the stored path string contains several image paths separated by commas, the stored path string is split by commas to obtain each independent image path; The client interface of MinIO object storage service reads the corresponding binary data stream of each image sequentially according to each independent image path. The image addition method provided by the POI tool is called to embed the read image binary data stream into the corresponding paragraph or cell placeholder positions in the target document one by one. When calling the image addition method, the image width and height values preset in the JSON configuration for this media type field are read, and the image width and height values are converted into EMU units (the standard unit for image size in Word documents) and then passed as parameters to constrain the display size of the embedded image in the target document.
[0028] 7. Dynamic generation of conditional underline: During the document rendering phase, conditional underscore generation is performed: The system uses a preset first underscore control placeholder to determine whether to add an underscore to the current text content. When the value of the first underscore control placeholder is true, the system calls the font style interface of the document rendering module to enable the underscore effect for the corresponding text content. When the value of the first underscore control placeholder is false, the system does not enable the underscore effect for the corresponding text content. By using a preset second underline control placeholder, a blank placeholder area with an underline style is pre-generated in the document. This blank placeholder area is used to align and splice with the user-defined text content with input box options in step four, so as to ensure the visual consistency between the user-defined text content and the underline in the final document.
[0029] 8. Document rendering, output, and optimization: The document rendering and output module integrates all the above processing results, performs paragraph filling, table filling, image embedding, and conditional underline generation on the Word template, completes the full rendering of the document according to field mapping rules and rendering styles, generates a standardized Word document after rendering, stores it in the specified path, and returns a document download link to support users to download and preview.
[0030] The system structure of this embodiment is as follows: Figure 4 As shown, it includes a JSON configuration parsing module, a field-format two-layer mapping module, a multi-type field processing module, a dynamic table generation module, an image automatic embedding module, a document rendering and output module, and an infrastructure layer; The infrastructure layer includes Kafka message queue components, Redis caching components, Nacos configuration center components, Quartz scheduled task components, and MinIO object storage components; The Kafka message queue component connects with the JSON configuration parsing module to asynchronously receive form data and document generation task messages; The Redis caching component connects to the JSON configuration parsing module and the field-format two-layer mapping module, respectively, to cache form configuration data and provide fast reading of field mapping rules; The Nacos configuration center component connects to the JSON configuration parsing module, the multi-type field processing module, the dynamic table generation module, and the automatic image embedding module, respectively, and is used to store and dynamically update the rendering rules, table processing parameters, and image size configurations required by each module. The Quartz scheduled task component connects with the JSON configuration parsing module to trigger batch document generation tasks on a scheduled basis; The MinIO object storage component connects with the image auto-embedding module to receive and store image resources uploaded from forms and provide an interface for reading image files.
[0031] As can be seen from the above embodiments, this embodiment achieves multi-form rendering of the same field value by constructing a field-format two-layer mapping mechanism and a unified processing framework for multiple field types. It uniformly processes more than ten field types and automatically generates standardized documents containing dynamic tables and images, significantly improving generation efficiency and flexibility. The modular design of this invention facilitates the subsequent addition of new field types and functional expansions, and can be adapted to various application scenarios such as government services, enterprise offices, and internet services.
[0032] The above is a detailed description of the preferred embodiments of the present invention, but the present invention is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention, and these equivalent modifications or substitutions are all included within the scope defined by the claims of this application.
Claims
1. A dynamic form generation method based on a two-layer mapping of field formats, characterized in that, Includes the following steps: Step S1: Receive and parse the JSON format form configuration and form data transmitted from the front end, extract field identifiers, field types, fill formats and user input values, and build a mapping relationship between fields and configuration parameters; Step S2: Perform a two-layer field-format mapping. The first layer of mapping associates the corresponding user input value with the field identifier, and the second layer of mapping determines the rendering style of the field value in the target document based on the combination of field type and fill format. Step S3: Call the corresponding processing logic according to the field type. Render the text of the basic text type field according to the rendering style. Execute polymorphic rendering of the selection type field. Extract the image path information of the media type field. Trigger the dynamic table processing flow for the composite type field. Step S4: For the list grouping field in the composite type field, identify the starting row, starting column and maximum number of columns of the corresponding table in the target document template, fill the table data into the placeholder row, and dynamically add table rows according to the number of data rows. Perform the two-level mapping of step S2 on each field in the newly added row. Step S5: For the media type field, identify the corresponding image path placeholder, obtain the image file from the object storage service, and embed the image into the corresponding position in the target document; Step S6: Integrate the processing results of steps S2 to S5, perform full rendering on the target document template, including generating conditional underlines, to generate and output a standardized Word document containing the rendering style, dynamic tables and embedded images.
2. The dynamic form generation method based on two-layer field format mapping according to claim 1, characterized in that, In step S2, the rendering style determined by the second layer mapping includes, for single-selection or multi-selection fields: When the fill format is Chinese characters, output the text of the selected option; When the fill format is checkmark fill, a checkmark symbol is added after the text of the selected option, and a blank placeholder is added after the text of the unselected option. When the fill format is checkbox fill, a box with a checkmark indicates the selected option, and a box without a checkmark indicates the unselected option.
3. The dynamic form generation method based on two-layer field format mapping according to claim 1, characterized in that, In step S3, the corresponding processing logic is called according to the field type. The field types involved include: single-line text type, multi-line text type, mobile phone number type, ID card number type, date type, year and month type, single selection type, multiple selection type, single selection with input box type, multiple selection with input box type, single image type, multiple image type, list grouping type, and grouping field type.
4. The dynamic form generation method based on two-layer field format mapping according to claim 1, characterized in that, In step S3, when performing polymorphic rendering of the selection type field, the processing of options with input boxes is also included, specifically: Iterate through the option list of the selection type field. When a preset identifier option is detected in the option list, an input box placeholder composed of the field identifier and a preset suffix is automatically generated after the display text of the preset identifier option. During the document rendering stage, by recognizing the input box placeholder, the user's custom text content entered in the corresponding input box at the front end of the form is dynamically filled into the placeholder position, and an underline style is automatically added below the custom text content; The automatic underline style is achieved through a separate underline control placeholder, which is associated with the input box placeholder.
5. The dynamic form generation method based on two-layer field format mapping according to claim 1, characterized in that, In step S4, the dynamic addition of new table rows includes the following steps: Step S41: Read the predefined table placeholder rows in the target document template, wherein the placeholder rows include field placeholders for the corresponding list grouping fields; Step S42: Calculate the number of new table rows required based on the number of data rows in the list grouping fields of the form data submitted by the user; Step S43: Based on the required number of new table rows, add the same number of table rows below the placeholder row by copying them row by row; Step S44: For each newly added table row, iterate through all the cells inside it, and copy the font style, border style, and alignment style of the cells corresponding to the placeholder row and apply them to the corresponding cells of the newly added row. Step S45: Fill the corresponding data in the form data into the corresponding cell placeholders of the newly added row according to the field-format two-layer mapping rule in step S2.
6. The dynamic form generation method based on two-layer field format mapping according to claim 1, characterized in that, In step S5, embedding the image into the corresponding location of the target document includes the following steps: Step S51: Extract the storage path string of the image in the object storage service from the image path placeholder corresponding to the media type field; Step S52: When the stored path string contains several image paths separated by commas, split the stored path string by commas to obtain each independent image path; Step S53: Read the corresponding binary data stream of each image sequentially according to each independent image path through the client interface of the object storage service; Step S54: Call the image addition method provided by the document operation tool to embed the read image binary data stream into the corresponding paragraph or cell placeholder position in the target document one by one; Step S55: When calling the image addition method, read the image width and image height values preset in the JSON configuration for the media type field, convert the image width and image height values into standard image size units applicable to the document operation tool, and then pass them as parameters.
7. The dynamic form generation method based on two-layer field format mapping according to claim 1, characterized in that, In step S6, generating conditional underscores specifically includes: The system determines whether to add an underline to the current text content by using a preset first underline control placeholder. When the value of the first underline control placeholder is true, the system calls the font style interface of the document rendering module to enable the underline effect for the corresponding text content. When the value of the first underline control placeholder is false, the system does not enable the underline effect for the corresponding text content. By using a preset second underline control placeholder, a blank placeholder area with an underline style is pre-generated in the document. This blank placeholder area is used to align and concatenate with user-defined text content with input box options in subsequent steps.
8. A dynamic form generation system based on two-layer field format mapping, used to implement the dynamic form generation method based on two-layer field format mapping as described in any one of claims 1-7, characterized in that, include: The JSON configuration parsing module is used to receive and parse the form configuration and form data transmitted from the front end, and extract field identifiers, field types, fill formats and user input values; The field-format two-level mapping module performs a first-level mapping to associate field identifiers with user input values, and performs a second-level mapping to determine the document rendering style of field values based on a combination of field type and fill format. The multi-type field processing module is used to call the corresponding rendering or processing logic for basic text type fields, selection type fields, media type fields and composite type fields according to the field type. The dynamic table generation module is used to identify the table structure corresponding to the list grouping fields in the target document template, and perform table data filling, dynamic row expansion and style copying operations; The automatic image embedding module is used to extract image paths from the media type field, read images from the object storage service, and embed them into the corresponding location in the target document; The document rendering and output module integrates the processing results of each module, performs full rendering of the target document template, and outputs a standardized Word document. The infrastructure layer includes Kafka message queue components, Redis caching components, Nacos configuration center components, Quartz scheduled task components, and MinIO object storage components. This infrastructure layer provides basic service support for asynchronous communication, data caching, configuration management, task scheduling, and object storage for the JSON configuration parsing module, field-format two-layer mapping module, multi-type field processing module, dynamic table generation module, image automatic embedding module, and document rendering and output module.
9. A dynamic form generation system based on a two-layer field format mapping according to claim 8, characterized in that, The Kafka message queue component is connected to the JSON configuration parsing module and is used to asynchronously receive form data and document generation task messages and pass the messages to the JSON configuration parsing module for processing. The Redis caching component is connected to the JSON configuration parsing module and the field-format two-layer mapping module respectively. It is used to cache the form configuration data parsed by the JSON configuration parsing module and to provide the field-format two-layer mapping module with fast reading of field mapping rules. The Nacos configuration center component is connected to the JSON configuration parsing module, the multi-type field processing module, the dynamic table generation module, and the automatic image embedding module, respectively, and is used to store and dynamically update the rendering rules, table processing parameters, and image size configurations required by each module. The Quartz scheduled task component is connected to the JSON configuration parsing module and serves as the execution entry point for periodically triggering batch document generation tasks. The MinIO object storage component is connected to the image automatic embedding module, and is used to receive and store image resources uploaded from the form, and provide an interface for reading image files according to the request of the image automatic embedding module.