CN111552903A - Page generation method and device based on HTML (Hypertext markup language) template and computer equipment - Google Patents

Page generation method and device based on HTML (Hypertext markup language) template and computer equipment Download PDF

Info

Publication number
CN111552903A
CN111552903A CN202010273181.0A CN202010273181A CN111552903A CN 111552903 A CN111552903 A CN 111552903A CN 202010273181 A CN202010273181 A CN 202010273181A CN 111552903 A CN111552903 A CN 111552903A
Authority
CN
China
Prior art keywords
page
content
html
resource file
resource
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010273181.0A
Other languages
Chinese (zh)
Inventor
刘慧众
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
OneConnect Smart Technology Co Ltd
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN202010273181.0A priority Critical patent/CN111552903A/en
Publication of CN111552903A publication Critical patent/CN111552903A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Information Transfer Between Computers (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application relates to a method and a device for generating a page based on an HTML template based on research and development management, computer equipment and a storage medium. The method comprises the following steps: the method comprises the steps of obtaining and identifying a reference page, capturing a page layout file and a resource file of the reference page, and determining similar page contents with the same label position according to the page layout file. And clustering similar page contents based on the label bits to obtain content clusters based on the label bits, extracting public parameters of the content clusters, and determining the page contents of the reference page based on the public parameters and the resource files. And performing templating processing on the page content of the reference page to generate an HTML template corresponding to the reference page, and generating a corresponding target page according to the HTML template and the resource file of the target page. By adopting the method, developers do not need to modify the source code file manually, the content of the target page is replaced according to the HTML template and the resource file of the target page, the target page is obtained, the consumption of human resources is reduced, and the generation efficiency of the target page is improved.

Description

Page generation method and device based on HTML (Hypertext markup language) template and computer equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a page generation method and apparatus based on an HTML template, a computer device, and a storage medium.
Background
With the development of computer technology and the wide application of the internet in daily life, it is becoming common for people to browse web pages to obtain required information. Accordingly, the creation and display of web pages are also a means for attracting more users by each website according to different requirements of each user.
When a web page is created, the elements of the web page need to be rewritten and laid out again according to the function to be implemented or the requirement of new addition. However, most of the conventional page content is rewritten or laid out in a code or a configuration file by manually modifying the code by a developer, which still consumes a lot of human resources, resulting in low efficiency of generating a web page.
Disclosure of Invention
In view of the above, it is necessary to provide a page generation method, apparatus, computer device and storage medium based on HTML template, which can improve the efficiency of generating web pages.
A page generation method based on an HTML template, the method comprising:
acquiring and identifying a reference page, and capturing a page layout file and a resource file of the reference page; the reference page is a website page of a baseline version;
determining similar page contents with the same label position according to the page layout file, and realizing clustering of the similar page contents based on the label position to obtain content clustering based on the label position;
extracting a public parameter of the content cluster, and determining the page content of the reference page based on the public parameter and the resource file;
performing templating processing on the page content of the reference page to generate an HTML template corresponding to the reference page;
and generating a corresponding target page according to the HTML template and the resource file of the target page.
In one embodiment, the generating a corresponding target page according to the HTML template and the resource file of the target page includes:
when a target page generation instruction is detected, triggering baseline version access operation, and acquiring an HTML page template according to the baseline version access operation;
and replacing the page content of the HTML page template with the resource file of the target page to generate a corresponding target page.
In one embodiment, the replacing the page content of the HTML page template with the resource file of the target page to generate a corresponding target page includes:
generating a plurality of replacement keys based on the page content and layout characteristics of the HTML page template;
when any replacement key is detected to be triggered, acquiring a resource extraction address corresponding to the replacement key, and acquiring a resource file of a target page according to the resource extraction address;
and replacing the page content of the HTML page template with the resource file of the target page to generate a corresponding target page.
In one embodiment, the common parameters include color schemes, and the page content includes a page theme color; the determining the page content of the page based on the common parameters and the resource file comprises:
analyzing the color values of the color matching of the reference page based on the color matching scheme and the resource file to obtain the color matching corresponding to the label positions with the same color numbers;
and clustering the color matching corresponding to the label positions with the same color number to obtain color number clusters based on the label positions, and determining the color numbers to be the page theme colors.
In one embodiment, the common parameters include layout characteristics, and the page content includes the location of website banner and resource attributes; the determining the page content of the page based on the common parameters and the resource file comprises:
extracting display keywords of the website mark from the resource file, and determining the resource attribute of the website mark according to the resource file; the display keyword is a top toolbar, and the resource attribute of the website mark is a picture attribute;
determining the display position of the website mark based on the association of the layout characteristics and the display keywords; the website mark is positioned at the top of the page corresponding to the top toolbar.
In one embodiment, the determining, according to the page layout file, similar page contents having the same tag bit, and implementing clustering of the similar page contents based on the tag bit to obtain a content cluster based on the tag bit includes:
acquiring all page contents of the page layout file, and extracting tag positions of all the page contents;
acquiring page contents with the same tag position, and determining the page contents as similar page contents;
and clustering the similar page content based on the label position to obtain content clusters based on the label position.
An apparatus for page generation based on HTML templates, the apparatus comprising:
the system comprises a reference page identification module, a page layout module and a resource module, wherein the reference page identification module is used for acquiring and identifying a reference page and capturing a page layout file and a resource file of the reference page; the reference page is a website page of a baseline version;
the content clustering module is used for determining similar page contents with the same label position according to the page layout file, and realizing clustering of the similar page contents based on the label position to obtain content clustering based on the label position;
the public parameter extraction module is used for extracting the public parameter of the content cluster and determining the page content of the page based on the public parameter and the resource file;
the HTML template generating module is used for carrying out templating processing on the basis of the page content of the reference page and generating an HTML template corresponding to the reference page;
and the target page generating module is used for generating a corresponding target page according to the HTML template and the resource file of the target page.
In one embodiment, the target page generation module is further configured to:
generating a plurality of replacement keys based on the page content and layout characteristics of the HTML page template;
when any replacement key is detected to be triggered, acquiring a resource extraction address corresponding to the replacement key, and acquiring a resource file of a target page according to the resource extraction address;
and replacing the page content of the HTML page template with the resource file of the target page to generate a corresponding target page.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
acquiring and identifying a reference page, and capturing a page layout file and a resource file of the reference page; the reference page is a website page of a baseline version
Determining similar page contents with the same label position according to the page layout file, and realizing clustering of the similar page contents based on the label position to obtain content clustering based on the label position;
extracting a public parameter of the content cluster, and determining the page content of the reference page based on the public parameter and the resource file;
performing templating processing on the page content of the reference page to generate an HTML template corresponding to the reference page;
and generating a corresponding target page according to the HTML template and the resource file of the target page.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring and identifying a reference page, and capturing a page layout file and a resource file of the reference page; the reference page is a website page of a baseline version;
determining similar page contents with the same label position according to the page layout file, and realizing clustering of the similar page contents based on the label position to obtain content clustering based on the label position;
extracting a public parameter of the content cluster, and determining the page content of the reference page based on the public parameter and the resource file;
performing templating processing on the page content of the reference page to generate an HTML template corresponding to the reference page;
and generating a corresponding target page according to the HTML template and the resource file of the target page.
According to the page generation method and device based on the HTML template, the computer equipment and the storage medium, the identification reference page is obtained, the page layout file and the resource file of the reference page are captured, clustering of similar page contents with the same label bit is further achieved, and content clustering based on the label bit is obtained. By extracting the common parameters of the content clusters, the page content of the page is determined based on the common parameters and the resource file. Since the page content of the reference page is subjected to templating, an HTML template corresponding to the reference page is generated. When the page content is modified, the original page content on the HTML template can be replaced by the resource file of the target page based on the HTML template, and the target page meeting the requirement can be obtained without modifying the page content in a mode that a developer manually modifies the source code file, so that the human resource consumption is reduced, and the generation efficiency of the target page is improved.
Drawings
FIG. 1 is a diagram of an application scenario of a page generation method based on HTML templates in an embodiment;
FIG. 2 is a flowchart illustrating a method for generating a page based on an HTML template according to an embodiment;
FIG. 3 is a diagram of an HTML template in one embodiment;
FIG. 4 is a flowchart illustrating steps of generating a corresponding destination page in one embodiment;
FIG. 5 is a diagram of a destination page in one embodiment;
FIG. 6 is a block diagram showing an exemplary page generation apparatus based on an HTML template;
FIG. 7 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The page generation method based on the HTML template can be applied to the application environment shown in FIG. 1. Wherein the terminal 102 and the server 104 communicate via a network. The server 102 acquires and identifies a website page of the baseline version of the terminal 102, and captures a page layout file and a resource file of a reference page. The server 104 determines similar page contents with the same tag bit according to the page layout file, clusters the similar page contents based on the tag bit to obtain a content cluster based on the tag bit, and determines the page contents of the reference page based on the common parameters and the resource file by extracting the common parameters of the content cluster. And performing templating processing on the page content of the reference page to generate an HTML template corresponding to the reference page, and generating a corresponding target page according to the HTML template and the resource file of the target page. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.
In one embodiment, as shown in fig. 2, a method for generating a page based on an HTML template is provided, which is described by taking the method as an example applied to the server in fig. 1, and includes the following steps:
step S202, a reference page is obtained and identified, and a page layout file and a resource file of the reference page are captured.
Specifically, the reference page is a website page of a baseline version, in the website development and design process, the same basic frame can be adopted to realize the construction of different websites, one website page is used as the baseline version, the reference page of the baseline version is identified, the layout file and the resource file of the reference page are captured, and the HTML template of the baseline version can be obtained according to the layout file and the resource file of the reference page. The document format on the network can be unified through the tags, so that the scattered network resources are connected into a logic whole. The template contains presentation elements including text words, HTML, and data binding expressions, the HTML template being a template of presentation elements consisting of a series of tags for HTML.
The page layout file relates to the setting of all contents included in a web page at different display positions of the page, taking a website mark as an example, the website mark is usually set at the topmost end of the page, and can be displayed in the middle or displayed at the upper left/right corners, etc., the keyword displayed in the resource file by the website mark is a top toolbar, and the corresponding resource attribute is a picture attribute because the website mark is mostly a picture.
And step S204, determining similar page contents with the same label position according to the page layout file, and realizing clustering of the similar page contents based on the label position to obtain content clustering based on the label position.
Specifically, all page contents of the page layout file are obtained, tag positions of all the page contents are extracted, page contents with the same tag positions are further obtained and determined to be similar page contents, and clustering operation is performed on the similar page contents based on the tag positions, so that content clustering based on the tag positions is obtained.
The tag positions can be used for displaying recommended products or hot-sell products and the like of the publicity column, different columns on the page can be respectively determined based on the page layout file of the page content, such as the tag positions of the recommended products or the hot-sell products and the like, and whether the tag positions corresponding to the different columns are the same or not is judged.
In one embodiment, the tag bit of the recommended product is displayed on the web page, the tag bit is displayed in the page layout file as div # details _ plan _ con _2, the corresponding tag bit is marked as < div class ═ details _ plan _ two _ right > in the resource file, and the tag bit is displayed in the web page as the tag bit of the hot-selling product, the tag bit is displayed in the page layout file as div. Based on the labeled label positions, clustering of recommended products and hot-sell products can be achieved, and content clustering based on the label positions is obtained.
Step S206, extracting the public parameter of the content cluster, and determining the page content of the reference page based on the public parameter and the resource file.
Specifically, by extracting common parameters for content clusters, the common parameters including color schemes and layout characteristics, the color schemes including color schemes for pages, the color schemes at different locations on the pages may be identical or different. The layout characteristics are the layout positions of the page content clusters determined according to different tag positions, and may include website marks, publicity columns and space elements. And further determining the page content of the reference page based on the common parameters and the resource file. The page content comprises a page theme color corresponding to the color scheme, and positions and resource attributes corresponding to the website logo and the publicity column.
Further, the scanning operation is carried out on the extracted public parameters, the participation operation is carried out, and the public parameters are written into the configuration table to be stored. And the parameter entering operation is represented by writing the extracted common parameters, and values or definitions corresponding to the common parameters into a preset configuration table. The method comprises the steps that a plurality of field names are arranged in a preset configuration table, each field name comprises a preset keyword, and when matching is successful, corresponding public parameters, corresponding values or definitions and the like are written into an area included by the corresponding field name.
Step S208, performing templating processing on the page content of the reference page to generate an HTML template corresponding to the reference page.
Specifically, by performing templating processing on reference page contents including page layout, theme color matching, space elements (including icons, pictures, backgrounds and the like), components forming an HTML template of a webpage are obtained, wherein the components include a main body HTML, a head and a content body. The head area mainly stores the title, the keywords, the description of the page and the references of cs and js codes, and the body area mainly stores the content of the page coded later by us. And generating an HTML template corresponding to the reference page according to each component obtained by performing templating processing.
Step S210, generating a corresponding target page according to the HTML template and the resource file of the target page.
Specifically, when a target page generation instruction is detected, a baseline version access operation is triggered, an HTML page template is obtained according to the baseline version access operation, page content of the HTML page template is replaced by a resource file of a target page, and a corresponding target page is generated.
Further, as shown in fig. 3, fig. 3 provides an HTML template, when a target page generation instruction is detected, a baseline version access operation is triggered, a detected baseline version access address is obtained, an HTML page template is obtained according to the input baseline version access address, and then page content of the HTML page template is replaced with a resource file of a target page to generate a corresponding target page.
The specific replacement process is a data resource covering or data resource replacement process, and the target page meeting the requirements is obtained by replacing the existing page content corresponding to the replacement button on the HTML page template with the target page content or covering the content of the corresponding part on the original HTML page template by using the target page content needing to be updated.
In the page generation method based on the HTML template, the reference page is obtained and identified, and the page layout file and the resource file of the reference page are captured, so that the clustering of similar page contents with the same label position is realized, and the content clustering based on the label position is obtained. The common parameters of the content clusters are extracted, the page content of the page is determined based on the common parameters and the resource file, the page content of the reference page is subjected to templating processing to generate an HTML template corresponding to the reference page, developers do not need to modify the source code file manually, the target page content can be replaced according to the HTML template and the resource file of the target page, the target page meeting the requirements is obtained, the human resource consumption is reduced, and the generation efficiency of the target page is improved.
In an embodiment, as shown in fig. 4, the step of generating the corresponding target page, that is, replacing the page content of the HTML page template with the resource file of the target page, and generating the corresponding target page specifically includes the following steps S402 to S406:
step S402, generating a plurality of replacement keys based on the page content and the layout characteristics of the HTML page template.
The page content of the HTML page template comprises a page theme color, a website mark and a space element, the space element comprises a background picture and a bulletin board picture, and the layout characteristics comprise a theme color layout corresponding to the page theme color, a website mark display position corresponding to the website mark and a space layout corresponding to the space element.
Specifically, based on the page theme color and the theme color layout, a corresponding page theme color replacement key may be generated, and based on the website logo and the website logo display position, a corresponding website logo replacement key may be generated. Likewise, based on the spatial elements and the spatial layout, corresponding spatial element replacement keys may be generated, wherein the spatial element replacement keys include a background picture replacement key and a billboard picture replacement key.
Step S404, when detecting that any one replacement key is triggered, acquiring a resource extraction address corresponding to the replacement key, and acquiring a resource file of the target page according to the resource extraction address.
Specifically, when any one of the replacement keys is detected to be triggered, including any one of the page theme color replacement key, the website logo replacement key, the background picture replacement key, and the bulletin board picture replacement key, the resource extraction address corresponding to the replacement key is acquired.
Further, taking the triggered replacement key as the website mark replacement key as an example, the resource file storing the website mark of the target page is extracted by acquiring the resource extraction address of the website mark of the target page and accessing the acquired resource extraction address.
Similarly, taking the triggered replacement key as the billboard picture replacement key as an example, the resource file storing the billboard picture of the target page may be extracted by acquiring the resource extraction address of the billboard picture of the target page and accessing the acquired resource extraction address.
Step S406, replacing the page content of the HTML page template with the resource file of the target page, and generating a corresponding target page.
Specifically, the page content of the HTML page template is replaced by the resource file of the target page corresponding to the replacement key according to the triggered replacement key, including the page theme color replacement key, the website logo replacement key, the background picture replacement key, the bulletin board picture replacement key and the like, so as to obtain the replaced target page.
Further, referring to fig. 5, fig. 5 is a schematic diagram of a target page obtained by triggering a replacement key, as shown in fig. 5, a website mark replacement key and a bulletin board picture replacement key are triggered, a website mark in the HTML template shown in fig. 3 is replaced by a website mark in a resource file of the target page, a bulletin board picture in the HTML template is replaced by a bulletin board picture in a resource file of the target page, and the target page after replacement is obtained.
The step of generating the corresponding target page includes generating a plurality of replacement keys based on page content and layout features of an HTML page template, acquiring a resource extraction address corresponding to a replacement key when any one of the replacement keys is detected to be triggered, acquiring a resource file of the target page according to the resource extraction address, replacing the page content of the HTML page template with the resource file of the target page, generating the corresponding target page, and realizing replacement of the target page content according to the HTML page template and the resource file of the target page without manually modifying a source code file by a developer, thereby improving generation efficiency of the target page.
In one embodiment, the common parameter comprises a color scheme and the page content comprises a page theme color; determining page content of the page based on the common parameters and the resource file, including:
analyzing the color values of the color matching of the reference page based on the color matching scheme and the resource file to obtain the color matching corresponding to the label positions with the same color numbers; and clustering the color matching corresponding to the label positions with the same color number to obtain color number clusters based on the label positions, and determining the color numbers as the page theme colors.
Specifically, color values of color schemes of the reference page are analyzed, color numbers of color schemes corresponding to all label positions of the reference page are obtained, and then the color numbers included in the color schemes belonging to the same label position are determined. And clustering the color matching of the label positions with the same color number to obtain color number clusters based on the label positions, namely determining the color matching with the most same label positions as the theme color of the page.
The page content of the page is determined according to the public parameters and the resource file, the page theme color is determined in a clustering mode, the problem that the extracted theme color has large error due to less sampling is solved, and the accuracy of the determined page theme color is improved.
In one implementation, the common parameters include layout characteristics, and the page content includes the location of the website logo and resource attributes; determining page content of the page based on the common parameters and the resource file, further comprising:
extracting display keywords of the website mark from the resource file, and determining the resource attribute of the website mark according to the resource file; the display keywords are top toolbars, and the resource attribute of the website mark is a picture attribute; determining the display position of the website mark based on the association of the layout characteristics and the display keywords; and the position of the website mark is the top end of the page corresponding to the top toolbar.
Specifically, the display keywords of the website marks are extracted from the resource file, wherein the display keywords corresponding to the website marks are top toolbars, and the resource attributes of the website marks can be determined to be picture attributes from the resource file. And then determining the display position of the website mark as the top of the page corresponding to the top toolbar based on the association relation between the layout characteristics and the display keywords. The website mark is usually arranged at the topmost end of the page, and may be a center display or a left/right upper corner display, and whether the website mark is determined by the layout characteristics and the association of the display keywords, and when the website mark is determined, the determined website mark is determined as a part of the page content.
In one embodiment, the public parameters may further include spatial elements, the spatial elements include a bulletin board, a background picture and the like, the page content further includes a position and a resource attribute of the bulletin board, the page content of the page is determined based on the public parameters and the resource file, and the method further includes:
extracting display keywords of the publicity column from the resource file, and determining the resource attribute of the publicity column according to the resource file; the display position of the bulletin board is determined based on the association of the layout features and the display keywords.
Specifically, the display keywords of the bulletin board are extracted from the resource file, wherein the display keywords of the bulletin board can be the middle toolbar, and the resource attributes of the bulletin board can be determined to be picture attributes or sound attributes or dynamic picture attributes and the like from the resource file. And determining the display position of the publicity column to be the page center position corresponding to the center toolbar based on the association relation between the layout characteristics and the display keywords.
The page content of the page is determined based on the public parameters and the resource file, the display keywords of the website mark are extracted from the resource file, the resource attribute of the website mark is determined according to the resource file, the display position of the website mark is determined based on the association between the layout characteristics and the display keywords, and meanwhile, whether the content displayed at the corresponding position of the page is the website mark can be determined, so that the probability of replacement errors during replacement operation is reduced, and the target page generation efficiency is improved.
It should be understood that although the steps in the flowcharts of fig. 2 and 4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2 and 4 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 6, there is provided a page generating apparatus based on HTML template, including: a reference page identification module 602, a content clustering module 604, a common parameter extraction module 606, an HTML template generation module 608, and a target page generation module 610, wherein:
a reference page identification module 602, configured to obtain and identify a reference page, and capture a page layout file and a resource file of the reference page; the base page is a baseline version of the web site page.
And a content clustering module 604, configured to determine similar page contents with the same tag bit according to the page layout file, and implement clustering of the similar page contents based on the tag bit to obtain a tag bit-based content cluster.
And a common parameter extraction module 606, configured to extract a common parameter of the content cluster, and determine page content of the page based on the common parameter and the resource file.
The HTML template generating module 608 is configured to perform templating processing based on the page content of the reference page, and generate an HTML template corresponding to the reference page.
And the target page generating module 610 is configured to generate a corresponding target page according to the HTML template and the resource file of the target page.
The page generation device based on the HTML template acquires and identifies the reference page, and captures the page layout file and the resource file of the reference page, so that clustering of similar page contents with the same tag bit is realized, and content clustering based on the tag bit is obtained. The common parameters of the content clusters are extracted, the page content of the page is determined based on the common parameters and the resource file, the page content of the reference page is subjected to templating processing to generate an HTML template corresponding to the reference page, developers do not need to modify the source code file manually, the target page content can be replaced according to the HTML template and the resource file of the target page, the target page meeting the requirements is obtained, the human resource consumption is reduced, and the generation efficiency of the target page is improved.
In one embodiment, the target page generation module is further configured to:
when a target page generation instruction is detected, triggering baseline version access operation, and acquiring an HTML page template according to the baseline version access operation; and replacing the page content of the HTML page template with the resource file of the target page to generate a corresponding target page.
According to the target page generation module, the corresponding target page is generated by replacing the page content of the HTML page template with the resource file of the target page, developers do not need to modify the source code file manually, the target page content can be replaced according to the HTML template and the resource file of the target page, and the target page generation efficiency is improved.
In one embodiment, the target page generation module is further configured to:
generating a plurality of replacement keys based on the page content and layout characteristics of the HTML page template; when any replacement key is detected to be triggered, acquiring a resource extraction address corresponding to the replacement key, and acquiring a resource file of a target page according to the resource extraction address; and replacing the page content of the HTML page template with the resource file of the target page to generate a corresponding target page.
The target page generation module generates a plurality of replacement keys based on the page content and layout characteristics of the HTML page template, acquires the resource extraction address corresponding to the replacement key when any one of the replacement keys is detected to be triggered, acquires the resource file of the target page according to the resource extraction address, replaces the page content of the HTML page template with the resource file of the target page, generates the corresponding target page, does not need developers to modify the source code file manually, can realize the replacement of the target page content according to the HTML page template and the resource file of the target page, and improves the generation efficiency of the target page.
In one embodiment, the common parameter extraction module is further configured to:
analyzing the color values of the color matching of the reference page based on the color matching scheme and the resource file to obtain the color matching corresponding to the label positions with the same color numbers; and clustering the color matching corresponding to the label positions with the same color number to obtain color number clusters based on the label positions, and determining the color numbers as the page theme colors.
The public parameter extraction module determines the page theme color in a clustering mode, so that the problem of large error of the extracted theme color caused by less sampling is solved, and the accuracy of the determined page theme color is improved.
In one embodiment, the common parameter extraction module is further configured to:
extracting display keywords of the website mark from the resource file, and determining the resource attribute of the website mark according to the resource file; displaying the keywords as a top toolbar, and the resource attribute of the website mark is a picture attribute; determining the display position of the website mark based on the association of the layout characteristics and the display keywords; the website logo is located at the top of the page corresponding to the top toolbar.
The public parameter extraction module extracts the display keywords of the website mark from the resource file, determines the resource attribute of the website mark according to the resource file, determines the display position of the website mark based on the association of the layout characteristics and the display keywords, and simultaneously can determine whether the content displayed at the corresponding position of the page is the website mark, thereby reducing the probability of replacement errors during replacement operation and improving the generation efficiency of the target page.
For specific definition of the page generation apparatus based on the HTML template, reference may be made to the above definition of the page generation method based on the HTML template, and details are not described here. The modules in the page generating device based on the HTML template can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is for storing page layout data and page resource data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of page generation based on HTML templates.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, there is provided a computer device comprising a memory storing a computer program and a processor implementing the following steps when the processor executes the computer program:
acquiring and identifying a reference page, and capturing a page layout file and a resource file of the reference page; the reference page is a website page of a baseline version;
determining similar page contents with the same label position according to the page layout file, and realizing clustering of the similar page contents based on the label position to obtain content clustering based on the label position;
extracting a public parameter of the content cluster, and determining the page content of the reference page based on the public parameter and the resource file;
performing templating processing on the page content of the reference page to generate an HTML template corresponding to the reference page;
and generating a corresponding target page according to the HTML template and the resource file of the target page.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
when a target page generation instruction is detected, triggering baseline version access operation, and acquiring an HTML page template according to the baseline version access operation;
and replacing the page content of the HTML page template with the resource file of the target page to generate a corresponding target page.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
generating a plurality of replacement keys based on the page content and layout characteristics of the HTML page template;
when any replacement key is detected to be triggered, acquiring a resource extraction address corresponding to the replacement key, and acquiring a resource file of a target page according to the resource extraction address;
and replacing the page content of the HTML page template with the resource file of the target page to generate a corresponding target page.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
analyzing the color values of the color matching of the reference page based on the color matching scheme and the resource file to obtain the color matching corresponding to the label positions with the same color numbers;
and clustering the color matching corresponding to the label positions with the same color number to obtain color number clusters based on the label positions, and determining the color numbers as the page theme colors.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
extracting display keywords of the website mark from the resource file, and determining the resource attribute of the website mark according to the resource file; displaying the keywords as a top toolbar, and the resource attribute of the website mark is a picture attribute;
determining the display position of the website mark based on the association of the layout characteristics and the display keywords; the website logo is located at the top of the page corresponding to the top toolbar.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring all page contents of the page layout file, and extracting tag positions of all the page contents;
acquiring page contents with the same tag position, and determining the page contents as similar page contents;
and clustering the similar page contents based on the label positions to obtain content clusters based on the label positions.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring and identifying a reference page, and capturing a page layout file and a resource file of the reference page; the reference page is a website page of a baseline version;
determining similar page contents with the same label position according to the page layout file, and realizing clustering of the similar page contents based on the label position to obtain content clustering based on the label position;
extracting a public parameter of the content cluster, and determining the page content of the reference page based on the public parameter and the resource file;
performing templating processing on the page content of the reference page to generate an HTML template corresponding to the reference page;
and generating a corresponding target page according to the HTML template and the resource file of the target page.
In one embodiment, the computer program when executed by the processor further performs the steps of:
when a target page generation instruction is detected, triggering baseline version access operation, and acquiring an HTML page template according to the baseline version access operation;
and replacing the page content of the HTML page template with the resource file of the target page to generate a corresponding target page.
In one embodiment, the computer program when executed by the processor further performs the steps of:
generating a plurality of replacement keys based on the page content and layout characteristics of the HTML page template;
when any replacement key is detected to be triggered, acquiring a resource extraction address corresponding to the replacement key, and acquiring a resource file of a target page according to the resource extraction address;
and replacing the page content of the HTML page template with the resource file of the target page to generate a corresponding target page.
In one embodiment, the computer program when executed by the processor further performs the steps of:
analyzing the color values of the color matching of the reference page based on the color matching scheme and the resource file to obtain the color matching corresponding to the label positions with the same color numbers;
and clustering the color matching corresponding to the label positions with the same color number to obtain color number clusters based on the label positions, and determining the color numbers as the page theme colors.
In one embodiment, the computer program when executed by the processor further performs the steps of:
extracting display keywords of the website mark from the resource file, and determining the resource attribute of the website mark according to the resource file; displaying the keywords as a top toolbar, and the resource attribute of the website mark is a picture attribute;
determining the display position of the website mark based on the association of the layout characteristics and the display keywords; the website logo is located at the top of the page corresponding to the top toolbar.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring all page contents of the page layout file, and extracting tag positions of all the page contents;
acquiring page contents with the same tag position, and determining the page contents as similar page contents;
and clustering the similar page contents based on the label positions to obtain content clusters based on the label positions.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A page generation method based on an HTML template, the method comprising:
acquiring and identifying a reference page, and capturing a page layout file and a resource file of the reference page; the reference page is a website page of a baseline version;
determining similar page contents with the same label position according to the page layout file, and realizing clustering of the similar page contents based on the label position to obtain content clustering based on the label position;
extracting a public parameter of the content cluster, and determining the page content of the reference page based on the public parameter and the resource file;
performing templating processing on the page content of the reference page to generate an HTML template corresponding to the reference page;
and generating a corresponding target page according to the HTML template and the resource file of the target page.
2. The method of claim 1, wherein generating the corresponding target page according to the HTML template and the resource file of the target page comprises:
when a target page generation instruction is detected, triggering baseline version access operation, and acquiring an HTML page template according to the baseline version access operation;
and replacing the page content of the HTML page template with the resource file of the target page to generate a corresponding target page.
3. The method of claim 2, wherein replacing the page content of the HTML page template with the resource file of the target page, and generating the corresponding target page comprises:
generating a plurality of replacement keys based on the page content and layout characteristics of the HTML page template;
when any replacement key is detected to be triggered, acquiring a resource extraction address corresponding to the replacement key, and acquiring a resource file of a target page according to the resource extraction address;
and replacing the page content of the HTML page template with the resource file of the target page to generate a corresponding target page.
4. The method of any of claims 1-3, wherein the common parameter comprises a color scheme, and wherein the page content comprises a page theme color; the determining the page content of the page based on the common parameters and the resource file comprises:
analyzing the color values of the color matching of the reference page based on the color matching scheme and the resource file to obtain the color matching corresponding to the label positions with the same color numbers;
and clustering the color matching corresponding to the label positions with the same color number to obtain color number clusters based on the label positions, and determining the color numbers to be the page theme colors.
5. The method of any of claims 1 to 3, wherein the common parameters include layout characteristics, and the page content includes a location of a website banner and resource attributes; the determining the page content of the page based on the common parameters and the resource file comprises:
extracting display keywords of the website mark from the resource file, and determining the resource attribute of the website mark according to the resource file; the display keyword is a top toolbar, and the resource attribute of the website mark is a picture attribute;
determining the display position of the website mark based on the association of the layout characteristics and the display keywords; the website mark is positioned at the top of the page corresponding to the top toolbar.
6. The method according to any one of claims 1 to 3, wherein the determining similar page contents with the same tag bits according to the page layout file and implementing clustering of the similar page contents based on the tag bits to obtain content clusters based on the tag bits comprises:
acquiring all page contents of the page layout file, and extracting tag positions of all the page contents;
acquiring page contents with the same tag position, and determining the page contents as similar page contents;
and clustering the similar page content based on the label position to obtain content clusters based on the label position.
7. An apparatus for generating a page based on an HTML template, the apparatus comprising:
the system comprises a reference page identification module, a page layout module and a resource module, wherein the reference page identification module is used for acquiring and identifying a reference page and capturing a page layout file and a resource file of the reference page; the reference page is a website page of a baseline version;
the content clustering module is used for determining similar page contents with the same label position according to the page layout file, and realizing clustering of the similar page contents based on the label position to obtain content clustering based on the label position;
the public parameter extraction module is used for extracting the public parameter of the content cluster and determining the page content of the page based on the public parameter and the resource file;
the HTML template generating module is used for carrying out templating processing on the basis of the page content of the reference page and generating an HTML template corresponding to the reference page;
and the target page generating module is used for generating a corresponding target page according to the HTML template and the resource file of the target page.
8. The HTML template based page generating apparatus of claim 7, wherein the target page generating module is further configured to:
generating a plurality of replacement keys based on the page content and layout characteristics of the HTML page template;
when any replacement key is detected to be triggered, acquiring a resource extraction address corresponding to the replacement key, and acquiring a resource file of a target page according to the resource extraction address;
and replacing the page content of the HTML page template with the resource file of the target page to generate a corresponding target page.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 6.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
CN202010273181.0A 2020-04-09 2020-04-09 Page generation method and device based on HTML (Hypertext markup language) template and computer equipment Pending CN111552903A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010273181.0A CN111552903A (en) 2020-04-09 2020-04-09 Page generation method and device based on HTML (Hypertext markup language) template and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010273181.0A CN111552903A (en) 2020-04-09 2020-04-09 Page generation method and device based on HTML (Hypertext markup language) template and computer equipment

Publications (1)

Publication Number Publication Date
CN111552903A true CN111552903A (en) 2020-08-18

Family

ID=72005668

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010273181.0A Pending CN111552903A (en) 2020-04-09 2020-04-09 Page generation method and device based on HTML (Hypertext markup language) template and computer equipment

Country Status (1)

Country Link
CN (1) CN111552903A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112269605A (en) * 2020-11-12 2021-01-26 北京百度网讯科技有限公司 Skin replacement method and device, electronic equipment and storage medium
CN112818277A (en) * 2021-01-25 2021-05-18 京东方科技集团股份有限公司 Webpage generation method and device, storage medium and electronic equipment
CN114546389A (en) * 2022-04-25 2022-05-27 浙江大华技术股份有限公司 Front-end page generation method, audio and video analysis method, device and medium
CN114968447A (en) * 2022-03-30 2022-08-30 中国人寿保险股份有限公司 Online webpage generation and management method and related equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112269605A (en) * 2020-11-12 2021-01-26 北京百度网讯科技有限公司 Skin replacement method and device, electronic equipment and storage medium
CN112818277A (en) * 2021-01-25 2021-05-18 京东方科技集团股份有限公司 Webpage generation method and device, storage medium and electronic equipment
CN114968447A (en) * 2022-03-30 2022-08-30 中国人寿保险股份有限公司 Online webpage generation and management method and related equipment
CN114546389A (en) * 2022-04-25 2022-05-27 浙江大华技术股份有限公司 Front-end page generation method, audio and video analysis method, device and medium

Similar Documents

Publication Publication Date Title
CN108446116B (en) Application program page generation method and device, computer equipment and storage medium
CN111552903A (en) Page generation method and device based on HTML (Hypertext markup language) template and computer equipment
CN108932122B (en) Interface document generation method, device, computer equipment and storage medium
CN109901834B (en) Document page generation method, device, computer equipment and storage medium
CN109712218B (en) Electronic book note processing method, handwriting reading equipment and storage medium
CN109814854B (en) Project framework generation method, device, computer equipment and storage medium
CN111898411B (en) Text image labeling system, method, computer device and storage medium
CN108664595B (en) Domain knowledge base construction method and device, computer equipment and storage medium
CN108595697B (en) Webpage integration method, device and system
CN109032917B (en) Page debugging method and system, mobile terminal and computer terminal
CN110110152B (en) Method and device for processing mind map, computer equipment and storage medium
CN112115338A (en) Page query request processing method, device, equipment and storage medium
CN111291533B (en) Sentence segment to be displayed display method and device, computer equipment and storage medium
CN110955608B (en) Test data processing method, device, computer equipment and storage medium
CN112131837A (en) Service report configuration method, device, computer equipment and storage medium
CN110647350A (en) Interface document generation method and device, computer equipment and storage medium
CN111783019A (en) Browser sub-page creation method and device, computer equipment and storage medium
CN117093386A (en) Page screenshot method, device, computer equipment and storage medium
CN112559938A (en) Electronic seal file generation method and device, computer equipment and storage medium
JP2005322082A (en) Document attribute input device and method
CN111597151A (en) File generation method and device, computer equipment and storage medium
CN115061688B (en) Page effect display method, computing device and storage medium
CN110222290B (en) Page generation method and device, computer equipment and storage medium
CN110908570B (en) Image processing method, device, terminal and storage medium
CN115293873A (en) Page processing method and device for credit granting flow, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination