Screenshot method, electronic device, and storage medium
Patent Information
- Application Number
- PCT/CN2026/079537
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-02-28
- Filing Date
- 2026-02-14
- Publication Date
- 2026-09-03
Smart Images

Figure CN2026079537_03092026_PF_FP_ABST
Abstract
Description
A screenshot method, electronic device, and storage medium
[0001] This application claims priority to Chinese Patent Application No. 202510242819.7, filed on February 28, 2025, entitled "A Screenshotting Method, Electronic Device and Storage Medium", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of terminal technology, and in particular to a screenshot method, electronic device, and storage medium. Background Technology
[0003] With the development of information technology, users can retrieve and display information resources through browsers. These resources can include text, images, animations, videos, or other content. These resources are displayed in the form of web pages. Generally, web pages contain a lot of content, but the screen size of a terminal device is limited, meaning the device cannot display all the content of a web page at once. The terminal device can receive user input by swiping up or down on the screen to display different content within the web page.
[0004] When a user wants to capture the entire content of a webpage, the device can use the scrolling screenshot function to capture the entire webpage, satisfying the user's need to capture long screenshots that exceed the height of the screen. During the scrolling screenshot process, the device can scroll the webpage and take multiple screenshots. Adjacent screenshots may contain overlapping areas. The device needs to crop out the overlapping areas from one of the adjacent screenshots before stitching the images together to obtain the long screenshot of the webpage.
[0005] However, the scrolling screenshot method requires the terminal device to scroll through the webpage, resulting in a poor user experience. Further research is needed to improve the efficiency of capturing long screenshots of webpages on terminal devices. Summary of the Invention
[0006] This application provides a screenshot method, an electronic device, and a storage medium. The terminal device can synthesize a long screenshot of a first webpage displayed in a first application through a newly added compositing module in the rendering process. This does not occupy the main process of the first application. If there is a webpage that needs to be refreshed, the main process of the first application can synthesize the webpage to be refreshed to refresh the animated or video content on the webpage. This prevents webpage lag during the terminal device's acquisition of the long screenshot of the first webpage, thus improving the display effect of the webpage on the terminal device.
[0007] Firstly, this application provides a screenshot method. The method is applied to a terminal device, on which a first application runs. The first application includes a main process and a rendering process, the rendering process including a drawing module and a compositing module. The method includes: the terminal device displaying a first portion of the content of a first webpage of the first application; the terminal device receiving a first operation, the first operation being used to enable a long screenshot function; in response to the first operation, the terminal device acquiring first webpage resources of the first webpage through the drawing module; based on the first webpage resources, the terminal device acquiring drawing instructions for compositing a first long screenshot through the drawing module; and the terminal device rendering and compositing the drawing instructions for drawing the first long screenshot through the compositing module to obtain a first long screenshot, the first long screenshot including a first portion of content and a second portion of the content of the first webpage.
[0008] Optionally, if the content of the first webpage is extensive and the display area of the terminal device's screen is limited, when the display ratio of the first application is 100%, the terminal device can display the first part of the content of the first webpage, but not the second part of the content of the first webpage.
[0009] Optionally, the first operation can be a user double-tapping the screen with their knuckle, or a user clicking the virtual button for taking a screenshot, or a user pressing the power button and the volume up button.
[0010] Optionally, after the first application is launched, the terminal device can create a rendering process for the first application, which includes a drawing module and a compositing module.
[0011] Optionally, the above-mentioned rendering operations based on drawing instructions can be implemented by the CPU. This can avoid blocking the GPU's tasks, ensure that the GPU can process the rendering tasks of the next frame in a timely manner, and avoid stuttering.
[0012] Alternatively, after the terminal device renders the drawing instructions for drawing the first long screenshot through the compositing module, the compositing operation may not be required. In this way, the long screenshot can be saved directly without compositing it with other layers, and there is no need to display a thumbnail of the long screenshot on the terminal device's user interface.
[0013] Using this method, when the terminal device displays the first webpage, in response to the first operation of enabling the long screenshot function, the terminal device can synthesize a long screenshot of the first webpage in the first application displayed on the terminal device through the newly added compositing module in the rendering process. This will not occupy the main process of the first application. If there is a webpage that needs to be refreshed, the main process of the first application can synthesize the webpage to be refreshed to refresh the animated or video content in the webpage. There will be no webpage lag during the terminal device's acquisition of the long screenshot of the first webpage, thus improving the display effect of the webpage on the terminal device.
[0014] In conjunction with the first aspect, in one possible implementation, after obtaining the first long screenshot, the method further includes: the terminal device sending the first long screenshot to the main process of the first application via a compositing module. It should be understood that the terminal device can display a thumbnail of the long screenshot on the user interface.
[0015] After the compositing module of the rendering process obtains the first long screenshot of the first webpage, the compositing module of the rendering process can send the first long screenshot to the main process of the first application.
[0016] In one possible implementation, after receiving a first long screenshot of the first webpage, the main process of the first application can save the first long screenshot. For example, the main process of the first application can save it in the gallery application or in a folder used for storing screenshots.
[0017] In other possible implementations, after receiving the first long screenshot of the first webpage, the first long screenshot is not limited to being saved through the main process of the first application; the terminal device can also save the first long screenshot through the operating system.
[0018] In other possible implementations, after receiving the first long screenshot of the first webpage, the main process of the first application can output a first prompt, asking the user whether to save the first long screenshot. The user can choose to save the first long screenshot or not.
[0019] In other possible implementations, after receiving the first long screenshot of the first webpage, the first prompt is not limited to being output through the main process of the first application; the terminal device can also output the first prompt through the operating system. The first prompt is used to ask the user whether to save the first long screenshot.
[0020] In conjunction with the first aspect, in one possible implementation, the terminal device retrieves the first long screenshot from the shared memory of the first application through the main process. Specifically, this includes: after the terminal device stores the first long screenshot in the shared memory of the first application through the synthesis module, the terminal device sends a first message to the main process through the synthesis module; in response to the first message, the terminal device retrieves the first long screenshot from the shared memory of the first application through the main process.
[0021] Optionally, the shared memory for the first application may be requested after the terminal device receives the first operation.
[0022] Optionally, the shared memory of the first application can be requested by the main process of the first application. After requesting the shared memory of the first application, the main process of the first application can obtain the address of the shared memory of the first application and send the shared memory of the first application to the compositing module of the rendering process. The address of the shared memory of the first application is used by the compositing module of the rendering process to access the data stored in the shared memory of the first application.
[0023] In this way, the compositing module of the rendering process can send the first long screenshot to the main process of the first application through the shared content of the first application.
[0024] In conjunction with the first aspect, in one possible implementation, the terminal device retrieves the first long screenshot from the shared memory of the first application through the main process. Specifically, this includes: after the terminal device stores the first long screenshot in the shared memory of the first application through the synthesis module, the terminal device sends a first message to the main process through the synthesis module; in response to the first message, the terminal device retrieves the first long screenshot from the shared memory of the first application through the main process.
[0025] In this way, after the compositing module of the rendering process composes the first long screenshot, the compositing module of the rendering process can send a first message to the main process of the first application to instruct the main process of the first application to retrieve the first long screenshot from the shared memory of the first application.
[0026] Optionally, the compositing module of the rendering process may not send the first message to the main process of the first application. The main process of the first application may periodically or irregularly access the main process of the first application to confirm whether the first long screenshot is saved in the main process of the first application. If the first long screenshot is saved in the main process of the first application, the first long screenshot shall be retrieved.
[0027] In conjunction with the first aspect, in one possible implementation, after the terminal device displays the first part of the content of the first webpage of the first application, the method further includes: the terminal device sending the second webpage resource of the second webpage to the rendering module through the main process; based on the second webpage resource, the terminal device obtaining the rendering instructions for composing the second webpage through the rendering module; the terminal device sending the rendering instructions for composing the second webpage to the main process through the rendering module; the terminal device rendering and composing the rendering instructions for composing the second webpage through the main process to obtain the second webpage; and the terminal device displaying the second webpage.
[0028] Optionally, the second web page resource can be obtained from the server in real time by the main process of the first application, or it can be obtained in advance and stored in the terminal device.
[0029] In this way, when the first webpage contains animated images or videos, the terminal device needs to periodically refresh the animated image or video content on the webpage. During the time the terminal device is capturing the first long screenshot of the first webpage, the terminal device renders and synthesizes the first long screenshot through the compositing module of the rendering process, instead of rendering and synthesizing the first long screenshot through the main process of the first application. This avoids occupying the main process of the first application, and the terminal device can then render and synthesize the second webpage through the main process of the first application to refresh the animated image or video content on the webpage, thus preventing any lag.
[0030] In conjunction with the first aspect, in one possible implementation, based on the second webpage resource, the terminal device obtains drawing instructions for composing the second webpage through the drawing module, specifically including: the terminal device confirming whether it has obtained drawing instructions for composing the first long screenshot; when it has obtained drawing instructions for composing the first long screenshot, based on the second webpage resource, the terminal device obtains drawing instructions for composing the second webpage through the drawing module.
[0031] In other possible implementations, when the drawing instruction for synthesizing the first long screenshot is not obtained, the terminal device waits until the drawing instruction for synthesizing the first long screenshot is obtained, and then obtains the drawing instruction for synthesizing the second webpage based on the second webpage resource through the drawing module.
[0032] After the terminal device receives the user's instruction to enable the long screenshot function, the terminal device can obtain the drawing instructions for composing the first long screenshot based on the first webpage resource through the rendering module of the rendering process. Upon receiving the second webpage resource sent by the main process of the first application, the rendering module of the rendering process may be busy obtaining the drawing instructions for composing the first long screenshot. Therefore, after receiving the second webpage resource from the main process of the first application, the rendering process needs to confirm whether the drawing module is idle. If it is confirmed that the drawing module is idle, the rendering process can obtain the drawing instructions for composing the second webpage based on the second webpage resource. If it is confirmed that the drawing module is busy, the rendering process needs to wait until it obtains the drawing instructions for composing the first long screenshot, i.e., until the rendering module is idle, before obtaining the drawing instructions for composing the second webpage based on the second webpage resource.
[0033] In conjunction with the first aspect, in one possible implementation, after the terminal device obtains the first long screenshot from the shared memory of the first application through the main process, the method further includes: the terminal device deleting the first long screenshot from the shared memory of the first application.
[0034] In this way, after the main process of the first application retrieves the first long screenshot from the shared memory of the first application, the terminal device can delete the first long screenshot from the shared memory of the first application to save the storage space of the shared memory of the first application.
[0035] Secondly, this application provides a terminal device, including a memory and a processor; wherein the memory and the processor are coupled, the memory is used to store a computer program, and when the processor executes the computer program, it causes the terminal device to execute a screenshot method provided in any possible implementation of the first aspect.
[0036] Thirdly, this application provides a computer-readable storage medium including instructions that, when executed on a terminal device, cause the terminal device to perform a screenshot method provided in any possible implementation of the first aspect above.
[0037] Fourthly, this application provides a chip system including one or more processors, which are used to invoke computer instructions to cause a terminal device to execute a screenshot method provided in any possible implementation of any of the above aspects.
[0038] Fifthly, this application provides a computer program product containing instructions that, when the computer program product is run on a terminal device, causes the terminal device to execute a screenshot method provided in any possible implementation of any of the above aspects.
[0039] For a description of the beneficial effects in aspects two through five, please refer to the description of the beneficial effects in aspect one; this application will not repeat them here. Attached Figure Description
[0040] Figure 1A shows a schematic diagram of a webpage;
[0041] Figures 1B-1G show schematic diagrams of a terminal device 100 displaying a portion of the content of the long webpage shown in Figure 1A;
[0042] Figure 1H shows a schematic diagram of a specific implementation of a terminal device 100 refreshing a webpage in a first application;
[0043] Figures 2A-2D illustrate a set of schematic diagrams showing how a terminal device 100 acquires a long screenshot of the first webpage displayed on the terminal device 100;
[0044] Figure 2E shows a schematic diagram illustrating the specific implementation of another terminal device 100 refreshing a webpage;
[0045] Figure 3 shows a schematic diagram of a communication system 10 provided in this application;
[0046] Figure 4 shows a schematic diagram of the hardware structure of a terminal device 100;
[0047] Figure 5 is a hardware structure diagram of the server 200 provided in an embodiment of this application;
[0048] Figure 6 illustrates an exemplary software structure block diagram of the terminal device 100;
[0049] Figures 7A-7D illustrate a schematic diagram of another set of terminal devices 100 acquiring a long screenshot of the webpage displayed by the terminal device 100;
[0050] Figure 8 shows a flowchart of a method for a terminal device 100 to obtain a first webpage and display the first part of the content of the first webpage.
[0051] Figure 9 shows a flowchart of a method for a terminal device 100 to obtain a first long screenshot of a first webpage.
[0052] Figure 10 shows an interactive schematic diagram of a terminal device 100 acquiring a first long screenshot of a first webpage;
[0053] Figure 11 shows a schematic diagram of a method for refreshing a webpage on a terminal device 100;
[0054] Figure 12 shows a schematic diagram illustrating the specific implementation of another terminal device 100 refreshing a webpage;
[0055] Figure 13 shows a schematic diagram of a terminal device 100 obtaining a first long screenshot of a first long page of a first application;
[0056] Figure 14 is a flowchart illustrating a screenshot method provided in this application. Detailed Implementation
[0057] The technical solutions in the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; the word "and / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.
[0058] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Therefore, features defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0059] The term "user interface (UI)" used in the following embodiments of this application refers to the medium interface through which an application or operating system interacts and exchanges information with a user. It realizes the conversion between the internal form of information and the form that the user can accept. The most common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operation displayed in a graphical manner. It can be visual interface elements such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets displayed on the screen of a wearable device.
[0060] Terminal devices can receive web pages accessed by users within browser applications. Web pages are generally written in Hypertext Markup Language (HTML). Web pages can include text, images, animations, videos, and other content. Generally, web pages contain a lot of content, and the screen size of a terminal device is limited, so the device cannot display all the content of a single web page at once.
[0061] Figure 1A shows a schematic diagram of a webpage.
[0062] As shown in Figure 1A, this webpage includes multiple pieces of information, such as information 101, information 102, information 103, and information 104. Information 101 could be a picture posted by user "Herry". Information 102 could be a video posted by user "Lucy". Information 103 could be a picture posted by user "Lisa". Information 104 could be a picture posted by user "Mike". The video content in information 102 can change over time; the video content in information 102 is different at different times.
[0063] Figures 1B-1G show schematic diagrams of a terminal device 100 displaying a portion of the content of the long webpage shown in Figure 1A.
[0064] For example, Figure 1B shows a main interface 11 on a terminal device 100 for displaying applications installed on the terminal device 100. The main interface 11 may include: a status bar 106, a calendar indicator, a weather indicator, a tray 105 with icons of commonly used applications, and other application icons 107. Wherein:
[0065] The tray 105, displaying icons for commonly used applications, can show: a phone icon, a contact icon, a text message icon, and a camera icon. Other application icons 107 can show: a browser app icon, a photo album icon, a music icon, an email icon, a notes icon, a settings icon, etc. The main interface 11 may also include a page indicator 112. These other application icons can be distributed across multiple pages, and the page indicator 112 can be used to indicate which page the user is currently viewing. Users can swipe left or right on the areas containing other application icons to view application icons on other pages.
[0066] As shown in Figures 1B and 1C, the terminal device 100 can receive user input operations on the browser app icon, such as a click operation. In response to the input operation, the terminal device 100 can display the browser homepage 12 shown in Figure 1C. As shown in Figure 1C, the browser homepage 12 may include a search bar 108, a refresh button 109, a function bar 110, icons of frequently used websites, and multiple information links. The function bar 110 includes at least one function button, such as a forward button, a back button, a menu button, and a more button.
[0067] As shown in Figure 1D, the terminal device 100 can receive the URL "https: / / www.xinwen.huawei.com / " entered by the user in the search bar 108, and the terminal device 100 displays the access control 111. The above URL can be the URL of xx news.
[0068] As shown in Figures 1D and 1E, terminal device 100 can receive user input operations on access control 111, such as a click operation. In response to the user's input operation, terminal device 100 parses the above-mentioned URL, obtains the IP address corresponding to the domain name "www.xinwen.huawei" in the above-mentioned URL, and requests the server corresponding to the IP address to obtain the web page resources of the web page in xx news indicated by the above-mentioned URL. Based on the web page resources returned by the server, terminal device 100 displays the first part of the web page content shown in Figure 1E. The second part of the web page content is not displayed. The web page may include the web page in xx news.
[0069] As shown in Figure 1E, the first part of the webpage includes information 101 and information 102 as shown in Figure 1A.
[0070] The webpage shown in Figure 1E can be displayed by terminal device 100 at time t1.
[0071] In some embodiments, the terminal device 100 may receive an upward swipe operation by a user on the webpage shown in FIG1E to display the second part of the webpage content.
[0072] Figures 1F and 1G illustrate different web pages displayed by terminal device 100 at different times. The web page shown in Figure 1F could be the first part of a second web page displayed by terminal device 100 at time t2. The web page shown in Figure 1G could be the first part of a third web page displayed by terminal device 100 at time t3.
[0073] Time t2 is later than time t1. The webpage shown in Figure 1F is similar to the webpage shown in Figure 1E. The difference is that the video content of information 102 in the webpage shown in Figure 1F is different from the video content of information 102 in the webpage shown in Figure 1E.
[0074] Time t3 is later than time t2. The webpage shown in Figure 1G is similar to the webpage shown in Figure 1F, except that the video content of information 102 in the webpage shown in Figure 1G is different from the video content of information 102 in the webpage shown in Figure 1F.
[0075] Figure 1H shows a schematic diagram illustrating a specific implementation of a terminal device 100 refreshing a webpage in a first application.
[0076] As shown in Figure 1H, the rendering module of the rendering process in the first application and the main process of the first application can work together to obtain the webpage to be displayed.
[0077] It is understandable that when the rendering module of the rendering process is processing webpage 1, the rendering module of the rendering process can call the CPU to draw webpage 1. After the CPU draws webpage 1, the main process of the first application can call the GPU to render and composite the webpage 1 drawn by the CPU. After the GPU finishes rendering and compositing the webpage 1 drawn by the CPU, the main process of the first application sends webpage 1 to the display screen of the terminal device 100 for display.
[0078] Optionally, the rendering module of the rendering process can call the CPU to draw webpage 1, which means that the rendering module of the rendering process obtains the drawing instructions used to compose webpage 1.
[0079] Optionally, the main process of the first application can call the GPU to render and composite the webpage 1 drawn by the CPU. This means that the main process of the first application can call the GPU to render and composite the drawing instructions used to composite webpage 1, thereby obtaining webpage 1. The explanation of drawing, rendering, and compositing is similar to that here, and will not be repeated here.
[0080] As shown in Figure 1H, when the rendering module of the rendering process is about to process webpage 1, the terminal device 100 can send a Vsync signal 1. The rendering module of the rendering process needs to call the CPU, and the main process of the first application needs to call the GPU to complete the drawing, rendering, and compositing of webpage 1 within a fixed period (e.g., 11.1ms). After the terminal device 100 sends the Vsync signal 1, the rendering module of the rendering process starts to call the CPU to draw webpage 1. After the CPU draws webpage 1, the main process of the first application calls the GPU to render and composite the webpage 1 drawn by the CPU. When webpage 1 completes the drawing, rendering, and compositing within the fixed period, the main process of the first application can send webpage 1 to the display screen of the terminal device 100 for display.
[0081] When the rendering module of the rendering process is about to process webpage 2, the terminal device 100 can send a Vsync signal 2. The rendering module needs to call the CPU, and the main process of the first application needs to call the GPU to complete the drawing, rendering, and compositing of webpage 2 within a fixed period (e.g., 11.1ms). After the terminal device 100 sends the Vsync signal 2, the rendering module of the rendering process begins to call the CPU to draw webpage 2. After the CPU draws webpage 2, the main process of the first application calls the GPU to render and composite the CPU-drawn webpage 2. When webpage 2 completes its drawing, rendering, and compositing within the fixed period, the main process of the first application can send webpage 2 to the display screen of the terminal device 100 for display.
[0082] When the rendering module of the rendering process is about to process webpage 3, the terminal device 100 can send a Vsync signal 3. The rendering module then needs to call the CPU, and the main process of the first application needs to call the GPU to complete the drawing, rendering, and compositing of webpage 3 within a fixed period (e.g., 11.1ms). After the terminal device 100 sends the Vsync signal 3, the rendering module begins to call the CPU to draw webpage 3. After the CPU draws webpage 3, the main process calls the GPU to render and composite the CPU-drawn webpage 3. When webpage 3 completes its drawing, rendering, and compositing within the fixed period, the main process of the first application can send webpage 3 to the display screen of the terminal device 100 for display.
[0083] When the rendering module of the rendering process is about to process webpage 4, the terminal device 100 can send a Vsync signal 4. The rendering module then needs to call the CPU, and the main process of the first application needs to call the GPU to complete the drawing, rendering, and compositing of webpage 4 within a fixed period (e.g., 11.1ms). After the terminal device 100 sends the Vsync signal 4, the rendering module of the rendering process begins to call the CPU to draw webpage 4. After the CPU draws webpage 4, the main process of the first application calls the GPU to render and composite the CPU-drawn webpage 4. When webpage 4 completes its drawing, rendering, and compositing within the fixed period, the main process of the first application can send webpage 4 to the display screen of the terminal device 100 for display.
[0084] Similarly, after the terminal device 100 sends the Vsync signal 5, the main process can send the webpage 5 to the display screen of the terminal device 100 for display, and the rendering module and the main process of the rendering process can refresh the webpage in the first application as shown in Figure 1H.
[0085] In some embodiments, when the terminal device 100 displays the first part of the content of the first webpage in the first application, the terminal device 100 can receive user operations and obtain the webpage resources of the first webpage displayed by the terminal device 100 to obtain a long screenshot of the first webpage.
[0086] Optionally, the terminal device 100 may obtain a long screenshot of the first webpage displayed by the terminal device 100 in any of the following ways.
[0087] Method 1: The terminal device can receive an instruction to enable the scrolling screenshot function. During the scrolling screenshot process, the terminal device can scroll through the first webpage displayed on terminal device 100 and take multiple screenshots to obtain multiple images. Among these, adjacent screenshots may contain overlapping areas. The terminal device needs to crop out the overlapping areas from one of the adjacent screenshots and then stitch the images together to obtain a long screenshot of the first webpage displayed on terminal device 100.
[0088] However, with the scrolling screenshot method, the terminal device needs to scroll through the first webpage, resulting in a poor user experience.
[0089] Method 2: Terminal device 100 can obtain the web page resources of the first web page displayed on terminal device 100, and through the main process of the browser application, render and synthesize the web page resources of the first web page to obtain a long screenshot of the first web page displayed on terminal device 100.
[0090] However, the main process of the browser application, based on the web page resources of the first webpage, performs rendering and compositing steps to obtain a long screenshot of the first webpage, which is a time-consuming operation. When the first webpage displayed on the terminal device 100 contains animated images or videos, the terminal device 100 needs to refresh the webpage periodically. Before the long screenshot of the first webpage is composed, the main process of the browser application cannot obtain the webpage to be refreshed, and the terminal device 100 cannot refresh the webpage, resulting in lag.
[0091] For example, Figures 2A-2D illustrate a schematic diagram of a group of terminal devices 100 acquiring a long screenshot of a first webpage displayed by the terminal device 100.
[0092] For example, as shown in Figure 2A, at time t1, the terminal device 100 can receive a user operation to enable the long screenshot function. For example, the user operation could be a user double-tapping the screen with their knuckle.
[0093] In response to user operation, terminal device 100 can obtain the web page resources of the first web page displayed by terminal device 100 to obtain a long screenshot of the first web page displayed by terminal device 100.
[0094] Terminal device 100 cannot refresh the page until it obtains a long screenshot of the first webpage displayed on terminal device 100. For example, at time t2, which is later than time t1, part of the content of the webpage displayed by terminal device 100 is the same as the content of the webpage displayed by terminal device 100 at time t1.
[0095] At time t3, after obtaining a long screenshot of the webpage displayed on terminal device 100, terminal device 100 can display a prompt box 2001 as shown in Figure 2C. Prompt box 2001 includes a long screenshot 2002, options 2003 and 2004. The user can save the long screenshot 2002 to the gallery application using option 2003. The user can also choose not to save the long screenshot 2002 using option 2004.
[0096] Optionally, instead of saving the long screenshot 2002 in the gallery application, the terminal device 100 may also prompt the user whether to save the long screenshot 2002 in a folder used for storing screenshots. This embodiment of the application uses the example of the terminal device 100 prompting the user whether to save the long screenshot 2002 in the gallery application for illustration.
[0097] Optionally, the content of the webpage displayed by terminal device 100 at time t3 is the same as the content of the webpage displayed by terminal device 100 at time t2.
[0098] Subsequently, if the terminal device 100 obtains the refreshed webpage at time t4, the terminal device 100 can display the webpage shown in Figure 2D. Time T4 is later than time t3. The webpage shown in Figure 2D is similar to the webpages shown in Figures 2A, 2B, and 2C, except that the video content of information 102 in the webpage shown in Figure 2D is different from the video content of information 102 in the webpages shown in Figures 2A, 2B, and 2C.
[0099] As can be seen from Figures 2A-2D, the content of the webpage displayed by terminal device 100 at times t1, t2, and t3 is the same. At time t4, terminal device 100 starts refreshing the webpage, and the terminal device 100 experiences a lag of (t3-t1) time.
[0100] Figure 2E shows a schematic diagram illustrating the specific implementation of another terminal device 100 refreshing a webpage.
[0101] The specific implementation shown in Figure 2E is similar to that shown in Figure 1H, except that during the display of the second webpage on the terminal device 100, the terminal device 100 receives an operation to enable the long screenshot function. In response to this operation, the rendering module of the rendering process can call the CPU to draw the first long screenshot. After the CPU draws the first long screenshot, the main process of the first application calls the GPU to render and composite the first long screenshot drawn by the CPU.
[0102] Optionally, the rendering process's drawing module calls the CPU to draw the first long screenshot, which can refer to the rendering process's drawing module calling the CPU to obtain the drawing instructions used to synthesize the first long screenshot.
[0103] Optionally, the main process of the first application calls the GPU to render and composite the first long screenshot drawn by the CPU. This can refer to the main process of the first application calling the GPU to render and composite the drawing instructions used to composite the first long screenshot, thus obtaining the first long screenshot. The explanation of drawing, rendering, and compositing is similar to that here, and will not be repeated here.
[0104] Terminal device 100 can emit Vsync signal 3. The rendering module of the rendering process needs to call the CPU, and the main process of the first application needs to call the GPU to complete the drawing, rendering, and compositing of webpage 3 within a fixed period (e.g., 11.1ms). After terminal device 100 emits Vsync signal 3, the rendering module of the rendering process needs to wait for the first long screenshot to finish drawing before calling the CPU to draw webpage 3. After the CPU draws webpage 3, the main process of the first application also needs to wait for the first long screenshot to finish rendering and compositing before calling the GPU to render and composit the CPU-drawn webpage 3. If webpage 3 is not rendered and composed within the fixed period (e.g., the second refresh cycle), the main process of the first application can continue to display webpage 2 within the third refresh cycle. In other words, if terminal device 100 displays webpage 2 within two consecutive refresh cycles, a stuttering situation will occur.
[0105] Figure 3 shows a schematic diagram of a communication system 10 provided in this application.
[0106] Figure 3 illustrates an exemplary system architecture diagram of a communication system 10 provided in an embodiment of this application. As shown in Figure 3, the communication system 10 includes at least one terminal device, such as terminal device 100, and at least one server, such as server 200.
[0107] Terminal device 100 can communicate with server 200 through communication network 300. Communication network 300 can be a local area network (LAN) or a wide area network (WAN), such as the Internet. This communication network 300 can be implemented using any known network communication protocol, including various wired or wireless communication protocols such as Ethernet, Universal Serial Bus (USB), FireWire, Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-CDMA), Long Term Evolution (LTE), Bluetooth, Wireless Fidelity (Wi-Fi), NFC, Voice over Internet Protocol (VoIP), communication protocols supporting network slicing architecture, or any other suitable communication protocol.
[0108] Terminal device 100 is equipped with a display screen and has a browser application (APP) installed. Users can browse web pages (e.g., the first web page) on the display screen using the aforementioned browser APP to obtain the required information resources. The server 200 corresponding to the first web page can be a single server, a server cluster consisting of multiple servers, or a cloud computing center. Server 200 can provide the terminal device 100 with the web page resources of the first web page accessed by the user.
[0109] The terminal device 100 and the server can be deployed on land, including indoors, outdoors, handheld or vehicle-mounted, or on water, or on airplanes and artificial satellites in the air. This application embodiment does not limit them in any way.
[0110] It should be understood that Figure 3 is merely a schematic diagram of the system structure of the communication system provided in the embodiment of this application, and does not constitute a specific limitation on the communication system 10. The communication system 10 may include more or fewer devices than shown in the figure. For example, it may also include wireless relay devices and wireless backhaul devices (not shown in Figure 3), etc. This application does not limit it here.
[0111] Figure 4 shows a schematic diagram of the hardware structure of a terminal device 100.
[0112] Terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include one or more sensors, such as a gyroscope sensor 180B, a magnetic sensor 180D, an accelerometer sensor 180E, a proximity sensor 180F, a touch sensor 180K, etc. In some embodiments, the sensor module 180 may further include one or more of the following sensors: pressure sensor, air pressure sensor, proximity light sensor, fingerprint sensor, temperature sensor, ambient light sensor, bone conduction sensor, etc.
[0113] Processor 110 may include one or more processing units, such as application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors.
[0114] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0115] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system. In some embodiments, the processor 110 may include one or more interfaces, such as a universal serial bus (USB) interface.
[0116] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, or USB Type-C port. USB port 130 can be used to connect a charger to charge terminal device 100, and can also be used for data transfer between terminal device 100 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.
[0117] The charging management module 140 is used to receive charging input from the charger. The charger can be a wireless charger or a wired charger.
[0118] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, internal memory 121, display 194, and wireless communication module 160, etc.
[0119] The wireless communication function of the terminal device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor.
[0120] Antennas 1 and 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.
[0121] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the terminal device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0122] Wireless communication module 160 can provide applications on terminal device 100 including wireless local area networks (WLAN) (such as wireless fidelity). Network), Bluetooth Solutions for wireless communication include BT (Browser-Based Telecommunications), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), and Infrared (IR). The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, demodulates and filters the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, frequency-modulate and amplify them, and then convert them into electromagnetic waves for radiation via antenna 2.
[0123] In some embodiments, the antenna 1 of the terminal device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the terminal device 100 can communicate with the network and other devices through wireless communication technology.
[0124] Terminal device 100 implements display functions through a GPU, display screen 194, and application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0125] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel.
[0126] Internal memory 121 may include one or more random access memory (RAM) and one or more non-volatile memory (NVM).
[0127] The random access memory can be directly read and written by the processor 110. It can be used to store executable programs (such as machine instructions) of the operating system or other running programs, as well as user and application data.
[0128] Non-volatile memory can also store executable programs and user and application data, and can be pre-loaded into random access memory for direct reading and writing by the processor 110.
[0129] The external memory interface 120 can be used to connect to external non-volatile memory, thereby expanding the storage capacity of the terminal device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to perform data storage functions. For example, music, video, and other files can be stored in the external non-volatile memory.
[0130] Terminal device 100 can implement audio functions, such as making calls and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, and application processor.
[0131] Audio module 170 is used to convert digital audio information into analog audio signal output, and also to convert analog audio input into digital audio signal. Audio module 170 can also be used for encoding and decoding audio signals.
[0132] The speaker 170A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. The terminal device 100 can listen to music or make hands-free calls through the speaker 170A.
[0133] The receiver 170B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the terminal device 100 answers a phone call or voice message, the receiver 170B can be brought close to the listener's ear to hear the voice.
[0134] Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 170C, inputting the sound signal into microphone 170C. Terminal device 100 may be equipped with at least one microphone 170C.
[0135] The 170D headphone jack is used to connect wired headphones.
[0136] The pressure sensor 180A is used to sense pressure signals and can convert pressure signals into electrical signals.
[0137] The gyroscope sensor 180B can be used to determine the motion attitude of the terminal device 100. In some embodiments, the angular velocity of the terminal device 100 about three axes (i.e., the x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for image stabilization.
[0138] The 180C barometric pressure sensor is used to measure barometric pressure.
[0139] The magnetic sensor 180D includes a Hall sensor. The terminal device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip cover.
[0140] The 180E accelerometer can detect the magnitude of acceleration in various directions (typically three axes) of the terminal device 100. When the terminal device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic devices and applied to applications such as screen orientation switching and pedometers.
[0141] A distance sensor 180F is used to measure distance. The terminal device 100 can measure distance via infrared or laser. In some embodiments, during a shooting scene, the terminal device 100 can utilize the distance sensor 180F to measure distance for rapid focusing.
[0142] The proximity light sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode.
[0143] The fingerprint sensor 180H is used to collect fingerprints.
[0144] Temperature sensor 180J is used to detect temperature. In some embodiments, terminal device 100 uses the temperature detected by temperature sensor 180J to execute a temperature processing strategy.
[0145] The touch sensor 180K, also known as a "touch device," can be placed on the display screen 194. The touch sensor 180K and the display screen 194 together form a touch screen, also known as a "touchscreen." The touch sensor 180K is used to detect touch operations applied to or near it.
[0146] An ambient light sensor 180L is used to sense the ambient light intensity. The terminal device 100 can adaptively adjust the brightness of the display screen 194 according to the sensed ambient light intensity.
[0147] The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire vibration signals from the vibrating bone segments of the human vocal cords.
[0148] In some embodiments, the terminal device 100 may further include one or more of buttons, a motor, and an indicator. Buttons may include a power button, volume buttons, etc. Buttons may be mechanical buttons or touch buttons. The terminal device 100 can receive button input and generate key signal inputs related to user settings and function control of the terminal device 100. The motor may generate vibration cues. The indicator may be an indicator light, used to indicate charging status, battery level changes, and may also indicate messages, missed calls, notifications, etc.
[0149] The SIM card interface 195 is used to connect the SIM card.
[0150] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the terminal device 100. In other embodiments of this application, the terminal device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0151] Figure 5 is a hardware structure diagram of the server 200 provided in an embodiment of this application.
[0152] As shown in Figure 5, server 200 may include: one or more processors 301, memory 302, communication interface 303, transmitter 305, receiver 306, coupler 307, and antenna 308. These components can be connected via bus 204 or other means; Figure 3 illustrates a bus connection as an example.
[0153] The communication interface 303 can be used by the server 200 to communicate with other communication devices, such as the terminal device 100. Specifically, the communication interface 303 can be a 3G communication interface, a Long Term Evolution (LTE) (4G) communication interface, a 5G communication interface, a WLAN communication interface, a WAN communication interface, etc. Not limited to wireless communication interfaces, the server 200 can also be configured with a wired communication interface 303 to support wired communication; for example, the backhaul link between the server 200 and other servers can be a wired communication connection.
[0154] In some embodiments, server 200 can receive a URL sent by terminal device 100 through communication interface 303.
[0155] In some embodiments, the server 200 may also send web page resources corresponding to a URL to the terminal device 100 through the communication interface 303.
[0156] In some embodiments of this application, transmitter 305 and receiver 306 can be considered as a wireless modem. Transmitter 305 can be used to transmit signals output by processor 301. Receiver 306 can be used to receive signals. In server 200, the number of transmitters 305 and receivers 306 can be one or more. Antenna 308 can be used to convert electromagnetic energy in a transmission line into electromagnetic waves in free space, or to convert electromagnetic waves in free space into electromagnetic energy in a transmission line. Coupler 307 can be used to split mobile communication signals into multiple paths and distribute them to multiple receivers 306. Understandably, antenna 308 of server 200 can be implemented as a large-scale antenna array.
[0157] The memory 302 is coupled to the processor 301 and is used to store various software programs and / or multiple sets of instructions. Specifically, the memory 302 may include high-speed random access memory and may also include non-volatile memory, such as one or more disk storage devices, flash memory devices, or other non-volatile solid-state storage devices.
[0158] The memory 302 can store an operating system (hereinafter referred to as the system), such as uCOS, VxWorks, RTLinux and other embedded operating systems.
[0159] In this embodiment of the application, the processor 301 can be used to read and execute computer-readable instructions.
[0160] It is understood that the structure illustrated in the embodiments of this application does not constitute a specific limitation on server 200. In other embodiments of this application, server 200 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0161] Please refer to Figure 6, which exemplarily shows a software structure block diagram of the terminal device 100.
[0162] The electronic device provided in this application embodiment can run an operating system (OS). This operating system can be various operating systems used in the industry, such as an operating system based on OpenHarmony, like HarmonyOS; or other operating systems such as Android. TM An operating system can refer to the iOS mobile operating system; it can also refer to various open-source operating systems or their derivatives, such as Linux OS and other embedded operating systems; or it can refer to future new operating systems, such as AI operating systems based on artificial intelligence. An operating system is a set of interconnected system software programs that manage and control the operation of electronic devices, utilize and run hardware and software resources, and provide public services to organize user interactions. In electronic devices, the operating system connects downwards to the physical devices at the hardware layer and upwards to provide a runtime environment for application software.
[0163] An operating system typically includes a kernel layer, a middleware layer, and an application layer. The application layer includes applications, which can include system applications and third-party applications. The middleware layer includes a suite of software providing various services to application developers, or frameworks providing services such as databases, multimedia, and graphics, or capabilities such as distributed scheduling and system scaling. For example, the middleware layer may include a framework layer and / or a system service layer. The framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. The system service layer includes the system's core capabilities, providing services to applications through the framework layer. The kernel layer is the layer between hardware and software. The kernel layer may include hardware drivers and the operating system kernel. In addition to providing hardware drivers, the kernel layer also supports functions such as memory management and system process management.
[0164] The electronic devices we use in our daily lives come in various types and forms, and are applied in a wide range of scenarios. Therefore, based on the different forms and functions of electronic devices, different application scenarios, and different user needs, the operating systems used in these devices may also differ. The basic functions implemented by the electronic device provided in this application can be implemented using a general-purpose operating system or a dedicated operating system. To more clearly illustrate the implementation of the embodiments of this application under a specific operating system, the architecture of HarmonyOS is shown below. Those skilled in the art can deduce the implementation of the embodiments of this application under other specific operating systems, such as Android™.
[0165] As shown in Figure 6, the software architecture of an electronic device can be divided into several layers. In some embodiments, from bottom to top, these layers are: kernel layer, system service layer, framework layer, and application layer. Layers communicate with each other through software interfaces. System functions can be tailored, added, or combined at the subsystem level in different device deployment scenarios, and each subsystem can also be tailored, added, or combined at the functional level.
[0166] The Kernel Abstraction Layer (KAL) provides basic kernel capabilities to upper layers by shielding the differences between multiple kernels, including but not limited to process / thread management, memory management, file system, network management, and peripheral device management.
[0167] Kernel Subsystem: Supports the selection of a suitable OS kernel for different resource-constrained devices, including but not limited to Linux kernel, HarmonyOS kernel, LiteOS (Lite Operating System), etc.
[0168] Driver Subsystem: The driver framework is the foundation for the open system hardware ecosystem, providing unified peripheral access capabilities and a framework for driver development and management. The driver framework includes: display drivers, camera drivers, audio drivers, Bluetooth drivers, sensor drivers, etc.
[0169] The system service layer comprises the core capabilities of the system, providing services to applications through the framework layer. This layer includes, but is not limited to, the following subsystems:
[0170] The system's basic capability subsystem set provides fundamental capabilities for the operation, scheduling, and migration of distributed applications across multiple devices. This set may include distributed soft bus, distributed data management, distributed task scheduling, and Ark multi-language runtime; it may also include multi-modal input subsystem, graphics subsystem, security subsystem, and AI business subsystem.
[0171] Basic software service subsystem set: provides public and general software services; the basic software service subsystem set may include event notification subsystem, telephone service subsystem, multimedia subsystem, etc.
[0172] Enhanced software service subsystem suite: Provides differentiated enhanced software services for different devices; the enhanced software service subsystem suite may include smart screen proprietary business subsystem, wearable proprietary business subsystem, IoT proprietary business subsystem, etc.
[0173] Hardware service subsystem set: Provides hardware services; the hardware service subsystem set may include location service subsystem, user IAM (Identity and Access Management) subsystem, wearable proprietary hardware service subsystem, biometric identification, IoT proprietary hardware service subsystem, etc.
[0174] Distributed task scheduling enables distributed service management (discovery, synchronization, registration, and invocation), supporting remote startup, remote invocation, remote connection, and migration of applications across devices.
[0175] Distributed data management enables data synchronization, data storage, data sharing, and data access across all scenarios and devices.
[0176] The distributed soft bus provides communication-related capabilities for seamless interconnection between multiple devices, including: WLAN service capabilities, Bluetooth service capabilities, soft bus, inter-process communication (IPC), and StarFlash communication capabilities.
[0177] Ark Multilingual Runtime is a unified compilation runtime platform designed to support the joint compilation and execution of multiple programming languages and multiple chip platforms.
[0178] The framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. The framework layer includes: the ArkUI framework (which provides a complete infrastructure for UI development of system applications, including UI functions such as components, layouts, animations, and interactive events, as well as a real-time interface preview tool), the user application framework, and the Ability framework (an Ability is a lightweight application; the Ability framework schedules and manages the operation and lifecycle of Abilities). Different devices may have different operating systems, and the APIs they support may also differ.
[0179] The HarmonyOS API is a series of open capabilities provided to support HarmonyOS application development. The HarmonyOS API can be set at the framework layer or independently of the framework layer. The HarmonyOS API includes the Audio API (audio service), Push API (push service), and Account API (account service), among others.
[0180] Applications can include system apps and extended / third-party apps. System apps can include the desktop, control bar, settings, contacts, phone, etc., while extended / third-party apps can include browser apps, etc.
[0181] Figures 7A-7D illustrate a schematic diagram of another set of terminal devices 100 acquiring a long screenshot of the webpage displayed on the terminal device 100.
[0182] For example, as shown in Figure 7A, at time t1, terminal device 100 displays the first part of the content of the first webpage in the browser application. The second part of the content of the first webpage is not displayed. Terminal device 100 can receive user operations to enable the long screenshot function. For example, the user operation could be a user double-tapping the screen with their knuckle, or a user clicking the virtual screenshot button, or a user pressing the power button and the volume up button.
[0183] In response to user operation, terminal device 100 can obtain a long screenshot of the first webpage displayed by terminal device 100 based on the webpage resources of the first webpage displayed by terminal device 100.
[0184] In this embodiment, the terminal device 100 draws, renders, and composites the first long screenshot through the rendering process of the browser application. The main process of the browser application does not need to perform the steps of rendering and compositing the first long screenshot. During the period when the terminal device 100 acquires the first long screenshot, the main process of the browser application is in an idle state. Therefore, before the terminal device 100 acquires the long screenshot of the first webpage, the main process of the browser application can render and composite the webpage to be refreshed, and the terminal device 100 can refresh the webpage.
[0185] For example, at time t2, which is later than time t1, terminal device 100 displays the first part of the content of the second webpage shown in Figure 7B. The second part of the content of the second webpage is not displayed. The first part of the content of the second webpage is different from the first part of the content of the first webpage. For example, the video content of information 102 in the first part of the second webpage is different from the video content of information 102 in the first part of the first webpage. For example, the video content of information 102 shown in Figure 7A includes the video content of the first minute, while the video content of information 102 shown in Figure 7B includes the video content of the first minute and the first second.
[0186] For example, at time t3, which is later than time t2, terminal device 100 displays the first part of the content of the third webpage shown in Figure 7C. The second part of the content of the third webpage is not displayed. The first part of the content of the third webpage is different from the first part of the content of the second webpage. For example, the video content of information 102 in the first part of the third webpage is different from the video content of information 102 in the first part of the second webpage. For instance, the video content of information 102 shown in Figure 7C includes the video content at the 1st minute and 2nd second, while the video content of information 102 shown in Figure 7B includes the video content at the 1st minute and 1st second.
[0187] In some embodiments, at time t3, after the terminal device 100 obtains a long screenshot of the first webpage, such as long screenshot 2002, the terminal device 100 may display a prompt box 2001 as shown in FIG7C. For a description of the prompt box 2001, please refer to the description in the embodiment of FIG2C.
[0188] Optionally, the prompt box 2001 shown in Figure 7C can be displayed by a browser application or by the operating system of the terminal device 100.
[0189] Terminal device 100 can receive user input for option 2003, such as a click operation. In response to the user's input, terminal device 100 can save a long screenshot 2002 to the gallery application.
[0190] Subsequently, at time t4, which is later than time t3, terminal device 100 displays the first part of the content of the fourth webpage shown in Figure 7D. The second part of the content of the fourth webpage is not displayed. The first part of the content of the fourth webpage is different from the first part of the content of the third webpage. For example, the video content of information 102 in the first part of the fourth webpage is different from the video content of information 102 in the first part of the third webpage. For example, the video content of information 102 shown in Figure 7D includes the video content at the 1st minute and 3rd second, while the video content of information 102 shown in Figure 7C includes the video content at the 1st minute and 2nd second.
[0191] As can be seen from Figures 7A-7D, during the period when the terminal device 100 is acquiring a long screenshot of the first webpage displayed on the terminal device 100, the terminal device 100 can refresh the webpage without experiencing any lag due to the inability to refresh the webpage.
[0192] Figure 8 shows a flowchart of a method for a terminal device 100 to obtain a first webpage and display the first part of the content of the first webpage.
[0193] S801, Terminal device 100 receives the second operation.
[0194] S802. In response to the second operation, access the first URL indicated by the second operation.
[0195] Optionally, when the first application is launched, the terminal device 100 may create a main process for the first application. The main process of the first application is responsible for the interface display, human-computer interaction, and the creation and destruction of other processes within the first application. For example, when a user opens a webpage corresponding to a new URL, the main process of the first application may create a new rendering process, which manages the webpage corresponding to that new URL. When the user closes the webpage corresponding to that new URL, the main process of the first application may destroy that new rendering process.
[0196] In some embodiments, the main process of the first application may be a software compositor host. In some embodiments, the rendering process of the first application may be a render process.
[0197] In some embodiments, the terminal device 100 may receive a second operation from a user on a first application, and in response to the second operation, the terminal device 100 may access a first webpage corresponding to a first URL.
[0198] In some embodiments, the second operation may include one or more of the following: entering a first URL in the URL search bar, entering a first keyword in the keyword search bar, clicking a text link, or clicking an image link, wherein the second operation indicates the first URL.
[0199] For example, the second operation could be entering the URL "https: / / www.xinwen.huawei.com / " in the search bar 108 as shown in Figure 1D, and an input operation for the access control 111.
[0200] S803, The main process of the first application creates the rendering process of the first application, which includes a drawing module and a compositing module.
[0201] Upon receiving the second operation, the main process of the first application can create a rendering process for the first application. This rendering process includes a drawing module and a compositing module. The drawing module of the rendering process obtains drawing instructions for compositing the webpage based on the webpage resources and sends these instructions to the main process of the first application for rendering and compositing. Alternatively, the drawing module of the rendering process obtains drawing instructions for compositing a long screenshot of the webpage based on the webpage resources and sends these instructions to the compositing module of the rendering process for rendering and compositing.
[0202] The compositing module of the rendering process is used to render and composite the drawing instructions obtained from the drawing module of the rendering process to obtain a long screenshot of the webpage.
[0203] In some embodiments, the rendering module of the rendering process can be a software compositor renderer. The compositing module of the rendering process can be a layer compositor.
[0204] S804, The main process of the first application obtains the first webpage resource based on the first URL.
[0205] The main process of the first application can obtain the first webpage resource corresponding to the first URL based on the first URL entered by the user.
[0206] For example, terminal device 100 can resolve the first URL and obtain the Internet Protocol (IP) address of the server 200 corresponding to the first URL.
[0207] In this embodiment of the application, the first URL can be a URL link.
[0208] It should be noted that a URL link typically consists of some or all of the following: protocol, domain, path, filename, and parameters.
[0209] The `protocol` directive indicates the method of resource retrieval. Different protocols correspond to different communication content formats, such as HTTP, HTTPS, File, Telnet, FTP, and News. The `domain name` directive indicates server 200; the server 200's IP address can also be used as its domain name. A port number can be appended to the domain name; if the URL does not include a port number, the default port number corresponding to the protocol in the URL is used. The `resource path` directive indicates the hierarchical path of the target resource (e.g., the first webpage) on server 200. If the URL does not include a resource path, server 200 defaults to the root directory. The `filename` directive indicates the filename of the target resource. If the URL does not include a filename, server 200 uses the default file from the last directory in the resource path as the target resource file. The `parameters` directive indicates all parameters required to access the target resource.
[0210] For example, the URL link is https: / / www.abc.edu / master file / 86886699 / notice / 996682256 / index.html. Here, the protocol is https, the domain is www.abc.edu, the resource path is master file / 86886699 / notice / 996682256, and the file name is index.html.
[0211] When terminal device 100 resolves a URL link, if the domain name in the URL link is not an IP address, it can resolve the domain name into an IP address through DNS (Domain Name System). In one implementation, terminal device 100 uses local Domain Name System (DNS) cached data to resolve the URL link. When terminal device 100 successfully resolves the URL link using local DNS cached data, it can obtain the IP address corresponding to the domain name. When terminal device 100 fails to resolve the URL link, it can request a DNS server to resolve the URL link using cloud-based DNS cached data to obtain the IP address.
[0212] After obtaining the IP address of server 200, the main process of the first application establishes a connection with server 200 based on the IP address of server 200 and requests the web page resources of the first web page indicated by the first URL.
[0213] In some embodiments, the terminal device 100 establishes a communication connection with the server 200 based on the TCP / IP protocol. After establishing the communication connection, the terminal device 100 sends an HTTP request to the server 200, which requests the web page resources of the first web page indicated by the first URL; the server 200 sends an HTTP response to the terminal device 100 based on the above HTTP request, which carries the web page resources of the first web page.
[0214] S805, The main process of the first application sends the first web page resource to the drawing module of the rendering process.
[0215] After acquiring the first webpage resource, the main process of the first application can send the first webpage resource to the rendering module of the rendering process.
[0216] It should be noted that S803-S804 can be executed after S805 or simultaneously with S805, and this application does not limit this.
[0217] S806, The rendering module of the rendering process obtains the rendering instructions for compositing the first webpage based on the first webpage resource.
[0218] After acquiring the first webpage resource, the rendering module of the rendering process can obtain the rendering instructions for compositing the first webpage based on the first webpage resource. The obtained rendering instructions for compositing the first webpage are then used by the main process of the first application to render and composite the webpage to obtain the first webpage to be displayed.
[0219] S807, The rendering module of the rendering process sends the rendering instructions for compositing the first webpage to the main process of the first application.
[0220] S808, The main process of the first application renders and synthesizes the drawing instructions used to synthesize the first webpage, and obtains the first webpage.
[0221] S809, The main process of the first application sends the first webpage to the display screen of the terminal device 100 for display.
[0222] After obtaining the drawing instructions for composing the first webpage, the main process of the first application can render and compose the drawing instructions for composing the first webpage to obtain the first webpage, and send the first webpage to the display screen of the terminal device 100 for display.
[0223] Optionally, the first webpage includes a first part of content and a second part of content; the display screen of the terminal device 100 can display the first part of content of the first webpage, but does not display the second part of content.
[0224] For example, the first part of the content of the first webpage can be the content shown in Figure 7A.
[0225] Using the method shown in Figure 8, the main process and rendering process of the first application can collaborate to obtain the webpage to be displayed based on the webpage resources.
[0226] In some embodiments, while the terminal device 100 is displaying the first webpage, the terminal device 100 may receive an operation from the user to enable the long screenshot function, and the terminal device 100 may obtain a first long screenshot of the first webpage, the first long screenshot including a first part of the content of the first webpage and a second part of the content of the first webpage.
[0227] Figure 9 shows a flowchart of a method for a terminal device 100 to obtain a first long screenshot of a first webpage.
[0228] S901, Terminal device 100 displays the first part of the content of the first webpage.
[0229] For example, the first part of the content of the first webpage can be the content shown in Figure 7A.
[0230] S902, Terminal device 100 receives the first operation, which is used to enable the long screenshot function.
[0231] S903, in response to the first operation, the main process of the first application requests shared memory.
[0232] Optionally, while the terminal device 100 is displaying the first part of the content of the first webpage, the terminal device 100 may receive a first operation from the user to enable the long screenshot function.
[0233] For example, the first operation can be the knuckle double-tap operation shown in Figure 7A. It should be noted that the first operation can also be other operations, and this application does not limit them.
[0234] In response to the first operation, the main process of the first application can request shared memory. Both the main process of the first application and the compositing module of the rendering process can access the data stored in this shared memory.
[0235] After requesting shared memory, the main process of the first application can obtain the address of the shared memory and send the address of the shared memory to the compositing module of the rendering process. The address of the shared memory is used by the compositing module of the rendering process to access the data stored in the shared memory.
[0236] S904, The main process of the first application sends a second message to the compositing module of the rendering process.
[0237] S905, The compositing module of the rendering process sends a third message to the drawing module of the rendering process.
[0238] In response to the first operation, the main process of the first application can send a second message to the compositing module of the rendering process. The second message is used to instruct the compositing module of the rendering process to send a message to the drawing module of the rendering process. The message is used to instruct the drawing module of the rendering process to draw drawing instructions for obtaining a first long screenshot of the first webpage based on the first webpage resource.
[0239] In response to the second message, the compositing module of the rendering process can send a third message to the rendering module of the rendering process. The third message is used to instruct the rendering module of the rendering process to obtain drawing instructions for compositing a first long screenshot of the first webpage based on the first webpage resource.
[0240] In some embodiments, the main process of the first application may also directly send a message to the rendering module of the rendering process, which is used to instruct the rendering module of the rendering process to obtain the drawing instructions for compositing the first long screenshot of the first webpage based on the first webpage resource.
[0241] Optionally, S903 can be executed after S904-S905, or it can be executed simultaneously with S904-S905. This application does not limit this.
[0242] S906, The rendering module of the rendering process obtains the drawing instructions for compositing the first long screenshot based on the first web page resource.
[0243] In response to the third message, the rendering module of the rendering process can obtain the drawing instructions for compositing the first long screenshot based on the first webpage resource. The drawing instructions for compositing the first long screenshot are used by the compositing module of the rendering process to render and composite the first long screenshot of the first webpage.
[0244] S907, The rendering process's drawing module sends the drawing instructions for compositing the first long screenshot to the rendering process's compositing module.
[0245] S908, the compositing module of the rendering process renders and composites the drawing instructions used to compose the first long screenshot, and obtains the first long screenshot.
[0246] The first long screenshot includes the first part of the first webpage and the second part of the first webpage.
[0247] After obtaining the drawing instructions for compositing the first long screenshot, the rendering process's drawing module can send these instructions to the rendering process's compositing module. The rendering process's compositing module can then render and composite the drawing instructions to obtain the first long screenshot, which includes the first part of the content of the first webpage and the second part of the content of the first webpage.
[0248] For example, the first long screenshot can be the long screenshot 2002 shown in Figure 7C.
[0249] S909, the compositing module of the rendering process saves the first long screenshot to shared memory.
[0250] After obtaining the first long screenshot, the compositing module of the rendering process can save the first long screenshot to the shared memory based on the storage address of the shared memory.
[0251] S910, the compositing module of the rendering process sends the first message to the main process of the first application.
[0252] For example, the first message can be used to indicate that the first long screenshot has been saved to shared memory.
[0253] S911, the main process of the first application retrieves the first long screenshot from shared memory.
[0254] After the first long screenshot is saved to the shared memory, the compositing module of the rendering process can send a first message to the main process of the first application, which indicates that the first long screenshot has been saved to the shared memory.
[0255] In response to the first message, the main process of the first application can retrieve the first long screenshot from the shared memory based on the storage address of the shared memory.
[0256] In some embodiments, S910 may not be executed. The main process of the first application may periodically / irregularly access the shared memory to confirm whether the first long screenshot is stored in the shared memory. If the first long screenshot is stored in the shared memory, the first long screenshot is retrieved.
[0257] Optionally, in some embodiments, after obtaining the first long screenshot, the terminal device 100 can directly save the first long screenshot. In other embodiments, after obtaining the first long screenshot, the terminal device 100 can prompt the user whether to save the first long screenshot. For example, the terminal device 100 can display the prompt box 2001 shown in FIG7C.
[0258] Figure 10 shows an interactive schematic diagram of a terminal device 100 obtaining a first long screenshot of a first webpage.
[0259] As shown in Figure 10, the first application receives a first operation to enable the long screenshot function. In response to this first operation, the rendering process can use its drawing module to call the CPU to obtain the drawing instructions for compositing the first long screenshot based on the first webpage resource. Then, the rendering process's compositing module calls the GPU to render and composite the drawing instructions for compositing the first long screenshot, thus obtaining the first long screenshot. After obtaining the first long screenshot, the rendering process's compositing module can save it to shared memory.
[0260] For example, after saving the first long screenshot to shared memory, the compositing module of the rendering process can send a first message to the main process of the first application, indicating that the first long screenshot has been saved to shared memory. In response to the first message, the main process of the first application can retrieve the first long screenshot from shared memory.
[0261] Using the method shown in the embodiments of Figures 9 and 10, in response to the user's operation of enabling the long screenshot function, the terminal device 100 can render and synthesize the first long screenshot through the compositing module of the rendering process, instead of the first long screenshot being rendered and synthesized by the main process of the first application, and thus will not occupy the main process of the first application.
[0262] In some embodiments, the first webpage displayed by the terminal device 100 contains animated images or videos. After the terminal device 100 receives the user's operation to enable the long screenshot function, the terminal device 100 can obtain the first long screenshot of the first webpage. The terminal device 100 can also refresh the animated images or videos on the webpage without any lag.
[0263] Figure 11 shows a schematic diagram of a method for refreshing a webpage on a terminal device 100.
[0264] S1101, The main process of the first application sends the second web page resource to the rendering module of the rendering process.
[0265] When the first webpage contains animated images or videos, the terminal device 100 needs to periodically refresh the webpage to update the animated image or video content. Before refreshing the webpage, the main process of the first application can obtain the resources of the second webpage. The second webpage resources are used to obtain the refreshed webpage (e.g., the second webpage). The main process of the first application can send the second webpage resources to the rendering module of the rendering process.
[0266] Optionally, the second web page resource can be obtained in real time from the server 200 by the main process of the first application, or it can be obtained in advance and stored in the terminal device 100.
[0267] S1102. The rendering process confirms whether the drawing module is in an idle state.
[0268] After receiving the second web page resource sent by the main process of the first application, the rendering process needs to confirm whether the drawing module is in an idle state.
[0269] In some embodiments, as shown in Figure 9, after the terminal device 100 receives the user's operation to enable the long screenshot function, the terminal device 100 can obtain drawing instructions for synthesizing the first long screenshot based on the first webpage resource through the rendering module of the rendering process. After receiving the second webpage resource sent by the main process of the first application, the rendering module of the rendering process may be in a busy state while obtaining the drawing instructions for synthesizing the first long screenshot. Therefore, after receiving the second webpage resource sent by the main process of the first application, the rendering process needs to confirm whether the drawing module is idle.
[0270] When it is confirmed that the drawing module is in an idle state, the rendering process can obtain the drawing instructions for composing the second webpage based on the second webpage resources, i.e., execute S1103.
[0271] When it is confirmed that the drawing module is busy, the rendering process needs to wait until the drawing instruction for compositing the first long screenshot is obtained, that is, until the drawing module of the rendering process is idle, and then the drawing instruction for compositing the second webpage is obtained based on the second webpage resource by the drawing module of the rendering process, that is, continue to execute S1102.
[0272] S1103. The rendering module of the rendering process obtains the rendering instructions for compositing the second webpage based on the second webpage resource.
[0273] S1104. The rendering module of the rendering process will receive the rendering instructions used to synthesize the second webpage and send them to the main process of the first application.
[0274] S1105. The main process of the first application renders and synthesizes the drawing instructions used to synthesize the second webpage, thus obtaining the second webpage.
[0275] S1106. The main process of the first application sends the second webpage to the display screen of the terminal device 100 for display.
[0276] After obtaining the drawing instructions for compositing the second webpage, the rendering module of the rendering process can send the drawing instructions for compositing the second webpage to the main process of the first application. The main process of the first application can render and composite the drawing instructions for compositing the second webpage to obtain the second webpage, and then send the second webpage to the display screen of the terminal device 100 for display.
[0277] Optionally, the second webpage includes a first part of content and a second part of content, and the display screen of the terminal device 100 can display the first part of content of the second webpage.
[0278] For example, the first part of the content of the second webpage may be the content shown in Figure 7B, Figure 7C, or Figure 7D.
[0279] Using the method shown in Figure 11, after the terminal device 100 receives the user's operation to enable the long screenshot function, during the period when the terminal device 100 is acquiring the first long screenshot of the first webpage, the terminal device 100 renders and synthesizes the first long screenshot through the compositing module of the rendering process, instead of rendering and synthesizing the first long screenshot through the main process of the first application. This does not occupy the main process of the first application. The terminal device 100 can render and synthesize the second webpage through the main process of the first application to refresh the animated content or video content in the webpage, without any lag.
[0280] Figure 12 shows a schematic diagram illustrating the specific implementation of another terminal device 100 refreshing a webpage.
[0281] The specific implementation shown in Figure 12 is similar to that shown in Figure 2E. The difference is that the rendering process of the first application has added a compositing module. After the terminal device 100 receives the operation to enable the long screenshot function, the drawing module of the rendering process can call the CPU to draw the first long screenshot. After the CPU draws the first long screenshot, the compositing module of the rendering process calls the GPU to render and composite the first long screenshot drawn by the CPU, without occupying the main process of the first application.
[0282] Optionally, the rendering process's drawing module can call the CPU to draw the first long screenshot, which means that the rendering process's drawing module can call the CPU to obtain the drawing instructions used to synthesize the first long screenshot.
[0283] Optionally, the compositing module of the rendering process calls the GPU to render and composite the first long screenshot drawn by the CPU. This can refer to the compositing module of the rendering process calling the GPU to render and composite the drawing instructions used to composite the first long screenshot, thus obtaining the first long screenshot. The explanation of drawing, rendering, and compositing is similar to that here, and will not be repeated here.
[0284] After terminal device 100 sends Vsync signal 3, the rendering process's drawing module needs to call the CPU to draw the first long screenshot. After the first long screenshot is drawn, the rendering process's compositing module can call the GPU to render and composite the first long screenshot drawn by the CPU.
[0285] After the CPU completes the first long screenshot rendering, the rendering module of the rendering process can render webpage 3. After webpage 3 is rendered, the main process of the first application does not need to wait for the first long screenshot rendering and compositing to complete. The main process of the first application can call the GPU to render and compose webpage 3 drawn by the CPU, so that webpage 3 can be rendered and composed within a fixed cycle (e.g., the second refresh cycle). The main process of the first application can display webpage 3 within the third refresh cycle, avoiding the situation where the same webpage content is displayed for two consecutive cycles, which could lead to the inability to refresh the animated or video content on the webpage.
[0286] In some embodiments, this application can also be applied to long screenshot scenarios outside of web pages. For example, terminal device 100 displays a first portion of a first long page of a first application, while a second portion of the first long page is not displayed. Terminal device 100 can receive a user's operation to enable long screenshots, and can acquire a first long screenshot of the first long page. When the first long page contains animated GIFs or videos, terminal device 100 can draw, render, and composite a second long page during the acquisition of the first long screenshot, and then display the second long page. This avoids a situation where terminal device 100 cannot refresh the animated GIF or video content during the acquisition of the first long screenshot, preventing lag.
[0287] Figure 13 shows a schematic diagram of a terminal device 100 obtaining a first long screenshot of a first long page of a first application.
[0288] As shown in Figure 13, in response to the operation of starting the first application, the terminal device 100 can send a Vsync signal 1. The first application can send a rendering instruction to the rendering service. The rendering service can call the drawing thread to draw the long page 1. After the long page 1 is drawn, the rendering service calls the first compositing thread to render and compose the long page 1, and then sends the long page 1 to the display screen of the terminal device 100 for display.
[0289] Optionally, the rendering service calls the drawing thread to draw long page 1, which can refer to the rendering service calling the drawing thread to obtain the drawing instructions used to compose long page 1.
[0290] Optionally, the rendering service calls the first compositing thread to render and composite the long page 1. This can refer to the rendering service calling the first compositing thread to render and composite the drawing instructions used to composite the long page 1, thus obtaining the long page 1. The explanation of drawing, rendering, and compositing is similar to that here, and will not be repeated here.
[0291] When the terminal device 100 is about to process the long page 2, the terminal device 100 can send a Vsync signal 2. The first application can send a rendering instruction to the rendering service. The rendering service can call the drawing thread to draw the long page 2. After the long page 2 is drawn, the rendering service calls the first compositing thread to render and compose the long page 2, and then sends the long page 2 to the display screen of the terminal device 100 for display.
[0292] When the terminal device 100 is about to process the long page 3, the terminal device 100 can send a Vsync signal 3. When the terminal device 100 receives the user's operation to enable the long screenshot function, the first application can send a rendering instruction to the rendering service. The rendering service can call the drawing thread to draw the first long screenshot of the long page 1. After the first long screenshot of the long page 1 is drawn, the rendering service calls the second compositing thread to render and composite the first long screenshot of the long page 1.
[0293] After the first long screenshot of long page 1 is drawn, the main process of the first application does not need to wait for the first long screenshot of long page 1 to be rendered and composited. The first application can send a rendering command to the rendering service, which can call the drawing thread to draw long page 3. After long page 3 is drawn, the rendering service calls the first compositing thread to render and composite long page 3, and sends long page 3 to the display screen of terminal device 100 for display. This allows long page 3 to be rendered and composited within a fixed period (e.g., the second refresh period), and terminal device 100 to display web page 3 within the third refresh period. This prevents the same web page content from being displayed in two consecutive periods, which could lead to the inability to refresh the animated or video content in the long page.
[0294] When the terminal device 100 is about to process the long page 4, the terminal device 100 can send a Vsync signal 4. The first application can send a rendering instruction to the rendering service. The rendering service can call the drawing thread to draw the long page 4. After the long page 4 is drawn, the rendering service calls the first compositing thread to render and compose the long page 4, and then sends the long page 4 to the display screen of the terminal device 100 for display.
[0295] Similarly, after the terminal device 100 sends the Vsync signal 5, the main process can send the long page 5 to the display screen of the terminal device 100 for display, and the drawing thread and the first compositing thread can refresh the long page in the first application as shown in Figure 13.
[0296] Figure 14 is a flowchart illustrating a screenshot method provided in this application.
[0297] S1401, The terminal device displays the first part of the content of the first webpage of the first application.
[0298] S1402, The terminal device receives the first operation, which is used to enable the long screenshot function.
[0299] S1403, In response to the first operation, the terminal device obtains the first webpage resource of the first webpage through the drawing module.
[0300] S1404. Based on the first webpage resource, the terminal device obtains drawing instructions for synthesizing the first long screenshot through the drawing module.
[0301] S1405. The terminal device renders and synthesizes the drawing instructions used to draw the first long screenshot through the compositing module to obtain the first long screenshot, which includes the first part of the content and the second part of the content of the first webpage.
[0302] Optionally, if the content of the first webpage is extensive and the display area of the terminal device's screen is limited, when the display ratio of the first application is 100%, the terminal device can display the first part of the content of the first webpage, but not the second part of the content of the first webpage.
[0303] Optionally, the first operation can be a user double-tapping the screen with their knuckle, or a user clicking the virtual button for taking a screenshot, or a user pressing the power button and the volume up button.
[0304] Optionally, after the first application is launched, the terminal device can create a rendering process for the first application, which includes a drawing module and a compositing module.
[0305] With this solution, when the terminal device displays the first webpage, in response to the first operation of enabling the long screenshot function, the terminal device can synthesize a long screenshot of the first webpage in the first application displayed on the terminal device through the newly added compositing module in the rendering process. This will not occupy the main process of the first application. The main process of the first application can synthesize the webpage to be refreshed to refresh the animated or video content on the webpage. There will be no webpage lag during the process of the terminal device acquiring the long screenshot of the first webpage, thus improving the display effect of the webpage on the terminal device.
[0306] In one possible implementation, after obtaining the first long screenshot, the method further includes: the terminal device sending the first long screenshot to the main process of the first application through the synthesis module.
[0307] After the compositing module of the rendering process obtains the first long screenshot of the first webpage, the compositing module of the rendering process can send the first long screenshot to the main process of the first application.
[0308] In one possible implementation, after receiving a first long screenshot of the first webpage, the main process of the first application can save the first long screenshot. For example, the main process of the first application can save it in the gallery application or in a folder used for storing screenshots.
[0309] In other possible implementations, after receiving the first long screenshot of the first webpage, the first long screenshot is not limited to being saved through the main process of the first application; the terminal device can also save the first long screenshot through the operating system.
[0310] In other possible implementations, after receiving the first long screenshot of the first webpage, the main process of the first application can output a first prompt, asking the user whether to save the first long screenshot. The user can choose to save the first long screenshot or not.
[0311] In other possible implementations, after receiving the first long screenshot of the first webpage, the first prompt is not limited to being output through the main process of the first application; the terminal device can also output the first prompt through the operating system. The first prompt is used to ask the user whether to save the first long screenshot.
[0312] In one possible implementation, the terminal device retrieves a first long screenshot from the shared memory of the first application through the main process. Specifically, after the terminal device stores the first long screenshot in the shared memory of the first application through the synthesis module, the terminal device sends a first message to the main process through the synthesis module. In response to the first message, the terminal device retrieves the first long screenshot from the shared memory of the first application through the main process.
[0313] Optionally, the shared memory for the first application may be requested after the terminal device receives the first operation.
[0314] Optionally, the shared memory of the first application can be requested by the main process of the first application. After requesting the shared memory of the first application, the main process of the first application can obtain the address of the shared memory of the first application and send the shared memory of the first application to the compositing module of the rendering process. The address of the shared memory of the first application is used by the compositing module of the rendering process to access the data stored in the shared memory of the first application.
[0315] In this way, the compositing module of the rendering process can send the first long screenshot to the main process of the first application through the shared content of the first application.
[0316] In one possible implementation, the terminal device retrieves a first long screenshot from the shared memory of the first application through the main process. Specifically, after the terminal device stores the first long screenshot in the shared memory of the first application through the synthesis module, the terminal device sends a first message to the main process through the synthesis module. In response to the first message, the terminal device retrieves the first long screenshot from the shared memory of the first application through the main process.
[0317] In this way, after the compositing module of the rendering process composes the first long screenshot, the compositing module of the rendering process can send a first message to the main process of the first application to instruct the main process of the first application to retrieve the first long screenshot from the shared memory of the first application.
[0318] Optionally, the compositing module of the rendering process may not send the first message to the main process of the first application. The main process of the first application may periodically or irregularly access the main process of the first application to confirm whether the first long screenshot is saved in the main process of the first application. If the first long screenshot is saved in the main process of the first application, the first long screenshot shall be retrieved.
[0319] In one possible implementation, after the terminal device displays the first part of the content of the first webpage of the first application, the method further includes: the terminal device sending the second webpage resource of the second webpage to the rendering module through the main process; based on the second webpage resource, the terminal device obtaining the rendering instructions for composing the second webpage through the rendering module; the terminal device sending the rendering instructions for composing the second webpage to the main process through the rendering module; the terminal device rendering and composing the rendering instructions for composing the second webpage through the main process to obtain the second webpage; and the terminal device displaying the second webpage.
[0320] Optionally, the second web page resource can be obtained from the server in real time by the main process of the first application, or it can be obtained in advance and stored in the terminal device.
[0321] In this way, when the first webpage contains animated images or videos, the terminal device needs to periodically refresh the animated image or video content on the webpage. During the time the terminal device is capturing the first long screenshot of the first webpage, the terminal device renders and synthesizes the first long screenshot through the compositing module of the rendering process, instead of rendering and synthesizing the first long screenshot through the main process of the first application. This avoids occupying the main process of the first application, and the terminal device can then render and synthesize the second webpage through the main process of the first application to refresh the animated image or video content on the webpage, thus preventing any lag.
[0322] In one possible implementation, based on the second webpage resource, the terminal device obtains drawing instructions for synthesizing the second webpage through the drawing module. Specifically, the terminal device confirms whether it has obtained drawing instructions for synthesizing the first long screenshot. When the drawing instructions for synthesizing the first long screenshot have been obtained, the terminal device obtains drawing instructions for synthesizing the second webpage through the drawing module based on the second webpage resource.
[0323] In other possible implementations, when the drawing instruction for synthesizing the first long screenshot is not obtained, the terminal device waits until the drawing instruction for synthesizing the first long screenshot is obtained, and then obtains the drawing instruction for synthesizing the second webpage based on the second webpage resource through the drawing module.
[0324] After the terminal device receives the user's instruction to enable the long screenshot function, the terminal device can obtain the drawing instructions for composing the first long screenshot based on the first webpage resource through the rendering module of the rendering process. Upon receiving the second webpage resource sent by the main process of the first application, the rendering module of the rendering process may be busy obtaining the drawing instructions for composing the first long screenshot. Therefore, after receiving the second webpage resource from the main process of the first application, the rendering process needs to confirm whether the drawing module is idle. If it is confirmed that the drawing module is idle, the rendering process can obtain the drawing instructions for composing the second webpage based on the second webpage resource. If it is confirmed that the drawing module is busy, the rendering process needs to wait until it obtains the drawing instructions for composing the first long screenshot, i.e., until the rendering module is idle, before obtaining the drawing instructions for composing the second webpage based on the second webpage resource.
[0325] In one possible implementation, after the terminal device retrieves the first long screenshot from the shared memory of the first application via the main process, the method further includes: the terminal device deleting the first long screenshot from the shared memory of the first application.
[0326] In this way, after the main process of the first application retrieves the first long screenshot from the shared memory of the first application, the terminal device can delete the first long screenshot from the shared memory of the first application to save the storage space of the shared memory of the first application.
[0327] This application provides a terminal device, including a memory and a processor; wherein the memory and the processor are coupled, the memory is used to store computer programs, and when the processor executes and calls the computer programs, the terminal device executes a screenshot method shown in Figure 14.
[0328] This application provides a computer-readable storage medium including instructions that, when executed on a terminal device, cause the terminal device to perform a screenshot method as shown in FIG14.
[0329] This application provides a chip system including one or more processors, which are used to invoke computer instructions to cause a terminal device to execute a screenshot method shown in FIG14.
[0330] This application provides a computer program product containing instructions that, when run on a terminal device, cause the terminal device to execute a screenshot method as shown in FIG14.
[0331] The above are merely some embodiments and implementation methods of this application. The scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0332] It is understood that the user interfaces described in the embodiments of this application are merely example interfaces and do not constitute a limitation on the solution of this application. In other embodiments, the user interface may adopt different interface layouts, may include more or fewer controls, and may add or remove other functional options, as long as they are based on the same inventive concept provided in this application, they are all within the protection scope of this application.
[0333] It should be noted that, without causing contradictions or conflicts, any feature in any embodiment of this application, or any part of any feature, can be combined, and the combined technical solution is also within the scope of the embodiments of this application.
[0334] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A method for taking long screenshots, characterized in that, The method is applied to a terminal device, which runs a first application. The first application includes a main process and a rendering process, and the rendering process includes a drawing module and a compositing module. The method includes: The terminal device displays the first part of the content of the first webpage of the first application; The terminal device receives a first operation, which is used to enable the long screenshot function. In response to the first operation, the terminal device obtains the first webpage resource of the first webpage through the rendering module; Based on the first webpage resource, the terminal device obtains drawing instructions for synthesizing the first long screenshot through the drawing module; The terminal device renders and synthesizes the drawing instructions for drawing the first long screenshot through the compositing module to obtain the first long screenshot, which includes the first part of the content and the second part of the content of the first webpage.
2. The method according to claim 1, characterized in that, After obtaining the first long screenshot, the method further includes: The terminal device sends the first long screenshot to the main process through the synthesis module.
3. The method according to claim 2, characterized in that, The terminal device sends the first long screenshot to the main process through the synthesis module, specifically including: The terminal device stores the first long screenshot in the shared memory of the first application through the synthesis module; The terminal device obtains the first long screenshot from the shared memory of the first application through the main process.
4. The method according to claim 3, characterized in that, The terminal device retrieves the first long screenshot from the shared memory of the first application through the main process, specifically including: After the terminal device stores the first long screenshot in the shared memory of the first application through the synthesis module, the terminal device sends a first message to the main process through the synthesis module. In response to the first message, the terminal device retrieves the first long screenshot from the shared memory of the first application through the main process.
5. The method according to any one of claims 1-4, characterized in that, After the terminal device displays a first portion of the content of a first webpage of a first application, the method further includes: The terminal device sends the second webpage resource of the second webpage to the rendering module through the main process; Based on the second webpage resource, the terminal device obtains drawing instructions for composing the second webpage through the drawing module; The terminal device sends the drawing instructions for synthesizing the second webpage to the main process through the drawing module; The terminal device renders and synthesizes the drawing instructions used to synthesize the second webpage through the main process to obtain the second webpage; The terminal device displays the second webpage.
6. The method according to claim 5, characterized in that, Based on the second webpage resource, the terminal device obtains drawing instructions for composing the second webpage through the drawing module, specifically including: The terminal device confirms whether it has received the drawing instruction for synthesizing the first long screenshot; When the drawing instruction for synthesizing the first long screenshot has been obtained, the terminal device obtains the drawing instruction for synthesizing the second webpage through the drawing module based on the second webpage resource.
7. The method according to claim 6, characterized in that, The method further includes: When the drawing instruction for synthesizing the first long screenshot is not obtained, the terminal device waits until the drawing instruction for synthesizing the first long screenshot is obtained, and then obtains the drawing instruction for synthesizing the second webpage based on the second webpage resource through the drawing module.
8. The method according to claim 3 or 4, characterized in that, After the terminal device retrieves the first long screenshot from the shared memory of the first application through the main process, the method further includes: The terminal device deletes the first long screenshot from the shared memory of the first application.
9. The method according to any one of claims 1-8, characterized in that, After the terminal device retrieves the first long screenshot from the shared memory of the first application through the main process, the method further includes: The terminal device outputs a first prompt, which prompts the user whether to save the first long screenshot.
10. The method according to any one of claims 1-8, characterized in that, After the terminal device retrieves the first long screenshot from the shared memory of the first application through the main process, the method further includes: The terminal device saves the first long screenshot.
11. A terminal device, characterized in that, The wearable device includes a memory and a processor; wherein the memory and the processor are coupled, the memory is used to store a computer program, and when the processor executes the computer program, the terminal device performs the method of any one of claims 1-10.
12. A computer-readable storage medium, characterized in that, Includes instructions that, when executed on a terminal device, cause the terminal device to perform the method of any one of claims 1-10.
13. A chip system, characterized in that, The chip system includes a processing circuit and an interface circuit. The interface circuit is used to receive code instructions and transmit them to the processing circuit. The processing circuit is used to execute the code instructions so that the terminal device performs the method as described in any one of claims 1-10.
14. A computer program product, characterized in that, Includes a computer program that, when run on a terminal device, causes the terminal device to perform the method as described in any one of claims 1-10.