Page jump method, device and equipment, and storage medium
By using nodes in the jump list to store page data and page-turning auxiliary values, the page search process is simplified, solving the problem of low page-turning efficiency in large page-turning scenarios and achieving the effect of quickly locating the target page.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-10
- Publication Date
- 2026-03-17
AI Technical Summary
When there are many pages, the page navigation efficiency of existing technologies is low, especially in scenarios with large page flips, and it cannot respond to user needs in a timely manner.
By using nodes in a jump list to store page data and pagination auxiliary values, page navigation is achieved by searching for the starting node in the jump list, simplifying the page search process and improving the efficiency of finding the starting node.
It effectively improves page navigation efficiency, especially in scenarios involving large page turns, enabling users to quickly locate the target page and meet their page-turning needs.
Smart Images

Figure CN116304461B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the technical fields of Internet technology, application processing, page display, and data storage in the field of computer technology, and in particular to a page redirection method, apparatus, device, and storage medium. Background Technology
[0002] On web pages or application pages, users can browse more page data by turning the page.
[0003] In related technologies, page data is stored in tables in a database. When turning pages, database statements are used to count from the beginning of all page data in the database tables, for example, starting from the first data of the first page, and continuing to the position of the page data of the page to be jumped to.
[0004] However, when there are many pages, the page redirection efficiency of the above method is relatively low. Summary of the Invention
[0005] This disclosure provides a page redirection method, apparatus, device, and storage medium for improving page redirection efficiency.
[0006] According to a first aspect of this disclosure, a page redirection method is provided, comprising:
[0007] Determine the page number to be redirected to;
[0008] Based on the page number, determine the logical sequence number of the starting node of the page to be redirected in the jump list. The jump list contains multiple nodes, at least one of which is the node corresponding to the page to be redirected. The data in the node includes page data and a jump auxiliary value. The jump auxiliary value contained in the node is used to reflect the number of nodes in the jump list that are located before the node.
[0009] Based on the logical sequence number and the jump auxiliary value contained in the node, the starting node is searched in the jump table;
[0010] Obtain the page data of the page to be redirected from the starting node;
[0011] Based on the page data of the page to be redirected, redirect to the page to be redirected.
[0012] According to a second aspect of this disclosure, a page redirection device is provided, comprising:
[0013] The page number determination unit is used to determine the page number of the page to be jumped to;
[0014] The sequence number determination unit is used to determine the logical sequence number of the starting node of the page to be jumped to in the jump list according to the page number. The jump list contains multiple nodes, at least one of which is the node corresponding to the page to be jumped to. The data in the node includes page data and jump auxiliary value. The jump auxiliary value contained in the node is used to reflect the number of nodes in the jump list that are located before the node.
[0015] A node lookup unit is used to look up the starting node in the jump table based on the logical sequence number and the jump auxiliary value contained in the node;
[0016] A data acquisition unit is used to acquire page data of the page to be redirected from the starting node;
[0017] A jump unit is used to jump to the page to be jumped to based on the page data of the page to be jumped to.
[0018] According to a third aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the page jump method described in the first aspect.
[0019] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform the page jump method described in the first aspect.
[0020] According to a fifth aspect of this disclosure, a computer program product is provided, the computer program product comprising: a computer program stored in a readable storage medium, at least one processor of an electronic device being able to read the computer program from the readable storage medium, the at least one processor executing the computer program causing the electronic device to perform the page redirection method described in the first aspect.
[0021] According to the technical solution provided in this disclosure, page data is stored in the nodes of the jump list. This simplifies the search for the page to be navigated to across multiple pages to the search for the starting node of the page to be navigated to within the jump list. Based on the page number of the page to be navigated to, the logical sequence number of the starting node in the jump list can be determined, further simplifying the search for the starting node to the search for the node with the corresponding logical sequence number. This continuous simplification improves page search efficiency. In the jump list, pagination auxiliary values within the nodes can be used to find the node with the corresponding logical sequence number. Since the pagination auxiliary value reflects the number of nodes preceding the current node in the jump list, and the number of nodes preceding the current node is related to the logical order of the nodes in the jump list, the pagination auxiliary value improves node search efficiency, thereby improving overall page search efficiency.
[0022] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0023] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0024] Figure 1 This is a schematic diagram illustrating an application scenario to which this disclosure applies;
[0025] Figure 2 This is a flowchart illustrating the page redirection method provided according to embodiments of the present disclosure. Figure 1 ;
[0026] Figure 3 Example of the structure of a skip list provided in the embodiments of this disclosure Figure 1 ;
[0027] Figure 4 This is a flowchart illustrating the page redirection method provided according to embodiments of the present disclosure. Figure 2 ;
[0028] Figure 5 This is a flowchart illustrating the page redirection method provided according to embodiments of the present disclosure. Figure 3 ;
[0029] Figure 6 This is a flowchart illustrating the page redirection method provided according to embodiments of the present disclosure. Figure 4 ;
[0030] Figure 7 Example of the structure of a skip list provided in the embodiments of this disclosure Figure 2 ;
[0031] Figure 8 Schematic diagram of the page navigation device provided in the embodiments of this disclosure Figure 1 ;
[0032] Figure 9 This is a schematic block diagram of an example electronic device 900 that can be used to implement embodiments of the present disclosure. Detailed Implementation
[0033] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0034] Users can navigate through pages on a webpage or application. In response to a user's page-turning action, the terminal or server needs to locate the target page from among multiple pages and redirect the user to display that page, i.e., turn the page to the target page.
[0035] Large-scale pagination scenarios refer to scenarios involving pagination across a large number of pages, such as pagination in online forums. Because of the large number of pages, pagination efficiency decreases in large-scale pagination scenarios.
[0036] Among the related technologies, the following page-turning methods exist:
[0037] The first approach is to use a relational database management system (such as MySQL) to store the list data, which includes page data for multiple pages. The data storage structure for the list data is a B+ tree. The time complexity of pagination based on a B+ tree is O(n), where n represents the number of pages. In large pagination scenarios, as n increases to a certain extent, the pagination efficiency becomes very slow and cannot respond to user requests promptly.
[0038] The second approach is to use a Remote Dictionary Server (RDS) to store the list data, which includes page data for multiple pages. Pagination is then implemented using an ordered list (Zset) within the RDS. However, this storage method is entirely in-memory, which can easily lead to memory bottlenecks and is unsuitable for scenarios with large pagination. Furthermore, Zset only supports storing list data in a single state; it cannot be used for pagination when the page contains multiple states. For example, a forum page might contain published posts and user-saved but unpublished posts. Published and unpublished are two different states, and Zset cannot be used for pagination in this scenario.
[0039] In the first approach, the following method can be used to solve the page-turning efficiency problem:
[0040] Solution 1: Use a waterfall layout. Each time, the page ID of the first page is passed in, and the first page is retrieved and displayed based on that ID. Then, the next page is automatically loaded in response to the user's swipe down, thus avoiding pagination. However, this method, by retrieving the first page each time, cannot quickly locate a specific position in the middle, resulting in slow pagination efficiency.
[0041] Solution 2: Only allow users to access the first m pages of data to reduce the number of pages to navigate through. For example, if there are 1000 posts in total, only allow users to access the first 100, thus reducing the number of pages users can navigate through. However, this method restricts normal access to more pages of data.
[0042] It is evident that the above methods have limited effect on improving page-turning efficiency and may even introduce new problems.
[0043] To improve page-turning efficiency, i.e., page jump efficiency, this disclosure provides a page jump method, apparatus, device, and storage medium, applicable to the field of computer technology, specifically internet technology, application processing, page display, and data storage. In the page jump method, page data and page-turning auxiliary values are stored in nodes of a jump list. Based on the page-turning auxiliary value, the starting node of the page is searched in the jump list, and page data is retrieved from the jump list according to the starting node to achieve page jump. Thus, the page jump process is simplified to finding the corresponding starting node of the page in the jump list, and the page-turning auxiliary value improves the efficiency of finding the starting node, thereby effectively improving page jump efficiency.
[0044] Figure 1 This diagram illustrates an application scenario applicable to an embodiment of this disclosure. In this application scenario, the devices involved include a terminal 101 and a page redirection device 102. The page redirection device 102 can be a terminal or a server. Figure 1 Taking the page redirection device 102 as an example, the server is used as an example.
[0045] Users can perform page-turning operations on the application page or webpage displayed on terminal 101. In response to the user's page-turning operation, terminal 101 can send a page jump request to page jump device 102. In response to the page jump request, page jump device 102 can search for the corresponding node in the jump table, obtain the page data to be displayed from the found node, and send the page data to terminal 101. After receiving the page data, terminal 101 displays the page, thus realizing the page-turning process.
[0046] This disclosure can be implemented on a terminal or a server. The terminal can be a personal digital assistant (PDA) device, a handheld device with wireless communication capabilities (e.g., a smartphone, tablet), a computing device (e.g., a personal computer, PC), a wearable device (e.g., a smartwatch, smart bracelet), or a smart home device (e.g., a smart speaker, smart display device). The server can be a standalone server or a server cluster, a local server or a cloud server.
[0047] The technical solutions of this disclosure and how they solve the aforementioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of this disclosure will now be described with reference to the accompanying drawings.
[0048] Figure 2 This is a flowchart illustrating the page redirection method provided according to embodiments of the present disclosure. Figure 1 .like Figure 2 As shown, page redirection methods include:
[0049] S201, Determine the page number of the page to be redirected to.
[0050] The page to be redirected to can be a webpage or an application page. The page number of the page to be redirected to is its logical sequence number among multiple pages. For example, among multiple pages, the logical sequence number of the first page is 1, the logical sequence number of the second page is 2, and so on.
[0051] In this embodiment, after receiving a page redirection request, the page to be redirected can be obtained from the page redirection request; alternatively, the page number of the page to be redirected, entered by the user, can be obtained.
[0052] For example, if a user clicks the jump control corresponding to page 10 on the terminal, or enters 10 and clicks to jump to the page, the terminal responds to the user's operation by sending a page jump request containing page number 10 to the page jump device. The page jump device obtains the page number of the page to be jumped to as 10 from the page jump request.
[0053] S202, based on the page number of the page to be redirected, determine the logical sequence number of the starting node of the page to be redirected in the jump list. The jump list contains multiple nodes, at least one of which is the node corresponding to the page to be redirected. The data in the node includes page data and a jump auxiliary value. The jump auxiliary value contained in the node is used to reflect the number of nodes in the jump list that are located before the node.
[0054] Among them, the skip list is an ordered linked list for binary search.
[0055] Here's an introduction to skip lists: First, multiple nodes in a skip list store page data for multiple pages. This page data is stored in the nodes in page number order. A single page's data can be stored in one or more nodes; for example, the page data for the first page might be stored in nodes 1-3, the page data for the second page in nodes 4-6, and so on. Second, each node in a skip list also stores a jump helper value. This jump helper value reflects the number of nodes preceding the node in the skip list. Therefore, jump helper values can be pre-determined for each node based on the nodes preceding it and stored in each node. Finally, the logical index of a node in the skip list changes continuously from smallest to largest according to the node's order in the list. For example, the logical index of the first node in the skip list is 1, the logical index of the second node is 2, and so on.
[0056] In this skip list, at least one node corresponds to the page to which the user is to be redirected; that is, at least one node stores the page data for the page to be redirected to. The starting node of the page to be redirected to is the node where the page data is located at the beginning of the page to be redirected to. For example, if the first post on the first page of a forum website is stored in the first node of the skip list, then the first node of the skip list is the starting node of the first page.
[0057] In this embodiment, since the page data of multiple pages are stored sequentially in multiple nodes of the jump list, the number of nodes occupied by all pages before the page to be adjusted can be determined according to the page number of the page to be jumped to, and then the logical sequence number of the starting node of the page to be jumped to in the jump list can be determined according to the number of nodes occupied by all pages before the page to be adjusted.
[0058] S203, based on the logical sequence number and the jump auxiliary value contained in the node, search for the starting node in the jump table.
[0059] In this embodiment, since the jump auxiliary value contained in the node can reflect the number of nodes in the jump list that precede the node, and the number of nodes in the jump list that precedes the node is closely related to the logical sequence number of the node in the jump list, the pointer can be moved in the jump list with the help of the jump auxiliary values contained in multiple nodes of the jump list. The logical sequence number of the node in the jump list can be found by moving the pointer, and finally the starting node of the page to be jumped to can be found.
[0060] S204, retrieve the page data of the page to be redirected from the starting node.
[0061] In this embodiment, after finding the starting node of the page to be adjusted, the nodes occupied by the page to be adjusted can be determined in the jump list based on the starting node and the number of nodes occupied by the page to be adjusted. That is, the nodes storing the page data of the page to be adjusted are determined. The page data of the page to be adjusted is then obtained from the nodes occupied by the page to be adjusted.
[0062] S205, based on the page data of the page to be redirected, redirect to the page to be redirected.
[0063] In this embodiment, the page data of the page to be redirected can be sent to the user's terminal, and the terminal can display the page to be redirected based on the page data to achieve page redirection; or, if the current page redirection device is responsible for displaying the page, after receiving the page data of the page to be redirected, it can display the page to be redirected based on the page data to achieve page redirection.
[0064] In this embodiment, page data is stored in nodes of a jump list, simplifying the page navigation problem to finding the starting node of the page to be navigated to in the jump list. The auxiliary values stored in the nodes of the jump list improve the efficiency of finding the starting node. This effectively improves page navigation efficiency, especially in scenarios with large page turns.
[0065] In some embodiments, each page in the multiple pages occupies the same number of nodes in the jump list. Based on this, a possible implementation of S202 includes: determining the logical sequence number of the page to be jumped to based on the page number of the page to be jumped to and the number of nodes occupied by a single page in the jump list. Thus, by having each page occupy the same number of nodes, the accuracy and efficiency of determining the logical sequence number of the page to be jumped to are improved.
[0066] In this embodiment, the number of nodes occupied by all pages preceding the page to be adjusted can be calculated based on the page number of the page to be adjusted and the number of nodes occupied by a single page in the jump list. The logical sequence number of the page to be adjusted is then obtained by adding 1 to the number of nodes occupied by all pages preceding the page to be adjusted. The formula for calculating the logical sequence number of the page to be adjusted can be expressed as: Logical sequence number of the page to be adjusted = (Page number of the page to jump to - 1) * Number of nodes occupied by a single page + 1.
[0067] As an example, a single page occupies 3 nodes in the skip list. If the page number to be adjusted is 4, then the logical sequence number of the page to be adjusted can be calculated as 10, meaning the starting node of page 4 is the 10th node in the skip list. Nodes 1-3 store the page data for page 1, nodes 4-6 store the page data for page 2, nodes 7-9 store the page data for page 3, and nodes 10-12 store the page data for page 4.
[0068] In cases where the number of nodes occupied by each page in the skip list may be the same or different across multiple pages, another possible implementation of S202 includes: obtaining the number of nodes occupied by each page preceding the page to be adjusted based on the page number of the page to be adjusted; determining the number of nodes occupied by all pages preceding the page to be adjusted based on the number of nodes occupied by each page preceding the page to be adjusted; and incrementing the number of nodes occupied by all pages preceding the page to be adjusted by 1 to obtain the logical sequence number of the page to be adjusted.
[0069] The structure of a skip list is further detailed below: A skip list adds multi-level indexes to an ordered linked list. Multi-level indexes can be understood as multiple levels; nodes in a skip list can be single-level or multi-level nodes, and different nodes can have the same or different levels. The first and last nodes in a skip list have the highest level. Each node in a skip list can also store a node identifier, which changes continuously or discontinuously according to the logical order of the nodes in the skip list.
[0070] Figure 3 Example of the structure of a skip list provided in the embodiments of this disclosure Figure 1 .like Figure 3 As shown, the layer numbers of nodes 1 through 17 are 4, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 4 respectively. The node identifiers of nodes 1 through 16 are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, and empty (representing the last node).
[0071] As can be seen from the structure of the skip list above, the process of searching for a node in the skip list involves the movement of pointers between nodes and between layers. With this in mind, the following is an example of node searching in a skip list.
[0072] Figure 4 This is a flowchart illustrating the page redirection method provided according to embodiments of the present disclosure. Figure 2 .like Figure 4 As shown, page redirection methods include:
[0073] S401, Determine the page number to be redirected to.
[0074] S402, based on the page number of the page to be redirected, determine the logical sequence number of the starting node of the page to be redirected in the jump list. The jump list contains multiple nodes, at least one of which is the node corresponding to the page to be redirected. The data in the node includes page data and a jump auxiliary value. The jump auxiliary value contained in the node is used to reflect the number of nodes in the jump list that are located before the node.
[0075] The implementation principles and technical effects of S401 to S402 can be referred to in the aforementioned embodiments, and will not be repeated here.
[0076] S403, starting from the highest level of the first node in the skip list.
[0077] S404 compares the jump auxiliary value and logical sequence number of the node pointed to by the pointer in the jump list to obtain the comparison result, which reflects the relationship between the node pointed to by the pointer and the starting node.
[0078] In this embodiment, since the first node and the last node in the skip list have the highest level, from Figure 3 It can also be seen that as the number of levels decreases, the search range of the pointer also gradually decreases. Therefore, we start searching from the highest level of the first node of the skip list. As the number of searches increases, the search range will gradually shrink until the starting node of the page to be jumped to is found. The pointer of the skip list is then set to the highest level of the first node. Since the jump auxiliary value contained in the node reflects the number of nodes preceding it, and the logical index of the starting node of the page to be jumped to also reflects the number of nodes preceding it, the jump auxiliary value contained in the node is compared with the logical index of the starting node. The comparison result reflects the relationship between the node pointed to by the pointer and the starting node.
[0079] S405, compare whether the result reflects that the node pointed to by the pointer is the starting node.
[0080] In this embodiment, if the comparison result shows that the node pointed to by the pointer is the starting node, then S406 is executed; otherwise, the process jumps to S408 to continue searching for the target node.
[0081] S406, confirmed that the starting node has been found.
[0082] S407, retrieve the page data of the page to be redirected from the starting node;
[0083] S408, based on the page data of the page to be redirected, redirect to the page to be redirected.
[0084] The implementation principles and technical effects of S407 to S408 can be referred to in the aforementioned embodiments, and will not be repeated here.
[0085] S409, adjusts the pointer of the skip list according to the comparison result.
[0086] In this embodiment, if the comparison result indicates that the node pointed to by the pointer is not the starting node, the pointer in the skip list is adjusted according to the comparison result, for example, by pointing the pointer to the next node, the previous node, and / or moving the pointer down one level, etc.; then, the process jumps to execute S404. This difference is performed multiple times until the starting node is found.
[0087] In this embodiment of the disclosure, after simplifying the page jump problem into the problem of finding the starting node of the page to be adjusted in the jump list, the jump list pointer, the jump auxiliary value stored in the node in the jump list, and the multi-level structure of the node are used to continuously narrow the search range of the node until the starting node of the page to be adjusted is found, which effectively improves the search efficiency of the starting node and thus improves the page adjustment efficiency.
[0088] In some embodiments, one possible implementation of S409 includes: if the comparison result reflects that the starting node of the page to be jumped to is after the node pointed to by the pointer, then adjust the pointer to point to the next node with the same level; and / or, another possible implementation of S409 includes: if the comparison result reflects that the starting node is before the node pointed to by the pointer, then backtrack the pointer to the previous node with the same level, and move the pointer down one level before pointing to the next node with the same level.
[0089] In this embodiment, if the comparison result indicates that the starting node of the page to be jumped to is located after the node pointed to by the pointer, it means that the search should be performed after the node pointed to by the pointer. The node located after the node pointed to by the pointer is the next node with the same level, where the same level refers to the level pointed to by the pointer. Figure 3 Taking the skip list shown as an example, assuming the pointer points to the highest level of node 9, after comparison, it is determined that the starting node is located after node 9, and the next node with the highest level of node 9 is the last node, so the pointer is pointed to the highest level of the last node.
[0090] If the comparison result shows that the starting node of the page to be adjusted is located before the node pointed to by the pointer, it means that the search should be performed before the node pointed to by the pointer. To narrow down the difference range, the pointer can be moved back to the previous node with the same level, then the pointer can be moved down one level, and then the pointer can be pointed to the next node with the same level. Here, "same level" refers to the level that the pointer points to after moving down one level. Figure 3 Taking the skip list shown as an example, assuming the pointer points to the highest level of node 9, after comparison it is determined that the starting node is in front of node 9. The pointer can be backed to the previous node in the same level: node 1. Then the pointer is lowered one level to point to the next node in the same level: node 5, so as to find the starting node in front of node 9.
[0091] In some embodiments, considering that the structure of the skip list is not necessarily standard ( Figure 3 (This is the standard structure of a skip list). For example, node identifiers in a skip list may not be continuous, and the level of nodes in a skip list may not be as specified. Figure 3 The central node shown has a high layer height. Skip lists with non-standard structures cannot effectively calculate the number of nodes preceding each node. To address this, the jump auxiliary value included in a node in the skip list can be the number of nodes to its lower left plus one. These lower left nodes are those preceding the node and at a lower layer. Thus, utilizing the multi-layered structure of the skip list to determine the jump auxiliary value improves the efficiency and accuracy of this determination. Furthermore, the jump auxiliary value reflects the node itself plus the number of its lower left nodes, aligning with the characteristic of skip lists where pointer jumps typically involve comparisons within the same layer, thus improving node lookup efficiency.
[0092] Furthermore, the jump helper value of the first node in the jump list is 0, and the jump helper values of the remaining nodes in the jump list other than the first node are the number of nodes to the left of the node plus 1.
[0093] like Figure 3 As shown, the jump auxiliary value of node 1 is 0; node 2 has no lower left node, so the jump auxiliary value of node 2 is 0 plus 1, which is 1; the lower left node of node 3 is node 2, so the jump auxiliary value of node 3 is 1 plus 1, which equals 2; node 4 has no lower left node, so the jump auxiliary value of node 4 is 0 plus 1, which equals 1; ...; the lower left nodes of node 9 are nodes 2 to 8, so the jump auxiliary value of node 9 is 7 plus 1, which equals 8; the remaining nodes follow the same pattern and will not be described one by one.
[0094] In some embodiments, based on the skip - assist value included in a node in the skip list being the number of nodes in the lower - left of the node in the skip list plus 1, a possible implementation of S404 includes: comparing the difference between the skip - assist value included in the node pointed to by the pointer and the logical sequence number minus one to obtain a comparison result. Among them, if the comparison result is that the skip - assist value included in the node pointed to by the pointer is equal to the difference, the comparison result reflects that the node pointed to by the pointer is the starting node; if the comparison result is that the skip - assist value included in the node pointed to by the pointer is less than the difference, the comparison result reflects that the starting node is after the node pointed to by the pointer; otherwise, the comparison result reflects that the starting node is before the node pointed to by the pointer. A possible implementation of S409 includes: if the comparison result reflects that the starting node of the page to be jumped to is after the node pointed to by the pointer, then update the logical sequence number of the starting node according to the skip - assist value included in the node pointed to by the pointer, and adjust the pointer to point to the next node of the same layer. Thus, the lower - left nodes of the nodes in the skip list are used to determine the skip - assist value included in the nodes in the skip list, avoiding too large skip - assist values in the large - page - turning scenario, and also improving the efficiency and accuracy of determining the skip - assist value for nodes; based on the skip - assist value included in the nodes, the efficiency of finding the starting node in the skip list is improved.
[0095] Further, based on the skip - assist value included in a node in the skip list being the number of nodes in the lower - left of the node in the skip list plus 1, the process of finding the starting node is (assuming the logical sequence number of the starting node is k):
[0096] Step 1: The pointer of the skip list points to the highest layer of the first node of the skip list to start searching from the highest layer of the first node, and the skip - assist value L0 of the first node is 0.
[0097] Among them, L i-1 represents the skip - assist value of the i - th node.
[0098] Step 2: If L i-1 < k - 1, it means that the starting node is after the node pointed to by the pointer. Update k to k - L i-1 , and the pointer points to the next node of the same layer; if L i-1 > k - 1, it means that the starting node is before the node pointed to by the pointer, and execute Step 3; if L i-1 = k - 1, it means that the starting node is the node pointed to by the pointer;
[0099] Step 3: Move the pointer back to the previous node of the same layer, then move the pointer down one layer to point to the next node, and continue to repeat Step 2.
[0100] As an example, taking the skip list shown in Figure 3 as an example, when the logical sequence number of the starting node is 6 (i.e., k = 6), the process of finding the starting node in the skip list is as follows:
[0101] First, the pointer points to the highest level of node 1 in the skip list. At this time, L0 = 0, and L0 < k - 1 = 6 - 1 = 5, indicating that the starting node is behind the first node. Since this is the case, there is no need to update the logical serial number k of the starting node. The pointer is then pointed to the next node at the same level, which is node 9. For node 9, L8 = 8, and L8 > k - 1 = 6 - 1 = 5, indicating that the starting node is before node 9. Therefore, step 3 is executed, and the pointer is moved back to the previous node at the same level, which is node 1. Then, it moves down one level and points to the next node, which is node 5. For node 5, L4 = 4, and L4 < 5, indicating that the starting node is behind node 5. Update k = k - L4 = 6 - 4 = 2. The pointer is pointed to the next node at the same level, which is node 9. Given that the starting node is before node 9, step 3 is executed. The pointer is moved back to the previous node at the same level, which is node 5. It moves down one level and then points to the next node at the same level, which is node 7. L3 = 2, and L3 > 2 - 1 = 1, indicating that the starting node is before node 7. Therefore, step 3 is executed, and the pointer is moved back to the previous node 5 at the same level. It moves down one level and then points to the next node at the same level, which is node 6. L5 = 2 - 1 = 1. So, node 6 is determined as the starting node.
[0102] Next, an embodiment where the number of skip lists in the page jump method is multiple is provided.
[0103] Figure 5 It is a flowchart of the page jump method provided according to an embodiment of the present disclosure Figure 3 In this page jump method, the number of skip lists is multiple. As Figure 5 shown, the page jump method includes:
[0104] S501, determine the page number of the page to be jumped to.
[0105] S502, according to the page number of the page to be jumped to, determine the logical serial number of the starting node of the page to be jumped to in multiple skip lists. The skip list includes multiple nodes, and at least one node in the multiple nodes is the node corresponding to the page to be jumped to. The data in the node includes page data and a jump auxiliary value. The jump auxiliary value included in the node is used to reflect the number of nodes before the node in the skip list.
[0106] Among them, the implementation principles and technical effects of S501 to S502 can be referred to the foregoing embodiments and will not be elaborated here.
[0107] In this context, when there are multiple skip lists, it's equivalent to splitting a large skip list into multiple smaller ones. Each skip list can store page data in different states, allowing for page navigation in scenarios where multiple pages contain page data in different states. For example, in a forum website, published posts are stored in skip list A, edited but unpublished posts are stored in skip list B, and posts that haven't been approved are stored in skip list C.
[0108] Example of storing page data in multiple skip lists: The nodes corresponding to the first page are nodes 1 to 3, the nodes corresponding to the second page are nodes 4 to 6, and the nodes corresponding to the third page are nodes 7 to 9; where nodes 1, 2, and 4 are nodes in skip list A, nodes 6 and 7 are nodes in skip list B, and nodes 3, 5, 8, and 9 are nodes in skip list C.
[0109] S503, based on the jump auxiliary values contained in the nodes of the multiple jump lists and the logical sequence number of the starting node, adjust the pointer of at least one jump list in the multiple jump lists to narrow the search range of the starting node until the search of the starting node meets the termination condition.
[0110] In this embodiment, within multiple skip lists, by adjusting the pointers of at least one skip list, the relationship between the starting node and the node pointed to by the pointer is determined based on the jump auxiliary value contained in the node pointed to by the pointer. If the starting node is before the node pointed to by the pointer, the node pointed to by the pointer can be determined as the upper bound of the search range; if the starting node is after the node pointed to by the pointer, the node pointed to by the pointer can be determined as the lower bound of the search range. Then, the pointer is moved to update the search range, narrowing the search range of the starting node until the search of the starting node meets the termination condition. Thus, by continuously narrowing the search range, the node search efficiency is improved.
[0111] In one possible implementation, the termination condition for the search of the starting node can be that the pointer of at least one skip list points to the bottom level of that skip list, meaning the pointer of at least one skip list cannot descend another level. Alternatively, the termination condition for the search of the starting node can be that the pointers of all skip lists point to the bottom level of their respective skip lists, meaning the pointers of all skip lists cannot descend another level. Here, the search range is sufficiently narrowed when the pointer descends to the last level, and the search range cannot be narrowed further when the pointer needs to descend but cannot. Therefore, constraining the search of the starting node based on the level at which the pointer is located can effectively improve the accuracy of the search for the starting node.
[0112] In another possible implementation, the termination condition for the search of the starting node can also be that the search duration of the starting node exceeds a duration threshold or the number of searches for the starting node reaches a number threshold. Thus, by constraining the node search from the perspective of duration or number of searches, search efficiency can be improved.
[0113] S504, determine the starting node in the jump list based on the search range.
[0114] In this embodiment, a starting node can be determined from the nodes within the search range and / or the nodes adjacent to the search range based on the jump assistance values of the nodes within the search range and / or the jump assistance values of the nodes adjacent to the search range. The nodes adjacent to the search range may include nodes adjacent to the upper bound of the search range and / or nodes adjacent to the lower bound of the search range.
[0115] S505: Retrieve page data of the page to be redirected from the starting node.
[0116] S506, based on the page data of the page to be redirected, redirect to the page to be redirected.
[0117] The implementation principles and technical effects of S505 to S506 can be referred to in the aforementioned embodiments, and will not be repeated here.
[0118] In this embodiment of the disclosure, when the page data of multiple pages includes page data of multiple states, multiple skip lists are used to store page data of different states. By utilizing the jump auxiliary values stored in the nodes of the multiple skip lists and the pointers of at least one skip list, the search range for the starting node of the page to be jumped to is continuously narrowed down within the multiple skip lists until the starting node is finally found. This effectively improves the efficiency of finding the starting node, improves page jump efficiency, especially in scenarios with multi-state page data and scenarios with large page turns.
[0119] In some embodiments, there are two skip lists, including a first skip list and a second skip list. The first skip list is used to store page data in a first state, and the second skip list is used to store page data in a second state. The first state and the second state are different states.
[0120] Furthermore, when there are two skip lists, one possible implementation of S503 includes: based on the jump auxiliary values contained in the nodes of the first skip list and the second skip list, and the logical sequence number of the starting node, moving the first pointer in the first skip list and the second pointer in the second skip list to narrow the search range until the search for the starting node meets the termination condition. Here, the first pointer is a pointer to the first skip list, and the second pointer is a pointer to the second skip list. Thus, by combining the jump auxiliary values of the nodes in both skip lists and the pointers in both skip lists, the search efficiency for the starting node is improved, thereby improving the page jump efficiency in multi-state page data scenarios.
[0121] Figure 6 This is a flowchart illustrating the page redirection method provided according to embodiments of the present disclosure. Figure 4 In this page redirection method, there are two jump lists: a first jump list and a second jump list. The first jump list stores the page data for the first state, and the second jump list stores the page data for the second state. For example... Figure 6 As shown, page redirection methods include:
[0122] S601, Determine the page number of the page to be redirected to.
[0123] S602, based on the page number of the page to be redirected, determine the logical sequence number of the starting node of the page to be redirected in multiple jump lists. The jump list contains multiple nodes, at least one of which is the node corresponding to the page to be redirected. The data in the node includes page data and a jump auxiliary value. The jump auxiliary value contained in the node is used to reflect the number of nodes in the jump list that are located before the node.
[0124] The implementation principles and technical effects of S601 to S602 can be referred to in the aforementioned embodiments, and will not be repeated here.
[0125] S603: For each skip list, the pointer in the skip list is pointed to the highest level of the first node in the skip list, and then the pointer is moved to the next node at the same level.
[0126] In this embodiment, in the first skip list, the first pointer is pointed to the highest level of the first node in the first skip list, and then the pointer is moved to the next node at the same level, that is, the first pointer is moved to the next node at the same level. In the second skip list, the second pointer is pointed to the highest level of the first node in the second skip list, and then the pointer is moved to the next node at the same level, that is, the second pointer is moved to the next node at the same level.
[0127] S604, based on the node pointed to by the first pointer, the jump auxiliary value contained in the node in the first jump list, the node pointed to by the second pointer, the jump auxiliary value contained in the node in the second jump list, and the logical sequence number of the starting node, move the first pointer and move the second pointer to determine the search range.
[0128] In this embodiment, in the first skip list, if the relationship between the node pointed to by the first pointer and the starting node can be determined based on the node pointed to by the first pointer, the jump auxiliary value contained in the node in the first skip list, and the logical sequence number of the starting node, then the first pointer can be moved according to the relationship between the starting node and the node pointed to by the first pointer. If the relationship between the node pointed to by the first pointer and the starting node cannot be determined based on the node pointed to by the first pointer, the jump auxiliary value contained in the node in the first skip list, and the logical sequence number of the starting node, then the relationship between the node pointed to by the first pointer and the starting node, or the relationship between the node pointed to by the second pointer and the starting node, can be determined by combining the node pointed to by the first pointer, the jump auxiliary value contained in the node in the first skip list, the node pointed to by the second pointer, and the jump auxiliary value contained in the node in the second skip list. Then, the first pointer is moved according to the relationship between the node pointed to by the first pointer and the starting node, and / or the second pointer is moved according to the relationship between the node pointed to by the second pointer and the starting node. The search range for the starting node is determined based on the relationship between the node pointed to by the first pointer and the starting node and / or the relationship between the node pointed to by the second pointer and the starting node. In this way, by combining the first and second skip lists, the efficiency and accuracy of finding the starting node are improved, thereby improving the efficiency and accuracy of page redirection.
[0129] S605, Does the search for the starting node meet the termination condition?
[0130] In this embodiment, if the search for the starting node meets the termination condition, the search for the starting node is stopped and S606 is executed; otherwise, the process jumps to S604 to continue moving the first pointer in the first jump list and / or moving the second pointer in the second jump list to narrow the search range.
[0131] S606, determine the starting node in the jump list based on the search range.
[0132] S607, retrieve the page data of the page to be redirected from the starting node.
[0133] S608, based on the page data of the page to be redirected, redirect to the page to be redirected.
[0134] The implementation principles and technical effects of S606 to S608 can be referred to in the aforementioned embodiments, and will not be repeated here.
[0135] In this embodiment of the disclosure, when the page data of multiple pages includes page data in a first state and page data in a second state, a first skip list and a second skip list are used to store page data in different states. Using the jump auxiliary value contained in the node in the first skip list, a first pointer, the jump auxiliary value contained in the node in the second skip list, a second pointer, and the logical sequence number of the starting node, the search range for the starting node of the page to be jumped to is continuously narrowed down in the first and second skip lists until the starting node is finally found. Therefore, the search efficiency for the starting node in multiple skip lists is effectively improved, as are the page jump efficiency in multi-state page data scenarios and page jump efficiency in large pagination scenarios.
[0136] In some embodiments, a possible implementation of S604 includes: determining a target positional relationship based on the node pointed to by the first pointer, the jump auxiliary value contained in the node in the first jump list, the node pointed to by the second pointer, the jump auxiliary value contained in the node in the second jump list, and the logical sequence number; and moving the first pointer and / or the second pointer according to the target positional relationship to determine the boundary nodes of the search range in the first jump list and / or the second jump list. The target positional relationship includes the positional relationship between the node pointed to by the first pointer and the starting node and / or the positional relationship between the node pointed to by the second pointer and the starting node, and the boundary nodes include the node pointed to by the first pointer, the node pointed to by the second pointer, the first upper bound node of the starting node in the first jump list, and the second upper bound node of the starting node in the jump list.
[0137] The boundary node of the search range is the same as the boundary node of the starting node. Since there are two skip lists, each corresponding to a search range, in other words, the search range of the starting node includes the search range corresponding to the first skip list and the search range corresponding to the second skip list. The node pointed to by the first pointer and the first upper bound node in the first skip list constitute the search range corresponding to the first skip list, and the node pointed to by the second pointer and the second upper bound node in the second skip list constitute the search range corresponding to the second skip list.
[0138] In this embodiment, in the target position relationship, if the starting node is located before the node pointed to by the first pointer, the node pointed to by the first pointer can be determined as the first upper bound node, and the first pointer is moved; if the starting node is located before the node pointed to by the second pointer, the node pointed to by the first pointer can be determined as the second upper bound node, and the second pointer is moved. Thus, by continuously judging the target position relationship and moving the pointer, the boundary nodes of the search range are continuously updated, and the search range is continuously narrowed. It is evident that by narrowing the search range in each skip list, the search efficiency of the starting node is improved.
[0139] In some embodiments, the jump auxiliary value contained in a node in the jump list is determined based on the number of nodes to the lower left of the node. The nodes to the lower left of a node are those located before the node and at a lower level. In this case, the jump auxiliary value contained in the node cannot directly reflect the number of nodes in front of the node. Therefore, the target positional relationship is determined based on the node pointed to by the first pointer, the jump auxiliary value contained in the node in the first jump list, the node pointed to by the second pointer, the jump auxiliary value contained in the node in the second jump list, and the logical sequence number. One possible implementation includes: determining the number of first nodes based on the jump auxiliary value contained in the node pointed to by the first pointer and the jump auxiliary value contained in the nodes on the movement trajectory of the first pointer in the current layer. The number of first nodes reflects the number of nodes in the first jump list preceding the node pointed to by the first pointer; determining the number of second nodes based on the jump auxiliary value contained in the node pointed to by the second pointer and the jump auxiliary value contained in the nodes on the movement trajectory of the second pointer in the current layer. The number of second nodes reflects the number of nodes in the second jump list preceding the node pointed to by the second pointer; and determining the target positional relationship based on the number of first nodes, the number of second nodes, and the logical sequence number of the starting node. Therefore, by combining the pointer's movement trajectory and the jump auxiliary values contained in the nodes, the number of first and second nodes that can intuitively reflect the number of nodes in front of the node are determined, thus improving the accuracy of the target position relationship.
[0140] The process of determining the jump auxiliary value contained in the node can be referred to the aforementioned embodiments and will not be repeated here.
[0141] In this embodiment, since the first and second skip lists each store partial data, the complete skip list storing all page data is formed by integrating the first and second skip lists. Therefore, for a certain node in the first skip list, the nodes preceding that node may not only be nodes preceding that node in the first skip list, but also some nodes in the second skip list. To solve this problem, the number of first nodes and the number of second nodes are determined separately. The number of first nodes (including the node pointed to by the first pointer) reflects the number of nodes preceding the node pointed to by the first pointer in the first skip list, and the number of second nodes (including the node pointed to by the first pointer) reflects the number of nodes preceding the node pointed to by the second pointer in the second skip list. Combining the number of first nodes and the number of second nodes allows for a more accurate determination of the target position relationship. In determining the number of first nodes and the number of second nodes, considering that the jump auxiliary value contained in a node is determined based on the number of nodes to the lower left of the node, and that the pointer's movement trajectory passes through the left-side nodes of the same layer when moving within the same layer, combining the pointer's movement trajectory and the jump auxiliary value contained in the node allows for an accurate determination of the number of first nodes and the number of second nodes.
[0142] In one possible implementation, the number of first nodes can be the sum of the jump auxiliary values of the nodes on the movement trajectory of the first pointer in the current layer plus one, and the number of second nodes can be the sum of the jump auxiliary values of the nodes on the movement trajectory of the second pointer in the current layer plus one.
[0143] Figure 7 Example of the structure of a skip list provided in the embodiments of this disclosure Figure 2 .
[0144] like Figure 7 As shown, the first skip list includes nodes 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 31, and an empty node. Taking nodes 1, 3, 5, 7, 9, 11, 13, 15, and 17 as examples, the skip auxiliary values contained in these nodes are 0, 1, 2, 1, 4, 1, 2, 1, and 8, respectively. The second skip list includes nodes 4, 8, 12, 16, 20, 28, 32, and 36, and the skip auxiliary values contained in these nodes are 0, 1, 2, 1, 4, 1, 2, 1, and 8, respectively. Based on Figure 7 In the skip list shown, if the first pointer points to node 9, the nodes on its path are node 1 and node 9, and the number of the first nodes can be calculated as 0+4+1=5; if the second pointer points to node 12, the nodes on its path are node 1 and node 12, and the number of the second nodes can be calculated as 0+2+1=3.
[0145] In one possible implementation, determining the target positional relationship based on the number of first nodes, the number of second nodes, and the logical sequence number includes: if the number of first nodes is greater than the logical sequence number of the starting node, then the starting node is determined to be located before the node pointed to by the first pointer; and / or, if the number of first nodes is less than or equal to the logical sequence number of the starting node, then the target positional relationship is determined based on the number of first nodes, the number of second nodes, and the logical sequence number of the starting node; and / or, if the number of second nodes is greater than the logical sequence number, then the starting node is determined to be located before the node pointed to by the second pointer.
[0146] In this implementation, since the number of first nodes reflects the number of nodes preceding the node pointed to by the first pointer in the first skip list, if the number of first nodes is greater than the logical index of the starting node, it can be clearly determined that the starting node is before the node pointed to by the first pointer. If the number of first nodes is less than or equal to the logical index of the starting node, it cannot be determined that the starting node is after the node pointed to by the first pointer, because there may be nodes in the second skip list preceding the node pointed to by the first pointer, and the number of first nodes is obtained without calculating the nodes in the second skip list. Therefore, the target position relationship must be determined based on the number of first nodes, the number of second nodes, and the logical index of the starting node. Similarly, if the number of second nodes is greater than the logical index, it can be clearly determined that the starting node is before the node pointed to by the second pointer. Thus, combining the number of first nodes and the number of second nodes improves the accuracy of the target position relationship.
[0147] In one possible implementation, the target positional relationship is determined based on the number of first nodes, the number of second nodes, and the logical index of the starting node. This includes: if the sum of the number of first nodes and the number of second nodes is greater than the logical index of the starting node and the node pointed to by the first pointer is after the node pointed to by the second pointer, then the starting node is determined to be before the node pointed to by the first pointer; and / or, if the sum of the number of first nodes and the number of second nodes is greater than the logical index of the starting node and the node pointed to by the first pointer is before the node pointed to by the second pointer, then the starting node is determined to be before the node pointed to by the second pointer. Therefore, when the sum of the number of first nodes and the number of second nodes is greater than the logical index of the starting node, introducing a comparison of the positional relationships between the nodes pointed to by the first and second pointers improves the accuracy of determining the target positional relationship.
[0148] In this implementation, if the sum of the number of the first node and the number of the second node is greater than the logical sequence number of the starting node and the node pointed to by the first pointer is after the node pointed to by the second pointer, it means that the number of nodes before the node pointed to by the first pointer (including the node pointed to by the first pointer) is the sum of the number of the first node and the number of the second node, thus indicating that the starting node is before the node pointed to by the first pointer; if the sum of the number of the first node and the number of the second node is greater than the logical sequence number of the starting node and the node pointed to by the first pointer is before the node pointed to by the second pointer, it means that the number of nodes before the node pointed to by the second pointer (including the node pointed to by the second pointer) is the sum of the number of the first node and the number of the second node, thus indicating that the starting node is before the node pointed to by the second pointer.
[0149] In one possible implementation, determining the target positional relationship based on the number of first nodes, the number of second nodes, and the logical index of the starting node includes: if the sum of the number of first nodes and the number of second nodes is less than or equal to the logical index of the starting node and the node pointed to by the first pointer is after the node pointed to by the second pointer, then the upper bound of the position of the node pointed to by the second pointer is determined based on the sum of the number of first nodes and the number of second nodes, and the target positional relationship is determined based on the upper bound and the logical index of the starting node; and / or, if the sum of the number of first nodes and the number of second nodes is less than or equal to the logical index of the starting node and the node pointed to by the first pointer is before the node pointed to by the second pointer, then the lower bound of the position of the node pointed to by the second pointer is determined based on the sum of the number of first nodes and the number of second nodes, and the target positional relationship is determined based on the lower bound and the logical index of the starting node. Therefore, when the sum of the number of first nodes and the number of second nodes is less than or equal to the logical index of the starting node, introducing a comparison of the positional relationships of the nodes pointed to by the first and second pointers improves the accuracy of determining the target positional relationship.
[0150] In this implementation, if the sum of the number of the first node and the number of the second node is less than or equal to the logical index of the starting node, and the node pointed to by the first pointer is located after the node pointed to by the second pointer, then for the node pointed to by the second pointer, its maximum position (i.e., the largest logical index) is the sum of the number of the first node and the number of the second node minus one. Therefore, the upper bound of the position of the node pointed to by the second pointer is determined to be the sum of the number of the first node and the number of the second node minus one. The upper bound of the position of the node pointed to by the second pointer is compared with the logical index of the starting node to determine the target positional relationship.
[0151] Furthermore, if the upper bound of the node pointed to by the second pointer is less than the logical index of the starting node, then the starting node is determined to be after the node pointed to by the second pointer; and / or, if the upper bound of the node pointed to by the second pointer is greater than or equal to the logical index of the starting node, then the starting node is determined to be before the node pointed to by the first pointer. Specifically, when the upper bound of the node pointed to by the second pointer is greater than or equal to the logical index of the starting node, since the node pointed to by the first pointer is after the node pointed to by the second pointer, it can be deduced that the node pointed to by the first pointer is after the starting node, thus determining that the starting node is before the node pointed to by the first pointer. Therefore, by comparing the upper bound of the position with the starting node, the accuracy of the target positional relationship is improved.
[0152] In this implementation, if the sum of the number of the first node and the number of the second node is less than or equal to the logical index of the starting node, and the node pointed to by the first pointer is located before the node pointed to by the second pointer, then for the node pointed to by the second pointer, its smallest position (i.e., the smallest logical index) is the sum of the number of the first node and the number of the second node. Therefore, the lower bound of the position of the node pointed to by the second pointer is the sum of the number of the first node and the number of the second node. The upper bound of the position of the node pointed to by the second pointer is compared with the logical index of the starting node to determine the target positional relationship.
[0153] Furthermore, if the lower bound of the node pointed to by the second pointer is less than the logical index of the starting node, then the starting node is determined to be after the node pointed to by the first pointer; and / or, if the upper bound of the node pointed to by the second pointer is greater than or equal to the logical index of the starting node, then the starting node is determined to be before the node pointed to by the second pointer. Specifically, if the lower bound of the node pointed to by the second pointer is less than the logical index of the starting node, since the node pointed to by the first pointer is before this lower bound, the logical index of the node pointed to by the first pointer is less than the logical index of the starting node, thus determining that the starting node is after the node pointed to by the first pointer.
[0154] In one possible implementation, based on the target position relationship, the first pointer and / or the second pointer are moved to determine the boundary nodes of the search range in the first skip list and / or the second skip list, including: if the starting node is located before the node pointed to by the first pointer, then the first upper bound node is determined to be the node pointed to by the first pointer, the first pointer is backtracked to the previous node with the same level and then descended one level, and then the first pointer is pointed to the next node on the same level, and the search for the starting node continues in the first skip list; or, if the starting node is located after the node pointed to by the first pointer, then the first pointer is descended one level, and then the first pointer is pointed to the next node on the same level, and the search for the starting node continues in the first skip list.
[0155] In another possible implementation, based on the target position relationship, the first pointer and / or the second pointer are moved to determine the boundary node of the search range in the first skip list and / or the second skip list. This includes: if the starting node is located before the node pointed to by the second pointer, the second pointer is backtracked to the previous node at the same level and then down one level, and then the second pointer is pointed to the next node at the same level, and the search for the starting node continues in the second skip list; or, if the starting node is located after the node pointed to by the second pointer, the second upper bound node is determined to be the node pointed to by the second pointer, the second pointer is down one level, and then the second pointer is pointed to the next node at the same level, and the search for the starting node continues in the second skip list.
[0156] Therefore, by determining the boundary nodes of the query range through pointer movement and positional relationship, the query range is narrowed down by continuously updating the boundary nodes, thereby improving the accuracy of the query.
[0157] In one possible implementation, determining the starting node in the jump list based on the search range includes: determining the sequence number range of the boundary node of the query range among all nodes in the first and second jump lists based on the jump auxiliary values contained in the nodes in the first and second jump lists; and determining the starting node among the boundary nodes or their adjacent nodes by comparing the sequence number range with logical sequences. Thus, combining the first and second jump lists after determining the query range improves the accuracy of finding the starting node.
[0158] In this implementation, the query range includes four boundary nodes: the node pointed to by the first pointer, the first upper bound node, the node pointed to by the second pointer, and the second upper bound node. These four nodes are adjacent nodes. The four nodes can be sorted according to their node identifiers. Based on the sorting result, the logical sequence numbers corresponding to the four nodes are determined as follows: the logical sequence number of the node with the smallest position is less than the sum of the number of the first node and the data of the second node minus one; the logical sequence number of the node with the largest position is less than the sum of the number of the first node and the data of the second node plus two; and the logical sequence numbers of the two middle nodes are the sum of the number of the first node and the number of the second node, and the sum of the number of the first node and the number of the second node plus one, respectively.
[0159] Assume the four boundary nodes are i, j, m, and n, and the logical index of the starting node is k. Here, i and j are a pair of lower bounds to each other, and m and n are a pair of upper bounds to each other. The positions (i.e., logical indices) of these four nodes are k1 <= S. i +S j -1, k2 = S i +S j k3 = S i +Sj+1、k4<=S i +S j +2; S i S represents the number of first nodes. j This indicates the number of the second node. Based on this, the process of finding the starting node is as follows:
[0160] (1) If k2 or k3 is equal to k, then determine the boundary corresponding to k2 or k3 as the starting node.
[0161] (2) If S i +S j -1 = k, assuming the position of node i is k. i The position of node j is kj :
[0162] Assume V j <V i k j <= k, and since k i =S i +S j Then k i -1 <= k, compare the values of node i-1 and node j, when V i-1 <V j At that time, k j = k, j is the starting node, otherwise i-1 is the starting node;
[0163] Assume V j >V i k i <= k, and since k j =S i +S j Then k j -1 <= k, compare the values of node i and node j-1, when V i <V j-1 At that time, k j If -1 = k, then node j-1 is the starting node; otherwise, node i is the starting node.
[0164] (3) If S i +S j +2 = k, assuming the position of node m is k. m The position of node n is k n :
[0165] Assume V m <V n k n >= k, and since k m =S i +S j +1, then k m +1>=k, compare the values of node m+1 and node n, when V m When +1>Vn, k n =k, where n is the starting node; otherwise, m+1 is the starting node k.
[0166] Assume V m >V n k m >= k, and since k n =S i +S j +1, then k n +1>=k, compare the values of node m and node n+1, when V m >V nWhen +1, k n If +1 = k, then node n+1 is the starting node; otherwise, node m is the starting node.
[0167] In some embodiments, if the first pointer points to the last level of the first skip list and the second pointer does not point to the last level of the second skip list, then if it is necessary to move the first pointer down one level, the second pointer is moved down one level and then pointed to the same level of the next node; and / or, if the second pointer points to the last level of the second skip list and the first pointer does not point to the last level of the first skip list, then if it is necessary to move the second pointer down one level, the first pointer is moved down one level and then pointed to the same level of the next node; and / or, if both the first and second pointers point to the last level of the first skip list, then the query for the starting node is determined to meet the termination condition. Thus, by adjusting the first and second pointers in a timely manner according to the level where the first and second pointers are located, the query is terminated promptly, improving node query efficiency.
[0168] In some embodiments, the first skip list and the second skip list satisfy at least one of the following conditions: both the first skip list and the second skip list are ideal skip lists (i.e., standard skip lists, with the node height distribution as shown in the figure). Figure 7 (As shown); the nodes in the first skip list do not intersect with the nodes in the second skip list; the logical sequence number of the starting node is less than the length of the first skip list and greater than 0, so that the starting node can always be found.
[0169] Figure 8 Schematic diagram of the page navigation device provided in the embodiments of this disclosure Figure 1 .like Figure 8 As shown, the page navigation device 800 includes:
[0170] Page number determination unit 801 is used to determine the page number of the page to be jumped to;
[0171] The sequence number determination unit 802 is used to determine the logical sequence number of the starting node of the page to be jumped to in the jump list according to the page number. The jump list contains multiple nodes, at least one of which is the node corresponding to the page to be jumped to. The data in the node includes page data and jump auxiliary value. The jump auxiliary value contained in the node is used to reflect the number of nodes in the jump list that are before the node.
[0172] The node lookup unit 803 is used to search for the starting node in the jump table based on the logical sequence number and the jump auxiliary value contained in the node;
[0173] The data acquisition unit 804 is used to acquire page data of the page to be redirected from the starting node;
[0174] The jump unit 805 is used to jump to the page to be jumped to based on the page data of the page to be jumped to.
[0175] In some embodiments, the node lookup unit 803 includes: a first comparison module 8031, configured to compare the jump auxiliary values and logical sequence numbers contained in the nodes pointed to by the pointers in the jump list, starting from the highest level of the first node of the jump list, to obtain a comparison result, the comparison result reflecting the relationship between the node pointed to by the pointer and the starting node; a lookup determination module 8032, configured to determine that the starting node has been found if the comparison result reflects that the node pointed to by the pointer is the starting node; and a first adjustment module 8033, configured to adjust the pointer of the jump list according to the comparison result if the comparison result reflects that the node pointed to by the pointer is not the starting node, until the starting node is found in the jump list.
[0176] In some embodiments, the first adjustment module 8033 includes: a first adjustment submodule (not shown in the figure), configured to adjust the pointer to point to the next node with the same level if the comparison result reflects that the starting node is after the node pointed to by the pointer; and / or a second adjustment submodule (not shown in the figure), configured to backtrack the pointer to the previous node with the same level and move the pointer down one level before pointing to the next node with the same level if the comparison result reflects that the starting node is before the node pointed to by the pointer.
[0177] In some embodiments, the jump auxiliary value contained in a node in the jump list is the number of nodes to the left of the node in the jump list plus 1, and the nodes to the left of the node are nodes located before the node and whose layer number is less than the node; the first comparison module 8031 includes: a comparison submodule (not shown in the figure), used to compare the jump auxiliary value contained in the node pointed to by the pointer with the difference between the logical sequence number and the difference, to obtain a comparison result; wherein, if the comparison result is that the jump auxiliary value contained in the node pointed to by the pointer is equal to the difference, the comparison result reflects that the node pointed to by the pointer is the starting node; if the comparison result is that the jump auxiliary value contained in the node pointed to by the pointer is less than the difference, the comparison result reflects that the starting node is located after the node pointed to by the pointer; otherwise, the comparison result reflects that the starting node is located before the node pointed to by the pointer.
[0178] In some embodiments, the sequence number determination unit 802 includes: a sequence number determination module 8021, configured to determine a logical sequence number based on the page number and the number of nodes occupied by a single page in the jump table.
[0179] In some embodiments, there are multiple skip lists, and the node lookup unit 803 includes: a second adjustment module 8034, used to adjust the pointer of at least one skip list in the multiple skip lists according to the jump auxiliary value and logical sequence number contained in the node in the multiple skip lists, so as to narrow the search range of the starting node until the search of the starting node meets the end condition; and a node determination module 8035, used to determine the starting node in the skip lists according to the search range.
[0180] In some embodiments, when there are two skip lists, the two skip lists include a first skip list and a second skip list. The first skip list is used to store page data of a first state, and the second skip list is used to store page data of a second state. The second adjustment module 8034 includes a third adjustment submodule (not shown in the figure), which is used to move a first pointer in the first skip list and a second pointer in the second skip list according to the jump auxiliary value contained in the node in the first skip list, the jump auxiliary value contained in the node in the second skip list, and the logical sequence number, so as to narrow the search range until the search of the starting node meets the end condition.
[0181] In some embodiments, the third adjustment submodule is specifically used for: for each skip list, pointing the pointer in the skip list to the highest level of the first node in the skip list, and then moving the pointer to the next node with the same level; moving the first pointer and the second pointer according to the node pointed to by the first pointer, the jump auxiliary value contained in the node in the first skip list, the node pointed to by the second pointer, the jump auxiliary value contained in the node in the second skip list, and the logical sequence number, to determine the search range; if the search for the starting node meets the termination condition, then stop searching for the starting node, otherwise continue moving the first pointer in the first skip list and / or moving the second pointer in the second skip list to narrow the search range.
[0182] In some embodiments, during the process of moving the first pointer and the second pointer to determine the search range based on the node pointed to by the first pointer, the jump auxiliary value contained in the node in the first jump list, the node pointed to by the second pointer, the jump auxiliary value contained in the node in the second jump list, and the logical sequence number, the third adjustment submodule is specifically used to: determine the target positional relationship based on the node pointed to by the first pointer, the jump auxiliary value contained in the node in the first jump list, the node pointed to by the second pointer, the jump auxiliary value contained in the node in the second jump list, and the logical sequence number; and move the first pointer and / or the second pointer to determine the boundary nodes of the search range in the first jump list and / or the second jump list based on the target positional relationship; wherein, the target positional relationship includes the positional relationship between the node pointed to by the first pointer and the starting node and / or the positional relationship between the node pointed to by the second pointer and the starting node, and the boundary nodes include the node pointed to by the first pointer, the node pointed to by the second pointer, the first upper bound node of the starting node in the first jump list, and the second upper bound node of the starting node in the jump list.
[0183] In some embodiments, the jump auxiliary value contained in a node in the jump list is determined based on the number of nodes to the lower left of the node, where the nodes to the lower left of the node are those located before the node and whose layer number is less than the node. In the process of determining the target positional relationship based on the node pointed to by the first pointer, the jump auxiliary value contained in the node in the first jump list, the node pointed to by the second pointer, the jump auxiliary value contained in the node in the second jump list, and the logical sequence number, the third adjustment submodule is specifically used to: determine the number of first nodes based on the jump auxiliary value contained in the node pointed to by the first pointer and the jump auxiliary value contained in the nodes located on the movement trajectory of the first pointer in the current layer, where the number of first nodes reflects the number of nodes before the node pointed to by the first pointer in the first jump list; determine the number of second nodes based on the jump auxiliary value contained in the node pointed to by the second pointer and the jump auxiliary value contained in the nodes located on the movement trajectory of the second pointer in the current layer, where the number of second nodes reflects the number of nodes before the node pointed to by the second pointer in the second jump list; and determine the target positional relationship based on the number of first nodes, the number of second nodes, and the logical sequence number.
[0184] In some embodiments, during the process of determining the target positional relationship based on the number of first nodes, the number of second nodes, and the logical sequence number, the third adjustment submodule is specifically used to: if the number of first nodes is greater than the logical sequence number, determine that the starting node is located before the node pointed to by the first pointer; and / or, if the number of first nodes is less than or equal to the logical sequence number, determine the target positional relationship based on the number of first nodes, the number of second nodes, and the logical sequence number; and / or, if the number of second nodes is greater than the logical sequence number, determine that the starting node is located before the node pointed to by the second pointer.
[0185] In some embodiments, during the process of determining the target positional relationship based on the number of first nodes, the number of second nodes, and the logical sequence number, the third adjustment submodule is specifically used to: if the sum of the number of first nodes and the number of second nodes is greater than the logical sequence number and the node pointed to by the first pointer is after the node pointed to by the second pointer, then determine that the starting node is before the node pointed to by the first pointer; and / or, if the sum of the number of first nodes and the number of second nodes is greater than the logical sequence number and the node pointed to by the first pointer is before the node pointed to by the second pointer, then determine that the starting node is before the node pointed to by the second pointer.
[0186] In some embodiments, during the process of determining the target positional relationship based on the number of first nodes, the number of second nodes, and the logical sequence number, the third adjustment submodule is specifically used to: if the sum of the number of first nodes and the number of second nodes is less than or equal to the logical sequence number and the node pointed to by the first pointer is after the node pointed to by the second pointer, then determine the upper bound of the position of the node pointed to by the second pointer based on the sum of the numbers, and determine the target positional relationship based on the upper bound of the position and the logical sequence number; and / or, if the sum of the numbers is less than or equal to the logical sequence number and the node pointed to by the first pointer is before the node pointed to by the second pointer, then determine the lower bound of the position of the node pointed to by the second pointer based on the sum of the numbers, and determine the target positional relationship based on the lower bound of the position and the logical sequence number.
[0187] In some embodiments, during the process of determining the target positional relationship based on the upper bound of the position and the logical sequence number, the third adjustment submodule is specifically used to: if the upper bound of the position is less than the logical sequence number, determine that the starting node is located after the node pointed to by the second pointer; and / or, if the upper bound of the position is greater than or equal to the logical sequence number, determine that the starting node is located before the node pointed to by the first pointer.
[0188] In some embodiments, during the process of determining the target positional relationship based on the lower bound of the position and the logical sequence number, the third adjustment submodule is specifically used to: if the lower bound of the position is less than the logical sequence number, determine that the starting node is located after the node pointed to by the first pointer; and / or, if the lower bound of the position is greater than or equal to the logical sequence number, determine that the starting node is located before the node pointed to by the second pointer.
[0189] In some embodiments, during the process of moving the first pointer and / or the second pointer according to the target position relationship and determining the boundary node of the search range in the first skip list and / or the second skip list, the third adjustment submodule is specifically used to: if the starting node is located before the node pointed to by the first pointer, then determine the first upper bound node as the node pointed to by the first pointer, backtrack the first pointer to the previous node with the same level and then descend one level, and then point the first pointer to the next node on the same level, and continue searching for the starting node in the first skip list; or, if the starting node is located after the node pointed to by the first pointer, then descend the first pointer one level, and then point the first pointer to the next node on the same level, and continue searching for the starting node in the first skip list.
[0190] In some embodiments, during the process of moving the first pointer and / or the second pointer according to the target position relationship and determining the boundary node of the search range in the first skip list and / or the second skip list, the third adjustment submodule is specifically used to: if the starting node is located before the node pointed to by the second pointer, then determine the second upper bound node as the node pointed to by the second pointer, backtrack the second pointer to the previous node with the same level and then down one level, and then point the second pointer to the next node on the same level, and continue searching for the starting node in the second skip list; or, if the starting node is located after the node pointed to by the second pointer, then downtrack the second pointer one level, and then point the second pointer to the next node on the same level, and continue searching for the starting node in the second skip list.
[0191] In some embodiments, during the process of determining the starting node in the jump list according to the search range, the third adjustment submodule is specifically used to: determine the sequence number range of the boundary node in all nodes of the first jump list and all nodes of the second jump list according to the jump auxiliary values contained in the nodes of the first jump list and the jump auxiliary values contained in the nodes of the second jump list; and determine the starting node in the boundary node or the adjacent nodes of the boundary node by comparing the sequence number range with the logical sequence number.
[0192] In some embodiments, the third adjustment module is further configured to: if the first pointer points to the last level of the first skip list and the second pointer does not point to the last level of the second skip list, then if it is necessary to lower the first pointer by one level, lower the second pointer by one level and then point the second pointer to the same level of the next node; and / or, if the second pointer points to the last level of the second skip list and the first pointer does not point to the last level of the first skip list, then if it is necessary to lower the second pointer by one level, lower the first pointer by one level and then point the first pointer to the same level of the next node; and / or, if the first pointer points to the last level of the first skip list and the second pointer points to the last level of the second skip list, then determine that the query of the starting node satisfies the termination condition.
[0193] Figure 8 The provided page redirection device can execute the corresponding method embodiments described above, and its implementation principle and technical effect are similar, so they will not be described again here.
[0194] According to embodiments of the present disclosure, the present disclosure also provides an electronic device, the electronic device including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the scheme provided in any of the above embodiments.
[0195] According to embodiments of this disclosure, this disclosure also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the scheme provided in any of the above embodiments.
[0196] According to embodiments of this disclosure, this disclosure also provides a computer program product comprising: a computer program stored in a readable storage medium, at least one processor of an electronic device being able to read the computer program from the readable storage medium, and the at least one processor executing the computer program causing the electronic device to perform the scheme provided in any of the above embodiments.
[0197] Figure 9 This is a schematic block diagram of an example electronic device 900 that can be used to implement embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0198] like Figure 9 As shown, the electronic device 900 includes a computing unit 901, which can make decisions based on data stored in a read-only memory (ROM). Figure 9 Taking ROM 902 as an example, the computer program is loaded from storage unit 908 into the random access memory (RAM). Figure 9 The computer program in RAM 903 (for example) performs various appropriate actions and processes. RAM 903 can also store various programs and data required for the operation of electronic device 900. The computing unit 901, ROM 902, and RAM 903 are interconnected via bus 904. Input / output (I / O) interface (… Figure 9 (Taking I / O interface 905 as an example) is also connected to bus 904.
[0199] Multiple components in electronic device 900 are connected to I / O interface 905, including: input unit 906, such as keyboard, mouse, etc.; output unit 907, such as various types of displays, speakers, etc.; storage unit 908, such as disk, optical disk, etc.; and communication unit 909, such as network card, modem, wireless transceiver, etc. Communication unit 909 allows electronic device 900 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0200] The computing unit 901 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 901 performs the various methods and processes described above, such as page jump methods. For example, in some embodiments, the page jump method can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 900 via ROM 902 and / or communication unit 909. When the computer program is loaded into RAM 903 and executed by the computing unit 901, one or more steps of the page jump method described above can be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform a page navigation method by any other suitable means (e.g., by means of firmware).
[0201] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard parts (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0202] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0203] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0204] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0205] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0206] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service ecosystem, addressing the shortcomings of traditional physical hosts and VPS (Virtual Private Server, or simply "VPS") services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers incorporating blockchain technology.
[0207] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this disclosure can be achieved, and this is not limited herein.
[0208] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A page jump method, comprising: determining a page number of a to-be-jumped page; determining a logical serial number of a start node of the to-be-jumped page in a skip list according to the page number and the number of nodes occupied by each page before the to-be-jumped page in the skip list, wherein the skip list comprises a plurality of nodes, at least one of the nodes is a node corresponding to the to-be-jumped page, and data in the node comprises page data and a jump auxiliary value, and the jump auxiliary value contained in the node is used to reflect the number of nodes before the node in the skip list; finding the start node in the skip list according to the logical serial number and the jump auxiliary value contained in the node; obtaining page data of the to-be-jumped page from the start node; jumping to the to-be-jumped page according to the page data of the to-be-jumped page.
2. The page jump method of claim 1, wherein, The finding the start node in the skip list according to the logical serial number and the jump auxiliary value contained in the node comprises: starting from the highest layer of the first node of the skip list, comparing the jump auxiliary value contained in the node pointed to by a pointer in the skip list with the logical serial number to obtain a comparison result, wherein the comparison result reflects the relationship between the node pointed to by the pointer and the start node; if the comparison result reflects that the node pointed to by the pointer is the start node, determining that the start node is found, otherwise, adjusting the pointing of the pointer in the skip list according to the comparison result until the start node is found in the skip list.
3. The page jump method of claim 2, wherein, The adjusting the pointing of the pointer in the skip list according to the comparison result comprises: if the comparison result reflects that the start node is located after the node pointed to by the pointer, adjusting the pointer to point to a next node having the same layer; and / or, if the comparison result reflects that the start node is located before the node pointed to by the pointer, backtracking the pointer to a previous node having the same layer and then pointing the pointer to a next node having the same layer after moving the pointer down one layer.
4. The page jump method of claim 2, wherein, The jump auxiliary value contained in the node in the skip list is the number of left lower nodes of the node in the skip list plus 1, wherein the left lower node of the node is a node located before the node and having a layer less than the node. The comparing the jump auxiliary value contained in the node pointed to by the pointer with the logical serial number comprises: comparing the difference between the jump auxiliary value contained in the node pointed to by the pointer and the logical serial number minus 1 to obtain the comparison result; wherein, if the comparison result is that the jump auxiliary value contained in the node pointed to by the pointer is equal to the difference, the comparison result reflects that the node pointed to by the pointer is the start node; if the comparison result is that the jump auxiliary value contained in the node pointed to by the pointer is less than the difference, the comparison result reflects that the start node is located after the node pointed to by the pointer; otherwise, the comparison result reflects that the start node is located before the node pointed to by the pointer.
5. The page jump method according to any one of claims 1 to 4, wherein, If the number of nodes occupied by each page in the plurality of pages in the skip list is the same, the determining the logical serial number of the start node of the to-be-jumped page in the skip list according to the page number and the number of nodes occupied by each page before the to-be-jumped page in the skip list comprises: Determine the logical sequence number according to the page number and the number of nodes occupied by the single page in the skip list.
6. The page jump method of claim 1, wherein, The number of the skip lists is multiple, and the starting node is found in the skip list according to the logical sequence number and the jump auxiliary value corresponding to the node in the skip list, comprising: Adjust the pointer of at least one of the multiple skip lists according to the jump auxiliary value contained in the node of the multiple skip lists and the logical sequence number, so as to narrow the search range of the starting node, until the search of the starting node meets the end condition; Determine the starting node in the skip list according to the search range.
7. The page jump method of claim 6, wherein, When the number of the skip lists is two, the two skip lists include a first skip list and a second skip list, the first skip list is used to store the page data in a first state, and the second skip list is used to store the page data in a second state; The adjustment of the pointer of at least one of the multiple skip lists according to the jump auxiliary value contained in the node of the multiple skip lists and the logical sequence number, so as to narrow the search range of the starting node, until the search of the starting node meets the end condition, comprises: Move the first pointer in the first skip list and the second pointer in the second skip list according to the jump auxiliary value contained in the node of the first skip list, the jump auxiliary value contained in the node of the second skip list and the logical sequence number, so as to narrow the search range, until the search of the starting node meets the end condition.
8. The page jump method of claim 7, wherein, The moving of the first pointer in the first skip list and / or the moving of the second pointer in the second skip list according to the jump auxiliary value contained in the node of the first skip list, the jump auxiliary value contained in the node of the second skip list and the logical sequence number, so as to narrow the search range, until the search of the starting node meets the end condition, comprises: For each skip list, point the pointer in the skip list to the highest layer of the first node in the skip list, and then move the pointer to the next node in the same layer; Move the first pointer and the second pointer according to the node pointed by the first pointer, the jump auxiliary value contained in the node of the first skip list, the node pointed by the second pointer, the jump auxiliary value contained in the node of the second skip list and the logical sequence number, to determine the search range; If the search of the starting node meets the end condition, stop searching the starting node, otherwise continue to move the first pointer in the first skip list and / or move the second pointer in the second skip list, to narrow the search range.
9. The page jump method of claim 8, wherein, The moving of the first pointer and the second pointer according to the node pointed by the first pointer, the jump auxiliary value contained in the node of the first skip list, the node pointed by the second pointer, the jump auxiliary value contained in the node of the second skip list and the logical sequence number, to determine the search range, comprises: Determine the target position relationship according to the node pointed by the first pointer, the jump auxiliary value contained in the node of the first skip list, the node pointed by the second pointer, the jump auxiliary value contained in the node of the second skip list and the logical sequence number; According to the target position relationship, the first pointer and / or the second pointer is moved, and a boundary node of the search range is determined in the first skip list and / or the second skip list; The target position relationship includes a position relationship between the node pointed to by the first pointer and the start node and / or a position relationship between the node pointed to by the second pointer and the start node, and the boundary node includes the node pointed to by the first pointer, the node pointed to by the second pointer, a first upper bound node of the start node in the first skip list, and a second upper bound node of the start node in the second skip list.
10. The page jump method of claim 9, wherein, The skip auxiliary value contained in the node in the skip list is determined according to the number of left lower nodes of the node, the left lower node of the node being a node located before the node and having a layer number smaller than that of the node; The target position relationship is determined according to the node pointed to by the first pointer, the skip auxiliary value contained in the node in the first skip list, the node pointed to by the second pointer, the skip auxiliary value contained in the node in the second skip list, and the logical serial number, including: A first node number is determined according to the skip auxiliary value contained in the node pointed to by the first pointer and the skip auxiliary value contained in the node located on the moving track of the first pointer in the current layer, the first node number reflecting the number of nodes in front of the node pointed to by the first pointer in the first skip list; A second node number is determined according to the skip auxiliary value contained in the node pointed to by the second pointer and the skip auxiliary value contained in the node located on the moving track of the second pointer in the current layer, the second node number reflecting the number of nodes in front of the node pointed to by the second pointer in the second skip list; The target position relationship is determined according to the first node number, the second node number, and the logical serial number.
11. The page jump method of claim 10, wherein, The target position relationship is determined according to the first node number, the second node number, and the logical serial number, including: If the first node number is greater than the logical serial number, it is determined that the start node is located before the node pointed to by the first pointer; And / or, if the first node number is less than or equal to the logical serial number, the target position relationship is determined according to the first node number, the second node number, and the logical serial number; And / or, if the second node number is greater than the logical serial number, it is determined that the start node is located before the node pointed to by the second pointer.
12. The page jump method of claim 11, wherein, The target position relationship is determined according to the first node number, the second node number, and the logical serial number, including: If the sum of the number of the first node number and the second node number is greater than the logical serial number and the node pointed to by the first pointer is located after the node pointed to by the second pointer, it is determined that the start node is located before the node pointed to by the first pointer; And / or, if the sum of the number of the first node number and the second node number is greater than the logical serial number and the node pointed to by the first pointer is located before the node pointed to by the second pointer, it is determined that the start node is located before the node pointed to by the second pointer.
13. The page jump method of claim 11, wherein, The determining the target position relationship according to the first node quantity, the second node quantity and the logical sequence number comprises: if the sum of the first node quantity and the second node quantity is less than or equal to the logical sequence number and the node pointed by the first pointer is behind the node pointed by the second pointer, determining an upper position limit of the node pointed by the second pointer according to the sum, and determining the target position relationship according to the upper position limit and the logical sequence number; and / or, if the sum is less than or equal to the logical sequence number and the node pointed by the first pointer is ahead of the node pointed by the second pointer, determining a lower position limit of the node pointed by the second pointer according to the sum, and determining the target position relationship according to the lower position limit and the logical sequence number.
14. The page jump method of claim 13, wherein, The determining the target position relationship according to the upper position limit and the logical sequence number comprises: if the upper position limit is less than the logical sequence number, determining that the start node is behind the node pointed by the second pointer; and / or, if the upper position limit is greater than or equal to the logical sequence number, determining that the start node is ahead of the node pointed by the first pointer.
15. The page jump method of claim 13, wherein, The determining the target position relationship according to the lower position limit and the logical sequence number comprises: if the lower position limit is less than the logical sequence number, determining that the start node is behind the node pointed by the first pointer; and / or, if the lower position limit is greater than or equal to the logical sequence number, determining that the start node is ahead of the node pointed by the second pointer.
16. The page jump method according to any one of claims 9 to 15, wherein, The moving the first pointer and / or the second pointer according to the target position relationship and determining the boundary node of the search range in the first skip list and / or the second skip list comprises: if the start node is ahead of the node pointed by the first pointer, determining the first upper limit node as the node pointed by the first pointer, retreating the first pointer to the previous node with the same layer and then descending one layer, and then pointing the first pointer to the next node on the same layer to continue searching the start node in the first skip list; or, if the start node is behind the node pointed by the first pointer, descending the first pointer by one layer, and then pointing the first pointer to the next node on the same layer to continue searching the start node in the first skip list.
17. The page jump method of any one of claims 9 to 15, wherein, The moving the first pointer and / or the second pointer according to the target position relationship and determining the boundary node of the search range in the first skip list and / or the second skip list comprises: if the start node is ahead of the node pointed by the second pointer, determining the second upper limit node as the node pointed by the second pointer, retreating the second pointer to the previous node with the same layer and then descending one layer, and then pointing the second pointer to the next node on the same layer to continue searching the start node in the second skip list; and / or, if the start node is behind the node pointed by the second pointer, descending the second pointer by one layer, and then pointing the second pointer to the next node on the same layer to continue searching the start node in the second skip list. Or, if the start node is located after the node pointed to by the second pointer, the second pointer is lowered by one level, and the second pointer is pointed to the next node at the same level, and the start node is searched in the second skip list.
18. The page jump method according to any one of claims 9 to 15, wherein, The start node is determined in the skip list according to the search range, including: The sequence number range of the boundary node in all nodes of the first skip list and all nodes of the second skip list is determined according to the jump auxiliary values contained in the nodes of the first skip list and the jump auxiliary values contained in the nodes of the second skip list; The start node is determined in the boundary node or the adjacent node of the boundary node by comparing the sequence number range with the logical sequence number.
19. The page jump method according to any one of claims 7 to 15, further comprising: If the first pointer points to the last level of the first skip list and the second pointer does not point to the last level of the second skip list, the second pointer is lowered by one level if necessary, and the second pointer is pointed to the same level of the next node; And / or, if the second pointer points to the last level of the second skip list and the first pointer does not point to the last level of the first skip list, the first pointer is lowered by one level if necessary, and the first pointer is pointed to the same level of the next node; And / or, if the first pointer points to the last level of the first skip list and the second pointer points to the last level of the second skip list, it is determined that the query of the start node satisfies an end condition.
20. A page jump device, comprising: a page number determination unit configured to determine a page number of a page to be jumped to; a sequence number determination unit configured to determine a logical sequence number of a start node of the page to be jumped to in a skip list according to the page number and a number of nodes occupied by each page before the page to be jumped to in the skip list, the skip list comprising a plurality of nodes, at least one of the plurality of nodes being a node corresponding to the page to be jumped to, data in the node comprising page data and a jump auxiliary value, the jump auxiliary value contained in the node being used to reflect a number of nodes located before the node in the skip list; a node searching unit configured to search for the start node in the skip list according to the logical sequence number and the jump auxiliary value contained in the node; a data acquisition unit configured to acquire page data of the page to be jumped to from the start node; a jump unit configured to jump to the page to be jumped to according to the page data of the page to be jumped to.
21. An electronic device, comprising: at least one processor; and a memory connected in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the page jump method of any one of claims 1 to 19.
22. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the page jump method according to any one of claims 1 to 19.
23. A computer program product comprising a computer program which, when executed by a processor, implements the steps of the page jump method according to any one of claims 1 to 19.
Citation Information
Patent Citations
Page redirection analysis method and apparatus
CN105867897A
Page jumping method and device, electronic equipment and storage medium
CN113641936A