A method and device for configuring form options

By generating and parsing the configuration table of the form component, the problems of code redundancy and low flexibility in the development of the form component are solved, and efficient form page generation and maintenance are achieved.

CN110109979BActive Publication Date: 2024-09-20BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN201810038986.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-01-16
Publication Date
2024-09-20
Estimated Expiration
2038-01-16

AI Technical Summary

Technical Problem

In the existing technology, form component development has code redundancy, unclear functional division, and high coupling, which leads to difficulty in maintenance. The flexibility of componentized development is low, and data verification is highly repeatable, which reduces development efficiency and maintenance costs.

Method used

By obtaining the configuration information of the form component, generating the configuration table, parsing the configuration table to generate the form component, and displaying the associated form options in the component, it supports format conversion and validation rules, and improves the reusability and flexibility of the component.

Benefits of technology

It realizes the rapid generation of form pages with verification functions, improves the reusability and flexibility of components, avoids repeated coding, simplifies form logic, and facilitates management and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110109979B
    Figure CN110109979B
Patent Text Reader

Abstract

The present invention discloses a method and device for configuring form options, and relates to the field of computer technology. A specific implementation of the method includes: obtaining configuration information associated with a form component, generating a configuration table based on the configuration information; parsing the configuration table, generating a corresponding form component, and displaying form options associated with the form component. This implementation provides a configurable idea for form options, which is highly versatile and improves the reusability and flexibility of form components; compared with the prior art, developers only need to write the configuration information in the configuration table, which is simple in logic, improves the development efficiency of form options, avoids repeated writing of similar codes and code redundancy, and reduces development costs and later maintenance costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for configuring form options. Background Art

[0002] In order to meet the development of information system business, it is usually necessary to change or add operations to the form program code, which leads to an increasing amount of form code, and many of them face the problem of reconstruction. At present, in the development process of platform form pages, repetitive development (such as adding and removing options, verification logic, data processing, etc.) is inevitable. The solution usually has two modes: non-component development and component development. Among them:

[0003] (1) Non-component development is more traditional, usually consisting of three parts: simple HTML (HyperText Markup Language), Javascript (control page elements), and CSS (Cascading Style Sheets). For the same form options, you can copy the code directly, and the data acquisition setting and verification part is completed by JavaScript;

[0004] (2) Component-based development, as an alternative to non-component-based development, defines each relatively independent module as a component, and then combines or nests small components into large components to finally complete the construction of the overall form interface. Since data processing and data validation are usually encapsulated inside components, for the same form options, only the corresponding components need to be referenced, which greatly improves reusability compared to non-component-based methods.

[0005] In the process of implementing the present invention, the inventors found that the prior art has at least the following problems:

[0006] (1) For non-component-based form development, the code redundancy is high, the functional division of business modules is unclear, and the coupling between modules is large, which makes it difficult to maintain the form later;

[0007] (2) For the component-based form development method, there are cases where different business requirements require some logic in repetitive components to be modified, and the modification is usually to the internal code of the component, resulting in low flexibility in repetitive development and repetitive data verification, which reduces the efficiency of form development;

[0008] (3) When the number of developers is limited, the development tasks of some form components may be handed over to third parties. However, due to the different development habits of developers, there is a high possibility of bugs appearing later, making maintenance difficult and not conducive to the development of form components. Summary of the invention

[0009] In view of this, an embodiment of the present invention provides a method and device for configuring form options, which can at least solve the problem in the prior art that the development flexibility of repetitive components is low, resulting in high subsequent maintenance costs.

[0010] To achieve the above-mentioned purpose, according to one aspect of an embodiment of the present invention, a method for configuring form options is provided, comprising: obtaining configuration information associated with a form component, and generating a configuration table based on the configuration information; parsing the configuration table, generating a corresponding form component, and displaying form options associated with the form component.

[0011] Optionally, the configuration information includes format receiving rules of the form component;

[0012] The display of the form options associated with the form component also includes: receiving a data input request for the form option and obtaining the input data information; when the format of the data information does not conform to the format receiving rule, converting the format of the data information according to a predetermined format conversion rule, transmitting the format-converted data information to the form component for display in the form option.

[0013] Optionally, the configuration information includes validation rules for the form component;

[0014] The displaying of the form options associated with the form component further includes: receiving a data input request for the form option, obtaining the input data information; when the data information does not conform to the validation rule, determining corresponding exception information, transmitting the exception information to the form component, so as to be displayed in the form option.

[0015] Optionally, the configuration information includes the type of the form component; wherein the type is one of dynamic or static;

[0016] The display of the form options associated with the form component also includes: receiving a data input request for the form option and obtaining the input data information; when the type of the form component is a dynamic type and a display request for the data information is received, transmitting the data information to the form component to display it in the form option; or when the type of the form component is a static type, transmitting the data information to the form component to display it in the form option.

[0017] Optionally, the configuration information includes format display rules of the form component;

[0018] The displaying of the form options associated with the form component further includes: performing format rendering on the form component according to the format display rule, and displaying the format-rendered form options.

[0019] To achieve the above-mentioned purpose, according to another aspect of an embodiment of the present invention, a device for configuring form options is provided, including: an acquisition module, used to acquire configuration information associated with a form component, and generate a configuration table based on the configuration information; a display module, used to parse the configuration table, generate a corresponding form component, and display form options associated with the form component.

[0020] Optionally, the configuration information includes format receiving rules of the form component;

[0021] The display module is also used to: receive a data input request for the form option and obtain the input data information; when the format of the data information does not conform to the format receiving rule, convert the format of the data information according to a predetermined format conversion rule, and transmit the format-converted data information to the form component to be displayed in the form option.

[0022] Optionally, the configuration information includes validation rules for the form component;

[0023] The display module is also used to: receive a data input request for the form option and obtain the input data information; when the data information does not meet the validation rules, determine corresponding exception information, transmit the exception information to the form component, and display it in the form option.

[0024] Optionally, the configuration information includes the type of the form component; wherein the type is one of dynamic or static;

[0025] The display module is also used to: receive a data input request for the form option and obtain the input data information; when the type of the form component is a dynamic type and a display request for the data information is received, transmit the data information to the form component to display it in the form option; or when the type of the form component is a static type, transmit the data information to the form component to display it in the form option.

[0026] Optionally, the configuration information includes format display rules of the form component;

[0027] The display module is further used to: perform format rendering on the form component according to the format display rule, and display the form options after format rendering.

[0028] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device for configuring form options is provided.

[0029] The electronic device of the embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement any of the configuration form option methods described above.

[0030] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, any of the above-mentioned methods for configuring form options is implemented.

[0031] According to the solution provided by the present invention, one embodiment of the above invention has the following advantages or beneficial effects: combining the idea of ​​componentization, performing high abstraction on the basis of componentization, and proposing an implementation solution that integrates option configuration, option generation, data format conversion, and data verification. Through this solution, the required functions are assembled, and a form page with verification function is quickly generated, which greatly improves the reusability and flexibility of the components, avoids repeated writing of similar codes and code redundancy, and facilitates the access of third-party codes, simplifies the form logic, makes the form easy to manage, and facilitates the maintenance and expansion of the form.

[0032] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0034] Figure 1 This is a schematic diagram of the main flow of a method for configuring form options according to an embodiment of the present invention;

[0035] Figure 2 is a flowchart of an optional method for configuring form options according to an embodiment of the present invention;

[0036] Figure 3 is a flowchart of another optional method for configuring form options according to an embodiment of the present invention;

[0037] Figure 4 is a flowchart of a specific method for configuring form options according to an embodiment of the present invention;

[0038] Figure 5 is a schematic diagram of main modules of a device for configuring form options according to an embodiment of the present invention;

[0039] Figure 6 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0040] Figure 7 It is a schematic diagram of the structure of a computer system of a mobile device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0041] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0042] See also Figure 1 , which shows a main flow chart of a method for configuring form options provided by an embodiment of the present invention, comprising the following steps:

[0043] S101: Acquire configuration information associated with the form component, and generate a configuration table based on the configuration information.

[0044] S102: Parse the configuration table, generate corresponding form components, and display form options associated with the form components.

[0045] In the above implementation, for step S101, the form is mainly responsible for collecting data on the page, and includes one or more form options, which are data information input boxes on the page, in which the user can perform data input operations.

[0046] Based on the idea of ​​componentization, the information associated with the form options can be combined, and the options can be configured to generate a form option configuration table, as shown in Table 1. Since the form components correspond to the form options, the information related to the form options is the same as the information related to the form options. Afterwards, when the form options need to be written or the content needs to be changed, the developer only needs to write and change it in the option configuration table, without much operation. For example, based on the configuration information, when a "warehouse entry" form option needs to be regenerated, there is no need to redevelop it, and only an available field needs to be configured in the configuration information. After the configuration is completed, the reconfigured configuration information is parsed to generate the "warehouse entry" form option.

[0047] Table 1 Form selection configuration table

[0048]

[0049] Among them, the form option configuration table abstracts the page form elements into an option configuration table in the form of key-value pairs (a corresponding value is obtained according to a key value). The table is a programming language description of the form options. The following is an explanation of each type in the option configuration table:

[0050] 1. The first-level attribute is the configuration of the form option Section. For a more complex form page, it can be divided into multiple sections according to functions, rules, etc., so that form options can be configured for each section separately, including:

[0051] (1) The type field indicates the type of the Section, which can be either a dynamic type or a static type. The dynamic type means that the user can determine whether to display this Section through an option on the page; the static type cannot be selected by the user and can only be displayed on the page by default;

[0052] (2) The properties field indicates all form options in the form component Section. The secondary properties configure them. Specifically:

[0053] 1) The type field in the secondary attribute indicates the component name used by the form item. For example, if the text box component specifies its component name as text, the code of the text component will be read during the parsing process to generate the text box on the page.

[0054] 2) The name field in the secondary attribute indicates the mapping of the form item in the data pool (where data is stored). When the value of the form item changes (for example, the information entered by the user changes from A to B), the content in the data pool will be synchronized.

[0055] 3) The validation field in the secondary attribute indicates the rules that need to be met when the form item validates the data; among them, the type field in the tertiary attribute is the name of the validation component, and the rules field specifies the rules that need to be met when validating the data.

[0056] Take the login password box as an example:

[0057] Properties:

[0058] Type: 'text'---Indicates that the text component is used, that is, the input box component;

[0059] Id: ''---Can be set arbitrarily, but must be unique. The code requires a unique identifier;

[0060] Label: 'Password', --- label is the word 'Password' in front of the input box that users see on the page;

[0061] Description: 'The password must be 16 characters long', some descriptions related to the password Label;

[0062] Param: {placeholder: 'Please enter password'} --- Some information can be stored in the page input box, for example, please enter password. In addition, for different components, some fields in param can be different, for example, additional parameters needed in the code.

[0063] Validation: (Data level) The rules that the password must comply with, such as it must be composed of 16 characters. The framework will judge the password entered by the user based on the content of this field to determine whether it meets the requirements.

[0064] }

[0065] 2. In addition, the definition and configuration of the option configuration table can use YAML (Yet Another Markup Language) language and JSON (JavaScript Object Notation) format. The basic grammatical rules of YAML language include:

[0066] 1) Case sensitive;

[0067] 2) Use indentation to indicate hierarchical relationships;

[0068] 3) TAB key is not allowed to be used during indentation, only spaces are allowed;

[0069] 4) The number of spaces indented is not important, as long as the elements at the same level are aligned on the left;

[0070] Therefore, compared with the JSON format, the YAML language makes the file hierarchy clearer, easier to identify, and more readable. The embodiment of the present invention mainly uses the YAML language to define the form option configuration table.

[0071] Regarding step S102, since the form configuration table includes all the associated configuration information, after completing the option configuration, the option configuration table can be parsed to generate the corresponding form component.

[0072] After the form component is generated, the form options corresponding to the form component can be displayed on the page to detect the configuration information. Afterwards, if the user enters data in the form options, it will be displayed in the form options, and the user can also view the entered data information on the page.

[0073] In addition, based on the idea of ​​componentization, there can be a unified display format for the forms displayed on the page to facilitate background management. That is, after a website is established, its page style is unified, so the display format of the page area and form options is also extracted into a set of components. Among them, the display format refers to the distance between one area and another area on the page, the placement of the form option input box within the area, the placement of the prompt information, etc. On display pages of different pixels, you can have the same display format, but the size of the display is different.

[0074] The method provided in the above embodiment provides a way to configure form options, which is highly versatile and improves the reusability and flexibility of form components. Compared with the prior art, developers only need to write / modify the configuration information in the configuration table, which improves development efficiency and avoids repeated writing of similar codes and code redundancy. In addition, based on the fixed format of the configuration table, bug problems caused by different development habits of different developers are avoided, development costs and later maintenance costs are reduced, and project expansion is facilitated.

[0075] See also Figure 2 , shows a schematic flow chart of an optional method for configuring form options according to an embodiment of the present invention, comprising the following steps:

[0076] S201: Acquire configuration information associated with a form component, and generate a configuration table based on the configuration information; wherein the configuration information includes a format receiving rule of the form component.

[0077] S202: Parse the configuration table, generate corresponding form components, and display form options associated with the form components.

[0078] S203: receiving a data input request for the form options, and obtaining the input data information.

[0079] S204: When the format of the data information does not conform to the format receiving rule, the data information is format converted according to a predetermined format conversion rule, and the format-converted data information is transmitted to the form component to be displayed in the form option.

[0080] In the above implementation, step S202 can refer to Figure 1 The description of step S102 is not repeated here.

[0081] In the above implementation, for step S201, due to business requirements and updates and iterations of the form component, the data information passed into the component may need to be formatted to meet development requirements.

[0082] Furthermore, the format receiving rules corresponding to the form component can be pre-set in the configuration table to unify the format of the output data information for easy background management. The rules can be set according to the requirements of different components. When the rules need to be changed, they can be changed directly in the configuration table.

[0083] For step S203, after the user enters data information in an input box on the page, the form option will send the data information and the corresponding input box information to the data pool for storage; wherein one input box corresponds to one form option. In addition, due to the complex hierarchical relationship of components, in order to facilitate communication between components and management of input information, all data needs to be stored in the data pool.

[0084] In addition, each form option corresponds to a form component, each form option has its own identification information, and the form component corresponds to the identification information. After obtaining the data information, the corresponding form component can also be determined based on the form option; for example, the Property option in the option configuration table is parsed, and the form component corresponding to the form option is determined based on the identification information, such as the component name type field in the secondary attribute.

[0085] For step S204, when the input data information meets the format receiving rules, the data information in the data pool will be sent to the form component to display the input data information in the page form options. However, when it does not meet the format receiving rules, it needs to be format converted. For example, the data information transmitted to the component contains a date of 2017.12.30, but the format that may need to be displayed on the page for the date is 12.30.2017.

[0086] In addition, since the page display front-end and the back-end server are separated, the front-end displays data, descriptions, and other data information that meet user needs; the back-end server stores information that is suitable for back-end tools. Taking RMB as an example, the front-end needs to display it in units of US dollars, euros, etc. according to requirements, which requires conversion. In addition, in order to facilitate the subsequent work process and reduce the inconvenience caused by work handover, the back-end server can be set to store data in the original format, such as RMB, so the data information finally stored in the back-end needs to be returned to the original format.

[0087] Therefore, for the overall process of data information being transmitted to the form component and finally saved, the specific operations of its format conversion can be as follows:

[0088] (1) Before transmitting data information to the form component, it needs to be converted into the corresponding format through a format converter, for example, RMB is converted into US dollars.

[0089] (2) After the format of the data information in the form component is changed, when saving it, it needs to be converted to the previous format through a format converter, for example, RMB is converted to US dollars and then converted back to RMB.

[0090] For the format converter of format conversion, it can be a filter, etc. Taking the filter as an example, its filtering method can be:

[0091] Key: Value | Filter 1 | Filter 2…

[0092] Among them, Key-Value represents a key-value pair, Key is an identifier of the Value, and Value is the data information that needs to be converted and processed in the format; the filter is the conversion rule for the corresponding data information displayed on the page or stored in the background with the form options, for example, the unit conversion between US dollars and RMB, and the date format conversion; the filters are separated by the symbol "|" and are parsed from left to right to process the data information in sequence.

[0093] Furthermore, the information transmitted to the form component may also include data description information, etc., wherein the data description information may be a requirement for the content of the input form options, for example, requiring the password to consist of 8 digits when registering an account on a web page. The data description information may be obtained from the data pool based on the component information, such as label information label, simple description description, etc.

[0094] In addition, in the process of parsing the configuration information to generate the form component, the format component can also be rendered to unify the format of the form options for easy subsequent management. The corresponding format requirements can also be stored in the configuration table.

[0095] The method provided in the above embodiment realizes the idea of ​​configurable format receiving rules of form components to meet the format requirements of displaying data information on form options and reflect the diversity of form components; in addition, based on the configurable format receiving rules and their storage in the configuration table, it is convenient for developers to modify them and reduce the subsequent maintenance costs.

[0096] See also Figure 3 , shows a schematic flow chart of another optional method for configuring form options according to an embodiment of the present invention, comprising the following steps:

[0097] S301: Acquire configuration information associated with a form component, and generate a configuration table based on the configuration information; wherein the configuration information includes validation rules of the form component.

[0098] S302: Parse the configuration table, generate corresponding form components, and display form options associated with the form components.

[0099] S303: receiving a data input request for form options, and obtaining input data information.

[0100] S304: When the data information does not meet the validation rules, corresponding exception information is determined, and the exception information is transmitted to the form component to be displayed in the form options.

[0101] In the above implementation, step S302 can refer to Figure 1 For the description of step S102 shown in FIG. 102 , step S303 can be found in FIG. Figure 2 The description of step S203 is not repeated here.

[0102] In the above implementation, for step S301, before displaying the data, the form option will verify the data based on the component to determine whether it meets the requirements for displaying in the form option. The validation rules can also be stored in the option configuration table and correspond to the form option, for example, the validation component corresponding to the type type of the validation attribute in the option configuration table, so as to facilitate subsequent modification.

[0103] The validation rules include but are not limited to the following rules:

[0104] (1) Rules for limiting the length of the information entered, for example, when entering a password on the login page, the password must consist of 16 characters;

[0105] (2) Rules restricting the type of information that can be entered, for example, the input box can only contain numbers, letters, punctuation marks, or a combination thereof;

[0106] (3) Size restriction rules for input information. This rule is mainly for pictures. For example, the size of the uploaded picture must be 100*100;

[0107] (4) Rules for limiting the order of input information, for example, a password consists of 16 digits, the first four digits and the last four digits are letters, and the middle eight digits are numbers.

[0108] For step S304, when the data information does not meet the corresponding validation rules, the background will analyze the reasons why the data information does not meet the validation rules, and generate corresponding exception information based on the reasons to be displayed on the form page. The exception information can be stored in the error pool in the data pool; wherein the error pool is used to store the exception information of all components. The error pool sends the exception information to the corresponding form component, triggering the re-rendering of the form component, and finally displays it on the page to inform the user of the error cause and improve the user input efficiency.

[0109] Furthermore, when the data information meets the validation rules, subsequent processes can be carried out, but when the data information does not meet the validation rules, the data information is still stored in the data pool, but based on the exception information framework, it will prevent the continuation of subsequent processes, making it impossible for users to log in unless the user changes the input information according to the prompts of the exception information.

[0110] For example, the password input box only allows numbers to be entered, but the user enters letters, and an exception message prompt will be displayed saying "Only numbers can be entered, please re-enter"; when the user changes the entered letters to numbers and passes the verification, subsequent processes can be carried out, and the correct password can be synchronized to change the content in the data pool.

[0111] After the user changes the input information, such as changing option A to option B or entering a password, the input framework will be triggered to re-render the changed content, that is, re-verify.

[0112] It should be noted that the validation logic supported by the configuration table can cover most of the validation rules, such as the length limit, type limit, size requirement, etc. mentioned above. However, there are always some form components with more complex validation logic. For example, if two input boxes need to meet some requirements at the same time, the corresponding validation rules cannot be configured in the configuration table, and the validation service (for example, code) needs to be used for validation.

[0113] The method provided in the above embodiment provides a configurable idea for data verification, so that the generation and verification of form options in the page are integrated, the business logic is simplified, and the amount of form code is reduced; in addition, the prompt based on abnormal information improves the user's input efficiency and speeds up the subsequent process.

[0114] See also Figure 4 , shows a schematic flow chart of another optional method for configuring form options according to an embodiment of the present invention, comprising the following steps:

[0115] S401: Acquire configuration information associated with a form component, and generate a configuration table based on the configuration information; wherein the configuration information includes a type of the form component; wherein the type is one of dynamic and static.

[0116] S402: Parse the configuration table, generate corresponding form components, and display form options associated with the form components.

[0117] S403: receiving a data input request for the form options, and obtaining the input data information.

[0118] S404: When the type of the form component is a dynamic type and a request for displaying data information is received, the data information is transmitted to the form component to be displayed in the form options.

[0119] S404': When the type of the form component is a static type, data information is transmitted to the form component to be displayed in the form options.

[0120] In the above implementation, step S402 can refer to Figure 1 For the description of step S102 shown in FIG. 1 , step S403 can be found in FIG. Figure 2 The description of step S203 is not repeated here.

[0121] In the above implementation, for step S401, the content input by the user in the form options can be displayed or not displayed, so corresponding dynamic types and static types can be set for developers to choose, expanding the selectivity of form component development.

[0122] For step S404, if the current form option is dynamic, a toggle switch can be added to the current form component through a dynamic switching component, so that when the form option is displayed on the page, it can have the function of being displayed or not displayed for the user to choose.

[0123] For dynamic form options, the page can have the following display, for example: □ Whether to display; where □ is a check box, which is equivalent to a toggle switch. When it is checked, the data information will be displayed. If it is unchecked, the data information will not be displayed.

[0124] However, for static form options, the data information is displayed directly, and the display will not be determined by switching switches.

[0125] The method provided in the above embodiment provides a way to configure the displayed information, so that the data entered in the form options can be displayed or not, thereby improving the user experience of the page form.

[0126] The method provided in the embodiment of the present invention combines the idea of ​​componentization, performs high abstraction on the basis of componentization, and proposes an implementation scheme that integrates option configuration, option generation, data format conversion, and data verification. The required functions are assembled through this scheme, and a form page with verification function is quickly generated, which greatly improves the reusability and flexibility of the components, avoids repeated writing of similar codes and code redundancy, and facilitates the access of third-party codes, simplifies the form logic, makes the form easy to manage, and facilitates the maintenance and expansion of the form.

[0127] See also Figure 5 , which shows a schematic diagram of main modules of a device 600 for configuring form options provided by an embodiment of the present invention, including:

[0128] The acquisition module 501 is used to acquire configuration information associated with the form component and generate a configuration table based on the configuration information;

[0129] The display module 502 is used to parse the configuration table, generate corresponding form components, and display form options associated with the form components.

[0130] In the implementation device of the present invention, the configuration information includes the format receiving rules of the form component;

[0131] The display module 502 is further used for:

[0132] Receiving a data input request for the form options and obtaining the input data information;

[0133] When the format of the data information does not conform to the format receiving rule, the data information is format converted according to a predetermined format conversion rule, and the data information after the format conversion is transmitted to the form component to be displayed in the form option.

[0134] In the implementation device of the present invention, the configuration information includes the validation rules of the form component;

[0135] The display module 502 is further used for:

[0136] Receiving a data input request for the form options and obtaining the input data information;

[0137] When the data information does not comply with the validation rule, corresponding exception information is determined, and the exception information is transmitted to the form component to be displayed in the form option.

[0138] In the implementation device of the present invention, the configuration information includes the type of the form component; wherein the type is one of dynamic or static;

[0139] The display module 502 is further used for:

[0140] Receiving a data input request for the form options and obtaining the input data information;

[0141] When the type of the form component is a dynamic type and a display request for the data information is received, the data information is transmitted to the form component to be displayed in the form option; or

[0142] When the type of the form component is a static type, the data information is transmitted to the form component to be displayed in the form options.

[0143] In the implementation device of the present invention, the configuration information includes the format display rules of the form component;

[0144] The display module 502 is further used for:

[0145] According to the format display rule, the form component is formatted and rendered, and the form options after format rendering are displayed.

[0146] The device provided in the embodiment of the present invention combines the idea of ​​componentization, performs high abstraction on the basis of componentization, and proposes an implementation scheme that integrates option configuration, option generation, data format conversion, and data verification. Through this scheme, the required functions are assembled, and a form page with verification function is quickly generated, which greatly improves the reusability and flexibility of the components, avoids repeated writing of similar codes and code redundancy, and facilitates the access of third-party codes, simplifies the form logic, makes the form easy to manage, and facilitates the maintenance and expansion of the form.

[0147] In addition, the specific implementation content of the device for configuring form options described in the embodiment of the present invention has been described in detail in the method for configuring form options described above, so the repeated content will not be described again here.

[0148] See also Figure 6 An exemplary system architecture 600 to which the method or device for configuring form options according to the embodiment of the present invention can be applied is shown.

[0149] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, 603, network 604 and server 605. Network 604 is used to provide a medium for communication links between terminal devices 601, 602, 603 and server 605. Network 604 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0150] Users can use terminal devices 601, 602, and 603 to interact with server 605 through network 604 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 601, 602, and 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).

[0151] The terminal devices 601 , 602 , and 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.

[0152] The server 605 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 601, 602, and 603. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only an example) to the terminal device.

[0153] It should be noted that the monitoring system security method provided in the embodiment of the present invention is generally executed by the server 605 , and accordingly, the monitoring system security device is generally set in the server 605 .

[0154] It should be understood that Figure 6 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0155] See also Figure 7 , which shows a schematic diagram of the structure of a computer system 700 of a terminal device suitable for implementing an embodiment of the present invention. Figure 7 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0156] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0157] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.

[0158] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present invention are executed.

[0159] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0160] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0161] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor. For example, they may be described as: a processor includes an acquisition module and a display module. The names of these modules do not, in some cases, constitute limitations on the modules themselves. For example, the display module may also be described as a "form option display module".

[0162] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:

[0163] Acquire configuration information associated with the form component, and generate a configuration table based on the configuration information;

[0164] The configuration table is parsed, a corresponding form component is generated, and form options associated with the form component are displayed.

[0165] According to the technical solution of the embodiment of the present invention, combined with the idea of ​​componentization, a highly abstracted implementation scheme integrating option configuration, option generation, data format conversion, and data verification is proposed. Through this scheme, the required functions are assembled, and a form page with verification function is quickly generated, which greatly improves the reusability and flexibility of the components, avoids repeated writing of similar codes and code redundancy, and facilitates the access of third-party codes, simplifies the form logic, makes the form easy to manage, and facilitates the maintenance and expansion of the form.

[0166] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for configuring form options, characterized in that: include: Acquire configuration information associated with the form component, and generate a configuration table based on the configuration information; wherein the configuration table includes field types and representative meanings, the field types include multi-level attributes, the first-level attributes are configurations of the form option part, including type fields, title fields, identification fields, and attribute fields, the type field is one of dynamic or static, when the form option is dynamic, a toggle switch is added to the form component of the form option through a dynamic switching component, and the display or non-display of the form option is controlled by turning the toggle switch on and off; only the attribute field includes second-level attributes, the type field in the second-level attributes indicates the component name used by the form option, the name field indicates the mapping of the form option in the data pool, and the format field indicates the rules that need to be met for the form option verification, including third-level attribute name fields and rule fields, the name field is the name of the verification component, and the rule field specifies the rules that need to be met for the verification; Parsing the configuration table, generating a corresponding form component, and displaying form options associated with the form component, including: Receiving a data input request for the form options and obtaining the input data information; When the format of the data information does not conform to the format receiving rule, the data information is format-converted according to a predetermined format conversion rule, and the data information after format conversion is transmitted to the form component to be displayed in the form option; wherein, before transmitting the data information to the form component, the data information is format-converted by a format converter; after the data information in the form component is format-converted, when the data information is saved, the data information after the format change is converted into the original format by a format converter.

2. The method according to claim 1, characterized in that The configuration information includes validation rules for the form component; The displaying of form options associated with the form component further comprises: When the data information does not comply with the validation rule, corresponding exception information is determined, and the exception information is transmitted to the form component to be displayed in the form option.

3. The method according to claim 1, characterized in that: The displaying of form options associated with the form component includes: When the type of the form component is a dynamic type and a display request for the data information is received, the data information is transmitted to the form component to be displayed in the form option; or When the type of the form component is a static type, the data information is transmitted to the form component to be displayed in the form options.

4. The method according to claim 1, characterized in that: The configuration information includes the format display rules of the form component; The displaying of form options associated with the form component further comprises: According to the format display rule, the form component is formatted and rendered, and the form options after format rendering are displayed.

5. A device for configuring form options, characterized in that: include: An acquisition module is used to acquire configuration information associated with a form component, and generate a configuration table based on the configuration information; wherein the configuration table includes field types and representative meanings, and the field types include multi-level attributes, and the first-level attributes are configurations of the form option part, including a type field, a title field, an identification field, and an attribute field, and the type field is one of dynamic or static. When the form option is dynamic, a toggle switch is added to the form component of the form option through a dynamic switching component, and the display or non-display of the form option is controlled by turning the toggle switch on and off; only the attribute field includes a second-level attribute, and the type field in the second-level attribute indicates the component name used by the form option, the name field indicates the mapping of the form option in the data pool, and the format field indicates the rules that need to be met for the form option verification, including a third-level attribute name field and a rule field, the name field is the name of the verification component, and the rule field specifies the rules that need to be met for the verification; The display module is used to parse the configuration table, generate corresponding form components, and display form options associated with the form components, including: Receiving a data input request for the form options and obtaining the input data information; When the format of the data information does not conform to the format receiving rule, the data information is format-converted according to a predetermined format conversion rule, and the data information after format conversion is transmitted to the form component to be displayed in the form option; wherein, before transmitting the data information to the form component, the data information is format-converted by a format converter; after the data information in the form component is format-converted, when the data information is saved, the data information after the format change is converted into the original format by a format converter.

6. The device according to claim 5, characterized in that The configuration information includes validation rules for the form component; The display module is also used for: When the data information does not comply with the validation rule, corresponding exception information is determined, and the exception information is transmitted to the form component to be displayed in the form option.

7. The device according to claim 5, characterized in that The display module is used for: When the type of the form component is a dynamic type and a display request for the data information is received, the data information is transmitted to the form component to be displayed in the form option; or When the type of the form component is a static type, the data information is transmitted to the form component to be displayed in the form options.

8. The device according to claim 5, characterized in that The configuration information includes the format display rules of the form component; The display module is also used for: According to the format display rule, the form component is formatted and rendered, and the form options after format rendering are displayed.

9. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.

10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Form verification method and form verification system

    CN103106186A

  • System and method for achieving general data form inputting through configuration files

    CN104375818A

  • Intelligent form system and generation method thereof

    CN106021211A

  • Form automatic filling method and system

    CN106599213A

  • Method and system for selecting rules to validate information submitted on an electronic form

    US20050108625A1