Web page view display method and device

By building a subtree structure containing empty nodes and filling data according to operations, the problem of long-term loading of web page views in the prior art is solved, and more efficient loading efficiency is achieved.

CN113656723BActive Publication Date: 2025-02-25TENCENT DIGITAL (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111082183.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-15
Publication Date
2025-02-25
Estimated Expiration
2041-09-15

AI Technical Summary

Technical Problem

When presenting hierarchical directory structure information, the existing technology causes the web page view initialization to take a long time, the loading efficiency is low, and the effective solution is lacking to save loading time.

Method used

By obtaining the path of the target node in the tree structure of the web page view, a first subtree structure containing an empty node is established, and a second subtree structure is built based on this to display the initial page. According to the operation, the data of the current page node is filled in the second subtree structure, and the third subtree structure is obtained to display the current page.

Benefits of technology

It effectively reduces the number of loaded nodes, saves the time-consuming loading of web page views, and improves loading efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113656723B_ABST
    Figure CN113656723B_ABST
Patent Text Reader

Abstract

The present application provides a method, device, equipment, computer-readable storage medium and computer program product for displaying a web page view; the method includes: obtaining the path of a target node in a tree structure of the web page view; establishing a first subtree structure corresponding to the parent node of each level in the path, wherein all nodes in the first subtree structure except the root node of the first subtree structure are empty nodes; establishing a second subtree structure based on the first subtree structure and the target node, and displaying the initial page of the web page view based on the second subtree structure; according to the operation on the web page view, obtaining the node data corresponding to the current page of the web page view, and filling the second subtree structure with data based on the node data to obtain a third subtree structure; displaying the current page based on the third subtree structure. Through the present application, it is possible to save the time consumed in loading the web page view and improve the loading efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technology, and in particular to a method, device, equipment, computer-readable storage medium, and computer program product for displaying a web page view. Background Art

[0002] With the rapid development of the Internet, especially the mobile Internet, web page views have been widely used as carriers of information that needs to be displayed. Due to the diversity of information, the display scenarios of web page views usually involve the display of hierarchical directory structure information.

[0003] In the prior art, for displaying hierarchical directory structure information, the parent node of each level associated with the entry node in the hierarchical directory structure and the child nodes corresponding to the parent node of each level are usually displayed in the web page view. This will cause the web page view to take a long time to initialize and load, resulting in low loading efficiency when displaying the web page view.

[0004] Regarding how to save the time spent on loading web page views and improve loading efficiency, there is no effective solution in the relevant technologies. Summary of the invention

[0005] The embodiments of the present application provide a method, apparatus, device, computer-readable storage medium, and computer program product for displaying a web page view, which can save the time consumed in loading a web page view and improve loading efficiency.

[0006] The technical solution of the embodiment of the present application is implemented as follows:

[0007] The present application provides a method for displaying a web page view, including:

[0008] Obtaining the path of the target node in the tree structure of the web page view;

[0009] Establishing a first subtree structure corresponding to the parent node of each level in the path, wherein all nodes in the first subtree structure except the root node of the first subtree structure are empty nodes;

[0010] Establishing a second subtree structure based on the first subtree structure and the target node, and displaying an initial page of the webpage view based on the second subtree structure;

[0011] According to the operation on the webpage view, node data corresponding to the current page of the webpage view is obtained, and data is filled in the second subtree structure based on the node data to obtain a third subtree structure;

[0012] The current page is displayed based on the third subtree structure.

[0013] The present application provides a device for displaying a web page view, including:

[0014] An acquisition module, used to acquire a path of a target node in the tree structure of the web page view;

[0015] A first construction module is used to establish a first subtree structure corresponding to the parent node of each level in the path, wherein all nodes in the first subtree structure except the root node of the first subtree structure are empty nodes;

[0016] a second construction module, configured to establish a second subtree structure based on the first subtree structure and the target node, and to display an initial page of the webpage view based on the second subtree structure;

[0017] a data filling module, configured to obtain node data corresponding to a current page of the web page view according to an operation on the web page view, and fill the second subtree structure with data based on the node data to obtain a third subtree structure;

[0018] A display module is used to display the current page based on the third subtree structure.

[0019] In the above scheme, the data filling module is also used to determine the index of the starting node of the current page and the number of nodes corresponding to the current page according to the operation on the web page view; determine the ending node of the current page according to the index of the starting node of the current page and the number of nodes corresponding to the current page; and obtain the node data corresponding to the current page according to the starting node of the current page and the ending node of the current page.

[0020] In the above scheme, the data filling module is also used to establish a mapping relationship list based on the starting node of the historical page, the ending node of the historical page and the historical node data request; when the starting node of the current page and the ending node of the current page exist in the mapping relationship list, the node data corresponding to the current page is obtained from the mapping relationship list.

[0021] In the above scheme, the data filling module is also used to send a node data request for the current page to the server when the starting node of the current page and the ending node of the current page do not exist in the mapping relationship list, and receive the node data corresponding to the current page returned by the server.

[0022] In the above scheme, the data filling module is also used to determine the sum of the number of node data requests for the current page and the number of node data requests in the request queue; when the sum is less than the number threshold, the multiple node data requests are loaded to the end of the request queue in the order of generation time; when the sum is greater than the number threshold, the target number of node data requests in the request queue are removed from the request queue in a first-in-first-out manner, and the multiple node data requests are loaded to the end of the request queue in the order of generation time; wherein the number threshold is the number of node data requests that need to be sent to fully display the current page; the node data requests in the request queue are sent and the request queue is cleared, and the node data corresponding to the current page returned by the server based on the sent node data requests is received.

[0023] In the above scheme, the acquisition module is also used to take the level where the target node is located as the starting level of the path, and take the level where the root node of the tree structure is located as the ending level of the path, and obtain the parent nodes of each level outside the level where the target node is located step by step in the direction from the starting level to the ending level; based on the parent nodes of each level and the target node, construct the path of the target node in the tree structure of the web page view.

[0024] In the above scheme, the first construction module is also used to obtain the number of nodes in each level of the first subtree structure except the level where the root node is located; fill each level of the first subtree structure except the level where the root node is located with empty nodes that are the same as the number of nodes; based on the root node of the first subtree structure and the empty nodes in each level of the first subtree structure except the level where the root node is located, construct a first subtree structure corresponding to the parent node of any one level.

[0025] In the above scheme, the data filling module is also used to fill the empty nodes corresponding to the node data in the second subtree structure with data based on each of the node data to obtain a node including the node data; and construct the third subtree structure based on the node including the node data and the target node.

[0026] In the above solution, the web page view display device further includes: a determination module, which is used to obtain all end nodes of the tree structure of the web page view; and determine at least one of the end nodes of the tree structure of the web page view as the target node.

[0027] The present application provides a device for displaying a web page view, including:

[0028] A memory for storing executable instructions;

[0029] The processor is used to implement the web page view display method provided in the embodiment of the present application when executing the executable instructions stored in the memory.

[0030] An embodiment of the present application provides a computer-readable storage medium storing executable instructions for causing a processor to execute instructions to implement a method for displaying a web page view provided in an embodiment of the present application.

[0031] The embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the web page view display method described in the embodiment of the present application.

[0032] The embodiments of the present application have the following beneficial effects:

[0033] Since the second subtree structure contains empty nodes in the first subtree structure, according to the operation on the web page view, the corresponding node data in the second subtree structure is filled with data based on the node data corresponding to the current page obtained, and the resulting third subtree structure only loads the nodes containing node data of the current page, effectively reducing the number of loaded nodes, effectively saving the loading time of the web page view, and improving loading efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is an optional structural diagram of a web page view display system architecture provided in an embodiment of the present application;

[0035] Figure 2 This is an optional structural diagram of a display device for a web page view provided in an embodiment of the present application;

[0036] FIG. 3A to FIG. 3D This is an optional flowchart of a method for displaying a web page view provided in an embodiment of the present application;

[0037] FIG. 4A to FIG. 4G It is a schematic diagram of the principle of the method for displaying a web page view provided in an embodiment of the present application. DETAILED DESCRIPTION

[0038] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0039] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0040] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0041] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0042] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0043] 1) Web page view: It is a view that can scroll and display the content of a web page, and is used to display the distribution of all the content in the web page on the entire page and the display position of all the content on each page.

[0044] 2) Path: A sequence of nodes starting from the root node in the web view tree structure and ending at the target node.

[0045] 3) Tree structure: It is a nonlinear data structure. Intuitively, the tree structure is a structure in which data elements (called nodes in the tree structure) are organized according to branching relationships.

[0046] 4) Level: The number of branches on the path from the root node of the tree structure to a certain node in the tree structure is called the level of the node. For example, in a tree structure, the level where the root node of the tree structure is located is the first level, the level where the child nodes of the root node of the tree structure are located is the second level, the level where the child nodes of the child nodes of the root node of the tree structure are located is the third level, and the level where the leaf nodes of the tree structure are located is the end level of the tree structure.

[0047] 5) Root node: The ancestor of all nodes in the same tree structure except itself, and has no parent node.

[0048] 6) Index: It is a decentralized storage structure created to speed up the retrieval of data rows in a table. The index is created for the table and is composed of index pages other than data pages. Each row in the index page contains a logical pointer to speed up the retrieval of physical data.

[0049] During the implementation of the embodiments of the present application, the applicant discovered that the related technology has the following problems:

[0050] The existing technical solution only optimizes the scrolling effect by reusing the document object model elements so that there will not be too many document object model element nodes corresponding to the data source in the view layer rendering process. However, the optimization effect is limited in the component initialization phase or when expanding a node with many child nodes.

[0051] In the prior art, the nodes that need to be displayed in the web page view include: the parent node of each layer associated with the entry node, and the child nodes of the parent node of each layer. That is, there will be many nodes to be displayed in the web page view, and the solution of the prior art will take a long time in the direct initialization stage, and the central processing unit (CPU) occupancy rate will be very high for a period of time.

[0052] The embodiments of the present application provide a method, apparatus, device and computer-readable storage medium for displaying a web page view, which can reduce loading time and improve loading efficiency when displaying a web page view. The following describes an exemplary application of the web page view display device provided by the embodiments of the present application. The web page view display device provided by the embodiments of the present application can be implemented as various types of user terminals such as laptop computers, tablet computers, desktop computers, set-top boxes, mobile devices (for example, mobile phones, portable music players, personal digital assistants, dedicated messaging devices, portable gaming devices), and can also be implemented as a server.

[0053] See also Figure 1 , Figure 1 It is an optional architecture diagram of a web page view-based display system 100 provided in an embodiment of the present application. To realize application scenarios of displaying web page views (for example, the application scenario of displaying web page views can be a web page display scenario in a web browser, such as web page content displayed in a web browser in the form of a web page view; a social network content display scenario, where the content of a social network is displayed in an APP in the form of a web page view, such as display of social dynamics, display of news pages, display of short videos, etc.), a terminal (terminal 400 is shown as an example) is connected to a server 200 via a network 300, and the network 300 can be a wide area network or a local area network, or a combination of the two.

[0054] The terminal 400 is used for the user to use the client 410, which is displayed on a graphical interface 410-1 (graphic interface 410-1 is shown as an example). The terminal 400 and the server 200 are connected to each other via a wired or wireless network.

[0055] In some embodiments, the server 200 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal 400 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal and the server may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application.

[0056] In some embodiments, after the terminal 400 establishes a tree structure including empty nodes and loads some node data of the tree structure, the terminal 400 sends a node data request of the web page view to the server 200 according to the user's operation on the graphical interface 410-1, and the server 200 feeds back the corresponding node data to the terminal 400. After receiving the node data, the terminal 400 fills the corresponding empty nodes with data and displays the tree structure filled with data in the graphical interface 410-1.

[0057] In other embodiments, after the terminal 400 establishes a tree structure including empty nodes and loads partial node data of the tree structure, the terminal 400 obtains corresponding node data in the relationship list stored in the terminal 400 according to the user's operation on the graphical interface 410-1, fills the corresponding empty nodes with data, and displays the filled tree structure in the graphical interface 410-1.

[0058] See also Figure 2 , Figure 2 is a structural diagram of a display terminal 400 for a web page view provided in an embodiment of the present application, Figure 2 The terminal 400 shown includes: at least one processor 410, a memory 450, at least one network interface 420 and a user interface 430. The various components in the terminal 400 are coupled together via a bus system 440. It is understood that the bus system 440 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 440 is not shown in FIG. Figure 2 Various buses are labeled as bus system 440 .

[0059] Processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0060] The user interface 430 includes one or more output devices 431 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.

[0061] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices that are physically remote from the processor 410.

[0062] The memory 450 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.

[0063] In some embodiments, memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.

[0064] Operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0065] A network communication module 452, for reaching other computing devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 include: Bluetooth, Wireless Compatibility Authentication (WiFi), and Universal Serial Bus (USB);

[0066] a presentation module 453 for enabling presentation of information via one or more output devices 431 (e.g., display screen, speaker, etc.) associated with the user interface 430 (e.g., a user interface for operating peripherals and displaying content and information);

[0067] The input processing module 454 is used to detect one or more user inputs or interactions from one of the one or more input devices 432 and translate the detected inputs or interactions.

[0068] In some embodiments, the web page view display device provided in the embodiments of the present application can be implemented in a software manner. Figure 2 A display device 455 of a web page view stored in a memory 450 is shown, which may be software in the form of a program or plug-in, including the following software modules: an acquisition module 4551, a first construction module 4552, a second construction module 4553, a data filling module 4554, and a display module 4555. These modules are logical and can therefore be arbitrarily combined or further split according to the functions implemented.

[0069] In other embodiments, the display device of the web page view provided in the embodiment of the present application can be implemented in hardware. As an example, the display device of the web page view provided in the embodiment of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the display method of the web page view provided in the embodiment of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs) or other electronic components.

[0070] In some embodiments, the terminal or server can implement the method for displaying the web page view provided in the embodiments of the present application by running a computer program. For example, the computer program can be a native program or software module in the operating system; it can be a native application (APP, Application), that is, a program that needs to be installed in the operating system to run, such as an instant messaging APP, a web browser APP; it can also be a small program, that is, a program that can be run only by downloading it to a browser environment; it can also be a small program that can be embedded in any APP. In short, the above-mentioned computer program can be an application, module or plug-in in any form.

[0071] Below, the method for displaying a web page view provided by the embodiment of the present application will be described in combination with the exemplary application and implementation of the terminal provided by the embodiment of the present application.

[0072] See also Figure 3A , Figure 3A is an optional flow chart of the method for displaying a web page view provided in the embodiment of the present application, which will be combined with Figure 3A Steps 101 to 106 are shown for explanation.

[0073] In step 101, the path of the target node in the tree structure of the webpage view is obtained.

[0074] The target node can be a node in the tree structure, and the path is a node sequence consisting of all nodes in the tree structure that connect the root node to the target node. For any two different nodes in a tree structure, if starting from one node, you can reach another node along the branches from top to bottom according to the hierarchy, there is a path between them. The path can be represented by the sequence of nodes that the path passes through, and the length of the path is equal to the number of nodes on the path minus 1.

[0075] The path of the target node includes a parent node at each level other than the level where the target node is located.

[0076] See also Figure 3B , Figure 3B is an optional flow chart of a method for displaying a web page view provided in an embodiment of the present application. Figure 3B Step 101 shown can be implemented through steps 1011 to 1012 .

[0077] In step 1011, the level where the target node is located is taken as the starting level of the path, and the level where the root node of the tree structure is located is taken as the ending level of the path, and the parent nodes of each level other than the level where the target node is located are obtained step by step in the direction from the starting level to the ending level.

[0078] For example, see Figure 4B , Figure 4B It is a schematic diagram of the principle of the web page view display method provided in an embodiment of the present application. The level of the root node 1 is 1, and the levels of other nodes except the root node 1 are equal to the level number of the parent node of the corresponding node plus 1.

[0079] As an example, see Figure 4B , take the level where the target node 7 is located as the starting level of the path, and take the level where the root node 1 of the tree structure is located as the ending level of the path, and obtain the parent node of each level except the level where the target node 7 is located step by step in the direction from the starting level to the ending level.

[0080] In step 1012 , based on the parent node and the target node at each level, a path of the target node in the tree structure of the web page view is constructed.

[0081] As an example, see Figure 4B , based on the parent node and target node 7 of each level, a path of target node 7 in the tree structure of the web page view is constructed. The path is composed of key nodes ( Figure 4B A node sequence composed of the key nodes shown in .

[0082] In this way, the parent nodes of each level outside the level where the target node is located are obtained step by step, and based on the parent nodes and target nodes of each level, the path of the target node in the tree structure of the web page view is constructed. Since the constructed path contains the parent nodes and target nodes of each level, the key nodes associated with the target node are obtained, which effectively reduces the number of non-key nodes and facilitates further saving of loading time in the future.

[0083] See also Figure 3B , before step 101, the target node is determined by executing steps 107 to 108.

[0084] In step 107, all end nodes of the tree structure of the webpage view are obtained.

[0085] The terminal node is a leaf node in the tree structure of the web page view. Figure 4B , obtain the end node (ie, leaf node) of the tree structure of the web page view, wherein node 7 and node 8 are both end nodes of the tree structure of the web page view.

[0086] In step 108, at least one end node of the tree structure of the web page view is determined as a target node. Figure 4B , node 7 in node 8 and node 7 in the tree structure of the web page view are determined as target nodes.

[0087] In step 102, a first subtree structure corresponding to the parent node of each level in the path is established, wherein all nodes in the first subtree structure except the root node of the first subtree structure are empty nodes.

[0088] See also Figure 3C , Figure 3C is an optional flow chart of a method for displaying a web page view provided in an embodiment of the present application. Figure 3C Step 102 shown can be implemented through steps 1021 to 1024 .

[0089] In step 1021, a parent node of any level is used as a root node of the corresponding first subtree structure.

[0090] As an example, see Figure 4B , the parent node of any level (for example, Figure 4B The node 2) shown is used as the root node of the first subtree structure corresponding to node 2.

[0091] In step 1022, the number of nodes in each level except the level where the root node is located in the first subtree structure is obtained.

[0092] As an example, see Figure 4B Taking node 2 as an example, obtain the number of nodes at each level except the level where the root node (i.e., node 2) is located in the first subtree structure corresponding to node 2, where the number of nodes at the level where the child nodes of node 2 are located is 3, and the number of nodes at the level where the child nodes of the child nodes of node 2 are located is 6.

[0093] In step 1023, each level in the first subtree structure except the level where the root node is located is filled with empty nodes equal to the number of nodes.

[0094] As an example, see Figure 4B , the level where the child nodes of node 2 are located is filled with 3 empty nodes, and the level where the child nodes of the child nodes of node 2 are located is filled with 6 empty nodes.

[0095] In step 1024, based on the root node of the first subtree structure and the empty nodes of each level in the first subtree structure except the level where the root node is located, a first subtree structure corresponding to the parent node of any level is constructed.

[0096] In some embodiments of step 1024, based on the root node of the first subtree structure, a level where the root node is located in the first subtree structure is constructed, and the following processing is performed for the empty nodes in any level of the first subtree structure except the level where the root node is located: based on the empty nodes in any level of the first subtree structure except the level where the root node is located, a level in the first subtree structure corresponding to the empty nodes in any level is constructed.

[0097] As an example, see Figure 4B Based on the root node of the first subtree structure (i.e., node 2) and the empty nodes at each level in the first subtree structure except the level where the root node (i.e., node 2) is located (for example, the three empty nodes in the level where the child nodes of node 2 are located), a first subtree structure 21 corresponding to node 2 is constructed.

[0098] Since empty nodes do not contain node data, the time consumed in loading node data can be effectively saved while ensuring the integrity of the tree structure.

[0099] In step 103, a second subtree structure is established based on the first subtree structure and the target node, and an initial page of the webpage view is displayed based on the second subtree structure.

[0100] In some embodiments of step 103, a first part of a second subtree structure is established based on a first subtree structure where a target node is located; a second part of a second subtree structure is established based on a first subtree structure where no target node exists; and a second subtree structure is established based on the first part of the second subtree structure and the second part of the second subtree structure.

[0101] For example, a second subtree structure is established based on the first subtree structure 21, other first subtree structures and the target node 7, and the initial page of the webpage view (i.e., the initial page of the webpage view) is displayed based on the second subtree structure. Figure 4B The initial page consists of the tree structure shown in ).

[0102] In step 104, according to the operation on the webpage view, the node data corresponding to the current page of the webpage view is obtained.

[0103] For example, operations on a web page view may include scrolling, up / down (single or multiple lines) scrolling, page switching, and previous / next page operations, etc. A web page view may include multiple pages, for example, a web page view includes multiple history pages and a current page.

[0104] As an example, when the operation on the web page view is a scrolling operation, according to the scrolling operation on the web page view, multiple pages in the web page view are turned accordingly (i.e., jumping from one page to another). When the scrolling operation on the page view stops, the turning of pages of the web page view stops accordingly. The page displayed at the stopping point is the current page. The nodes that need to be displayed on the current page are recalculated, and the node data corresponding to the current page of the web page view is obtained.

[0105] As an example, when the operation on the web page view is an upward single-line scrolling operation, each time the upward single-line scrolling operation is triggered, the web page view updates the page, and the page after the triggering will cancel the display of the top row of data in the page before the triggering, and move each row of data except the top row of data in the page before the triggering up by one row, and add a row of data to the bottom of the page before the triggering. At this time, the current page is the page after the trigger, and the nodes that need to be displayed on the current page are recalculated, and the node data corresponding to the current page of the web page view is obtained.

[0106] As an example, when the operation on the web page view is the previous page operation, each time the previous page operation is triggered, the web page view updates the current page to the previous page of the current page (it should be noted that the current page and the history page are relative time concepts. It can be understood that after the update, the above-mentioned current page is converted to the history page, and the previous page of the above-mentioned current page is converted to the current page), recalculates the nodes that need to be displayed on the current page, and obtains the node data corresponding to the current page of the web page view.

[0107] Since the screen size of the terminal is limited, the content directly displayed in front of the user is also quite limited. When multiple pages are displayed and the content displayed on the current screen is one of the pages, the user can view content other than that displayed on the current screen by operating the web view. The web view is a view that can scroll to display content. It can be used to display the content of multiple pages, and all content can be viewed through operations on the web view. Content that exceeds the boundary of the web view will be automatically hidden, and the hidden content that exceeds the boundary of the web view will be displayed according to the operations on the web view.

[0108] For example, the operation on the web page view may be a page sliding operation on the web page view, and by responding to the page sliding operation on the web page view, page turning display is realized in the page of the web page view. The page sliding operation on the web page view may be an upward page sliding operation (toward the home page direction of the web page view) or a downward page sliding operation (toward the end page direction of the web page view).

[0109] For example, when the operation on the web page view is stopped, the page displayed in the web page view is the current page of the web page view, so that the node data corresponding to the current page of the web page view is obtained.

[0110] See also Figure 3D , Figure 3D is an optional flow chart of a method for displaying a web page view provided in an embodiment of the present application. Figure 3D Step 104 shown can be implemented through steps 1041 to 1043 .

[0111] In step 1041 , according to the operation on the webpage view, the index of the starting node of the current page and the number of nodes corresponding to the current page are determined.

[0112] The index represents the position of a node in the tree structure.

[0113] As an example, see Figure 4B , according to the operation on the web page view, determine the index of the starting node of the current page (for example, node 3) and the number of nodes corresponding to the current page (for example, the number of nodes corresponding to the current page is 12).

[0114] In step 1042, the end node of the current page is determined according to the index of the start node of the current page and the number of nodes corresponding to the current page.

[0115] As an example, see Figure 4B , determine the end node of the current page (e.g., node 4) according to the index of the starting node of the current page (e.g., node 3) and the number of nodes corresponding to the current page (e.g., the number of nodes corresponding to the current page is 12). The number of nodes at the level where node 3 is located is 3, and the number of nodes at the level where node 4 is located is 9. The sum of the number of nodes at the level where node 3 is located and the number of nodes at the level where node 4 is located is the number of nodes corresponding to the current page (e.g., as before, the number of nodes corresponding to the current page is 12).

[0116] In step 1043, node data corresponding to the current page is obtained according to the start node of the current page and the end node of the current page.

[0117] As an example, see Figure 4B , according to the starting node of the current page (for example, node 3) and the ending node of the current page (for example, node 4), obtain the node data corresponding to the current page (for example, the node data corresponding to the 12 nodes from node 3 to node 4).

[0118] In this way, by determining the starting node and the ending node of the current page, all nodes that need to be displayed in the current page are determined, and the node data corresponding to the current page is obtained, thereby saving the time spent on loading other node data except the current page.

[0119] In some embodiments, the above step 1043 can be implemented in the following way: based on the starting node of the historical page, the ending node of the historical page and the historical node data request, a mapping relationship list is established; when the starting node of the current page and the ending node of the current page exist in the mapping relationship list, the node data corresponding to the current page is obtained from the mapping relationship list.

[0120] For example, in response to the operation of the web page view, as the web page view page turns, a history page is continuously generated, and the history page includes a start node of the history page, an end node of the history page, and a data request of the history page. A mapping relationship list can be established based on the start node of the history page, the end node of the history page, and the data request of the history node, and the mapping relationship list can be cached locally in the terminal, wherein the mapping relationship list represents the mapping relationship between the start node of the history page, the end node of the history page, and the data request of the history page.

[0121] For another example, when the operation on the web page view includes both an upward (toward the home page direction of the web page view) sliding page operation and a downward (toward the end page direction of the web page view) sliding page operation, then in the process of sliding page operation, it will slide to a repeated node (that is, the starting node of the historical page is the same as the starting node of the current page, or the ending node of the historical page is the same as the ending node of the current page). That is, in the mapping relationship list established based on the starting node of the historical page, the ending node of the historical page and the historical node data request, there will be the starting node of the current page and the ending node of the current page. When the starting node of the current page and the ending node of the current page exist in the mapping relationship list, according to the mapping relationship between the starting node of the historical page, the ending node of the historical page and the data request of the historical page in the mapping relationship list, the node data corresponding to the current page is obtained from the mapping relationship list.

[0122] In this way, by obtaining the node data corresponding to the current page from the mapping relationship list, it is effectively avoided to repeatedly obtain node data from the server for the same web page view page, effectively saving the delay caused by obtaining node data from the server and improving loading efficiency.

[0123] In some embodiments, the above step 1043 can be implemented in the following way: when the starting node and the ending node of the current page do not exist in the mapping relationship list, a node data request for the current page is sent to the server, and the node data corresponding to the current page returned by the server is received.

[0124] For example, when the operation on the web page view is only an upward (toward the home page direction of the web page view) sliding page operation, or only a downward (toward the end page direction of the web page view) sliding page operation, then in the process of sliding page operation, it will not slide to repeated nodes (that is, the starting node of the historical page will not be the same as the starting node of the current page, or the ending node of the historical page will not be the same as the ending node of the current page). That is, the starting node of the current page and the ending node of the current page will not exist in the mapping relationship list established based on the starting node of the historical page, the ending node of the historical page and the historical node data request. When the starting node of the current page and the ending node of the current page do not exist in the mapping relationship list, it is impossible to obtain the node data corresponding to the current page from the mapping relationship list, so as to send a node data request for the current page to the server, and receive the node data corresponding to the current page returned by the server.

[0125] In this way, when the start node and the end node of the current page do not exist in the mapping relationship list, a node data request for the current page is sent to the server to obtain the corresponding node data from the server. This ensures that the corresponding node data can be obtained normally even when the current page is a web page view page that has never appeared before.

[0126] In some embodiments, the above-mentioned sending of a node data request for the current page to the server and receiving the node data corresponding to the current page returned by the server can be achieved in the following manner: determining the sum of the number of node data requests for the current page and the number of node data requests in the request queue; when the sum of the numbers is less than the number threshold, loading the multiple node data requests to the end of the request queue in the order of generation time; when the sum of the numbers is greater than the number threshold, removing the target number of node data requests in the request queue from the request queue in a first-in-first-out manner, and loading the multiple node data requests to the end of the request queue in the order of generation time; wherein the number threshold is the number of node data requests that need to be sent to fully display the current page; sending the node data requests in the request queue and clearing the request queue, and receiving the node data corresponding to the current page returned by the server based on the sent node data requests.

[0127] For example, before sending a node data request for the current page to the server, a node data request for the current page will be generated, wherein at least one node corresponds to one node data request (for example, one node corresponds to one node data request). If there are multiple nodes in the current page, multiple node data requests will be generated.

[0128] For example, the number of multiple node data requests for the current page is 5, the number of node data requests in the request queue is 3, and the sum of the number of multiple node data requests for the current page and the number of node data requests in the request queue is 8. When the sum is less than the quantity threshold (for example, the data threshold is 12), the multiple node data requests are loaded to the end of the request queue in the order of generation time. After loading, the number of node data requests in the request queue is 8.

[0129] For example, the number of nodes corresponding to the current page is 12, which means that a page can display at most 12 nodes, and the number threshold is consistent with the number of nodes corresponding to the current page, that is, the number threshold represents the maximum number of nodes that can be displayed in a page, and at least one node corresponds to a node data request. The maximum number of nodes that can be displayed in a page also reflects the maximum number of node data requests that need to be sent for a page, that is, the number threshold is the number of node data requests that need to be sent to fully display the current page. Thus, the node data request in the request queue is sent and the request queue is cleared, waiting for the next node data request to be loaded into the request queue. After sending the node data request, the node data corresponding to the current page returned by the receiving server according to the sent node data request.

[0130] For example, the generation time of the first node data is 16:30 and the generation time of the second node data is 16:31. According to the order of generation time, the first node data is first loaded to the end of the request queue, and after loading, the end of the request queue is updated to the first node data, and then the second node data is loaded to the end of the request queue, and after loading, the end of the request queue is updated to the second node data.

[0131] In this way, a certain number of node data requests to be sent are loaded through the request queue, thereby avoiding sending too many node data requests in the same time period, thereby effectively controlling the number of node data requests sent and avoiding sending invalid node data requests (that is, since the node data obtained based on the node data requests sent within the historical time period will not be displayed on the current web view page, the node data requests sent within the historical time period are invalid node data requests).

[0132] In step 105, data is filled in the second subtree structure based on the node data to obtain a third subtree structure.

[0133] In some embodiments, the above step 105 fills the empty nodes corresponding to the node filling data in the second subtree structure with data based on the node data to obtain the third subtree structure, which can be implemented in the following manner: fill the empty nodes corresponding to the node data in the second subtree structure with data based on each node data to obtain a node including the node data. Construct the third subtree structure based on the node including the node data and the target node.

[0134] As an example, see Figure 4B, based on each node data, the empty nodes corresponding to the node data in the second subtree structure (for example, node 2, node 3, and all empty nodes at the level where node 4 is located) are filled with data to obtain nodes including node data (for example, node 2 including node data, node 3 including node data, and all nodes including node data at the level where node 4 is located).

[0135] In this way, by filling the third subtree structure with data, it is avoided to load the node data corresponding to all nodes in the tree structure, effectively reducing the amount of loaded node data, thereby effectively reducing the loading time when displaying the web page view and improving the loading efficiency.

[0136] In step 106, the current page is displayed based on the third subtree structure.

[0137] For example, the node data of each node in the third subtree structure and the association relationship between the nodes in the third subtree structure (for example, the parent node and the child node corresponding to each node) are displayed in the current page.

[0138] In this way, since the second subtree structure contains empty nodes in the first subtree structure, according to the operation on the web page view, the corresponding node data in the second subtree structure is filled with data based on the node data corresponding to the current page obtained, and the resulting third subtree structure only loads the nodes containing node data of the current page, effectively reducing the number of loaded nodes, effectively reducing the loading time when displaying the web page view, and improving loading efficiency.

[0139] Below, an exemplary application of the embodiment of the present application in an application scenario of a web browser will be described.

[0140] In the application scenario of a web browser, a user browsing a web page browses a hierarchical directory structure in the web browser, for example, browsing N layers of sub-web pages under a main web page, browsing N layers of sub-folders under a parent folder, etc. The web browser displays the corresponding hierarchical directory structure in the web browser in response to the corresponding operation of the user.

[0141] In a web browser application scenario, see Figure 4A , Figure 4A It is a schematic diagram of the principle of the method for displaying a web page view provided in an embodiment of the present application.

[0142] In step 401, enter node 4299.

[0143] That is, the data layer of the web browser enters node 4299.

[0144] In step 402, a 4299 path [4299, 4210, 4211 ...] is obtained.

[0145] In step 403, the details of [4299, 4210, 4211 ...] are obtained, and the subscript indexes of these nodes in the child nodes of the parent node are obtained according to the screening condition.

[0146] That is, the data layer of the web browser obtains the details of the path {node 4299, node 4210, node 4211...} of node 4299, where node 4210 is the parent node of node 4299, and node 4211 is the parent node of node 4210, until tracing back to node 1. And according to the screening conditions, the subscripts (index) of these nodes in the child nodes of the root node (i.e., the index described above) are obtained, that is, the position of the path {node 4299, node 4210, node 4211...} in the child nodes of parent node 1 is obtained, and the subscript (index) represents the relative position relationship.

[0147] In step 404, a tree is constructed according to the count of direct subfolders of each node, and nodes other than the nodes in the path are filled with blanks (itemDataBlank=true).

[0148] The data layer of the web browser establishes a tree structure corresponding to each node according to the number of child nodes corresponding to each node in the path {node 4299, node 4210, node 4211...}. The nodes outside the path {node 4299, node 4210, node 4211}, that is, the child nodes of the path {node 4299, node 4210, node 4211...} are established in the form of empty placeholders {empty placeholder parameter (itemDataBlank) is true (true)}, where the empty placeholder means that the node data in the node is an empty value, or the node data in the node is initialized data rather than the final data of the node.

[0149] In step 405, treeview.refreshLayout is called. When itemDataBlank=true, a placeholder is first placed on the view, and an event 'cmd_treeview_getTreeData' is emitted with the parameters of index and parentld.

[0150] The rendering layer of the web browser calls the pull-down refresh function (treeview.refreshLayout). When the empty placeholder parameter itemDataBlank is true, the web view is first occupied. At the same time, the rendering layer of the web browser sends a data acquisition event (cmd_treeview_getTreeData) to the data layer of the web browser, where the parameter of the data acquisition event is index.parentld.

[0151] In step 406, treeviewpanel receives the event cmd_treeview_getTreeData, calculates offset through index and pagecount, and finds the key of promise = offset + 'I' + parentld.

[0152] After the grouping control (treeviewpanel) in the data layer of the web browser receives the event with the parameter cmd_treeview_getTreeData sent by the rendering layer of the web browser, the data layer of the web browser calculates the length (offset) of the current page data set through the index (index) and the number of data on each page in the web page (pagecount), and calculates the key parameter (key) in the state function (promise) of the web page, where key = offset + I + parentld, and the key parameter (key) represents that the data layer of the web browser determines the parameters of the calling interface after receiving the event with the parameter cmd_treeview_getTreeData.

[0153] In step 407, determine whether key is in _getChildPromiseMap_.

[0154] The data layer of the web browser determines whether the key parameter (key) is in the mapping relationship list (_getChildPromiseMap_) (ie, the mapping relationship list mentioned above).

[0155] In step 408, _getChildPromiseMap_[key] = {key; key, promise:getNodeChildrenByQuery(...), status:waiting}.

[0156] If the key parameter (key) is not in the mapping relationship list (_getChildPromiseMap_), the following operations are performed: _getChildPromiseMap_[key] = {key; key, promise: getNodeChildrenByQuery(...), status: waiting}. If the key parameter (key) is in the mapping relationship list (_getChildPromiseMap_), the following operations are not performed: _getChildPromiseMap_[key] = {key; key, promise: getNodeChildrenByQuery(...), status: waiting}.

[0157] In step 409, it is determined whether the state of the promise is resolved.

[0158] In step 410, the promise object is not pushed into the queue _getChildpromisepedding List_.

[0159] In step 411, the promise object is pushed into the queue _getChildpromisepedding List_.

[0160] The data layer of the web browser determines whether the state of the state function (promise) is in the completed state (resolved). If it is not in the completed state (resolved), the object of the state function (promise) (data acquisition request) is pushed into the queue _getChildpromisepedding List_ (that is, the request queue above). If it is in the completed state (resolved), the object of the state function (promise) (data acquisition request) is not pushed into the queue _getChildpromisepedding List_ (that is, the request queue above).

[0161] In step 412, it is determined whether the length of _getChildpromisepedding List_ is greater than MAX_XHR.

[0162] In step 413, the first item of getChildpromisepedding List is retrieved, the cancel method of promise is called and status=cancel is set.

[0163] The data layer of the web browser determines whether the length of the data acquisition request in the queue (_getChildPromisePeddingList_) is greater than the threshold (i.e., the data threshold mentioned above) (MAX_XHR). If the length of the data acquisition request in the queue (_getChildPromisePeddingList_) is greater than the threshold (MAX_XHR), the first data acquisition request in the queue (_getChildPromisePeddingList_) is taken out, the delete method of the state function (promise) is called and the current state (status) is set to the cancel state (cancel). If the length of the queue (_getChildPromisePeddingList_) is less than the threshold (MAX_XHR), the first data acquisition request in the queue (_getChildPromisePeddingList_) is not taken out.

[0164] In step 414, the promise in getChildPromisePeddingList_ is queued, the treeview data source is updated in promise.then and treeview.refreshLayout is called, and the status of the promise is set to resolved.

[0165] The data layer of the web browser updates the status parameter (promise.then) of the data acquisition request in the queue (_getChildPromisePeddingList_), the rendering layer of the web browser calls the tree control (treeview) to render and display the rendering layer, and calls the pull-down refresh function (treeview.refreshLayout), and then sets the status (status) of the status function (promise) to the completed status (resolve).

[0166] See also Figure 4B , first enter node 7, and trace the path of node 7 through node 7 to the root node 1 of the tree structure (i.e. Figure 4B The path composed of key nodes in .

[0167] Then, for each node in the path, obtain the position of each node in the child nodes of its parent node. Then, an empty tree structure is established based on the key nodes (i.e. Figure 4B The data structure of the key nodes is as follows: {id:Number,name:String,parentId:Number,permission:Number,iconUrl:String,isEmpty:false}. The data structure of the key nodes is determined by the backend data. The data structure of the empty node is as follows: {isEmpty:true,parentId:Number}. The data structure of the empty node is generated by the front-end component itself. It mainly serves as a data placeholder and waits to fill in the data after responding to the user's operation.

[0168] During the first rendering process of the rendering layer of the web browser, when an empty node is encountered, an event is sent to the data layer of the tree view control (treeView) through the rendering layer of the tree view control (treeView). A network request queue is maintained in the data layer of the tree view control (treeView), and a network request is pushed into the queue after receiving an event sent by the rendering layer. At the same time, a maximum number of requests at the same time is set. For example, the maximum number of requests at the same time can be 6, so that a network request call is issued. Whether the network request succeeds or fails, the corresponding network request in the queue will be consumed.

[0169] The network request that is removed from the queue will be manually canceled (that is, the network request will not be sent), and the successfully executed network request will update the data source of the tree view control (treeView) during the successful callback process and allow the tree view control (treeView) to render again.

[0170] In some usage scenarios that require collaboration, data may be missing and collaboration may be lost during the life cycle of a certain use. The embodiment of the present application can push all data changes of the tree view control (treeView) by a full-duplex communication protocol (websocket) based on TCP after the tree view control (treeView) is initialized, thereby solving the problem of data missing and collaboration loss during the life cycle of a certain use.

[0171] Below, the superior performance of the embodiment of the present application is illustrated by comparing the prior art with the technical solution provided by the embodiment of the present application.

[0172] In the prior art solution, see Figure 4C , Figure 4C A schematic diagram of the principles of a method for displaying a web page view provided in an embodiment of the present application.

[0173] In the prior art, when a tree data structure (i.e., the tree structure described above) has many nodes, it is required to enter from a deeper level node (e.g., a leaf node) (e.g., Figure 4C , enter this node). However, the nodes that need to be displayed on the page are located at a shallower level (see Figure 4C , nodes that need to be displayed on the page), where the nodes that need to be displayed on the page include: the parent nodes of each level associated with the entry node, and the child nodes of the parent nodes of each level. Then, the number of nodes displayed on the page will be relatively large, and it will take a long time to load the nodes.

[0174] Next, the prior art is provided. For example, the tree structure has 5 layers, each layer of the tree structure has 1300 nodes, and the loading time of the tree view control (treeView) is counted level by level. The loading time in the prior art is shown in Table 1 below.

[0175] Table 1 Loading time of tree view control (treeView) in the prior art (the tree structure has 5 layers, and each layer of the tree structure has 1300 nodes)

[0176]

[0177]

[0178] For another example, the tree structure has 5 layers, each layer of the tree structure has 6300 nodes, and the loading time of the tree View control is counted level by level. The loading time in the prior art is shown in Table 2 below.

[0179] Table 2 Loading time of tree view control (treeView) in the prior art (the tree structure has 5 layers, and each layer of the tree structure has 6300 nodes)

[0180]

[0181]

[0182] In the prior art solution, see Figure 4D , Figure 4D Schematic diagram of the principle of the method for displaying a web page view provided in the embodiment of the present application. Figure 4D In the prior art, the loading time reaches 4881ms, and the CPU occupancy rate is high.

[0183] As an example, see Figure 4D ,exist Figure 4D The test tool interface shown includes: an interface for selecting a test project ( Figure 4D The left interface of the test results ( Figure 4D on the right side of the interface).

[0184] In the interface showing the test results, the total loading time of the existing technology is 4881ms, downloading time is 1ms, scripting time is 2997ms, submission time is 19ms, rendering time is 3ms, system time is 35ms, and idling time is 1826ms.

[0185] In the prior art solution, see Figure 4E , Figure 4E Schematic diagram of the principle of the method for displaying a web page view provided in the embodiment of the present application. Figure 4E In the example, when the tree structure has 5 layers and each layer of the tree structure has 1300 nodes, the CPU occupancy rate of the prior art is still very high.

[0186] As an example, see Figure 4E ,exist Figure 4E The test tool interface shown includes: an interface for selecting a test project ( Figure 4E The left interface of the test results ( Figure 4E on the right side of the interface).

[0187] In the interface showing the test results, when the tree structure has 5 layers and each layer of the tree structure has 1300 nodes, the total loading time of the existing technology is 3469ms, the downloading time is 3ms, the scripting time is 1876ms, the submission time is 66ms, the rendering time is 8ms, the system time is 49ms, and the idling time is 1467ms.

[0188] In the embodiment of the present application, the performance of the initialization, expansion and other scenarios is optimized by controlling the number of nodes loaded each time. Figure 4F , Figure 4F is a schematic diagram of the principle of the method for displaying a web page view provided in an embodiment of the present application. Figure 4F In the example, the test data of the method for displaying a web page view provided in the embodiment of the present application is as follows: Figure 4F As shown, the loading time of the web page view display method provided in the embodiment of the present application is 3454 ms (significantly shorter than the loading time of 4881 ms in the prior art).

[0189] As an example, see Figure 4F ,exist Figure 4F The test tool interface shown includes an interface for displaying test results.

[0190] In the interface displaying the test results, the loading time of the web page view display method provided in the embodiment of the present application is 3454ms, the downloading time is 61ms, the scripting time is 1290ms, the submission time is 262ms, the rendering time is 33ms, the system time is 234ms, and the idling time is 1574ms.

[0191] In the prior art solution, see Figure 4G , Figure 4G Schematic diagram of the principle of the method for displaying a web page view provided in the embodiment of the present application. Figure 4G In the embodiment of the present invention, when the tree structure has 5 layers and each layer of the tree structure has 10,000 nodes, the loading time of the web page view display method provided by the embodiment of the present application is 9276ms. Compared with the prior art, the loading time within the unit node is significantly shortened, and compared with the prior art, the CPU occupancy rate is significantly reduced.

[0192] As an example, see Figure 4G ,exist Figure 4G The test tool interface shown includes an interface for displaying test results.

[0193] In the interface displaying the test results, when the tree structure has 5 layers and each layer of the tree structure has 10,000 nodes, the loading time of the web page view display method provided in the embodiment of the present application is 9276ms, the downloading time is 8ms, the scripting time is 605ms, the submission time is 808ms, the rendering time is 104ms, the system time is 152ms, and the idling time is 7600ms.

[0194] In the web page view display method provided in the embodiment of the present application, for example, the tree structure has 5 layers, each layer of the tree structure has 1300 nodes, and the loading time of the tree view control (treeView) is counted level by level. The loading time of the web page view display method provided in the embodiment of the present application is shown in Table 3 below.

[0195] Table 3 Loading time of the tree view control (treeView) of the web page view display method provided in the embodiment of the present application (the tree structure has 5 layers, and each layer of the tree structure has 1300 nodes)

[0196]

[0197] It is obvious from the data in Table 1 and Table 3 that the loading time of the tree view control (treeView) of the web page view display method provided in the embodiment of the present application is significantly shorter than that of the prior art.

[0198] In the web page view display method provided in the embodiment of the present application, for example, the tree structure has 5 layers, each layer of the tree structure has 6300 nodes, and the loading time of the tree view control (treeView) is counted level by level. The loading time of the web page view display method provided in the embodiment of the present application is shown in Table 4 below.

[0199] Table 4 Loading time of the tree view control (treeView) of the web page view display method provided in the embodiment of the present application (the tree structure has 5 layers, and each layer of the tree structure has 6300 nodes)

[0200]

[0201] It is obvious from the data in Table 2 and Table 4 above that the loading time of the tree view control (treeView) of the web page view display method provided in the embodiment of the present application is significantly shorter than that of the prior art.

[0202] The following is a description of an exemplary structure of a web page view display device 455 provided in an embodiment of the present application implemented as a software module. In some embodiments, for example, Figure 2As shown, the software modules in the display device 455 of the web page view stored in the memory 440 may include: an acquisition module 4551, used to acquire the path of the target node in the tree structure of the web page view; a first construction module 4552, used to establish a first subtree structure corresponding to the parent node of each level in the path, wherein all nodes in the first subtree structure except the root node of the first subtree structure are empty nodes; a second construction module 4553, used to establish a second subtree structure based on the first subtree structure and the target node, and display the initial page of the web page view based on the second subtree structure; a data filling module 4554, used to acquire node data corresponding to the current page of the web page view according to the operation on the web page view, and fill the second subtree structure with data based on the node data to obtain a third subtree structure; a display module 4555, used to display the current page based on the third subtree structure.

[0203] In some embodiments, the data filling module 4554 is also used to determine the index of the starting node of the current page and the number of nodes corresponding to the current page based on the operation on the web page view; determine the ending node of the current page based on the index of the starting node of the current page and the number of nodes corresponding to the current page; and obtain the node data corresponding to the current page based on the starting node of the current page and the ending node of the current page.

[0204] In some embodiments, the data filling module 4554 is also used to establish a mapping relationship list based on the starting node of the historical page, the ending node of the historical page and the historical node data request; when the starting node of the current page and the ending node of the current page exist in the mapping relationship list, the node data corresponding to the current page is obtained from the mapping relationship list.

[0205] In some embodiments, the data filling module 4554 is also used to send a node data request for the current page to the server when the starting node of the current page and the ending node of the current page do not exist in the mapping relationship list, and receive the node data corresponding to the current page returned by the server.

[0206] In some embodiments, the data filling module 4554 is also used to determine the sum of the number of node data requests for the current page and the number of node data requests in the request queue; when the sum is less than the quantity threshold, the multiple node data requests are loaded to the end of the queue in the order of generation time; when the sum is greater than the quantity threshold, the target number of node data requests in the request queue are removed from the request queue in a first-in-first-out manner, and the multiple node data requests are loaded to the end of the request queue in the order of generation time; wherein the quantity threshold is the number of node data requests that need to be sent to fully display the current page; the node data requests in the request queue are sent and the request queue is cleared, and the node data corresponding to the current page returned by the receiving server based on the sent node data requests.

[0207] In some embodiments, the acquisition module 4551 is also used to use the level where the target node is located as the starting level of the path, and the level where the root node of the tree structure is located as the ending level of the path, and to obtain the parent nodes of each level outside the level where the target node is located step by step from the starting level to the ending level; based on the parent node and target node of each level, construct the path of the target node in the tree structure of the web page view.

[0208] In some embodiments, the first construction module 4552 is also used to obtain the number of nodes in each level of the first subtree structure except the level where the root node is located; fill each level of the first subtree structure except the level where the root node is located with empty nodes equal to the number of nodes; based on the root node of the first subtree structure and the empty nodes in each level of the first subtree structure except the level where the root node is located, construct a first subtree structure corresponding to the parent node of any level.

[0209] In some embodiments, the data filling module 4554 is also used to fill the empty nodes corresponding to the node data in the second subtree structure with data based on each node data to obtain a node including the node data; and construct a third subtree structure based on the node including the node data and the target node.

[0210] In some embodiments, the web page view display device further includes: a determination module, configured to obtain all end nodes of the tree structure of the web page view; and determine at least one end node of the tree structure of the web page view as a target node.

[0211] An embodiment of the present application provides a display device for a web page view, including: a memory for storing executable instructions; and a processor for executing the executable instructions stored in the memory to implement the display method for the web page view provided in the embodiment of the present application.

[0212] An embodiment of the present application provides a computer-readable storage medium storing executable instructions for causing a processor to execute instructions to implement a method for displaying a web page view provided in an embodiment of the present application.

[0213] The embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the web page view display method described in the embodiment of the present application.

[0214] An embodiment of the present application provides a computer-readable storage medium storing executable instructions, wherein executable instructions are stored. When the executable instructions are executed by a processor, the processor will execute the web page view display method provided by the embodiment of the present application, for example, the web page view display method shown in Figure 3.

[0215] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or it may be various devices including one or any combination of the above memories.

[0216] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0217] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0218] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.

[0219] In summary, the embodiments of the present application have the following beneficial effects:

[0220] (1) Since the second subtree structure contains the empty nodes in the first subtree structure, according to the operation on the web page view, the corresponding node data in the second subtree structure is filled with data based on the node data corresponding to the current page obtained, and the obtained third subtree structure only loads the nodes containing the node data of the current page, which effectively reduces the number of nodes loaded, effectively saves the loading time of displaying the web page view, and improves the loading efficiency.

[0221] (2) The parent nodes of each level outside the level where the target node is located are obtained step by step, and based on the parent nodes and target nodes of each level, the path of the target node in the tree structure of the web page view is constructed. Since the constructed path contains the parent nodes and target nodes of each level, the key nodes associated with the target node are obtained, which effectively reduces the number of non-key nodes and facilitates further saving of loading time in the future.

[0222] (3) Since empty nodes do not contain node data, the time consumed in loading node data can be effectively saved while ensuring the integrity of the tree structure.

[0223] (4) By determining the starting node and the ending node of the current page, all nodes that need to be displayed in the current page are determined, and only the node data corresponding to the current page is obtained, thereby saving the time of loading other node data except the current page.

[0224] (5) By obtaining the node data corresponding to the current page from the mapping relationship list, it is effectively avoided to repeatedly obtain node data from the server for the same web view page, effectively saving the delay caused by obtaining node data from the server and improving loading efficiency.

[0225] (6) When the start node and the end node of the current page do not exist in the mapping relationship list, a node data request for the current page is sent to the server to obtain the corresponding node data from the server. This ensures that the corresponding node data can be obtained normally even when the current page is a web page view page that has never appeared before.

[0226] (7) By loading a certain number of node data requests to be sent through the request queue, it is avoided that too many node data requests are sent in the same time period, thereby effectively controlling the number of node data requests sent and avoiding sending invalid node data requests.

[0227] (8) By filling the third subtree structure with data, it is avoided to load the node data corresponding to all nodes in the tree structure, effectively reducing the amount of loaded node data, thereby effectively reducing the loading time when displaying the web page view and improving the loading efficiency.

[0228] The above are only embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims

1. A method for displaying a web page view, characterized in that: include: Obtaining the path of the target node in the tree structure of the web page view; The following processing is performed for the parent node of any level in the path: Taking the parent node of any one level as the root node of the corresponding first subtree structure; Obtain the number of nodes at each level in the first subtree structure except the level where the root node is located; Filling each level of the first subtree structure except the level where the root node is located with empty nodes equal to the number of nodes; Based on the root node of the first subtree structure and the empty nodes of each level in the first subtree structure except the level where the root node is located, construct a first subtree structure corresponding to the parent node of any level respectively; Establishing a second subtree structure based on the first subtree structure and the target node, and displaying an initial page of the webpage view based on the second subtree structure; According to the operation on the webpage view, node data corresponding to the current page of the webpage view is obtained, and data is filled in the second subtree structure based on the node data to obtain a third subtree structure; The current page is displayed based on the third subtree structure.

2. The method according to claim 1, characterized in that The acquiring, according to the operation on the webpage view, node data corresponding to the current page of the webpage view comprises: Determine, according to the operation on the webpage view, the index of the starting node of the current page and the number of nodes corresponding to the current page; Determine the end node of the current page according to the index of the start node of the current page and the number of nodes corresponding to the current page; According to the start node of the current page and the end node of the current page, node data corresponding to the current page is acquired.

3. The method according to claim 2, characterized in that The acquiring node data corresponding to the current page according to the starting node of the current page and the ending node of the current page includes: Establishing a mapping relationship list based on the start node of the historical page, the end node of the historical page and the historical node data request; When the mapping relationship list contains the start node of the current page and the end node of the current page, the node data corresponding to the current page is acquired from the mapping relationship list.

4. The method according to claim 3, characterized in that The acquiring node data corresponding to the current page according to the starting node of the current page and the ending node of the current page includes: When the starting node of the current page and the ending node of the current page do not exist in the mapping relationship list, a node data request for the current page is sent to the server, and the node data corresponding to the current page returned by the server is received.

5. The method according to claim 4, characterized in that The sending a node data request for the current page to the server and receiving the node data corresponding to the current page returned by the server includes: Determine the sum of the number of node data requests for the current page and the number of node data requests in the request queue; When the sum of the quantities is less than the quantity threshold, the multiple node data requests are loaded to the end of the request queue in the order of generation time; When the sum of the quantities is greater than the quantity threshold, the target quantity of node data requests in the request queue are removed from the request queue in a first-in-first-out manner, and the multiple node data requests are loaded to the end of the request queue in the order of generation time; The quantity threshold is the number of node data requests that need to be sent to fully display the current page; The node data request in the request queue is sent and the request queue is cleared, and the node data corresponding to the current page and returned by the server according to the sent node data request is received.

6. The method according to claim 1, characterized in that The obtaining of the path of the target node in the tree structure of the webpage view includes: The level where the target node is located is used as the starting level of the path, and the level where the root node of the tree structure is located is used as the ending level of the path, and the parent nodes of each level other than the level where the target node is located are obtained step by step from the starting level to the ending level; Based on the parent node of each level and the target node, a path of the target node in the tree structure of the webpage view is constructed.

7. The method according to claim 1, characterized in that The step of filling the second subtree structure with data based on the node data to obtain a third subtree structure includes: Filling data on empty nodes corresponding to the node data in the second subtree structure based on each of the node data to obtain a node including the node data; The third subtree structure is constructed based on the node including the node data and the target node.

8. The method according to claim 1, characterized in that Before obtaining the path of the target node in the tree structure of the webpage view, the method further includes: Obtain all terminal nodes of the tree structure of the web page view; At least one of the terminal nodes of the tree structure of the webpage view is determined as the target node.

9. A web page view display device, characterized in that: include: An acquisition module, used to acquire a path of a target node in the tree structure of the web page view; The first construction module is used to perform the following processing on the parent node of any level in the path: taking the parent node of any level as the root node of the corresponding first subtree structure; obtaining the number of nodes of each level in the first subtree structure except the level where the root node is located; Filling each level of the first subtree structure except the level where the root node is located with empty nodes equal to the number of nodes; Based on the root node of the first subtree structure and the empty nodes of each level in the first subtree structure except the level where the root node is located, construct a first subtree structure corresponding to the parent node of any level respectively; a second construction module, configured to establish a second subtree structure based on the first subtree structure and the target node, and to display an initial page of the webpage view based on the second subtree structure; a data filling module, configured to obtain node data corresponding to a current page of the web page view according to an operation on the web page view, and fill the second subtree structure with data based on the node data to obtain a third subtree structure; A display module is used to display the current page based on the third subtree structure.

10. An electronic device, characterized in that: The electronic device comprises: A memory for storing executable instructions; A processor, configured to implement the method according to any one of claims 1 to 8 when executing the executable instructions stored in the memory.

11. A computer-readable storage medium storing executable instructions, characterized in that: When the executable instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.

12. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Method and system for displaying web pages on mobile communication terminal

    CN102457613A

  • Methods for the augmentation, exploration, and maintenance of project hierarchies

    CN109121436A