Website page generation method and system, computer and storage medium

By obtaining page template data and CMS configuration data, analyzing the data source ID and matching the data result set, and using the JSP rendering engine to generate dynamic pages, solving the problem of inefficient website page generation in the existing technology, realizing the rapid construction and simplifying the page generation process.

CN119646341APending Publication Date: 2025-03-18江西博微新技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411878239.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

In the prior art, website page generation efficiency is low, and when frequent adjustments are required to display data or page effects, it is usually necessary to redeploy, resulting in inefficiency.

Method used

By obtaining page template data and CMS configuration data, analyzing the data source ID based on a custom tag processor, matching the data result set, and generating dynamic pages through the JSP rendering engine, simplifying the page generation process.

Benefits of technology

It realizes the rapid construction of a complete page, and associates the page with data through data source ID and custom tag attributes, simplifies the page generation and construction process and improves efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119646341A_ABST
    Figure CN119646341A_ABST
Patent Text Reader

Abstract

The invention provides a website page generation method and system, a computer and a storage medium. The method comprises the following steps that page template data and CMS configuration data are obtained; matching from the CMS configuration data based on the data source ID data to obtain a data result set; performing mapping processing on the data result set to obtain page data; and replacing the page data with the HTML fragment based on the JSP rendering engine, and rendering based on the HTML fragment to generate a dynamic page. Through CMS configuration data and page template data, a complete page can be quickly constructed based on a CMS page rendering engine, the page template data and a configuration data source, the data source is specified through a uniquely marked data source ID, and then a user-defined label attribute is configured in a page template, so that the page can be associated with the data. A plurality of data modules can be spliced into a complete data driving page, so that the page generation and construction process is simplified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of website development, and in particular to a website page generation method, system, computer and storage medium. Background Art

[0002] The existing website page generation method adopts HTML / CSS / JavaScript development according to the design drawing to ensure the connection with the back-end API service and complete the dynamic page data display of the page.

[0003] In the prior art, the development of website pages usually involves front-end developers responsible for page layout design, back-end developers defining API interfaces and implementing business logic, and finally completing the filling and generation of page content by requesting API interfaces. In addition, when making corresponding adjustments to the displayed data or page effects, it is usually necessary to redeploy, resulting in low website page generation efficiency. Summary of the invention

[0004] In view of the deficiencies in the prior art, the object of the present invention is to provide a website page generation method, system, computer and storage medium, aiming to solve the technical problem of low website page generation efficiency in the prior art.

[0005] In order to achieve the above object, in a first aspect, the present invention provides: a method for generating a website page, comprising the following steps: Obtaining page template data and CMS configuration data, wherein the page template data includes custom tags and sub-tags; Based on the custom tag, the data source ID data of the custom tag is obtained by parsing the custom tag processor; Based on the data source ID data, matching is performed from the CMS configuration data to obtain a data result set; Returning the acquired data result set to the custom tag processor, mapping and processing the data result set to obtain page data; The page data is replaced with HTML fragments based on the JSP rendering engine, and a dynamic page is generated based on the rendering of the HTML fragments.

[0006] According to one aspect of the above technical solution, the CMS configuration data includes JSON data configuration data and database configuration data.

[0007] According to one aspect of the above technical solution, the step of obtaining a data result set by matching the CMS configuration data based on the data source ID data specifically includes: Call the data source execution processor, use JAXB technology to parse the JSON data configuration data in the CMS configuration data, and obtain a data source list object; A processor is executed according to the data source, and a data result set corresponding to the data source ID data is obtained by matching the data source list object in the database configuration data.

[0008] According to one aspect of the above technical solution, the sub-tag includes a data mapping sub-tag and a parameter tag, and the data mapping sub-tag includes a field tag and a mapping tag.

[0009] According to one aspect of the above technical solution, the step of mapping and processing the data result set to obtain page data specifically includes: Parsing the data result set to map the field names in the data result set to the variable names in the page template data based on the field labels; The data in the data result set is mapped to the page template based on the mapping tag to obtain page data.

[0010] According to one aspect of the above technical solution, the step of obtaining a data result set corresponding to the data source ID data in the database configuration data based on the data source list object specifically includes: Obtaining a corresponding executable SQL statement from the XML configuration file of the data source list object according to the data source ID; A data result set corresponding to the data source ID data is obtained by matching the executable SQL statement in the database configuration data.

[0011] In a second aspect, the present invention provides a website page generation system, comprising: A data module, used to obtain page template data and CMS configuration data, wherein the page template data includes custom tags and sub-tags; A data source ID module, used to parse the custom tag through a custom tag processor to obtain the data source ID data of the custom tag; A matching module, used for matching the CMS configuration data based on the data source ID data to obtain a data result set; A mapping module is used to return the acquired data result set to the custom tag processor, and perform mapping processing on the data result set to obtain page data; The rendering module is used to replace the page data with HTML fragments based on the JSP rendering engine, and generate dynamic pages based on the HTML fragments.

[0012] According to one aspect of the above technical solution, the CMS configuration data includes JSON data configuration data and database configuration data; The matching module is specifically used for: Call the data source execution processor, use JAXB technology to parse the JSON data configuration data in the CMS configuration data, and obtain a data source list object; A processor is executed according to the data source, and a data result set corresponding to the data source ID data is obtained by matching the data source list object in the database configuration data.

[0013] According to one aspect of the above technical solution, the sub-tag includes a data mapping sub-tag and a parameter tag, and the data mapping sub-tag includes a field tag and a mapping tag; The mapping module is specifically used for: Parsing the data result set to map the field names in the data result set to the variable names in the page template data based on the field labels; The data in the data result set is mapped to the page template based on the mapping tag to obtain page data.

[0014] According to one aspect of the above technical solution, the matching module is further used for: Call the data source execution processor, use JAXB technology to parse the JSON data configuration data in the CMS configuration data, and obtain a data source list object; A processor is executed according to the data source, and a data result set corresponding to the data source ID data is obtained by matching the data source list object in the database configuration data.

[0015] In a third aspect, the present invention provides a computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the website page generation method as described in the above technical solution when executing the computer program.

[0016] In a fourth aspect, the present invention provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the website page generation method as described in the above technical solution.

[0017] Compared with the prior art, the beneficial effects of the present invention are as follows: through CMS configuration data and page template data, based on the CMS page rendering engine, page template data and configured data source, a complete page can be quickly constructed; based on the page template data containing the data source ID, the data source is specified by the uniquely marked data source ID, and then the page can be associated with the data by configuring the custom tag attributes in the page template to form a page data module unit. In this way, multiple data modules can be spliced ​​into a complete data-driven page, thereby simplifying the page generation and construction process. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 It is a flowchart of the website page generation method in the first embodiment of the present invention; Figure 2 It is a structural block diagram of a website page generation system in a second embodiment of the present invention; Figure 3 is a schematic diagram of the hardware structure of a computer in a third embodiment of the present invention; The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION

[0019] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.

[0020] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.

[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0022] Embodiment 1 See also Figure 1 , which is a flow chart of a website page generation method in a first embodiment of the present invention. As shown in the figure, the method includes the following steps: Step S100, obtaining page template data and CMS configuration data, wherein the page template data includes custom tags and sub-tags. CMS (Content Management System), that is, a content management system, is a tool that helps users create, manage, and edit website content.

[0023] Specifically, in this embodiment, when designing the above custom tag, i.e., bws:list (list tag), the attribute source (data source ID) needs to be set as the unique identification code. The above sub-tags include a data mapping sub-tag (bws:srcmap) and a parameter tag (bws:param), and the data mapping sub-tag includes a field tag and a mapping tag.

[0024] In some application scenarios of this embodiment, the parameter tag includes a model attribute and a name attribute, wherein the model attribute includes urlin (representing input) and urlout (representing output), urlin is used to receive data from an external URL (such as an API interface, user input, etc.), and name represents the name of the input or output; The name attribute is used to provide a name or identifier for the parameter tag. The value of name is usually a string that describes or explains the specific content or purpose of the input or output. If the parameter tag is used to receive form data submitted by the user, the name attribute can be set to "userInput" or "formData" to clearly indicate that the parameter tag is associated with user input data.

[0025] Likewise, if the parameter tag is used to send data to a server for processing, the name attribute can be set to "requestData" or "serverInput" to indicate that the parameter tag is associated with data sent to the server.

[0026] Step S200: obtaining data source ID data of the custom tag through parsing by a custom tag processor based on the custom tag.

[0027] Step S300: obtaining a data result set by matching the CMS configuration data based on the data source ID data.

[0028] Further, in this embodiment, the CMS configuration data includes JSON data configuration data and database configuration data; The step of obtaining a data result set by matching the CMS configuration data based on the data source ID data specifically includes: Step S310, calling the data source execution processor, using JAXB technology to parse the JSON data configuration data in the CMS configuration data, and obtaining a data source list object. Specifically, the above-mentioned JAXB (Java Architecture for XML Binding) can be implemented using Jackson's support for JAXB annotations (jackson-module-jaxb-annotations), which facilitates the generation of both XML and JSON. JAXB allows JAVA personnel to convert JSON data into JAVA objects, and then map JAVA objects to XML representations.

[0029] Step S320: executing a processor according to the data source, and obtaining a data result set corresponding to the data source ID data in the database configuration data based on matching of the data source list object.

[0030] Furthermore, in this embodiment, the step of executing the processor according to the data source and obtaining a data result set corresponding to the data source ID data in the database configuration data based on matching of the data source list object specifically includes: Step S321, obtain the corresponding executable SQL statement from the XML configuration file of the data source list object according to the data source ID. The data source list object usually contains not only the basic information of the data source, but also may contain additional configurations associated with each data source, such as SQL query statements, connection parameters, etc. By traversing the data source list object, searching for nodes matching the given data source ID, the matching data source ID node is found, and then the executable SQL statement is extracted from the node or its child nodes.

[0031] Step S322, based on the executable SQL statement, a data result set corresponding to the data source ID data is obtained in the database configuration data. The data source processor loads the data result set and returns it to the data source execution processor, thereby executing the data result set based on the data source execution processor.

[0032] Step S400, returning the acquired data result set to the custom tag processor, performing mapping processing on the data result set to obtain page data.

[0033] Specifically, in this embodiment, the sub-tags include a data mapping sub-tag and a parameter tag, and the data mapping sub-tag includes a field tag and a mapping tag; The step of mapping and processing the data result set to obtain page data specifically includes: Step S410, the data result set is parsed to map the field names in the data result set to the variable names in the page template data based on the field tags. Specifically, the data result set is returned to the custom tag processor for combining it with the page template.

[0034] In some application scenarios of this embodiment, first, the custom tag processor needs to parse the structure of the data result set, including its field names and data types; then, the processor searches for the field labels defined in the custom tags (these labels are usually pre-defined in the page template to specify how to map the fields in the data result set to the variables in the page template); finally, a mapping relationship is established: the processor establishes a mapping relationship between the data result set fields and the page template variables based on the field labels.

[0035] Step S420, mapping the data in the data result set to the page template based on the mapping tag to obtain page data.

[0036] In some application scenarios of this embodiment, the mapping tag is used to specify how to actually fill the data into the specified position in the page template; first, the processor fills the data in the data result set into the corresponding position of the page template according to the mapping tag and the mapping relationship established in step S410; then, after the data filling process, the processor generates the final page data, which now includes the data mapped from the data result set.

[0037] Step S500: replacing the page data with HTML fragments based on the JSP rendering engine, and rendering and generating a dynamic page based on the HTML fragments.

[0038] Specifically, the JSP rendering engine allows the embedding of Java code and JSP tags, and can use syntax such as JSP expressions, script fragments, and JSP actions to dynamically generate HTML content. The JSP rendering engine combines the static HTML content in the page template, the HTML fragments generated by the JSP expression, and the HTML fragments generated by the custom tag processor into a complete HTML page; the final generated HTML page will be sent back to the client browser for rendering and display. Since the JSP page is dynamically generated, different HTML content can be generated based on the latest data each time it is requested. This enables Web applications to reflect data changes in real time.

[0039] In summary, the website page generation method in the above embodiment of the present invention can quickly build a complete page through CMS configuration data and page template data, based on the CMS page rendering engine, page template data and configured data source, based on the page template data containing the data source ID, specify the data source through the uniquely marked data source ID, and then configure the custom tag attributes in the page template to associate the page with the data to form a page data module unit. In this way, multiple data modules can be spliced ​​into a complete data-driven page, thereby simplifying the page generation and construction process.

[0040] Embodiment 2 The second embodiment of the present application also provides a website page generation system, which is used to implement the embodiments and preferred implementations, and will not be repeated hereafter. As used below, the terms "module", "unit", "subunit", etc. can implement a combination of software and / or hardware of a predetermined function. Although the system described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and contemplated.

[0041] like Figure 2 As shown, the system includes: a data module 100 , a data source ID module 200 , a matching module 300 , a mapping module 400 and a rendering module 500 .

[0042] The data module 100 is used to obtain page template data and CMS configuration data, wherein the page template data includes custom tags and sub-tags; The data source ID module 200 is used to parse the custom tag through a custom tag processor to obtain the data source ID data of the custom tag; The matching module 300 is used to match the CMS configuration data based on the data source ID data to obtain a data result set; The mapping module 400 is used to return the acquired data result set to the custom tag processor, and perform mapping processing on the data result set to obtain page data; The rendering module 500 is used to replace the page data with HTML fragments based on the JSP rendering engine, and generate a dynamic page based on the HTML fragments.

[0043] Preferably, in this embodiment, the matching module 300 is specifically used for: Call the data source execution processor, use JAXB technology to parse the JSON data configuration data in the CMS configuration data, and obtain a data source list object; A processor is executed according to the data source, and a data result set corresponding to the data source ID data is obtained by matching the data source list object in the database configuration data.

[0044] Preferably, in this embodiment, the mapping module 400 is specifically used for: Parsing the data result set to map the field names in the data result set to the variable names in the page template data based on the field labels; The data in the data result set is mapped to the page template based on the mapping tag to obtain page data.

[0045] Preferably, in this embodiment, the matching module 300 is further used for: Call the data source execution processor, use JAXB technology to parse the JSON data configuration data in the CMS configuration data, and obtain a data source list object; A processor is executed according to the data source, and a data result set corresponding to the data source ID data is obtained by matching the data source list object in the database configuration data.

[0046] In summary, the website page generation system in the above embodiment of the present invention can quickly build a complete page through CMS configuration data and page template data, based on the CMS page rendering engine, page template data and configured data source. Based on the page template data containing the data source ID, the data source is specified through the uniquely marked data source ID, and then the custom tag attributes are configured in the page template to associate the page with the data to form a page data module unit. In this way, multiple data modules can be spliced ​​into a complete data-driven page, thereby simplifying the page generation and construction process.

[0047] It should be noted that each module can be a functional module or a program module, and can be implemented by software or hardware. For modules implemented by hardware, each module can be located in the same processor; or each module can be located in different processors in any combination.

[0048] Embodiment 3 A third embodiment of the present application provides a computer, which may include a processor 81 and a memory 82 storing computer program commands.

[0049] Specifically, the processor 81 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0050] Among them, the memory 82 may include a large-capacity memory for data or commands. By way of example and not limitation, the memory 82 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 82 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 82 may be inside or outside the data processing device. In a specific embodiment, the memory 82 is a non-volatile memory. In a specific embodiment, the memory 82 includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM) or a flash memory (FLASH), or a combination of two or more of these. Under appropriate circumstances, the RAM can be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM can be a fast page mode dynamic random access memory (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.

[0051] The memory 82 may be used to store or cache various data files required for processing and / or communication, as well as possible computer program commands executed by the processor 81 .

[0052] The processor 81 implements any one of the website page generation methods in the above embodiments by reading and executing the computer program commands stored in the memory 82 .

[0053] In some embodiments, the computer may further include a communication interface 83 and a bus 80. Figure 3 As shown, the processor 81, the memory 82, and the communication interface 83 are connected via a bus 80 and communicate with each other.

[0054] The communication interface 83 is used to implement communication between the modules, devices, units and / or equipment in the embodiment of the present application. The communication interface 83 can also implement data communication with other components such as: external devices, image / data acquisition equipment, databases, external storage, and image / data processing workstations.

[0055] The bus 80 includes hardware, software or both, and couples the components of the computer to each other. The bus 80 includes but is not limited to at least one of the following: a data bus, an address bus, a control bus, an expansion bus, and a local bus. By way of example and not limitation, bus 80 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, bus 80 may include one or more buses. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.

[0056] Embodiment 4 The fourth embodiment of the present application provides a readable storage medium having computer program commands stored thereon; when the computer program commands are executed by a processor, any one of the website page generation methods in the above embodiments is implemented.

[0057] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0058] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for generating a website page, characterized in that: The following steps are involved: Obtaining page template data and CMS configuration data, wherein the page template data includes custom tags and sub-tags; Based on the custom tag, the data source ID data of the custom tag is obtained by parsing the custom tag processor; Based on the data source ID data, matching is performed from the CMS configuration data to obtain a data result set; Returning the acquired data result set to the custom tag processor, mapping and processing the data result set to obtain page data; The page data is replaced with HTML fragments based on the JSP rendering engine, and a dynamic page is generated based on the rendering of the HTML fragments.

2. The website page generation method according to claim 1, characterized in that: The CMS configuration data includes JSON data configuration data and database configuration data.

3. The website page generation method according to claim 2, characterized in that: The step of obtaining a data result set by matching the CMS configuration data based on the data source ID data specifically includes: Call the data source execution processor, use JAXB technology to parse the JSON data configuration data in the CMS configuration data, and obtain a data source list object; A processor is executed according to the data source, and a data result set corresponding to the data source ID data is obtained by matching the data source list object in the database configuration data.

4. The website page generation method according to claim 1, characterized in that: The sub-tags include a data mapping sub-tag and a parameter tag, and the data mapping sub-tag includes a field tag and a mapping tag.

5. The website page generation method according to claim 4, characterized in that: The step of mapping and processing the data result set to obtain page data specifically includes: Parsing the data result set to map the field names in the data result set to the variable names in the page template data based on the field labels; The data in the data result set is mapped to the page template based on the mapping tag to obtain page data.

6. The website page generation method according to claim 3, characterized in that: The step of obtaining a data result set corresponding to the data source ID data by matching the data source list object in the database configuration data specifically includes: Obtaining a corresponding executable SQL statement from the XML configuration file of the data source list object according to the data source ID; A data result set corresponding to the data source ID data is obtained by matching the executable SQL statement in the database configuration data.

7. A website page generation system, characterized in that: include: A data module, used to obtain page template data and CMS configuration data, wherein the page template data includes custom tags and sub-tags; A data source ID module, used to parse the custom tag through a custom tag processor to obtain the data source ID data of the custom tag; A matching module, used for matching the CMS configuration data based on the data source ID data to obtain a data result set; A mapping module is used to return the acquired data result set to the custom tag processor, and perform mapping processing on the data result set to obtain page data; The rendering module is used to replace the page data with HTML fragments based on the JSP rendering engine, and generate dynamic pages based on the HTML fragments.

8. The website page generation system according to claim 7, characterized in that: The CMS configuration data includes JSON data configuration data and database configuration data; The matching module is specifically used for: Call the data source execution processor, use JAXB technology to parse the JSON data configuration data in the CMS configuration data, and obtain a data source list object; A processor is executed according to the data source, and a data result set corresponding to the data source ID data is obtained by matching the data source list object in the database configuration data.

9. A computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the website page generation method according to any one of claims 1 to 6 is implemented.

10. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the website page generation method described in any one of claims 1 to 6 is implemented.