CN-115455013-B - Method, system, computer equipment and medium for automatically updating dynamic form
Abstract
The invention discloses a method, a system, a computer device and a medium for automatically updating a dynamic form, wherein the method applied to a browser in one embodiment comprises the steps of responding to form starting operation of a user side, sending a resource request instruction to a front-end server, acquiring resources from the front-end server, analyzing and executing the resources, triggering a form engine to acquire form unit data, setting an event monitoring function according to the form unit data, generating a dynamic form code, running the dynamic form code, presenting a visual dynamic form, triggering the event monitoring function, responding to form editing operation of the user side, modifying the form unit data, generating an editing triggering signal, monitoring the event monitoring function, transmitting the editing triggering signal to the front-end server, and calling a data interface of a back-end server through the front-end server to modify the form unit data stored in a database. The embodiment can dynamically update the table unit data stored in the database through the event monitoring function, and has practical application value.
Inventors
- LI WEIHUA
Assignees
- 京东方科技集团股份有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20210609
Claims (15)
- 1. A method for automatically updating a dynamic form, applied to a browser, comprising the steps of: Transmitting a resource request instruction to a front-end server in response to form starting operation of a user side, and acquiring resources from the front-end server; analyzing and executing the resource, triggering a form engine to obtain first form unit data, executing the resource triggering form engine for the browser, requesting a front-end server by the form engine, calling a second form unit data stored in a database and read by a data interface of a back-end server by the front-end server, and caching the second form unit data in the browser, the second table unit data is structured data and comprises at least one object, each object comprises at least one key value pair, and each key value pair comprises an attribute and a value; setting an event monitoring function according to the first table unit data and generating a dynamic table code; Running the dynamic form code to present a visual dynamic form and triggering the event monitoring function; The first table unit data is modified and an editing trigger signal is generated in response to the form editing operation of the user side, the event monitoring function monitors and transmits the editing trigger signal to the front-end server, and the front-end server calls a data interface of the back-end server to modify the second table unit data stored in the database; The editing trigger signal comprises a preset structured data editing package, the structured data editing package is used for representing data change caused by the form editing operation, the form editing operation of the response user side modifies the first form unit data and generates an editing trigger signal, and the event monitoring function monitors and transmits the editing trigger signal to the front-end server further comprises: the event monitoring function monitors the editing trigger signal, caches the structured data editing package of the editing trigger signal in the browser, and sends all the structured data editing packages within the preset interval time to the front-end server according to the preset interval time.
- 2. The method of claim 1, wherein the setting an event listening function and generating a dynamic form code based on the first form element data further comprises: setting an event monitoring function according to the data structure of the first table unit data; And generating dynamic form codes according to the data structure of the first form unit data.
- 3. The method of claim 2, wherein the setting an event listening function according to the data structure of the first table unit data further comprises: dividing according to a data hierarchy relation of the first table unit data according to a preset element structure, wherein the preset element structure comprises a parent element and nested child elements, and the first table unit data comprises at least one parent element; And setting the event monitoring function on the parent element, responding to the browser to run the dynamic form code to trigger the event monitoring function, and transmitting an monitored editing trigger signal generated by the browser responding to the form editing operation of the user side to the front-end server.
- 4. The method of claim 2, wherein generating dynamic form code from the data structure of the first form element data further comprises: Traversing the object included in the first table unit data and the key value pair included in the object according to the structured data of the first table unit data and generating a corresponding dynamic table code.
- 5. The method of claim 1, wherein the structured data editing package comprises: First structured data comprising a first edit key value pair for characterizing a first form editing operation, said first form editing operation modifying a value of an existing key value pair of an existing object of said first form element data on a visualized dynamic form presented by said browser by said user side, said first edit key value pair comprising a first content key value pair of said modified attribute and/or said value, and a first coordinate key value pair characterizing a coordinate position of the first content key value pair; Or alternatively The second structured data comprises a second editing key value pair, which is used for representing a second form editing operation, wherein the second form editing operation is to newly add a key value pair of an existing object of the first form unit data and the attribute and the value of the key value pair on a visual dynamic form presented by the browser by the user side, and the second editing key value pair comprises a newly added second content key value pair and a second coordinate key value pair representing the coordinate position of the second content key value pair; Or alternatively And the third structured data comprises a third editing key value pair, which is used for representing a third form editing operation, wherein the third form editing operation is that the user side newly adds an object of the first form unit data, at least one key value pair of the object and the attribute and the value of the key value pair on a visual dynamic form presented by the browser, the third editing key value pair comprises a newly added third content key value pair and a third coordinate key value pair representing the coordinate position of the third content key value pair, the third content key value pair comprises nested sub-content key value pairs, and the third coordinate key value pair comprises nested sub-coordinate key value pairs corresponding to the sub-content key value pairs.
- 6. The method of claim 5, wherein the structured data edit package is digitally signed and asymmetrically encrypted using a pre-set encryption function.
- 7. The method of claim 1, wherein after said modifying said first form element data and generating an edit trigger in response to a form edit operation at a user side, said event listening function listens for and transmits said edit trigger to said front-end server, said method further comprises: And carrying out data statistics by using a preset callback function and outputting statistical data.
- 8. The method of any of claims 1-7, wherein the dynamic form comprises one or more of a text box, a multi-line text box, a password box, a hidden field, a check box, a radio box, a file upload box, and a drop down selection box.
- 9. A method for automatically updating a dynamic form, applied to a front-end server, comprising the steps of: responding to a resource request instruction sent by a browser, sending the stored resource to the browser, so that the browser analyzes and executes the resource, and triggering a form engine; A data interface of a back-end server is called in response to a request of the form engine to read second form unit data stored in a database and send the second form unit data to the browser, so that the form engine acquires first form unit data and stores the first form unit data in the browser, an event monitoring function is set according to the first form unit data, a dynamic form code is generated, the browser runs the dynamic form code to present a visual dynamic form and trigger the event monitoring function, the second form unit data is structured data and comprises at least one object, each object comprises at least one key value pair, and each key value pair comprises an attribute and a value; The method comprises the steps of responding to a received editing trigger signal to call a data interface of a back-end server to modify second table unit data stored in a database, wherein the editing trigger signal is generated by a browser responding to a form editing operation of a user side and monitored and transmitted by an event monitoring function, the editing trigger signal comprises a preset structured data editing packet, the structured data editing packet is used for representing data change caused by the form editing operation, the editing trigger signal is monitored by the event monitoring function and the structured data editing packet of the editing trigger signal is cached in the browser, and all the structured data editing packets within the preset interval time are transmitted according to the preset interval time.
- 10. A method for automatically updating a dynamic form, applied to a back-end server, comprising the steps of: Responding to the call of a front-end server, reading second table unit data stored in a database by using a data interface connected with the database and transmitting the second table unit data to the front-end server, transmitting the second table unit data to a browser by the front-end server and caching the second table unit data into first table unit data, so that a form engine triggered by the browser sets an event monitoring function according to the first table unit data and generates a dynamic form code, the browser runs the dynamic form code to present a visual dynamic form and trigger the event monitoring function, the second table unit data is structured data and comprises at least one object, each object comprises at least one key value pair, and each key value pair comprises an attribute and a value; And responding to the call of the front-end server, modifying the second table unit data stored in the database by using a data interface connected with the database according to the modified first table unit data output by the browser, wherein the modified first table unit data is modified by the browser in response to the form editing operation of the user side, and generates an editing trigger signal, the editing trigger signal is monitored by the event monitoring function and transmitted to the front-end server, the editing trigger signal comprises a preset structured data editing packet, the structured data editing packet is used for representing the data change caused by the form editing operation, the editing trigger signal is monitored by the event monitoring function and the structured data editing packet of the editing trigger signal is cached in the browser, and all the structured data editing packets within the preset interval time are transmitted to the front-end server according to the preset interval time.
- 11. A method for automatically updating a dynamic form, applied to a database, comprising: Outputting stored second table unit data in response to a data request of a data interface of a back-end server, so that the back-end server transmits the second table unit data to a front-end server and to a browser through the front-end server and is cached as first table unit data, so that the browser acquires and caches the first table unit data, so that a form engine triggered by the browser sets an event monitoring function according to the first table unit data and generates a dynamic form code, so that the browser runs the dynamic form code to present a visual dynamic form and trigger the event monitoring function, the second table unit data is structured data and comprises at least one object, each object comprises at least one key value pair, and each key value pair comprises an attribute and a value; The method comprises the steps of responding to an update request of a data interface of a back-end server, updating stored second table unit data according to modified first table unit data sent by the back-end server, wherein the modified first table unit data is modified by a browser in response to a table editing operation of a user side, generating an editing trigger signal, monitoring by an event monitoring function, transmitting the editing trigger signal to a front-end server, and transmitting the editing trigger signal to the back-end server through the front-end server, the editing trigger signal comprises a preset structured data editing package, the structured data editing package is used for representing data change caused by the table editing operation, the editing trigger signal is monitored by the event monitoring function, the structured data editing package of the editing trigger signal is cached in the browser, and all structured data editing packages within a preset interval time are transmitted to the front-end server according to the preset interval time.
- 12. The method for automatically updating the dynamic form is applied to a user terminal and is characterized by comprising the following steps: Triggering a browser according to an input form starting operation, so that the browser sends a resource request instruction to a front-end server, acquires resources from the front-end server, analyzes and executes the resources, triggers a form engine to acquire first form unit data, enables the form engine to set an event monitoring function according to the first form unit data and generate a dynamic form code, enables the browser to run the dynamic form code to present a visual dynamic form and trigger the event monitoring function, enables the first form unit data to be structured data, and enables the browser to execute the resource trigger form engine, requests a front-end server by the form engine and calls second form unit data stored in a database and read by a data interface of a back-end server through the front-end server, wherein the second form unit data comprises at least one object, each object comprises at least one key value pair, and each key value pair comprises an attribute and a value; Triggering a browser according to an input form editing operation, so that the browser modifies the first form unit data and generates an editing trigger signal, monitoring and transmitting the editing trigger signal to the front-end server by the event monitoring function, calling a data interface of the back-end server by the front-end server, and updating second form unit data stored in the database according to the modified first form unit data, wherein the editing trigger signal comprises a preset structured data editing packet, the structured data editing packet is used for representing data change caused by the form editing operation, the editing trigger signal is monitored by the event monitoring function and transmits all the structured data editing packets of the editing trigger signal to the front-end server in a buffering mode according to a preset interval time, and all the structured data editing packets of the editing trigger signal are transmitted to the front-end server according to the preset interval time.
- 13. A dynamic form automatic update system, comprising a user side, a browser, a front-end server, a back-end server, and a database, wherein the browser is configured to: Transmitting a resource request instruction to a front-end server in response to form starting operation of a user side, and acquiring resources from the front-end server; Analyzing and executing the resource, triggering a form engine to acquire first form unit data, wherein the first form unit data is the browser executing the resource triggering form engine, requesting a front-end server by the form engine, calling second form unit data stored in a database and read by a data interface of a back-end server through the front-end server, and caching the second form unit data in the browser, wherein the second form unit data is structured data and comprises at least one object, each object comprises at least one key value pair, and each key value pair comprises an attribute and a value; setting an event monitoring function according to the first table unit data and generating a dynamic table code; Running the dynamic form code to present a visual dynamic form and triggering the event monitoring function; The first table unit data is modified and an editing trigger signal is generated in response to the form editing operation of the user side, the event monitoring function monitors and transmits the editing trigger signal to the front-end server, and the front-end server calls a data interface of the back-end server to modify the second table unit data stored in the database; The editing trigger signal comprises a preset structured data editing package, the structured data editing package is used for representing data change caused by the form editing operation, the form editing operation of the response user side modifies the first form unit data and generates an editing trigger signal, and the event monitoring function monitors and transmits the editing trigger signal to the front-end server further comprises: the event monitoring function monitors the editing trigger signal, caches the structured data editing package of the editing trigger signal in the browser, and sends all the structured data editing packages within the preset interval time to the front-end server according to the preset interval time.
- 14. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program, when executed by a processor, implementing the method of any of claims 1-8; Or alternatively Which when executed by a processor implements the method of claim 9; Or alternatively Which when executed by a processor implements the method of claim 10; Or alternatively Which when executed by a processor implements the method of claim 11; Or alternatively Which when executed by a processor implements the method of claim 12.
- 15. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that, The processor implementing the method of any one of claims 1-8 when executing the program; Or alternatively The processor implementing the method of claim 9 when executing the program; Or alternatively The processor implementing the method of claim 10 when executing the program; Or alternatively The processor implementing the method of claim 11 when executing the program; Or alternatively The processor, when executing the program, implements the method of claim 12.
Description
Method, system, computer equipment and medium for automatically updating dynamic form Technical Field The present invention relates to the field of internet technologies, and in particular, to a method for automatically updating a dynamic form, a system for automatically updating a dynamic form, a computer storage medium, and a computer device. Background In the prior art, the application of dynamic forms is becoming more and more popular, however, the problems of undefined requirements, easy change of requirements and the like exist in the development process of the traditional dynamic forms, so that the problems of large-scale modification of form codes developed in the prior art exist, and the problems of workload increase and development period extension appear. Therefore, how to implement automatic update of dynamic forms is a current urgent problem to be solved. Disclosure of Invention To solve at least one of the above problems, a first embodiment of the present invention provides a method for automatically updating a dynamic form, which is applied to a browser, and includes: Transmitting a resource request instruction to a front-end server in response to form starting operation of a user side, and acquiring resources from the front-end server; Analyzing and executing the resource, triggering a form engine to acquire first form unit data, wherein the first form unit data is the browser executing the resource triggering form engine, requesting a front-end server by the form engine, calling second form unit data stored in a database and read by a data interface of a back-end server through the front-end server, and caching the second form unit data in the browser, wherein the second form unit data is structured data and comprises at least one object, each object comprises at least one key value pair, and each key value pair comprises an attribute and a value; setting an event monitoring function according to the first table unit data and generating a dynamic table code; Running the dynamic form code to present a visual dynamic form and triggering the event monitoring function; And responding to the form editing operation of the user side, modifying the first form unit data and generating an editing trigger signal, monitoring and transmitting the editing trigger signal to the front-end server by the event monitoring function, and calling a data interface of the back-end server by the front-end server to modify the second form unit data stored in the database. In a specific embodiment, the setting an event listening function according to the first table unit data and generating a dynamic table code further includes: setting an event monitoring function according to the data structure of the first table unit data; And generating dynamic form codes according to the data structure of the first form unit data. In a specific embodiment, the setting an event listening function according to the data structure of the first table unit data further includes: dividing according to a data hierarchy relation of the first table unit data according to a preset element structure, wherein the preset element structure comprises a parent element and nested child elements, and the first table unit data comprises at least one parent element; And setting the event monitoring function on the parent element, responding to the browser to run the dynamic form code to trigger the event monitoring function, and transmitting an monitored editing trigger signal generated by the browser responding to the form editing operation of the user side to the front-end server. In a specific embodiment, the generating the dynamic form code according to the data structure of the first table unit data further includes: Traversing the object included in the first table unit data and the key value pair included in the object according to the structured data of the first table unit data and generating a corresponding dynamic table code. In a specific embodiment, the editing trigger signal includes a preset structured data editing package, the structured data editing package is used for characterizing a data change caused by the form editing operation, the modifying the first table unit data and generating an editing trigger signal in response to the form editing operation of the user side, and the event monitoring function monitors and transmits the editing trigger signal to the front-end server further includes: the event monitoring function monitors the editing trigger signal, caches the structured data editing package of the editing trigger signal in the browser, sends all the structured data editing packages within the preset interval time to the front-end server according to the preset interval time, and calls a data interface of the back-end server through the front-end server to modify second table unit data stored in the database. In a specific embodiment, the structured data editing package comprises: First structured data comprising a firs