Interactive form design method and system based on language large model
By combining a standardized form model with JSON Schema, a visual designer, and a large language model, natural language-driven form design was achieved. This solved the problems of cumbersome traditional design and limitations of existing models, improving design efficiency and interactive experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 彭志勇
- Filing Date
- 2026-02-26
- Publication Date
- 2026-05-29
Smart Images

Figure CN122113839A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of human-computer interaction and automatic form generation technology, specifically relating to an interactive form design method and system based on a large language model. Background Technology
[0002] In the field of form design, traditionally, it has relied on standalone WYSIWYG software systems, such as the mask-based web form design method disclosed in CN107391656A. These systems require users to manually construct form content step-by-step according to predetermined steps, enabling precise control over the final form structure. However, this approach also has significant drawbacks: the design process is cumbersome and time-consuming, with a large workload; the quality and content of the form highly depend on the operator's business understanding and operational proficiency. Especially when the initial requirements are vaguely described and the designer lacks relevant domain knowledge, users often find it difficult to initiate the design process, and even with additional learning or research, the entire design process remains extremely cumbersome.
[0003] In recent years, large-scale general-purpose language models (such as ChatGPT, DeepSeek, and Google Gemini) have experienced rapid development. These models, built on deep learning, possess massive parameters and powerful general-purpose language understanding and generation capabilities, enabling them to flexibly handle various natural language tasks such as dialogue, text creation, and information retrieval. A typical application is interaction based on natural language dialogue: users or systems input instructions or parameters in natural language, the model receives and processes the input, and returns the corresponding processing result. The result is usually natural language text, but structured formats (such as JSON) can also be output as needed. Furthermore, it is worth noting that the responses of these models are typically returned via HTTP streaming. Some models, such as DeepSeek, also introduce a "thinking" mechanism, streaming a short interim thought text before returning the final result.
[0004] With the rise of large language model technology, solutions have emerged that attempt to apply it to form design, such as the form generation method and system based on a large language model proposed in CN116910275A. These solutions typically require pre-training the model with form design-related data, sometimes incorporating knowledge from specific business domains. In practice, users only input their requirements once in the initial stage, and the trained model directly generates a complete form (generally understood as directly generating an HTML form page). However, this approach has several limitations: First, the model requires specific training or fine-tuning, resulting in high initial costs; second, the model's capabilities are limited by the training data, leading to a narrow scope of application and insufficient flexibility and generalization; finally, these solutions are usually limited to one-time generation. While the generated form can be imported into a traditional WYSIWYG designer for further editing, the edited content cannot undergo further natural interaction and optimization with the large language model to form an interactive closed loop. Summary of the Invention
[0005] This invention provides an interactive form design method and system based on a large language model, enabling users to directly generate or modify visual forms through natural language dialogue. It deeply integrates the intelligent interaction capabilities of a general-purpose language model with a form designer, supporting users to create, edit, and optimize forms using natural language commands, and providing real-time previews of the AI response generation process and results. This method supports full updates for small forms and incremental updates for large forms, effectively balancing interaction efficiency and data processing performance. Through standardized form models and streaming response processing technology, it achieves seamless collaboration between intelligent generation and manual refinement, improving the usability, efficiency, and flexibility of form design.
[0006] To achieve these objectives and other advantages of the present invention, in a first aspect, the present invention provides an interactive form design method based on a large language model, comprising the following steps: S1. Define the form model: Define a document model to describe the form structure, and specify the corresponding JSON Schema specification for the document model to constrain the format of the form data; S2. Form Designer: Used for visual editing of forms built based on the document model. The form designer supports importing and exporting JSON data that conforms to the JSON Schema specification. S3. The form designer interacts with the language model: The interactive interface of the form designer provides a function entry point to trigger the interaction of the language model. S4. Dynamic Request Construction and Submission: In response to user-triggered language model interaction commands, dynamically construct and submit requests to the language model based on the current state of the form designer, including: When the form content is empty, the request includes at least the natural language instructions entered by the user and the JSON Schema specification; When the form content is not empty, the request includes at least the natural language instructions entered by the user, the JSON Schema specification, and the JSON data of the current form; S5, Streaming Response Processing and Preview: Receives the response returned in streaming from the large language model, processes and visualizes the response in real time, and progressively updates the preview interface in the form designer.
[0007] Preferably, the streaming response processing and progressive preview specifically include: Content recognition and display sub-step: Receive the streaming response, identify the thought process text and the formal result part, and display the thought process text in the interactive interface in real time; The result aggregation and parsing sub-step involves: real-time aggregation of the text fragments in the identified formal result portion, and the remedial parsing method is used to parse the aggregated text fragments into JSON objects that conform to the JSON Schema in real time; Difference comparison and update sub-step: Compare the parsed new JSON object with the previous parsing result. If the structure or content of the new JSON object has changed, immediately import it into the form designer to update the form preview interface.
[0008] Preferably, the restorative analysis method includes: Perform grammatical integrity checks on all currently aggregated text fragments and automatically complete any missing JSON syntax elements to form a grammatically correct JSON string; The parsed JSON object is verified to meet the preset basic validity conditions. The basic validity conditions include at least the following: for control objects in the form, they must contain three key attributes: id, type, and title; the JSON object is considered a valid result only if this condition is met.
[0009] Preferably, when the form content is not empty, the dynamic construction and submission steps can adopt a full update mode if the current form data size is less than a preset threshold. This includes: In the build request, the explicit instruction language big model returns a complete, modified form JSON data that conforms to the stated JSON Schema; In the streaming response processing and progressive preview steps, when the parsed new JSON object is imported into the form designer, a differential merging operation is performed based on the form state at the start of the interaction and the new JSON object. This differential merging operation includes: Control matching steps: Match the controls in the new JSON object with the controls in the form at the start of the interaction, based on the control's id attribute; Attribute fusion step: For a successfully matched control, update the properties of that control in the new JSON object to the corresponding control in the form at the start of the interaction, and retain the properties that exist in the form at the start of the interaction but are not included in the new JSON object; Control management steps: Delete controls whose IDs are not matched in the new JSON object, and add new controls whose IDs do not exist in the form at the start of the interaction.
[0010] Preferably, the step of dynamically constructing and submitting the request when the form content is not empty adopts an incremental update mode if the data size of the current form is greater than or equal to a preset threshold, specifically including: A predefined incremental operation instruction JSON Schema is used to structurally define discrete modification operation instructions for editing forms. The discrete modification operation instruction types defined in the incremental operation instruction JSON Schema include at least: modifying form attributes, modifying question attributes, adding questions, and deleting questions. A structured request message is dynamically constructed and submitted to the language model. This structured request message includes: a format enforcement instruction: containing a system instruction that uniquely specifies and enforces that the output of this interaction must conform to the incremental operation instruction JSON Schema array; an operation format definition: containing the incremental operation instruction JSON Schema, which serves as the specific format specification for the format enforcement instruction; and a reference data block: containing the JSON Schema specification and the current form JSON data. This reference data block is appended with a metadata identifier to declare its purpose, indicating that the data block is only used for context understanding and does not have the effect of defining the output format. In the streaming response processing and progressive preview steps, when the incremental operation instruction array is parsed, the form state at the start of the interaction is used as the baseline. The operation instruction array is treated as an executable instruction sequence, and each operation instruction is parsed and applied sequentially to progressively update the form preview interface.
[0011] Preferably, the instruction types defined in the incremental operation JSON Schema specifically include: Commands to modify form attributes include: operation type identifier, attribute name, and attribute value; Instructions to modify problem attributes: include operation type identifier, problem identifier, attribute name, and attribute value, wherein the problem identifier corresponds to the id attribute of the problem object; Add a problem instruction: including the operation type identifier, insertion position identifier, and problem object; Deleting a problem command includes an operation type identifier and a problem identifier.
[0012] Preferably, in the difference comparison and update sub-step, if a control in the new JSON object is missing any of the attributes id, type, or title, the control will not be updated to the preview interface until the streaming response ends and the attributes are complete.
[0013] Preferably, the form designer also allows users to directly adjust the form content generated or modified by the language big model in the visual editing interface. After being verified by the normative constraint engine, it can be exported again as JSON data conforming to JSON Schema and used as input for subsequent language big model interactions.
[0014] Preferably, the function entry point for triggering the interaction of the language model in step S3 is specifically: integrating a language model dialogue panel into the interactive interface of the form designer; Users can trigger the interaction of the language model by bringing up the dialog panel and entering natural language commands; the modification results returned by the language model are integrated in real time through step S5 and updated to the preview interface of the current form.
[0015] Secondly, the present invention provides an interactive form design system based on a language large model, applied to the aforementioned interactive form design method based on a language large model, comprising: The form modeling module is used to define and store the document model of a form and its corresponding JSON Schema specification; The form designer module provides a visual form editing interface and supports importing and exporting JSON data that conforms to the JSON Schema specification; The interactive control module is used to provide a functional entry point for triggering the interaction of the language big model in the interactive interface of the form designer module, and to respond to the interactive commands triggered by the user. The request construction and submission module is used to dynamically construct and submit a request to the language big model based on the current state of the form designer module, wherein: when the form content is empty, the request includes at least the natural language instructions input by the user and the JSON Schema specification; when the form content is not empty, the request includes at least the natural language instructions input by the user, the JSON Schema specification, and the JSON data of the current form; The streaming response processing module receives the response returned in streaming form from the language big model and processes and visualizes the response in real time to drive the form designer module to progressively update its preview interface.
[0016] The present invention has at least the following beneficial effects: First, this invention creates a novel interactive form design paradigm by deeply integrating a standardized form model (JSON Schema), a visual form designer, and a general-purpose language model. This design method significantly reduces the barrier to entry and startup costs. Users do not need to be proficient in business details or complex operations; they only need to describe their requirements in natural language to drive the language model to generate or modify forms. This is especially suitable for "cold start" scenarios where requirements are vague or knowledge is lacking. It achieves a true intelligent interactive closed loop, utilizing a general-purpose language model without requiring expensive and rigid specialized training for form tasks, giving the system broad applicability and flexibility. The design process is no longer a one-way generation but supports multi-round natural language dialogue interaction based on the current design state, realizing a collaborative workflow of "description-generation-adjustment-re-description." This improves design efficiency and user experience, freeing users from tedious manual drag-and-drop configuration. Through natural language commands, users can quickly create and iterate forms. Combined with streaming response and real-time preview, users can instantly perceive the AI's "thinking" and generation process, making the design process intuitive and efficient.
[0017] Secondly, by breaking down the streaming response into three sub-steps—content recognition, result aggregation, and difference comparison—significant improvements in user experience and system performance are achieved. First, real-time display of the model's thought process text enhances the transparency and trust of the interaction; users are no longer waiting for a black box result but can understand the AI's reasoning logic. Second, real-time aggregation and parsing of the results allow the form preview to update progressively as data arrives, enabling users to see preliminary results without waiting for the complete response, greatly reducing perceived latency. Finally, through difference comparison, the system can accurately detect changes in JSON objects, triggering preview updates only when the actual content changes, avoiding unnecessary interface refreshes and data processing overhead, and ensuring the accuracy of preview updates and system performance.
[0018] Third, the aforementioned corrective parsing method solves the core problem of incomplete and unstable JSON data fragments under streaming transmission, ensuring the robustness and accuracy of the preview process. It can automatically detect and complete missing JSON syntax elements such as quotation marks and parentheses, repairing potentially invalid fragment streams into syntactically correct complete strings, greatly reducing the probability of parsing failures caused by network stream truncation or model output fluctuations. By setting and validating basic validity conditions including key attributes such as id, type, and title, it ensures that only structurally complete and semantically clear valid control data is used to update the preview. This filters out invalid or intermediate interference data from the source, ensuring that the form content finally presented in the form designer is usable and conforms to basic specifications, improving the reliability and output quality of the entire system.
[0019] Fourth, by introducing a full update mode based on data scale thresholds and corresponding differentiated merging operations, intelligent and accurate data synchronization is achieved in the modification scenarios of small and medium-sized forms. For forms with small data volumes, requesting and responding with complete JSON data is within an acceptable overhead range, simplifying the interaction logic with large models. The model only needs to understand the instructions and output a complete new form. Differentiated merging operations are a key innovation. By matching controls with IDs, the precise correspondence of modification targets is ensured; the attribute fusion step intelligently merges old and new data, applying AI modifications while retaining original attributes that the user may have adjusted in the designer but not mentioned by the AI, avoiding data loss; the control management step accurately reflects the AI's intention to add or delete control structures. The entire merging process is like an intelligent "version merging tool," ensuring a smooth and accurate transition from the editing state to the new version, resulting in a consistent user experience.
[0020] Fifth, the incremental update mode designed for large-scale form scenarios is a key optimization of this invention, bringing significant performance improvements and enhanced usability. By guiding the large language model to output a structured array of operation instructions, instead of a massive complete form JSON, the amount of data in requests and responses is greatly reduced, saving network bandwidth and speeding up interactive response, making it especially suitable for forms with a large number of question items.
[0021] Other advantages, objectives and features of the present invention will become apparent in part from the following description, and in part from those skilled in the art through study and practice of the invention. Attached Figure Description
[0022] Figure 1 This is a flowchart illustrating the interactive form design method based on a large language model according to the present invention. Figure 2 This is a diagram of the interaction interface between the language model and the form designer. Detailed Implementation
[0023] The present invention will now be described in further detail so that those skilled in the art can implement it based on the description.
[0024] It should be understood that terms such as “having,” “comprising,” and “including” as used herein do not exclude the presence or addition of one or more other elements or combinations thereof.
[0025] like Figure 1 As shown, this embodiment of the invention provides an interactive form design method based on a large language model, including the following steps: S1. Define the form model: Define a document model to describe the form structure, and specify the corresponding JSON Schema specification for the document model to constrain the format of the form data.
[0026] In the steps above, a document model is defined to describe the form structure. This document model is an abstract representation of all elements in the form (such as the form title, description, and various question controls), their hierarchical relationships, and attributes. To ensure the standardization and exchangeability of the data format, a corresponding JSON Schema specification needs to be established for this document model. JSON Schema itself is a standard based on the JSON format used to describe and validate JSON data structures. In this scheme, its role is to strictly constrain the format of the final form data, specifying which fields are required, what the field types are (e.g., string, number, array), and the constraint relationships between fields. For example, it can specify that a "question" object must contain three attributes: "id" (identifier), "type" (type, such as radio button, checkbox, text box), and "title" (question title). By pre-defining such a machine-readable specification, a clear structured goal is provided for the subsequent generation or modification of form data in the large language model, and the consistency of data exchange between the designer and external systems is also guaranteed.
[0027] S2. Form Designer: Used for visual editing of forms built based on the document model. The form designer supports importing and exporting JSON data that conforms to the JSON Schema specification.
[0028] In the steps described above, the main function of this form designer is to provide visual editing of forms built upon the aforementioned document model. This means that users can create and adjust various components of a form through intuitive methods such as dragging, clicking, and filling in attribute boxes within a graphical interface, achieving a WYSIWYG experience. A key technical feature is that this form designer needs to support importing and exporting JSON data conforming to the JSON Schema specification. The import function allows loading existing, compliant form data from external sources into the form designer, presenting it as an editable visual interface; the export function allows serializing the current form state in the form designer into a JSON data file or string conforming to the JSON Schema. This feature bridges the gap between visual operations and structured data, enabling forms to be manually edited within the interface, as well as saved, transmitted, or used as input for other processing flows in a standard data format.
[0029] S3. The form designer interacts with the language model: The interactive interface of the form designer provides a function entry point to trigger the interaction of the language model.
[0030] The steps described above introduce an interaction portal with the language model. To enable intelligent assistance, a functional entry point that can trigger interaction with the language model needs to be provided within the interactive interface of the form designer. This entry point could be a persistent button, a pop-up sidebar dialog panel, or a specific menu option. The goal is to allow users to easily initiate a dialogue with the language model during regular visual editing without switching to a separate AI tool or interface. This design embodies the core of "interaction," deeply embedding AI capabilities into the workflow, making natural language commands a new and parallel input method driving form design.
[0031] S4. Dynamic Request Construction and Submission: In response to user-triggered language model interaction commands, dynamically construct and submit requests to the language model based on the current state of the form designer, including: When the form content is empty, the request includes at least the natural language instructions entered by the user and the JSON Schema specification; When the form content is not empty, the request includes at least the natural language instructions entered by the user, the JSON Schema specification, and the JSON data of the current form.
[0032] The above steps illustrate the dynamic construction and submission process of the request. When a user triggers an instruction to interact with the language model through the aforementioned functional entry point (e.g., entering "add an input box to collect user emails" or "randomly shuffle the order of all multiple-choice options" in a dialog box), the system needs to respond to the instruction and dynamically construct a request to be sent to the language model based on the current state of the form designer. "Dynamically constructed" here means that the content of the request is not fixed but depends on the current design context. Specifically, the construction logic is divided into two cases: When the form content in the form designer is empty, i.e., in the initial creation state, the submitted request must at least contain the user's input natural language instruction and the JSON Schema specification as a format constraint. In this case, the language model's task is to generate a complete form JSON data from scratch based on the instruction and specification. When the form content in the form designer is not empty, i.e., a form already exists and is being edited, the request must at least contain the user's input natural language instruction, the JSON Schema specification, and the current form's JSON data (which can be obtained through the form designer's export function). At this point, the task of the language model is to modify or supplement the form based on instructions, understanding the existing form structure (through JSON data) and the required format (through JSONSchema). This differentiated request construction method allows a single interaction entry point to handle both creation and editing / optimization tasks, adapting to the needs of different design stages.
[0033] S5, Streaming Response Processing and Preview: Receives the response returned in streaming from the large language model, processes and visualizes the response in real time, and progressively updates the preview interface in the form designer.
[0034] The above steps describe the streaming response processing and real-time preview mechanism. After a request is submitted, the language big model begins processing and generating a response. Modern language big models typically support returning responses in a streaming manner, meaning data is transmitted back in batches and fragments, like a stream of water, rather than waiting for all data to be generated before returning it all at once. This method fully utilizes this characteristic. As the system receives these streaming response fragments, it processes and visualizes them in real time, progressively updating the preview interface in the form designer. This means that users don't need to wait for the AI to finish "thinking" to see the form being gradually generated or modified. For example, the language big model might first stream a form title, and the preview interface immediately displays this title; then it might output the structure of the first question, and the preview interface adds that question accordingly. This process is continuous and dynamic. To achieve this progressive update, the backend needs to parse the streaming data, identify the data fragments representing the form structure, and convert them in real time into a format that the form designer can understand and render, thus driving the interface update. This approach greatly enhances the immediacy of interaction and user engagement, allowing users to perceive the AI's progress in real time and intervene when necessary.
[0035] By combining the above technical features, the technical solution defined in this embodiment realizes a complete interactive form design process: from defining a standardized data model and building a visual editor as the foundation, to seamlessly integrating an AI interaction entry point into the editor, then dynamically assembling a request containing instructions, specifications, and current data according to the design status and sending it to a general-purpose language large model, and finally processing the streaming response of the large model in real time and dynamically updating the designer preview. The entire process forms a collaborative design environment with dual modes of parallel operation: "human visual editing" and "AI natural language driven".
[0036] Compared to traditional form design tools that rely entirely on manual drag-and-drop configuration, this method lowers the barrier to entry and reduces the complexity of form design by introducing natural language interaction. Even users unfamiliar with all the features of the form designer can quickly generate form drafts or complete batch modifications by describing their requirements, improving design efficiency, especially suitable for scenarios where requirements are initially formed or rapid prototyping is underway. Compared to some existing solutions that use specially trained large models to generate forms all at once, this method directly utilizes a general-purpose language model, eliminating the need for expensive and limited specific training, resulting in greater versatility and lower costs. More importantly, it achieves a true interactive closed loop—the generated or modified results are directly presented in the form designer, allowing users to immediately make visual fine-tunings and then initiate new modification requests again via natural language commands. This forms a flexible and iterative "description-generation-adjustment-re-description" workflow, making AI a true collaborative partner in assisting design, rather than a one-off code generator. Furthermore, the streaming response and real-time preview features make the entire AI interaction process more transparent and smooth, reducing user anxiety and improving the user-friendliness of the interactive experience.
[0037] In one specific implementation, the streaming response processing and progressive preview specifically include: Content recognition and display sub-step: Receive the streaming response, identify the thought process text and the formal result part, and display the thought process text in the interactive interface in real time; The result aggregation and parsing sub-step involves: real-time aggregation of the text fragments in the identified formal result portion, and the remedial parsing method is used to parse the aggregated text fragments into JSON objects that conform to the JSON Schema in real time; Difference comparison and update sub-step: Compare the parsed new JSON object with the previous parsing result. If the structure or content of the new JSON object has changed, immediately import it into the form designer to update the form preview interface.
[0038] In the above implementation, when a streaming response is received from a large language model, the system needs to parse and differentiate the data stream in real time. Some advanced large language models output an internal "thinking process" text before generating the final answer. This text is usually intended to demonstrate its reasoning chain, but it is not the final structured result. The core technical feature of this step is to identify and separate the "thinking process text" from the "formal result" in the response. This can be achieved by detecting specific markers in the response (e.g., some models use "thinking:" as a prefix), analyzing text patterns, or utilizing metadata output by the model. The identified "thinking process text" is displayed in real time in a specific area of the interactive interface, such as a speech bubble or a separate log panel. The principle behind this is to reveal the AI's reasoning logic to the user, enhancing the transparency and interpretability of the interaction process. The user is no longer facing a black box, but can "see" how the model understands instructions and plans the next step, which helps build trust and allows the user to detect deviations in the model's reasoning earlier.
[0039] For the identified "formal result portion," i.e., text fragments expected to contain structured form data (such as JSON), the system needs to process them in real time. Because it's streaming, text representing the same JSON object may be split into multiple fragments arriving sequentially. Therefore, the system needs a buffer to aggregate these text fragments belonging to the "formal result" in real time. However, directly parsing incomplete JSON fragments usually leads to failure. To address this, this step introduces a "remedial parsing method." Its principle is to intelligently assess the syntactic integrity of all currently aggregated fragments before attempting to parse them. For example, it checks if parentheses are paired and if string quotes are closed. If obvious syntactic deficiencies are detected, the system automatically attempts to complete the missing syntactic elements, such as adding a closing curly brace or square bracket at the end of the fragment. For example, when all output reaches `{"title":"test","questions":[{"id":"aa"]`, it needs to be automatically completed to `{"title":"test","questions":[{"id":"aa"}]}`. The goal of this repair process is to form a syntactically correct JSON string as much as possible so that it can be successfully parsed by a standard JSON parser. Through this method of aggregating, repairing, and parsing simultaneously, the system can construct complete JSON objects in real time from the continuously arriving, potentially incomplete, stream of fragments.
[0040] Whenever a new JSON object (representing the current form generation state) is successfully parsed using the aforementioned corrective parsing method, the system does not immediately and blindly refresh the entire preview interface with it. Instead, it compares it with the previously successfully parsed JSON object used to update the interface. This comparison is a deep, structured, and content-based comparison, designed to precisely identify what changes have occurred between the two JSON objects, such as whether new controls have been added, whether the property values of existing controls have been modified, or whether the order of controls has been adjusted. Only when the newly parsed JSON object has indeed changed in structure or content will the system immediately import it into the form designer to update the form preview interface. If the content has not changed substantially (e.g., only some meaningless formatting adjustments in the streaming output are corrected), no interface update will be triggered. This differentiated update mechanism aims to avoid unnecessary frequent flickering or redrawing of the preview interface due to minor, non-substantial formatting fluctuations in the streaming response, ensuring the accuracy and efficiency of the update action while providing users with a more stable and smooth visual experience.
[0041] These three sub-steps work together to form a highly efficient streaming response processing pipeline. From differentiating and displaying the thought process to enhance transparency, to intelligently aggregating and repairing incomplete structured data to construct objects in real time, and then to achieving precise incremental updates of the interface through difference comparison, the entire process enables the "thinking" and "output" of the large model to be mapped onto the form designer's visual interface in a coherent, stable, and user-perceptible manner in real time.
[0042] This implementation method significantly enhances users' understanding and trust in the AI decision-making process by displaying the model's thought process in real time, transforming the interaction from result-oriented to process-visible. Employing a restorative parsing method effectively overcomes the inherent incompleteness of streaming data transmission, ensuring reliable parsing and previewing as data arrives, drastically reducing the perceived waiting time from issuing a command to seeing preliminary results, achieving true "generate-while-previewing." Furthermore, the precise update mechanism based on difference comparison effectively avoids invalid interface refreshes caused by minor fluctuations in the data stream, ensuring real-time content while improving front-end rendering efficiency and interface display stability, making the entire AI-assisted design process smooth and natural.
[0043] In one specific embodiment, the restorative parsing method includes: Perform grammatical integrity checks on all currently aggregated text fragments and automatically complete any missing JSON syntax elements to form a grammatically correct JSON string; The parsed JSON object is verified to meet the preset basic validity conditions. The basic validity conditions include at least the following: for control objects in the form, they must contain three key attributes: id, type, and title; the JSON object is considered a valid result only if this condition is met.
[0044] In the above implementation, grammatical integrity checking and auto-completion are the first processing steps in the repairable parsing method. After the system aggregates the latest batch of text fragments from the "formal results part" of the large language model, it performs a grammatical integrity check on the entire aggregated text string before attempting to parse it into a JSON object. This is not a simple string check, but a lightweight grammatical analysis based on JSON grammar rules. The principle is to scan the text, checking whether key structured symbols match and are closed, such as checking if a left curly brace `{` has a corresponding right curly brace `}`, a left square bracket `[` has a corresponding right square bracket `]`, and whether string values are enclosed in paired quotation marks. If a significant missing grammatical element is detected at the end of the text (e.g., an unclosed string quotation mark, or an object missing a closing bracket), the system automatically attempts to complete it. This completion is conservative and rule-based, aiming to "repair" the current set of fragments into a JSON string that is at least grammatically correct, so that it can be successfully read by the subsequent JSON parser. This process addresses the issue of a complete JSON object being transmitted in fragments during streaming, resulting in the receiving end only possessing incomplete fragments of the object at any given time. Without this fix, parsing would frequently fail, causing preview updates to be interrupted.
[0045] After obtaining a potentially valid JSON string through syntax completion and successfully parsing a JSON object in memory, the corrective parsing process is not yet complete. Next, the system verifies whether the parsed JSON object meets the preset "basic validity conditions." These conditions are semantic constraints on the form's business logic, going beyond pure syntactic correctness. At a minimum, each control object in the form must contain three key attributes: id, type, and title. id is the unique identifier of the control, type defines the control's type (e.g., text box, dropdown list), and title is the label text displayed to the user. These three are the minimum necessary attribute set for a recognizable, renderable, and manageable form control. The verification principle is to traverse the structure of the parsed JSON object, locate the array or nested objects representing controls, and check whether each object possesses all three attribute keys and whether its values conform to the expected type (e.g., string). Only when a JSON object passes syntax parsing and all its internal controls meet this basic validity condition will the system consider the JSON object valid and usable for updating the preview interface. If any key attribute is missing, the object will be considered invalid or incomplete at this stage.
[0046] These two stages work closely together, forming a two-layer filtering mechanism from low-level syntax repair to high-level semantic verification. The first layer, syntax completion, ensures that data can be correctly parsed into structured objects, resolving the physical layer incompleteness issues caused by streaming transmission. The second layer, validity verification, ensures that the parsed objects have basic business logic integrity, filtering out intermediate states or erroneous outputs that, while syntactically correct, are incomplete or cannot be correctly rendered on the interface. Only data that passes both layers of verification is safely passed to the subsequent difference comparison and interface update modules.
[0047] In one specific implementation, when the form content is not empty, the dynamic construction and submission step of the request can adopt a full update mode if the data size of the current form is less than a preset threshold, specifically including: In the build request, the explicit instruction language big model returns a complete, modified form JSON data that conforms to the stated JSON Schema; In the streaming response processing and progressive preview steps, when the parsed new JSON object is imported into the form designer, a differential merging operation is performed based on the form state at the start of the interaction and the new JSON object. This differential merging operation includes: Control matching steps: Match the controls in the new JSON object with the controls in the form at the start of the interaction, based on the control's id attribute; Attribute fusion step: For a successfully matched control, update the properties of that control in the new JSON object to the corresponding control in the form at the start of the interaction, and retain the properties that exist in the form at the start of the interaction but are not included in the new JSON object; Control management steps: Delete controls whose IDs are not matched in the new JSON object, and add new controls whose IDs do not exist in the form at the start of the interaction.
[0048] In the above implementation, the activation of the full update mode depends on a judgment: whether the data size of the current form is less than a preset threshold. This preset threshold is a configurable parameter used to distinguish between "small forms" and "large forms," and is exemplarily set to 50. This means that when the number of questions in the form is less than 50, the system tends to adopt the full update mode. Of course, the optimal value needs to be determined based on specific system performance, network environment, and user experience testing; it may be set to 20 or 30 to obtain a smoother interactive experience. In this mode, the request to build the language model will contain an explicit instruction requiring the language model to directly return a complete, JSON Schema-compliant, modified form JSON data. The principle is that for forms with small data volumes, the network overhead and waiting time incurred in transmitting and receiving complete JSON data are acceptable.
[0049] When the language model stream returns the complete, modified form JSON data and parses it into a new JSON object, the system cannot simply replace the current form state in the form designer with this new object. This is because the user may have made some manual adjustments to the form in the form designer before triggering the AI interaction, and these adjustments may not be included in the AI's return results. Therefore, a "differentiated merging operation" is required. This operation uses the form state at the start of the interaction as a baseline (called the "original state") and the new JSON object generated by the AI as the modification target for intelligent merging. First, a control matching step is performed. The principle is to associate the controls in the new object with the controls in the original state based on the unique id attribute of each control. The id is like an identity card for each control and is the cornerstone of the matching operation. For controls that are successfully matched, the attribute merging step is entered. This step iterates through all the attributes of the control in the new object and updates the attributes of the corresponding control in the original state with these new attribute values. The key is that the merging operation is merging, not overwriting: attributes that exist in the original control but are not included in the new object (possibly attributes that the AI did not mention or deemed unnecessary to modify) will be preserved. This ensures that user-defined settings not covered by AI are not lost. Finally, there's the control management step, which handles additions and deletions to the structure: for original controls whose IDs don't match in the new object, they are removed from the final state (corresponding to AI's deletion intent); for new controls whose IDs don't exist in the original state, they are added to the final state (corresponding to AI's addition intent).
[0050] In full update mode, a complete processing loop is formed, from sending a request command to return the complete JSON, to receiving and parsing the JSON, and then performing the aforementioned fine-grained differential merging operations. Only the result of the merge—a new form state that integrates the AI's modification intent and the user's original editing state—is ultimately imported into the form designer to update the preview interface. This process ensures that the transition from the old state to the new state is smooth, accurate, and without data loss.
[0051] In one specific implementation, the step of dynamically constructing and submitting the request when the form content is not empty, if the data size of the current form is greater than or equal to a preset threshold, adopts an incremental update mode, specifically including: A predefined incremental operation instruction JSON Schema is used to structurally define discrete modification operation instructions for editing forms. The discrete modification operation instruction types defined in the incremental operation instruction JSON Schema include at least: modifying form attributes, modifying question attributes, adding questions, and deleting questions. A structured request message is dynamically constructed and submitted to the language model. This structured request message includes: a format enforcement instruction: containing a system instruction that uniquely specifies and enforces that the output of this interaction must conform to the incremental operation instruction JSON Schema array; an operation format definition: containing the incremental operation instruction JSON Schema, which serves as the specific format specification for the format enforcement instruction; and a reference data block: containing the JSON Schema specification and the current form JSON data. This reference data block is appended with a metadata identifier to declare its purpose, indicating that the data block is only used for context understanding and does not have the effect of defining the output format. In the streaming response processing and progressive preview steps, when the incremental operation instruction array is parsed, the form state at the start of the interaction is used as the baseline. The operation instruction array is treated as an executable instruction sequence, and each operation instruction is parsed and applied sequentially to progressively update the form preview interface.
[0052] In the above implementation, when the data size of the current form is determined to be greater than or equal to a preset threshold (for example, the number of questions reaches or exceeds the aforementioned 50), the system will adopt an incremental update mode. The core of this incremental update mode is to guide the language's large model to output specific modification action instructions, rather than the complete form data. For this purpose, an incremental operation instruction JSON Schema needs to be predefined. This schema is a structured specification specifically designed to describe discrete operation instructions for editing forms. It defines the allowed operation types, including at least "modify form attributes," "modify question attributes," "add question," and "delete question."
[0053] In incremental update mode, the request message sent to the language big model needs to be carefully crafted to strictly constrain its output format. This message is a multi-part structure. First, it contains a strong format enforcement instruction, a system-level prompt that explicitly and uniquely specifies that the output of this interaction must be an array of operation instructions conforming to the aforementioned incremental operation instruction JSON Schema. This aims to ensure that the big model outputs instructions, rather than freely chosen natural language or complete JSON. Second, it provides the operation format definition, that is, directly including the defined incremental operation instruction JSON Schema itself in the request, as a specific format specification for the format enforcement instruction, for the model to reference. Finally, it provides a reference data block containing the form's JSON Schema specification and the current form's JSON data. This data block is appended with a special metadata identifier (e.g., marked with a comment or a specific key-value pair), explicitly telling the language big model: this part is only for understanding the current form structure and state context, and does not define the required output format. This design clearly separates the "output format definition" (operation instruction Schema) from the "input context data" (current form), helping to reduce model confusion and improve the format compliance of its output instructions.
[0054] When the language model streams back a response and parses it into a compliant "incremental operation instruction array," the system processes it differently than in full mode. Instead of replacing anything with a new, complete JSON object, it uses the form's initial state as an immutable baseline. The parsed array of operation instructions is then treated as an executable script or sequence of commands. The system reads and applies these commands sequentially. For example, upon encountering a "modify issue attribute" command, the system finds the corresponding control in the copy of the baseline form based on the issue ID specified in the command and modifies its specific attribute; upon encountering a "add issue" command, it inserts a new control object at the specified position. Each time a command or a small batch of commands is successfully applied, the system calculates the state of the current form copy and immediately compares and updates it with the previous preview state. This achieves "progressive updates" based on the command stream. The principle is to transform the AI's editing intent into a series of sequentially executable atomic operations, gradually applying changes to the form and providing real-time feedback throughout the process.
[0055] This implementation significantly reduces the data load of requests and responses by transforming the interaction target from a massive, complete form data set into a streamlined set of operation instructions. This effectively saves network bandwidth and reduces data transmission latency, making it particularly suitable for editing extremely long forms containing hundreds or thousands of questions. The introduction of structured instructions makes the AI's modification intentions clear, parsable, and reversible, improving the accuracy and controllability of the interaction. Simultaneously, this "step-by-step" preview update method allows users to see the changes gradually appear on the interface almost in real time, even for modifications to massive forms. This avoids the frustrating experience of waiting for a huge JSON to be generated, greatly improving the interaction response speed and user experience in large form scenarios.
[0056] In one specific implementation, the instruction types defined in the incremental operation JSON Schema specifically include: Commands to modify form attributes include: operation type identifier, attribute name, and attribute value; Instructions to modify problem attributes: include operation type identifier, problem identifier, attribute name, and attribute value, wherein the problem identifier corresponds to the id attribute of the problem object; Add a problem instruction: including the operation type identifier, insertion position identifier, and problem object; Deleting a problem command includes an operation type identifier and a problem identifier.
[0057] In the above implementation, the instruction types are divided into modifications to the entire form and modifications to specific issues (controls). Modifying form properties instructions are used to change the form's own metadata or global attributes, such as the form's title, description, and submission address. The structure of this instruction contains three key parts: an operation type identifier, which is a fixed string (e.g., modify_form_property) used to allow the system to identify what type of instruction it is; an attribute name, specifying the key name of the form attribute to be modified (e.g., title); and an attribute value, i.e., the new value to be set. Its principle is to directly and precisely locate and replace a specific attribute value of the form's root object.
[0058] The "Modify Question Property" command is used to modify the property of a specific control in a form. Its structure consists of four parts: an operation type identifier (e.g., `modify_question_property`); a question identifier, which must correspond to the `id` attribute of the target question object in the data; this is crucial for accurately locating the target control; the property name, specifying the key name of the control property to be modified (e.g., `placeholder`, `options`); and the new property value. The principle behind this command is to lock a specific control using a unique `id` and then update its specified property. This is suitable for modifying specific settings such as the question's prompt text, option list, and whether a field is required.
[0059] The "Add Question" command is used to insert a new control into a form. Its structure includes an operation type identifier (e.g., `add_question`), an insertion position identifier, and a complete question object. The insertion position identifier can be a numeric index (inserted after the Nth question) or the ID of an existing question (inserted after that question), defining the insertion point for the new control. The question object is a complete object conforming to the form control's JSON Schema, containing all the new control's attributes (id, type, title, etc.). Its principle is to locate the insertion point and insert the new control data into the form's question list. The "Delete Question" command is the simplest, containing an operation type identifier (e.g., `delete_question`) and a question identifier. The system finds and removes the corresponding control based on this ID.
[0060] In one specific implementation, in the difference comparison and update sub-step, if a control in the new JSON object is missing any of the attributes id, type, or title, the control will not be updated to the preview interface until the streaming response ends and the attributes are complete.
[0061] In the above implementation, during difference comparison and updating, if some control objects in the newly parsed JSON object are missing any of the three key attributes (id, type, or title), the system will adopt a conservative strategy: temporarily not updating this control to the form's preview interface. Even if the new JSON object containing this control passes the syntax parsing and may contain other valid attributes, if it does not meet the basic integrity requirement (missing core attributes), it will be considered a "not ready" or "defective" data fragment. The system will shelve it and continue processing subsequent streaming data. Only when the entire streaming response ends and all the finally aggregated and parsed complete data is finally validated, if the missing attributes of the control are completed in subsequent streaming fragments, thus satisfying the basic validity condition, will it be included in the final update. If it still lacks key attributes until the end of the stream, it will be ultimately filtered out and will not be displayed.
[0062] In one specific implementation, the form designer also allows users to directly adjust the form content generated or modified by the language big model in the visual editing interface. After being verified by the normative constraint engine, it can be exported again as JSON data conforming to JSON Schema and used as input for subsequent language big model interactions.
[0063] In the above implementation, the form designer not only displays and progressively updates AI-generated or modified content, but also fully retains its core functionality as a visual editor. Users can directly adjust the form content generated or modified by the language model using input devices such as a mouse and keyboard on the preview interface. These adjustments can be multifaceted, such as dragging questions to change their order; modifying the title or options of a question in the properties panel; adjusting the layout style; or even deleting a control added by the AI or manually adding a control not generated by the AI. To ensure that the manually adjusted data still conforms to the system-defined specifications, the form designer integrates a "standardization constraint engine." This engine performs compliance checks on the user-edited form data in real-time or during validation, based on predefined rules such as JSON Schema. For example, it checks whether required attributes are missing and whether the value types are correct. Only data that passes validation is allowed to be exported.
[0064] The most crucial step is that the validated form content can be exported again as JSON data conforming to the JSON Schema specification. This new JSON data, embodying the initial contributions of the AI and the user's manual optimizations, can serve as input for subsequent interactions with the large language model. When the user issues commands again through the dialog panel, the "current form's JSON data" included in the system's constructed request is this manually refined version. The principle behind this is establishing a closed-loop data flow: "AI output -> manual editing -> standardized export -> becoming new AI input context." This transforms the design process from a single AI projection into a multi-round, progressively optimizing dialogue between humans and machines. Users can use natural language to drive the AI to complete the overall framework and batch modifications, then use precise manual operations for fine-tuning and correction, and finally use the optimized state as a new baseline to continue proposing further optimization requests using natural language.
[0065] In one specific implementation, providing a functional entry point for triggering the language model interaction in step S3 specifically means: integrating a language model dialogue panel into the interactive interface of the form designer; Users can trigger the interaction of the language model by bringing up the dialog panel and entering natural language commands; the modification results returned by the language model are integrated in real time through step S5 and updated to the preview interface of the current form.
[0066] In the above implementation, the entry point for triggering the language model interaction is achieved by directly integrating a language model dialogue panel into the form designer's interactive interface. This dialogue panel can be a floating window, a sidebar, or a fixed area embedded in the main interface. Essentially, it's a chat interface specifically designed for communicating with AI, similar to a common smart assistant dialog box. Users "call up" this dialogue panel through some interaction method (such as clicking an AI icon button or using a shortcut key), making it visible and operable on the interface. Then, users can directly type natural language commands in the input boxes of this panel, such as "Add a file upload question after the third question," "Change all multiple-choice questions to single-choice questions," or "Make the form style more dynamic." When the user sends this command, the interaction process with the language model is formally triggered.
[0067] The system will execute steps S4 and S5: constructing the request, sending it to the language model, and receiving and processing the streaming response. The modifications returned by the language model will be integrated and updated in real-time to the current form's preview interface through the streaming response processing and preview mechanism of S5. Crucially, this update occurs in the designer's main editing / preview area, not just in the dialog panel. Users can see that as the AI "thinks" and "outputs," the form interface is changing dynamically accordingly.
[0068] In another embodiment, an interactive form design system based on a language model is provided, applied to the aforementioned interactive form design method based on a language model, comprising: The form modeling module is used to define and store the document model of a form and its corresponding JSON Schema specification; The form designer module provides a visual form editing interface and supports importing and exporting JSON data that conforms to the JSON Schema specification; The interactive control module provides a functional entry point for triggering the interaction of the language big model in the interactive interface of the form designer module, and responds to the interactive commands triggered by the user. The request construction and submission module is used to dynamically construct and submit a request to the language big model based on the current state of the form designer module, wherein: when the form content is empty, the request includes at least the natural language instructions input by the user and the JSON Schema specification; when the form content is not empty, the request includes at least the natural language instructions input by the user, the JSON Schema specification, and the JSON data of the current form; The streaming response processing module receives the response returned in streaming form from the language big model and processes and visualizes the response in real time to drive the form designer module to progressively update its preview interface.
[0069] In the above embodiment, the system includes a form modeling module, whose responsibility is to carry and provide the content defined in step S1. It is responsible for defining the document model used to describe the form and storing and maintaining the corresponding JSON Schema specification. This module is the cornerstone of the system's data format, providing structured constraint standards for the entire system. Another core module is the form designer module, corresponding to step S2. This module provides a graphical user interface (GUI), i.e., a visual form editing interface, where users can perform drag-and-drop, configuration, and other operations. Simultaneously, it has the ability to exchange data with external systems, importing JSON data conforming to JSON Schema and rendering it as an editable form, and also exporting the current design state as JSON data conforming to the specification.
[0070] The interaction control module corresponds to step S3 and specifically implements the aforementioned dialog panel. Its responsibility is to provide and manage entry points (such as buttons and panels) that trigger AI interactions within the form designer module's interface, and to respond to user interaction commands triggered at these entry points (such as sending chat messages), converting them into an internal system processing event. Once an interaction command is triggered, the request construction and submission module begins its work, corresponding to step S4. This module can access the current form's state (whether it's empty, current JSON data), the JSON Schema specification, and the user's input natural language commands, and dynamically assembles them according to rules into a request message suitable for sending to an external language large model API, then submits the request.
[0071] The final key module is the streaming response processing module, which corresponds to step S5 and further refined processes. This module is responsible for listening to and receiving data returned in streaming mode from the language model API. It implements specific processing logic, such as identifying thought processes, aggregating result fragments, performing corrective analysis, and performing difference comparisons. Ultimately, this module drives the form designer module to progressively update its preview interface, providing real-time, visual feedback of the AI's response to the user.
[0072] These modules do not operate in isolation, but rather collaborate closely through internal data and event flows. The form modeling module provides data specifications for the designer and request building modules; users work in the designer module and initiate AI requests through the interaction control module; the request building module constructs requests using the current state of the designer module and the specifications from the modeling module; and the streaming response processing module, after receiving AI responses, in turn drives the designer module to update its interface. Together, they constitute a complete hardware and software system architecture for realizing "natural language-driven visual form design."
[0073] The following is a specific example to illustrate this. Figure 2 The diagram shows the interaction interface between the language model and the form designer.
[0074] The number of devices and processing scale described herein are for the purpose of simplifying the description of the invention. Applications, modifications, and variations of the invention will be readily apparent to those skilled in the art.
[0075] Although the embodiments of the present invention have been disclosed above, they are not limited to the applications listed in the specification and embodiments. They can be applied to various fields suitable for the present invention. For those skilled in the art, other modifications can be easily made. Therefore, without departing from the general concept defined by the claims and their equivalents, the present invention is not limited to the specific details.
Claims
1. An interactive form design method based on a large language model, characterized in that, Includes the following steps: S1. Define the form model: Define a document model to describe the form structure, and specify the corresponding JSON Schema specification for the document model to constrain the format of the form data; S2. Form Designer: Used for visual editing of forms built based on the document model. The form designer supports importing and exporting JSON data that conforms to the JSON Schema specification. S3. The form designer interacts with the language model: The interactive interface of the form designer provides a function entry point to trigger the interaction of the language model. S4. Dynamic Request Construction and Submission: In response to user-triggered language model interaction commands, dynamically construct and submit requests to the language model based on the current state of the form designer, including: When the form content is empty, the request includes at least the natural language instructions entered by the user and the JSON Schema specification; When the form content is not empty, the request includes at least the natural language instructions entered by the user, the JSON Schema specification, and the JSON data of the current form; S5, Streaming Response Processing and Preview: Receives the response returned in streaming from the large language model, processes and visualizes the response in real time, and progressively updates the preview interface in the form designer.
2. The interactive form design method based on a large language model as described in claim 1, characterized in that, The streaming response processing and progressive preview specifically include: Content recognition and display sub-step: Receive the streaming response, identify the thought process text and the formal result part, and display the thought process text in the interactive interface in real time; The result aggregation and parsing sub-step involves: real-time aggregation of the text fragments in the identified formal result portion, and the remedial parsing method is used to parse the aggregated text fragments into JSON objects that conform to the JSON Schema in real time; Difference comparison and update sub-step: Compare the parsed new JSON object with the previous parsing result. If the structure or content of the new JSON object has changed, immediately import it into the form designer to update the form preview interface.
3. The interactive form design method based on a large language model as described in claim 2, characterized in that, The restorative analysis method includes: Perform grammatical integrity checks on all currently aggregated text fragments and automatically complete any missing JSON syntax elements to form a grammatically correct JSON string; The parsed JSON object is verified to meet the preset basic validity conditions. The basic validity conditions include at least the following: for control objects in the form, they must contain three key attributes: id, type, and title; the JSON object is considered a valid result only if this condition is met.
4. The interactive form design method based on a large language model as described in claim 1, characterized in that, When the form content is not empty, the request is dynamically constructed and submitted. If the data size of the current form is less than a preset threshold, a full update mode can be used, which includes: In the build request, the explicit instruction language big model returns a complete, modified form JSON data that conforms to the stated JSON Schema; In the streaming response processing and progressive preview steps, when the parsed new JSON object is imported into the form designer, a differential merging operation is performed based on the form state at the start of the interaction and the new JSON object. This differential merging operation includes: Control matching steps: Match the controls in the new JSON object with the controls in the form at the start of the interaction, based on the control's id attribute; Attribute fusion step: For a successfully matched control, update the properties of that control in the new JSON object to the corresponding control in the form at the start of the interaction, and retain the properties that exist in the form at the start of the interaction but are not included in the new JSON object; Control management steps: Delete controls whose IDs are not matched in the new JSON object, and add new controls whose IDs do not exist in the form at the start of the interaction.
5. The interactive form design method based on a large language model as described in claim 1, characterized in that, The step of dynamically constructing and submitting the request when the form content is not empty, if the data size of the current form is greater than or equal to a preset threshold, adopts an incremental update mode, specifically including: A predefined incremental operation instruction JSON Schema is used to structurally define discrete modification operation instructions for editing forms. The discrete modification operation instruction types defined in the incremental operation instruction JSON Schema include at least: modifying form attributes, modifying question attributes, adding questions, and deleting questions. A structured request message is dynamically constructed and submitted to the language model. This structured request message includes: a format enforcement instruction: containing a system instruction that uniquely specifies and enforces that the output of this interaction must conform to the incremental operation instruction JSON Schema array; an operation format definition: containing the incremental operation instruction JSON Schema, which serves as the specific format specification for the format enforcement instruction; and a reference data block: containing the JSON Schema specification and the current form JSON data. This reference data block is appended with a metadata identifier to declare its purpose, indicating that the data block is only used for context understanding and does not have the effect of defining the output format. In the streaming response processing and progressive preview steps, when the incremental operation instruction array is parsed, the form state at the start of the interaction is used as the baseline. The operation instruction array is treated as an executable instruction sequence, and each operation instruction is parsed and applied sequentially to progressively update the form preview interface.
6. The interactive form design method based on a large language model as described in claim 5, characterized in that, The instruction types defined in the incremental operation JSON Schema specifically include: Commands to modify form attributes include: operation type identifier, attribute name, and attribute value; Instructions to modify problem attributes: include operation type identifier, problem identifier, attribute name, and attribute value, wherein the problem identifier corresponds to the id attribute of the problem object; Add a problem instruction: including the operation type identifier, insertion position identifier, and problem object; Deleting a problem command includes an operation type identifier and a problem identifier.
7. The interactive form design method based on a large language model as described in claim 2, characterized in that, In the difference comparison and update sub-step, if a control in the new JSON object is missing any of the attributes id, type, or title, the control will not be updated to the preview interface until the streaming response ends and the attributes are complete.
8. The interactive form design method based on a large language model as described in claim 1, characterized in that, The form designer also allows users to directly adjust the form content generated or modified by the language big model in the visual editing interface. After being verified by the normative constraint engine, it can be exported again as JSON data that conforms to JSON Schema and used as input for subsequent language big model interactions.
9. The interactive form design method based on a large language model as described in claim 1, characterized in that, The function entry point for triggering the interaction of the language model in step S3 is specifically: integrating a language model dialogue panel into the interactive interface of the form designer; Users can trigger the interaction of the language model by bringing up the dialog panel and entering natural language commands; the modification results returned by the language model are integrated in real time through step S5 and updated to the preview interface of the current form.
10. An interactive form design system based on a large language model, applied to the interactive form design method based on a large language model as described in any one of claims 1-9, characterized in that, include: The form modeling module is used to define and store the document model of a form and its corresponding JSON Schema specification; The form designer module provides a visual form editing interface and supports importing and exporting JSON data that conforms to the JSON Schema specification; The interactive control module is used to provide a functional entry point for triggering the interaction of the language big model in the interactive interface of the form designer module, and to respond to the interactive commands triggered by the user. The request construction and submission module is used to dynamically construct and submit a request to the language big model based on the current state of the form designer module, wherein: when the form content is empty, the request includes at least the natural language instructions input by the user and the JSON Schema specification; when the form content is not empty, the request includes at least the natural language instructions input by the user, the JSON Schema specification, and the JSON data of the current form; The streaming response processing module receives the response returned in streaming form from the language big model and processes and visualizes the response in real time to drive the form designer module to progressively update its preview interface.
Citation Information
Patent Citations
Web form design method based on mask
CN107391656A
Form generation method and system based on large language model
CN116910275A