Web page generation method, device, electronic device and computer-readable storage medium
By displaying and generating display data of web page materials in the preview interface, and directly using the web page generation algorithm to generate web page data, the problem of low web page generation efficiency in the existing technology is solved, and a more efficient web page generation process is achieved.
Patent Information
- Application Number
- CN201811140435.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-09-28
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2038-09-28
AI Technical Summary
In the existing technology, web page generation efficiency is low, and web designers need to wait for front-end developers to write code, resulting in low generation efficiency.
By obtaining the materials that need to be displayed in the landing web page and their display rules, displaying the materials in the preset preview interface, and generating display data of the materials according to the display rules, and directly generating web page data of the landing web page using the preset web page generation algorithm.
The efficiency of web page generation is improved, allowing web designers to directly generate web page data of the target web page based on the display effect of the material in the preview interface, reducing the time to wait for encoding.
Smart Images

Figure CN109471625B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technologies, and particularly to a method, device, electronic device, and computer-readable storage medium for generating a web page. Background Art
[0002] With the rapid development of computer and Internet technologies, the network has become an indispensable part of people's lives. Most users obtain information on the network by browsing web pages.
[0003] In related technologies, the steps of generating a web page include: first, a web designer designs the expected effect of the web page, and then a front-end developer implements the expected effect of the web page in code.
[0004] However, in the above process, after the web designer hands over the expected effect diagram of the web page to the front-end developer, it is necessary to wait for the front-end developer to write code, resulting in low efficiency of web page generation.
[0005] Aiming at the technical problem of low efficiency in web page generation in related technologies, no effective solution has been proposed yet. Summary of the Invention
[0006] The purpose of the embodiments of the present invention is to provide a method, device, electronic device, and computer-readable storage medium for generating a web page, which can improve the efficiency of web page generation. The specific technical solutions are as follows:
[0007] In a first aspect, in order to achieve the above purpose, the embodiments of the present invention disclose a method for generating a web page, the method including: obtaining the materials to be displayed on the target web page and the display rules of the materials; displaying the materials in a preset preview interface according to the display rules; generating the display data of the materials according to the display rules; generating the web page data of the target web page by using a preset web page generation algorithm according to the materials and the display data.
[0008] Optionally, the obtaining the materials to be displayed on the target web page includes: receiving an upload instruction, where the upload instruction carries the materials; obtaining the materials according to the upload instruction.
[0009] Optionally, after obtaining the materials, the method further includes: storing the materials in a preset material resource library.
[0010] Optionally, the obtaining the materials to be displayed on the target web page includes; receiving a material selection instruction, where the material selection instruction carries the material identifier of the materials to be displayed on the target web page; obtaining the materials corresponding to the material identifier from a preset material resource library.
[0011] Optionally, the display rule includes at least one of the following: the display position of each piece of material in the preview interface; the display size of each piece of material in the preview interface; the display color of each piece of material in the preview interface.
[0012] Optionally, generating the display data of the material according to the display rule includes: receiving a generation instruction, where the generation instruction is used to indicate that the display effect of the material in the preview interface meets a preset condition; and generating the display data according to the display rule based on the generation instruction.
[0013] Optionally, after displaying the material in a preset preview interface according to the display rule, the method further includes: receiving an adjustment instruction for adjusting the material, where the adjustment instruction carries the adjusted display rule of the material; and displaying the material in the preview interface according to the adjusted display rule of the material.
[0014] In a second aspect, to achieve the above object, an embodiment of the present invention discloses a web page generation device, where the device includes: an acquisition module, configured to acquire materials to be displayed in a target web page and the display rules of the materials; a first display module, configured to display the materials in a preset preview interface according to the display rules; a first generation module, configured to generate the display data of the materials according to the display rules; and a second generation module, configured to generate the web page data of the target web page by using a preset web page generation algorithm according to the materials and the display data.
[0015] Optionally, the acquisition module includes: a first reception sub-module, configured to receive an upload instruction, where the upload instruction carries the materials; and a first acquisition sub-module, configured to acquire the materials according to the upload instruction.
[0016] Optionally, the acquisition module further includes: a storage sub-module, configured to store the materials in a preset material resource library.
[0017] Optionally, the acquisition module includes: a second reception sub-module, configured to receive a material selection instruction, where the material selection instruction carries the material identifier of the material to be displayed in the target web page; and a second acquisition sub-module, configured to acquire the material corresponding to the material identifier from a preset material resource library.
[0018] Optionally, the display rule includes at least one of the following: the display position of each piece of material in the preview interface; the display size of each piece of material in the preview interface; the display color of each piece of material in the preview interface.
[0019] Optionally, the first generation module is specifically configured to receive a generation instruction, where the generation instruction is used to indicate that the display effect of the material in the preview interface meets a preset condition; and based on the generation instruction, generate the display data according to the display rule.
[0020] Optionally, the device further includes: a receiving module, configured to receive an adjustment instruction for adjusting the material, where the adjustment instruction carries the adjusted display rule of the material; and a second display module, configured to display the material in the preview interface according to the adjusted display rule of the material.
[0021] In another aspect of the implementation of the present invention, in order to achieve the above object, an embodiment of the present invention further discloses an electronic device, where the electronic device includes a processor and a memory; the memory is used to store a computer program; and the processor is configured to, when executing the program stored in the memory, implement the web page generation method as described in the first aspect above.
[0022] In yet another aspect of the implementation of the present invention, a computer-readable storage medium is further provided, where instructions are stored in the computer-readable storage medium, and when the instructions run on a computer, the web page generation method as described in the first aspect above is implemented.
[0023] In yet another aspect of the implementation of the present invention, an embodiment of the present invention further provides a computer program product including instructions, and when the computer program product runs on a computer, the computer is caused to execute the web page generation method as described in the first aspect above.
[0024] The web page generation method, device, electronic device, and computer-readable storage medium provided by the embodiments of the present invention can obtain the materials to be displayed on the target web page and the display rules of the materials, display the materials in a preset preview interface according to the display rules, generate the display data of the materials according to the display rules, and generate the web page data of the target web page by using a preset web page generation algorithm based on the materials and the display data. Based on the above processing, the web page data of the target web page can be directly generated according to the display effect of the materials in the preview interface, thereby improving the web page generation efficiency.
[0025] Of course, it is not necessarily required that any product or method implementing the present invention simultaneously achieves all the above-mentioned advantages. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts.
[0027] Figure 1 Flow chart of a web page generation method provided by an embodiment of the present invention;
[0028] Figure 2 Flow chart of a method for obtaining materials provided by an embodiment of the present invention;
[0029] Figure 3 Flow chart of a second method for obtaining materials provided by an embodiment of the present invention;
[0030] Figure 4 Flow chart of a method for adjusting materials provided by an embodiment of the present invention;
[0031] Figure 5 Schematic diagram of a user operation for generating a web page provided by an embodiment of the present invention;
[0032] Figure 6 Structure diagram of a web page generation device provided by an embodiment of the present invention;
[0033] Figure 7 Structure diagram of a device for obtaining materials provided by an embodiment of the present invention;
[0034] Figure 8 Structure diagram of a second device for obtaining materials provided by an embodiment of the present invention;
[0035] Figure 9 Structure diagram of a second web page generation device provided by an embodiment of the present invention;
[0036] Figure 10 Structure diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners
[0037] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0038] The present invention application provides a method, apparatus, electronic device and computer-readable storage medium for generating a web page. The above method can be applied to a terminal or a server. In the embodiments of the present invention, the case where the above method is applied to a terminal is taken as an example for illustration, and other cases are similar. The terminal can obtain the materials to be displayed on the target web page and the display rules of the materials, and display the materials in a preset preview interface according to the display rules. The terminal can generate the display data of the materials according to the display rules, and generate the web page data of the target web page by using a preset web page generation algorithm based on the materials and the display data. Based on the above processing, the web page data of the target web page can be directly generated according to the display effect of the materials in the preview interface, thereby improving the web page generation efficiency.
[0039] The present invention will be introduced in detail below through specific embodiments.
[0040] See Figure 1 , Figure 1 which is a flowchart of a method for generating a web page provided by an embodiment of the present invention, including:
[0041] S101: Obtain the materials to be displayed on the target web page and the display rules of the materials.
[0042] In implementation, when a user needs to generate a target web page, the user can directly use the materials in the local resources of the terminal. The user can select the materials to be used in the material selection interface. The terminal can then receive the material selection instruction and search for the materials that the user needs to display on the target web page in the local resources. Or, if the materials required by the user are not available in the local resources of the terminal, the user can also upload the materials by himself; or, the user can also search for the materials to be used in the network. The user can input the material identifier or material type to be searched in the terminal, and the terminal can then receive the search instruction carrying the material identifier or material type. Then, the terminal can search in the network according to the search instruction to obtain the materials that the user needs to display on the target web page. Among them, the above materials can be one or more. The materials can include pictures, texts, etc. Specifically, the method for the terminal to obtain materials will be introduced in detail in subsequent embodiments.
[0043] After the user selects the materials, the user can also set the display rules of the materials on the target web page. The terminal will then receive the display setting instruction, and the display setting instruction can carry the display rules of the materials. The display rules of the materials can include the following rules: the position where the materials are displayed on the target web page, the size of the materials displayed on the target web page, and the color of the materials displayed on the target web page.
[0044] S102: Display the materials in a preset preview interface according to the display rules.
[0045] Among them, the preview interface can be an interface for displaying the display effect of the material on the target web page. The user can view the display effect of the material in the preview interface and, if necessary, adjust the display rules corresponding to the material so that the display effect of each material in the preview interface reaches the display effect of the ideal interface expected by the user.
[0046] In implementation, when there are multiple such materials, for each material, the terminal can display the material in the preview interface according to the display rules corresponding to the material.
[0047] In this step, for a certain material, if a certain rule is not included in the display rules corresponding to the material received by the terminal, the terminal can set the rule corresponding to the material to the default parameter, or, alternatively, can keep the rule corresponding to the material as the original parameter of the material. Exemplarily, for the picture material A, the original parameter of its size is 800×600, and the display rule corresponding to the picture material A received by the terminal is: centered display. At this time, the terminal can adjust the size of the picture material A to 400×300 according to the default picture size parameter 400×300 and display it centered in the preview interface. The terminal can also directly display the picture centered in the preview interface with a size of 800×600.
[0048] S103: Generate the display data of the material according to the display rules.
[0049] In implementation, for each material, the terminal can obtain the display rules corresponding to the material at the current moment and use the parameters of each rule of the display rules corresponding to the material as the display data of the material. For example, for a certain material, if the size of the material is 400×300 at present, the display data of the material includes the display size of the material (i.e., 400×300). In addition, if the material is centered display at present, the display data of the material can also include the display position information of the material (i.e., centered display).
[0050] It should be noted that for a certain material, the display rules corresponding to the material at the current moment can be the same as the display rules of the material obtained by the terminal in S101 above, or can be different from the display rules of the material obtained by the terminal in S101 above.
[0051] Optionally, the terminal can also generate display data according to the user's instruction. Specifically, the method for the terminal to generate display data can include the following steps:
[0052] Step 1, receive the generation instruction.
[0053] Among them, the generation instruction is used to indicate that the display effect of the material in the preview interface meets the preset conditions. The preset conditions can be the display effects of each material expected by the user in the preview interface.
[0054] In implementation, during the process that the user browses the preview interface and adjusts the display rules of each material, when the user determines that the display effect of each material reaches the ideal interface expected by the user, the user can input a generation instruction to the terminal. For example, a "Generate" button can be set in the preview interface. When the user determines that the display effect of each material reaches the ideal interface expected by the user, the user can click the "Generate" button to input a generation instruction to the terminal. Correspondingly, the terminal can receive the generation instruction input by the user.
[0055] Step 2: Based on the generation instruction, generate display data according to the display rules.
[0056] In implementation, the terminal can generate display data based on the generation instruction according to the display rules. Specifically, when the terminal receives the generation instruction, the terminal can generate the display data of each material according to the current display rules of each material. The method for the terminal to generate display data according to the display rules can refer to the detailed introduction of S103 above, which will not be elaborated here.
[0057] S104: According to the materials and the display data, use a preset web page generation algorithm to generate the web page data of the target web page.
[0058] In implementation, the preset web page generation algorithm can be installed in the terminal in the form of an application program. This application program can generate web page data according to the materials and the display data of the materials. The terminal can send the materials and the display data of the materials to this application program. After receiving the materials and the display data of the materials, the application program can generate the web page data of the target web page. Among them, the web page data can include the above-mentioned materials and the display rules of each material represented in code form. After generating the web page data, the terminal can store the web page data in the terminal, or send the web page data to the corresponding server in the format of a web page document, so that the user can access the server and then browse the target web page. The above-mentioned web page document can be a Hyper Text Markup Language (HTML) document.
[0059] It can be seen from the above that based on the web page generation method of the embodiments of the present invention, the user can directly generate the web page data of the target web page according to the display effect of the materials in the preview interface, thereby improving the generation efficiency of the web page.
[0060] Optionally, for the case where the materials required by the user are not available in the local resources of the terminal, the terminal can obtain the materials uploaded by the user. Refer to Figure 2 , Figure 2 which is a flowchart of a method for obtaining materials provided by the embodiments of the present invention. Specifically, the above-mentioned processing steps may include:
[0061] S201: Receive an upload instruction.
[0062] Among them, the upload instruction may carry materials (i.e., the materials uploaded by the user).
[0063] In implementation, if the materials required by the user are not available in the local resources of the terminal, the user can upload the materials to be displayed on the target web page to the terminal in the material upload interface. Then the terminal can receive the upload instruction input by the user. The user can upload one material at a time or multiple materials at a time.
[0064] S202: Obtain materials according to the upload instruction.
[0065] In implementation, the terminal can parse the upload instruction to obtain the materials uploaded by the user.
[0066] As can be seen from the above, based on the web page generation method of the embodiments of the present invention, the terminal can receive the materials uploaded by the user and generate web page data according to the materials uploaded by the user. Based on the above processing, the personalized web page design requirements of the user can be met, thereby improving the user experience.
[0067] Optionally, the terminal can also store the materials uploaded by the user. Specifically, after obtaining the materials uploaded by the user, the above method may further include:
[0068] Store the materials in a preset material resource library.
[0069] Among them, the material resource library may be the storage space in the terminal for storing materials. The material resource library may pre-store the materials preset by technicians. The terminal can store the materials in different partitions of the storage space according to the types of the materials, where the types of the materials may be pictures or texts.
[0070] In implementation, the terminal can store the materials uploaded by the user in a preset material resource library. Specifically, the terminal can store each material uploaded by the user in the corresponding partition in the material resource library according to the type of the material uploaded by the user.
[0071] As can be seen from the above, based on the web page generation method of the embodiments of the present invention, the terminal can store the materials uploaded by the user in the material resource library. Based on the above processing, the terminal can continuously enrich the material resource library to meet the higher web page design requirements of the user, thereby improving the user experience.
[0072] Optionally, it is also possible to enable the terminal to directly obtain materials from the local resources. Refer to Figure 3 , Figure 3 which is the flowchart of the second method for obtaining materials provided by the embodiments of the present invention. Specifically, the above processing steps may include:
[0073] S301: Receive a material selection instruction.
[0074] Among them, the material selection instruction may carry a material identifier of the material to be displayed on the target web page.
[0075] In implementation, when a user needs to select a material from a material resource library, the user can input a material selection instruction to the terminal, and the terminal can receive the material selection instruction.
[0076] S302: Obtain the material corresponding to the material identifier from a preset material resource library.
[0077] In implementation, the material identifier obtained by the terminal can be one or multiple. For each obtained material identifier, the terminal can search in the material resource library to obtain the material corresponding to the material identifier.
[0078] As can be seen from the above, based on the web page generation method of the embodiments of the present invention, the terminal can provide a material resource library for the user, facilitating the user to select materials and improving the efficiency of web page generation.
[0079] Optionally, the display rule may include at least one of the following:
[0080] The display position of each material in the preview interface;
[0081] The display size of each material in the preview interface;
[0082] The display color of each material in the preview interface.
[0083] Among them, for a picture material, the display position can be represented by the coordinates of the center point of the picture material in the preview interface, the display size can be represented by the length and width of the picture material, and the display color is usually the original color of the picture material; for a text material, the display position can be represented by the coordinates of the center point of the text box where the text material is located in the preview interface, the display size can be represented by the font size of the text in the text material, and the display color is usually the color set by the user.
[0084] As can be seen from the above, based on the web page generation method of the embodiments of the present invention, the user can specify the display position, display size and display color of the material, meeting the user's personalized web page design requirements and improving the user experience.
[0085] Optionally, it can also be implemented to adjust the material according to the user's needs. Refer to Figure 4 , Figure 4 which is a flowchart of a method for adjusting materials provided by the embodiments of the present invention. Specifically, the above processing steps may include:
[0086] S401: Receive an adjustment instruction for adjusting the material.
[0087] Among them, the adjustment instruction can carry the display rule after the material is adjusted.
[0088] In implementation, after the user views the display effect of the material in the preview interface, if the user is not satisfied with the current display effect, the user can choose to adjust the material in the preview interface. The terminal will then receive the adjustment instruction and obtain the display rule after the material is adjusted. For a certain material, if the user does not need to adjust the material, the display rule after the material is adjusted is the same as the display rule before the adjustment.
[0089] S402: Display the material in the preview interface according to the display rule after the material is adjusted.
[0090] In implementation, the terminal can adjust one material or multiple materials. The terminal can display the adjusted material in the preview interface. Exemplarily, the terminal can adjust the picture material centered for display to left-aligned display, adjust the 12-point font to 14-point font, and adjust the black font to yellow font.
[0091] It can be seen from the above that the web page generation method based on the embodiment of the present invention enables the user to adjust the material in the preview interface until the expected effect of the user is achieved, thereby improving the user experience.
[0092] See Figure 5 , Figure 5 which is a schematic diagram of a user operation for generating a web page provided by an embodiment of the present invention.
[0093] Among them, in the preview interface 1 is the display effect of the material displayed by the terminal according to the received display rule. The user can view the display effect of the preview interface 1. If the user wants to adjust the material, the user can input an adjustment instruction to the terminal. The terminal can adjust the material according to the adjustment instruction until the expected effect of the user is achieved, that is, the display effect in the preview interface 2. Optionally, the user can click the "Generate" button in the preview interface, and then the terminal can generate web page data (xx.html document) according to the material and the display data of the material. The terminal can send the xx.html document to the server. Based on the above processing, the user can access the server through the mobile terminal or the computer terminal to view the target web page.
[0094] Corresponding to the above method embodiment, see Figure 6 , Figure 6 which is a structural diagram of a web page generation device provided by an embodiment of the present invention, including:
[0095] An obtaining module 601, configured to obtain the material to be displayed in the target web page and the display rule of the material;
[0096] The first display module 602 is configured to display materials in a preset preview interface according to a display rule;
[0097] The first generation module 603 is configured to generate display data of the materials according to the display rule;
[0098] The second generation module 604 is configured to generate web page data of a target web page according to the materials and the display data by using a preset web page generation algorithm.
[0099] Optionally, refer to Figure 7 , Figure 7 which is a structural diagram of a material acquisition device provided by an embodiment of the present invention. Among them, the acquisition module 601 may include:
[0100] The first receiving sub-module 6011 is configured to receive an upload instruction, where the upload instruction carries materials;
[0101] The first acquisition sub-module 6012 is configured to acquire the materials according to the upload instruction.
[0102] Optionally, the acquisition module 601 may further include:
[0103] The storage sub-module is configured to store the materials in a preset material resource library.
[0104] Optionally, refer to Figure 8 , Figure 8 which is a structural diagram of a second material acquisition device provided by an embodiment of the present invention. Among them, the acquisition module 601 may include:
[0105] The second receiving sub-module 6013 is configured to receive a material selection instruction, where the material selection instruction carries a material identifier of the material to be displayed in the target web page;
[0106] The second acquisition sub-module 6014 acquires the material corresponding to the material identifier from a preset material resource library.
[0107] Optionally, the display rule may include at least one of the following:
[0108] The display position of each material in the preview interface;
[0109] The display size of each material in the preview interface;
[0110] The display color of each material in the preview interface.
[0111] Optionally, the first generation module 603 is specifically configured to receive a generation instruction, where the generation instruction is used to indicate that the display effect of the material in the preview interface meets a preset condition;
[0112] Based on the generation instruction, generate the display data according to the display rule.
[0113] Optionally, refer to Figure 9 , Figure 9 which is the structural diagram of the second web page generation device provided by the embodiment of the present invention. The above device may further include:
[0114] A receiving module 605, configured to receive an adjustment instruction for adjusting a material, where the adjustment instruction carries a display rule after the material is adjusted;
[0115] A second display module 606, configured to display the material in a preview interface according to the display rule after the material is adjusted.
[0116] It should be noted that the above device may be located in a terminal or in a server, but is not limited thereto.
[0117] The embodiment of the present invention further provides an electronic device, as Figure 10 shown, including a memory 1001 and a processor 1002. Among them, the memory 1001 is used to store a computer program; the processor 1002, when executing the program stored on the memory 1001, implements the steps of the above web page generation method. Optionally, the following steps may be implemented: obtain materials to be displayed in a target web page and the display rules of the materials; display the materials in a preset preview interface according to the display rules; generate display data of the materials according to the display rules; generate web page data of the target web page by using a preset web page generation algorithm according to the materials and the display data.
[0118] For the specific implementation of each step of this method and related explanatory content, reference may be made to the foregoing method embodiment section, and details are not described herein again.
[0119] The above electronic device may be provided with a communication interface for realizing communication between the above electronic device and other devices.
[0120] The above-mentioned processor 1002, communication interface, and memory 1001 complete mutual communication through a communication bus. The communication bus mentioned here may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus may be divided into an address bus, a data bus, a control bus, etc.
[0121] The memory 1001 may include a Random Access Memory (RAM), or may also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0122] The aforementioned processor 1002 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0123] The electronic device provided by the embodiment of the present invention can enable a web page designer to directly generate web page data of a target web page according to the display effect of materials in a preview interface when generating a web page, thereby improving the generation efficiency of the web page.
[0124] The embodiment of the present invention also provides a computer-readable storage medium, in which instructions are stored. When running on a computer, the instructions enable the computer to execute the web page generation method provided by the embodiment of the present invention.
[0125] Optionally, the aforementioned web page generation method includes: obtaining materials to be displayed in a target web page and the display rules of the materials; displaying the materials in a preset preview interface according to the display rules; generating display data of the materials according to the display rules; and generating web page data of the target web page by using a preset web page generation algorithm according to the materials and the display data.
[0126] It should be noted that other implementation manners of the aforementioned web page generation method are the same as those in the method embodiment part described above, and will not be elaborated here.
[0127] By running the instructions stored in the computer-readable storage medium provided by the embodiment of the present invention, when generating a web page, it can enable a web page designer to directly generate web page data of a target web page according to the display effect of materials in a preview interface, thereby improving the generation efficiency of the web page.
[0128] An embodiment of the present invention further provides a computer program product including instructions, which, when running on a computer, causes the computer to execute the web page generation method provided by the embodiment of the present invention.
[0129] Optionally, the above web page generation method includes: obtaining the materials to be displayed on the target web page and the display rules of the materials; displaying the materials in a preset preview interface according to the display rules;
[0130] generating display data of the materials according to the display rules; and generating web page data of the target web page by using a preset web page generation algorithm based on the materials and the display data.
[0131] It should be noted that other implementation manners of the above web page generation method are the same as those in the foregoing method embodiment, and will not be elaborated here.
[0132] By running the computer program product provided by the embodiment of the present invention, when generating a web page, it can enable web designers to directly generate web page data of the target web page according to the display effect of the materials in the preview interface, thereby improving the web page generation efficiency.
[0133] In the above embodiment, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The above computer program product includes one or more computer instructions. When the above computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiment of the present invention are generated in whole or in part. The above computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The above computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the above computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wirelessly (such as infrared, wireless, microwave, etc.). The above computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrating one or more available media. The above available medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)).
[0134] It should be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprising", "including" or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the said element.
[0135] Each embodiment in this specification is described in a related manner. For the same or similar parts among the embodiments, reference can be made to each other, and the differences between each embodiment and other embodiments are emphasized. In particular, for the embodiments of the device, electronic device, computer-readable storage medium, and computer program product, since they are basically similar to the method embodiments, the description is relatively simple, and reference can be made to the corresponding parts of the method embodiments for the relevant content.
[0136] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included within the protection scope of the present invention.
Claims
1. A method for generating a web page, characterized in that, The method includes: Obtaining the materials to be displayed on the target web page and the display rules for each of the materials on the target web page; the display rules include at least one of the following: the display position of each material in the preview interface; the display size of each material in the preview interface; the display color of each material in the preview interface; each material has a corresponding display rule; Displaying the materials in a preset preview interface according to the display rules; Receiving an adjustment instruction for adjusting the materials, where the adjustment instruction carries the adjusted display rules of the materials; Displaying the materials in the preview interface according to the adjusted display rules of the materials; Generating the display data of the materials according to the adjusted display rules; Generating the web page data of the target web page by using a preset web page generation algorithm according to the materials and the display data, where the web page data includes: the materials and the display rules of each material in the form of code.
2. The method according to claim 1, characterized in that, The obtaining of the materials to be displayed on the target web page includes: Receiving an upload instruction, where the upload instruction carries the materials; Obtaining the materials according to the upload instruction.
3. The method according to claim 2, wherein After obtaining the materials, the method further includes: Storing the materials in a preset material resource library.
4. The method according to claim 1, wherein The obtaining of the materials to be displayed on the target web page includes; Receiving a material selection instruction, where the material selection instruction carries the material identifier of the material to be displayed on the target web page; Obtaining the material corresponding to the material identifier from a preset material resource library.
5. The method according to claim 1, characterized in that, The generating of the display data of the materials according to the display rules includes: Receiving a generation instruction, where the generation instruction is used to indicate that the display effect of the materials in the preview interface meets a preset condition; Generating the display data according to the display rules based on the generation instruction.
6. A web page generating device, characterized in that, The device includes: An obtaining module, configured to obtain the materials to be displayed on the target web page and the display rules for each of the materials on the target web page; the display rules include at least one of the following: the display position of each material in the preview interface; the display size of each material in the preview interface; the display color of each material in the preview interface; each material has a corresponding display rule; A first display module, configured to display the materials in a preset preview interface according to the display rules; A receiving module, configured to receive an adjustment instruction for adjusting the materials, where the adjustment instruction carries the adjusted display rules of the materials; A second display module, configured to display the materials in the preview interface according to the adjusted display rules of the materials; A first generation module, configured to generate the display data of the materials according to the adjusted display rules; A second generation module, configured to generate the web page data of the target web page by using a preset web page generation algorithm according to the materials and the display data, where the web page data includes: the materials and the display rules of each material in the form of code.
7. The device according to claim 6, characterized in that, The obtaining module includes: A first receiving sub-module, configured to receive an upload instruction, where the upload instruction carries the material; A first obtaining sub-module, configured to obtain the material according to the upload instruction.
8. The device according to claim 7, characterized in that, The obtaining module further includes: A storage sub-module, configured to store the material in a preset material resource library.
9. The device according to claim 6, characterized in that, The obtaining module includes: A second receiving sub-module, configured to receive a material selection instruction, where the material selection instruction carries a material identifier of the material to be displayed on a target web page; A second obtaining sub-module, configured to obtain the material corresponding to the material identifier from a preset material resource library.
10. The device according to claim 6, characterized in that, The first generating module is configured to receive a generation instruction, where the generation instruction is used to indicate that the display effect of the material in the preview interface meets a preset condition; and generate the display data according to the display rule based on the generation instruction.
11. An electronic device, characterized in that, It includes a memory and a processor; The memory is configured to store a computer program; When the processor executes the program stored on the memory, it implements the method steps described in any one of claims 1-5.
12. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, and when the computer program is executed by the processor, it implements the method steps described in any one of claims 1-5.
Citation Information
Patent Citations
Webpage rendering method and apparatus
CN105956026A
Method of automatically generating webpage theme, storage medium and electronic equipment
CN107943924A
Methods, Systems & Products for Generating Web Pages
US20100023493A1
3D webpage display method and apparatus
CN108345687A