Page management system construction method based on data driving
By using a data-driven approach to dynamically generate and render functional components of the page management system, we solve the problems of low construction efficiency and high maintenance costs of traditional page management systems, and achieve more efficient and stable page management.
Patent Information
- Application Number
- CN202411086708.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-10-29
AI Technical Summary
The traditional page management system based on static rules and manual configuration has low construction efficiency, poor quality, high maintenance costs, and heavy workload. It is difficult to adapt to the needs of enterprise scale expansion and business complexity.
Using a data-driven approach, the browser sends a request to the server, reads the database and converts fields into required data types, generates JSON format data structures and server interfaces, and dynamically generates and renders functional components to achieve automatic Render the page.
It reduces maintenance costs and workload, improves system reliability and stability, adapts to different business needs and environmental changes, and improves the construction efficiency and quality of the page management system.
Smart Images

Figure CN118861402A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of page management, and in particular to a method for constructing a page management system based on data drive. Background Art
[0002] With the rapid development of the radio and television industry, page management systems have become an important tool for enterprises and organizations in the radio and television industry to manage their business and information. Page management systems can provide users with a variety of functions and services, including information publishing, data management, user management, etc., to help enterprises conveniently manage and operate their businesses. However, with the continuous expansion of enterprise scale and the increasing complexity of business, traditional page management systems based on static rules and manual configuration are facing more and more challenges. Traditional page management systems based on static rules and manual configuration have low construction efficiency and poor quality. Page adjustments require manual modification and configuration, which has high maintenance costs and heavy workload. Summary of the invention
[0003] The purpose of the present invention is to provide a method for constructing a page management system based on data drive to solve the above technical problems;
[0004] The technical problem solved by the present invention can be achieved by adopting the following technical solutions:
[0005] A method for constructing a page management system based on data drive, comprising:
[0006] Step S1, reading a database according to a request sent by a browser to a server, and converting and classifying fields of the database into data types that meet the requirements of the browser according to the request of the browser;
[0007] Step S2, analyzing the fields of the target type in the database, and generating a corresponding JSON format data structure and a server interface according to the analysis results;
[0008] Step S3, the browser side dynamically generates and renders functional components according to the data structure in JSON format obtained from the server side.
[0009] Preferably, in step S1, when the browser accesses at least one access page including user management, data management, search, authorization management and log recording, the browser sends a request to the server, and the server reads the corresponding database according to the access page and divides the fields of the database into retrievable, modifiable and viewable data types.
[0010] Preferably, step S1 comprises:
[0011] Step S11, the browser side obtains the routing parameters of the accessed page by returning the page address, and sends a request to the server side to transfer the routing parameters;
[0012] Step S12, the server selects the corresponding database according to the routing parameters;
[0013] Step S13, the server traverses the fields of the database, divides the fields into searchable, modifiable and viewable, and classifies the searchable fields into a search data set, the viewable fields into a view data set, and the modifiable fields into a modify data set;
[0014] Step S14, the server converts the field types of the retrieval data set, the viewing data set and the modification data set from the field types of the database to the field types that meet the requirements of the browser through the data dictionary, and converts the field names in the database to the field names used by the browser, and converts the Chinese names of the database fields to the Chinese names used by the browser.
[0015] Preferably, in step S2, the target type in the database is analyzed as a field that is retrievable, modifiable and viewable, and analysis is performed based on the field type, and a data structure in the JSON format that supports rendering by the functional component on the browser side is generated on the server side; and when the field type is retrievable or modifiable, the server interface is generated based on the corresponding structured query language.
[0016] Preferably, in step S3, the browser obtains the returned data structure in JSON format, parses the data content, and matches and renders the functional components according to each data type; the DOM elements of the functional components and the data of the functional components are loaded and rendered separately, including:
[0017] Step S31, first load and render the DOM element of the functional component;
[0018] Step S32, the loaded DOM element is directly injected into the main container of the accessed page;
[0019] Step S33, the browser requests data from the server by way of callback, and applies the returned data to the corresponding functional component to complete rendering.
[0020] Preferably, in step S3, the server returns data in encrypted form, and the data is decrypted and rendered on the browser side. If the field is a data type that has generated the server interface, the functional component on the browser side communicates data with the server by calling the method of the server interface.
[0021] Preferably, in step S2, the fields reserved for the retrieval data set and the modification data set include an interface path field, a retrieval field, a list field, and a value field, the structured query language for editing and retrieval is converted into code executable by the server and encapsulated as an interface, the interface path of the interface is passed into the interface path field, and the retrieval configuration parameters are passed into the retrieval field;
[0022] The field reserved for viewing the data set is an option field, and the option field is used to pass in a corresponding configuration object according to a function.
[0023] Preferably, in step S3, the browser receives the data structure in JSON format, creates a search container, generates a first rendering module instance corresponding to the search data set on the browser, traverses and renders the search data set, all data of the search data set are used as search elements, and the functional component is rendered according to the field type of the search element;
[0024] After the rendering of the retrieval data set is completed, the browser generates a first method. The first method generates a server request template by checking the interface path. The parameters of the retrieval field are bidirectionally bound to the functional component. The server request template sends a request to the server according to the parameters of the retrieval field. The server accepts the request and performs a retrieval operation on the database, and returns the retrieved data to the browser. The browser stores the retrieved data in a list of the first rendering module.
[0025] Preferably, in step S3, the browser side receives the data structure in JSON format, and generates a second rendering module instance corresponding to the viewing data set on the browser side by creating a viewing container, wherein the viewing data set is a list element, and the viewing data set is traversed to read the identification field as the keyword of the list, and the name field is read as the header of the list; the list field of the first rendering module is read and the data is traversed, and the display of the actual data of the second rendering module is completed according to the association of the keywords; when the option field of the viewing data set is not empty, the function button is loaded according to the target value of the option field.
[0026] Preferably, in step S3, the browser receives the data structure in JSON format, creates a modification container, generates a third rendering module instance corresponding to the modified data set on the browser, traverses the modified data set, uses all data of the modified data set as modifiable elements, renders the functional component according to the field type of the modifiable element, and generates a submit button after the functional component is rendered;
[0027] After the modified data set is rendered, the browser generates a second method, which is bound to the submit button, reads the interface path field to generate the server request template, and the parameters of the search field are bidirectionally bound to the functional component. By clicking the submit button, the server request template is called to send a request to the server, and the server accepts the request and performs a modification operation on the database.
[0028] The beneficial effects of the present invention are as follows: due to the adoption of the above technical scheme, the present invention forms a data structure in JSON format through the operation of the database by the server side and transmits it to the browser side, and the browser side judges and renders the data to realize automatic rendering of the page, thereby solving the limitations brought by the traditional page management system based on static rules and manual configuration, reducing maintenance costs and workload, and improving the reliability and stability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A schematic diagram of the steps of a method for constructing a data-driven page management system according to an embodiment of the present invention;
[0030] Figure 2 This is a schematic diagram of step S1 in an embodiment of the present invention;
[0031] Figure 3 This is a schematic diagram of step S3 in an embodiment of the present invention;
[0032] Figure 4 The flowchart of the interaction between the browser and the server in the embodiment of the present invention. DETAILED DESCRIPTION
[0033] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 are within the scope of protection of the present invention.
[0034] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0035] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, but they are not intended to limit the present invention.
[0036] A data-driven page management system construction method, such as Figures 1 to 4 As shown, including
[0037] Step S1, reading database 3 according to the request sent by browser 1 to server 2, and converting and classifying the fields of database 3 into data types that meet the requirements of browser 1 according to the request of browser 1;
[0038] Step S2, analyzing the fields of the target type in the database 3, and generating a corresponding JSON format data structure and a server interface according to the analysis results;
[0039] Step S3, the browser 1 dynamically generates and renders the functional components according to the data structure in JSON format obtained from the server 2.
[0040] Specifically, the present invention provides a method for constructing a page management system based on data-driven, the method comprising: reading a database 3 according to a request sent by a browser 1 to a server 2, and classifying the fields of the database 3 into types that meet the requirements of the browser 1; analyzing the three types of fields in the database 3, namely, searchable, modifiable, and viewable, and generating a corresponding JSON data structure and a server interface; the browser 1 completes the rendering of the page component according to the JSON data structure to realize the construction of a page management system based on data-driven. The present invention can effectively improve the construction efficiency and quality of the web management system.
[0041] Preferably, the data-driven page management system of the present invention collects and analyzes a large amount of real-time data, automatically adjusts the configuration and behavior of the system to adapt to different business needs and environmental changes, and can implement dynamic page configuration according to the dynamic changes of data, thereby improving the flexibility, efficiency and performance of the system.
[0042] The present invention forms a data structure in JSON format through the operation of the server 2 on the database 3 and transmits it to the browser 1. The browser 1 judges and renders the data to realize automatic rendering of user management, data management, search, authorization management and log record pages, which solves the limitations brought by traditional page management systems based on static rules and manual configuration, reduces maintenance costs and workload, and improves the reliability and stability of the system.
[0043] In a preferred embodiment, in step S1, when the browser 1 accesses an access page including at least one of user management, data management, search, authorization management and log recording, the browser 1 sends a request to the server 2, and the server 2 reads the corresponding database 3 according to the access page and divides the fields of the database 3 into retrievable, modifiable and viewable data types.
[0044] Specifically, by reading the field information of the database 3 and converting it into a JSON data structure readable by the browser 1, user management, data management, search, authorization management and log recording are realized. The browser 1 page automatically renders the corresponding functional components according to the JSON data structure. The functional components do not need manual secondary development, thereby realizing data communication between the browser 1 and the server 2.
[0045] In a preferred embodiment, Figure 2 As shown, step S1 includes,
[0046] Step S11, the browser 1 obtains the routing parameters of the accessed page by returning the page address, and sends a request to the server 2 to pass the routing parameters;
[0047] Step S12, the server 2 selects the corresponding database 3 according to the routing parameters;
[0048] Step S13, the server 2 traverses the fields of the database 3, divides the fields into searchable, modifiable and viewable, and classifies the searchable fields into a search data set, the viewable fields into a view data set, and the modifiable fields into a modify data set;
[0049] In step S13, the server 2 converts the field types of the retrieved data set, viewed data set and modified data set from the field types of the database 3 to the field types that meet the requirements of the browser 1 through the data dictionary, and at the same time converts the field names in the database 3 to the field names used by the browser 1, and converts the Chinese names of the fields in the database 3 to the Chinese names used by the browser 1.
[0050] Specifically, the present invention uses a data-driven approach to implement pages for user management, data management, search, authorization management, and log recording.
[0051] When a user opens the management system webpage, the browser obtains the routing parameters of the current page through the window.location.href method of returning the page address. Window.location.href is a property in JavaScript that returns the URL address of the current page (the complete URL string).
[0052] Use the encryption method of SM4.encrypt to encrypt the routing parameters and pass the parameters to the server 2 through a POST request. After receiving the parameters, the server 2 decrypts the parameters through the decryption method of SM4.decrypt, and sets the parameter legitimacy program to determine the legitimacy of the parameters. After the legitimacy test passes, select the corresponding database 3 for user management, data management, search, authorization management and logging according to the parameters.
[0053] Server 2 traverses the fields of database 3 and divides the fields into searchable, modifiable and viewable fields. The searchable fields are grouped into a search data set named search_fields; the viewable fields are grouped into a view data set named grid_fields; the modifiable fields are grouped into a modify data set named form_fields.
[0054] Server 2 uses the data dictionary to convert the three data set field types of retrieval data set, viewing data set, and modification data set from database 3 field type to browser 1 field type (type), database 3 field name to browser 1 field name (id), and database 3 field Chinese name to browser 1 field Chinese name (name).
[0055] Specifically, the comparison between the field types of the database 3 and the functional components of the browser end 1 is shown in Table 1 below.
[0056] Type Control Components Hidden el-hidden Input el-input Avatar el-avatar Tab el-tab List el-select Time el-date
[0057] Table 1
[0058] Among them, "Hidden" represents a hidden field, corresponding to the hidden component "el-hidden" of the control component;
[0059] "Input" represents the input field, corresponding to the input component "el-input" of the control component;
[0060] “Avatar” represents the avatar field, corresponding to the avatar component “el-avatar” of the control component;
[0061] "Tab" represents the tab field, corresponding to the tab component "el-tab" of the control component;
[0062] "List" represents a list field, corresponding to the drop-down selection box component "el-select" of the control component;
[0063] "Time" represents the time field, corresponding to the time component "el-date" of the comparison component.
[0064] In a preferred embodiment, in step S2, the target type in the analysis database 3 is a field that is retrievable, modifiable and viewable, and analysis is performed based on the field type, and a data structure in JSON format that supports rendering of functional components on the browser side 1 is generated on the server side 2; and when the field type is retrievable or modifiable, a server interface is generated based on the corresponding structured query language.
[0065] Specifically, when a user accesses the user management, data management, search, authorization management and log recording browser-side 1 pages, the browser sends a request to the server-side 2. The server-side 2 reads the corresponding database 3 according to the accessed page, divides the data into three types: retrievable, modifiable and viewable. The three types of fields in the database 3 are analyzed and a JSON data structure is generated and returned to support the rendering of the functional components of the browser-side 1. If it is a retrievable and modifiable type field, a server-side interface will be generated according to the corresponding formatted query language (SQL statement).
[0066] To be more specific, for searchable fields and modifiable fields, a server interface will be generated based on the corresponding formatted query language. The functional components of browser 1 can communicate data with server 2 by calling the server interface, solving the problem of manual secondary development required for component rendering and communication with server 2.
[0067] In a preferred embodiment, in step S3, the browser 1 obtains the returned data structure in JSON format, parses the data content, and matches and renders the functional components according to each data type; the DOM elements of the functional components and the data of the functional components are loaded and rendered separately, such as Figure 3 As shown, including
[0068] Step S31, first load and render the DOM element of the functional component;
[0069] Step S32, the loaded DOM element is directly injected into the main container of the accessed page;
[0070] Step S33, the browser 1 requests data from the server by way of callback, and applies the returned data to the corresponding functional components to complete rendering.
[0071] Specifically, the browser 1 obtains the returned JSON data structure, parses the data content, and automatically matches and renders the functional components of the browser 1 according to the different data types. The DOM elements of the functional components and the data of the functional components are loaded separately. After the functional component DOM elements are loaded according to the JSON data structure, they are directly injected into the page body container (BODY container). The server 2 data is requested through the callback method to complete the final data rendering, which improves the user-unfriendly scenarios such as long-term white screen and no response of the page due to the slow return of data from the server 2 when the non-separated loading method is used.
[0072] In a preferred embodiment, in step S3, the server 2 returns data in encrypted form, and the data is decrypted and rendered on the browser 1. If the field is a data type that has generated a server interface, the functional component of the browser 1 communicates data with the server 2 by calling the method of the server interface.
[0073] Specifically, the present invention is aimed at the field of radio and television. Since the first priority of the radio and television field is safe broadcasting, all data returned by the server 2 are in encrypted form, and the data is decrypted and rendered on the browser 1. If it is a searchable and modifiable field, the server interface is obtained and bound to the functional component. The functional component rendered by this method realizes data communication with the server 2, which solves the problem that the component rendering and the communication with the server 2 require manual secondary development.
[0074] In a preferred embodiment, in step S2, the fields reserved for retrieving data sets and modifying data sets include an interface path field, a search field, a list field, and a value field, and the structured query language for editing and searching is converted into executable code on the server 2 and encapsulated as an interface, the interface path of the interface is passed into the interface path field, and the search configuration parameters are passed into the search field;
[0075] The fields reserved for viewing data sets are option fields, which are used to pass in corresponding configuration objects according to functions.
[0076] Specifically, the fields reserved for retrieving data sets and modifying data sets include an interface path field (apiUrl field), a search field (search field), a list field (list field) and a value field (value field). The present invention adopts a self-developed conversion program to convert the edited and retrieved SQL statements into codes that can be executed on the server 2, encapsulates the converted results into an API interface, and provides it to the browser 1 through the interface path field, and at the same time passes the retrieval configuration parameters to the retrieval field.
[0077] Preferably, the editing and searching SQL statements are converted into codes that can be directly executed on the server side through a self-developed conversion program and encapsulated into an API, so that the editing and searching operations on the database 3 can be implemented by calling the API.
[0078] The fields reserved for viewing the dataset are option fields (opt fields), which are used for different function configurations, such as linking to a new tab (target:blank,url:'...'), confirmation pop-up window (target:confirm,msg:'...',url:'...'), dialog box (target:dialog,apiUrl:'...'), downloading files (target:download,url:'...'), editing operations (target:edit), etc. After the dataset is processed, it is returned to the browser in the form of JSON data 1.
[0079] Specifically, the browser 1 receives the JSON data structure returned by the server 2, and renders the three data sets, namely, the retrieval data set, the viewing data set, and the modification data set, into corresponding modules according to the JSON data.
[0080] In a preferred embodiment, in step S3, the browser terminal 1 receives the data structure in JSON format, creates a search container, generates a first rendering module instance corresponding to the search data set on the browser terminal 1, traverses and renders the search data set, and all data of the search data set are used as search elements, and the functional component is rendered according to the field type of the search element;
[0081] After the rendering of the retrieved data set is completed, the browser 1 generates a first method. The first method generates a server request template by checking the interface path. The parameters of the retrieval field are bidirectionally bound to the functional component. The server request template sends a request to the server 2 according to the parameters of the retrieval field. The server 2 accepts the request and performs a retrieval operation on the database 3, and returns the retrieved data to the browser 1. The browser 1 stores the retrieved data in the list of the first rendering module.
[0082] Specifically, the present invention creates a search container on the browser side 1 through document.createElement("div.search_fields-container") for rendering a module for a search data set, traverses the search data set, and all data under the search data set are considered as search elements. The data of each search data set is rendered in a different manner according to its field type, for example:
[0083] If it is an input type, it is rendered as a text input box component (el-input);
[0084] If it is of date type, it is rendered as a date component (el-date);
[0085] If it is a list type, it is rendered as a drop-down box component (el-select).
[0086] After the rendering of the retrieved data set is completed, the browser 1 will generate a first method named fetchSearch method. The main function of the first method is to generate a server request template by judging the value of the interface path.
[0087] The parameters of the search field are bidirectionally bound to the functional component. When the data trigger of the functional component changes, the parameters of the search field will also change. The server-side request template sends a request to the server based on the parameters of the search field. Preferably, the request includes the parameters of the search field.
[0088] Preferably, the dynamically generated request method can request data from the server in real time based on user input, thereby improving responsiveness.
[0089] The server 2 performs a database 3 search operation according to the received search field parameters, and returns the searched data as a response to the browser 1. The browser 1 stores the searched data returned by the server 2 in a list of the first rendering module.
[0090] In a preferred embodiment, in step S3, the browser end 1 receives a data structure in JSON format, and generates a second rendering module instance corresponding to the viewing data set on the browser end 1 by creating a viewing container. The viewing data set is a list element, and the viewing data set is traversed to read the identification field as the keyword of the list, and the name field is read as the header of the list; the list field of the first rendering module is read and the data is traversed, and the actual data of the second rendering module is displayed according to the association of the identification field; when the option field of the viewing data set is not empty, the function button is loaded according to the target value of the option field.
[0091] Specifically, the present invention creates a viewing container on the browser side 1 through document.createElement("div.grid_fields-container"), which is used to render a list of the second rendering module corresponding to the viewing data set. The viewing data set is traversed, and the identification field (id) of each element therein is used as the keyword (key) of the list, and the name field (name) is used as the header of the list, thereby completing the rendering of the basic list.
[0092] The list field of the first rendering module is read and the data is traversed, and the actual data of the second rendering module is filled according to the association of the key field, so as to complete the display of the actual data of the second rendering module.
[0093] When the value of the option field of the second rendering module is not empty, different function buttons are loaded according to different target values (target values) of the option field, including:
[0094] When target is blank, read the url field to generate the jump page code and jump to the specified url;
[0095] When target is edit, jump to the third rendering module to allow users to modify related data;
[0096] When target is confirm, read the msg field to generate a secondary confirmation pop-up box, display the content of the msg field, and determine whether to execute the code in the url based on the confirmation callback;
[0097] When the target is dialog, a server request template is generated according to the interface path field, and the second rendering module field is converted to an editable type. After the editing is completed, the server request template is triggered to send data to server 2;
[0098] When target is download, read the url field to generate a download link.
[0099] Preferably, the present invention dynamically generates page elements and function buttons according to different data and requirements, so that the page can be dynamically adjusted and interacted according to business requirements.
[0100] In a preferred embodiment, in step S3, the browser terminal 1 receives the data structure in JSON format, generates a third rendering module instance corresponding to the modified data set on the browser terminal 1 by creating a modification container, traverses the modified data set, and uses all data of the modified data set as modifiable elements, renders the functional component according to the field type of the modifiable element, and generates a submit button after the functional component rendering is completed;
[0101] After the modified data set rendering is completed, the browser 1 generates a second method, the second method is bound to the submit button, the interface path field is read to generate a server request template, the parameters of the retrieval field are bidirectionally bound to the functional component, and the server request template is called by clicking the submit button to send a request to the server 2. The server 2 accepts the request and performs the modification operation on the database 3.
[0102] Specifically, the present invention generates a modification container on the browser side 1 through document.createElement("div.form_fields-container"), generates a third rendering module instance, and all data of the modified data set are used as modifiable elements. The data of each modified data set selects the rendering method according to its field type (type), for example:
[0103] If it is an input type, it is rendered as a text input box component (el-input);
[0104] If it is of date type, it is rendered as a date component (el-date);
[0105] If it is a list type, it is rendered as a drop-down box component (el-select).
[0106] After all functional components are rendered, a submit button will be generated at the bottom.
[0107] After the modified data set is rendered, the browser 1 will generate a second method named fetchSubmit. The second method is bound to the submit button. When the submit button is clicked, the second method will be triggered.
[0108] The second method reads the interface path field, generates a server request template, and binds the parameters of the search field to the functional component in a two-way manner. After clicking the submit button, the parameters of the search field are encrypted using the SM4.encrypt encryption method, and the server request template is called.
[0109] After receiving the request, server 2 decrypts and parses the data through SM4.encrypt decryption method to implement modification operations such as adding, editing, and deleting of database 3.
[0110] In a specific embodiment, the present invention includes the following steps: reading database 3 according to the request sent by browser 1 to server 2, and classifying the fields of database 3 into types that meet the requirements of browser 1; analyzing the three types of fields in database 3 that can be searched, modified, and viewed, and generating corresponding JSON data structures and server interfaces; browser 1 completes the rendering of page components according to the JSON data structure to realize the construction of a page management system based on data drive. The present invention can effectively improve the construction efficiency and quality of web management systems, such as Figure 4 As shown, the method of interaction between the browser 1 and the server 2 is:
[0111] Step 1, when accessing a page, the browser 1 sends a page configuration request to the server 2;
[0112] Step 2: Server 2 determines whether the request is legal. If so, execute step 3; otherwise, execute step 4.
[0113] Step 3, the server 2 parses the request content, reads the database 3 according to the data query request, and converts the data format into a readable form for the browser 1 after the data is returned to the server 2;
[0114] Step 4, returning the illegal request information to the browser 1.
[0115] In summary, the present invention forms a data structure in JSON format through the operation of the server 2 on the database 3 and transmits it to the browser 1. The browser 1 judges and renders the data to realize automatic rendering of user management, data management, search, authorization management and log recording pages, which solves the limitations brought by traditional page management systems based on static rules and manual configuration, reduces maintenance costs and workload, and improves the reliability and stability of the system.
[0116] The above description is only a preferred embodiment of the present invention, and does not limit the implementation mode and protection scope of the present invention. For those skilled in the art, it should be aware that all solutions obtained by equivalent substitutions and obvious changes made using the description and illustrations of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for constructing a page management system based on data drive, characterized in that: include, Step S1, reading a database (3) according to a request sent by a browser (1) to a server (2), and converting and classifying fields of the database (3) into data types that meet the requirements of the browser (1) according to the request of the browser (1); Step S2, analyzing the target type fields in the database (3), and generating a corresponding JSON format data structure and a server interface according to the analysis results; In step S3, the browser (1) dynamically generates and renders functional components according to the data structure in the JSON format obtained from the server (2).
2. The method for constructing a data-driven page management system according to claim 1, characterized in that: In step S1, when the browser (1) accesses at least one access page including user management, data management, search, authorization management and log record, the browser (1) sends a request to the server (2), and the server (2) reads the corresponding database (3) according to the access page and divides the fields of the database (3) into data types that can be searched, modified and viewed.
3. The method for constructing a data-driven page management system according to claim 2, wherein: Step S1 includes, Step S11, the browser (1) obtains the routing parameters of the accessed page by returning the page address, and sends a request to the server (2) to transfer the routing parameters; Step S12, the server (2) selects the corresponding database (3) according to the routing parameters; In step S13, the server (2) traverses the fields of the database (3), divides the fields into searchable, modifiable and viewable, and classifies the searchable fields into a search data set, the viewable fields into a view data set, and the modifiable fields into a modification data set; In step S14, the server (2) converts the field types of the retrieval data set, the viewing data set, and the modification data set from the field types of the database (3) into field types that meet the requirements of the browser (1) through the data dictionary, and simultaneously converts the field names in the database (3) into the field names used by the browser (1), and converts the Chinese names of the fields in the database (3) into the Chinese names used by the browser (1).
4. The method for constructing a data-driven page management system according to claim 1, wherein: In step S2, the target type in the database (3) is analyzed as a field that is retrievable, modifiable and viewable, and according to the field type, a data structure in the JSON format that supports the rendering of the functional component of the browser side (1) is generated on the server side (2); and when the field type is retrievable or modifiable, the server side interface is generated according to the corresponding structured query language.
5. The method for constructing a data-driven page management system according to claim 1, wherein: In step S3, the browser (1) obtains the returned data structure in JSON format, parses the data content, and matches and renders the functional components according to each data type; the DOM elements of the functional components and the data of the functional components are loaded and rendered separately, including: Step S31, first load and render the DOM element of the functional component; Step S32: The loaded DOM element is directly injected into the main container of the accessed page; In step S33, the browser (1) requests data from the server through a callback method, and applies the returned data to the corresponding functional component to complete the rendering.
6. The method for constructing a data-driven page management system according to claim 1, wherein: In step S3, the server (2) returns data in an encrypted form, and the data is decrypted and rendered on the browser (1). If the field is a data type that has generated the server interface, the functional component of the browser (1) communicates data with the server (2) by calling the method of the server interface.
7. The method for constructing a data-driven page management system according to claim 3, characterized in that: In step S2, the fields reserved in the retrieval data set and the modification data set include an interface path field, a retrieval field, a list field, and a value field. The structured query language for editing and retrieval is converted into code executable by the server (2) and encapsulated into an interface. The interface path of the interface is passed into the interface path field, and the retrieval configuration parameters are passed into the retrieval field. The field reserved for viewing the data set is an option field, and the option field is used to pass in a corresponding configuration object according to a function.
8. The method for constructing a data-driven page management system according to claim 7, characterized in that: In step S3, the browser side (1) receives the data structure in the JSON format, creates a search container, generates a first rendering module instance corresponding to the search data set on the browser side (1), traverses and renders the search data set, uses all data of the search data set as search elements, and renders the functional component according to the field type of the search element; After the rendering of the retrieval data set is completed, the browser side (1) generates a first method, the first method generates a server request template by checking the interface path, the parameters of the retrieval field are bidirectionally bound to the functional component, the server request template sends a request to the server side (2) according to the parameters of the retrieval field, the server side (2) accepts the request and performs a retrieval operation on the database (3), and returns the retrieval data to the browser side (1), and the browser side (1) stores the retrieval data in a list of the first rendering module.
9. The method for constructing a data-driven page management system according to claim 8, characterized in that: In step S3, the browser end (1) receives the data structure in the JSON format, and generates a second rendering module instance corresponding to the viewing data set on the browser end (1) by creating a viewing container, wherein the viewing data set is a list element, and the viewing data set is traversed to read the identification field as the keyword of the list and the name field as the header of the list; the list field of the first rendering module is read and the data is traversed, and the actual data of the second rendering module is displayed according to the association of the keywords; When the option field of the viewing data set is not empty, a function button is loaded according to a target value of the option field.
10. The method for constructing a data-driven page management system according to claim 8, characterized in that: In step S3, the browser side (1) receives the data structure in the JSON format, creates a modification container, generates a third rendering module instance corresponding to the modified data set on the browser side (1), traverses the modified data set, uses all data of the modified data set as modifiable elements, renders the functional component according to the field type of the modifiable element, and generates a submit button after the functional component rendering is completed; After the modified data set is rendered, the browser (1) generates a second method, which is bound to the submit button, reads the interface path field to generate the server request template, and the parameters of the search field are bidirectionally bound to the functional component. By clicking the submit button, the server request template is called to send a request to the server (2), and the server (2) accepts the request and performs a modification operation on the database (3).
Citation Information
Patent Citations
Database general management system based on webpage
CN107480262A
Template marketing activity publishing method and template marketing activity publishing system
CN111857700A
Server rendering page generation method and system based on dynamic form verification
CN111859236A
Online rendering method and device of model
CN114637939A
Method and device for quickly generating data query front-end page and electronic equipment
CN116009860A
Cited By
Component rendering method and device, equipment and medium
CN122411927A
An assembly rendering method, apparatus, device and medium
CN122411927B
