CN112035774A - Network page generation method and device, computer equipment and readable storage medium - Google Patents
Network page generation method and device, computer equipment and readable storage medium Download PDFInfo
- Publication number
- CN112035774A CN112035774A CN202010904482.9A CN202010904482A CN112035774A CN 112035774 A CN112035774 A CN 112035774A CN 202010904482 A CN202010904482 A CN 202010904482A CN 112035774 A CN112035774 A CN 112035774A
- Authority
- CN
- China
- Prior art keywords
- information
- picture
- target
- template
- file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
- G06F16/972—Access to data in other repository systems, e.g. legacy data or dynamic Web page generation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
- G06F16/986—Document structures and storage, e.g. HTML extensions
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Processing Or Creating Images (AREA)
Abstract
The invention relates to artificial intelligence, and discloses a method and a device for generating a network page, computer equipment and a readable storage medium, wherein the method comprises the following steps: acquiring information to be processed, extracting a template corresponding to the information to be processed, and setting the template as a target template; extracting the file information and the original picture in the information to be processed, inputting the file information into a file stack, and inputting the original picture into an image stack; acquiring modification information, performing transparent processing cutting and/or size modification on an original picture in an image stack according to the modification information, and acquiring a target picture and storing the target picture in the image stack; extracting the pattern information in the pattern stack and the target picture in the image stack, writing the pattern information into the pattern part of the target template, and loading the picture into the image part of the target template to obtain the network page. The invention improves the generation efficiency of the network page and solves the problem that the user can not obtain the required display effect by modifying the image in the network page.
Description
Technical Field
The invention relates to the technical field of artificial intelligence image detection, in particular to a network page generation method and device, computer equipment and a readable storage medium.
Background
The main electricity merchant platform products are constantly updated, activities are increasingly popularized, commodity activity pictures are basically drawn manually, time and labor are consumed in manual drawing, and required network pages cannot be generated quickly and efficiently, so that part of e-commerce platforms generate the required network pages in a mode of inputting information into preset templates.
However, the inventor has realized that the template for generating the web page currently provided only has a document input box and an image input box, so that the document information needs to be manually entered into the document input box, and meanwhile, the picture in the image input box cannot be modified, so that the process of generating the web page is not only inefficient and laborious, but also the user cannot obtain the required display effect by modifying the image in the web page.
Disclosure of Invention
The invention aims to provide a network page generation method, a network page generation device, computer equipment and a readable storage medium, which are used for solving the problems that the process of generating a network page is not efficient and labor-consuming, and a user cannot obtain the required display effect by modifying images in the network page in the prior art.
In order to achieve the above object, the present invention provides a method for generating a web page, including:
acquiring information to be processed, extracting a template corresponding to the information to be processed from a preset database, and setting the template as a target template;
extracting the file information and the original picture in the information to be processed, inputting the file information into a preset file stack, and inputting the original picture into a preset image stack;
acquiring modification information, performing transparent processing cutting and/or size modification on an original picture in the image stack according to the modification information to obtain a target picture, and storing the target picture in the image stack;
and extracting the pattern information in the pattern stack and the target picture in the image stack, writing the pattern information into the pattern part of the target template, and loading the picture into the image part of the target template to obtain the network page.
In the above scheme, before the information to be processed is acquired, the method includes:
a database is created for holding templates, wherein the templates are stored in the database in a key-value pair storage form.
In the above scheme, the step of obtaining the information to be processed includes:
sending a bullet frame to be processed to a user side, wherein the bullet frame to be processed is used for recording information to be processed written by the user side;
and receiving the information to be processed, which is input and sent in the bullet frame to be processed by the user side.
In the above scheme, the step of extracting the template corresponding to the information to be processed from the preset database includes:
extracting target information in the information to be processed, wherein the target information is information reflecting the type of the information to be processed;
and identifying template information consistent with the target information from a database, and extracting a template corresponding to the template information, wherein the template information reflects the type of the template.
In the above scheme, the step of obtaining modification information, and performing transparency processing clipping, and/or size modification on the original picture in the image stack according to the modification information to obtain a target picture includes:
judging whether the modification information has transparentization information;
if the transparent information exists, carrying out transparency processing on the original pictures in the image stack according to the transparency information to obtain transparent pictures and storing the transparent pictures in the image stack;
if the transparent information does not exist or the transparent picture is obtained, judging whether the modification information has cutting information;
if the transparent pictures or the original pictures in the image stack have the cutting information, cutting the transparent pictures or the original pictures in the image stack according to the cutting information to obtain the cut pictures and storing the cut pictures in the image stack;
if the modified information does not have the cutting information or the cutting picture is obtained, judging whether the modified information has size information;
if the size information exists, modifying the size of the transparentized picture, or cutting the picture or the original picture in the image stack according to the size information to obtain a target picture;
and if the picture does not have the size information, setting the transparentized picture, the cut picture or the original picture as a target picture.
In the above scheme, the transparentizing process is a picture processing operation of changing RGB of a pixel into an RGBA four-channel color attribute by an opencv algorithm to set the transparency of an original picture;
the cropping information is a selected area formed on the original picture;
cutting the transparent picture or the original picture in the image stack according to the cutting information to obtain a cut picture and storing the cut picture in the image stack, wherein the cutting comprises the following steps:
and cutting the original picture according to cutting information by an opencv algorithm to form a cut picture, wherein the cutting information comprises starting point information, a selected length and a selected width, the starting point coordinates are coordinates of vertexes in the selected area, the selected length is the length size of the selected area, and the selected width is the width size of the selected area.
In the above solution, the step of writing the document information into the document part of the target template includes:
identifying metadata in the file information, and extracting file contents corresponding to the metadata;
identifying a file label matched with the metadata in the file part, and writing the file content into a text box corresponding to the file label;
after the picture is loaded into the image part of the target template to obtain a network page, the method further comprises the following steps:
and uploading the network page to a block chain.
In order to achieve the above object, the present invention further provides a web page generating device, including:
the template extraction module is used for acquiring information to be processed, extracting a template corresponding to the information to be processed from a preset database, and setting the template as a target template;
the file and picture management module is used for extracting file information and original pictures in the information to be processed, inputting the file information into a preset file stack, and inputting the original pictures into a preset image stack;
the image processing module is used for acquiring modification information, performing transparent processing cutting and/or size modification on an original image in the image stack according to the modification information to obtain a target image, and storing the target image in the image stack;
and the page generation module is used for extracting the file information in the file stack and the target picture in the image stack, writing the file information into the file part of the target template, and loading the picture into the image part of the target template to obtain the network page.
To achieve the above object, the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor of the computer device implements the steps of the above network page generation method when executing the computer program.
In order to achieve the above object, the present invention further provides a computer-readable storage medium, in which a computer program is stored, and the computer program stored in the computer-readable storage medium, when executed by a processor, implements the steps of the above web page generation method.
The network page generating method, the device, the computer equipment and the readable storage medium provided by the invention can be used for acquiring the template corresponding to the information to be processed from the database so as to facilitate a user to quickly acquire the required target template for generating the network page, improve the network page generating efficiency, obtain the target picture by extracting the file information and the original picture in the processing information and respectively inputting the file information and the original picture into the file stack and the image stack so as to separately store the file information and the original picture so as to respectively manage the file information and the original picture information, obtain the target picture by performing transparence processing, cutting and size modification on the original picture and store the target picture in the image stack, and load the target picture in the image stack into the image part of the target template by directly acquiring the file information from the file stack and writing the file information into the file part of the target template to realize the technical effect of quickly generating the network page, therefore, the method and the device solve the problems that how to generate the network page efficiently and quickly and how to solve the problem that the user cannot obtain the required display effect by modifying the image in the network page.
Drawings
FIG. 1 is a flowchart of a first embodiment of a method for generating a web page according to the present invention;
FIG. 2 is a schematic diagram of an environment application of a network page generation method according to a second embodiment of the network page generation method of the present invention;
fig. 3 is a flowchart of a specific method of a network page generation method in a second embodiment of the network page generation method of the present invention;
fig. 4 is a flowchart of extracting a template corresponding to the information to be processed from a preset database in the second embodiment of the network page generation method of the present invention;
fig. 5 is a flowchart of obtaining modification information, and performing transparent processing clipping, and/or size modification on an original picture in the image stack according to the modification information to obtain a target picture in the second embodiment of the network page generation method according to the present invention;
FIG. 6 is a flowchart of writing the document information into the document part of the target template according to the second embodiment of the web page generation method of the present invention;
FIG. 7 is a schematic diagram of a program module of a third embodiment of a web page generation apparatus according to the present invention;
fig. 8 is a schematic diagram of a hardware structure of a computer device according to a fourth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The following examples are now provided:
the first embodiment is as follows:
referring to fig. 1, a method for generating a web page according to the embodiment includes:
s102: acquiring information to be processed, extracting a template corresponding to the information to be processed from a preset database, and setting the template as a target template.
S103: and extracting the file information and the original picture in the information to be processed, inputting the file information into a preset file stack, and inputting the original picture into a preset image stack.
S104: and acquiring modification information, performing transparent processing cutting and/or size modification on the original picture in the image stack according to the modification information to obtain a target picture, and storing the target picture in the image stack.
S105: and extracting the pattern information in the pattern stack and the target picture in the image stack, writing the pattern information into the pattern part of the target template, and loading the picture into the image part of the target template to obtain the network page.
In an exemplary embodiment, a template corresponding to information to be processed is obtained from a database according to the information to be processed generated according to the requirements of a user, so that the user can quickly obtain a target template required by the user for generating a network page, the network page generation efficiency is improved, and how to quickly generate the network page is solved, thereby avoiding the problem of huge design workload caused by the fact that a great amount of designers need to repeatedly design the network page in the prior art.
The method extracts the file information and the original pictures in the processing information and respectively records the file information and the original pictures into the file stack and the image stack to separately store the file information and the original pictures so as to respectively manage the file information and the original picture information, thereby solving the problems of how to efficiently process the file information and the original pictures and accurately load the file information and the original pictures into the designated part of the target template.
And performing transparency processing, cutting and size modification on the original picture according to the modification information to obtain a target picture, and storing the target picture in the image stack, so that the problems of ensuring the transparency of the image uploaded to the target template, ensuring the position of the picture uploaded to the target template and ensuring that the size of the picture uploaded to the target template can meet the requirements of a user are solved.
And loading the target picture in the image stack into the image part of the target template to realize the technical effect of quickly generating the network page by directly obtaining the file information from the file stack and writing the file information into the file part of the target template.
Therefore, the method and the device solve the problems that how to generate the network page efficiently and quickly and how to solve the problem that the user cannot obtain the required display effect by modifying the images in the network page.
Example two:
the embodiment is a specific application scenario of the first embodiment, and the method provided by the present invention can be more clearly and specifically explained through the embodiment.
The method provided in this embodiment will be specifically described below by taking as an example, in a server running a network page generation method, extracting a target template corresponding to the information to be processed, inputting the document information into a document stack, inputting an original picture into an image stack, performing transparent processing cutting, and/or size modification on the original picture according to modification information to obtain a target picture, writing the document information into a document part of the target template, and loading the picture into an image part of the target template to obtain a network page. It should be noted that the present embodiment is only exemplary, and does not limit the protection scope of the embodiments of the present invention.
Fig. 2 schematically shows an environment application diagram of the web page generation method according to the second embodiment of the present application.
In an exemplary embodiment, the server 2 in which the network page generation method is located is connected to the user terminal 4 through the network 3; the server 2 may provide services through one or more networks 3, which networks 3 may include various network devices, such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices, and/or the like. The network 3 may include physical links, such as coaxial cable links, twisted pair cable links, fiber optic links, combinations thereof, and/or the like. The network 3 may include wireless links, such as cellular links, satellite links, Wi-Fi links, and/or the like; the user terminal 4 may be a computer device such as a smart phone, a tablet computer, a notebook computer, and a desktop computer.
Fig. 3 is a flowchart of a specific method of a web page generation method according to an embodiment of the present invention, where the method specifically includes steps S201 to S205.
S201: a database is created for holding templates, wherein the templates are stored in the database in a key-value pair storage form.
In order to enable a user to directly input in the template to quickly generate the network page, the template is set and stored in the database in a key value pair storage mode, so that the template can be repeatedly used, and the efficiency of producing the network page is greatly improved.
In this embodiment, the template is used as a key value, the template information of the template is used as a primary key, and the primary key and the key value are corresponded to form the key value pair; wherein the template information reflects a type of the template.
S202: acquiring information to be processed, extracting a template corresponding to the information to be processed from a preset database, and setting the template as a target template.
In order to quickly generate a network page and avoid the problem that in the prior art, a great amount of design workload is caused by the fact that designers need to repeatedly design the network page, the template corresponding to the information to be processed is obtained from a database according to the information to be processed generated according to the requirements of users, so that the users can quickly obtain the required target template for generating the network page.
In this embodiment, the step of acquiring the information to be processed includes:
sending a bullet frame to be processed to a user side, wherein the bullet frame to be processed is used for recording information to be processed written by the user side;
and receiving the information to be processed, which is input and sent in the bullet frame to be processed by the user side.
In a preferred embodiment, referring to fig. 4, the step of extracting the template corresponding to the information to be processed from the preset database includes:
s202-1: extracting target information in the information to be processed, wherein the target information is information reflecting the type of the information to be processed, such as: promotional events, consumer coupons or bulletin messages, and the like.
S202-2: identifying template information consistent with the target information from a database, and extracting a template corresponding to the template information, wherein the template information reflects the type of the template, such as: promotional events, consumer coupons or bulletin messages, and the like.
S203: and extracting the file information and the original picture in the information to be processed, inputting the file information into a preset file stack, and inputting the original picture into a preset image stack.
The method is convenient for processing the file information and the original picture, and simultaneously, the file information and the original picture are conveniently and accurately loaded to the specified part of the target template; the step extracts the file information and the original pictures in the processing information and respectively inputs the file information and the original pictures into the file stack and the image stack, so that the file information and the original pictures are separately stored, and the file information and the original picture information are respectively managed.
S204: and acquiring modification information, performing transparency processing, and/or clipping, and/or size modification on the original picture in the image stack according to the modification information to obtain a target picture, and storing the target picture in the image stack.
In order to ensure that the transparency of the image uploaded to the target template, the position of the picture uploaded to the target template and the size of the picture uploaded to the target template can meet the requirements of a user, the step is to perform transparentization processing, cutting and size modification on the original picture according to modification information to obtain a target picture and store the target picture in the image stack.
In a preferred embodiment, referring to fig. 5, the step of obtaining modification information, and performing transparency processing clipping, and/or size modification on the original picture in the image stack according to the modification information to obtain a target picture includes:
s204-1: and judging whether the modification information has transparentization information.
S204-2: and if the transparent information exists, carrying out transparency processing on the original pictures in the image stack according to the transparency information to obtain transparent pictures and storing the transparent pictures in the image stack.
In order to realize the PNG format transparent original picture synthesis, the step of performing transparency processing on the original picture to enable the original picture to have the transparency attribute, wherein the transparency processing is a picture processing operation of changing RGB of pixels into RGBA four-channel color attribute through an opencv algorithm to set the transparency of the original picture.
It should be noted that, in a computer RGB color mode, three channels RGB are superimposed to each other to obtain various colors, but because there is transparency, a color four channel is RGBA, a represents an a' alpha channel and is generally used as an opaque parameter, so in this application, each pixel in an original picture is converted into a pixel set by an opencv algorithm, and by setting a color attribute of each pixel in the pixel set, it is realized that an alpha channel is added to the RGB channel of each pixel on the original picture to realize color transparency of the pixel; among them, the alpha channel is generally used as the opacity parameter. If a pixel has an alpha channel value of 0%, it is completely transparent (i.e., invisible), and a value of 100% means a completely opaque pixel (a conventional digital image). A value between 0% and 100% allows the pixel to be displayed through the background, as though it were through glass (translucency), which effect is simply binary transparency (transparent or opaque) does not. It facilitates digital synthesis. The alpha channel values may be expressed in percentage, integer, or real numbers from 0 to 1 as with the RGB parameters.
The OpenCV algorithm is a cross-platform computer vision library issued based on BSD license (open source), and can run on Linux, Windows, Android, and Mac OS operating systems. The method is light and efficient, is composed of a series of C functions and a small number of C + + classes, provides interfaces of languages such as Python, Ruby, MATLAB and the like, and realizes a plurality of general algorithms in the aspects of image processing and computer vision.
Therefore, the OpenCV algorithm is used for carrying out the transparentizing treatment on the original picture so as to avoid the problem that the expected effect cannot be achieved by synthesizing the original picture based on java because java can set the transparent part of the original picture to be black by default.
S204-3: and if the transparent information is not available or the transparent picture is obtained, judging whether the modification information contains cutting information.
S204-4: and if the transparent pictures or the original pictures in the image stack have the cutting information, cutting the transparent pictures or the original pictures in the image stack according to the cutting information to obtain the cut pictures and storing the cut pictures in the image stack.
The original picture can be partially displayed for realizing the generation of the image part of the network page so as to meet the requirement of a user on displaying a certain part of the original picture; in this step, the cropping information is a selected area displayed on an original picture, and the selected area on the original picture is cropped by an opencv algorithm to obtain a cropped picture, wherein the cropping information includes start point information, a selected length and a selected width, the start point coordinates are coordinates of a vertex in the selected area, the selected length is a length size of the selected area, and the selected width is a width size of the selected area.
In this embodiment, the clipping information is a rectangular draw frame clicked and pulled by a mouse, an area of the rectangular draw frame defined on an original picture is the selected area, the starting point information is coordinates of a vertex at the upper left corner of the selected frame, the selected length is the length of the rectangular draw frame, and the selected width is the width of the rectangular draw frame.
Illustratively, the length and width of the original picture are 360 × 480, but the content required by the design is only in the designated area of the original picture, and then the clipping information is formed by clicking and pulling the rectangular drawing frame with a mouse, for example: the start point information is (10,10), and the selected length: 200, selected width: 100.
in this embodiment, the selected area on the original picture is intercepted by the submat algorithm of opencv to obtain a cropped picture, for example: with the start point information as (10,10), the selected length: 200, selected width: the cutting information of 100 is cut off from the corresponding area on the original picture to obtain the cut picture.
S204-5: if the modified information does not have the cutting information or the cutting picture is obtained, judging whether the modified information has size information;
s204-6: and if the size information exists, modifying the size of the transparentized picture, or cutting the picture or the original picture in the image stack according to the size information to obtain a target picture.
In order to ensure that the pictures in the image stack can be adapted to the size of the image part of the target template, the size of the pictures in the image stack is adjusted through a resize algorithm in the opencv algorithm, and compared with a traditional java scaling function, the scaling function provided by the resize algorithm in the opencv algorithm used in the application has better fidelity reduction degree.
S204-7: and if the picture does not have the size information, setting the transparentized picture, the cut picture or the original picture as a target picture.
S205: and extracting the pattern information in the pattern stack and the target picture in the image stack, writing the pattern information into the pattern part of the target template, and loading the target picture into the image part of the target template to obtain the network page.
In order to realize the technical effect of quickly generating the network page, the file information is directly obtained from the file stack and written into the file part of the target template, the target picture in the image stack is loaded into the image part of the target template, and finally the network page is obtained.
In a preferred embodiment, referring to fig. 6, the step of writing the document information into the document part of the target template includes:
s205-1: and identifying metadata in the file information, and extracting file contents corresponding to the metadata.
Illustratively, the obtained documentation information is shown in the following table:
activity name | China celebrating Kuanghuan shopping festival |
Price of activity | 99-999 yuan |
Duration of activity | 2019/9/30-2019/10/10 |
Wherein, the 'activity name', 'activity price', 'activity period' are metadata of the file information; "the festival of happy country shopping", "99-999 yuan", "2019/9/30-2019/10/10" are the corresponding paperwork contents of the metadata, respectively.
S205-2: and identifying the file label matched with the metadata in the file part, and writing the file content into a text box corresponding to the file label.
Exemplarily, the following steps are carried out: the pattern label of the pattern part in the template comprises: "activity name", "activity price", "activity duration"; writing the case content of 'national celebration and binghuan shopping festival' into the text box corresponding to the 'activity name' in the case part, writing the case content of '99-999' into the text box corresponding to the 'activity price' in the case part, and writing the case content of '2019/9/30-2019/10/10' into the text box corresponding to the 'activity period' in the case part.
Preferably, after the image is loaded into the image portion of the target template to obtain a web page, the method further includes:
and uploading the network page to a block chain.
It should be noted that the corresponding digest information is obtained based on the web page, and specifically, the digest information is obtained by hashing the web page, for example, by using the sha256s algorithm. Uploading summary information to the blockchain can ensure the safety and the fair transparency of the user. The user equipment can download the summary information from the blockchain so as to verify whether the network page is tampered. The blockchain referred to in this example is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Example three:
referring to fig. 7, a web page generating apparatus 1 of the present embodiment includes:
the template extraction module 12 is configured to acquire information to be processed, extract a template corresponding to the information to be processed from a preset database, and set the template as a target template;
the document and picture management module 13 is configured to extract document information and an original picture in the information to be processed, enter the document information into a preset document stack, and enter the original picture into a preset image stack;
the picture processing module 14 is configured to obtain modification information, perform transparency processing clipping and/or size modification on an original picture in the image stack according to the modification information to obtain a target picture, and store the target picture in the image stack;
and the page generating module 15 is configured to extract the document information in the document stack and the target picture in the image stack, write the document information into the document part of the target template, and load the picture into the image part of the target template to obtain the network page.
Optionally, the network page generating apparatus 1 further includes:
a creating module 11, configured to create a database for storing templates, where the templates are stored in the database in a key-value pair storage form.
The technical scheme is applied to the technical field of artificial intelligence image detection, and a template corresponding to the information to be processed is extracted from a database and is set as a target template; extracting the file information and the original picture in the information to be processed, inputting the file information into a preset file stack, and inputting the original picture into a preset image stack; performing image processing operations such as transparentization processing cutting, and/or size modification on the original image in the image stack according to the modification information to obtain a target image, storing the target image in the image stack, and realizing region extraction on the designated region of the original image according to the cutting information to obtain the target image; and writing the pattern information into the pattern part of the target template by extracting the pattern information in the pattern stack and the target picture in the image stack, and loading the picture into the image part of the target template to obtain the network page.
Example four:
in order to achieve the above object, the present invention further provides a computer device 5, where components of the network page generating apparatus 1 according to the third embodiment may be dispersed in different computer devices, and the computer device 5 may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server, or a rack server (including an independent server or a server cluster formed by multiple application servers) that executes a program, and the like. The computer device of the embodiment at least includes but is not limited to: a memory 51, a processor 52, which may be communicatively coupled to each other via a system bus, as shown in FIG. 8. It should be noted that fig. 8 only shows a computer device with components, but it should be understood that not all of the shown components are required to be implemented, and more or fewer components may be implemented instead.
In this embodiment, the memory 51 (i.e., a readable storage medium) includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the memory 51 may be an internal storage unit of the computer device, such as a hard disk or a memory of the computer device. In other embodiments, the memory 51 may be an external storage device of a computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the computer device. Of course, the memory 51 may also include both internal and external storage devices of the computer device. In this embodiment, the memory 51 is generally used for storing an operating system and various application software installed in the computer device, for example, the program code of the web page generating apparatus in the third embodiment. Further, the memory 51 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 52 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 52 is typically used to control the overall operation of the computer device. In this embodiment, the processor 52 is configured to run a program code stored in the memory 51 or process data, for example, run a network page generation apparatus, so as to implement the network page generation methods of the first embodiment and the second embodiment.
Example five:
to achieve the above objects, the present invention also provides a computer readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application store, etc., on which a computer program is stored, which when executed by a processor 52, implements corresponding functions. The computer-readable storage medium of this embodiment is used for storing a web page generation apparatus, and when executed by the processor 52, implements the web page generation method of the first embodiment and the second embodiment.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (10)
1. A method for generating a web page, comprising:
acquiring information to be processed, extracting a template corresponding to the information to be processed from a preset database, and setting the template as a target template;
extracting the file information and the original picture in the information to be processed, inputting the file information into a preset file stack, and inputting the original picture into a preset image stack;
acquiring modification information, performing transparent processing cutting and/or size modification on an original picture in the image stack according to the modification information to obtain a target picture, and storing the target picture in the image stack;
and extracting the pattern information in the pattern stack and the target picture in the image stack, writing the pattern information into the pattern part of the target template, and loading the picture into the image part of the target template to obtain the network page.
2. The method for generating web pages according to claim 1, wherein before obtaining the information to be processed, the method comprises:
a database is created for holding templates, wherein the templates are stored in the database in a key-value pair storage form.
3. The method for generating web pages according to claim 1, wherein the step of obtaining information to be processed comprises:
sending a bullet frame to be processed to a user side, wherein the bullet frame to be processed is used for recording information to be processed written by the user side;
and receiving the information to be processed, which is input and sent in the bullet frame to be processed by the user side.
4. The method for generating web pages according to claim 1, wherein the step of extracting the template corresponding to the information to be processed from a preset database comprises:
extracting target information in the information to be processed, wherein the target information is information reflecting the type of the information to be processed;
and identifying template information consistent with the target information from a database, and extracting a template corresponding to the template information, wherein the template information reflects the type of the template.
5. The method for generating web pages according to claim 1, wherein the step of obtaining modification information, performing transparent processing cropping, and/or size modification on the original pictures in the image stack according to the modification information to obtain the target pictures comprises:
judging whether the modification information has transparentization information;
if the transparent information exists, carrying out transparency processing on the original pictures in the image stack according to the transparency information to obtain transparent pictures and storing the transparent pictures in the image stack;
if the transparent information does not exist or the transparent picture is obtained, judging whether the modification information has cutting information;
if the transparent pictures or the original pictures in the image stack have the cutting information, cutting the transparent pictures or the original pictures in the image stack according to the cutting information to obtain the cut pictures and storing the cut pictures in the image stack;
if the modified information does not have the cutting information or the cutting picture is obtained, judging whether the modified information has size information;
if the size information exists, modifying the size of the transparentized picture, or cutting the picture or the original picture in the image stack according to the size information to obtain a target picture;
and if the picture does not have the size information, setting the transparentized picture, the cut picture or the original picture as a target picture.
6. The web page generation method according to claim 5, wherein the transparentization processing is a picture processing operation of changing RGB of a pixel into RGBA four-channel color attributes by an opencv algorithm to set transparency of an original picture;
the cropping information is a selected area formed on the original picture;
cutting the transparent picture or the original picture in the image stack according to the cutting information to obtain a cut picture and storing the cut picture in the image stack, wherein the cutting comprises the following steps:
and cutting the original picture according to cutting information by an opencv algorithm to form a cut picture, wherein the cutting information comprises starting point information, a selected length and a selected width, the starting point coordinates are coordinates of vertexes in the selected area, the selected length is the length size of the selected area, and the selected width is the width size of the selected area.
7. The method for generating web pages according to claim 1, wherein the step of writing the document information into the document part of the target template comprises:
identifying metadata in the file information, and extracting file contents corresponding to the metadata;
identifying a file label matched with the metadata in the file part, and writing the file content into a text box corresponding to the file label;
after the picture is loaded into the image part of the target template to obtain a network page, the method further comprises the following steps:
and uploading the network page to a block chain.
8. A web page generation apparatus, comprising:
the template extraction module is used for acquiring information to be processed, extracting a template corresponding to the information to be processed from a preset database, and setting the template as a target template;
the file and picture management module is used for extracting file information and original pictures in the information to be processed, inputting the file information into a preset file stack, and inputting the original pictures into a preset image stack;
the image processing module is used for acquiring modification information, performing transparent processing cutting and/or size modification on an original image in the image stack according to the modification information to obtain a target image, and storing the target image in the image stack;
and the page generation module is used for extracting the file information in the file stack and the target picture in the image stack, writing the file information into the file part of the target template, and loading the picture into the image part of the target template to obtain the network page.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the web page generation method of any one of claims 1 to 7 are implemented by the processor of the computer device when the computer program is executed by the processor.
10. A computer-readable storage medium, on which a computer program is stored, the computer program stored in the computer-readable storage medium, when being executed by a processor, implementing the steps of the web page generation method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010904482.9A CN112035774A (en) | 2020-09-01 | 2020-09-01 | Network page generation method and device, computer equipment and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010904482.9A CN112035774A (en) | 2020-09-01 | 2020-09-01 | Network page generation method and device, computer equipment and readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112035774A true CN112035774A (en) | 2020-12-04 |
Family
ID=73590839
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010904482.9A Pending CN112035774A (en) | 2020-09-01 | 2020-09-01 | Network page generation method and device, computer equipment and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112035774A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115002097A (en) * | 2022-04-25 | 2022-09-02 | 青岛海尔科技有限公司 | Application image display method and device, storage medium and electronic device |
WO2023284792A1 (en) * | 2021-07-14 | 2023-01-19 | 清华大学 | Lens calibration method and apparatus for scanning light field imaging system |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110910475A (en) * | 2019-10-16 | 2020-03-24 | 浙江大搜车软件技术有限公司 | Picture editing method and device, computer equipment and storage medium |
CN111243061A (en) * | 2020-01-21 | 2020-06-05 | 苏宁云计算有限公司 | Commodity picture generation method, device and system |
CN111324761A (en) * | 2020-02-25 | 2020-06-23 | 平安科技(深圳)有限公司 | Image annotation management method, device, computer system and readable storage medium name |
-
2020
- 2020-09-01 CN CN202010904482.9A patent/CN112035774A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110910475A (en) * | 2019-10-16 | 2020-03-24 | 浙江大搜车软件技术有限公司 | Picture editing method and device, computer equipment and storage medium |
CN111243061A (en) * | 2020-01-21 | 2020-06-05 | 苏宁云计算有限公司 | Commodity picture generation method, device and system |
CN111324761A (en) * | 2020-02-25 | 2020-06-23 | 平安科技(深圳)有限公司 | Image annotation management method, device, computer system and readable storage medium name |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023284792A1 (en) * | 2021-07-14 | 2023-01-19 | 清华大学 | Lens calibration method and apparatus for scanning light field imaging system |
CN115002097A (en) * | 2022-04-25 | 2022-09-02 | 青岛海尔科技有限公司 | Application image display method and device, storage medium and electronic device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109801347B (en) | Method, device, equipment and medium for generating editable image template | |
US11507727B2 (en) | Font rendering method and apparatus, and computer-readable storage medium | |
CN111553131B (en) | PSD file analysis method, device, equipment and readable storage medium | |
CN112035111A (en) | Page editing method, system, computer device and computer readable storage medium | |
CN112035774A (en) | Network page generation method and device, computer equipment and readable storage medium | |
CN111243061B (en) | Commodity picture generation method, device and system | |
WO2021174786A1 (en) | Training sample production method and apparatus, computer device, and readable storage medium | |
CN110708423A (en) | Message content display method and device and storage medium | |
CN113409411A (en) | Rendering method and device of graphical interface, electronic equipment and storage medium | |
CN115328588A (en) | Method and system for rendering OFD (office file) based on browser front end | |
CN114998464A (en) | Electronic certificate generation method and device | |
CN112001159A (en) | Document generation method and device, electronic equipment and storage medium | |
CN113268949B (en) | Form display method and device based on dynamic fields, computer equipment and medium | |
CN112927314A (en) | Image data processing method and device and computer equipment | |
CN111222069A (en) | Report component adjusting method and device and related equipment | |
US9081529B1 (en) | Generation of electronic books | |
CN114022891A (en) | Method, device and equipment for extracting key information of scanned text and storage medium | |
CN112395834A (en) | Brain graph generation method, device and equipment based on picture input and storage medium | |
CN102467490B (en) | Font data processing method and device | |
CN117032666A (en) | Page editing method and device based on editor, terminal equipment and storage medium | |
CN111581402A (en) | Method and system for generating content test material, electronic equipment and storage medium | |
CN114138717A (en) | Rich text information publishing method and related device | |
CN111738166A (en) | Target contour delineation method, device, computer system and readable storage medium | |
CN111259276A (en) | Method and device for displaying title content, electronic equipment and storage medium | |
CN110704105B (en) | Data migration method, terminal and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |