Document display method, device and equipment
By responding to the rendering task during the document display process, determining the nodes to be displayed within the viewport range, and displaying the target nodes according to the display restrictions, the lag problem in the online document display process is solved and the user experience is improved.
Patent Information
- Application Number
- CN202411834072.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-04-08
AI Technical Summary
There is a problem of lag during the online document display process, mainly because the document is large, which causes all content to be mounted into the browser at one time, which takes a long time and affects the user experience.
By responding to the rendering task, determine the nodes to be displayed in the viewport range of the document, and display the target nodes that meet the conditions according to the display restrictions (such as limiting the number of nodes, limiting execution time, and node priority type), reducing the complexity and time-consuming of a single rendering task.
It effectively reduces lags in the document display process and improves user experience. By splitting long-term rendering tasks into multiple short-term tasks, the resource management and loading order in the browser is optimized.
Smart Images

Figure CN119782642A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a document display method, device and equipment. Background Art
[0002] Online documents refer to documents that can be accessed through the Internet. These documents may include various types of files, such as text documents, spreadsheets, presentations, etc. Online documents can be displayed through a browser. Currently, the entire content of a document is usually mounted in a browser at one time for display. However, since the document is a relatively large application, technical problems such as freezes may occur during the document display process. Summary of the invention
[0003] In view of this, embodiments of the present application provide a document display method, apparatus, and device to reduce freezes during document display.
[0004] To solve the above problems, the technical solutions provided in the embodiments of the present application are as follows:
[0005] In a first aspect, an embodiment of the present application provides a document display method, the method comprising:
[0006] In response to the rendering task, determining a node to be displayed in the document within the viewport range;
[0007] In response to the existence of a target node that needs to be updated in the nodes to be displayed, the target node that meets the display restriction condition is displayed according to the display restriction condition.
[0008] In a possible implementation, the method further includes:
[0009] The steps of responding to the rendering task, determining the node to be displayed in the viewport, and subsequent steps are repeatedly performed until the target node does not exist.
[0010] In a possible implementation, when the display restriction condition includes limiting the number of nodes, displaying the target nodes satisfying the display restriction condition according to the display restriction condition includes:
[0011] Display target nodes that are less than or equal to the limit number of nodes.
[0012] In a possible implementation, when the display restriction condition includes limiting the execution time, displaying the target node satisfying the display restriction condition according to the display restriction condition includes:
[0013] After displaying each of the target nodes, determining whether the limited execution time is exceeded;
[0014] If the execution time limit is not exceeded, display the next target node;
[0015] If the limited execution time is exceeded, the target node is stopped from being displayed.
[0016] In a possible implementation, when the display restriction condition includes a node priority type, displaying the target node satisfying the display restriction condition according to the display restriction condition includes:
[0017] Displays target nodes that meet the specified node priority type.
[0018] In a possible implementation, determining the nodes to be displayed within the viewport range includes:
[0019] The nodes to be displayed within the viewport range are determined according to the preset height and / or actual height of the nodes in the document, the viewport height, and the document scroll bar position.
[0020] In a possible implementation manner, after displaying the target node that meets the display restriction condition, the method further includes:
[0021] Gets the actual height of the displayed target node.
[0022] In a possible implementation manner, after displaying the target node that meets the display restriction condition, the method further includes:
[0023] After the displayed target nodes are beyond the viewport range, unload the target nodes that are beyond the viewport range.
[0024] In a second aspect, an embodiment of the present application provides a document display device, the device comprising:
[0025] A determination unit, configured to determine, in response to a rendering task, a node to be displayed of the document within a viewport range;
[0026] The display unit is configured to, in response to the existence of a target node that needs to be updated in the nodes to be displayed, display the target node that meets the display restriction condition according to the display restriction condition.
[0027] In a third aspect, an embodiment of the present application provides a document display device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the document display method as described in any one of the above items is implemented.
[0028] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, characterized in that instructions are stored in the computer-readable storage medium, and when the instructions are executed on a terminal device, the terminal device executes a document display method as described in any one of the above items.
[0029] In a fifth aspect, an embodiment of the present application provides a computer program product, characterized in that it includes computer program instructions, and when the computer program instructions are executed on a terminal device, the terminal device executes any one of the document display methods described.
[0030] It can be seen that the embodiments of the present application have the following beneficial effects:
[0031] In response to the rendering task, the embodiment of the present application determines the nodes to be displayed in the document within the viewport range. When there are target nodes that need to be updated and displayed in the nodes to be displayed, the target nodes that meet the display restriction conditions are displayed according to the display restriction conditions. That is, during the document display process, only some nodes within the viewport range are mounted and displayed at a time. By splitting a single long rendering task into multiple short rendering tasks, the jamming during the document display process is reduced and the user experience is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 A schematic diagram of an exemplary application scenario provided for an embodiment of the present application;
[0033] Figure 2 A schematic diagram of a flow chart of a virtual scrolling method in an embodiment of the present application;
[0034] Figure 3 A flowchart of a document display method provided in an embodiment of the present application;
[0035] Figure 4 A flowchart of a document display method in an embodiment of the present application;
[0036] Figure 5 A schematic diagram of a document display device provided in an embodiment of the present application;
[0037] Figure 6 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] In order to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and easy to understand, the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0039] In order to facilitate understanding and explanation of the technical solution provided by the embodiments of the present application, the background technology of the embodiments of the present application will be described below.
[0040] Since the document is a relatively large application, if all the contents of the document are mounted into the browser at once, it will lead to technical problems such as long initialization time and operation lag.
[0041] In the embodiment of the present application, virtual scrolling is used to optimize the user experience during the document display process, that is, only the content near the user's viewport is mounted in the browser. When the user scrolls the document, the content outside the viewport range is unloaded, and the new content within the viewport range is mounted and displayed. However, since there are many nodes in the viewport, the user may still feel stuck.
[0042] Based on this, the embodiments of the present application provide a document display method, device and equipment, and further optimize the virtual scrolling method provided in the embodiments of the present application. By limiting the number of nodes entering the rendering or limiting the time consumed by the rendering, only some nodes within the display viewport are rendered at a time, and a single long rendering task is split into multiple short rendering tasks to reduce the jamming during the document display process.
[0043] In order to facilitate understanding of the document display method provided in the embodiment of the present application, Figure 1 See the example scenario shown in the figure. Figure 1 As shown, this figure is a schematic diagram of an exemplary application scenario provided in an embodiment of the present application.
[0044] The embodiments of the present application can be applied to a browser, which can be used to display documents. The types of documents can be text documents, spreadsheets, presentations, etc. The embodiments of the present application do not limit the types of documents.
[0045] It is understandable that documents are usually long and the browser's viewport is limited. Part of the document is displayed within the viewport. Users can trigger the display of other parts of the document within the viewport by scrolling the document. The viewport is used in the user interface to define the display area of a window or view on a device. When a document is opened for the first time or when the user triggers document scrolling, a rendering task can be triggered to display the document within the browser's viewport.
[0046] A document may include multiple nodes, and in the embodiment of the present application, a node is an element to be displayed in the document. A node may be a text node, a table node, or an image node, etc. In practical applications, a text may constitute a text node, such as text node 1, text node 2, text node 3, and text node 4 in the figure. A table may constitute a table node, such as table node 1 in the figure. An image may constitute an image node, such as image node 1 in the figure.
[0047] Document display is achieved by mounting and displaying the nodes in the document.
[0048] Those skilled in the art will understand that Figure 1 The framework diagram shown is only an example in which the embodiments of the present application can be implemented. The scope of application of the embodiments of the present application is not limited by any aspect of the framework.
[0049] See also Figure 2 As shown, a schematic diagram of a process of using virtual scrolling in actual applications is shown.
[0050] When a document is opened or the user triggers document scrolling, a rendering task can be triggered. A rendering task is a rendering task unit. During a document scrolling process, one or more rendering tasks can be generated to unload and mount the content within the viewport range to ensure that the content within the user's viewport is visible and the number of nodes mounted and displayed does not increase.
[0051] In response to the rendering task, determine the nodes to be displayed in the document within the viewport. Due to the characteristics of the browser and the business, the height of the node cannot be predicted in advance. If it is the first execution in the loop to determine the nodes to be displayed in the document within the viewport, when no node is displayed in the viewport, through some preset page layout related information, such as the preset height of the node, the viewport height, and the document scroll bar position, etc., the nodes that may need to be displayed in the current viewport range can be calculated as the nodes to be displayed. If it is not the first execution in the loop to determine the nodes to be displayed in the document within the viewport range, there may be nodes that have been mounted and displayed within the viewport range, and the actual heights of these nodes are known, then the nodes that may need to be displayed in the current viewport range can be calculated as the nodes to be displayed based on the preset height and / or actual height of the node, the viewport height, and the document scroll bar position.
[0052] Then, it is determined whether there is a target node that needs to be updated and displayed. If the node has been mounted and displayed, it does not actually need to be updated and displayed. The target node can be understood as a node that needs to be mounted in the browser for display to obtain the actual width and height information.
[0053] If the target node exists, the target node is further displayed. For multiple target nodes, each target node is displayed in turn until the viewport range is filled. In practical applications, displaying the target node may include instantiating the target node and mounting the target node to the viewport. Among them, the instantiated target node can instantiate the target node that needs to be updated and displayed, and cache it in the memory. Mounting the target node to the viewport can mount the target node into the browser, and obtain the actual height, actual width and other data of the target node, and record the data, and provide it to the next execution to determine the nodes to be displayed in the document within the viewport range, so as to more accurately calculate which nodes need to be displayed.
[0054] If the target node does not exist, the steps to keep the target node mounted are executed, some placeholders are generated to support the page height, and the target node that exceeds the viewport range can also be unloaded. At this point, the rendering task is completed.
[0055] If there are a large number of target nodes in the viewport, the execution time of a single rendering task will be long, which will cause users to feel a lag and make it impossible to insert and execute other tasks in the browser.
[0056] Based on this, a document display method provided by an embodiment of the present application is further described. In order to facilitate understanding of the embodiment of the present application, a document display method provided by an embodiment of the present application is described below in conjunction with the accompanying drawings.
[0057] See also Figure 3 As shown in FIG. 1 , this figure is a flow chart of a document display method provided by an embodiment of the present application, such as Figure 3 As shown, the method may include S301-S302:
[0058] S301: In response to a rendering task, determine a node to be displayed in a document within a viewport range.
[0059] When a document is opened or a user triggers document scrolling or the document display method of the embodiment of the present application does not interrupt the loop, the rendering task can be triggered. The nodes to be displayed in the document within the viewport range are calculated to calculate the nodes that may be displayed within the viewport range.
[0060] In a possible implementation, the specific implementation of determining the to-be-displayed nodes within the viewport range in S301 may include:
[0061] The nodes to be displayed within the viewport range are determined according to the preset height and / or actual height of the nodes in the document, the viewport height, and the document scroll bar position.
[0062] When no node is displayed in the viewport, the nodes to be displayed that may need to be displayed within the current viewport range can be calculated through some preset page layout related information, such as the preset height of the node, the viewport height, and the document scroll bar position. When there are nodes displayed in the viewport, the nodes to be displayed that may need to be displayed within the current viewport range can be calculated based on the actual height of the mounted and displayed nodes and the preset height of the unmounted and displayed nodes, the viewport height, and the document scroll bar position. For example, the preset height of the text node is 26, and the preset height of the image node and the table node is 220. According to the node order, the distance of each node from the top can be obtained based on the preset height and / or actual height of the nodes in the document. The nodes to be displayed that may need to be displayed within the current viewport range can be calculated based on the viewport height and the distance from the document scroll bar to the top.
[0063] S302: In response to the existence of a target node that needs to be updated in the nodes to be displayed, display the target node that meets the display restriction condition according to the display restriction condition.
[0064] Among the nodes to be displayed, some nodes may have been mounted and displayed, and some nodes may not be mounted and displayed. To determine whether there are target nodes that need to be updated and displayed among the nodes to be displayed, that is, to determine whether there are nodes that have not been mounted and displayed among the nodes to be displayed. The target nodes can be understood as nodes that need to be mounted and displayed in the browser to obtain real information such as width and height.
[0065] In actual applications, the actual height of the node that has been mounted and displayed can be obtained, or the node is marked. By judging whether the nodes to be displayed include nodes whose actual height has not been obtained or nodes that are not marked, it is determined whether there are target nodes that need to be updated and displayed.
[0066] If there is a target node, different from the virtual scrolling method, it is necessary to limit the target nodes displayed at a single time, and only display the target nodes that meet the display restriction conditions, that is, mount the target nodes that meet the display restriction conditions into the browser for display.
[0067] In a possible implementation, when the display restriction condition includes limiting the number of nodes, the specific implementation of displaying the target nodes satisfying the display restriction condition according to the display restriction condition in S302 may include:
[0068] Display target nodes that are less than or equal to the limit number of nodes.
[0069] That is, if the display restriction condition includes limiting the number of nodes, the number of target nodes displayed at a time is limited, and at most the target nodes of the limited number of nodes are displayed. If the number of target nodes is greater than the limited number of nodes, target nodes equal to the limited number of nodes can be displayed. If the number of target nodes is less than the limited number of nodes, all current target nodes can be displayed. For example, if the limited number of nodes is 3, at most 3 target nodes can be displayed at a time. Thus, the rendering tasks with a smaller number of nodes are split to reduce the jamming during the document display process.
[0070] In a possible implementation, when the display restriction condition includes limiting the execution time, the specific implementation of displaying the target node satisfying the display restriction condition according to the display restriction condition in S302 may include:
[0071] After displaying each target node, determine whether the execution time limit is exceeded; if the execution time limit is not exceeded, display the next target node; if the execution time limit is exceeded, stop displaying the target node.
[0072] That is, the display restriction condition may include a limited execution time, which limits the time consumed by a single execution of the mount display. After displaying each target node, it is determined whether the limited execution time has been exceeded. If the limited execution time has not been exceeded, the next target node may continue to be displayed. If the limited execution time has been exceeded, the next target node will no longer be displayed. This makes the execution time of a single rendering task shorter, thereby reducing the jamming during the document display process.
[0073] In a possible implementation, when the display restriction condition includes a node priority type, the specific implementation of displaying the target node satisfying the display restriction condition according to the display restriction condition in S302 may include:
[0074] Displays target nodes that meet the node priority type.
[0075] That is, the display restriction condition may include a node priority type to give priority to displaying target nodes that meet the node priority type. For example, if the node priority type is an image type, image nodes in the target node are given priority to displaying. The embodiment of the present application does not limit the node priority type, and it can be set according to actual conditions. This allows users to see more important content in the document first, and at the same time, limits the target nodes displayed by the rendering task.
[0076] It is understandable that the display restriction condition can be preset, and may include one or more of limiting the number of nodes, limiting the execution time, and the node priority type. That is, the limiting the number of nodes, limiting the execution time, and the node priority type can be restricted at the same time, so as to split a single long-time rendering task into multiple short-time rendering tasks.
[0077] In a possible implementation manner, after displaying the target node that meets the display restriction condition, the following may also be included:
[0078] Gets the actual height of the displayed target node.
[0079] After displaying the target nodes that meet the display restriction conditions, the actual height, actual width and other data of the displayed target nodes can be obtained through the browser interface, and the data can be recorded and provided to the next execution of S301 to more accurately calculate which nodes need to be displayed.
[0080] In a possible implementation manner, after displaying the target node that meets the display restriction condition, the following may also be included:
[0081] After the displayed target nodes are beyond the viewport range, unload the target nodes that are beyond the viewport range.
[0082] In addition, target nodes that are beyond the viewport range can be unloaded to save browser resources.
[0083] In a possible implementation, the method may further include:
[0084] S301 is repeatedly executed in response to the rendering task, calculating the nodes to be displayed in the viewport and subsequent steps until there is no target node.
[0085] S301-S302 is a short-time rendering task, and the target nodes are mounted and displayed in batches by continuously executing S301-S302 in a loop. When there is no target node, it means that all the nodes to be displayed are mounted and displayed, and the loop execution of S301-S302 can be stopped to complete the display of the document.
[0086] In response to the rendering task, the embodiment of the present application determines the nodes to be displayed in the document within the viewport range. When there are target nodes that need to be updated and displayed in the nodes to be displayed, the target nodes that meet the display restriction conditions are mounted and displayed according to the display restriction conditions. That is, during the document display process, only some nodes within the viewport range are mounted and displayed at a time. By splitting a single long rendering task into multiple short rendering tasks, the jamming during the document display process is reduced and the user experience is improved.
[0087] See also Figure 4 As shown, a flow chart of the document display method provided in an embodiment of the present application in actual application is shown.
[0088] In response to the rendering task, a node to be displayed in the document within the viewport is determined.
[0089] Determine whether there is a target node that needs to be updated and displayed. If there is a target node, limit the number of target nodes displayed at a single time, and display at most the target nodes with the limited number of nodes. In practical applications, displaying the target node may include instantiating the target node and mounting the target node to the viewport. Among them, instantiating the target node can instantiate the target node that needs to be updated and displayed, and cache it in the memory. Mounting the target node to the viewport can mount the target node into the browser, and obtain the actual height, actual width and other data of the target node, and record the data, and provide it to the next execution to determine the nodes to be displayed in the document within the viewport range, so as to more accurately calculate which nodes need to be displayed.
[0090] After displaying each target node, it is determined whether the execution time limit has been exceeded. If the execution time limit has not been exceeded, the next target node can be displayed. If the execution time limit has been exceeded, the next target node will no longer be displayed.
[0091] Execute the steps to keep the target node mounted, generate some placeholders to support the page height, and also unload the target node that exceeds the viewport range. At this point, the rendering task is completed.
[0092] The loop is executed until the rendering task starts, and until there is no target node, the document display is stopped.
[0093] By actually applying the document display method of the embodiment of the present application, the freeze rate can be effectively reduced and the user experience can be improved.
[0094] Based on a document display method provided by the above method embodiment, an embodiment of the present application also provides a document display device, which will be described below in conjunction with the accompanying drawings.
[0095] See also Figure 5 As shown in FIG. 1 , this figure is a schematic diagram of the structure of a document display device provided in an embodiment of the present application. Figure 5 As shown, the document display device includes:
[0096] A determination unit 501, configured to determine, in response to a rendering task, a node to be displayed in a document within a viewport range;
[0097] The display unit 502 is configured to, in response to the existence of a target node that needs to be updated in the nodes to be displayed, display the target node that meets the display restriction condition according to the display restriction condition. In a possible implementation, the device further includes:
[0098] A loop unit is used to repeatedly trigger the determination unit to execute the response to the rendering task, determine the nodes to be displayed in the viewport, and the display unit to execute the response to the existence of target nodes that need to be updated in the nodes to be displayed, and display the target nodes that meet the display restriction conditions according to the display restriction conditions until the target node does not exist.
[0099] In a possible implementation manner, when the display restriction condition includes limiting the number of nodes, the display unit is specifically configured to:
[0100] In response to the existence of target nodes that need to be updated in the nodes to be displayed, target nodes less than or equal to the limit number of nodes are displayed.
[0101] In a possible implementation manner, when the display restriction condition includes limiting the execution time, the display unit is specifically configured to:
[0102] In response to the existence of a target node that needs to be updated and displayed in the nodes to be displayed, after displaying each of the target nodes, determining whether the limited execution time is exceeded;
[0103] If the execution time limit is not exceeded, display the next target node;
[0104] If the limited execution time is exceeded, the target node is stopped from being displayed.
[0105] In a possible implementation manner, when the display restriction condition includes a node priority type, the display unit is specifically configured to:
[0106] In response to the existence of a target node that needs to be updated in the nodes to be displayed, the target nodes that meet the node priority type are displayed.
[0107] In a possible implementation manner, the determining unit is specifically configured to:
[0108] The nodes to be displayed within the viewport range are determined according to the preset height and / or actual height of the nodes in the document, the viewport height, and the document scroll bar position.
[0109] In a possible implementation manner, the device further includes:
[0110] The acquisition unit is used to acquire the actual height of the displayed target node after the display unit displays the target node that meets the display restriction condition.
[0111] In a possible implementation manner, the device further includes:
[0112] The unloading unit is used to unload the target nodes that exceed the viewport range after the display unit displays the target nodes that meet the display restriction condition and the displayed target nodes exceed the viewport range.
[0113] An embodiment of the present application further provides a computer program product, including computer program instructions. When the computer program instructions are executed on a terminal device, the terminal device executes any of the document display methods described above.
[0114] Based on a document display method provided in the above method embodiment, the present application also provides an electronic device, including: one or more processors; a storage device, on which one or more programs are stored, when the one or more programs are executed by the one or more processors, the one or more processors implement the document display method described in any of the above embodiments.
[0115] Reference below Figure 6, which shows a schematic diagram of the structure of an electronic device 1300 suitable for implementing the embodiment of the present application. The terminal device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (portable android devices), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs (televisions), desktop computers, etc. Figure 6 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0116] like Figure 6 As shown, the electronic device 1300 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1302 or a program loaded from a storage device 1306 into a random access memory (RAM) 1303. In the RAM 1303, various programs and data required for the operation of the electronic device 1300 are also stored. The processing device 1301, the ROM 1302, and the RAM 1303 are connected to each other via a bus 1304. An input / output (I / O) interface 1305 is also connected to the bus 1304.
[0117] Typically, the following devices may be connected to the I / O interface 1305: an input device 1306 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1306 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1309. The communication device 1309 may allow the electronic device 1300 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 1300 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0118] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 1309, or installed from the storage device 1306, or installed from the ROM 1302. When the computer program is executed by the processing device 1301, the above-mentioned functions defined in the method of the embodiment of the present application are executed.
[0119] The electronic device provided in the embodiment of the present application and the document display method provided in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0120] Based on a document display method provided by the above method embodiment, an embodiment of the present application provides a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the document display method as described in any of the above embodiments is implemented.
[0121] It should be noted that the computer-readable medium in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In an embodiment of the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In an embodiment of the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0122] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0123] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0124] The computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device executes the document display method.
[0125] The computer program code for performing the operation of the embodiment of the present application can be written in one or more programming languages or a combination thereof, and the above-mentioned programming languages include but are not limited to object-oriented programming languages-such as Java, Smalltalk, C++, and also include conventional procedural programming languages-such as "C" language or similar programming languages. The program code can be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network-including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0126] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0127] The units involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the unit / module does not, in some cases, constitute a limitation on the unit itself.
[0128] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0129] In the context of the present application embodiment, machine-readable medium can be a tangible medium that can contain or store a program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable medium can include but is not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the above. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.
[0130] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the system or device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0131] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0132] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0133] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0134] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A document display method, characterized in that: The method comprises: In response to the rendering task, determining a node to be displayed in the document within the viewport range; In response to the existence of a target node that needs to be updated in the nodes to be displayed, the target node that meets the display restriction condition is displayed according to the display restriction condition.
2. The method according to claim 1, characterized in that The method further comprises: The steps of responding to the rendering task, determining the node to be displayed in the viewport, and subsequent steps are repeatedly performed until the target node does not exist.
3. The method according to claim 1, characterized in that: When the display restriction condition includes limiting the number of nodes, displaying the target nodes satisfying the display restriction condition according to the display restriction condition includes: Display target nodes that are less than or equal to the limit number of nodes.
4. The method according to claim 1, characterized in that: When the display restriction condition includes limiting the execution time, displaying the target node satisfying the display restriction condition according to the display restriction condition includes: After displaying each of the target nodes, determining whether the limited execution time is exceeded; If the execution time limit is not exceeded, display the next target node; If the limited execution time is exceeded, the target node is stopped from being displayed.
5. The method according to claim 1, characterized in that When the display restriction condition includes a node priority type, displaying the target node satisfying the display restriction condition according to the display restriction condition includes: Displays target nodes that meet the specified node priority type.
6. The method according to claim 1, characterized in that The step of determining the nodes to be displayed within the viewport range includes: The nodes to be displayed within the viewport range are determined according to the preset height and / or actual height of the nodes in the document, the viewport height, and the document scroll bar position.
7. The method according to any one of claims 1 to 6, characterized in that: After displaying the target node that meets the display restriction condition, the method further includes: Gets the actual height of the displayed target node.
8. The method according to any one of claims 1 to 6, characterized in that: After displaying the target node that meets the display restriction condition, the method further includes: After the displayed target nodes are beyond the viewport range, unload the target nodes that are beyond the viewport range.
9. A document display device, characterized in that: The device comprises: A determination unit, configured to determine, in response to a rendering task, a node to be displayed of the document within a viewport range; The display unit is configured to, in response to the existence of a target node that needs to be updated in the nodes to be displayed, display the target node that meets the display restriction condition according to the display restriction condition.
10. A document display device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the document display method according to any one of claims 1 to 8 is implemented.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device executes the document display method according to any one of claims 1 to 8.
12. A computer program product, characterized in that The method comprises computer program instructions, which, when executed on a terminal device, enable the terminal device to execute the document display method according to any one of claims 1 to 8.