Web page generation method, device, storage medium and electronic device
By adding the page components and content information selected by the user to the basic web page template and converting it into a json object to generate HTML files, the problem of cumbersome web page maintenance in the existing technology is solved, and the function of quickly generating and updating static web pages is realized, which improves the Efficiency and user experience of web page maintenance.
Patent Information
- Application Number
- CN202110099029.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-25
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2041-01-25
AI Technical Summary
In the existing technology, web page maintenance is relatively cumbersome. Once the web page is updated, it is necessary to re-update the web page content in a complex web page creation process, which takes a long time and cannot meet the needs of quickly building and updating the website.
A web page generation method is proposed. By adding the page components selected by the user to the basic web page template, a primary web page template is generated, and the user-configured page content information is added to the primary web page template, which is converted into a json object, using json object and reservation. The file converter generates an HTML file with content data, and ends up with a static web page.
Simplifies the web page creation process, and users can realize web page maintenance through simple operations. No matter how complex the front-end configuration data changes or how complex the web page template changes, they can quickly generate and update static web pages, improving the efficiency and user experience of web page maintenance. .
Smart Images

Figure CN112818277B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of the Internet, and in particular to a webpage generation method, device, storage medium and electronic device. Background Art
[0002] In the related art, web page content management usually includes data maintained in the background and web page display templates maintained in the front end to control the front end display content, or static content displayed in the front end and edited and stored by the background.
[0003] For the first method, since the web page display template is maintained by the front end, the front end page needs to be edited, repackaged, deployed, and put online when the web page display template is changed, and the web page maintenance efficiency is low; for the second method, the data is edited and stored by the background, and it is difficult for users to dynamically add and modify display attributes (such as titles, etc.), and it is also difficult to achieve cross-site content reuse.
[0004] The maintenance of the above web pages is relatively cumbersome. Once a web page is updated, a relatively complicated web page creation process is required to re-update the web page content, which is time-consuming and cannot meet the needs of quickly building and updating websites. Summary of the invention
[0005] In view of this, the embodiments of the present disclosure propose a web page generation method, device, storage medium and electronic device to solve the following problems in the prior art: web page maintenance is relatively cumbersome, and once a web page is updated, a relatively complex web page creation process is required to re-update the web page content, which is time-consuming and cannot meet the needs of quickly building and updating websites.
[0006] On the one hand, an embodiment of the present disclosure proposes a web page generation method, including: adding a page component selected by a user to a predetermined position in a basic web page template to obtain a primary web page template, wherein the basic web page template is a modular operation interface corresponding to an HTML file; adding page content information configured by the user for the page component in the primary web page template; converting all of the page components and all of the page content information into a json object; generating an HTML file with content data based on the json object and a predetermined file converter, and saving the HTML file based on the actual path information of the HTML file to obtain a static web page.
[0007] In some embodiments, before adding the page component selected by the user to a predetermined position in the basic web page template, it also includes: in response to a trigger operation to create the basic web page template, determining based on the structural information of the page whether there is a name identical to the initial file name of the HTML file in the same level storage directory where the HTML file to be generated is located; if there is a name identical to the initial file name, reallocating the initial file name for the HTML file to be generated.
[0008] In some embodiments, after determining whether there is a name identical to the initial file name of the HTML file in the same-level storage directory where the HTML file to be generated is located based on the structural information of the page, it also includes: in the case where there is no name identical to the initial file name, naming the HTML file based on the initial file name, and determining the actual path information of the HTML file to store the HTML file.
[0009] In some embodiments, adding page content information configured by the user for the page component in the primary web page template includes: determining the data type of each data source corresponding to the predetermined page data obtained through a predetermined interface; configuring a corresponding data conversion component according to the type of the data type, so as to convert the data from different data sources into the predetermined page data of the predetermined type through the data conversion component.
[0010] On the other hand, an embodiment of the present disclosure proposes a web page generation device, including: a first adding module, used to add a page component selected by a user to a predetermined position in a basic web page template to obtain a primary web page template, wherein the basic web page template is a modular operation interface corresponding to an HTML file; a second adding module, used to add page content information selected by the user as a page component in the primary web page template; a conversion module, used to convert all of the page components and all of the page content information into a json object; a generation module, used to generate an HTML file with content data based on the json object and a predetermined file converter, and save the HTML file according to the actual path information of the HTML file to obtain a static web page.
[0011] In some embodiments, it also includes: a determination module, which is used to respond to the trigger operation of creating the basic web page template, and determine whether there is a name that is the same as the initial file name of the HTML file in the same level storage directory where the HTML file to be generated is located according to the structural information of the page; and a renaming module, which is used to reallocate the initial file name to the HTML file to be generated when there is a name that is the same as the initial file name.
[0012] In some embodiments, it also includes: a creation module for naming the HTML file according to the initial file name when there is no name identical to the initial file name, and determining the actual path information of the HTML file to store the HTML file.
[0013] In some embodiments, the second adding module is specifically used to: determine the data types of the predetermined page data obtained through the predetermined interface corresponding to the respective data sources; configure the corresponding data conversion component according to the type of the data type, so as to convert the data from different data sources into the predetermined page data of the predetermined type through the data conversion component.
[0014] On the other hand, an embodiment of the present disclosure provides a storage medium storing a computer program, which implements the method provided by any embodiment of the present disclosure when the computer program is executed by a processor.
[0015] On the other hand, an embodiment of the present disclosure provides an electronic device, which includes at least a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the method provided in any embodiment of the present disclosure when executing the computer program in the memory.
[0016] In the disclosed embodiment, the user can configure the static page he wants to obtain through the basic web page template, and after configuring the primary web page template, configure the corresponding data for the primary web page template, and uniformly convert the front-end configuration data obtained by modularization into a json object so that the front-end configuration data can be recognized, and then generate an HTML file to obtain a usable static web page. The entire web page creation process of the disclosed embodiment is relatively simple, and only complex front-end configuration data needs to be uniformly converted into a json object. No matter how complex the front-end configuration data changes or how complex the web page template changes, only simple operations are needed to achieve web page maintenance, and the user experience is good. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0018] Figure 1 A flowchart of a webpage generation method provided in the first embodiment of the present disclosure;
[0019] Figure 2 A schematic diagram of an interface in which a basic web page template provided in the first embodiment of the present disclosure is provided with page components;
[0020] Figure 3 A diagram of the conversion process of data from different data sources provided in the first embodiment of the present disclosure;
[0021] Figure 4 A diagram of a generation process of an HTML file with an initial file name provided for the first embodiment of the present disclosure;
[0022] Figure 5 A schematic diagram of the structure of a webpage generating device provided in the second embodiment of the present disclosure;
[0023] Figure 6 A schematic diagram of the structure of an electronic device provided in the fourth embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings of the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the described embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0025] Unless otherwise defined, the technical terms or scientific terms used in the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0026] In order to keep the following description of the embodiments of the present disclosure clear and concise, the present disclosure omits detailed descriptions of well-known functions and well-known components.
[0027] The first embodiment of the present disclosure provides a method for generating a web page. The process of the method is as follows: Figure 1 As shown, steps S101 to S104 are included:
[0028] S101, adding a page component selected by a user to a predetermined position in a basic web page template to obtain a primary web page template, wherein the basic web page template is a modular operation interface corresponding to an HTML file.
[0029] When creating a static web page, a basic web page template is required, and then the static web page layout you want to see can be built on the basic web page template; the basic web page template can be a blank template that does not include any layout, that is, a blank page, or it can be a template with a certain layout, that is, a blank page with some page components already set. Regardless of the form of the basic web page template, the user can adjust the layout in the basic web page template, that is, add, delete page components, or adjust the position of page components. The basic web page template is a modular operation interface corresponding to the HTML file. When the basic web page template is established, the HTML file already exists, but because the basic web page template has not been edited to add new content, the HTML file at this time may be blank. The basic web page template and the HTML file are similar to a mapping form, that is, the HTML file is a file that the user cannot see and cannot edit, and the basic web page template is visible and editable to the user.
[0030] The above-mentioned page components are also called web components. Different page components have different functions. For example, you can insert page components corresponding to tables, drop-down boxes, videos, pictures, etc. into the basic web page template, and then you can present the corresponding content in the final web page.
[0031] When the user completes the selection of the required page components and adds them to the corresponding positions in the basic web page template, a primary web page template is formed. The layout of the primary web page template is the visual state of the static web page that the user wants to obtain. The static web page refers to the web page corresponding to the HTML file. The data on the static web page can be dynamic or static. It does not mean that the data content of the web page is unchanging, nor does it mean that the web page cannot interact with the web page user.
[0032] For example Figure 2 As shown in the figure, the interface shown in the figure is a basic web page template, and a part of the page components have been added to the basic web page template. The upper part of the basic web page template is set with a page component that supports video display, the lower left corner is a page component that supports dynamic display of A chart, and the lower right corner is a page component that supports text display. Of course, Figure 2 This is just a simple example, and users are not limited to this when creating static web pages. Figure 2 Each page component in the is in a state where the page content information is not configured.
[0033] S102, adding page content information configured by the user for the page component to the primary web page template.
[0034] The primary web page template has been created. Next, you need to add the content that the web page user can see in the static web page to each page component. This content is the page content information, which is configured by the user. The page content information can be different content such as pictures, videos, text, etc., as long as the user wants to display it on the web page interface.
[0035] The above-mentioned page content information may be pictures, texts and other contents, or may be tables or charts that need to be dynamically generated. For tables or charts that need to be dynamically generated, the existing technology can only transmit certain specific data in a fixed format, which cannot meet the requirements of data source diversity. Therefore, when the embodiment of the present disclosure adds page content information configured by the user for the page component in the primary web page template, a data conversion component is set up, so that the dynamically generated content such as tables or charts can obtain data from different data sources. Specifically, it is possible to first determine the data type of each data source corresponding to the predetermined page data obtained through the predetermined interface, and then configure the corresponding data conversion component according to the type of data type, so that the data from different data sources can be converted into predetermined page data of a predetermined type through the data conversion component.
[0036] Figure 3 The conversion process of data from different data sources is shown. Figure 3 The data source for a data in a dynamic line chart can come from Figure 3 Among the four business systems shown in the figure, business system 1 can directly give the specific value of the data in the form of static data, that is, directly give the specific values of the X coordinate, Y coordinate, and Z coordinate; business system 2 gives the specific values of the X coordinate, Y coordinate, and Z coordinate in the form of text, for example, "The specific value of the X coordinate is..." This kind of text data with words, it is necessary to extract the specific data of the X coordinate from the text data; business system 3 provides specific values through an API interface, for example, obtaining the specific value of the X coordinate through a certain API interface; business system 4 obtains the specific value of the X coordinate in the form of a database, for example, once the specific value of the X coordinate is needed, it needs to be obtained from a certain database. Figure 3 The contents in the brackets under the four business systems are the parameters needed to obtain specific values. For example, when obtaining data through the API interface of business system 3, it is necessary to know the request path, request parameters, request header and the request method called to obtain the specific value. Figure 3 This is only an example, and those skilled in the art can configure corresponding data sources for tables or charts that need to be dynamically generated according to actual needs.
[0037] When the page content information is configured, in order to speed up the speed at which web users can find the web page when searching for the web page, TDK information (ie, the website title, description and keywords) can also be set for the entire web page.
[0038] S103, converting all page components and all page content information into a json object.
[0039] Since the page components and page content information have been configured for the entire page, the basic data of the entire static web page is already available. However, the modular front-end configuration data (i.e., page components and page content information) cannot directly generate HTML files. Therefore, the embodiment of the present disclosure uses json objects as an intermediate medium, that is, converting page components and page content information into json objects, generating HTML files through unified data in json format, and then realizing the conversion of modular configuration data to real static web pages.
[0040] S104, generating an HTML file with content data according to the json object and a predetermined file converter, and saving the HTML file according to actual path information of the HTML file to obtain a static web page.
[0041] The json object has a json data format, which can be recognized by the system, so the json object can be converted into the content data of the HTML file using a predetermined file converter set according to predetermined requirements, thereby updating the content data of the HTML file. Since the actual path information of the HTML file has been generated when the basic web page template is created, the generated HTML file with content data can be saved, thereby obtaining a static web page that the user can use.
[0042] In the disclosed embodiment, the user can configure the static page he wants to obtain through the basic web page template, and after configuring the primary web page template, configure the corresponding data for the primary web page template, and uniformly convert the front-end configuration data obtained by modularization into a json object so that the front-end configuration data can be recognized, and then generate an HTML file to obtain a usable static web page. The entire web page creation process of the disclosed embodiment is relatively simple, and only complex front-end configuration data needs to be uniformly converted into a json object. No matter how complex the front-end configuration data changes or how complex the web page template changes, only simple operations are needed to achieve web page maintenance, and the user experience is good.
[0043] The basic web page template corresponds to an HTML file. The editing operation of the basic web page template is the process of generating the content data of the HTML file. When the editing operation of the basic web page template is completed and the primary web page template is obtained, it is equivalent to having completed a part of the HTML file. The subsequent configuration of specific page content information can complete the other part of the entire HTML file; the previously obtained part and the other part are processed together to generate the final HTML file with content data. When generating the final HTML file, the initial file name initially determined will be directly set as the file name of the HTML file. The file name is generated when the basic web page template is initially established. Specifically, before adding the page component selected by the user to the predetermined position in the basic web page template, in response to the trigger operation of creating the basic web page template, it is determined according to the structural information of the page (i.e., the tree structure information) whether there is a name identical to the initial file name of the HTML file in the same-level storage directory where the HTML file to be generated is located; if there is a name identical to the initial file name, the initial file name is reallocated to the HTML file to be generated to redetermine the initial file name of the HTML file; if there is no name identical to the initial file name, the HTML file is named according to the initial file name, and the actual path information of the HTML file (i.e., the hierarchical relationship, which file or folder it belongs to) is determined to store the HTML file.
[0044] Of course, when saving the HTML file according to the actual path information of the HTML file, the file name of the HTML file can also be modified, as long as there is no duplicate name under the same level storage directory where the HTML file is located.
[0045] like Figure 4 The figure shows the process of generating the HTML file with the initial file name. Figure 4 The process shown can be divided into the front-end and the back-end in specific implementation. The front-end is the interface where the web page template is located that the user can see, and the back-end is the operation that the user cannot see. The process is as follows:
[0046] The front end creates a basic web page template. After the creation, the front end completes the construction, design and layout of page components and page content in the basic web page template according to actual needs. The front end transmits the designed page content information and page components to the back end in json format. The back end records the structural information of the page when the front end creates the basic web page template to determine the initial file name, and detects whether there is a rename. If there is no rename, the file name of the HTML file can be determined; based on the actual path information, the HTML file with content data generated according to the json object is stored.
[0047] The disclosed embodiment manages pages according to a hierarchical structure, and manages the pages according to modules; pages at different levels can set their states, such as display mode, jump mode, etc.
[0048] The second embodiment of the present disclosure provides a webpage generation device, the structure of which is shown in FIG. Figure 5 As shown, including:
[0049] A first adding module 10 is used to add a page component selected by a user to a predetermined position in a basic web page template to obtain a primary web page template, wherein the basic web page template is a modular operation interface corresponding to an HTML file; a second adding module 20 is coupled to the first adding module 10 and is used to add page content information selected by the user as a page component in the primary web page template; a conversion module 30 is coupled to the second adding module 20 and is used to convert all page components and all page content information into a json object; a generation module 40 is coupled to the conversion module 30 and is used to generate an HTML file with content data based on the json object and a predetermined file converter, and save the HTML file according to the actual path information of the HTML file to obtain a static web page.
[0050] When creating a static web page, a basic web page template is required, and then the static web page layout you want to see can be built on the basic web page template; the basic web page template can be a blank template that does not include any layout, that is, a blank page, or it can be a template with a certain layout, that is, a blank page with some page components already set. Regardless of the form of the basic web page template, the user can adjust the layout in the basic web page template, that is, add, delete page components, or adjust the position of page components. The basic web page template is a modular operation interface corresponding to the HTML file. When the basic web page template is established, the HTML file already exists, but because the basic web page template has not been edited to add new content, the HTML file at this time may be blank. The basic web page template and the HTML file are similar to a mapping form, that is, the HTML file is a file that the user cannot see and cannot edit, and the basic web page template is visible and editable to the user.
[0051] The above-mentioned page components are also called web components. Different page components have different functions. For example, you can insert page components corresponding to tables, drop-down boxes, videos, pictures, etc. into the basic web page template, and then you can present the corresponding content in the final web page.
[0052] When the user completes the selection of the required page components and adds them to the corresponding positions in the basic web page template, a primary web page template is formed. The layout of the primary web page template is the visual state of the static web page that the user wants to obtain. The static web page refers to the web page corresponding to the HTML file. The data on the static web page can be dynamic or static. It does not mean that the data content of the web page is unchanging, nor does it mean that the web page cannot interact with the web page user.
[0053] The primary web page template has been created. Next, you need to add the content that the web page user can see in the static web page to each page component. This content is the page content information, which is configured by the user. The page content information can be different content such as pictures, videos, text, etc., as long as the user wants to display it on the web page interface.
[0054] The above-mentioned page content information may be pictures, texts and other contents, or it may be tables or charts that need to be dynamically generated. For tables or charts that need to be dynamically generated, the existing technology can only transmit certain specific data in a fixed format, which cannot meet the requirements of data source diversity. Therefore, when the embodiment of the present disclosure adds page content information configured by the user for the page component in the primary web page template, a data conversion component is set up, so that the dynamically generated content such as tables or charts can obtain data from different data sources. Specifically, the second adding module can be used to: determine the data type of each data source corresponding to the predetermined page data obtained through the predetermined interface, and configure the corresponding data conversion component according to the type of data type, so as to convert the data from different data sources into predetermined page data of a predetermined type through the data conversion component.
[0055] When the page content information is configured, in order to speed up the speed at which web users can find the web page when searching for the web page, TDK information can also be set for the entire web page.
[0056] Since the page components and page content information have been configured for the entire page, the basic data of the entire static web page is already available. However, the modular front-end configuration data cannot directly generate HTML files. Therefore, the embodiment of the disclosure uses json objects as an intermediate medium, that is, converting page components and page content information into json objects, generating HTML files through unified data in json format, and then realizing the conversion of modular configuration data to real static web pages.
[0057] The json object has a json data format, which can be recognized by the system, so the json object can be converted into the content data of the HTML file using a predetermined file converter set according to predetermined requirements, thereby updating the content data of the HTML file. Since the actual path information of the HTML file has been generated when the basic web page template is created, the generated HTML file with content data can be saved, thereby obtaining a static web page that the user can use.
[0058] In the disclosed embodiment, the user can configure the static page he wants to obtain through the basic web page template, and after configuring the primary web page template, configure the corresponding data for the primary web page template, and uniformly convert the front-end configuration data obtained by modularization into a json object so that the front-end configuration data can be recognized, and then generate an HTML file to obtain a usable static web page. The entire web page creation process of the disclosed embodiment is relatively simple, and only complex front-end configuration data needs to be uniformly converted into a json object. No matter how complex the front-end configuration data changes or how complex the web page template changes, only simple operations are needed to achieve web page maintenance, and the user experience is good.
[0059] The basic web page template corresponds to an HTML file. The editing operation of the basic web page template is the process of generating the content data of the HTML file. When the editing operation of the basic web page template is completed and the primary web page template is obtained, it is equivalent to having completed a part of the HTML file. The specific page content information can be configured later to complete the other part of the entire HTML file. The previously obtained part and the other part are processed together to generate the final HTML file with content data. When the final HTML file is generated, the initial file name initially determined will be directly set as the file name of the HTML file. The file name is generated when the basic web page template is initially established. Specifically, the embodiment of the present disclosure may also include: a determination module, which is used to respond to the trigger operation of creating the basic web page template, and determine whether there is a name that is the same as the initial file name of the HTML file in the same level storage directory where the HTML file to be generated is located according to the structural information of the page; a renaming module, coupled with the determination module, is used to reallocate the initial file name to the HTML file to be generated when there is a name that is the same as the initial file name; a creation module, coupled with the determination module and the first adding module, is used to name the HTML file according to the initial file name when there is no name that is the same as the initial file name, and determine the actual path information of the HTML file to store the HTML file.
[0060] Of course, when saving the HTML file according to the actual path information of the HTML file, the file name of the HTML file can also be modified, as long as there is no duplicate name under the same level storage directory where the HTML file is located.
[0061] A third embodiment of the present disclosure provides a storage medium, which is a computer-readable medium and stores a computer program. When the computer program is executed by a processor, the method provided by any embodiment of the present disclosure is implemented, including the following steps S11 to S14:
[0062] S11, adding the page component selected by the user to a predetermined position in the basic webpage template to obtain a primary webpage template, wherein the basic webpage template is a modular operation interface corresponding to the HTML file;
[0063] S12, adding page content information configured by the user for the page component to the primary web page template;
[0064] S13, converting all page components and all page content information into json objects;
[0065] S14, generating an HTML file with content data according to the json object and a predetermined file converter, and saving the HTML file according to actual path information of the HTML file to obtain a static web page.
[0066] Before the processor executes the step of adding the page component selected by the user to the predetermined position in the basic web page template, the processor also executes the following steps: in response to the trigger operation of creating the basic web page template, determining whether there is a file with the same name as the initial file name of the HTML file in the same level storage directory where the HTML file to be generated is located according to the structure information of the page;
[0067] In the case where there is a name identical to the initial file name, the initial file name is newly assigned to the HTML file to be generated.
[0068] After the computer program is executed by the processor to determine whether there is a name identical to the initial file name of the HTML file in the same-level storage directory where the HTML file to be generated is located based on the structural information of the page, the processor also executes the following steps: if there is no name identical to the initial file name, name the HTML file based on the initial file name, and determine the actual path information of the HTML file to store the HTML file.
[0069] When the computer program is executed by the processor to add the page content information configured by the user for the page component in the primary web page template, the processor specifically executes the following steps: determining the data type of each data source corresponding to the predetermined page data obtained through the predetermined interface; configuring the corresponding data conversion component according to the type of data type, so as to convert the data from different data sources into predetermined page data of a predetermined type through the data conversion component.
[0070] In the disclosed embodiment, the user can configure the static page he wants to obtain through the basic web page template, and after configuring the primary web page template, configure the corresponding data for the primary web page template, and uniformly convert the front-end configuration data obtained by modularization into a json object so that the front-end configuration data can be recognized, and then generate an HTML file to obtain a usable static web page. The entire web page creation process of the disclosed embodiment is relatively simple, and only complex front-end configuration data needs to be uniformly converted into a json object. No matter how complex the front-end configuration data changes or how complex the web page template changes, only simple operations are needed to achieve web page maintenance, and the user experience is good.
[0071] Optionally, in this embodiment, the above-mentioned storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk. Optionally, in this embodiment, the processor executes the method steps recorded in the above-mentioned embodiment according to the program code stored in the storage medium. Optionally, the specific examples in this embodiment can refer to the examples described in the above-mentioned embodiment and the optional implementation mode, and this embodiment will not be repeated here. Obviously, it should be understood by those skilled in the art that the above-mentioned modules or steps of the present disclosure can be implemented with a general computing device, which can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. Optionally, they can be implemented with executable program codes of computing devices, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that here, or they can be made into individual integrated circuit modules respectively, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the present disclosure is not limited to any specific combination of hardware and software.
[0072] A fourth embodiment of the present disclosure provides an electronic device. The structural diagram of the electronic device can be as follows: Figure 6As shown, at least a memory 901 and a processor 902 are included, the memory 901 stores a computer program, and the processor 902 implements the method provided by any embodiment of the present disclosure when executing the computer program on the memory 901. Exemplarily, the steps of the electronic device computer program are as follows S21 to S24:
[0073] S21, adding the page component selected by the user to a predetermined position in the basic web page template to obtain a primary web page template, wherein the basic web page template is a modular operation interface corresponding to the HTML file;
[0074] S22, adding page content information configured by the user for the page component to the primary web page template;
[0075] S23, converting all page components and all page content information into JSON objects;
[0076] S24, generating an HTML file with content data according to the json object and a predetermined file converter, and saving the HTML file according to actual path information of the HTML file to obtain a static web page.
[0077] Before executing a computer program stored in a memory for adding a page component selected by a user to a predetermined position in a basic web page template, the processor also executes the following computer program: in response to a trigger operation for creating a basic web page template, determining, based on the structural information of the page, whether there exists a name identical to the initial file name of the HTML file in a storage directory at the same level as the HTML file to be generated; if there exists a name identical to the initial file name, reallocating the initial file name to the HTML file to be generated.
[0078] After executing a computer program stored in the memory that determines, based on structural information of the page, whether there exists a file with the same name as the initial file name of the HTML file in a storage directory at the same level where the HTML file to be generated is located, the processor further executes the following computer program: in the absence of a file with the same name as the initial file name, the HTML file is named according to the initial file name, and actual path information of the HTML file is determined to store the HTML file.
[0079] When the processor executes a computer program stored in the memory for adding page content information configured by the user for a page component to a primary web page template, the processor specifically executes the following computer program: determining the data type of each data source corresponding to the predetermined page data obtained through a predetermined interface; configuring a corresponding data conversion component according to the type of data type, so as to convert data from different data sources into predetermined page data of a predetermined type through the data conversion component.
[0080] In the disclosed embodiment, the user can configure the static page he wants to obtain through the basic web page template, and after configuring the primary web page template, configure the corresponding data for the primary web page template, and uniformly convert the front-end configuration data obtained by modularization into a json object so that the front-end configuration data can be recognized, and then generate an HTML file to obtain a usable static web page. The entire web page creation process of the disclosed embodiment is relatively simple, and only complex front-end configuration data needs to be uniformly converted into a json object. No matter how complex the front-end configuration data changes or how complex the web page template changes, only simple operations are needed to achieve web page maintenance, and the user experience is good.
[0081] In addition, although exemplary embodiments have been described herein, the scope includes any and all embodiments based on the present disclosure with equivalent elements, modifications, omissions, combinations (e.g., various embodiments intersecting schemes), adaptations or changes. The elements in the claims will be interpreted broadly based on the language adopted in the claims, and are not limited to the examples described in this specification or during the implementation of this application, and the examples will be interpreted as non-exclusive. Therefore, this specification and examples are intended to be considered as examples only, and the true scope and spirit are indicated by the following claims and the full scope of their equivalents.
[0082] The above description is intended to be illustrative rather than restrictive. For example, the above examples (or one or more of them) can be used in combination with each other. For example, a person of ordinary skill in the art can use other embodiments when reading the above description. In addition, in the above-mentioned specific embodiments, various features can be grouped together to simplify the present disclosure. This should not be interpreted as an intention that a disclosed feature that is not required to be protected is necessary for any claim. On the contrary, the subject matter of the present disclosure may be less than all the features of a specific disclosed embodiment. Thus, the following claims are incorporated into the specific embodiments as examples or embodiments, wherein each claim is independently used as a separate embodiment, and it is considered that these embodiments can be combined with each other in various combinations or arrangements. The scope of the present disclosure should be determined with reference to the attached claims and the full scope of equivalent forms granted by these claims.
[0083] Multiple embodiments of the present disclosure are described in detail above, but the present disclosure is not limited to these specific embodiments. Those skilled in the art can make various variations and modifications to the embodiments based on the concepts of the present disclosure, and these variations and modifications should all fall within the scope of protection required by the present disclosure.
Claims
1. A web page generation method, characterized in that: include: In response to a trigger operation of creating a basic web page template, determining, based on the structure information of the page, whether there is a file with the same name as the initial file name of the HTML file in the same level storage directory as the HTML file to be generated; In the case where there is a name identical to the initial file name, reassigning the initial file name to the HTML file to be generated; Adding the page component selected by the user to a predetermined position in the basic web page template to obtain a primary web page template, wherein the basic web page template is a modular operation interface corresponding to the HTML file; Adding page content information configured by the user for the page component in the primary web page template; Convert all the page components and all the page content information into json objects; An HTML file with content data is generated according to the json object and a predetermined file converter, and the HTML file is saved according to actual path information of the HTML file to obtain a static web page.
2. The webpage generation method according to claim 1, characterized in that: After determining, according to the structural information of the page, whether there is a file with the same name as the initial file name of the HTML file in the same level storage directory where the HTML file to be generated is located, the method further includes: In the case that there is no file name identical to the initial file name, the HTML file is named according to the initial file name, and the actual path information of the HTML file is determined to store the HTML file.
3. The web page generation method according to claim 1 or 2, characterized in that: The adding of page content information configured by the user for the page component in the primary webpage template includes: Determine the data types of each data source corresponding to the predetermined page data obtained through the predetermined interface; A corresponding data conversion component is configured according to the type of the data type, so as to convert data from different data sources into the predetermined page data of a predetermined type through the data conversion component.
4. A web page generating device, characterized in that: include: A determination module, for responding to a trigger operation of creating a basic webpage template, and determining, based on the structure information of the page, whether there is a file with the same name as the initial file name of the HTML file in the same level storage directory as the HTML file to be generated; a renaming module, for reallocating an initial file name to the HTML file to be generated if there is a name identical to the initial file name; A first adding module, used to add the page component selected by the user to a predetermined position in the basic web page template to obtain a primary web page template, wherein the basic web page template is a modular operation interface corresponding to the HTML file; A second adding module, used to add page content information of the user as a page component in the primary web page template; A conversion module, used to convert all the page components and all the page content information into JSON objects; The generating module is used to generate an HTML file with content data according to the json object and a predetermined file converter, and save the HTML file according to the actual path information of the HTML file to obtain a static web page.
5. The web page generating device according to claim 4, characterized in that: Also includes: A creation module is used to name the HTML file according to the initial file name when there is no file name identical to the initial file name, and determine the actual path information of the HTML file to store the HTML file.
6. The web page generating device according to any one of claims 4 or 5, characterized in that: The second adding module is specifically used for: Determine the data types of each data source corresponding to the predetermined page data obtained through the predetermined interface; A corresponding data conversion component is configured according to the type of the data type, so as to convert data from different data sources into the predetermined page data of a predetermined type through the data conversion component.
7. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
8. An electronic device comprising at least a memory and a processor, wherein a computer program is stored in the memory, wherein: The processor implements the steps of the method of any one of claims 1 to 3 when executing the computer program on the memory.
Citation Information
Patent Citations
JSON-oriented webpage modular design and asynchronous loading method
CN107357817A
Static web site construction method, static web site construction service providing method, dynamic / static conversion processor, and dynamic / static conversion processing program
JP2010170453A
Automated web site creation system
US6732332B1