Page image processing method, device, server and storage medium

By querying the server and calling the browser rendering service to draw pictures, the problem of inconsistent display effects on different terminals is solved, and the picture display effect is unified and the quality is improved.

CN111475751BActive Publication Date: 2025-10-03SAI ANDY TECHNOLOGY (HONG KONG) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010189667.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-18
Publication Date
2025-10-03
Estimated Expiration
2040-03-18

AI Technical Summary

Technical Problem

Due to differences in browsers and displays on different terminals, the use of canvas rendering technology results in inconsistent display effects and different clarity of images drawn on the same page, resulting in poor image display effects.

Method used

The server receives the image acquisition request from the terminal and checks whether the target page image exists. If so, it is sent directly. If not, the browser rendering service is called to draw the image and send the image to the terminal, or the image rendering tool library is called through the browser rendering service to draw the image and add a QR code to the initial image to generate the final image.

Benefits of technology

This achieves the unification of the display effects of pictures drawn on the same page by different terminals, improving picture quality and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111475751B_ABST
    Figure CN111475751B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a page image processing method, device, server and storage medium, the method may include: receiving an image acquisition request for a target page sent by a terminal, the image acquisition request carrying the page parameters of the target page; querying whether there is a drawn image of the target page according to the page parameters of the target page; when the query finds that there is a drawn image of the target page, acquiring the image of the target page and sending the image of the target page to the terminal; when the query finds that there is no drawn image of the target page, calling the browser rendering service to draw the image of the target page and sending the image of the target page to the terminal. By adopting the present application, the display effect of the images drawn by different terminals for the same page can be made more uniform, thereby improving the image display effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a page image processing method, device, server, and storage medium. Background Art

[0002] With the rapid development of internet technology, a wide variety of internet terminals are now available, including traditional PCs, mobile browsers (H5), native apps, and the more recent rise of mini-programs. This diverse range of internet terminal products involves a complex and diverse range of browser kernels and versions, as well as the varying display resolutions of different mobile phones. Multi-terminal compatibility has long been a challenge for the terminal industry.

[0003] Currently, an increasing number of internet terminal products require real-time image generation for web pages, allowing users to download, share, and forward web pages. Most internet terminal products use canvas rendering technology to draw web pages. However, due to differences in browsers and displays, this rendering technology can result in inconsistent display of images drawn on the same page across different terminals. For example, image clarity can vary, resulting in poor display quality. Summary of the Invention

[0004] The embodiments of the present application provide a page image processing method, device, server and storage medium, which can make the display effects of images drawn by different terminals for the same page more unified, thereby improving the image display effect.

[0005] In a first aspect, an embodiment of the present application provides a page image processing method, comprising:

[0006] Receiving a request for obtaining an image of a target page sent by a terminal, wherein the request carries page parameters of the target page;

[0007] querying whether there is a drawn image of the target page according to the page parameters of the target page;

[0008] When the query finds that there is a drawn image of the target page, obtaining the image of the target page and sending the image of the target page to the terminal;

[0009] When the query shows that there is no drawn picture of the target page, the browser rendering service is called to draw the picture of the target page, and the picture of the target page is sent to the terminal.

[0010] Optionally, the page parameter includes a link address of the target page, and the calling of the browser rendering service to draw a picture of the target page includes:

[0011] Calling the browser rendering service to draw the initial image of the target page, and generating a QR code image of the target page according to the link address of the target page;

[0012] Add the QR code image to the initial image to obtain the initial image with the QR code image added;

[0013] The initial image with the QR code image added thereto is determined as the image of the target page.

[0014] Optionally, calling a browser rendering service to draw a picture of the target page includes:

[0015] The image rendering tool library is called through the browser rendering service, and the image of the target page is drawn according to the image rendering tool library.

[0016] Optionally, drawing the image of the target page includes:

[0017] Start the kernel for simulating browser behavior;

[0018] Creating a page cache through the kernel, accessing the link address of the target page, and loading the target page according to preset page attributes;

[0019] The target page is stored in a page cache through the kernel, and a screenshot is performed on the target page in the page cache to obtain a picture of the target page.

[0020] Optionally, when the query does not find the image of the target page drawn, after calling the browser rendering service to draw the image of the target page, the method further includes:

[0021] Storing the image of the target page locally; or,

[0022] The image of the target page is sent to a picture cache server so that the picture cache server stores the image of the target page.

[0023] Optionally, the method further includes:

[0024] Obtaining a page image query record, wherein the page image query record includes the number of queries for images of each of a plurality of pages within a preset time range;

[0025] According to the page query records, determining from the images images of pages whose query times are less than a preset threshold;

[0026] Delete the images of the pages whose query times are less than a preset threshold.

[0027] Optionally, the image acquisition request is sent by the terminal after detecting an image acquisition triggering event for the target page; wherein,

[0028] The image acquisition triggering event may be any one of the following: an image sharing event, an image saving event, or a page link address submission event.

[0029] In a second aspect, an embodiment of the present application provides a page image processing device, comprising:

[0030] A communication module, configured to receive a request for obtaining an image of a target page from a terminal, wherein the request carries page parameters of the target page;

[0031] A query module, configured to query whether a drawn image of the target page exists according to page parameters of the target page;

[0032] an acquisition module, configured to acquire the image of the target page when the query module queries that there is a drawn image of the target page, and send the image of the target page to the terminal through the communication module;

[0033] The drawing module is used to call the browser rendering service to draw the picture of the target page when the query module queries that there is no drawn picture of the target page, and send the picture of the target page to the terminal through the communication module.

[0034] In a third aspect, an embodiment of the present application provides a server comprising a processor, an input device, an output device, and a memory, wherein the processor, the input device, the output device, and the memory are interconnected, wherein the memory is used to store a computer program, the computer program comprising program instructions, and the processor is configured to call the program instructions to execute the method described in the first aspect.

[0035] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method as described in the first aspect.

[0036] To sum up, the server can receive an image acquisition request for a target page sent by a terminal, and query whether there is a drawn image of the target page based on the page parameters of the target page carried in the image acquisition request; when the query shows that there is a drawn image of the target page, the server can obtain the image of the target page and send the image of the target page to the terminal; when the query shows that there is no drawn image of the target page, the server can call the browser rendering service to draw the image of the target page and send the image of the target page to the terminal, thereby making the display effects of the images drawn for the same page by different terminals more unified, thereby improving the image display effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0038] Figure 1 This is a flow chart of a page image processing method provided by an embodiment of the present application;

[0039] Figure 2 This is a flow chart of another page image processing method provided by an embodiment of the present application;

[0040] Figure 3 This is a schematic diagram of the network architecture of a page image processing system provided by an embodiment of the present application;

[0041] Figure 4 This is a schematic diagram of the structure of a page image processing device provided in an embodiment of the present application;

[0042] Figure 5 It is a structural diagram of a server provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0043] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0044] See also Figure 1 , is a flow chart of a page image processing method provided in an embodiment of the present application. The method can be applied to a server, which can be a server or a server cluster. Specifically, the method can include the following steps:

[0045] S101: Receive an image acquisition request for a target page sent by a terminal, where the image acquisition request carries page parameters of the target page.

[0046] In an embodiment of the present application, the terminal may send a request for obtaining an image of a target page to the server, and the server may receive the request for obtaining an image of the target page sent by the terminal, wherein the page parameter may at least include the link address of the target page.

[0047] In one embodiment, the image acquisition request may be sent by the terminal through an application client, and the server may be a server corresponding to the application client, wherein the application client includes but is not limited to H5, mini-programs, and APP applications.

[0048] In one embodiment, the image acquisition request is sent by the terminal after detecting an image acquisition trigger event for the target page; wherein the image acquisition trigger event can be any of the following: an image sharing event, an image save as event, or a page link address submission event.

[0049] For example, when the terminal detects a click operation on a picture sharing button corresponding to a target page, it is determined that a picture acquisition trigger event for the target page is detected.

[0050] For another example, when the terminal detects a click operation on an option corresponding to the target page to save the page as a picture, it determines that a picture acquisition trigger event for the target page is detected.

[0051] In one application scenario, a terminal user can open the target page on a computer application client. The application client can display a menu bar when a right-click event is detected. The menu bar may include an option to save the page as an image. The terminal user can click the option to save the page as an image. When the terminal detects the click operation on the option to save the page as an image, it determines that an image acquisition event for the target page has been detected.

[0052] For another example, when the terminal detects that the user clicks a submit button corresponding to a page parameter of a target page, it determines that a trigger event for obtaining an image for the target page is detected.

[0053] In one application scenario, a terminal can open the page parameter entry interface of an application client. This page parameter entry interface may include a link address input box and a submit button. The terminal user can enter the link address of the target page in the link address input box and click the submit button. When the terminal detects the click of the submit button, it determines that a trigger event for obtaining an image for the target page has been detected.

[0054] S102: Query whether there is a drawn image of the target page according to the page parameters of the target page.

[0055] In the embodiment of the present application, the server may execute step S103 and step S104 in parallel after executing step S102.

[0056] In one embodiment, the server may locally store images for each of the multiple pages. The images for each page may be drawn by the server using a browser rendering service. The server may query whether a drawn image of the target page exists locally based on the page parameters of the target page. Storing the images of the page by the server may increase the speed of querying the images of the page, thereby increasing the response rate to image acquisition requests.

[0057] In one embodiment, an image rendering server may include images for each of a plurality of pages. The images for each page may be rendered by the server using a browser rendering service. The server may query an image cache server based on the page parameters of the target page to determine whether the rendered image for the target page exists. Having the image cache server store the images for the page can reduce storage pressure on the server.

[0058] S103: When the query finds that there is a drawn image of the target page, the image of the target page is acquired, and the image of the target page is sent to the terminal.

[0059] In the embodiment of the present application, when the server finds that an image of the target page has been drawn, it can obtain the image of the target page and send the image of the target page to the terminal. Compared with the problem of inconsistent page images drawn by different terminals caused by the existing technology of terminals using canvas rendering technology to draw images, the embodiment of the present application adopts the above method to make the display effect of the same page image on different terminals more uniform and the image quality better.

[0060] In one embodiment, when the server finds that a rendered image of the target page exists locally, the server may obtain the image of the target page locally.

[0061] In one embodiment, when the server queries and finds that the image cache server has the image of the target page drawn, the server can obtain the image of the target page from the image cache server.

[0062] In one embodiment, the server may forward the image acquisition request to the image cache server, and the image cache server may return the image of the target page to the server in response to the image acquisition request, and the server may receive the image of the target page.

[0063] S104: When the query indicates that there is no drawn image of the target page, calling a browser rendering service to draw the image of the target page, and sending the image of the target page to the terminal.

[0064] In an embodiment of the present application, when the server queries and finds that there is no drawn image of the target page, it can call the browser rendering service to draw the image of the target page, and send the image of the target page to the terminal. The page image is drawn in real time through the browser rendering service, so that the display effect of the same page image on different terminals is more unified.

[0065] In one embodiment, the server calls the browser rendering service to draw the image of the target page in a manner that the server calls the image rendering tool library through the browser rendering service, and draws the image of the target page according to the image rendering tool library. Among them, the browser rendering service refers to a program that can provide image rendering functions for page images. The image rendering tool library can also be called an image rendering toolkit. The image rendering tool can provide multiple interfaces and can call the functions of the kernel for simulating browser behavior without a user interface. The embodiment of the present application adopts the above process to improve the quality of page images and solve the problem of inconsistent display of the same page image on different terminals.

[0066] In one embodiment, the browser rendering service can be deployed on a server, or can also be deployed on other servers, such as a rendering server. In one embodiment, the browser rendering service can be a Puppeteer rendering service, and the image rendering tool library can be Puppeteer.

[0067] In one embodiment, the browser rendering service may provide an external access interface, which is used to provide image rendering functionality for page images. The server may communicate with the browser rendering service through the access interface, thereby implementing a call to the browser rendering service.

[0068] In one embodiment, the browser rendering service may be a Hypertext Transfer Protocol (HTTP) service. Since HTTP is more universal and easy to use, when the browser rendering service is an HTTP service, the server's call to the browser rendering service will be simpler and more convenient.

[0069] In one embodiment, the method of drawing the image of the target page can be to start a kernel for simulating browser behavior; create a page cache through the kernel, access the link address of the target page, and load the target page according to preset page attributes; store the target page in the page cache through the kernel, and take a screenshot of the target page in the page cache to obtain an image of the target page. The page attributes include but are not limited to at least one of the following: page resolution, maximum width of the page, and maximum height of the page. The image of the target page can be a screenshot (such as a screenshot of the entire target page) or a PDF file.

[0070] In one embodiment, when the query shows that there is no drawn image of the target page, the server can call the browser rendering service to draw the image of the target page and then store the image of the target page locally; or, send the image of the target page to the image cache server so that the image cache server can store the image of the target page.

[0071] In one embodiment, the server can obtain a page image query record, which includes the number of queries for images of each of a plurality of pages within a preset time range; the server determines, from the images, images of pages with a query count less than a preset threshold value based on the page query record, and deletes the images of pages with a query count less than the preset threshold value. For example, the server obtains a page image query record, which includes the number of queries for images of each of a plurality of pages within the past month. The server can determine, from the images, images of pages with a query count less than 10 times based on the page query record, and delete the images of pages with a query count less than 10 times. By adopting the above process, some unimportant images can be deleted, thereby reducing the storage pressure of the server or image cache server.

[0072] visible, Figure 1 In the embodiment shown, the server can receive an image acquisition request for a target page sent by a terminal, and query whether there is a drawn image of the target page based on the page parameters of the target page carried in the image acquisition request; when the server queries that there is a drawn image of the target page, it obtains the image of the target page and sends the image of the target page to the terminal; when the server queries that there is no drawn image of the target page, it calls the browser rendering service to draw the image of the target page, and sends the image of the target page to the terminal, so that the display effect of the page images obtained by different terminals is more unified, thereby improving the image display effect.

[0073] See also Figure 2, is a flow chart of another page image processing method provided in an embodiment of the present application. The method can be applied to a server. The server can be a single server or a server cluster. Specifically, the method can include the following steps:

[0074] S201: Receive an image acquisition request for a target page sent by a terminal, where the image acquisition request carries page parameters of the target page.

[0075] Among them, step S201 can refer to step S101, and the embodiment of this application will not be repeated here.

[0076] S202: Query whether there is a drawn image of the target page according to the page parameters of the target page.

[0077] In one embodiment, the server may query whether the rendered image of the target page exists locally or in an image cache server.

[0078] S203: When the query finds that there is a drawn image of the target page, obtain the image of the target page and send the image of the target page to the terminal.

[0079] In the embodiment of the present application, the terminal may execute step S203 and step S204 in parallel after executing step S202. The image of the target page mentioned in the embodiment of the present application refers to the initial image with the corresponding QR code image added.

[0080] S204. When the query shows that there is no drawn image of the target page, call the browser rendering service to draw the image of the target page, call the browser rendering service to draw the initial image of the target page, and generate a QR code image of the target page according to the link address of the target page.

[0081] In one embodiment, the server calls the browser rendering service to draw the initial image of the target page by calling an image rendering tool library through the browser rendering service and drawing the initial image of the target page according to the image rendering tool library.

[0082] In one embodiment, the method of drawing the image of the target page can be to start a kernel for simulating browser behavior; create a page cache through the kernel, access the link address of the target page, and load the target page according to preset page attributes; store the target page in the page cache through the kernel, and take a screenshot of the target page in the page cache to obtain the initial image of the target page. The page attributes include but are not limited to at least one of the following: page resolution, maximum width of the page, and maximum height of the page. The image of the target page can be a screenshot (such as a screenshot of the entire target page) or a PDF file.

[0083] In one embodiment, the server may utilize a QR code generator to generate a QR code image of the target page according to the link address of the target page.

[0084] S205 , adding the QR code image to the initial image to obtain the initial image with the QR code image added.

[0085] S206: Determine the initial image with the QR code image added thereto as the image of the target page, and send the image of the target page to the terminal.

[0086] In an embodiment of the present application, the server can add the QR code image to the initial image to obtain the initial image with the QR code image added thereto; the server can determine the initial image with the QR code image added thereto as the image of the target page, and send the image of the target page to the terminal. By sending the page image with the QR code image added thereto to the terminal, the terminal user can obtain more detailed page information, thereby improving the user experience.

[0087] In one embodiment, the server may identify a blank space in the initial image and add the QR code image in the blank space.

[0088] In one embodiment, the server may identify the location of the key information in the initial image, and add the QR code image to other locations in the initial image except the location of the key information.

[0089] In one embodiment, the server may store the image of the target page locally; or, the server may send the image of the target page to an image cache server so that the image cache server stores the image of the target page.

[0090] In one embodiment, considering that a page may be updated, the server can obtain the link address of the target page when it detects that the update cycle for the image of the target page has arrived, and call the browser rendering service to redraw the image of the target page, and use the redrawn image of the target page to update the image. This image update can be directed to the local or image cache server. Using the above process, the content of the page image can be updated more timely and effectively.

[0091] In one embodiment, the server can obtain the image of the target page and the link address of the target page when detecting that the update cycle of the image of the target page has arrived, and access the link address of the target page to obtain the target page; the server can verify the consistency of the content of the image of the target page and the content of the target page. If the verification fails, the image of the target page is redrawn through the browser rendering service, and the image is updated using the redrawn image of the target page.

[0092] In one embodiment, when querying for a drawn image of the target page, the server can obtain the image of the target page and the link address of the target page, and access the link address of the target page to obtain the target page; the server can verify the consistency between the content of the image of the target page and the content of the target page; if the verification passes, the image of the target page is sent to the terminal; if the verification fails, the image of the target page is redrawn through the browser rendering service, and the redrawn image of the target page is sent to the terminal. In addition, the server can also use the redrawn image of the target page to update the image.

[0093] In one embodiment, the image acquisition request carries an event type, which may refer to the type of touch event. When the event type indicates that the image acquisition trigger event is an image sharing event, the server may execute the steps of calling the browser rendering service to draw the initial image of the target page, and generating a QR code image of the target page according to the link address of the target page; when the event type indicates that the image acquisition trigger event is an image save as event, the server may call the browser rendering service to draw the initial image of the target page, and determine the initial image as the image of the target page; when the event type indicates that the image acquisition trigger event is a page link address submission event, the server may execute the steps of calling the browser rendering service to draw the initial image of the target page, and generating a QR code image of the target page according to the link address of the target page, or may call the browser rendering service to draw the initial image of the target page, and determine the initial image as the image of the target page.

[0094] visible, Figure 2In the embodiment shown, when the query shows that there is no drawn image of the target page, the server can call the browser rendering service to draw the initial image of the target page, and generate a QR code image of the target page based on the link address of the target page; the server can add the QR code image to the initial image to obtain the initial image with the QR code image added, and determine the initial image with the QR code image added as the image of the target page, and send the page image with the QR code image added to the terminal, which can facilitate the terminal user to obtain more detailed page information and improve the user experience.

[0095] See also Figure 3 , is a network architecture diagram of a page image processing system provided in an embodiment of the present application. Figure 3 The system shown may include a terminal 10 and a server 20. The terminal 10 may communicate with the server 20.

[0096] The terminal 10 can send a picture acquisition request for the target page to the server 20. The server can execute step S101 to obtain the picture acquisition request, and can obtain the picture of the target page by executing steps S102-S104, and send the picture of the target page to the terminal 10, which can make the display effect of the page pictures obtained by different terminals more unified and improve the picture display effect.

[0097] See also Figure 4 , is a schematic diagram of the structure of a page image processing device provided in an embodiment of the present application. The page image processing device can be applied to a server. Specifically, the page image processing device may include:

[0098] The communication module 401 is configured to receive a picture acquisition request for a target page sent by a terminal, where the picture acquisition request carries page parameters of the target page.

[0099] The query module 402 is configured to query whether a drawn image of the target page exists according to the page parameters of the target page.

[0100] The acquisition module 403 is configured to acquire the image of the target page when the query module 402 queries that there is a drawn image of the target page, and send the image of the target page to the terminal through the communication module 401 .

[0101] The drawing module 404 is configured to call a browser rendering service to draw a picture of the target page when the query module 402 does not find any drawn picture of the target page, and send the picture of the target page to the terminal through the communication module 401 .

[0102] In an optional embodiment, the page parameters include the link address of the target page, and the drawing module 404 is specifically used to call the browser rendering service to draw the initial image of the target page, and generate a QR code image of the target page according to the link address of the target page; add the QR code image to the initial image to obtain the initial image with the QR code image added; and determine the initial image with the QR code image added as the image of the target page.

[0103] In an optional implementation, the drawing module 404 is specifically configured to call an image rendering tool library through the browser rendering service, and draw the image of the target page according to the image rendering tool library.

[0104] In an optional embodiment, the drawing module 404 draws a picture of the target page, specifically by starting a kernel for simulating browser behavior; creating a page cache through the kernel, accessing the link address of the target page, and loading the target page according to preset page attributes; storing the target page in the page cache through the kernel, and taking a screenshot of the target page in the page cache to obtain a picture of the target page.

[0105] In an optional implementation, the page image processing device further includes a processing module 405 .

[0106] In an optional embodiment, the processing module 405 is used to call the browser rendering service to draw the image of the target page when the drawing module 404 queries through the query module 402 that there is no drawn image of the target page, and then store the image of the target page locally; or, send the image of the target page to the image cache server through the communication module 401, so that the image cache server stores the image of the target page.

[0107] In an optional embodiment, the processing module 405 is also used to obtain a page image query record, wherein the page image query record includes the number of queries for images of each of multiple pages within a preset time range; based on the page query record, determine from the images the images of pages with a query number less than a preset threshold; and delete the images of pages with a query number less than the preset threshold.

[0108] In an optional embodiment, the image acquisition request is sent by the terminal after detecting an image acquisition trigger event for the target page; wherein, the image acquisition trigger event can be any one of the following: image sharing event, image save as event, page link address submission event.

[0109] visible, Figure 4In the embodiment shown, the server can receive an image acquisition request for a target page sent by a terminal, and query whether there is a drawn image of the target page based on the page parameters of the target page carried in the image acquisition request; when the server queries that there is a drawn image of the target page, it obtains the image of the target page and sends the image of the target page to the terminal; when the server queries that there is no drawn image of the target page, it calls the browser rendering service to draw the image of the target page, and sends the image of the target page to the terminal, so that the display effect of the page images obtained by different terminals is more unified, thereby improving the image display effect.

[0110] See also Figure 5 , which is a schematic diagram of the structure of a server provided in an embodiment of the present application. The server described in this embodiment may include: a processor 1000, one or more input devices 2000, one or more output devices 3000, and a memory 4000. The processor 1000, one or more input devices 2000, one or more output devices 3000, and the memory 4000 may be connected via a bus or other means. The input devices 2000 and the output devices 3000 may include standard wired or wireless communication interfaces.

[0111] The processor 1000 may be a central processing unit (CPU), or may be another general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, etc.

[0112] The memory 4000 can be a high-speed RAM memory or a non-volatile memory, such as a disk memory. The memory 4000 is used to store a set of program codes. The processor 1000, the input device 2000, and the output device 3000 can call the program codes stored in the memory 4000. Specifically:

[0113] The processor 1000 receives a picture acquisition request for a target page sent by the terminal through the input device 2000, wherein the picture acquisition request carries the page parameters of the target page; queries whether there is a drawn picture of the target page according to the page parameters of the target page; when the query finds that there is a drawn picture of the target page, acquires the picture of the target page, and sends the picture of the target page to the terminal through the output device 3000; when the query finds that there is no drawn picture of the target page, calls the browser rendering service to draw the picture of the target page, and sends the picture of the target page to the terminal through the output device 3000.

[0114] Optionally, the page parameters include the link address of the target page, and the processor 1000 calls the browser rendering service to draw the picture of the target page, specifically calling the browser rendering service to draw the initial picture of the target page, and generating a QR code picture of the target page according to the link address of the target page; adding the QR code picture to the initial picture to obtain the initial picture with the QR code picture added; and determining the initial picture with the QR code picture added as the picture of the target page.

[0115] Optionally, the processor 1000 calls a browser rendering service to draw the image of the target page, specifically calling an image rendering tool library through the browser rendering service, and drawing the image of the target page according to the image rendering tool library.

[0116] Optionally, the processor 1000 draws a picture of the target page, specifically by starting a kernel for simulating browser behavior; creating a page cache through the kernel, accessing the link address of the target page, and loading the target page according to preset page attributes; storing the target page in the page cache through the kernel, and taking a screenshot of the target page in the page cache to obtain a picture of the target page.

[0117] Optionally, the processor 1000 is also used to call the browser rendering service to draw the image of the target page when the query does not contain a drawn image of the target page, and then store the image of the target page locally; or, send the image of the target page to the image cache server through the output device 3000, so that the image cache server stores the image of the target page.

[0118] Optionally, the processor 1000 is also used to obtain a page image query record, wherein the page image query record includes the number of queries for images of each of multiple pages within a preset time range; based on the page query record, determine from the images images of pages with a query number less than a preset threshold; and delete the images of pages with a query number less than the preset threshold.

[0119] Optionally, the image acquisition request is sent by the terminal after detecting an image acquisition trigger event for the target page; wherein the image acquisition trigger event can be any one of the following: an image sharing event, an image save as event, and a page link address submission event.

[0120] In a specific implementation, the processor 1000, input device 2000, and output device 3000 described in the embodiment of the present application may execute Figure 1 and Figure 2 The implementation method described in the embodiment can also implement the implementation method described in the embodiment of this application, which will not be repeated here.

[0121] The functional modules in the various embodiments of the present application may be integrated into a single processing module, or each module may exist physically separately, or two or more modules may be integrated into a single module. The aforementioned integrated modules may be implemented in the form of sampling hardware or sampling software functional modules.

[0122] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The computer-readable storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0123] The above disclosure is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application. Ordinary technicians in this field can understand that all or part of the processes of the above embodiment and equivalent changes made in accordance with the claims of the present application are still within the scope covered by the present application.

Claims

1. A page image processing method, characterized in that: include: Receiving a request for obtaining an image of a target page sent by a terminal, wherein the request carries page parameters of the target page; querying whether there is a drawn image of the target page according to the page parameters of the target page; When the query finds that there is a picture of the target page drawn, the picture of the target page is obtained, and the link address of the target page is obtained, and the link address of the target page is accessed to obtain the target page; Verify the consistency between the content of the target page's image and the content of the target page; If the verification fails, the target page image is redrawn through the browser rendering service, and the redrawn target page image is sent to the terminal; If the verification is passed, the image of the target page is sent to the terminal; When the query finds that no image of the target page is drawn, calling a browser rendering service to draw the image of the target page, and sending the image of the target page to the terminal; the image of the target page is obtained by loading the target page according to preset page attributes and storing the target page in a page cache, and then taking a screenshot of the target page in the page cache, wherein the page attributes include: page resolution, maximum width of the page, and maximum height of the page; When it is detected that the update cycle of the image of the target page has arrived, the image of the target page is obtained, and the link address of the target page is obtained, and the link address of the target page is accessed to obtain the target page; the consistency of the content of the image of the target page and the content of the target page is verified. If the verification fails, the image of the target page is redrawn through the browser rendering service, and the image is updated using the redrawn image of the target page.

2. The method according to claim 1, characterized in that The page parameter includes the link address of the target page, and the calling of the browser rendering service to draw the image of the target page includes: Calling the browser rendering service to draw the initial image of the target page, and generating a QR code image of the target page according to the link address of the target page; Add the QR code image to the initial image to obtain the initial image with the QR code image added; The initial image with the QR code image added thereto is determined as the image of the target page.

3. The method according to claim 1, characterized in that The calling of the browser rendering service to draw the image of the target page includes: The image rendering tool library is called through the browser rendering service, and the image of the target page is drawn according to the image rendering tool library.

4. The method according to claim 3, characterized in that Drawing the image of the target page includes: Start the kernel for simulating browser behavior; Creating a page cache through the kernel, accessing the link address of the target page, and loading the target page according to preset page attributes; The target page is stored in a page cache through the kernel, and a screenshot is performed on the target page in the page cache to obtain a picture of the target page.

5. The method according to claim 1, wherein When the query finds that no image of the target page is drawn, after calling the browser rendering service to draw the image of the target page, the method further includes: Storing the image of the target page locally; or, The image of the target page is sent to a picture cache server so that the picture cache server stores the image of the target page.

6. The method according to claim 1, wherein The method further comprises: Obtaining a page image query record, wherein the page image query record includes the number of queries for images of each of a plurality of pages within a preset time range; According to the page query records, determining from the images images of pages whose query times are less than a preset threshold; Delete the images of the pages whose query times are less than a preset threshold.

7. The method according to claim 1, characterized in that The picture acquisition request is sent by the terminal after detecting a picture acquisition triggering event for the target page; wherein, The image acquisition triggering event may be any one of the following: an image sharing event, an image saving event, or a page link address submission event.

8. A page image processing device, characterized in that: include: A communication module, configured to receive a request for obtaining an image of a target page from a terminal, wherein the request carries page parameters of the target page; A query module, configured to query whether a drawn image of the target page exists according to page parameters of the target page; an acquisition module, configured to acquire the image of the target page and the link address of the target page when the query module queries that there is a drawn image of the target page, and access the link address of the target page to obtain the target page; Verify the consistency between the content of the target page's image and the content of the target page; If the verification fails, the target page image is redrawn through the browser rendering service, and the redrawn target page image is sent to the terminal; If the verification is passed, the image of the target page is sent to the terminal through the communication module; a drawing module configured to, when the query module queries that no image of the target page exists, call a browser rendering service to draw an image of the target page, and send the image of the target page to the terminal via the communication module; the image of the target page is obtained by loading the target page according to preset page attributes and storing the target page in a page cache, and then taking a screenshot of the target page in the page cache, wherein the page attributes include: page resolution, maximum page width, and maximum page height; The drawing module is also used to obtain the image of the target page and the link address of the target page when detecting that the update cycle of the image of the target page has arrived, and access the link address of the target page to obtain the target page; verify the consistency of the content of the image of the target page and the content of the target page. If the verification fails, redraw the image of the target page through the browser rendering service, and use the redrawn image of the target page to update the image.

9. A server, characterized in that: The method comprises a processor, an input device, an output device and a memory, wherein the processor, the input device, the output device and the memory are interconnected, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Webpage image operating method and device, terminal and storage medium

    CN108376090A

  • Picture generation method, server, electronic device, and readable storage medium

    CN109165357A