Electronic certificate form generation method and electronic equipment
By extracting and updating JSON metadata, generating dynamic forms and rendering the page, the problem of poor modification flexibility caused by hard-coded generation of electronic credential forms and the inability of users to modify by themselves is solved, and the flexibility and user experience of form modification is achieved.
Patent Information
- Application Number
- CN202411094280.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-11-29
AI Technical Summary
In the prior art, hard-coded electronic voucher forms have resulted in poor flexibility in form modification, and users cannot modify the form by themselves.
By responding to form change requests, obtain form change information, extract JSON metadata, generate dynamic forms, and transmit them to the backend server, update the JSON metadata in the initial user form, generate target form data, implement page rendering, and allow users to Modify the form yourself.
Improve the flexibility of form modification, and users can modify the form by themselves, solving the problem of modification difficulties and inflexibility caused by hard-coded generation of electronic credential forms.
Smart Images

Figure CN119045794A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electronic certificates, and in particular to an electronic certificate form generation method and an electronic device. Background Art
[0002] The electronic certificate form is a digital certificate. If the relevant information on the electronic certificate form changes, the electronic certificate form needs to be modified.
[0003] In the related art, the electronic credential form is generated based on hard coding. When the electronic credential form needs to be modified, the user cannot modify it by himself. The developer needs to modify the back-end code according to the user's needs, and then associate the front-end code to achieve the change of the content to be modified. This method has the problems of difficulty in modifying the form page, troublesome modification, lack of flexibility, and the user cannot modify the form by himself.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide an electronic credential form generation method and an electronic device, so as to at least solve the technical problem that the form modification flexibility is poor and the user cannot modify the form by himself due to the use of hard coding to generate the electronic credential form in the related art.
[0006] According to one aspect of an embodiment of the present invention, a method for generating an electronic credential form is provided, comprising: obtaining form change information in response to a form change request of an electronic credential; extracting first JSON metadata in the form change information; generating a dynamic form based on the first JSON metadata; transmitting the dynamic form to a back-end server, so that the back-end server updates the JSON metadata in an initial user form based on the dynamic form to obtain second JSON metadata; receiving target form data generated by the back-end server based on the second JSON metadata, and performing page rendering based on the target form data to generate a target form page.
[0007] Optionally, generating a dynamic form based on the first JSON metadata includes: constructing an initial JSON metadata structure, wherein the fields in the initial JSON metadata structure include at least one of the following: user registration, form title, and field array; constructing a container element, wherein the container element is an extended field for the initial JSON metadata structure, and the extended field is used to indicate a field different from user registration, form title, and field array; inserting the container element into the initial JSON metadata structure to generate a target JSON metadata structure; generating the dynamic form based on the first JSON metadata and the target JSON metadata structure.
[0008] Optionally, generating the dynamic form based on the first JSON metadata and the target JSON metadata structure includes: obtaining an identifier in the first JSON metadata; and based on the identifier, inputting the first JSON metadata into the target JSON metadata structure to generate the dynamic form.
[0009] Optionally, transmitting the dynamic form to the backend server includes: configuring an application program interface; and linking the dynamic form to the backend server based on the application program interface.
[0010] Optionally, based on the identifier, the first JSON metadata is input into the target JSON metadata structure to generate the dynamic form, and the method also includes: obtaining preset verification rules corresponding to the target JSON metadata structure, wherein the preset verification rules at least include field length and / or whether it is a required item; determining whether the first JSON metadata complies with the preset verification rules; if the first JSON metadata complies with the preset verification rules, based on the identifier, the first JSON metadata is input into the target JSON metadata structure to generate the dynamic form.
[0011] Optionally, the method further includes: generating an error prompt message when the first JSON metadata does not comply with the preset verification rule.
[0012] According to another aspect of an embodiment of the present invention, there is provided a method for generating an electronic credential form, comprising: receiving a dynamic form from a front-end device, wherein the dynamic form is generated based on first JSON metadata, and the first JSON metadata is extracted by the front-end device from form change information corresponding to the electronic credential; updating the JSON metadata in an initial user form based on the dynamic form to obtain second JSON metadata; generating target form data based on the second JSON metadata; and sending the target form data to the front-end device, so that the front-end device performs page rendering based on the target form data to generate a target form page.
[0013] Optionally, updating the JSON metadata in the initial user form based on the dynamic form to obtain the second JSON metadata includes: updating the JSON metadata in the initial user form based on the first JSON metadata in the dynamic form to obtain the second JSON metadata, wherein the updating includes at least one of the following: adding, replacing, and deleting.
[0014] According to another aspect of an embodiment of the present invention, a method for generating an electronic credential form is provided, comprising: a front-end device obtains form change information in response to a form change request of an electronic credential; the front-end device extracts first JSON metadata in the form change information; the front-end device generates a dynamic form based on the first JSON metadata, and transmits the dynamic form to a back-end server; the back-end server updates the JSON metadata in an initial user form based on the dynamic form to obtain second JSON metadata; the back-end server generates target form data based on the second JSON metadata, and sends the target form data to the front-end device; the front-end device performs page rendering based on the target form data to generate a target form page.
[0015] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the electronic voucher form generation methods.
[0016] In an embodiment of the present invention, by responding to a form change request of an electronic voucher, form change information is obtained; first JSON metadata in the form change information is extracted; a dynamic form is generated based on the first JSON metadata; the dynamic form is transmitted to a backend server, so that the backend server updates the JSON metadata in the initial user form based on the dynamic form to obtain second JSON metadata; target form data generated by the backend server based on the second JSON metadata is received, and page rendering is performed based on the target form data to generate a target form page. The purpose of generating the initial user form through JSON metadata and automatically modifying the JSON metadata in the initial user form based on the JSON metadata in the modified content through the interaction between the front end and the back end is achieved, thereby achieving the technical effect of improving the flexibility of form modification and allowing users to modify the form by themselves, thereby solving the technical problem of poor flexibility of form modification and inability of users to modify the form by themselves caused by the use of hard coding to generate electronic voucher forms in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0018] Figure 1 is a flow chart of a method for generating an electronic voucher form according to an embodiment of the present invention;
[0019] Figure 2 is a flow chart of another method for generating an electronic voucher form according to an embodiment of the present invention;
[0020] Figure 3 is a flow chart of another method for generating an electronic voucher form according to an embodiment of the present invention;
[0021] Figure 4 is a flow chart of an optional method for generating an electronic voucher form according to an embodiment of the present invention;
[0022] Figure 5 is a schematic diagram of an electronic voucher form generating device according to an embodiment of the present invention;
[0023] Figure 6 is a schematic diagram of another electronic voucher form generating device according to an embodiment of the present invention;
[0024] Figure 7 2 is a schematic diagram of another electronic voucher form generating device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention 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 interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] First, to facilitate understanding of the embodiments of the present invention, some terms or nouns involved in the present invention are explained below:
[0028] JSON (JavaScript Object Notation) is a lightweight data exchange format that uses a text format that is easy for humans to read and write to represent structured data.
[0029] Metadata refers to a data format that describes data, provides information about other data, and is often used in data management and organization.
[0030] Electronic credentials refer to identity authentication and authorization documents that are stored, transmitted and displayed in electronic form. They can verify the identity, qualifications, rights or other information of an individual or entity and have the same or similar legal effect as traditional paper credentials.
[0031] According to an embodiment of the present invention, a method embodiment of an electronic voucher form generation is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0032] Figure 1 is a flow chart of a method for generating an electronic voucher form according to an embodiment of the present invention. Figure 1As shown, the method comprises the following steps:
[0033] Step S102, in response to the form change request of the electronic voucher, obtaining form change information;
[0034] Optionally, the user uploads the form content of the electronic certificate that he wants to modify to the front-end device. The front-end device receives the form change request and generates form change information based on the form content that he wants to modify, so that the existing initial user form can be modified based on the above form change information, thereby achieving the effect that the user can modify the form by himself.
[0035] Step S104, extracting the first JSON metadata in the form change information;
[0036] Optionally, JSON (JavaScript Object Notation) metadata is used to describe the structure, properties, and other information of JSON data. JSON is a lightweight data exchange format that can be used for data transmission and storage between front-end devices and back-end servers. Metadata can include information such as data field name, data type, length limit, default value, validation rules, etc.
[0037] Optionally, since JSON metadata can transmit data between the front-end device and the back-end server, the content input by the front-end device can be automatically transmitted to the back-end server, so that after the form change information to be modified is input on the front-end device, the first JSON metadata in the form change information can be extracted and automatically transmitted to the back-end server, thereby achieving the effect that the user can modify the form through front-end operations by themselves.
[0038] Step S106, generating a dynamic form based on the first JSON metadata;
[0039] Optionally, there may be a lot of content that the user needs to modify. In this case, there may be multiple first JSON metadata extracted based on the form change information, that is, there is more than one first JSON metadata. The form change information obtained each time is taken as a group of information, that is, the multiple first JSON metadata in the form change information are taken as a group of data, and the above multiple first JSON metadata are integrated together to generate a dynamic form. When the above dynamic form is transmitted to the back-end server, confusion or missing of the first JSON metadata is effectively avoided, thereby effectively ensuring the accuracy of the transmission of the form change information.
[0040] In an optional embodiment, a dynamic form is generated based on a first JSON metadata, including: constructing an initial JSON metadata structure, wherein the fields in the initial JSON metadata structure include at least one of the following: user registration, form title, and field array; constructing a container element, wherein the container element is an extended field for the initial JSON metadata structure, and the extended field is used to indicate a field different from user registration, form title, and field array; inserting the container element into the initial JSON metadata structure to generate a target JSON metadata structure; and generating a dynamic form based on the first JSON metadata and the target JSON metadata structure.
[0041] Optionally, the information in each electronic certificate form may be different, resulting in the need to modify the subsequent form information, and the corresponding modified content may also be different. The above difference refers to the different types of modified information, that is, some electronic certificate forms contain data such as user name, user age, user education information, etc., but some electronic certificate forms contain user name, user certificate application time, user certificate expiration time, etc. Due to the different types of information in the electronic certificate, the user needs to change the content in the electronic certificate form differently, but the electronic certificate form contains user registration information (i.e. user name), form title (i.e. electronic ID card or electronic driver's license, etc.) and other data. An initial JSON metadata structure is constructed based on the above common data, so that when the user modifies the common data, the corresponding extracted first JSON metadata can be placed in the corresponding position of the initial JSON metadata structure, that is, the first JSON metadata can be filled into the initial JSON metadata structure, so as to avoid data confusion during subsequent transmission.
[0042] Optionally, for the part of the electronic certificate that is not common data, a container element is constructed, and the field data that cannot be placed in the initial JSON metadata structure (i.e., field data that is not user registration, form title, or field array) is stored in the container element, and the container element is inserted to the end of the initial JSON metadata structure to generate a target JSON metadata structure. A dynamic form is formed by inserting the content in the first JSON metadata into the corresponding position of the target JSON metadata structure. The above-mentioned dynamic form is a form that integrates all the first JSON metadata together.
[0043] Optionally, a JavaScript engine is used to construct a target JSON metadata structure, thereby generating a dynamic form. Specifically, a container element is constructed using Hypertext Markup Language (HTML) to effectively construct the target JSON metadata structure.
[0044] In an optional embodiment, a dynamic form is generated based on the first JSON metadata and the target JSON metadata structure, including: obtaining an identifier in the first JSON metadata; based on the identifier, inputting the first JSON metadata into the target JSON metadata structure to generate a dynamic form.
[0045] Optionally, the first JSON metadata is placed in the target JSON metadata structure accordingly. It is necessary to identify an identifier in the first JSON metadata, wherein the identifier can be used to indicate whether the corresponding first JSON metadata is field information registered by the user, field information of the form title, or other field information. Based on the identifier, the above-mentioned first JSON metadata is inserted into the corresponding position of the target JSON metadata structure accordingly to achieve orderly transmission of the first JSON metadata to the back-end server and avoid data confusion during transmission.
[0046] In an optional embodiment, based on the identifier, the first JSON metadata is input into the target JSON metadata structure to generate a dynamic form. The method also includes: obtaining preset verification rules corresponding to the target JSON metadata structure, wherein the preset verification rules at least include field length and / or whether it is a required item; determining whether the first JSON metadata complies with the preset verification rules; if the first JSON metadata complies with the preset verification rules, based on the identifier, the first JSON metadata is input into the target JSON metadata structure to generate a dynamic form.
[0047] Optionally, preset validation rules are set during the construction of the target JSON metadata structure. If the first JSON metadata meets the preset validation rules, the first JSON metadata can be input into the target JSON metadata structure. For example, there is a user name in the user registration process. If the user needs to modify the user name, the form change information obtained at this time includes the new user name, and the first JSON metadata is the data field information corresponding to the new user name. Assuming that the preset validation rule is set to a user name greater than three characters and less than twenty characters, the first JSON metadata will be verified at this time. If the first JSON metadata meets the rule of greater than three characters and less than twenty characters, it is determined that the above new user name meets the regulations and can be modified. The first JSON metadata corresponding to the new user name is input into the target JSON metadata structure, which effectively realizes the accuracy of the modified information content.
[0048] In an optional embodiment, the method further includes: generating an error prompt message when the first JSON metadata does not comply with a preset verification rule.
[0049] Optionally, if the first JSON metadata meets the preset verification rules, the first JSON metadata can be input into the target JSON metadata structure. However, there may be a situation where the first JSON metadata does not meet the preset verification rules. In this case, an error prompt message can be generated based on the specific situation that the first JSON metadata does not meet the preset verification rules. For example, during the user registration process, there is a username modification, but the new username uploaded by the user is not within the range of more than three characters and less than twenty characters. At this time, the error prompt message is "The user name format does not meet the rules." Based on the above method, an error prompt message is generated, so that when the user fills in the modified content within the correct verification rule range, the first JSON metadata will be input into the target JSON metadata structure accordingly to generate a dynamic form.
[0050] Step S108, transmitting the dynamic form to the backend server, so that the backend server updates the JSON metadata in the initial user form based on the dynamic form to obtain second JSON metadata;
[0051] Optionally, the front-end device transmits the above-generated dynamic form to the back-end server so that the back-end server extracts the first JSON metadata in the dynamic form, thereby modifying the JSON metadata in the initial user form and generating new second JSON metadata. It should be noted that since the initial user form is generated by JSON metadata, it is still generated in the form of JSON metadata after modification. The initial user form is modified by modifying the JSON metadata in the initial user form. The flexibility of form modification is effectively improved, and users can modify the effect of the form by themselves.
[0052] In an optional embodiment, transmitting the dynamic form to the backend server includes: configuring an application program interface; and linking the dynamic form to the backend server based on the application program interface.
[0053] Optionally, configure the corresponding Application Programming Interface (API). Specifically, select the Representational State Transfer (RESTful) API interface protocol for transmission. The dynamic form is transmitted to the back-end server based on the RESTful API interface protocol, which effectively realizes the interaction between the front-end and the back-end, thereby achieving the effect of automatically modifying the form content.
[0054] Step S110: receiving target form data generated by the backend server based on the second JSON metadata, and performing page rendering based on the target form data to generate a target form page.
[0055] Optionally, the front-end device renders the page based on the target form data, that is, performs a refresh operation, so that the target form data in the back-end server is displayed on the front-end device, thereby generating a modified target form page, thereby achieving the effect of users modifying the electronic voucher form by themselves, and also achieving the effect of improving the flexibility of form modification.
[0056] Optionally, the user can modify the data on the electronic voucher based on the information that he wants to modify, and can also modify the style of the electronic voucher form page based on the layout, color and other page diversity elements of the electronic voucher that the user has set. That is, the third JSON metadata in the form layout change information is obtained in the same manner as the first JSON metadata in the form change information, wherein the form layout change information and the form change information constitute the user page, and the form layout change information at least includes the page element layout and / or page color; the dynamic page is generated based on the third JSON metadata in the same manner as the dynamic form is generated based on the first JSON metadata; the dynamic page is transmitted to the backend server and the JSON metadata in the initial user form is updated based on the dynamic form to obtain the second JSON metadata in the same manner as the dynamic form is transmitted to the backend server, and the JSON metadata in the initial user form is updated based on the dynamic form to obtain the fourth JSON metadata; the target form data generated by the backend server based on the second JSON metadata is received, and the page is rendered based on the target form data to generate the target form page in the same manner as the target page data is generated based on the fourth JSON metadata, and the page is rendered based on the target page data to generate the first target form page. It should be noted that both the first target form page and the target form page are pages displayed on the front-end device, and the page layout and page information can be modified synchronously. Finally, the final target form page is directly displayed during the rendering process.
[0057] Through the above steps S102 to S110, the initial user form can be generated through JSON metadata. The user only needs to upload the content that he wants to modify, and the JSON metadata in the initial user form can be automatically modified based on the JSON metadata in the modified content through the interaction between the front-end and the back-end, thereby achieving the technical effect of improving the flexibility of form modification and allowing the user to modify the form by themselves, thereby solving the technical problem of poor form modification flexibility and the inability of users to modify the form by themselves due to the use of hard coding to generate electronic voucher forms in related technologies.
[0058] According to an embodiment of the present invention, another method embodiment of generating an electronic voucher form is provided. Figure 2 FIG. 1 is a flow chart of another method for generating an electronic voucher form according to an embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:
[0059] Step S202, receiving a dynamic form from a front-end device, wherein the dynamic form is generated based on first JSON metadata, and the first JSON metadata is extracted by the front-end device from form change information corresponding to the electronic voucher;
[0060] Optionally, based on the dynamic form generated by the front-end device, the back-end server receives the dynamic form and modifies the initial user form based on the dynamic form, thereby achieving the effect of improving the flexibility of form modification and enabling users to modify the electronic voucher form by themselves.
[0061] Step S204, updating the JSON metadata in the initial user form based on the dynamic form to obtain second JSON metadata;
[0062] Optionally, the initial user form is a form that has always existed and has not been modified. Based on the dynamic form, the initial user form is modified. The initial user form is generated based on JSON metadata. In this case, it is necessary to obtain the first JSON metadata existing in the dynamic form, so as to replace the JSON metadata in the initial user form with the content in the first JSON metadata, and obtain the modified second JSON metadata, thereby realizing the modification of the initial user form, and further achieving the effect of users modifying the electronic certificate form by themselves.
[0063] In an optional embodiment, updating the JSON metadata in the initial user form based on the dynamic form to obtain the second JSON metadata includes: updating the JSON metadata in the initial user form based on the first JSON metadata in the dynamic form to obtain the second JSON metadata, wherein the update includes at least one of the following: adding, replacing, and deleting.
[0064] Optionally, the JSON metadata in the initial user form is updated based on the first JSON metadata. When the updated content is to modify the JSON metadata in the initial user form, the first JSON metadata can be used to replace the JSON metadata in the initial user form for updating; when the updated content is to remove some unnecessary information, the corresponding JSON metadata in the initial user form can be deleted for updating; when the updated content is to add some instructions or some information, the first JSON metadata content can be added to the corresponding JSON metadata in the initial user form for updating. For example, when the user name is changed, the original user name can be directly replaced with the new user name, or the original user name can be retained, but the explanatory information "former name" and other words are added after the original user name, and the new user name is added. Based on the above update method, the initial user form can be effectively modified, and the effect of users modifying the electronic certificate form by themselves can be effectively achieved.
[0065] Step S206, generating target form data based on the second JSON metadata;
[0066] Optionally, a dynamic programming language (JavaScript) is used to parse the second JSON metadata and generate target form data, thereby realizing the effect of automatically modifying and generating the modified form based on the modification information input by the user, effectively realizing the effect of the user modifying the electronic certificate form by himself.
[0067] Step S208, sending the target form data to the front-end device, so that the front-end device performs page rendering based on the target form data to generate a target form page.
[0068] Optionally, the target form data is sent to the front-end device, and the front-end device renders the page based on the target form data, that is, performs a refresh operation, so that the target form data in the back-end server is displayed on the front-end device, thereby generating a modified target form page, thereby achieving the effect of users modifying the electronic voucher form by themselves, and also achieving the effect of improving the flexibility of form modification.
[0069] Through the above steps S202 to S208, the initial user form can be generated through JSON metadata. The user only needs to upload the content that he wants to modify, and the JSON metadata in the initial user form can be automatically modified based on the JSON metadata in the modified content through the interaction between the front-end and the back-end, thereby achieving the technical effect of improving the flexibility of form modification and allowing the user to modify the form by themselves, thereby solving the technical problem of poor form modification flexibility and inability of users to modify the form by themselves due to the use of hard coding to generate electronic voucher forms in related technologies.
[0070] According to an embodiment of the present invention, another method embodiment of generating an electronic voucher form is provided. Figure 3 FIG. 1 is a flow chart of another method for generating an electronic voucher form according to an embodiment of the present invention. Figure 3 As shown, the method comprises the following steps:
[0071] Step S302, the front-end device obtains form change information in response to the form change request of the electronic voucher;
[0072] Step S304, the front-end device extracts the first JSON metadata in the form change information;
[0073] Step S306: the front-end device generates a dynamic form based on the first JSON metadata, and transmits the dynamic form to the back-end server;
[0074] Step S308, the backend server updates the JSON metadata in the initial user form based on the dynamic form to obtain second JSON metadata;
[0075] Step S310: the backend server generates target form data based on the second JSON metadata, and sends the target form data to the frontend device;
[0076] Step S312: the front-end device performs page rendering based on the target form data to generate a target form page.
[0077] Through the above steps S302 to S312, the initial user form can be generated through JSON metadata. The user only needs to upload the content that he wants to modify, and the JSON metadata in the initial user form can be automatically modified based on the JSON metadata in the modified content through the interaction between the front-end and the back-end, thereby achieving the technical effect of improving the flexibility of form modification and allowing users to modify the form by themselves, thereby solving the technical problem of poor form modification flexibility and inability of users to modify the form by themselves due to the use of hard coding to generate electronic voucher forms in related technologies.
[0078] Based on the above embodiments and optional embodiments, the present invention proposes an optional implementation mode: Figure 4 is a flow chart of an optional method for generating an electronic voucher form according to an embodiment of the present invention, such as Figure 4 As shown, the method includes:
[0079] Step S1, data model design: design the target JSON metadata structure;
[0080] Step S2, form generation engine: developing a dynamic programming language (JavaScript) engine to generate a dynamic form according to the above target JSON metadata structure;
[0081] Among them, the configuration of the dynamic form includes at least the field name, description, type, and preset verification rules. When the back-end server modifies the initial user form, it renders the corresponding form fields (renders the JSON metadata in the initial user form) according to the configuration of the dynamic form, and loads the verification method according to the configured preset verification rules.
[0082] Step S3, configure the interface: use the application program interface API, specifically design a management interface for the RESTful API protocol, and support obtaining, updating and deleting the JSON metadata of the initial user form.
[0083] Among them, the back-end server will perform dynamic JSON table configuration of different dynamic forms at the background interface. After the configuration is completed, it will be sent to the front-end device. The front-end device will reload the rendering to take effect, thereby achieving the effect of automatic generation of the target form page.
[0084] Step S4, verification mechanism: embed preset verification rules in the target JSON metadata structure to ensure that the data submitted by the generated dynamic form complies with the defined verification rules.
[0085] Among them, the front-end device will pre-develop corresponding preset verification rules, such as field length, regular verification, whether it is required, etc., and perform binding verification according to the actual loaded form configuration.
[0086] Through the above steps S1 to S4, development efficiency can be improved, hard coding requirements can be reduced, and developers do not need to frequently modify the code, saving time and human resources. The flexibility and maintainability of form modification can also be increased. The form page can be dynamically configured through the JSON metadata field, which can quickly respond to changes in business requirements and enhance the flexibility and maintainability of the system. The user experience can also be improved, the dynamic generation and adjustment of the form page can be realized, and a more flexible and personalized user experience can be provided. At the same time, the data validity can be ensured. The built-in verification mechanism ensures that the data entered by the user meets expectations, improving data quality and security.
[0087] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards in the relevant regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0088] In this embodiment, an electronic voucher form generating device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the terms "module" and "device" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0089] According to an embodiment of the present invention, there is also provided an apparatus embodiment for implementing the above-mentioned electronic voucher form generation method. Figure 5 is a schematic diagram of the structure of an electronic voucher form generating device according to an embodiment of the present invention. Figure 5 As shown, the electronic voucher form generating device comprises: an acquisition module 501, an extraction module 502, a dynamic form generating module 503, an update module 504 and a target form page generating module 505, wherein:
[0090] The acquisition module 501 is used to obtain form change information in response to the form change request of the electronic voucher;
[0091] An extraction module 502, connected to the acquisition module 501, is used to extract the first JSON metadata in the form change information;
[0092] A dynamic form generation module 503, connected to the extraction module 502, is used to generate a dynamic form based on the first JSON metadata;
[0093] The updating module 504 is connected to the dynamic form generating module 503 and is used to transmit the dynamic form to the backend server, so that the backend server updates the JSON metadata in the initial user form based on the dynamic form to obtain the second JSON metadata;
[0094] The target form page generating module 505 is connected to the updating module 504, and is used for receiving the target form data generated by the backend server based on the second JSON metadata, and performing page rendering based on the target form data to generate the target form page.
[0095] It should be noted that the above modules can be implemented by software or hardware. For example, for the latter, it can be implemented in the following ways: the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0096] It should be noted that the acquisition module 501, the extraction module 502, the dynamic form generation module 503, the update module 504 and the target form page generation module 505 correspond to steps S102 to S110 in the embodiment, and the examples and application scenarios implemented by the modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the modules as part of the device can be run in a computer terminal.
[0097] According to an embodiment of the present invention, another device embodiment for implementing the above-mentioned electronic voucher form generation method is also provided. Figure 6 is a schematic diagram of the structure of another electronic voucher form generating device according to an embodiment of the present invention. Figure 6 As shown, the electronic voucher form generating device comprises: a receiving module 601, an updating module 602, a target form data generating module 603 and a target form page generating module 604, wherein:
[0098] A receiving module 601 is used to receive a dynamic form from a front-end device, wherein the dynamic form is generated based on the first JSON metadata, and is connected to the receiving module 601, and the first JSON metadata is extracted by the front-end device from the form change information corresponding to the electronic voucher;
[0099] The updating module 602 is connected to the receiving module 601 and is used to update the JSON metadata in the initial user form based on the dynamic form to obtain the second JSON metadata;
[0100] A target form data generating module 603, connected to the updating module 602, is used to generate target form data based on the second JSON metadata;
[0101] The target form page generating module 604 is connected to the target form data generating module 603 and is used to send the target form data to the front-end device so that the front-end device can render the page based on the target form data and generate the target form page.
[0102] It should be noted that the above modules can be implemented by software or hardware. For example, for the latter, it can be implemented in the following ways: the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0103] It should be noted that the receiving module 601, the updating module 602, the generating target form data module 603 and the generating target form page module 604 correspond to steps S202 to S208 in the embodiment, and the examples and application scenarios implemented by the modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above embodiment. It should be noted that the modules as part of the device can be run in a computer terminal.
[0104] According to an embodiment of the present invention, another device embodiment for implementing the above-mentioned electronic voucher form generation method is also provided. Figure 7 is a schematic diagram of the structure of another electronic voucher form generating device according to an embodiment of the present invention. Figure 7 As shown, the electronic voucher form generating device comprises: an acquisition module 701, an extraction module 702, a dynamic form generating module 703, an update module 704, a target form data generating module 705 and a target form page generating module 706, wherein:
[0105] Acquisition module 701, used for the front-end device to respond to the form change request of the electronic voucher and acquire the form change information;
[0106] An extraction module 702, connected to the acquisition module 701, is used for the front-end device to extract the first JSON metadata in the form change information;
[0107] The dynamic form generation module 703 is connected to the extraction module 702 and is used for the front-end device to generate a dynamic form based on the first JSON metadata and transmit the dynamic form to the back-end server;
[0108] An updating module 704, connected to the dynamic form generating module 703, is used for the backend server to update the JSON metadata in the initial user form based on the dynamic form to obtain a second JSON metadata;
[0109] The target form data generating module 705 is connected to the updating module 704 and is used for the back-end server to generate the target form data based on the second JSON metadata and send the target form data to the front-end device;
[0110] The target form page generation module 706 is connected to the target form data generation module 705 and is used for the front-end device to render the page based on the target form data to generate the target form page.
[0111] It should be noted that the above modules can be implemented by software or hardware. For example, for the latter, it can be implemented in the following ways: the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0112] It should be noted that the acquisition module 701, extraction module 702, dynamic form generation module 703, update module 704, target form data generation module 705 and target form page generation module 706 correspond to steps S302 to S312 in the embodiment, and the examples and application scenarios implemented by the modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above embodiment. It should be noted that the modules as part of the device can be run in a computer terminal.
[0113] It should be noted that the optional or preferred implementation of this embodiment can refer to the relevant description in the embodiment, which will not be repeated here.
[0114] The above-mentioned electronic voucher form generation device may also include a processor and a memory. The above-mentioned acquisition module 701, extraction module 702, dynamic form generation module 703, update module 704, target form data generation module 705 and target form page generation module 706 are all stored in the memory as program modules, and the processor executes the above-mentioned program modules stored in the memory to realize corresponding functions.
[0115] The processor includes a kernel, which retrieves the corresponding program module from the memory. The kernel may be one or more. The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. The memory includes at least one memory chip.
[0116] According to an embodiment of the present application, an embodiment of a non-volatile storage medium is also provided. Optionally, in this embodiment, the non-volatile storage medium includes a stored program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute any of the above-mentioned electronic voucher form generation methods.
[0117] Optionally, in this embodiment, the non-volatile storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group, and the non-volatile storage medium includes a stored program.
[0118] Optionally, when the program is running, the device where the non-volatile storage medium is located is controlled to perform the following functions: in response to a form change request of an electronic certificate, obtain form change information; extract the first JSON metadata in the form change information; generate a dynamic form based on the first JSON metadata; transmit the dynamic form to a back-end server, so that the back-end server updates the JSON metadata in the initial user form based on the dynamic form to obtain a second JSON metadata; receive target form data generated by the back-end server based on the second JSON metadata, and perform page rendering based on the target form data to generate a target form page.
[0119] According to an embodiment of the present application, an embodiment of a processor is also provided. Optionally, in this embodiment, the processor is used to run a program, wherein the program executes any of the above-mentioned electronic voucher form generation methods when running.
[0120] According to an embodiment of the present application, an embodiment of a computer program product is also provided. Optionally, in this embodiment, the computer program product includes a computer program, and when the computer program is executed by a processor, the computer program implements any of the steps of the electronic voucher form generation method.
[0121] Optionally, the above-mentioned computer program product, when executed on a data processing device, is suitable for executing a program initialized with the following method steps: obtaining form change information in response to a form change request of an electronic certificate; extracting first JSON metadata in the form change information; generating a dynamic form based on the first JSON metadata; transmitting the dynamic form to a back-end server, so that the back-end server updates the JSON metadata in the initial user form based on the dynamic form to obtain second JSON metadata; receiving target form data generated by the back-end server based on the second JSON metadata, and performing page rendering based on the target form data to generate a target form page.
[0122] An embodiment of the present invention provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the following steps are implemented: in response to a form change request of an electronic voucher, form change information is obtained; first JSON metadata in the form change information is extracted; a dynamic form is generated based on the first JSON metadata; the dynamic form is transmitted to a back-end server, so that the back-end server updates the JSON metadata in an initial user form based on the dynamic form to obtain second JSON metadata; target form data generated by the back-end server based on the second JSON metadata is received, and a page is rendered based on the target form data to generate a target form page.
[0123] The above sequence of the embodiments of the present invention is for description only and does not represent the superiority or inferiority of the embodiments.
[0124] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0125] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the above modules can be a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, modules or indirect coupling or communication connection of modules, which can be electrical or other forms.
[0126] The modules described above as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0127] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of software functional modules.
[0128] If the above-mentioned integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable non-volatile storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a non-volatile storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the various embodiments of the present invention. The aforementioned non-volatile storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0129] The above are only preferred embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for generating an electronic voucher form, characterized in that: include: Responding to a form change request of the electronic voucher, obtaining form change information; Extracting the first JSON metadata in the form change information; Generate a dynamic form based on the first JSON metadata; The dynamic form is transmitted to a backend server, so that the backend server updates the JSON metadata in the initial user form based on the dynamic form to obtain second JSON metadata; The target form data generated by the back-end server based on the second JSON metadata is received, and a page is rendered based on the target form data to generate a target form page.
2. The method according to claim 1, characterized in that The generating a dynamic form based on the first JSON metadata includes: Constructing an initial JSON metadata structure, wherein the fields in the initial JSON metadata structure include at least one of the following: user registration, form title, and field array; Constructing a container element, wherein the container element is an extension field for the initial JSON metadata structure, and the extension field is used to indicate a field different from user registration, form title, and field array; Inserting the container element into the initial JSON metadata structure to generate a target JSON metadata structure; The dynamic form is generated based on the first JSON metadata and the target JSON metadata structure.
3. The method according to claim 2, characterized in that The generating the dynamic form based on the first JSON metadata and the target JSON metadata structure includes: Obtain the identifier in the first JSON metadata; Based on the identifier, the first JSON metadata is input into the target JSON metadata structure to generate the dynamic form.
4. The method according to claim 1, characterized in that The step of transmitting the dynamic form to a backend server comprises: Configure the application program interface; The dynamic form is linked to the backend server based on the application program interface.
5. The method according to claim 3, characterized in that: Based on the identifier, inputting the first JSON metadata into the target JSON metadata structure to generate the dynamic form, the method further includes: Obtaining a preset validation rule corresponding to the target JSON metadata structure, wherein the preset validation rule at least includes field length and / or whether it is a required item; Determine whether the first JSON metadata complies with the preset verification rule; In the case where the first JSON metadata meets the preset verification rule, based on the identifier, the first JSON metadata is input into the target JSON metadata structure to generate the dynamic form.
6. The method according to claim 5, characterized in that The method further comprises: When the first JSON metadata does not conform to the preset verification rule, an error prompt message is generated.
7. A method for generating an electronic voucher form, characterized in that: include: Receiving a dynamic form from a front-end device, wherein the dynamic form is generated based on first JSON metadata, and the first JSON metadata is extracted by the front-end device from form change information corresponding to the electronic voucher; Based on the dynamic form, the JSON metadata in the initial user form is updated to obtain second JSON metadata; Generate target form data based on the second JSON metadata; The target form data is sent to the front-end device, so that the front-end device performs page rendering based on the target form data to generate a target form page.
8. The method according to claim 7, characterized in that The updating of the JSON metadata in the initial user form based on the dynamic form to obtain the second JSON metadata includes: The JSON metadata in the initial user form is updated based on the first JSON metadata in the dynamic form to obtain the second JSON metadata, wherein the updating includes at least one of the following: adding, replacing, and deleting.
9. A method for generating an electronic voucher form, characterized in that: include: The front-end device obtains form change information in response to the form change request of the electronic voucher; The front-end device extracts the first JSON metadata in the form change information; The front-end device generates a dynamic form based on the first JSON metadata, and transmits the dynamic form to the back-end server; The back-end server updates the JSON metadata in the initial user form based on the dynamic form to obtain second JSON metadata; The back-end server generates target form data based on the second JSON metadata, and sends the target form data to the front-end device; The front-end device performs page rendering based on the target form data to generate a target form page.
10. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the electronic voucher form generation method described in any one of claims 1 to 9.
