Page generation method, device, equipment and storage medium
By deleting content layout information from the SVG file, only the area layout information is retained, and the target page is generated, the problem of slow loading speed of SVG file is solved and the loading speed of content images is improved.
Patent Information
- Application Number
- CN202211600782.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-12
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2042-12-12
AI Technical Summary
In the prior art, SVG files have a problem of slow content loading speed when loading, mainly because there is a lot of redundant content that requires the entire file to be loaded.
By analyzing the page design file of the target page, deleting the content layout information, only the area layout information is retained, the second page layout information is generated, and the target page is generated based on the information of the target display area and the information of the first content image.
Reduces redundant content in content images, reduces memory usage, and improves the speed of loading content images.
Smart Images

Figure CN115828019B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing, and in particular, to a page generation method, apparatus, device, medium, and program product. Background Art
[0002] In the prior art, an electronic manuscript is usually typeset by a typesetting software, and then the output typesetting result is used as the layout of the electronic manuscript. The typeset electronic manuscript is output in SVG (Scalable Vector Graphics) and displayed on a visualization interface.
[0003] However, in the process of implementing the inventive concept, the inventor found that in the related art, when loading an SVG file to display the layout of an electronic manuscript, there is a problem of slow content loading speed. Summary of the Invention
[0004] In view of the above problems, the present disclosure provides a page generation method, apparatus, device, medium, and program product.
[0005] According to a first aspect of the present disclosure, there is provided a page generation method, including: parsing a page design file of a target page to obtain information of a first content image and first page layout information, where the target page includes M display areas, the first page layout information includes area layout information and content layout information, the area layout information represents the layout information of the M display areas on the target page; the content layout information represents the layout information of page content within the M display areas, where M is an integer greater than 1; deleting the content layout information from the first page layout information to obtain second page layout information; in response to a page generation request for the target page, obtaining information of a target display area; and generating the target page according to the information of the target display area, the information of the first content image, and the second page layout information.
[0006] According to an embodiment of the present disclosure, generating the target page according to the information of the target display area, the information of the first content image, and the second page layout information includes: processing the first content image according to the information of the target display area and the information of the first content image to obtain a second content image; and generating the target page according to the second content image and the second page layout information.
[0007] According to an embodiment of the present disclosure, the information of the target display area represents the first size information of the target display area, the information of the first content image represents the second size information of the first content image, and processing the first content image according to the information of the target display area and the information of the first content image to obtain a second content image includes: obtaining image compression parameter information according to the first size information and the second size information; processing the first content image according to the image compression parameter information to obtain the second content image.
[0008] According to an embodiment of the present disclosure, generating the target page according to the second content image and the second page layout information includes: obtaining a rendering strategy according to the second content image and the second page layout information; performing a rendering process on the second content image and the second page layout information according to the rendering strategy to obtain the target page.
[0009] According to an embodiment of the present disclosure, obtaining a rendering strategy according to the second content image and the second page layout information includes: generating a target vector image according to the second page layout information; querying the first layer information corresponding to the target vector image from the layer configuration information according to the target vector image; querying the second layer information corresponding to the second content image from the layer configuration information according to the second content image; obtaining the rendering strategy according to the first layer information and the second layer information.
[0010] According to an embodiment of the present disclosure, the page generation method further includes: generating text information of page content according to the content layout information, where the text information of the page content includes text information of M sub - contents corresponding to M display areas, where m is an integer greater than 1 and less than M; in response to a click operation on the m - th display area on the target page, displaying target content information through a visual interface, where the target content information represents the text information of the m - th sub - content corresponding to the m - th display area.
[0011] According to an embodiment of the present disclosure, generating text information of page content according to the content layout information includes: for the m - th display area, obtaining the m - th sub - content information and the arrangement order information of each character in the m - th sub - content in the m - th display area from the content layout information; sorting each character in the m - th sub - content according to the arrangement order information to obtain the text information of the m - th sub - content; generating the text information of the page content according to the text information of M sub - contents.
[0012] According to an embodiment of the present disclosure, in response to a click operation on the m-th display area on the above-mentioned target page, target content information is displayed through a visual interface, including: in response to a click operation on the m-th display area on the above-mentioned target page, obtaining the position information of the target display area; querying to obtain the target content information corresponding to the above-mentioned target display area according to the position information of the above-mentioned target display area; and displaying the above-mentioned target content information through a visual interface.
[0013] A second aspect of the present disclosure provides a page generation device, including: a parsing module, configured to parse a page design file of a target page to obtain information of a first content image and first page layout information, where the above-mentioned target page includes M display areas, the above-mentioned first page layout information includes area layout information and content layout information, the above-mentioned area layout information represents the layout information of the M display areas on the above-mentioned target page; the above-mentioned content layout information represents the layout information of page content within the M display areas, where M is an integer greater than 1; a deletion module, configured to delete the above-mentioned content layout information from the above-mentioned first page layout information to obtain second page layout information; an acquisition module, configured to obtain information of a target display area in response to a page generation request for the target page; a first generation module, configured to generate a target page according to the information of the above-mentioned target display area, the information of the above-mentioned first content image, and the above-mentioned second page layout information.
[0014] A third aspect of the present disclosure provides an electronic device, including: one or more processors; a memory, configured to store one or more programs, where when the one or more programs are executed by the one or more processors, the one or more processors are caused to execute the above-mentioned method.
[0015] A fourth aspect of the present disclosure further provides a computer-readable storage medium, on which executable instructions are stored, and when the instructions are executed by a processor, the processor is caused to execute the above-mentioned method.
[0016] A fifth aspect of the present disclosure further provides a computer program product, including a computer program, and when the computer program is executed by a processor, the above-mentioned method is implemented.
[0017] According to the page generation method, apparatus, device, medium, and program product provided by the present disclosure, by parsing the page design file of the target page, the content layout information is deleted from the parsed first page layout information to obtain the second page layout information, so as to reduce the content to be loaded. Then, in response to the page generation request for the target page, the information of the target display area is obtained, and the target page is generated according to the information of the target display area, the information of the first content image, and the second page layout information. Since the content layout information is deleted, the redundant content in the content image is reduced, thereby reducing the memory occupancy when loading the content image and improving the loading speed of the content image on the target page. Description of the Drawings
[0018] Through the following description of the embodiments of the present disclosure with reference to the drawings, the above content and other objects, features, and advantages of the present disclosure will become clearer. In the drawings:
[0019] Figure 1 Schematically shows an application scenario diagram of the page generation method, apparatus, device, medium, and program product according to an embodiment of the present disclosure;
[0020] Figure 2 Schematically shows a flowchart of the page generation method according to an embodiment of the present disclosure;
[0021] Figure 3 Schematically shows a schematic diagram of the target page displaying the second layout information according to an embodiment of the present disclosure;
[0022] Figure 4 Schematically shows a flowchart of the method for obtaining the rendering strategy according to an embodiment of the present disclosure;
[0023] Figure 5 Schematically shows a flowchart of the method for generating page content text information according to an embodiment of the present disclosure;
[0024] Figure 6 Schematically shows a schematic diagram of displaying the target content information according to an embodiment of the present disclosure;
[0025] Figure 7 Schematically shows a structural block diagram of the page generation apparatus according to an embodiment of the present disclosure; and
[0026] Figure 8 Schematically shows a block diagram of an electronic device suitable for implementing the page generation method according to an embodiment of the present disclosure. Detailed Embodiments
[0027] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the following detailed description, for the sake of explanation, numerous specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is obvious that one or more embodiments can also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts of the present disclosure.
[0028] The terms used herein are merely for describing specific embodiments and are not intended to limit the present disclosure. The terms "including", "comprising", etc. used herein indicate the presence of the described features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0029] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0030] In cases where expressions similar to "at least one of A, B, and C, etc." are used, generally, it should be interpreted according to the meaning commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include, but not be limited to, a system having only A, only B, only C, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.).
[0031] In the technical solution of the present disclosure, the processing of the data involved (such as including but not limited to user personal information) in terms of collection, storage, use, processing, transmission, provision, disclosure, and application, etc. all comply with the provisions of relevant laws and regulations, necessary confidentiality measures are taken, and public order and good customs are not violated.
[0032] The inventors found that in the related art, due to the large amount of redundant content in the SVG file, the entire SVG file needs to be loaded during display. Therefore, there is a problem of slow content loading speed.
[0033] In view of this, embodiments of the present disclosure provide a page generation method, including:
[0034] Analyze the page design file of the target page to obtain the information of the first content image and the first page layout information. The target page includes M display areas, and the first page layout information includes area layout information and content layout information. The area layout information represents the layout information of the M display areas on the target page; the content layout information represents the layout information of the page content within the M display areas, where M is an integer greater than 1.
[0035] Delete the content layout information from the first page layout information to obtain the second page layout information.
[0036] In response to a page generation request for the target page, obtain the information of the target display area.
[0037] Generate the target page according to the information of the target display area, the information of the first content image, and the second page layout information.
[0038] Figure 1 FIG. schematically shows an application scenario diagram of a page generation method according to an embodiment of the present disclosure.
[0039] As Figure 1 shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0040] The user can use at least one of the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0041] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices with a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, and desktop computers, etc.
[0042] Server 105 may be a server that provides various services. For example, it can be a background management server (only for illustration) that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server can analyze and process data such as user requests received, and feedback the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.
[0043] It should be noted that the page generation method provided by the embodiments of the present disclosure can generally be executed by server 105. Correspondingly, the page generation device provided by the embodiments of the present disclosure can generally be set in server 105. The page generation method provided by the embodiments of the present disclosure can also be executed by a server or a server cluster different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the page generation device provided by the embodiments of the present disclosure can also be set in a server or a server cluster different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.
[0044] It should be understood that Figure 1 the numbers of terminal devices, networks, and servers in
[0045] are merely illustrative. According to the implementation requirements, there can be any number of terminal devices, networks, and servers. Figure 1 Based on the Figures 2 to 6 scenario described below, the page generation method of the disclosed embodiments will be described in detail through
[0046] Figure 2 FIG. schematically shows a flowchart of the page generation method according to the embodiments of the present disclosure.
[0047] As Figure 2 shown, the page generation method of this embodiment includes operation S210 to operation S240.
[0048] In operation S210, parse the page design file of the target page to obtain the information of the first content image and the first page layout information. The target page includes M display areas. The first page layout information includes area layout information and content layout information. The area layout information represents the layout information of the M display areas on the target page; the content layout information represents the layout information of the page content within the M display areas, where M is an integer greater than 1.
[0049] According to an embodiment of the present disclosure, for example, the page design file may be an SVG file. The content of the SVG file may be in XML (Extensible Markup Language) format and may include a root node, child nodes, and leaf nodes. The target page information may be used as the root node, and the child nodes corresponding to the target page may be multiple display area information. The multiple display areas may be displayed on the target page according to the area layout information. For example, the display areas may be divided by articles on the target page, and each article corresponds to a display area. The leaf nodes corresponding to the display areas may be page content, and within the display area, the page content may be displayed according to the image layout information. For example, the page content may be the text content of the article within the display area and the layout content of the text within the display area.
[0050] According to an embodiment of the present disclosure, the first content image may be a display content image within the display area of the target page. For example, the first content image may be an image in Base64 encoding format. The first page layout information may include the vector information for displaying the first content image information on the target page. For example, the first content image information may be displayed according to the page layout structure of the first page layout information.
[0051] According to an embodiment of the present disclosure, the area layout information may include the display layout of the first content image on the target page, and the content layout information may include the display layout of the image content in the first content image. For example, the display area of the first content image on the target page may be determined according to the area layout information, and then the arrangement order of the image content in the first content image may be determined according to the content layout information.
[0052] In operation S220, the content layout information is deleted from the first page layout information to obtain the second page layout information.
[0053] According to an embodiment of the present disclosure, by deleting the content layout information, only the area layout information is retained on the target page to reduce the cache resources occupied by loading the target page and increase the loading speed of the target page.
[0054] In operation S230, in response to a page generation request for the target page, the information of the target display area is obtained.
[0055] According to an embodiment of the present disclosure, the target display area may be the display area where the first content image needs to be displayed.
[0056] In operation S240, a target page is generated according to the information of the target display area, the information of the first content image, and the second page layout information.
[0057] According to an embodiment of the present disclosure, a target page is generated based on the information of the target display area, the information of the first content image, and the second page layout information. For example, the generated target page may be a page in which the content image is set in the target display area of the second page, but in the case of non-response, the specific image content of the target image is not displayed.
[0058] According to an embodiment of the present disclosure, by parsing the page design file of the target page, the content layout information is deleted from the parsed first page layout information to obtain the second page layout information, so as to reduce the memory of the generated target page. Then, in response to a page generation request for the target page, the information of the target display area is obtained, and a target page is generated based on the information of the target display area, the information of the first content image, and the second page layout information. Since the content layout information is deleted, the redundant content in the content image is reduced, thereby reducing the memory occupancy when loading the content image and improving the loading speed of the content image on the target page.
[0059] Figure 3 A schematic diagram showing the second layout information of the target page according to an embodiment of the present disclosure is schematically shown.
[0060] As Figure 3 shown, the target page can be laid out according to the second page layout information, can include 6 display areas, and can include area A1, area A2, area A3, area A4, area A5, and area A6. The first content image information can be displayed in the above 6 areas according to the second page layout information.
[0061] According to an embodiment of the present disclosure, generating a target page based on the information of the target display area, the information of the first content image, and the second page layout information includes:
[0062] Processing the first content image according to the information of the target display area and the information of the first content image to obtain a second content image;
[0063] Generating a target page based on the second content image and the second page layout information.
[0064] According to an embodiment of the present disclosure, processing the first content image according to the information of the target display area and the information of the first content image to obtain a second content image. For example, it may be to change the size of the first content image to a content image corresponding to the size of the target display area, so that the content image matches the target display area, and use this content image as the second content image.
[0065] According to an embodiment of the present disclosure, a target page is generated based on a second content image and second page layout information. For example, a second content image corresponding to the size of a target display area is generated into a target page according to the page layout in the second page layout information, so that the second content image is displayed in a target display area of the target page.
[0066] According to an embodiment of the present disclosure, the first content image is processed based on the information of the target display area and the information of the first content image, so that the first content image matches the target display area, and a second content image that matches the target display area is obtained. Then, according to the layout method of the second page layout information, the second content image is laid out, and a target page is generated based on the laid-out second content image. Since the target display area and the content image are matched, the content image can be displayed in the target display area, enhancing the adaptability of the content image. Then, the content image is laid out according to the layout method, so that the generated target page displays the content image, enhancing the flexibility of the target page layout.
[0067] According to an embodiment of the present disclosure, the information of the target display area represents the first size information of the target display area, and the information of the first content image represents the second size information of the first content image. Processing the first content image based on the information of the target display area and the information of the first content image to obtain a second content image includes:
[0068] Obtaining image compression parameter information according to the first size information and the second size information;
[0069] Processing the first content image according to the image compression parameter information to obtain a second content image.
[0070] According to an embodiment of the present disclosure, image compression parameter information is obtained according to the first size information and the second size information. For example, the scaling factor between the first size information of the target display area and the second size of the first content image can be determined, and the image compression parameter can be determined based on this scaling factor, and the first content image can be compressed in size through this image compression parameter.
[0071] According to an embodiment of the present disclosure, processing the first content image according to the image compression parameter information to obtain a second content image. For example, the compression degree of the first content image can be determined according to the scaling factor between the first size information and the second size information in the image compression parameter information, and then the first content image can be compressed to obtain a second content image.
[0072] According to an embodiment of the present disclosure, based on the first size information and the second size information, image compression parameter information is obtained, and then based on the image compression parameter information, the first content image is processed so that the size of the content image matches the display area, and a second content image with a size matching the display area is obtained, improving the adaptability and flexibility of the content image.
[0073] According to an embodiment of the present disclosure, based on the second content image and the second page layout information, a target page is generated, including:
[0074] Based on the second content image and the second page layout information, a rendering strategy is obtained;
[0075] According to the rendering strategy, the second content image and the second page layout information are rendered to obtain a target page.
[0076] According to an embodiment of the present disclosure, based on the second content image and the second page layout information, a rendering strategy is obtained. For example, based on the second content image and the layout information of the second page, the display mode of the second content image can be determined, and this display mode can be used as the rendering strategy to display the second content image.
[0077] According to an embodiment of the present disclosure, according to the rendering strategy, the second content image and the second page layout information are rendered to obtain a target page. For example, according to the rendering strategy, the display mode of displaying the second content image on the target page according to the second page layout information can be determined, and then a target page displaying the second content image in this display mode can be obtained.
[0078] According to an embodiment of the present disclosure, based on the second content image and the second page layout information, a rendering strategy is obtained, and then according to the rendering strategy, the second content image and the second page layout information are rendered to obtain a target page. Since the rendering strategy is determined and the display mode of the content image is determined, the content image on the target page can be displayed according to the layout mode and the display mode, enhancing the flexibility of the content image display.
[0079] Figure 4 Schematically shows a flowchart of a method for obtaining a rendering strategy according to an embodiment of the present disclosure.
[0080] As Figure 4 shown, the method for obtaining a rendering strategy in this embodiment includes operation S410 to operation S440.
[0081] In operation S410, based on the second page layout information, a target vector image is generated.
[0082] According to an embodiment of the present disclosure, the target vector image can be a vector image for display on the target page.
[0083] According to an embodiment of the present disclosure, a target vector image is generated according to the second page layout information. For example, according to the layout manner of the second page layout information, the target vector image is generated at a corresponding position on the target page.
[0084] In operation S420, according to the target vector image, first layer information corresponding to the target vector image is queried from the layer configuration information.
[0085] According to an embodiment of the present disclosure, the layer configuration information may be configuration information for determining the stacking order of images on the target page.
[0086] According to an embodiment of the present disclosure, the first layer information corresponding to the target vector image may be configuration information that positions the target vector image on the upper layer of the target page.
[0087] According to an embodiment of the present disclosure, according to the target vector image, first layer information corresponding to the target vector image is queried from the layer configuration information. For example, according to the target vector image, configuration information that positions the target vector image on the upper layer of the target page may be queried from the layer configuration information.
[0088] In operation S430, according to the second content image, second layer information corresponding to the second content image is queried from the layer configuration information.
[0089] According to an embodiment of the present disclosure, the second layer information corresponding to the second content image may be configuration information that positions the second content image on the lower layer of the target page.
[0090] According to an embodiment of the present disclosure, according to the second content image, second layer information corresponding to the second content image is queried from the layer configuration information. For example, according to the second content image, configuration information that positions the second content image on the lower layer of the target page may be queried from the layer configuration information.
[0091] In operation S440, a rendering strategy is obtained according to the first layer information and the second layer information.
[0092] According to an embodiment of the present disclosure, a rendering strategy is obtained according to the first layer information and the second layer information. For example, it may be determined according to the first layer information and the second layer information that the target vector image is on the upper layer of the target page, and it is determined that the second content image is on the lower layer of the target page.
[0093] According to an embodiment of the present disclosure, a target vector image is generated according to the second page layout information, and then according to the target vector image, the first layer information corresponding to the target vector image is queried from the layer configuration information, the stacking order of the vector image on the target page is determined, and according to the second content image, the second layer information corresponding to the second content image is queried from the layer configuration information, the stacking order of the content image on the target page is determined, and then according to the first layer information and the second layer information, a rendering strategy is obtained according to the stacking order. Since the content image is located below the vector image, only the vector image is displayed on the target page, which can reduce the cache in the case of loading images and speed up the image loading speed.
[0094] According to an embodiment of the present disclosure, the above page generation method further includes:
[0095] According to the content layout information, text information of the page content is generated. The text information of the page content includes text information of M sub-contents corresponding to M display areas, where m is an integer greater than 1 and less than M;
[0096] In response to a click operation on the m-th display area on the target page, target content information is displayed through the visual interface. The target content information represents the text information of the m-th sub-content corresponding to the m-th display area.
[0097] According to an embodiment of the present disclosure, according to the content layout information, text information of the page content is generated. For example, according to the layout method in the content layout information, the text information is laid out to generate the text information of the page content.
[0098] According to an embodiment of the present disclosure, in response to a click operation on the m-th display area on the target page, target content information is displayed through the visual interface. For example, by responding to a click operation on the display area on the target page, the corresponding target content can be displayed in this display area.
[0099] According to an embodiment of the present disclosure, according to the content layout information, text information of the page content is generated, and the text is arranged according to the content layout, and then in response to a click operation on the m-th display area on the target page, the arranged target content information is displayed through the visual interface, which enhances the flexibility of text display.
[0100] Figure 5 Schematically shows a flowchart of a method for generating text information of page content according to an embodiment of the present disclosure.
[0101] As Figure 5 shown, the method for generating text information of page content in this embodiment includes operation S510 to operation S530.
[0102] In operation S510, for the m-th display area, obtain the m-th sub-content information and the arrangement order information of each character in the m-th sub-content in the content layout information;
[0103] In operation S520, sort each character in the m-th sub-content according to the arrangement order information to obtain the text information of the m-th sub-content.
[0104] In operation S530, generate the page content text information according to the text information of the M sub-contents.
[0105] According to an embodiment of the present disclosure, for example, each character in the sub-content can be sorted according to the arrangement order in the content layout information to obtain the sub-content containing the sorted characters, and then the page content text information containing the sub-content can be generated according to the sub-content containing the sorted characters.
[0106] According to an embodiment of the present disclosure, by obtaining the sub-content information and the arrangement order information of each character in the sub-content in the display area from the content layout information, and then sorting each character in the sub-content according to the arrangement order information, the text information of the m-th sub-content can be obtained, and then the page content text information can be generated according to the text information of the m sub-contents. Since each character in the sub-content is arranged, the generated text information can be displayed on the target page, enhancing the flexibility of text information display.
[0107] According to an embodiment of the present disclosure, in response to a click operation on the m-th display area on the target page, display the target content information through a visual interface, including:
[0108] In response to a click operation on the m-th display area on the target page, obtain the position information of the target display area;
[0109] According to the position information of the target display area, query and obtain the target content information corresponding to the target display area;
[0110] Display the target content information through a visual interface.
[0111] According to an embodiment of the present disclosure, for example, it can be in response to a click operation on the display area on the target page, then obtain the position information of the clicked target display area, determine the content corresponding to the position information according to the position information, and then display the content at the position of the display area on the visual interface.
[0112] Figure 6 Schematically shows a schematic diagram of displaying target content information according to an embodiment of the present disclosure.
[0113] As Figure 6As shown, in response to a click operation on the A4 area of the target page, the position information of the A4 area can be obtained, and then according to this position information, the target content information corresponding to this position information can be queried, and the target content information can be displayed in the A4 area.
[0114] According to an embodiment of the present disclosure, by responding to a click operation on the m-th display area of the target page, the position information of the target display area is obtained, and then according to the position information of the target display area, the target content information corresponding to the target display area is queried, and then the target content information can be displayed in the display area of the visualization interface. Since the target content information is displayed only in response to the corresponding click operation, the cache of the loaded content image is reduced, the speed of loading the content image is increased, and the flexibility of displaying the target content information is increased.
[0115] Based on the above page generation method, the present disclosure also provides a page generation device. The following will be combined with Figure 7 to describe this device in detail.
[0116] Figure 7 Schematically shows a structural block diagram of a page generation device according to an embodiment of the present disclosure.
[0117] As Figure 7 shown, the page generation device 700 of this embodiment includes a parsing module 710, a deletion module 720, an acquisition module 730, and a first generation module 740.
[0118] The parsing module 710 is used to parse the page design file of the target page to obtain the information of the first content image and the first page layout information. Among them, the target page includes M display areas, the first page layout information includes area layout information and content layout information, and the area layout information represents the layout information of the M display areas on the target page; the content layout information represents the layout information of the page content within the M display areas, where M is an integer greater than 1. In one embodiment, the parsing module 710 can be used to perform the operation S210 described above, which will not be elaborated here.
[0119] The deletion module 720 is used to delete the content layout information from the first page layout information to obtain the second page layout information. In one embodiment, the deletion module 720 can be used to perform the operation S220 described above, which will not be elaborated here.
[0120] The acquisition module 730 is used to respond to a page generation request for the target page and obtain the information of the target display area. In one embodiment, the acquisition module 730 can be used to perform the operation S230 described above, which will not be elaborated here.
[0121] The first generation module 740 is configured to generate a target page according to the information of the target display area, the information of the first content image, and the second page layout information. In one embodiment, the first generation module 740 may be configured to perform the operation S240 described above, which will not be elaborated herein.
[0122] According to an embodiment of the present disclosure, the first generation module includes a processing sub-module and a first generation sub-module. The processing sub-module is configured to process the first content image according to the information of the target display area and the information of the first content image to obtain a second content image. The first generation sub-module is configured to generate a target page according to the second content image and the second page layout information.
[0123] According to an embodiment of the present disclosure, the processing sub-module includes a first acquisition unit and a processing unit. The first acquisition unit is configured to obtain image compression parameter information according to the first size information and the second size information. The processing unit is configured to process the first content image according to the image compression parameter information to obtain a second content image.
[0124] According to an embodiment of the present disclosure, the first generation sub-module includes a second acquisition unit and a rendering unit. The second acquisition unit is configured to obtain a rendering strategy according to the second content image and the second page layout information. The rendering unit is configured to perform a rendering process on the second content image and the second page layout information according to the rendering strategy to obtain a target page.
[0125] According to an embodiment of the present disclosure, the second acquisition unit includes a generation sub-unit, a first query sub-unit, a second query sub-unit, and an acquisition sub-unit. The generation sub-unit is configured to generate a target vector image according to the second page layout information. The first query sub-unit is configured to query the first layer information corresponding to the target vector image from the layer configuration information according to the target vector image. The second query sub-unit is configured to query the second layer information corresponding to the second content image from the layer configuration information according to the second content image. The acquisition sub-unit is configured to obtain a rendering strategy according to the first layer information and the second layer information.
[0126] According to an embodiment of the present disclosure, the above page generation device further includes a second generation module and a display module. The second generation module is configured to generate text information of page content according to the content layout information. The text information of page content includes text information of M sub-contents corresponding to M display areas, where M is an integer greater than 1 and less than M. The display module is configured to, in response to a click operation on the m-th display area on the target page, display target content information through a visual interface. The target content information represents the text information of the m-th sub-content corresponding to the m-th display area.
[0127] According to an embodiment of the present disclosure, the second generation module includes a first acquisition sub-module, a sorting sub-module, and a second generation sub-module. Among them, the first acquisition sub-module is configured to, for the m-th display area, acquire the m-th sub-content information and the arrangement order information of each character in the m-th sub-content in the m-th display area from the content layout information; the sorting sub-module is configured to sort each character in the m-th sub-content according to the arrangement order information to obtain the text information of the m-th sub-content; the second generation sub-module is configured to generate the page content text information according to the text information of the M sub-contents.
[0128] According to an embodiment of the present disclosure, the display module includes a second acquisition sub-module, a query sub-module, and a display sub-module. Among them, the second acquisition sub-module is configured to, in response to a click operation on the m-th display area on the target page, acquire the position information of the target display area; the query sub-module is configured to query the target content information corresponding to the target display area according to the position information of the target display area; the display sub-module is configured to display the target content information through a visual interface.
[0129] According to an embodiment of the present disclosure, any plurality of modules among the parsing module 710, the deletion module 720, the acquisition module 730, and the first generation module 740 may be combined and implemented in one module, or any one of them may be split into multiple modules. Or, at least part of the functions of one or more of these modules may be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the parsing module 710, the deletion module 720, the acquisition module 730, and the first generation module 740 may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on a substrate, a system in a package, an application specific integrated circuit (ASIC), or any other reasonable way of integrating or packaging circuits, etc., implemented by hardware or firmware, or implemented in any one of the three implementation manners of software, hardware, and firmware, or in an appropriate combination of any several of them. Or, at least one of the parsing module 710, the deletion module 720, the acquisition module 730, and the first generation module 740 may be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding functions may be executed.
[0130] Figure 8 A block diagram of an electronic device suitable for implementing the page generation method according to an embodiment of the present disclosure is schematically shown.
[0131] As Figure 8As shown, an electronic device 800 according to an embodiment of the present disclosure includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage section 808 into a random access memory (RAM) 803. The processor 801 may include, for example, a general microprocessor (e.g., CPU), an instruction set processor, and / or a related chipset, and / or a dedicated microprocessor (e.g., an application specific integrated circuit (ASIC)), etc. The processor 801 may also include on-board memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0132] In the RAM 803, various programs and data required for the operation of the electronic device 800 are stored. The processor 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. The processor 801 performs various operations of the method flow according to an embodiment of the present disclosure by executing the program in the ROM 802 and / or the RAM 803. It should be noted that the program may also be stored in one or more memories other than the ROM 802 and the RAM 803. The processor 801 may also perform various operations of the method flow according to an embodiment of the present disclosure by executing the program stored in the one or more memories.
[0133] According to an embodiment of the present disclosure, the electronic device 800 may further include an input / output (I / O) interface 805, and the input / output (I / O) interface 805 is also connected to the bus 804. The electronic device 800 may further include one or more of the following components connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed so that a computer program read from it can be installed into the storage section 808 as needed.
[0134] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist separately without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the one or more programs are executed, the method according to an embodiment of the present disclosure is implemented.
[0135] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include one or more memories other than the above-described ROM 802 and / or RAM 803 and / or ROM 802 and RAM 803.
[0136] An embodiment of the present disclosure further includes a computer program product, which includes a computer program that contains program code for executing the method shown in the flowchart. When the computer program product runs in a computer system, the program code is used to cause the computer system to implement the item recommendation method provided by the embodiment of the present disclosure.
[0137] When the computer program is executed by the processor 801, it executes the above functions defined in the system / apparatus of the embodiment of the present disclosure. According to an embodiment of the present disclosure, the above-described system, apparatus, module, unit, etc. may be implemented by computer program modules.
[0138] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices and magnetic storage devices. In another embodiment, the computer program may also be transmitted and distributed in the form of a signal on a network medium, and be downloaded and installed through the communication part 809, and / or be installed from the removable medium 811. The program code included in the computer program may be transmitted by any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0139] In such an embodiment, the computer program may be downloaded and installed from the network through the communication part 809, and / or be installed from the removable medium 811. When the computer program is executed by the processor 801, it executes the above functions defined in the system of the embodiment of the present disclosure. According to an embodiment of the present disclosure, the above-described system, device, apparatus, module, unit, etc. may be implemented by computer program modules.
[0140] In accordance with embodiments of the present disclosure, program code for executing the computer programs provided by the embodiments of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, such as Java, C++, Python, the "C" language, or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., by connecting through the Internet using an Internet service provider).
[0141] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and combinations of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0142] Those skilled in the art can understand that the features recited in the various embodiments and / or claims of the present disclosure can be combined or / and combined in various ways, even if such combinations or combinations are not explicitly recited in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features recited in the various embodiments and / or claims of the present disclosure can be combined and / or combined in various ways. All such combinations and / or combinations fall within the scope of the present disclosure.
[0143] The embodiments of the present disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments have been described separately above, this does not mean that the measures in each embodiment cannot be used advantageously in combination. The scope of the present disclosure is defined by the appended claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art can make various substitutions and modifications, and all such substitutions and modifications should fall within the scope of the present disclosure.
Claims
1. A page generation method, comprising: Parsing a page design file of a target page to obtain information of a first content image and first page layout information, where the target page includes M display areas, the first page layout information includes area layout information and content layout information, the area layout information represents the layout information of the M display areas on the target page; the content layout information represents the layout information of page content within the M display areas, where M is an integer greater than 1; Deleting the content layout information from the first page layout information to obtain second page layout information; Responding to a page generation request for the target page, and obtaining information of a target display area; Generating a target page according to the information of the target display area, the information of the first content image, and the second page layout information.
2. The method according to claim 1, wherein The generating a target page according to the information of the target display area, the information of the first content image, and the second page layout information includes: Processing the first content image according to the information of the target display area and the information of the first content image to obtain a second content image; Generating the target page according to the second content image and the second page layout information.
3. The method according to claim 2, wherein The information of the target display area represents first dimension information of the target display area, the information of the first content image represents second dimension information of the first content image, and the processing the first content image according to the information of the target display area and the information of the first content image to obtain a second content image includes: Obtaining image compression parameter information according to the first dimension information and the second dimension information; Processing the first content image according to the image compression parameter information to obtain the second content image.
4. The method according to claim 2, wherein The generating the target page according to the second content image and the second page layout information includes: Obtaining a rendering strategy according to the second content image and the second page layout information; Performing a rendering process on the second content image and the second page layout information according to the rendering strategy to obtain the target page.
5. The method according to claim 4, wherein, Obtaining a rendering strategy according to the second content image and the second page layout information includes: Generating a target vector image according to the second page layout information; Querying, from layer configuration information, first layer information corresponding to the target vector image according to the target vector image; Querying, from layer configuration information, second layer information corresponding to the second content image according to the second content image; Obtaining the rendering strategy according to the first layer information and the second layer information.
6. The method according to claim 1, further comprising: Generating text information of page content according to the content layout information, where the text information of the page content includes text information of M sub - contents corresponding to the M display areas, where m is an integer greater than 1 and less than M; In response to a click operation on the m-th display area on the target page, display target content information through a visual interface, where the target content information represents the text information of the m-th sub-content corresponding to the m-th display area.
7. The method according to claim 6, wherein Generating the text information of the page content according to the content layout information includes: For the m-th display area, obtain the m-th sub-content information and the arrangement order information of each character in the m-th sub-content in the m-th display area from the content layout information; Sort each character in the m-th sub-content according to the arrangement order information to obtain the text information of the m-th sub-content; Generate the text information of the page content according to the text information of the M sub-contents.
8. The method according to claim 6, wherein, In response to a click operation on the m-th display area on the target page, displaying the target content information through a visual interface includes: In response to a click operation on the m-th display area on the target page, obtain the position information of the target display area; According to the position information of the target display area, query and obtain the target content information corresponding to the target display area; Display the target content information through a visual interface.
9. A page generation device, comprising: A parsing module, configured to parse a page design file of a target page to obtain information of a first content image and first page layout information, where the target page includes M display areas, the first page layout information includes area layout information and content layout information, the area layout information represents the layout information of the M display areas on the target page; the content layout information represents the layout information of page content within the M display areas, where M is an integer greater than 1; A deletion module, configured to delete the content layout information from the first page layout information to obtain second page layout information; An acquisition module, configured to, in response to a page generation request for the target page, acquire information of a target display area; A first generation module, configured to generate a target page according to the information of the target display area, the information of the first content image, and the second page layout information.
10. An electronic device, comprising: One or more processors; A storage device, configured to store one or more programs, where when the one or more programs are executed by the one or more processors, the one or more processors are caused to execute the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, on which executable instructions are stored, and when the instructions are executed by a processor, the processor is caused to execute the method according to any one of claims 1 to 8.
12. A computer program product, comprising a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Method and device for displaying pages
CN108279903A
Method and device for embedding transition page into webpage, computer equipment and storage medium
CN112328940A