Non-intrusive dynamic form configuration and application method, device, equipment and medium
By building a JSON data model and binding it to form templates, a read-only copy is generated, solving the problem of frequent changes in form requirements in Internet applications. This enables dynamic management and zero-code updates of form functions, improving development efficiency and system flexibility.
Patent Information
- Application Number
- CN202511847636.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-09
- Publication Date
- 2026-03-13
AI Technical Summary
In internet application development, frequent changes in form requirements lead to repeated builds, tests, and releases of the program, increasing workload and error risks, and extending the delivery cycle.
A non-intrusive dynamic form configuration method is adopted. By constructing a JSON-structured data model, configuring data types and permissions, binding form template components, and generating read-only copies, the form display, filling, and validation logic are separated from the program code.
It enables dynamic and configurable management of form functionality, reduces maintenance costs, improves development efficiency and system flexibility, and reduces the workload and error risk of code-level updates.
Smart Images

Figure CN121658460A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data processing technology, and more specifically, to a non-intrusive dynamic form configuration and application method, apparatus, device and medium. Background Technology
[0002] When developing internet applications, companies often encounter situations requiring users to fill out forms. This data is stored on a server and viewed later in read-only mode. After the initial release of the application, the implemented form interface may require modifications, such as changing the displayed content, the information required from the user, or the validation logic. These new modification requests can be frequent, with most adjustments involving interface displays or minor changes to the input fields. Implementing these changes by modifying the code would necessitate multiple code builds and manual testing. Bugs discovered during testing would further increase the number of builds, introducing a significant workload in a short period. Summary of the Invention
[0003] In view of this, this disclosure provides a non-intrusive dynamic form configuration and application method, apparatus, device and medium.
[0004] One aspect of this disclosure provides a non-intrusive dynamic form configuration and application method, comprising: constructing a JSON-structured data model and configuring data types and data permissions for nodes in the model; configuring multiple form templates and binding nodes in the data model to input components in each form template; responding to a user's data entry request, matching and loading a target form template from the multiple form templates according to user attributes, and generating a read-only copy of the data entered by the user into the target form template according to the format of the data model; responding to a user's query request for the target form template, loading the read-only copy into the target form template, and displaying the portion of the read-only copy that the current user has viewing permissions in read-only mode.
[0005] According to embodiments of this disclosure, constructing a JSON-structured data model and configuring data types and data permissions for nodes in the model includes: constructing node data types for the data model, wherein the node data types include objects, arrays, integers, floating-point numbers, strings, booleans, and reference types; configuring data types, validation rules, and data permissions for the nodes of the data model, wherein the validation rules are used to define the data format of the nodes, and the data permissions are used to restrict the data that users can access after publishing a read-only copy of the data model.
[0006] According to embodiments of this disclosure, the verification rules are configured based on data types, including: integer and floating-point type nodes support configuration for whether fields are required and for numerical range verification; string type nodes support configuration for whether fields are required and for string length verification; boolean type nodes support configuration for whether fields are required; internal child nodes of object and array type nodes support recursive application of the verification rules; reference type nodes inherit the verification rules and data permissions of the referenced data model and cannot be modified.
[0007] According to embodiments of this disclosure, configuring multiple form templates and binding nodes in the data model to input components in each form template includes: placing input components, structural components, static text, or images into the editing area via a drag-and-drop interface to form the multiple form templates; binding non-object type nodes in the data model to input components, wherein array type nodes are only allowed to be bound to components that support multi-value input.
[0008] According to embodiments of this disclosure, the step of responding to a user's data entry request, matching and loading a target form template from the plurality of form templates based on user attributes, and generating a read-only copy of the data entered by the user into the target form template according to the format of the data model includes: responding to a user's data entry request, matching and loading a target form template from the plurality of form templates based on the user's attributes; receiving input data from the user in the target form template, and validating the input data according to the validation rules in the data model bound to the target form template; after successful validation, storing the input data as data entry data in JSON format, and associating the identification information of the target form template with the data entry data to generate the read-only copy.
[0009] According to embodiments of this disclosure, in a data entry scenario, the target form template only displays input components that the user is authorized to fill in, and executes the bound validation rules; in a query scenario, the target form template displays data in a read-only style, and only displays data content that the user is authorized to view.
[0010] According to embodiments of this disclosure, the method further includes: in a data replacement form scenario, selecting existing data of the associated form to be replaced and a target new form template; comparing the structural differences between the original target form template and the data model associated with the target new form template; writing the existing data into the target new form template, and adjusting the existing data based on the structural differences so that the existing data matches the constraints of the target new form template.
[0011] Another aspect of this disclosure provides a non-intrusive dynamic form configuration and application device, comprising: a model building module for constructing a JSON-structured data model and configuring data types and data permissions for nodes in the model; a form configuration module for configuring multiple form templates and binding nodes in the data model to input components in each form template; a data writing module for responding to a user's data entry request, matching and loading a target form template from the multiple form templates according to user attributes, and generating a read-only copy of the data entered by the user into the target form template according to the format of the data model; and a data query module for responding to a user's query request for the target form template, loading the read-only copy into the target form template, and displaying the portion of the read-only copy that the current user has viewing permissions in read-only mode.
[0012] Another aspect of this disclosure provides an electronic device comprising: one or more processors; and a memory for storing one or more programs, wherein, when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to perform the method as described above.
[0013] Another aspect of this disclosure provides a computer-readable storage medium storing computer-executable instructions that, when executed, are used to implement the method described above.
[0014] Because it employs a technical approach that separates the display, filling, and validation logic of forms from the program code by publishing immutable data models and read-only copies of form templates, it at least partially overcomes the technical problem in Internet application development where frequent changes in form requirements necessitate repeated program building, testing, and deployment, thereby introducing a huge workload, extending delivery cycles, and increasing the risk of errors. This achieves the technical effect of enabling dynamic, configurable management and zero-code updates of form functions, significantly reducing maintenance costs, improving development efficiency, and enhancing system flexibility. Attached Figure Description
[0015] The above and other objects, features and advantages of this disclosure will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0016] Figure 1 A flowchart illustrating a non-intrusive dynamic form configuration and application method according to an embodiment of the present disclosure is shown schematically.
[0017] Figure 2 A block diagram illustrating a non-intrusive dynamic form configuration and application apparatus according to embodiments of the present disclosure is shown; and
[0018] Figure 3A block diagram of an electronic device 300 suitable for implementing a non-intrusive dynamic form configuration and application method according to an embodiment of the present disclosure is shown schematically. Detailed Implementation
[0019] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.
[0020] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0021] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0022] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0023] In the embodiments disclosed herein, the collection, updating, analysis, processing, use, transmission, provision, disclosure, and storage of data (e.g., including but not limited to user personal information) comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures have been taken to prevent unauthorized access to user personal information data and to safeguard user personal information security, network security, and national security.
[0024] In the embodiments disclosed herein, user authorization or consent is obtained before acquiring or collecting user personal information.
[0025] Figure 1 A flowchart illustrating a non-intrusive dynamic form configuration and application method according to an embodiment of the present disclosure is shown.
[0026] like Figure 1 As shown, the method includes operations S110~S140.
[0027] In operation S110, a data model with a JSON structure is constructed, and data types and data permissions are configured for the nodes in the model.
[0028] In this embodiment of the disclosure, when building this function, an interface for editing data models should be established. Each data model specifies a JSON-formatted data structure, which is designed within this interface.
[0029] Construct a JSON-structured data model and configure data types and permissions for the nodes in the model, including S111~S112.
[0030] In operation S111, the node data types of the data model are constructed. The node data types include objects, arrays, integers, floating-point numbers, strings, booleans, and reference types.
[0031] In operation S112, data types, validation rules, and data permissions are configured for the nodes of the data model. Validation rules are used to define the data format of the nodes, and data permissions are used to restrict the data that users can access after publishing a read-only copy based on the data model.
[0032] The parent node of the data model can only have two data types: object and array. Selecting an object type allows you to add child nodes to that node, and the type can be integer, floating-point number, string, boolean value, object, array, or reference. Selecting an array allows you to specify the type of the elements in the array, with the same types as objects. The effects of selecting objects and arrays apply recursively, while selecting references allows you to reference an already published data model structure.
[0033] Each node needs to be configured with a key name, display name, and data type. Configurable validation rules include: integer and floating-point type nodes support configuration for whether the field is required and for numerical range validation; string type nodes support configuration for whether the field is required and for string length validation; boolean type nodes support configuration for whether the field is required; internal child nodes of object and array type nodes support recursive application of validation rules; reference type nodes inherit the validation rules and data permissions of the referenced data model and cannot be modified.
[0034] The relationship between validation rules and data types is shown in the table below:
[0035]
[0036] The length check determines how many characters the string contains.
[0037] Each node in the data structure can be configured with data permissions. The conditions that the attributes of users who can see the value of the node must meet can be selected. Different conditions can be combined according to the "AND" and "OR" relationships. Nodes with data types that are references retain the data permissions of their internal child nodes and cannot modify them, but the data permissions of the current node as a whole can be increased.
[0038] The configured data model can be published. When published, a read-only copy is created, retaining all its attributes at the time of publication.
[0039] When accessing data from a data model (whether published or not), it should be able to parse the JSON format described by the model and obtain the path of all nodes in the JSON format, the type of the corresponding value, the validation rules, and the data permissions.
[0040] In operation S120, multiple form templates are configured, and nodes in the data model are bound to input components in each form template.
[0041] In this embodiment of the disclosure, when constructing this function, an interface for editing the data entry interface should be established. This interface must allow users to drag and drop interface components to the editing area to build the entry interface. Draggable components include, but are not limited to, input components, structural components, static text, and images. Multiple form templates are formed by placing input components, structural components, static text, or images into the editing area through a drag-and-drop interface. Non-object type nodes in the data model are bound to input components. Array type nodes are only allowed to be bound to components that support multiple input values; that is, the content entered by the user on the input component will be stored under that node. Only data nodes that are not object data types can be bound to input components. Array type data nodes can only be bound to components that provide multiple input values. The entry interface also provides a read-only view of the entered data. When viewing the context, components that previously allowed input display the entered content in a read-only style.
[0042] Once created, the form submission interface can be published. Before publishing, you need to configure the conditions that the users matching this published form submission interface must meet. Different conditions are combined using an "OR" relationship, and the system needs to specify the priority of the conditions. During publication, a read-only copy is created, retaining all its attributes at the time of publication, the attributes of the associated data model, and the attributes matching the user conditions.
[0043] In operation S130, in response to the user's data entry request, the target form template is matched and loaded from multiple form templates based on the user's attributes, and a read-only copy of the data entered by the user into the target form template is generated according to the format of the data model.
[0044] Operation S130 includes S131 to S133.
[0045] In operation S131, in response to the user's data entry request, the target form template is matched from multiple form templates based on the user's attributes and loaded.
[0046] In operation S132, the user input data in the target form template is received, and the input data is validated according to the validation rules in the data model bound to the target form template.
[0047] In operation S133, after successful verification, the input data is stored as fill-in data in JSON format, and a read-only copy is generated by associating the identification information of the target form template with the fill-in data.
[0048] In this embodiment, when a user fills out the form, the best-matching form interface is loaded. The best interface is found as follows: for each interface V containing matching conditions, the highest priority condition C among all matching conditions for each interface is found. The C conditions for each V are sorted according to their priority, and the V represented by the highest priority C is selected as the best-matching interface. This interface only contains components that satisfy the user's data permissions. For the displayed components, the configured verification rules will take effect. After the user fills in the content into the input component, the verification rules will determine whether the input is compliant. Only when all input content is compliant can the form data be saved or submitted.
[0049] The following are examples of data model configuration, corresponding data entry interface, and the format of submitted data:
[0050]
[0051] Submitted data is stored in the database according to the data format at the time of submission. Therefore, the database must support storage in native JSON format, such as JSON type columns in MySQL, or in a MongoDB collection. Each submitted data entry must also specify the form used for that data entry.
[0052] In operation S140, in response to a user's query request for a target form template, a read-only copy is loaded into the target form template, and the portion of the read-only copy that the current user has viewing permissions for is displayed in read-only mode.
[0053] In the form filling scenario, the target form template only displays the input components that the user is authorized to fill in and executes the bound validation rules; in the query scenario, the target form template displays the data in a read-only style and only displays the data content that the user is authorized to view.
[0054] If the system needs to display old data through the new form entry interface, the following measures must be implemented to ensure the normal operation of the system: In the case of data replacement forms, select the existing data of the associated form to be replaced and the target new form template; compare the structural differences between the original target form template and the data model associated with the target new form template; write the existing data into the target new form template, and adjust the existing data based on the structural differences so that the existing data matches the constraints of the target new form template.
[0055] Specifically, for keys that exist in the old model but not in the new model, the corresponding values should be discarded. For keys that do not exist in the old model but exist in the new model, and where there are validation rules for the value of the key, a default value that conforms to the validation rules should be provided. For keys that exist in both the old and new models, but where there are incompatible changes to the data type or validation rules, a conversion scheme should be provided to make the old data conform to the constraints of the new model.
[0056] Because it employs a technical approach that separates the display, filling, and validation logic of forms from the program code by publishing immutable data models and read-only copies of form templates, it at least partially overcomes the technical problem in Internet application development where frequent changes in form requirements necessitate repeated program building, testing, and deployment, thereby introducing a huge workload, extending delivery cycles, and increasing the risk of errors. This achieves the technical effect of enabling dynamic, configurable management and zero-code updates of form functions, significantly reducing maintenance costs, improving development efficiency, and enhancing system flexibility.
[0057] Figure 2 A block diagram illustrating a non-intrusive dynamic form configuration and application apparatus according to an embodiment of the present disclosure is shown.
[0058] like Figure 2 As shown, the non-intrusive dynamic form configuration and application 200 includes a model building module 210, a form configuration module 220, a data writing module 230, and a data query module 240.
[0059] The model building module 210 is used to build a JSON-structured data model and configure data types and data permissions for the nodes in the model.
[0060] The form configuration module 220 is used to configure multiple form templates and bind the nodes in the data model to the input components in each form template.
[0061] The data writing module 230 is used to respond to the user's data entry request, match and load the target form template from multiple form templates according to the user's attributes, and generate a read-only copy of the data entered by the user into the target form template according to the format of the data model.
[0062] The data query module 240 is used to respond to a user's query request for a target form template, load a read-only copy into the target form template, and display the parts of the read-only copy that the current user has viewing permissions in read-only mode.
[0063] Any one or more of the modules, submodules, units, and subunits according to embodiments of the present disclosure, or at least part of the functions of any one or more of them, can be implemented in one module. Any one or more of the modules, submodules, units, and subunits according to embodiments of the present disclosure can be implemented by dividing them into multiple modules. Any one or more of the modules, submodules, units, and subunits according to embodiments of the present disclosure can be at least partially implemented as hardware circuitry, such as a Field-Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a System-on-Chip, a System-on-a-Substrate, a System-on-Package, an Application-Specific Integrated Circuit (ASIC), or implemented in hardware or firmware by any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, one or more of the modules, submodules, units, and subunits according to embodiments of the present disclosure can be at least partially implemented as computer program modules, which, when run, can perform corresponding functions.
[0064] For example, any plurality of the model building module 210, form configuration module 220, data writing module 230, and data query module 240 can be combined into one module / unit / subunit, or any one of these modules / units / subunits can be split into multiple modules / units / subunits. Alternatively, at least part of the functionality of one or more of these modules / units / subunits can be combined with at least part of the functionality of other modules / units / subunits and implemented in one module / unit / subunit. According to embodiments of the present disclosure, at least one of the model building module 210, form configuration module 220, data writing module 230, and data query module 240 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging the circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, at least one of the model building module 210, form configuration module 220, data writing module 230, and data query module 240 may be implemented at least partially as a computer program module, which can perform corresponding functions when the computer program module is run.
[0065] It should be noted that the non-intrusive dynamic form configuration and application device part in the embodiments of this disclosure corresponds to the non-intrusive dynamic form configuration and application method part in the embodiments of this disclosure. For a detailed description of the non-intrusive dynamic form configuration and application device part, please refer to the non-intrusive dynamic form configuration and application method part, which will not be repeated here.
[0066] Figure 3 A block diagram of an electronic device suitable for implementing the methods described above, according to embodiments of the present disclosure, is illustrated schematically. Figure 3 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0067] like Figure 3 As shown, an electronic device 300 according to an embodiment of this disclosure includes a processor 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage portion 308 into a random access memory (RAM) 303. The processor 301 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 301 may also include onboard memory for caching purposes. The processor 301 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this disclosure.
[0068] RAM 303 stores various programs and data required for the operation of electronic device 300. Processor 301, ROM 302, and RAM 303 are interconnected via bus 304. Processor 301 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 302 and / or RAM 303. It should be noted that programs may also be stored in one or more memories other than ROM 302 and RAM 303. Processor 301 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in one or more memories.
[0069] According to embodiments of this disclosure, the electronic device 300 may further include an input / output (I / O) interface 305, which is also connected to a bus 304. The electronic device 300 may also include one or more of the following components connected to the input / output (I / O) interface 305: an input section 306 including a keyboard, mouse, etc.; an output section 307 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN card, modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the input / output (I / O) interface 305 as needed. A removable medium 311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 310 as needed so that computer programs read from it can be installed into the storage section 308 as needed.
[0070] According to embodiments of this disclosure, the method flow according to embodiments of this disclosure can be implemented as a computer software program. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable storage medium, the computer program containing program code for performing the methods shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network via communication section 309, and / or installed from removable medium 311. When the computer program is executed by processor 301, it performs the functions defined in the system of embodiments of this disclosure. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0071] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.
[0072] According to embodiments of this disclosure, the computer-readable storage medium can be a non-volatile computer-readable storage medium. Examples include, but are not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0073] For example, according to embodiments of this disclosure, a computer-readable storage medium may include the ROM 302 and / or RAM 303 described above and / or one or more memories other than ROM 302 and RAM 303.
[0074] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods provided in the embodiments of this disclosure. When the computer program product is run on an electronic device, the program code enables the electronic device to implement the non-intrusive dynamic form configuration and application methods provided in the embodiments of this disclosure.
[0075] When the computer program is executed by the processor 301, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0076] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via communication section 309, and / or installed from removable medium 311. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0077] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on a user's computing device, partially on a user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0078] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions. Those skilled in the art will understand that the features described in the various embodiments of the present disclosure can be combined and / or combined in various ways, even if such combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments of this disclosure may be combined and / or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.
[0079] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.
Claims
1. A non-intrusive dynamic form configuration and application method, characterized in that, Includes the following steps: Build a JSON-structured data model and configure data types and permissions for the nodes in the model; Configure multiple form templates and bind the nodes in the data model to the input components in each form template; In response to a user's data entry request, a target form template is matched and loaded from the multiple form templates based on the user's attributes, and a read-only copy of the data entered by the user into the target form template is generated according to the format of the data model. In response to a user's query request for the target form template, the read-only copy is loaded into the target form template, and the portion of the read-only copy that the current user has viewing permission for is displayed in read-only mode.
2. The method according to claim 1, characterized in that, The process of constructing a JSON-structured data model and configuring data types and permissions for nodes in the model includes: The node data types that construct the data model include objects, arrays, integers, floating-point numbers, strings, booleans, and reference types; Configure data types, validation rules, and data permissions for the nodes of the data model. The validation rules are used to define the data format of the nodes, and the data permissions are used to restrict the data that users can access after publishing a read-only copy based on the data model.
3. The method according to claim 2, characterized in that, The verification rules are configured according to the data type, including: Integer and floating-point number type nodes support configuration for whether fields are required and for value range validation; String type nodes support configuration for whether fields are required and string length validation; Boolean value type nodes support configuration to indicate whether a field is required; The validation rules can be recursively applied to the internal child nodes of object and array type nodes; Reference type nodes inherit the validation rules and data permissions of the referenced data model, and cannot be modified.
4. The method according to claim 1, characterized in that, The configuration of multiple form templates, and the binding of nodes in the data model to input components in each form template, includes: By dragging and dropping input components, structural components, static text, or images into the editing area, multiple form templates can be formed. The non-object type nodes in the data model are bound to the input components, wherein array type nodes are only allowed to be bound to components that support multi-value input.
5. The method according to claim 1, characterized in that, The step of responding to a user's data entry request, matching and loading a target form template from the plurality of form templates based on user attributes, and generating a read-only copy of the data entered by the user into the target form template according to the format of the data model includes: In response to a user's request to fill in information, the target form template is matched from the multiple form templates based on the user's attributes and loaded. Receive user input data from the target form template and validate the input data according to the validation rules in the data model bound to the target form template; After successful verification, the input data is stored as fill-in data in JSON format, and the identification information of the target form template is associated with the fill-in data to generate the read-only copy.
6. The method according to claim 1, characterized in that, In the form-filling scenario, the target form template only displays the input components that the user is authorized to fill in, and executes the bound validation rules; In query scenarios, the target form template displays data in a read-only style, showing only the data content that the user is authorized to view.
7. The method according to claim 1, characterized in that, The method further includes: In a data replacement form scenario, select the existing data of the associated form to be replaced and the target new form template; Compare the structural differences between the original target form template and the data model associated with the new target form template; The existing data is written into the target new form template, and the existing data is adjusted based on the structural differences so that the existing data matches the constraints of the target new form template.
8. A non-intrusive dynamic form configuration and application device, comprising: The model building module is used to build a JSON-structured data model and configure data types and permissions for nodes in the model. The form configuration module is used to configure multiple form templates and bind the nodes in the data model to the input components in each form template. The data writing module is used to respond to the user's filling request, match and load the target form template from the multiple form templates according to the user attributes, and generate a read-only copy of the data filled in by the user into the target form template according to the format of the data model; The data query module is used to respond to a user's query request for the target form template, load the read-only copy into the target form template, and display the portion of the read-only copy that the current user has viewing permission in read-only mode.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the non-intrusive dynamic form configuration and application method as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the non-intrusive dynamic form configuration and application method as described in any one of claims 1 to 7.