Form rendering method, device, equipment and storage medium
By setting up an adapted component library and using the JSON data format on the form rendering end, the problem of insufficient form rendering flexibility in the existing technology is solved, multi-end form rendering and efficient processing are achieved, and the efficiency and flexibility of form rendering are improved.
Patent Information
- Application Number
- CN201911220270.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-03
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2040-09-10
AI Technical Summary
When rendering forms in the existing technology, the flexibility and scalability of XML and JSON data formats are insufficient, resulting in the need for repeated development when displaying on multiple terminals, consuming manpower and material resources, and the form configuration information description information is limited.
By setting up a component library adapted to the rendering end on the form rendering end, using a unified JSON data format to store and transmit form configuration information, and parsing and generating form components on the rendering end, multi-end form rendering is achieved.
It improves the processing efficiency of form rendering, ensures the scalability and flexibility of form configuration information, realizes the versatility of different terminals, and facilitates parsing and adaptation.
Smart Images

Figure CN111178012B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer application technology, and in particular to a form rendering method, device, equipment and storage medium. Background Art
[0002] When information is transmitted over the network, the user interface is currently mainly displayed through HTML (Hyper Text Markup Language). For survey or interview scenarios, forms are often needed to display information. The content and presentation of these forms are different but not very different.
[0003] In the prior art, the display of forms on the rendering end is mainly realized by form engines based on XML (Extensible Markup Language) and JSON (JavaScript Object Notation, JS Object Notation) data format. Specifically, the former uses XML to describe the order of form fields, field types and other information, and then uses a parser to parse the corresponding components, and finally arranges the parsed components in order on the page. This method is relatively limited in the description information of the form, and has poor flexibility and scalability; the latter is mainly through generating configuration information in JSON data format, then parsing the configuration information, and finally rendering it on the rendering end. However, although the existing configuration information in JSON data format can be improved in flexibility and scalability compared with the former, the function is not perfect, and when displayed on multiple terminals, the form configuration information needs to be repeatedly developed multiple times to adapt to the form content and adapt to multi-terminal display, which consumes manpower and material resources. Therefore, it is necessary to provide a more reliable or more effective solution. Summary of the invention
[0004] The present application provides a form rendering method, apparatus, device and storage medium, which can realize multi-terminal form rendering through unified form configuration information, greatly improve the processing efficiency of form rendering, and ensure the scalability and flexibility of form configuration information.
[0005] On the one hand, the present application provides a form rendering method, which is applied to a terminal provided with a form engine, wherein the form engine is provided with a component library, the component library is adapted to the terminal, and the terminal uses the form engine to perform form rendering, the method comprising:
[0006] Send a form rendering request of the target form to the form configuration end;
[0007] Receive the form configuration information in JSON data format sent by the form configuration end;
[0008] Parsing the form configuration information in the JSON data format to obtain the form configuration information of the target form, wherein the form configuration information represents the layout style and data configuration information of the target form;
[0009] The form component of the target form is rendered from a component library according to the form configuration information to generate the target form.
[0010] On the other hand, a form rendering device is provided, wherein the device is provided with a form engine, the form engine is provided with a component library, the component library is adapted to the device, and when the device uses the form engine to perform form rendering, the device includes:
[0011] A form rendering request sending module is used to send a form rendering request of a target form to a form configuration end;
[0012] The form configuration information receiving module is used to receive the form configuration information in JSON data format sent by the form configuration terminal;
[0013] A form configuration information parsing module, used to parse the form configuration information in the JSON data format to obtain the form configuration information of the target form, wherein the form configuration information represents the layout style and data configuration information of the target form;
[0014] The target form generation module is used to render the form component of the target form from the component library according to the form configuration information to generate the target form.
[0015] On the other hand, a form rendering device is provided, the device comprising a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the form rendering method as described above.
[0016] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction or at least one program is stored in the storage medium, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the form rendering method as described above.
[0017] The form rendering method, device, equipment and storage medium provided by this application have the following technical effects:
[0018] This application sets a component library adapted to the form rendering end in the form engine set on the form rendering end, thereby ensuring subsequent form rendering on different types of form rendering ends, and also realizing multi-end form rendering through unified form configuration information, thereby greatly improving the processing efficiency of form rendering; at the same time, by storing and transmitting the form configuration information in the JSON data format, it is possible to ensure the versatility of the transmitted form configuration information while ensuring the scalability and flexibility of the form configuration information, thereby facilitating parsing by different terminals. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 is a schematic diagram of an application environment provided by an embodiment of the present application;
[0021] Figure 2 It is a flowchart of a form rendering method provided in an embodiment of the present application;
[0022] Figure 3 is a schematic diagram of a form configuration page provided in an embodiment of the present application;
[0023] Figure 4 This is a schematic diagram of the effect of a global configuration provided by an embodiment of the present application;
[0024] Figure 5 A schematic diagram of a process of rendering a form component of the target form from a component library according to the form configuration information and generating the target form is provided in an embodiment of the present application;
[0025] Figure 6 The embodiment of the present application provides a flow chart of configuring the form component of the target form based on the static configuration information of the form component to obtain the configured form component;
[0026] Figure 7 Another embodiment of the present application provides a flow chart of configuring the form component of the target form based on the static configuration information of the form component to obtain the configured form component;
[0027] Figure 8 This is a schematic diagram of a target form rendered by a PC provided in an embodiment of the present application;
[0028] Fig. 9 is a schematic diagram of a target form rendered by a mobile terminal provided in an embodiment of the present application;
[0029] Fig.10 is a structural diagram of a form rendering device provided in an embodiment of the present application;
[0030] Fig.11 It is a structural diagram of a client provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0033] See also Figure 1 , Figure 1 is a schematic diagram of an application environment provided by an embodiment of the present application, such as Figure 1 As shown, the application environment may include a form configuration end 100 and a form rendering end 200 .
[0034] In the embodiment of the present application, the form configuration terminal 100 may include a terminal 101 for providing a user-oriented form configuration interface, and a server 102 for performing form configuration management. Specifically, the user may configure the form configuration information in the form configuration interface provided by the terminal 101. Accordingly, the terminal 101 may send the form configuration information to the server 102; the server 102 may store the configured form configuration information, and provide a background service for subsequent form rendering based on the form configuration information.
[0035] Specifically, the terminal 101 may include physical devices of the type of smart phones, desktop computers, tablet computers, laptops, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, smart wearable devices, etc. It may also include software running in physical devices, such as virtual machines, etc. The operating system running on the terminal 101 in the embodiment of the present application may include but is not limited to Android system, IOS system, Linux, Windows, etc. Specifically, the server 102 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0036] In an embodiment of the present application, the form rendering end 200 can be used to perform form rendering based on form configuration information. Specifically, the form rendering end 200 is provided with a form engine, and the form engine is provided with a component library for implementing form rendering. The component library is adapted to the form rendering end 200, and the form rendering end 200 uses the form engine to perform form rendering. The form rendering end 200 may include physical devices such as smart phones, desktop computers, tablet computers, laptops, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, smart wearable devices, etc. It may also include software running in a physical device, such as a virtual machine. In an embodiment of the present application, the operating system running on the form rendering end 200 may include, but is not limited to, Android, IOS, Linux, Windows, etc.
[0037] In the embodiments of this specification, the terminal 101 and the server 102, and the form rendering terminal 200 and the server 102 may be directly or indirectly connected via wired or wireless communication, and this application does not impose any limitation thereto.
[0038] In addition, it should be noted that the above Figure 1 This is only one application environment provided in the embodiment of the present application. In actual applications, the server 102 may include two servers, which are respectively used for performing form configuration management and providing background services for form rendering.
[0039] The following describes an embodiment of a form rendering method of the present application, taking the form rendering end as the execution subject. Figure 2It is a flowchart of a form rendering method provided by an embodiment of the present application. This specification provides method operation steps as described in the embodiment or flowchart, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the steps among many orders, and does not represent the only order of execution. When the actual system or terminal product is executed, it can be executed in the order of the method shown in the embodiment or the drawings or in parallel (for example, in a parallel processor or multi-threaded processing environment). Specifically, Figure 2 As shown, the method may include:
[0040] S201: Sending a form rendering request of a target form to a form configuration end.
[0041] In an embodiment of the present specification, when it is necessary to render a target form, a form rendering request of the target form can be sent to the form configuration end. In actual applications, the form rendering request can carry identification information of the target form, and accordingly, the form configuration end can find the form configuration information of the target form based on the identification information. Specifically, the identification information of the form component can include a unique identifier of the form component set according to a preset rule. In a specific embodiment, the identification information of the form component can include the name and random code of the form component.
[0042] In actual applications, a form configuration page can be provided on the user-facing terminal side of the form configuration end. Figure 3 As shown, Figure 3 : is a schematic diagram of a form configuration page provided in an embodiment of the present application. Specifically, in the form configuration page, multiple types of form components are set; after the user selects a form component, the form component can be configured. In the embodiment of this specification, the form components can be selected one by one for corresponding configuration, or the selected form components can be configured in batches. Figure 3 For example, after configuring the components, you can also perform global configuration.
[0043] Specifically, in the embodiments of this specification, the form component may include a layout component, a basic component, and a business component. Among them, the layout component can be used to configure the overall layout structure of the form. Specifically, the layout component may include but is not limited to a grid component, a card layout component, and a Layout layout component. Among them, the grid layout can divide the form into at least two columns, and the card layout component can display the form combination as a card style. The Layout component can set an independent style configuration.
[0044] Specifically, the basic components may include components that implement common functions of forms. In the embodiments of the present specification, the basic components may include nested components and non-nested components. Specifically, the nested components may include components that can nest other form components; non-nested components are components that cannot nest other form components. Specifically, the nested components may include, but are not limited to, array components and object components. Non-nested components may include, but are not limited to: single-line input components, multi-line input components, title text components, number box components, switch components, radio button components, check box components, radio drop-down box components, date components, month components, date range components, time components, slider components, and table components, etc.
[0045] Specifically, the business component may include a component that is customized in combination with actual business needs. In a specific embodiment, the business component may include, but is not limited to, a password component, a scoring component, and an ethnic component.
[0046] In the embodiments of this specification, the above enumeration of form components is only an example. In actual applications, the form components can be continuously updated in combination with actual application scenarios.
[0047] In an embodiment of the present specification, component configuration may include configuring static configuration information of a form component; specifically, the static configuration information may represent the inherent properties of the form component configured locally at the form configuration end; such as display style, display location, function and other properties. In an embodiment of the present specification, in order to better improve the scalability of the component, the static configuration information may also include field linkage properties and event association properties. Specifically, the field linkage properties may be the association between different fields of the same or multiple forms. For example, if [Name] is written in Form A, [Name] in Form B will also be automatically filled in. For another example, in a questionnaire form, a radio button form component corresponds to two gender fields, male and female. Accordingly, when male or female is selected, different subsequent questionnaire data will appear (here the subsequent questionnaire data also corresponds to the corresponding form component).
[0048] In the embodiments of this specification, the global configuration may include global configuration information for each form component in the entire form. Specifically, the global configuration information represents information for configuring the form components included in the target form through a remote configuration interface. Specific configuration information may include configuration of the overall display style and functions of the form components included in the target form; for example, in combination with Figure 4, assuming that the target form includes input of name information, accordingly, the component title "Name" will be set before the single-line input component. In some embodiments, a ":" (colon) can be added after the name through global configuration.
[0049] After component configuration and global configuration of various types of form components in the target form, form configuration information representing the layout style and data configuration of the target form can be generated to achieve local static configuration and remote configuration of form components in the form.
[0050] S203: Receive the form configuration information in JSON data format sent by the form configuration end.
[0051] In actual applications, after the user configures the form on the terminal side in the form configuration end, the terminal can send the form configuration information to the server side in the form configuration end, and accordingly, the server side can store the form configuration information in JSON data format. After receiving a form rendering request for a target form, the form configuration information of the target form can be sent to the corresponding form rendering end in JSON data format.
[0052] In the embodiments of this specification, when the form configuration information is represented in JSON data format, the configuration information of the form component of the target form is mainly represented by type (i.e., type is used to record the type of the form component) and characteristics. Specifically, the characteristics may include the identification information of the form component, component configuration (i.e., static configuration information), and global configuration.
[0053] Specifically, different types of form components have different static configuration information. Among them, the component configuration in the characteristics of the basic components includes common component configuration characteristics and unique component configuration characteristics, among which the common component configuration characteristics can mainly include: title (component title, for example, the single-line input component is used to input a name, and the corresponding component title can be name); x-component (component label, the component label can represent the data type corresponding to the form component, for example, the component name of the single-line input box component is input, and its x-component may be a string string or a password password, that is, the data input by the single-line input box component can be a string or a password through the component label); x-props (component style), x-index (the order of form components in the form); x-linkid (association identification, that is, when different form components need to be associated, the field is set to the identification information of the associated form component); x-linkages (field linkage, that is, the association relationship between different fields of the same or multiple forms), etc. In addition, different basic components will have their own unique component configuration features. For example, array components have the items feature (static configuration information of the form component nested in the array component); object components have the properties feature (static configuration information of the form component nested in the object component); and multiple-select box components, radio button components, and drop-down box components have the enum feature (enumerated option information).
[0054] Specifically, the component configuration characteristics of the layout component can mainly include: the identification information of the form component; title (component title); x-fieldid (component name); x-component (component label); x-props (component style); properties (information of the included components, that is, the static configuration information of other form components loaded in the layout component)
[0055] Specifically, the component configuration characteristics of the business component can mainly include: identification information of the form component; title (component title); x-component (component label); x-props (component style); x-index (the order of form components in the form).
[0056] Furthermore, global configuration is the configuration that applies to the entire form. Features may include labelAlign (position information of component labels), labelTextAlign (position of content in component labels), autoAddColon (whether to add a colon to component labels), needFormButtonGroup (whether to set a submit button in the form), labelCol (width of component labels), wrapperCol (width of content in component labels), editable (whether form components are editable), initialRequests (remote configuration information, which may include request name, request URL, request type, and field mapping. The field mapping here mainly refers to what configuration to make for that field. For example, the information obtained from a remote configuration is data: {name:Joe}. Accordingly, fill in Joe in the single-line input component titled Name on the form rendering side).
[0057] In the embodiments of this specification, the form configuration information is stored and transmitted in JSON data format, which can ensure the versatility of the transmitted form configuration information while ensuring the scalability and flexibility of the form configuration information, and facilitate parsing by different terminals.
[0058] S205: Parse the form configuration information in the JSON data format to obtain the form configuration information of the target form.
[0059] In an embodiment of the present specification, after receiving the form configuration information in JSON data format, it can be parsed to obtain the form configuration information of the target form. In an embodiment of the present specification, the parsed form configuration information may include: identification information of the form component contained in the target page, static configuration information of the form component, and global configuration information of the target form.
[0060] S207: Rendering the form component of the target form from the component library according to the form configuration information to generate the target form.
[0061] In the embodiment of the present specification, by pre-setting a component library compatible with the form rendering end in the form engine of the form rendering end, it is ensured that the form rendering of different form rendering ends can be realized through unified form configuration information for different types of form rendering ends in the future. In the embodiment of the present specification, the form rendering end may include a PC (Personal Computer) end and a mobile end. Specifically, the PC end may include a physical PC device, or software running in a physical PC device, such as a website, etc.; specifically, the mobile end may include a physical mobile device, or software running in a physical mobile device, such as an h5 (web page on the mobile end) page, a public account, a mini-program, and an application program, etc. When the form rendering end is a PC end, the component library may include a PC end component library that sets a corresponding style (including display attributes such as style and theme color) in combination with the display requirements of the PC end; when the form rendering end is a mobile end, the component library may include a mobile end component library that sets a corresponding style in combination with the display requirements of the mobile end.
[0062] In a specific embodiment, Figure 5 As shown, the form component of the target form is rendered from the component library according to the form configuration information, and generating the target form may include:
[0063] S2071: Acquire the form component of the target form from the component library according to the identification information of the form component;
[0064] S2073: configuring the form component of the target form based on the static configuration information of the form component to obtain a configured form component;
[0065] S2075: Perform form rendering based on the global configuration information and the configured form components to generate the target form.
[0066] In the embodiment of the present specification, when the form component includes a nestable basic component, the static configuration information of the form component may include: static configuration information of the nestable basic component and static configuration information of a nested form component corresponding to the nestable basic component (the nested form component here may include a form component nested in the nestable basic component); accordingly, Figure 6 As shown, the form component of the target form is configured based on the static configuration information of the form component, and the configured form component may include:
[0067] S601: Setting the attribute configuration of the basic component according to the static configuration information of the nestable basic component;
[0068] S603: Setting the attribute configuration of the nested form component according to the static configuration information of the nested form component;
[0069] S605: Adapting and nesting a nested form component with property configuration set in a basic component with property configuration set, to obtain the configured form component;
[0070] In the embodiment of the present specification, the layout style of the nested form component remains unchanged after being nested, and the layout style of the basic component after being nested is adaptively adjusted along with the nested form component.
[0071] In the embodiments of this specification, by nesting basic components, it is possible to implement component nesting of other form components except layout components, which can better improve the scalability and flexibility of the rendered form and implement the configuration of more styles of layouts.
[0072] In some other embodiments, when the form component includes a layout component, the static configuration information of the form component may include: static configuration information of the layout component and static configuration information of a nested form component corresponding to the layout component (the nested form component may include a form component nested in the layout component); accordingly, Figure 7 As shown, the form component of the target form is configured based on the static configuration information of the form component, and the configured form component may include:
[0073] S701: Setting the attribute configuration of the layout component according to the static configuration information of the layout component;
[0074] S703: Setting the attribute configuration of the nested form component according to the static configuration information of the nested form component;
[0075] S705: Adapting and nesting a nested form component with set attribute configuration in a layout component with set attribute configuration to obtain the set form component;
[0076] The layout style of the layout component after nesting remains unchanged, and the layout style of the nested form component after nesting is adaptively adjusted along with the layout component.
[0077] In the embodiments of this specification, two different nested form component methods, namely, layout components and nested basic components, can be used to better improve the scalability and flexibility of the rendered form and implement configurations of more layout styles.
[0078] In a specific embodiment, Figure 8and Fig. 9 The following are schematic diagrams of target forms rendered on a PC and a mobile terminal based on the same form configuration information of the target form.
[0079] It can be seen from the technical solutions provided in the above embodiments of this specification that in the embodiments of this specification, by setting a component library adapted to the form rendering end in the form engine set in the form rendering end, it can be ensured that the form rendering is subsequently performed on different types of form rendering ends, and it is also possible to achieve multi-end form rendering through unified form configuration information, thereby greatly improving the processing efficiency of form rendering; at the same time, by storing and transmitting the form configuration information in the JSON data format, it is possible to ensure the versatility of the transmitted form configuration information while ensuring the scalability and flexibility of the form configuration information, so as to facilitate parsing by different terminals.
[0080] In some other embodiments, the form component may include a form component with a validation function, and the method further includes:
[0081] In response to an edit instruction or a submit instruction of the target form, performing local verification processing on the information in the form component with verification function;
[0082] or,
[0083] In response to the editing instruction or the submitting instruction of the target form, remote verification processing is performed on the information in the form component with verification function.
[0084] In the embodiments of this specification, after entering the data value in the form component of the form, the data can be submitted and verified. In the embodiments of this specification, local verification and remote verification can be implemented. Specifically, in the scenario of local verification, the corresponding verification rules can be set in the form configuration information in advance, for example, a single-line input component input is a required item. Remote verification can be combined with the corresponding remote interface to send the input data to the corresponding verification end, which will perform verification. For example, in the scenario of logging in to an account, the input account information is verified. Accordingly, if the verification fails, a prompt message indicating that the verification failed may appear.
[0085] The embodiment of the present application further provides a form rendering device, wherein the device is provided with a form engine, the form engine is provided with a component library, the component library is adapted to the device, and when the device uses the form engine to perform form rendering, the device includes:
[0086] The form rendering request sending module 1010 can be used to send a form rendering request of a target form to the form configuration end;
[0087] The form configuration information receiving module 1020 may be used to receive the form configuration information in JSON data format sent by the form configuration terminal;
[0088] The form configuration information parsing module 1030 may be used to parse the form configuration information in the JSON data format to obtain the form configuration information of the target form, wherein the form configuration information represents the layout style and data configuration information of the target form;
[0089] The target form generating module 1040 may be used to render the form component of the target form from the component library according to the form configuration information to generate the target form.
[0090] In some embodiments, the form configuration information includes: global configuration information of a target form, identification information of form components included in the target form, and static configuration information of the form components;
[0091] The global configuration information represents information for configuring the form components included in the target form through a remote configuration interface;
[0092] The static configuration information represents the inherent properties of the form component configured locally at the form configuration end.
[0093] In some embodiments, the target form generation module 1040 may include:
[0094] A form component acquisition unit, used to acquire the form component of the target form from a component library according to the identification information of the form component;
[0095] A form component configuration unit, configured to configure the form component of the target form based on the static configuration information of the form component to obtain a configured form component;
[0096] The form rendering unit is used to perform form rendering based on the global configuration information and the configured form components to generate the target form.
[0097] In some embodiments, the form component may include a nestable base component, a non-nested base component, a custom business component, and a layout component.
[0098] In some embodiments, when the form component includes a nestable basic component, the static configuration information of the form component includes: static configuration information of the nestable basic component and static configuration information of a nested form component corresponding to the nestable basic component;
[0099] Accordingly, the form component configuration unit may include:
[0100] A first property configuration unit, configured to set the property configuration of the basic component according to the static configuration information of the nestable basic component;
[0101] A second property configuration unit, used to set the property configuration of the nested form component according to the static configuration information of the nested form component;
[0102] A first form component adaptation unit is used to adapt a nested form component with property configuration set in a basic component with property configuration set, so as to obtain the configured form component;
[0103] The layout style of the nested form component remains unchanged after being nested, and the layout style of the basic component after being nested is adaptively adjusted along with the nested form component.
[0104] In some embodiments, when the form component includes a layout component, the static configuration information of the form component includes: static configuration information of the layout component and static configuration information of a nested form component corresponding to the layout component;
[0105] Accordingly, the form component configuration unit may include:
[0106] A third property configuration unit, used to set the property configuration of the layout component according to the static configuration information of the layout component;
[0107] A fourth property configuration unit, used to set the property configuration of the nested form component according to the static configuration information of the nested form component;
[0108] A second form component adaptation unit is used to adapt the nested form component with set attribute configuration in the layout component with set attribute configuration to obtain the set form component;
[0109] The layout style of the layout component after nesting remains unchanged, and the layout style of the nested form component after nesting is adaptively adjusted along with the layout component.
[0110] In some embodiments, the form component includes a form component with a verification function, and the device further includes:
[0111] A local verification processing module, used for performing local verification processing on the information in the form component with verification function in response to an edit instruction or a submit instruction of the target form;
[0112] or,
[0113] The remote verification processing module is used to perform remote verification processing on the information in the form component with verification function in response to the editing instruction or submission instruction of the target form.
[0114] The device and method embodiments in the device embodiments are based on the same application concept.
[0115] An embodiment of the present application provides a form rendering device, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the form rendering method provided in the above method embodiment.
[0116] The memory can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required for functions, etc.; the data storage area can store data created according to the use of the device, etc. In addition, the memory can include a high-speed random access memory and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory can also include a memory controller to provide the processor with access to the memory.
[0117] The method embodiments provided in the embodiments of the present application can be executed in a client (mobile terminal, PC terminal), a server or a similar computing device. Taking running on the client as an example, Fig.11 is a schematic diagram of the structure of a client provided in an embodiment of the present application, such as Fig.11 As shown, the client can be used to implement the information interaction method provided in the above embodiment. Specifically:
[0118] The client may include an RF (Radio Frequency) circuit 1110, a memory 1120 including one or more computer-readable storage media, an input unit 1130, a display unit 1140, a sensor 1150, an audio circuit 1160, a WiFi (wireless fidelity) module 1170, a processor 1180 including one or more processing cores, and a power supply 1190. Those skilled in the art will appreciate that Fig.11 The client structure shown in the figure does not constitute a limitation on the client, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0119] The RF circuit 1110 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is handed over to one or more processors 1180 for processing; in addition, the data related to the uplink is sent to the base station. Generally, the RF circuit 1110 includes but is not limited to an antenna, at least one amplifier, a tuner, one or more oscillators, a user identity module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, etc. In addition, the RF circuit 1110 can also communicate with the network and other clients through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to GSM (Global System of Mobilecommunication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), etc.
[0120] The memory 1120 can be used to store software programs and modules, and the processor 1180 executes various functional applications and data processing by running the software programs and modules stored in the memory 1120. The memory 1120 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, application programs required for functions, etc.; the data storage area may store data created according to the use of the client, etc. In addition, the memory 1120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 1120 may also include a memory controller to provide the processor 1180 and the input unit 1130 with access to the memory 1120.
[0121] The input unit 1130 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit 1130 may include a touch-sensitive surface 1131 and other input devices 1132. The touch-sensitive surface 1131, also known as a touch display screen or a touch pad, can collect user touch operations on or near it (such as operations performed by the user using fingers, stylus, or any other suitable object or accessory on or near the touch-sensitive surface 1131), and drive corresponding connection devices according to a pre-set program. Optionally, the touch-sensitive surface 1131 may include a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then sends it to the processor 1180, and can receive and execute commands sent by the processor 1180. In addition, the touch-sensitive surface 1131 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 1131, the input unit 1130 may further include other input devices 1132. Specifically, the other input devices 1132 may include, but are not limited to, one or more of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.
[0122] The display unit 1140 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the client, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 1140 may include a display panel 1141. Optionally, the display panel 1141 may be configured in the form of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode) and the like. Further, the touch-sensitive surface 1131 may cover the display panel 1141. When the touch-sensitive surface 1131 detects a touch operation on or near it, it is transmitted to the processor 1180 to determine the type of the touch event, and then the processor 1180 provides corresponding visual output on the display panel 1141 according to the type of the touch event. Among them, the touch-sensitive surface 1131 and the display panel 1141 can be two independent components to realize the input and output functions, but in some embodiments, the touch-sensitive surface 1131 and the display panel 1141 can also be integrated to realize the input and output functions.
[0123] The client may also include at least one sensor 1150, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1141 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 1141 and / or the backlight when the client moves to the ear. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the client (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; As for other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that can also be configured on the client, they will not be repeated here.
[0124] The audio circuit 1160, the speaker 1161, and the microphone 1162 can provide an audio interface between the user and the client. The audio circuit 1160 can transmit the electrical signal converted from the received audio data to the speaker 1161, which is converted into a sound signal for output; on the other hand, the microphone 1162 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1160 and converted into audio data, and then the audio data is output to the processor 1180 for processing, and then sent to another client through the RF circuit 1110, or the audio data is output to the memory 1120 for further processing. The audio circuit 1160 may also include an earphone jack to provide communication between an external headset and the client.
[0125] WiFi is a short-range wireless transmission technology. The client can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 1170, which provides users with wireless broadband Internet access. Fig.11 A WiFi module 1170 is shown, but it is understandable that it is not a necessary component of the client and can be omitted as needed without changing the essence of the invention.
[0126] The processor 1180 is the control center of the client, and uses various interfaces and lines to connect various parts of the entire client. By running or executing software programs and / or modules stored in the memory 1120, and calling data stored in the memory 1120, the processor 1180 performs various functions of the client and processes data, thereby monitoring the client as a whole. Optionally, the processor 1180 may include one or more processing cores; preferably, the processor 1180 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1180.
[0127] The client also includes a power supply 1190 (such as a battery) for supplying power to each component. Preferably, the power supply can be logically connected to the processor 1180 through a power management system, so that the power management system can manage charging, discharging, power consumption management and other functions. The power supply 1190 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.
[0128] Although not shown, the client may also include a camera, a Bluetooth module, etc., which will not be described in detail herein. Specifically in this embodiment, the display unit of the client is a touch screen display, and the client also includes a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors to execute instructions in the method embodiment of the present invention.
[0129] An embodiment of the present application also provides a storage medium, which can be set in a device to store at least one instruction or at least one program related to a form rendering method in a method embodiment, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the form rendering method provided by the above method embodiment.
[0130] Optionally, in this embodiment, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0131] It can be seen from the embodiments of the form rendering method, device, server or storage medium provided by the present application that in the present application, by setting a component library adapted to the form rendering end in the form engine set at the form rendering end, it can be ensured that the form rendering is performed on different types of form rendering ends in the future, and it is also possible to achieve multi-end form rendering through unified form configuration information, which greatly improves the processing efficiency of form rendering and reduces development manpower and material resources; at the same time, by storing and transmitting the form configuration information in JSON data format, it is possible to ensure the versatility of the transmitted form configuration information while ensuring the scalability and flexibility of the form configuration information, so as to facilitate parsing by different terminals. The verification function is also realized through the form component, and the scalability and flexibility of the rendered form can be better improved through two different nested form component methods, namely the layout component and the nestable basic component, so as to achieve the configuration of more style layouts.
[0132] It should be noted that the above-mentioned sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of this specification are described. Other embodiments are within the scope of the attached claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0133] 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 device, equipment and storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0134] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or may be accomplished by instructing the relevant hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0135] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A form rendering method, characterized in that: Applied to a terminal provided with a form engine, the form engine provided with a component library, the component library adapted to the terminal, the terminal using the form engine to perform form rendering, the method comprising: Send a form rendering request of the target form to the form configuration end; Receive the form configuration information in JSON data format sent by the form configuration end; Parse the form configuration information in the JSON data format to obtain the form configuration information of the target form, wherein the form configuration information represents the layout style and data configuration information of the target form; the form configuration information includes: global configuration information of the target form, identification information of the form components included in the target form, and static configuration information of the form components; the global configuration information represents information for configuring the form components included in the target form through a remote configuration interface; the static configuration information represents inherent properties of the form components configured locally at the form configuration end; Acquire the form component of the target form from a component library according to the identification information of the form component; configuring the form component of the target form based on the static configuration information of the form component to obtain a configured form component; The form is rendered based on the global configuration information and the configured form components to generate the target form.
2. The method according to claim 1, characterized in that The form components include nestable basic components, non-nested basic components, custom business components and layout components.
3. The method according to claim 1, characterized in that When the form component includes a nestable basic component, the static configuration information of the form component includes: static configuration information of the nestable basic component and static configuration information of the nested form component corresponding to the nestable basic component; The form component of the target form is configured based on the static configuration information of the form component to obtain the configured form component, including: Setting the attribute configuration of the basic component according to the static configuration information of the nestable basic component; Setting the attribute configuration of the nested form component according to the static configuration information of the nested form component; Adapting and nesting a nested form component with property configuration set in a basic component with property configuration set, to obtain the configured form component; The layout style of the nested form component remains unchanged after being nested, and the layout style of the basic component after being nested is adaptively adjusted along with the nested form component.
4. The method according to claim 1, characterized in that: When the form component includes a layout component, the static configuration information of the form component includes: static configuration information of the layout component and static configuration information of a nested form component corresponding to the layout component; The form component of the target form is configured based on the static configuration information of the form component to obtain the configured form component, including: Setting the attribute configuration of the layout component according to the static configuration information of the layout component; Setting the attribute configuration of the nested form component according to the static configuration information of the nested form component; Adapting and nesting a nested form component with set attribute configuration in a layout component with set attribute configuration to obtain the set form component; The layout style of the layout component after nesting remains unchanged, and the layout style of the nested form component after nesting is adaptively adjusted along with the layout component.
5. The method according to claim 1, characterized in that The form component includes a form component with a verification function, and the method further includes: In response to an edit instruction or a submit instruction of the target form, performing local verification processing on the information in the form component with verification function; or, In response to the editing instruction or the submitting instruction of the target form, remote verification processing is performed on the information in the form component with verification function.
6. A form rendering device, characterized in that: The device is provided with a form engine, the form engine is provided with a component library, the component library is adapted to the device, and when the device uses the form engine to perform form rendering, the device includes: A form rendering request sending module is used to send a form rendering request of a target form to a form configuration end; The form configuration information receiving module is used to receive the form configuration information in JSON data format sent by the form configuration terminal; A form configuration information parsing module is used to parse the form configuration information in the JSON data format to obtain the form configuration information of the target form, wherein the form configuration information represents the layout style and data configuration information of the target form; the form configuration information includes: global configuration information of the target form, identification information of the form components included in the target form, and static configuration information of the form components; the global configuration information represents information for configuring the form components included in the target form through a remote configuration interface; the static configuration information represents inherent properties of the form components configured locally at the form configuration end A target form generation module is used to render the form component of the target form from the component library according to the form configuration information to generate the target form; the target form generation module includes: a form component acquisition unit, used to acquire the form component of the target form from the component library according to the identification information of the form component; a form component configuration unit, used to configure the form component of the target form based on the static configuration information of the form component to obtain the configured form component; a form rendering unit, used to perform form rendering based on the global configuration information and the configured form component to generate the target form.
7. The device according to claim 6, characterized in that The form components include nestable basic components, non-nested basic components, custom business components and layout components.
8. The device according to claim 6, characterized in that When the form component includes a nestable basic component, the static configuration information of the form component includes: static configuration information of the nestable basic component and static configuration information of the nested form component corresponding to the nestable basic component; The form component configuration unit includes: A first property configuration unit, configured to set the property configuration of the basic component according to the static configuration information of the nestable basic component; A second property configuration unit, used to set the property configuration of the nested form component according to the static configuration information of the nested form component; A first form component adaptation unit is used to adapt a nested form component with property configuration set in a basic component with property configuration set, so as to obtain the configured form component; The layout style of the nested form component remains unchanged after being nested, and the layout style of the basic component after being nested is adaptively adjusted along with the nested form component.
9. The device according to claim 6, characterized in that When the form component includes a layout component, the static configuration information of the form component includes: static configuration information of the layout component and static configuration information of a nested form component corresponding to the layout component; The form component configuration unit includes: A third property configuration unit, used to set the property configuration of the layout component according to the static configuration information of the layout component; A fourth property configuration unit, used to set the property configuration of the nested form component according to the static configuration information of the nested form component; A second form component adaptation unit is used to adapt the nested form component with set attribute configuration in the layout component with set attribute configuration to obtain the set form component; The layout style of the layout component after nesting remains unchanged, and the layout style of the nested form component after nesting is adaptively adjusted along with the layout component.
10. The device according to claim 6, characterized in that The form component includes a form component with a verification function, and the device also includes: A local verification processing module, used for performing local verification processing on the information in the form component with verification function in response to an edit instruction or a submit instruction of the target form; or, The remote verification processing module is used to perform remote verification processing on the information in the form component with verification function in response to the editing instruction or submission instruction of the target form.
11. A form rendering device, characterized in that: The device includes a processor and a memory, wherein at least one instruction or at least one program is stored in the memory, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the form rendering method as described in any one of claims 1 to 5.
12. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the form rendering method according to any one of claims 1 to 5.
