Form generation method and device, storage medium and electronic equipment
By receiving form generation requests from the client and combining pre-built prompt information, the pre-trained form generation model is used to generate form configuration codes containing loops and nested structures, which solves the problem that the form generation model in the existing technology is difficult to generate complex structure form configuration codes, and achieves efficient and accurate form generation.
Patent Information
- Application Number
- CN202510587902.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-08
- Publication Date
- 2025-06-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing form generation model is difficult to automatically generate form configuration codes containing complex structures such as loops and nesting, which leads to relevant personnel needing to manually write component configuration codes corresponding to complex structures, which is inefficient.
By receiving the form generation request sent by the client, the fields and field data in the form to be generated are determined, and combined with the pre-constructed prompt information (including the configuration method of loop structure and nested structure), it is input into the pre-trained form generation model to generate the corresponding form configuration code.
It realizes the generation of form configuration codes containing loops and nested structures, which improves the accuracy and richness of form generation, reduces the need for manual code writing, and improves work efficiency.
Smart Images

Figure CN120104131A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and in particular to a form-based generation method, device, storage medium and electronic device. Background Art
[0002] With the development of science and technology, artificial intelligence technology has developed rapidly. Forms can be used for data collection. Before generating a form, relevant personnel often pre-design the structure of the form, that is, there is a target form that needs to be generated. At present, in terms of form generation, in order to reduce the workload of relevant personnel, forms can be generated based on artificial intelligence technology.
[0003] However, the structures contained in the form are diverse. In a form, there are simple structures such as input boxes, drop-down boxes, buttons, and complex structures such as loops and nesting. For example, the data that needs to be collected in the resume form includes personal information, educational experience, etc., and personal information involves filling in data such as name and gender, and educational experience involves filling in data such as school and academic qualifications. In this case, a nested structure can be used to organize the complex information of the resume form to make the generated form more logical and improve the convenience of user filling in. For example, the cargo list form needs to collect information on different goods, and each cargo has data such as name, size, price, etc. In this case, a loop structure can be used to organize the data of the cargo list form so that users can dynamically add or delete form item instances in the generated form based on the actual number of goods. However, the current form generation model can only automatically generate simple structures such as input boxes and drop-down boxes in the form. For complex structures such as loops and nesting, relevant personnel still need to manually write form configuration code. Therefore, how to enable the form generation model to generate form configuration code containing complex structures such as loops and nesting so as to generate forms based on form configuration code is an important issue.
[0004] Based on this, this application specification provides a method for generating a form. Summary of the invention
[0005] This specification provides a form generation method, device, storage medium and electronic device to at least partially solve the above-mentioned problems existing in the prior art.
[0006] This manual adopts the following technical solutions: This specification provides a method for generating a form, which is applied to a server in which a pre-trained form generation model is deployed; the method includes: Receive a form generation request sent by a client, wherein the form generation request carries an image of a target form to be generated; Determine a data example consisting of fields in the target form to be generated and field data corresponding to the fields; Inputting the pre-built prompt information, the image and the data example into the pre-trained form generation model, obtaining the form configuration code corresponding to the target form to be generated output by the pre-trained form generation model; wherein the prompt information at least includes a configuration method of a form component corresponding to a loop structure and a configuration method of a form component corresponding to a nested structure; According to the obtained form configuration code, a target form is generated through the client.
[0007] Optionally, generate a target form, including: The form configuration code is sent to the client, so that the client parses the form configuration code to dynamically generate a target form, wherein the target form includes at least one of a component corresponding to a loop structure and a component corresponding to a nested structure.
[0008] Optionally, generate a target form, including: By means of the client, when a loop structure is identified in the form configuration code, components corresponding to the loop structure of a number corresponding to the field data are generated according to the field data corresponding to the loop structure; According to the components corresponding to the generated loop structure, the target form is obtained.
[0009] Optionally, the prompt information also includes configuration methods of form components corresponding to other structures except the loop structure and the nested structure.
[0010] Optionally, train an initial form generation model, including: Obtain a sample form image and a sample data example consisting of fields in the sample form image and field data corresponding to the fields; and obtain a form configuration code annotation corresponding to the sample form image; Inputting the pre-built prompt information, the sample form image and the sample data example into the initial form generation model, and obtaining the form configuration code prediction result corresponding to the form in the sample form image output by the initial form generation model; The initial form generation model is trained with the goal of minimizing the difference between the form configuration code prediction result and the form configuration code annotation to obtain a trained form generation model.
[0011] Optionally, generate a target form, including: Determine the code corresponding to each form component; A target form is generated through the client according to the obtained form configuration code and the codes corresponding to each form component.
[0012] This specification provides a method for generating a form, which is applied to a client; the method comprises: According to the image of the target form to be generated uploaded by the user, a form generation request is sent to the server, wherein the form generation request carries the image of the target form to be generated, so that the server determines a data example composed of fields in the target form to be generated and field data corresponding to the fields, and inputs the pre-built prompt information, the image and the data example into the pre-trained form generation model to obtain a form configuration code corresponding to the target form to be generated output by the pre-trained form generation model, and the server returns the form configuration code to the client; wherein the prompt information at least includes a configuration method of a form component corresponding to a loop structure and a configuration method of a form component corresponding to a nested structure; Receiving the form configuration code sent by the server; Generate a target form according to the form configuration code.
[0013] This specification provides a form generation device, which is located in a server, and a pre-trained form generation model is deployed in the server; the device specifically includes: A receiving module, used to receive a form generation request sent by a client, wherein the form generation request carries an image of a target form to be generated; A determination module, used for determining a data example consisting of fields in the target form to be generated and field data corresponding to the fields; An output module, used for inputting the pre-built prompt information, the image and the data example into the pre-trained form generation model, and obtaining the form configuration code corresponding to the target form to be generated output by the pre-trained form generation model; wherein the prompt information at least includes the configuration method of the form component corresponding to the loop structure and the configuration method of the form component corresponding to the nested structure; A generating module is used to generate a target form through the client according to the obtained form configuration code.
[0014] Optionally, the generation module is specifically used to send the form configuration code to the client, so that the client parses the form configuration code to dynamically generate a target form, and the target form includes at least one of a component corresponding to a loop structure and a component corresponding to a nested structure.
[0015] Optionally, the generation module is specifically used to, through the client, when a loop structure is identified in the form configuration code, generate components corresponding to the loop structure with a number corresponding to the field data corresponding to the loop structure; and obtain the target form based on the components corresponding to the generated loop structure.
[0016] Optionally, the prompt information also includes configuration methods of form components corresponding to other structures except the loop structure and the nested structure.
[0017] Optionally, the device further comprises a training module; The training module is specifically used to obtain a sample form image and a sample data example consisting of fields in the sample form image and field data corresponding to the fields; and obtain a form configuration code annotation corresponding to the sample form image; input pre-constructed prompt information, the sample form image and the sample data example into the initial form generation model to obtain a form configuration code prediction result corresponding to the form in the sample form image output by the initial form generation model; wherein the prompt information at least includes a configuration method for a form component corresponding to a loop structure and a configuration method for a form component corresponding to a nested structure; with the goal of minimizing the difference between the form configuration code prediction result and the form configuration code annotation, the initial form generation model is trained to obtain a trained form generation model.
[0018] This specification provides a form generation device, which is located at a client; the device specifically includes: A sending module, used for sending a form generation request to a server according to an image of a target form to be generated uploaded by a user, wherein the form generation request carries an image of the target form to be generated, so that the server determines a data example composed of fields in the target form to be generated and field data corresponding to the fields, and inputs pre-built prompt information, the image and the data example into the pre-trained form generation model to obtain a form configuration code corresponding to the target form to be generated output by the pre-trained form generation model, and the server returns the form configuration code to the client; wherein the prompt information at least includes a configuration method of a form component corresponding to a loop structure and a configuration method of a form component corresponding to a nested structure; A receiving module, used for receiving the form configuration code sent by the server; The generating module is used to generate a target form according to the form configuration code.
[0019] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the method for generating the above-mentioned form is implemented.
[0020] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned plasma-based inversion proxy model training method when executing the program.
[0021] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects: In the form generation method provided in the present specification, the server can receive a form generation request sent by a client, and the form generation request carries an image of a target form to be generated. Then, a data example consisting of fields in the target form to be generated and field data corresponding to the fields can be determined. Then, the pre-built prompt information, images, and data examples are input into a pre-trained form generation model to obtain a form configuration code corresponding to the target form to be generated output by the pre-trained form generation model, and the prompt information at least includes a configuration method of a form component corresponding to a loop structure and a configuration method of a form component corresponding to a nested structure. Finally, the server can generate the target form through the client according to the obtained form configuration code.
[0022] It can be seen from the above method that the image of the target form to be generated and the data example consisting of the fields in the target form to be generated and the field data corresponding to the fields are input into the form generation model. The form of the data example can reflect the structure existing in the form, and through the fields, the form generation model can correspond the form items in the image to the data example. Therefore, the data example and the image combined input method help the form generation model to better understand the structure existing in the target form in the image, thereby improving the accuracy of the generated form. In addition, by constructing prompt information including at least the configuration method of the form component corresponding to the loop structure and the configuration method of the form component corresponding to the nested structure, and inputting them into the form generation model, the form generation model can understand the use of the loop structure and the nested structure, thereby improving the richness of the generated form. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings: Figure 1 A flowchart of a method for generating a form in this manual; Figure 2A schematic diagram of a form generation model provided in this manual; Figure 3 A flowchart of a method for generating a form in this manual; Figure 4 A schematic diagram of a form generation device provided in this specification; Figure 5 A schematic diagram of a form generation device provided in this specification; Figure 6 The corresponding Figure 1 Schematic diagram of electronic equipment. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the specification.
[0025] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.
[0026] As described in the background technology, there are relatively complex structures such as loops and nesting in the form. The current form generation model has a relatively low ability to generate form configuration code with complex structures, and is even unable to generate form configuration code with loops and nested structures. Therefore, when the final form is rendered based on the form configuration code, relevant personnel are required to manually write the configuration logic of the components corresponding to the complex structure, resulting in low form generation efficiency and waste of human resources.
[0027] In this specification, considering that the UI image of the target form and the data example corresponding to the target form can reflect the structure and logic of the form, it is considered that the data example corresponding to the target form is also input into the form generation model as input, so that the form generation model learns the correspondence between the data example and the form items in the target form, so as to better understand the structure of the form. In addition, in this specification, a prompt word is also constructed, which at least includes the configuration method of the form component corresponding to the loop structure and the configuration method of the form component corresponding to the nested structure, which can further help the form generation model understand the structure of the form, and enable the form generation model to determine the loop structure and nested structure used in the target form, which can not only make the structure of the form corresponding to the generated form configuration code richer, but also improve the accuracy of the form corresponding to the generated form configuration code.
[0028] Figure 1 A flowchart of a method for generating a form provided in this specification may include the following steps: S100: receiving a form generation request sent by a client, wherein the form generation request carries an image of a target form to be generated.
[0029] In this specification, the user determines the image of the target form to be generated on the client side, and can upload the image of the target form to be generated to the client. The client can generate a form generation request based on the image of the target form to be generated uploaded by the user. The form generation request carries the image of the target form to be generated, and the client can send the form generation request to the server.
[0030] Thus, the server can receive the form generation request sent by the client, and in subsequent steps, based on the image of the target form carried in the form generation request, determine the form configuration code through a pre-trained form generation model.
[0031] The image of the target form is a prototype image or a UI design image.
[0032] S102: Determine a data example consisting of fields in the target form to be generated and field data corresponding to the fields.
[0033] As mentioned above, the UI image of the target form and the data example corresponding to the target form can reflect the structure and logic of the form. Therefore, in this specification, the server can determine a data example consisting of each field in the target form to be generated and the field data corresponding to each field.
[0034] Specifically, the user can upload a data sample by himself, and the form generation request generated by the client and sent to the server also carries the data sample. Of course, the data sample can also be a data sample generated by the server based on the image of the target form to be generated, such as using image detection technology, optical character recognition technology, etc., to determine the data fields in the image, etc.
[0035] It should be noted that in one or more embodiments of this specification, the data example is the format of the transmission data agreed upon by the client and the server, which can be a JSON object, including several fields and field data corresponding to the fields, that is, including several key-value pairs, the key is a string, and the value can be one of a number, a string, a Boolean value, null, an object, and an array. If the value is an array or an object, it can be further nested.
[0036] The data example may be a backend interface document, a database table structure, a database table creation statement, etc., and this specification does not impose any specific limitation.
[0037] S104: Input the pre-constructed prompt information, the image and the data example into the pre-trained form generation model to obtain the form configuration code corresponding to the target form to be generated output by the pre-trained form generation model; wherein the prompt information at least includes a configuration method of the form component corresponding to the loop structure and a configuration method of the form component corresponding to the nested structure.
[0038] like Figure 2 As shown, it is a schematic diagram of a form generation model provided in this specification. In this specification, the server can input pre-built prompt information, a picture of the target form to be generated, and a data example into a pre-trained form generation model to obtain a form configuration code corresponding to the target form to be generated output by the pre-trained form generation model.
[0039] In one or more embodiments of the present specification, the form generation model is a large language model.
[0040] In this specification, the prompt information at least includes the configuration method of the form component corresponding to the loop structure and the configuration method of the form component corresponding to the nested structure. In one or more embodiments of this specification, the prompt information may also include the configuration method of the form component corresponding to other structures besides the configuration method of the form component corresponding to the loop structure and the configuration method of the form component corresponding to the nested structure, such as the configuration method of the form component such as the input box and the drop-down box.
[0041] S106: Generate a target form through the client according to the obtained form configuration code.
[0042] Finally, the server can generate a target form through the client according to the form configuration code output by the pre-trained form generation model. Specifically, the server can send the form configuration code to the client, and the client can parse the form configuration code and dynamically render the target form. In one or more embodiments of the present specification, the target form rendered by the client includes at least one of a component corresponding to a loop structure and a component corresponding to a nested structure.
[0043] It should be noted that the specific technical method used by the client to render the form configuration code into the target form is not specifically limited in this specification, and this technology is relatively mature in the current form generation field, so this specification does not make specific details.
[0044] In this specification, when the client generates a target form, the client can generate a loop structure in the form configuration code. When the loop structure is identified, the client generates components corresponding to the number of loop structures corresponding to the field data according to the field data corresponding to the loop structure, and then further processes other data in the form configuration code according to the generated number of components corresponding to the loop structure, thereby rendering the target form. For example, when the client parses the form configuration code and identifies that the form configuration code includes a loop structure, it can determine the array type data corresponding to the loop structure and the array length of the array type data, that is, determine the field data corresponding to the loop structure, and the field data is the array length, thereby generating components corresponding to the number of loop structures corresponding to the array length, and determining other components according to other form configuration codes, thereby rendering to obtain the target form.
[0045] based on Figure 1 In the above-mentioned form generation method provided in this specification, the image of the target form to be generated and the data example consisting of the fields in the target form to be generated and the field data corresponding to the fields are input into the form generation model. The form of the data example can reflect the structure existing in the form, and through the fields, the form generation model can correspond the form items in the image to the data example. Therefore, the data example and the image combined input method help the form generation model to better understand the structure existing in the target form in the image, thereby improving the accuracy of the generated form. In addition, by constructing prompt information including at least the configuration method of the form component corresponding to the loop structure and the configuration method of the form component corresponding to the nested structure, and inputting them into the form generation model, the form generation model can understand the use of the loop structure and the nested structure, thereby improving the richness of the generated form.
[0046] like Figure 3 As shown, it is a flowchart of a method for generating a form provided in this specification. It can be seen that on the client side, generating a form specifically includes the following steps: S200: According to the image of the target form to be generated uploaded by the user, a form generation request is sent to the server, wherein the form generation request carries the image of the target form to be generated, so that the server determines a data example composed of fields in the target form to be generated and field data corresponding to the fields, and inputs pre-built prompt information, the image and the data example into the pre-trained form generation model to obtain a form configuration code corresponding to the target form to be generated output by the pre-trained form generation model, and the server returns the form configuration code to the client; wherein the prompt information at least includes a configuration method of a form component corresponding to a loop structure and a configuration method of a form component corresponding to a nested structure.
[0047] S202: Receive the form configuration code sent by the server.
[0048] S204: Generate a target form according to the form configuration code.
[0049] As mentioned above, the client uses a specific technical method to render the form configuration code into the target form. This specification does not make specific restrictions, and this technology is relatively mature in the current form generation field, so this specification will not go into details.
[0050] In addition, the client side can also perform format verification, size restrictions, etc. on the images uploaded by the user to ensure that the images uploaded by the user to be generated meet the requirements.
[0051] Further, in order to improve the accuracy of the generated target form, in the present specification, in the above step S106, when the server generates the target form through the client according to the obtained form configuration code, the server may first verify the form configuration code, and when it is determined that the verification passes, send the form configuration code to the client, so that the client renders the target form based on the form configuration code. In one or more embodiments of the present specification, the server may pre-customize the verification rules, so that the generated form configuration code can be verified based on the pre-customized verification rules.
[0052] In one or more embodiments of the present specification, the verification rules may include the existence of a field, the correctness of a field data type, the value range of a field, etc. Through this verification, it is possible to ensure that the structure and content of the form configuration code meet expectations, and avoid sending invalid or incomplete form configuration codes to the client, thereby failing to generate a form or generating an erroneous or non-compliant form.
[0053] In addition, this specification provides a method for training an initial form generation model.
[0054] Specifically, in this specification, the server can obtain a sample form image and a sample data example consisting of fields in the sample form image and field data corresponding to the fields, and the server can also obtain the form configuration code annotation corresponding to the sample form image. Then, the server can input the pre-built prompt information, sample form image and sample data example into the initial form generation model to obtain the form configuration code prediction result corresponding to the form in the sample form image output by the initial form generation model, and the prompt information at least includes the configuration method of the form component corresponding to the loop structure and the configuration method of the form component corresponding to the nested structure. Finally, the server can train the initial form generation model with the goal of minimizing the difference between the form configuration code prediction result and the form configuration code annotation, thereby obtaining a trained form generation model.
[0055] As mentioned above, the initial form generation model can be a large language model. The training of the initial form generation model can be used to fine-tune the large language model so that the large language model can capture the potential correspondence between the form image and the data examples corresponding to the form in the image, thereby enabling the large language model to better understand the structure existing in the form and improve the accuracy of the form configuration code output by the large language model.
[0056] In actual applications, when the client renders the target form based on the form configuration code, it needs to use the pre-packaged form component in the client. In one or more embodiments of this specification, the form component in the client can receive a JavaScript object as input, and the form component can be pre-built based on frameworks such as React and Vue.js. Since the key value of the JavaScript object allows more data types, for example, its value can be a function, the form component can perform more logical operations through the function, thereby improving the flexibility of generating the form.
[0057] In addition, in one or more embodiments of the present specification, the form is configured as a tree structure, and the format of each tree node is FormItem. When the client renders and generates the target form, the client can deeply traverse the tree structure and dynamically render the form component for each FormItem node according to the configuration item corresponding to the node.
[0058] Among them, during the deep traversal process, for each FormItem node, the client can combine all the keys on the path from the root node to the FormItem node into a path. That is to say, the path represents how to access the value bound to the FormItem node from the data. Each FormItem node corresponds to a key in the data, and the key value will be passed to the form component as the initial value. When the user modifies the input, the new value will be updated to the corresponding data key.
[0059] The configuration items of FormItem may include: key, type of form component, label, items, props, value, etc.
[0060] Among them, label is the prompt text on the left side of the control and supports the use of functions.
[0061] Among them, the type (type) of the form component can be input corresponding to text input, number corresponding to numeric input, select corresponding to drop-down selection, radio corresponding to radio button, and so on. In this specification, the types of form components also include loops and nesting, that is, the form component also includes components corresponding to the nested structure, namely the group component and components corresponding to the loop structure, namely the list component. The group component can be used to nest forms. On the UI image corresponding to the form, the nested component can be a color block, an indent, a group of dividing lines, etc., and in the data example, it is a nested structure with the value of an object. The list component can render its corresponding subcomponents in a loop. On the UI image corresponding to the form, it is a repeated series of form items, and in the data example, it is a nested structure with the value of an object.
[0062] Among them, if there is a component in the form that does not correspond to a field in the data, such as a plain text used for prompts or summaries, you can directly assign it a value through value.
[0063] In this specification, in the form component, the component corresponding to the loop structure, namely the list component, and the component corresponding to the nested structure, namely the group component, can be constructed to generate richer and more complex forms, making the generated forms more logical and easier to manage, while also improving the user experience and enhancing the flexibility and scalability of the configuration code.
[0064] Based on the form generation method described above, the embodiment of this specification also provides a schematic diagram of a form generation device, such as Figure 4 shown.
[0065] Figure 4 A schematic diagram of a form generation device provided in an embodiment of this specification, wherein the device is located in a server, and a pre-trained form generation model is deployed in the server; the device specifically includes: This specification provides a form generation device, which is located in a server, and a pre-trained form generation model is deployed in the server; the device specifically includes: The receiving module 300 is used to receive a form generation request sent by a client, wherein the form generation request carries an image of a target form to be generated; A determination module 302 is used to determine a data example consisting of fields in the target form to be generated and field data corresponding to the fields; The output module 304 is used to input the pre-built prompt information, the image and the data example into the pre-trained form generation model to obtain the form configuration code corresponding to the target form to be generated output by the pre-trained form generation model; wherein the prompt information at least includes the configuration method of the form component corresponding to the loop structure and the configuration method of the form component corresponding to the nested structure; The generating module 306 is used to generate a target form through the client according to the obtained form configuration code.
[0066] Optionally, the generating module 306 is specifically configured to send the form configuration code to the client, so that the client parses the form configuration code to dynamically generate a target form.
[0067] Optionally, the generating module 306 is specifically configured to verify the obtained form configuration code, and when it is determined that the verification passes, send the form configuration code to the client.
[0068] Optionally, the prompt information also includes configuration methods of form components corresponding to other structures except the loop structure and the nested structure.
[0069] Optionally, the device further comprises a training module 308; The training module 308 is specifically used to obtain a sample form image and a sample data example consisting of fields in the sample form image and field data corresponding to the fields; and obtain a form configuration code annotation corresponding to the sample form image; input pre-constructed prompt information, the sample form image and the sample data example into the initial form generation model to obtain a form configuration code prediction result corresponding to the form in the sample form image output by the initial form generation model; wherein the prompt information at least includes a configuration method for a form component corresponding to a loop structure and a configuration method for a form component corresponding to a nested structure; with the goal of minimizing the difference between the form configuration code prediction result and the form configuration code annotation, the initial form generation model is trained to obtain a trained form generation model.
[0070] Based on the form generation method described above, the embodiment of this specification also provides a schematic diagram of a form generation device, such as Figure 5 shown.
[0071] Figure 5 A schematic diagram of a form generation device provided in an embodiment of this specification, wherein the device is located at a client; the device specifically includes: The sending module 400 is used to send a form generation request to the server according to the image of the target form to be generated uploaded by the user, wherein the form generation request carries the image of the target form to be generated, so that the server determines a data example composed of fields in the target form to be generated and field data corresponding to the fields, and inputs the pre-built prompt information, the image and the data example into the pre-trained form generation model to obtain a form configuration code corresponding to the target form to be generated output by the pre-trained form generation model, and the server returns the form configuration code to the client; wherein the prompt information at least includes a configuration method of a form component corresponding to a loop structure and a configuration method of a form component corresponding to a nested structure; The receiving module 402 is used to receive the form configuration code sent by the server; The generating module 404 is used to generate a target form according to the form configuration code.
[0072] Based on the method of generating the form described above, this specification embodiment also proposes Figure 6 The schematic structure diagram of the electronic device shown in FIG. Figure 6 At the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the method of generating the form described above.
[0073] Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the executor of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0074] In the 1990s, it was very clear whether the improvement of a technology was hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with hardware entity modules. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0075] The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, and the memory controller may also be implemented as part of the control logic of the memory. It is also known to those skilled in the art that, in addition to implementing the controller in a purely computer-readable program code manner, the controller may be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the devices for implementing various functions included therein may also be considered as structures within the hardware component. Or even, the devices for implementing various functions may be considered as both software modules for implementing the method and structures within the hardware component.
[0076] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0077] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0078] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0079] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0080] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0081] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0082] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0083] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0084] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0085] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0086] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0087] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0088] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0089] The above description is only an embodiment of this specification and is not intended to limit this specification. For those skilled in the art, this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification should be included in the scope of the claims of this application.
Claims
1. A method for generating a form, characterized in that: The method is applied to a server, in which a pre-trained form generation model is deployed; the method comprises: Receive a form generation request sent by a client, wherein the form generation request carries an image of a target form to be generated; Determine a data example consisting of fields in the target form to be generated and field data corresponding to the fields; Inputting the pre-built prompt information, the image and the data example into the pre-trained form generation model, obtaining the form configuration code corresponding to the target form to be generated output by the pre-trained form generation model; wherein the prompt information at least includes a configuration method of a form component corresponding to a loop structure and a configuration method of a form component corresponding to a nested structure; According to the obtained form configuration code, a target form is generated through the client.
2. The method according to claim 1, characterized in that Generate a target form, including: The form configuration code is sent to the client, so that the client parses the form configuration code to dynamically generate a target form, wherein the target form includes at least one of a component corresponding to a loop structure and a component corresponding to a nested structure.
3. The method according to claim 1, characterized in that Generate a target form, including: By means of the client, when a loop structure is identified in the form configuration code, components corresponding to the loop structure of a number corresponding to the field data are generated according to the field data corresponding to the loop structure; According to the components corresponding to the generated loop structure, the target form is obtained.
4. The method according to claim 1, characterized in that The prompt information also includes configuration methods of form components corresponding to other structures except the loop structure and the nested structure.
5. The method according to claim 1, characterized in that Pre-train the initial form generation model, including: Obtain a sample form image and a sample data example consisting of fields in the sample form image and field data corresponding to the fields; and obtain a form configuration code annotation corresponding to the sample form image; Input the pre-built prompt information, the sample form image and the sample data example into the initial form generation model to obtain the form configuration code prediction result corresponding to the form in the sample form image output by the initial form generation model; wherein the prompt information at least includes the configuration method of the form component corresponding to the loop structure and the configuration method of the form component corresponding to the nested structure; The initial form generation model is trained with the goal of minimizing the difference between the form configuration code prediction result and the form configuration code annotation to obtain a trained form generation model.
6. A method for generating a form, characterized in that: The method is applied to a client; the method comprises: According to the image of the target form to be generated uploaded by the user, a form generation request is sent to the server, wherein the form generation request carries the image of the target form to be generated, so that the server determines a data example composed of fields in the target form to be generated and field data corresponding to the fields, and inputs the pre-built prompt information, the image and the data example into the pre-trained form generation model to obtain a form configuration code corresponding to the target form to be generated output by the pre-trained form generation model, and the server returns the form configuration code to the client; wherein the prompt information at least includes a configuration method of a form component corresponding to a loop structure and a configuration method of a form component corresponding to a nested structure; Receiving the form configuration code sent by the server; Generate a target form according to the form configuration code.
7. A form generating device, characterized in that: The device is located in a server, and a pre-trained form generation model is deployed in the server; The device specifically comprises: A receiving module, used to receive a form generation request sent by a client, wherein the form generation request carries an image of a target form to be generated; A determination module, used for determining a data example consisting of fields in the target form to be generated and field data corresponding to the fields; An output module, used for inputting the pre-built prompt information, the image and the data example into the pre-trained form generation model, and obtaining the form configuration code corresponding to the target form to be generated output by the pre-trained form generation model; wherein the prompt information at least includes the configuration method of the form component corresponding to the loop structure and the configuration method of the form component corresponding to the nested structure; A generating module is used to generate a target form through the client according to the obtained form configuration code.
8. A form generation device, characterized in that: The device is located at the client; the device specifically includes: A sending module, used for sending a form generation request to a server according to an image of a target form to be generated uploaded by a user, wherein the form generation request carries an image of the target form to be generated, so that the server determines a data example composed of fields in the target form to be generated and field data corresponding to the fields, and inputs pre-built prompt information, the image and the data example into the pre-trained form generation model to obtain a form configuration code corresponding to the target form to be generated output by the pre-trained form generation model, and the server returns the form configuration code to the client; wherein the prompt information at least includes a configuration method of a form component corresponding to a loop structure and a configuration method of a form component corresponding to a nested structure; A receiving module, used for receiving the form configuration code sent by the server; The generating module is used to generate a target form according to the form configuration code.
9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of claims 1 to 6 is implemented.
10. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Intelligent low-code page development system and method
CN117331561A
Form page generation method and device and electronic equipment
CN117875288A
Low-code application generation method and device, electronic equipment and storage medium
CN118428336A
