A method of dynamically disabling forms

By using Java reflection and dynamic configuration, form fields can be dynamically disabled, solving the problem of inflexible form disabling in existing technologies and improving the system's flexibility and maintainability.

CN116150168BActive Publication Date: 2026-01-06JIANGSU YINCHENG NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211546423.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-05
Publication Date
2026-01-06
Estimated Expiration
2042-12-05

AI Technical Summary

Technical Problem

In existing technologies, the dynamic disabling mechanism for duplicate forms during user information collection is inflexible, requiring frequent changes to the front-end code to disable or undisable forms, leading to difficulties in system maintenance.

Method used

The Java reflection mechanism is used to obtain form field information. The form fields that need to be disabled are stored in the frozenFields collection through dynamic configuration, and the backend responds to the frontend for dynamic disabling, reducing the maintenance work of the frontend business code.

Benefits of technology

It enables dynamic adjustment of form disabling, reduces front-end code maintenance work, improves system flexibility and maintainability, and avoids frequent system restarts and code changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116150168B_ABST
    Figure CN116150168B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of real-name authentication systems, and particularly discloses a method for dynamically disabling forms, which comprises the following steps: 1) a frozenFields set responded by a back end to a front end is all form fields that need to be disabled in a current page; 2) the front end judges whether a current form field is in the frozenFields set according to each given form field, if yes, sets a form attribute as disabled, and if not, sets the form attribute as allowed. The method for dynamically disabling forms provided by the application adopts a dynamic configuration mode to manage the input fields, if the content in a business item is modified, the modification can take effect in real time, the system does not need to be redeployed, real-time query can be realized, the latest data can be obtained, and the data management and control of the back end are greatly facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of real-name authentication system technology, and specifically to a method for dynamically disabling forms. Background Technology

[0002] Websites across various industries require users to register an account, and this process involves collecting basic user information.

[0003] Because user needs vary across different business scenarios, it's necessary to collect different user information multiple times. If duplicate forms appear during these multiple data collections, then in subsequent data collections, if the data has already been collected in the previous collection, the form will be displayed but not editable. Alternatively, if some information from the two forms is related, then the user will not be allowed to modify it during the second data collection. For example:

[0004] A website collected the legal representative's name, ID number, and mobile phone number during real-name authentication, but failed to collect the ID's expiration date. Figure 1 During subsequent account opening procedures, the legal representative's name, ID number, and mobile phone number will be grayed out and cannot be changed, but the ID's expiration date can be entered. Figure 2 ).

[0005] In the aforementioned existing technologies, if the form that needs to be grayed out is temporarily fixed, the front-end hardcodes the form that needs to be disabled. However, when it is necessary to unblock or disable other forms, the front-end needs to modify the code and restart the system for the changes to take effect. Summary of the Invention

[0006] The purpose of this invention is to provide a method for dynamically disabling forms, simplifying front-end operations and enabling dynamic adjustments. The front-end can determine whether to disable a form based on the actual form data entered.

[0007] To achieve the above objectives, the present invention provides the following technical solution: a method for dynamically disabling forms, comprising the following steps:

[0008] 1) The frozenFields collection that the backend responds to the frontend contains all the form fields that need to be disabled on the current page;

[0009] 2) The front end checks each given form field to see if the current form field is in the frozenFields collection. If it is, the form attribute is set to disabled; otherwise, the form attribute is set to allowed.

[0010] Preferably, the frozenFields collection includes:

[0011] faceIdUrl, the front of the ID card;

[0012] backIdUrl, the back of the ID card;

[0013] legalpersonName, full name;

[0014] ID No.

[0015] phone, mobile phone number.

[0016] Preferably, the method for determining whether form field attributes are disabled in the frozenFields collection in the backend response is as follows:

[0017] S001. Use dynamic configuration to store form fields into the frozenFields collection;

[0018] S002. Obtain field information through Java reflection and match it with the fields required by the business requirements. Determine whether the fields need to be stored in the frozenFields collection by comparison.

[0019] Preferably, the Java reflection mechanism obtains field information in the following manner:

[0020] S003. The Java reflection mechanism obtains all form fields that need to be responded to by the front end;

[0021] S004. Iterate through the array of all the form fields, get the name of each form field, and match it to a subset of the frozenFields collection according to the Java reflection mechanism. The subset of the data values ​​are obtained from all the form fields.

[0022] S005. After obtaining the data values ​​of the subset items, make business judgments on the data values ​​to determine whether to store the corresponding form field names into the frozenFields collection.

[0023] Preferably, the dynamic configuration in step S001 refers to importing the entered form fields into the local Apollo to configure all form fields that need to be disabled.

[0024] Preferably, the dynamic configuration in step S001 involves reading the form field data in real time, obtaining the form fields that need to be disabled, adding them to the frozenFields set, and responding to the front end.

[0025] A system for dynamically disabling forms, used to execute the method for dynamically disabling forms as described in the above scheme, includes:

[0026] The input module allows users to enter basic information to form a subset of project data.

[0027] The data processing module matches the subset of project data mentioned in the first step with the business project fields to include them in the frozenFields collection;

[0028] The data judgment module provides feedback based on the included frozenFields set data values ​​and displays disabled subset items. The data of the second subset items included are compared cyclically with the data of the first subset items, and the user determines the frozenFields set data values ​​to be included for the corresponding business item.

[0029] Preferably, the data processing module dynamically configures the entered subset of project data based on predetermined business projects, and selects a configuration method according to the business projects, wherein...

[0030] The configuration methods include:

[0031] The first configuration unit imports the subset of project data into the dynamic configuration center to configure all form fields that need to be disabled and stores the form fields that need to be disabled into the database.

[0032] The second configuration unit reads the subset of project data in real time, obtains the form fields that need to be disabled, enters them into the frozenFields collection, and responds to the front end for display in real time.

[0033] In the above technical solution, the present invention provides a method for dynamically disabling forms, which has the following beneficial effects: It dynamically configures the data entered by the front end based on Java reflection. By looping through the data in the array, it obtains a subset of item data within the `frozenFields` collection using Java reflection. Business logic is then applied to this data to determine whether to store the corresponding form field names in the `frozenFields` collection, and the front end is fed back with all form fields that need to be disabled on the current page. Through flexible dynamic configuration, it controls in real-time which forms need to be grayed out on the front end, and the corresponding business layer in the back end determines whether form fields need to be grayed out, reducing redundant business code on the front end and increasing code maintainability and readability. Attached Figure Description

[0034] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0035] Figure 1 This is a schematic diagram of the module structure provided in an embodiment of the present invention;

[0036] Figure 2 This is a schematic diagram of the process structure provided in an embodiment of the present invention;

[0037] Figure 3 This is a diagram of an information input interface in existing technology;

[0038] Figure 4 The existing technology provides an interface diagram for entering gray warning items for information entry;

[0039] Figure 5 This is a diagram of the user interface provided in an embodiment of the present invention. Detailed Implementation

[0040] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0041] Example 1

[0042] like Figure 2 and Figure 4 As shown, a method for dynamically disabling a form includes the following steps:

[0043] 1) The frozenFields collection that the backend responds to the frontend contains all the form fields that need to be disabled on the current page;

[0044] 2) The front end checks each given form field to see if the current form field is in the frozenFields collection. If it is, the form attribute is set to disabled; otherwise, the form attribute is set to allowed.

[0045] The frozenFields collection in the example includes:

[0046] faceIdUrl, the front of the ID card;

[0047] backIdUrl, the back of the ID card;

[0048] legalpersonName, full name;

[0049] ID No.

[0050] phone, mobile phone number.

[0051] Furthermore, the backend response determines whether form field attributes are disabled in the frozenFields collection as follows:

[0052] S001. Use dynamic configuration to store form fields into the frozenFields collection;

[0053] S002. Obtain field information through Java reflection and match it with the fields required by the business requirements. Determine whether the fields need to be stored in the frozenFields collection by comparison.

[0054] Furthermore, Java reflection retrieves field information in the following ways:

[0055] S003. Use Java reflection to obtain all form fields that need to be sent to the front end.

[0056] S004. Loop through the array of all form fields, get the name of each form field, and use Java reflection to match it with a subset of the frozenFields collection. Get the corresponding data value of each form field from the subset.

[0057] S005. After obtaining the data values ​​of the subset project, make business judgments on the data values ​​to determine whether to store the corresponding form field names into the frozenFields collection.

[0058] The above solution utilizes Java reflection to dynamically configure data entered from the front end. By iterating through the array, it retrieves a subset of items from the `frozenFields` collection using Java reflection. Business logic is then applied to this data to determine whether to add the corresponding form field names to the `frozenFields` collection and to send a notification to the front end regarding all form fields that need to be disabled. This flexible dynamic configuration allows for real-time control of which forms need to be grayed out on the front end, while the backend business logic determines whether form fields need to be grayed out, reducing redundant front-end business logic and increasing code maintainability and readability.

[0059] Example 2

[0060] The method for determining whether the form field attributes of the frozenFields collection are disabled in the backend response of the above embodiment 1 is as follows: The dynamic configuration in step S001 refers to the import of the entered form fields into the local apollo to configure all form fields that need to be disabled.

[0061] Right now:

[0062] S001. Use dynamic configuration to import the entered form fields into the local apollo to configure all form fields that need to be disabled and store them in the frozenFields collection;

[0063] S002. Obtain field information through Java reflection and match it with the fields required by the business requirements. Determine whether the fields need to be stored in the frozenFields collection by comparison.

[0064] Furthermore, Java reflection retrieves field information in the following ways:

[0065] S003. Use Java reflection to obtain all form fields that need to be sent to the front end.

[0066] S004. Loop through the array of all form fields, get the name of each form field, and use Java reflection to match it with a subset of the frozenFields collection. Get the corresponding data value of each form field from the subset.

[0067] S005. After obtaining the data values ​​of the subset project, make business judgments on the data values ​​to determine whether to store the corresponding form field names into the frozenFields collection.

[0068] Example 3

[0069] The method for determining whether a form field attribute in the frozenFields collection is disabled in the backend response of Embodiment 1 above is as follows: dynamic configuration in step S001, which reads form field data in real time, obtains the form fields that need to be disabled and includes them in the frozenFields collection, and responds to the frontend.

[0070] Right now:

[0071] S001. Use dynamic configuration to import the entered form fields into the local apollo to configure all form fields that need to be disabled and store them in the frozenFields collection;

[0072] S002. Obtain field information through Java reflection and match it with the fields required by the business requirements. Determine whether the fields need to be stored in the frozenFields collection by comparison.

[0073] Furthermore, Java reflection retrieves field information in the following ways:

[0074] S003. Use Java reflection to obtain all form fields that need to be sent to the front end.

[0075] S004. Loop through the array of all form fields, get the name of each form field, and use Java reflection to match it with a subset of the frozenFields collection. Get the corresponding data value of each form field from the subset.

[0076] S005. After obtaining the data values ​​of the subset project, make business judgments on the data values ​​to determine whether to store the corresponding form field names into the frozenFields collection.

[0077] Example 4

[0078] like Figure 1 As shown, a system for dynamically disabling forms, used to execute the methods for dynamically disabling forms provided in Embodiments 1, 2, and 3 above, includes:

[0079] The input module allows users to enter basic information to form a subset of project data.

[0080] The data processing module matches the first subset of project data with the business project fields to include them in the frozenFields collection;

[0081] The data judgment module provides feedback based on the included frozenFields set data values ​​and displays disabled subset items. The data of the secondary subset items that are included again will be compared with the data of the first subset items in a cyclical manner, and the user determines the frozenFields set data values ​​to be included for the corresponding business items.

[0082] Furthermore, in the above technical solution, the data processing module dynamically configures the entered subset of project data based on predetermined business projects, and selects the configuration method according to the business projects.

[0083] Configuration methods include:

[0084] The first configuration unit imports the subset of project data into the dynamic configuration center to configure all form fields that need to be disabled and stores the form fields that need to be disabled into the database.

[0085] The second configuration unit reads the subset of project data in real time, obtains the form fields that need to be disabled, enters them into the frozenFields collection, and responds to the front end for display in real time.

[0086] Compared to static configuration, dynamic configuration allows changes to take effect immediately without requiring system redeployment. The same applies to database configuration; it can be queried in real-time to retrieve the latest data. Therefore, when an administrator modifies a form field that needs to be disabled, the front-end can retrieve the modified content in real-time, render the latest form disabling scheme, and achieve real-time "disable" setting and effect on the page form.

[0087] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0088] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0089] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0090] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0091] Specific embodiments have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.

[0092] The embodiments of this application also provide a specific implementation of an electronic device capable of implementing all the steps in the methods described above, wherein the electronic device specifically includes the following:

[0093] Processor, memory, communications interface, and bus;

[0094] The processor, memory, and communication interface communicate with each other through the bus.

[0095] The processor is used to invoke a computer program in the memory, and when the processor executes the computer program, it implements all the steps in the method described in the above embodiments.

[0096] Embodiments of this application also provide a computer-readable storage medium capable of implementing all the steps of the methods in the above embodiments, wherein the computer-readable storage medium stores a computer program that, when executed by a processor, implements all the steps of the methods in the above embodiments.

[0097] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on its differences from other embodiments. In particular, for hardware + program embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. Although the embodiments in this specification provide the method operation steps as shown in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-inventive means. The order of steps listed in the embodiments is merely one possible execution order among many steps and does not represent the only execution order. In actual device or terminal product execution, the methods can be executed in the order shown in the embodiments or drawings or in parallel (e.g., in a parallel processor or multi-threaded processing environment, or even a distributed data processing environment). The terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, product, or apparatus that includes a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, product, or apparatus. Without further limitations, the presence of other identical or equivalent elements in the process, method, product, or apparatus that includes said elements is not excluded. For ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing the embodiments of this specification, the functions of each module can be implemented in one or more software and / or hardware, or the module implementing the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms. This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions, which are executable by the processor of the computer or other programmable data processing device, produce instructions for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0098] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, the embodiments of this specification can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The various embodiments in this specification are described in a progressive manner, and similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the description of the method embodiments. In the description of this specification, the reference to the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., means that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the embodiments of this specification.

[0099] In this specification, the illustrative expressions of the terms used do not necessarily refer to the same embodiments or examples. Furthermore, those skilled in the art can combine and integrate different embodiments or examples described in this specification, as well as features of different embodiments or examples, without contradiction. The above descriptions are merely embodiments of this specification and are not intended to limit the embodiments of this specification. Various modifications and variations can be made to the embodiments of this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the embodiments of this specification should be included within the scope of the claims of the embodiments of this specification.

Claims

1. A method of dynamically disabling a form, comprising: The method comprises the following steps: 1) the backend responds to the frozenFields set of the front end, which is all the form fields that need to be disabled in the current page; 2) the front end judges according to each given form field, whether the current form field is in the frozenFields set, if so, set the form attribute to be disabled, if not, set the form attribute to be allowed; The judgment method of the backend response to determine the frozenFields set to disable the form field attribute is as follows: S001, store the form field into the frozenFields set by dynamic configuration; S002, obtain field information through java reflection mechanism, and match with the field required by business demand, and determine whether to store into the frozenFields set by comparison; The java reflection mechanism obtains field information by the following method: S003, the java reflection mechanism obtains all the form fields that need to be responded to the front end; S004, all the form fields are traversed in the array, the name of each form field is obtained, and the subset item of the frozenFields set is obtained according to the java reflection mechanism, and the subset item obtains the corresponding data value in all the form fields; S005, after completing the data value acquisition of the subset item, the corresponding form field name is stored in the frozenFields set by doing business judgment on the data value; The dynamic configuration in step S001 refers to the entry of the form field into the local apollo to configure all the form fields that need to be disabled.

2. The method of dynamically disabling a form of claim 1, wherein, The frozenFields set includes: faceIdUrl, identity card front; backIdUrl, identity card back; legalpersonName, name; idNo, certificate number; phone, mobile phone number.

3. The method of dynamically disabling a form of claim 1, wherein, The dynamic configuration in step S001 acquires the form fields that need to be disabled by reading the form field data in real time, and includes them in the frozenFields set and responds to the front end.

4. A system for dynamically disabling forms, comprising: The method for dynamically disabling the form according to any one of claims 1-3 comprises: an input module for inputting user basic information to form subset item data; a data processing module for matching the first subset item data with business item fields to include them in the frozenFields set; a data judgment module for feedback display based on the data value of the included frozenFields set, and displaying the disabled subset item, and the second subset item data will be compared with the first subset item data, and the user determines the data value of the included frozenFields set corresponding to the business item.

5. The system for dynamically disabling forms of claim 4, wherein, The data processing module dynamically configures the input subset item data based on the given business item, and selects the configuration mode according to the business item, wherein the configuration mode includes: A first configuration unit introduces the subset project data into a dynamic configuration center to configure all the form fields that need to be disabled, and stores the form fields that need to be disabled into a repository. A second configuration unit reads the subset project data in real time, acquires the form fields that need to be disabled, enters the acquired form fields into a frozenFields collection, and responds to the front end in real time to display the form fields.

6. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the steps of the method for dynamically disabling a form according to any one of claims 1 to 3 when executing the program.

7. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program implements the steps of the method for dynamically disabling a form according to any one of claims 1 to 3 when executed by the processor.

Citation Information

Patent Citations

  • Form configuration method and device

    CN113051269A