Page processing method, apparatus, device, storage medium and program product

By updating the first parent page in the index tree and merging the first page and the second page, the merging failure problem caused by the splitting of the parent page is solved, and the success rate of page processing is improved.

WO2025196534A1PCT designated stage Publication Date: 2025-09-25CLOUD INTELLIGENCE ASSETS HOLDING (SINGAPORE) PTE LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/IB2025/051586
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-03-20
Filing Date
2025-02-14
Publication Date
2025-09-25

AI Technical Summary

Technical Problem

In the prior art, when an electronic device merges child pages in an index tree, the merging fails because the parent page is split, resulting in a low page processing success rate.

Method used

By determining the first page and the second page in the index tree, updating the first parent page corresponding to the first page, merging the first page and the second page, and deleting the first page, the parent page is prevented from being split, thereby improving the merging success rate.

Benefits of technology

Improves the page processing success rate of the index tree and avoids merge failures caused by parent pages being split.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure IB2025051586_25092025_PF_FP_ABST
    Figure IB2025051586_25092025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present disclosure are a page processing method, an apparatus, a device, a storage medium and a program product. The method comprises: determining a first page in an index tree corresponding to a disk, wherein the index tree comprises a plurality of pages, and the pages are used for indexing data blocks or storage data in the disk; determining in the index tree a second page corresponding to the first page, and updating a first parent page corresponding to the first page on the basis of the first page and the second page, wherein the first parent page is used for indexing the first page; and merging the first page and the second page, and deleting the first page in the index tree. The present disclosure improves the success rate of page processing of index trees.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This disclosure claims priority to Chinese patent application No. 202410322840.3, filed with the China Patent Office on March 20, 2024, entitled "Page Processing Method, Apparatus, Device, Storage Medium, and Program Product," the entire contents of which are incorporated herein by reference. TECHNICAL FIELD This disclosure relates to the field of storage, and more particularly to a page processing method, apparatus, device, storage medium, and program product. BACKGROUND An electronic device may include a storage device. The electronic device may read and write data in the storage device based on an index tree. The index tree may include multiple pages. In related art, an electronic device may perform page processing on pages in an index tree to modify the structure of the index tree. When merging two subpages in an index tree, the electronic device may fail to merge the two subpages because the parent page corresponding to the two subpages is split. As can be seen from the above, in related technologies, the success rate of page processing in an index tree is low. SUMMARY OF THE INVENTION Various aspects of the present disclosure provide a page processing method, apparatus, device, storage medium, and program product for improving the success rate of page processing in an index tree. In a first aspect, an embodiment of the present disclosure provides a page processing method, comprising: determining a first page in an index tree corresponding to a disk, the index tree including multiple pages, the pages used to index or store data; determining a second page corresponding to the first page in the index tree, and updating a first parent page corresponding to the first page based on the first and second pages, the first parent page used to index the first page; merging the first and second pages, and deleting the first page from the index tree. In one possible implementation, updating a first parent page corresponding to the first page based on the first page and the second page includes: determining a first key value range corresponding to the first page and a second key value range corresponding to the second page; determining a target key value range based on the first key value range and the second key value range, where the target key value range includes the first key value range and the second key value range; updating page content of the first parent page based on the target key value range, and updating index-related information of the first parent page.In one possible embodiment, updating the page content of the first parent page according to the target key value range includes: determining, in the first parent page, a first index record corresponding to the first page and a second index record corresponding to the second page, the first index record including the identifier of the first page and the maximum key value in the first key value range, and the second index record including the identifier of the second page and the maximum key value in the second key value range; generating a target record according to the target key value range, the target record including the identifier of the second page and the maximum key value in the target key value range; updating the second index record in the first parent page to the target record, and deleting the first index record. In another possible embodiment, updating the index-related information of the first parent page includes: determining a first storage address on disk for a first update record corresponding to the first parent page; generating a first disk-written record corresponding to the first parent page, the first disk-written record including the memory address of the first parent page and the first storage address; and updating, in a page mapping table corresponding to the disk, the memory address corresponding to the first parent page to the memory address of the first disk-written record. In one possible implementation, merging the first page and the second page includes: creating a target page corresponding to the first and second pages; storing the content of the first and second pages in the target page; and updating index-related information of the target page. In one possible implementation, updating the index-related information of the target page includes: determining a second storage address of the target page on disk; generating a second disk-written record corresponding to the target page, the second disk-written record including the memory address of the target page and the second storage address; and updating the memory address of the second page in a page mapping table corresponding to the disk to the memory address of the second disk-written record. In one possible implementation, deleting the first page from the index tree includes: deleting the first page; and deleting the memory address corresponding to the identifier of the first page in the page mapping table corresponding to the disk. In one possible implementation, determining the second page corresponding to the first page in the index tree includes: determining a left sibling page corresponding to the first page as the second page; or determining at least one adjacent page corresponding to the first page in the index tree, determining a page size of each adjacent page, and determining the second page from the at least one adjacent page based on the page size of each adjacent page, wherein the sum of the page sizes of the first page and the second page is less than or equal to a preset threshold.In one possible embodiment, the method further includes: determining a third page in the index tree, where the page size of the third page is greater than or equal to a second threshold; splitting the third page to obtain a fourth page and a fifth page, and updating index-related information for the fourth and fifth pages; determining a second parent page corresponding to the third page, and updating page content and index-related information for the second parent page. In one possible embodiment, splitting the third page to obtain the fourth and fifth pages includes: creating the fourth and fifth pages; determining a first portion of content and a second portion of content in the third page; storing the first portion of content in the fourth page, and storing the second portion of content in the fifth page. In one possible embodiment, updating the index-related information for the fourth page includes: determining a third storage address of the fourth page on the disk; generating a third disk-write record corresponding to the fourth page, the third disk-write record including the memory address of the fourth page and the third storage address; and storing the identifier of the fourth page and the memory address of the third disk-write record in a page mapping table corresponding to the disk. In one possible implementation, updating index-related information for the fifth page includes: determining a fourth storage address of the fifth page on the disk; generating a fourth flush record corresponding to the fifth page, the fourth flush record including the memory address of the fifth page and the fourth storage address; and updating the memory address corresponding to the third page in a page mapping table corresponding to the disk with the memory address of the fourth flush record. In another possible implementation, updating the page content of the second parent page includes: determining a third index record corresponding to the third page in the second parent page, the third index record including an identifier of the third page and a maximum key value in a third key value range corresponding to the third page; determining a fourth key value range corresponding to the fourth page and a fifth key value range corresponding to the fifth page; generating a fourth index record corresponding to the fourth page based on the fourth key value range, the fourth index record including the identifier of the fourth page and the maximum key value in the fourth key value range; updating the maximum key value in the third key value range in the third index record to the maximum key value in the fifth key value range in the second parent page, and adding the fourth index record.In one possible implementation, updating the index-related information of the second parent page includes: determining a fifth storage address on the disk for a second update record corresponding to the second parent page; generating a fifth disk-write record corresponding to the second parent page, the fifth disk-write record including the memory address of the second parent page and the fifth storage address; and updating, in a page mapping table corresponding to the disk, the memory address corresponding to the second parent page to the memory address of the fifth disk-write record. In one possible implementation, the method further includes: receiving a data operation request including a target key value; searching the index tree for a sixth page corresponding to the target key value; and if data corresponding to the target key value does not exist on the sixth page, performing integrity repair on the index tree to obtain a target index tree. In one possible implementation, performing integrity repair on the index tree to obtain a target index tree includes: determining a sixth key value range corresponding to the sixth page; when determining that the target key value is greater than a maximum key value in the sixth key value range, determining a seventh page, the seventh page being the right sibling page of the sixth page; and performing integrity repair on the index tree based on the page size of the seventh page to obtain the target index tree. In one possible implementation, performing integrity repair on the index tree based on the page size of the seventh page to obtain the target index tree includes: if the page size of the seventh page is greater than or equal to a third threshold, mounting the seventh page to the index tree to obtain the target index tree; if the page size of the seventh page is less than the third threshold, merging the seventh page into the sixth page in the index tree to obtain the target index tree. In one possible implementation, the page size of the first page is less than or equal to a first threshold. In a second aspect, an embodiment of the present disclosure provides a page processing device, comprising: a first determination module, a second determination module, an update module, and a processing module, wherein the first determination module is used to determine a first page in an index tree corresponding to a disk, the index tree including multiple pages, the pages being used to index data blocks or stored data in the disk; the second determination module is used to determine a second page corresponding to the first page in the index tree; the update module is used to update a first parent page corresponding to the first page based on the first page and the second page, the first parent page being used to index the first page; and the processing module is used to merge the first page and the second page, and delete the first page from the index tree.In one possible embodiment, the update module is specifically configured to: determine a first key value range corresponding to the first page and a second key value range corresponding to the second page; determine a target key value range based on the first key value range and the second key value range, the target key value range including the first key value range and the second key value range; update the page content of the first parent page and update index-related information of the first parent page based on the target key value range. In one possible embodiment, the update module is specifically configured to: determine, in the first parent page, a first index record corresponding to the first page and a second index record corresponding to the second page, the first index record including the identifier of the first page and the maximum key value in the first key value range, the second index record including the identifier of the second page and the maximum key value in the second key value range; generate a target record based on the target key value range, the target record including the identifier of the second page and the maximum key value in the target key value range; update the second index record in the first parent page to the target record, and delete the first index record. In one possible embodiment, the update module is specifically configured to: determine a first storage address on the disk for a first update record corresponding to the first parent page; generate a first disk flush record corresponding to the first parent page, the first disk flush record including the memory address of the first parent page and the first storage address; and update the memory address corresponding to the first parent page in the page mapping table corresponding to the disk with the memory address of the first disk flush record. In one possible embodiment, the processing module is specifically configured to: create a target page corresponding to the first and second pages; store the contents of the first and second pages to the target page; and update index-related information of the target page. In one possible embodiment, the processing module is specifically configured to: determine a second storage address on the disk for the target page; generate a second disk flush record corresponding to the target page, the second disk flush record including the memory address of the target page and the second storage address; and update the memory address of the second page in the page mapping table corresponding to the disk with the memory address of the second disk flush record. In one possible embodiment, the processing module is specifically configured to: delete the first page; and delete the memory address corresponding to the identifier of the first page in the page mapping table corresponding to the disk.In one possible implementation, the second determination module is specifically configured to: determine the left sibling page corresponding to the first page as the second page; or determine at least one adjacent page corresponding to the first page in the index tree, determine the page size of each adjacent page, and determine the second page from the at least one adjacent page based on the page size of each adjacent page, wherein the sum of the page sizes of the first and second pages is less than or equal to a preset threshold. In one possible implementation, the first determination module is further configured to determine a third page in the index tree, wherein the page size of the third page is greater than or equal to a second threshold; the processing module is further configured to split the third page to obtain a fourth page and a fifth page; the update module is further configured to update index-related information of the fourth and fifth pages; the second determination module is further configured to determine a second parent page corresponding to the third page; and the update module is further configured to update page content and index-related information of the second parent page. In one possible embodiment, the processing module is specifically configured to: create the fourth page and the fifth page; determine the first portion of content and the second portion of content in the third page; store the first portion of content in the fourth page, and store the second portion of content in the fifth page. In one possible embodiment, the update module is specifically configured to: determine a third storage address of the fourth page on the disk; generate a third disk flush record corresponding to the fourth page, the third disk flush record including the memory address of the fourth page and the third storage address; and store the identifier of the fourth page and the memory address of the third disk flush record in a page mapping table corresponding to the disk. In one possible embodiment, the update module is specifically configured to: determine a fourth storage address of the fifth page on the disk; generate a fourth disk flush record corresponding to the fifth page, the fourth disk flush record including the memory address of the fifth page and the fourth storage address; and update the memory address corresponding to the third page in the page mapping table corresponding to the disk to the memory address of the fourth disk flush record.In one possible implementation, the update module is specifically configured to: determine, in the second parent page, a third index record corresponding to the third page, the third index record including an identifier of the third page and a maximum key value in a third key value range corresponding to the third page; determine a fourth key value range corresponding to the fourth page and a fifth key value range corresponding to the fifth page; generate, based on the fourth key value range, a fourth index record corresponding to the fourth page, the fourth index record including an identifier of the fourth page and a maximum key value in the fourth key value range; update, in the second parent page, the maximum key value in the third key value range in the third index record to the maximum key value in the fifth key value range, and add the fourth index record. In one possible implementation, the update module is specifically configured to: determine a fifth storage address on the disk for the second update record corresponding to the second parent page; generate a fifth flush record corresponding to the second parent page, the fifth flush record including a memory address of the second parent page and the fifth storage address; and update, in a page mapping table corresponding to the disk, the memory address corresponding to the second parent page to the memory address of the fifth flush record. In one possible embodiment, the apparatus further includes: a receiving module, a search module, and a repair module, wherein the receiving module is configured to receive a data operation request including a target key value; the search module is configured to search the index tree for the sixth page corresponding to the target key value; and the repair module is configured to, if the data corresponding to the target key value does not exist on the sixth page, perform integrity repair on the index tree to obtain a target index tree. In one possible embodiment, the repair module is specifically configured to: determine a sixth key value range corresponding to the sixth page; if it is determined that the target key value is greater than the maximum key value in the sixth key value range, determine a seventh page, the seventh page being the right sibling page of the sixth page; and perform integrity repair on the index tree based on the page size of the seventh page to obtain the target index tree. In one possible implementation, the repair module is specifically configured to: if the page size of the seventh page is greater than or equal to a third threshold, mount the seventh page to the index tree to obtain the target index tree; and if the page size of the seventh page is less than the third threshold, merge the seventh page into the sixth page in the index tree to obtain the target index tree. In another possible implementation, the page size of the first page is less than or equal to a first threshold.In a third aspect, embodiments of the present disclosure provide an electronic device, comprising: a memory and a processor; the memory storing computer-executable instructions; and the processor executing the computer-executable instructions stored in the memory, causing the electronic device to perform any of the methods described in the first aspect. In a fourth aspect, embodiments of the present disclosure provide a computer-readable storage medium storing computer-executable instructions, which, when executed by the processor, implement any of the methods described in the first aspect. In a fifth aspect, embodiments of the present disclosure provide a computer program product, comprising a computer program, which, when executed by the processor, implements any of the methods described in the first aspect. Embodiments of the present disclosure provide a page processing method, apparatus, device, storage medium, and program product. The electronic device may determine a first page in an index tree corresponding to a disk, determine a second page corresponding to the first page in the index tree, and update a first parent page corresponding to the first page based on the first and second pages. The electronic device may merge the first and second pages and delete the first page from the index tree. Because the first parent page corresponding to the first page can be updated based on the first and second pages before deleting the first page, the situation where the first and second pages cannot be merged due to the splitting of the first parent page is avoided, thereby improving the success rate of page processing in the index tree. BRIEF DESCRIPTION OF THE DRAWINGS The drawings described herein are provided to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are provided to explain the present disclosure and are not intended to unduly limit the present disclosure. In the accompanying drawings: Figure 1 is a scenario diagram provided by an exemplary embodiment of the present disclosure; Figure 2 is a schematic diagram of a Bwe-tree working principle provided by an exemplary embodiment of the present disclosure; Figure 3 is a flow chart of a page processing method provided by an exemplary embodiment of the present disclosure; Figure 4 is a flow chart of another page processing method provided by an exemplary embodiment of the present disclosure; Figure 5 is a process diagram of a page processing method provided by an exemplary embodiment of the present disclosure; Figure 6 is a flow chart of another page processing method provided by an exemplary embodiment of the present disclosure; Figure 7 is a process diagram of another page processing method provided by an exemplary embodiment of the present disclosure; Figure 8 is a schematic diagram of an incomplete index tree provided by an exemplary embodiment of the present disclosure; Figure 9 is a flow chart of another page processing method provided by an exemplary embodiment of the present disclosure; Figure 10 is a structural diagram of a page processing device provided by an exemplary embodiment of the present disclosure; Figure 11 is a structural diagram of another page processing device provided by an exemplary embodiment of the present disclosure; Figure 12 is a structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure.DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, storage, and display) involved in this disclosure are all authorized by the user or fully authorized by all parties. The collection, use, and processing of the relevant data must comply with relevant laws, regulations, and standards, and corresponding operation portals are provided for users to choose to authorize or reject. To further clarify the objectives, technical solutions, and advantages of this disclosure, the technical solutions of this disclosure will be clearly and completely described below in conjunction with specific embodiments of this disclosure and the corresponding drawings. Obviously, the described embodiments are only some of the embodiments of this disclosure, and are not exhaustive. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure. Figure 1 is a schematic diagram of a scenario provided by an exemplary embodiment of this disclosure. Referring to Figure 1, an electronic device may include an index tree. The index tree may include multiple pages, which may include a root page, multiple index pages, and multiple leaf pages. For example, the index tree may include a root page, under which index pages 1, ..., and n may correspond; under index page 1 may correspond index pages 1-1, 1-2, and 1-3; ...; under index page n may correspond index page n-1 and index page n-2; under index page 1T may correspond leaf pages 1-1-1, 1-1-2, and 1-1-3; under index page n-2 may correspond leaf pages n-2-1 and n-2-3. oAn electronic device can merge or split pages in an index tree. For example, the electronic device can merge leaf page 1-1-1 and leaf page 1-1-2; or split leaf page 1-1-3 to obtain leaf pages 1-1-4 and 1-1-5. In related art, an electronic device can perform page processing on pages in an index tree to modify the structure of the index tree. When an electronic device merges two subpages in an index tree, the parent page corresponding to the two subpages may be split, making it impossible to merge the two subpages, resulting in page processing failure. Therefore, in related art, the success rate of page processing on an index tree is low. In an embodiment of the present disclosure, the electronic device can determine a first page in the index tree and determine a second page corresponding to the first page. Based on the first and second pages, the electronic device can update the first parent page corresponding to the first page, then merge the first and second pages, and delete the first page. Because the first parent page corresponding to the first page can be updated based on the first and second pages before deleting the first page, the situation where the first and second pages cannot be merged due to the splitting of the first parent page is avoided, thereby improving the success rate of page processing in the index tree. In the technical solution of the present disclosure, an index tree named Bwe-tree is provided. To facilitate understanding of the technical solution of the present disclosure, the working principle of the index tree Bwe-tree is first explained below in conjunction with Figure 2. Figure 2 is a schematic diagram of the working principle of a Bwe-tree provided by an exemplary embodiment of the present disclosure. Referring to Figure 2, the electronic device may include a disk and a memory. The memory may be provided with a page mapping table, which can be used to manage the index tree. The page mapping table may include page identifiers and mapping entries. For example, in the page mapping table, 0, 1, 2, . . .

[0002] 9 is a page identifier, and each page identifier corresponds to a mapping entry. A mapping entry can store a corresponding memory address or storage address. A memory address refers to an address in memory, and a storage address refers to an address on disk. Any page (also called a node) in the Bwe-tree can be identified by P. For example, page 2 can be represented as P2 O It should be noted that different pages corresponding to the same page identifier can be distinguished by key value range. For example, the page corresponding to page identifier 2 may be page P2 [400, 500). After the update, the page corresponding to page identifier 2 may be page P2 [400, 700].

[0003] A Bwe-tree can include multiple index pages and multiple leaf pages. For example, in a Bwe-tree, pages P3 and P8 can be index pages, and pages P2 and P4 can be leaf pages. Page P3 can be the parent page of pages P2 and P4. Each index page can have a corresponding key value range. An index page can store index records corresponding to multiple child pages, pointers to each child page, and pointers to right sibling pages. Optionally, the pointers can be the memory addresses or storage addresses of the corresponding pages. For example, as shown in Figure 2, the key value range corresponding to page P3 can be (-8, 1000). Page P3 can store: the index record corresponding to page P1 (P1, 400), the index record corresponding to page P2 (P2, 700), the index record corresponding to page P4 (P4, 1000), and a pointer to the right sibling page P8. Each leaf page has a corresponding key value range [low key, high key). The leaf page stores multiple key-value pairs within the key value range and pointers to the right sibling page. Each value has a corresponding log sequence number (LSN). For example, in a Bwe-tree, the key value range of page P2 can be [400, 700). Then page P2 stores: values ​​corresponding to keys 400 to 700, and pointers to the right sibling page P4. For example, key 400 can have a pair of historical data corresponding to key value 400, and value 2 can be Electronic devices can perform page processing on pages in an index tree through a structure modification operation (SMO). When performing an operation on a page in the index tree, an operation record corresponding to the page can be generated and linked to the page, rather than directly modifying the page. Operation records can include data increment records (data-delete), flush records (flush-delete), and stub records. Any operation record can include the memory address of the corresponding page or the memory address of the previous operation record, a data increment count, a page fragment count, and a page size. If the operation record is a flush record, the flush record can also include the storage address of the page fragment on disk. The page size refers to the total size of multiple key-value pairs and LSNs in the page, that is, the size of the logical page. For any page, each time an operation record corresponding to that page is generated, the mapping entry corresponding to that page can be updated with the memory address of the operation record, so that the mapping entry corresponding to that page can point to the operation record for that page. For example, as shown in Figure 2, when page P2 is flushed to disk, that is, when page P2 is stored to disk as P2 page fragment 1, a flush record a corresponding to page P2 can be generated. Flush record a can include the memory address of page P2 in memory, a data increment count of 0, a page fragment count of 1, a page size of 4 KB (kilobytes), and the storage address 1 of P2 page fragment 1 on disk. In the page mapping table, the mapping entry corresponding to page ID 2 can be updated with the memory address of flush record a. When new data is added to page P2, a data increment record 1 corresponding to P2 can be generated. Data incremental record 1 may include the newly added data for page P2, namely the value corresponding to key value 515, the memory address of disk-written record a, a data incremental count of 1, a page fragment count of 2, and a page size of 6 KB. In the page mapping table, the memory address of disk-written record a can be updated to the memory address of data incremental record 1 in the mapping entry corresponding to page ID 2. Similarly, when the value corresponding to key value 455 is updated for page P2, data incremental record 2 can be generated.Incremental data record 2 may include: the newly added data for page P2, i.e., the value corresponding to key value 455, the memory address of incremental data record 2, a data increment count of 2, a page fragment count of 2, and a page size of 7 KB. In the page mapping table, the memory address of incremental data record 1 may be updated to the memory address of incremental data record 2 in the mapping entry corresponding to page identifier 2. When page P2 is flushed to disk again, i.e., the newly added data of page P2 is stored to disk as P2 page fragment 2, a flush record b corresponding to page P2 may be generated. Flush record b may include the memory address of incremental data record 2, a data increment count of 2, a page fragment count of 2, a page size of 7 KB, and the storage address 2 of P2 page fragment 2 on disk. In the page mapping table, the memory address of incremental data record 2 may be updated to the memory address of flush record b in the mapping entry corresponding to page identifier 2. It should be noted that, on disk, P2 page fragment 2 may include the storage address of P2 page fragment 1. When page P2 is flushed to disk again, incremental storage can be performed, storing only the incremental data (515...) and (455...) for page P2. This helps reduce storage write amplification. When memory is insufficient, pages in memory can be stored to disk, deleted from memory, and the corresponding stub record stored in memory to reduce memory usage. For example, when memory is insufficient, page P4 can be stored to disk, and stub record 1 corresponding to page P4 can be stored in memory. Stub record 1 may include the disk address of page P4. In the page mapping table, the mapping entry corresponding to page ID 4 can be updated with the memory address of stub record 1. For any page, if the page is deleted, the ID corresponding to the page can be recycled and linked to the IDs of other free pages. For example, as shown in FIG2 , if page 0, page 9, page 7, and page 6 are free pages, page ID 0 can point to page ID 9, page ID 9 can point to page ID 7, page ID 7 can point to page ID 6, and page ID 6 can point to page ID 0, so as to link the page IDs of the four free pages together.It should be noted that when flushing any page to disk, the specific process is as follows: If the page is linked to multiple operation records, when the data increment count in the operation records reaches a threshold, the page can be updated based on the multiple operation records to obtain a new page, and the new page can be stored as a page fragment in the buffer. If the data increment count in the operation records has not reached the threshold and flushing to disk is still required, the page and the multiple operation records can be stored as a page fragment in the buffer. The buffer can store page fragments corresponding to multiple pages. When the buffer is full, the multiple page fragments in the buffer can be encapsulated into a data block and stored to disk, i.e., flushed to disk. The technical solutions disclosed in this disclosure are described in detail below through specific embodiments. It should be noted that the following embodiments may exist independently or in combination with each other. Identical or similar content will not be repeated in different embodiments. Figure 3 is a flow chart of a page processing method provided by an exemplary embodiment of this disclosure. Referring to Figure 3, the method may include:

[0004] S301. Determine the first page in the index tree corresponding to the disk. The execution subject of the embodiment of the present disclosure may be an electronic device, or a page processing device provided in the electronic device. The page processing device may be implemented by software, or by a combination of software and hardware. The page processing device may be a processor in the electronic device. For ease of understanding, the following description will be based on an example in which the execution subject is an electronic device. In the technical solution of the present disclosure, the page size of the first page may be less than or equal to a first threshold. For example, the first threshold may be 4KB. O The first page may also be a non-leftmost page under the first parent page corresponding to the first page. For example, in the index tree shown in FIG1 , the first page may be leaf page 1 T -2 or leaf page 1 -1 -3 OAn electronic device may be provided with an index tree corresponding to a disk. The index tree may include multiple pages, each of which may be used to index or store data. For example, the index tree may be the Bwe-treeo described in Figure 2 . In the index tree corresponding to the disk, the electronic device may determine a page whose page size is less than or equal to a first threshold and is not the leftmost page as the first page. For example, if the first threshold is 4 KB, if the page size of page P10 is 6 KB, and page P10 is not the leftmost page, the electronic device may determine page P10 as the first page. S302: Determine the second page corresponding to the first page in the index tree, and update the first parent page corresponding to the first page based on the first and second pages. The first parent page may be used to index the first page. The first parent page may be the index page described in Figure 2 . If the first parent page has other pages corresponding to it, the first parent page may also index other pages. For example, if the first parent page is page P3 and the first page is page P10, and page P3 corresponds not only to page P10 but also to pages P1, P2, and P4, then page P3 can index not only page P10 but also pages P1, P2, and P4. In an optional embodiment, based on the first and second pages, the first parent page corresponding to the first page is updated by: determining a first key value range corresponding to the first page and a second key value range corresponding to the second page; determining a target key value range based on the first and second key value ranges; and updating the page content of the first parent page and the index-related information of the first parent page based on the target key value range. Any page can have a corresponding key value range. For example, the first key value range corresponding to page P10 can be [500, 700]. The target key value range can include both the first and second key value ranges. For example, if the first page is page P10, the electronic device determines in the index tree that the second page corresponding to page P10 is page P2 [400, 500). If the first parent page corresponding to page P10 is page P3, the first key value range corresponding to page P10 is [500, 700); the second key value range corresponding to page P2 [400, 500) is [400, 500). Then, based on the first key value range [500, 700) and the second key value range [400, 500), the target key value range can be determined to be [400, 700). Then, based on the target key value range [400, 700), the page content of page P3 can be updated, and the index-related information of page P3 can be updated.

[0005] S303. Merge the first and second pages and delete the first page from the index tree. In an optional embodiment, the first and second pages can be merged in the following manner: create a target page corresponding to the first and second pages; store the content of the first and second pages in the target page; and update the index-related information of the target page. For example, if the first page is page P10 and the second page is page P2[400, 500), the electronic device can create the target page, store the content of page P10 and page P2[400, 500) in the target page, and update the index-related information of the target page. The electronic device can create the target page as the new page P2[400, 700]. After merging page P10 and page P2[400, 500), the electronic device can delete page P10 from the index tree. In an embodiment of the present disclosure, an electronic device may determine a first page in an index tree corresponding to a disk, determine a second page corresponding to the first page in the index tree, and update the first parent page corresponding to the first page based on the first and second pages. The electronic device may merge the first and second pages and delete the first page from the index tree. Because the first parent page corresponding to the first page can be updated based on the first and second pages before deleting the first page, this avoids situations where the first and second pages cannot be merged due to the splitting of the first parent page, thereby improving the success rate of page processing in the index tree. The following describes the above-described page processing method in detail, based on the embodiment shown in FIG. 3 and in conjunction with FIG. 4 . FIG. 4 is a schematic flow chart of another page processing method provided by an exemplary embodiment of the present disclosure. Referring to FIG. 4 , the method may include:

[0006] S401. Determine the first page in the index tree corresponding to the disk. It should be noted that the execution process of step S401 can refer to the execution process of step S301 and will not be repeated here.

[0007] S402. Determine the second page corresponding to the first page in the index tree. Optionally, determining the second page corresponding to the first page in the index tree may include the following two methods: Method 1: Determine the left sibling page corresponding to the first page as the second page. If the first page has a left sibling page, the left sibling page corresponding to the first page may be determined as the second page. Optionally, determining the left sibling page corresponding to the first page may be done by: determining the first parent page corresponding to the first page; then, in the index record of the first parent page, determining a second index record that is adjacent to the left of the first index record corresponding to the first page, and determining the page corresponding to the second index record as the left sibling page corresponding to the first page. For example, if the first page is page P10, the first parent page corresponding to page P10 is page P3, and if the multiple index records included in page P3 are: (P1, 400) (P2, 500) (P10, 700) (P4, 1000), then it can be determined that the first index record corresponding to page P10 is (P10, 700), the second index record adjacent to the left of the first index record (P10, 700) is (P2, 500), and the page corresponding to the second index record is page P2 [400, 500), then it can be determined that the left sibling page corresponding to page P10 is page P2 [400, 500), and page P2 [400, 500) can be determined as the second page. Method 2: Determine at least one adjacent page corresponding to the first page in the index tree, determine the page size of each adjacent page, and determine a second page from the at least one adjacent page based on the page size of each adjacent page. The sum of the page sizes of the first and second pages is less than or equal to a preset threshold. For example, the preset threshold may be 16KB. O For example, if the first page is page P10, if the left adjacent page corresponding to page P10 is page P2 [400, 500) and the corresponding right adjacent page is page P4, then the page size 1 of page P2 [400, 500) and the page size 2 of page P4 can be determined respectively. Assuming that the sum of the page sizes of page P10 and page P2 [400, 500) is greater than a preset threshold, and the sum of the page sizes of page P10 and page P4 is less than the preset threshold, then page P4 can be determined as the second page.

[0008] S403. Determine a first key value range corresponding to the first page and a second key value range corresponding to the second page. For example, if the first page is page P10 and the second page is page P2 [400, 500), then the first key value range corresponding to page P10 can be determined to be [500, 700), and the second key value range corresponding to page P2 [400, 500) can be determined to be [400, 500].

[0009] S404. Determine a target key value range based on the first key value range and the second key value range. For example, if the first key value range is [500, 700) and the second key value range is [400, 500)], the target key value range can be determined as [400, 700) based on the first key value range [500, 700) and the second key value range [400, 500)].

[0010] S405. Update the page content of the first parent page according to the target key value range. In an optional embodiment, the page content of the first parent page can be updated according to the target key value range in the following manner: determine, in the first parent page, a first index record corresponding to the first page and a second index record corresponding to the second page; generate a target record according to the target key value range; update the second index record in the first parent page to the target record; and delete the first index record. The first index record can include the identifier of the first page and the first key value range; the second index record can include the identifier of the second page and the second key value range. The target record can include the identifier of the second page and the maximum key value in the target key value range. For example, if the first parent page is page P3, and page P3 includes multiple index records: (P1, 400), (P2, 500), (P10, 700), (P4, 1000), then the first index record corresponding to page P10 can be determined in page P3 to be (P10, 700), and the second index record corresponding to page P2 [400, 500] can be determined to be (P2, 500). If the target key value range is [400, 700), then the target record (P2, 700) can be generated based on the target key value range [400, 700). The electronic device can update the second index record (P2, 500) in page P3 to the target record (P2, 700) and delete the first index record (P10, 700), resulting in a new page P3. The multiple index records included in the new page P3 may be: (P1, 400) (P2, 700) (P4, 1000).

[0011] S406. Update the index-related information of the first parent page. In an optional embodiment, the index-related information of the first parent page can be updated in the following manner: determining the first storage address on disk of the first update record corresponding to the first parent page; generating a first disk-written record corresponding to the first parent page; and updating the memory address corresponding to the first parent page in the corresponding page mapping table on disk to the memory address of the first disk-written record. The first update record is a record that updates the page content of the first parent page according to the target key value range. The electronic device can store the first update record on disk as the first page fragment corresponding to the first parent page and determine the first storage address on disk of the first update record. Optionally, if the second page fragment corresponding to the first parent page is already stored on disk and the second page fragment is stored on disk before the first page fragment, after the first update record is stored on disk as the first page fragment, the first page fragment can also include the storage address of the second page fragment to link the first and second page fragments corresponding to the first parent page. For example, if the first parent page is page P3, and update record 1 corresponding to page P3 is: Update the second index record (P2, 500) to the target record (P2, 700) in page P3, and delete the first index record (P10, 700), then update record 1 can be stored on disk as page fragment 2 corresponding to page P3. If page fragment 1 corresponding to page P3 already exists on disk, and page fragment 1 is stored on disk before page fragment 2, page fragment 2 corresponding to page P3 can include the storage address of page fragment 1. The electronic device can generate a first disk-write record corresponding to the first parent page in memory and link the first disk-write record to the first parent page. The first disk-write record can include the memory address and first storage address of the first parent page. Optionally, the first disk-write record can also include a data increment count, a page fragment count, and the page size of the first parent page. For example, if the first parent page is page P3, the electronic device may generate disk write record 1 corresponding to page P3. Disk write record 1 may include the memory address of page P3, a data increment count of 0, a page fragment count of 2, a page size of 2KB, and the first storage address of update record 1 (i.e., page fragment 2 corresponding to page P3) on the disk.Because the memory address of the first parent page is stored in the mapping entry corresponding to the first parent page identifier in the page mapping table before the first disk flush record is generated, after the first disk flush record corresponding to the first parent page is generated in memory, the electronic device can update the memory address of the first parent page in the page mapping table to the memory address of the first disk flush record, so that the first parent page identifier in the page mapping table can point to the first disk flush record. For example, if the first parent page is page P3, and page P3 has a corresponding disk flush record 1, the memory address of page P3 can be updated in the mapping entry corresponding to page identifier 3 in the page mapping table to the memory address of disk flush record 1.

[0012] S407. Create target pages corresponding to the first and second pages. For example, if the first page is page P10 and the second page is page P2[400, 500), the electronic device may create target pages corresponding to page P10 and page P2[400, 500). Before creating the target pages, a pending deletion flag may be set in the mapping entry corresponding to the identifier of the first page in the page mapping table. For example, if the first page is page P10, the electronic device may set a pending deletion flag in the mapping entry corresponding to the page identifier 10 in the page mapping table.

[0013] 5408. Store the contents of the first page and the second page to the target page. For example, if the first page is page P10, and page P10 stores multiple key-value pairs within the first key value range [500, 700), and the second page is page P2 [400, 500), and page P2 [400, 500) stores multiple key-value pairs within the second key value range [400, 500), then the electronic device can store the contents of page P10 and page P2 [400, 500) to the target page, and the target page can store multiple key-value pairs within the target key value range [400, 700), and the target page can be represented as target page P2 [400, 700). Since for any page, the page stores a pointer to the right sibling page, after storing the contents of the first page and the second page to the target page, the pointer to the right sibling page of the first page can also be stored in the target page, and the right sibling page corresponding to the first page is used as the right sibling page corresponding to the target page. For example, if the first page is page P10, the right sibling page of page P10 is page P4, and a pointer to page P4 is stored in page P10, then after the electronic device stores the contents of page P10 and page P2 [400, 500) in the target page, it may also store a pointer to page P4 to indicate that the right sibling page of the target page is page P4. O

[0014] S409. Update the index-related information of the target page. In an optional embodiment, the index-related information of the target page can be updated in the following manner: determining the second storage address of the target page on the disk; generating a second disk-written record corresponding to the target page; and updating the memory address of the second page in the corresponding page mapping table on the disk to the memory address of the second disk-written record. The electronic device can determine the second storage address of the target page on the disk and store the target page on the disk. The electronic device can also set a deletion confirmation flag corresponding to the first page in the target page. The deletion confirmation flag is used to indicate that the first page has been deleted. For example, if the target page is target page P2[400,700), the second storage address of target page P2[400,700] on the disk can be determined, and target page P2[400,700] can be stored on the disk. If the first page is page P10, the electronic device may also set a deletion confirmation flag corresponding to page P10 in the target page P2[400, 700) on the disk. The electronic device may generate a second disk flush record corresponding to the target page in memory and link the second disk flush record to the target page. The second disk flush record may include the memory address and the second storage address of the target page. Optionally, the second disk flush record may also include a data increment count, a page fragment count, and the page size of the target page. For example, if the target page is target page P2[400, 700), the electronic device may generate disk flush record 2 corresponding to target page P2[400, 700]. Disk flush record 2 may include the memory address of target page P2[400, 700), a data increment count of 0, a page fragment count of 1, a page size of 7 KB, and the second storage address of target page P2[400, 700) on the disk. Because the memory address of the second page is stored in the mapping entry corresponding to the second page identifier in the page mapping table before the second flush record is generated, after generating the second flush record corresponding to the target page (i.e., the new second page) in memory, the electronic device can update the memory address of the second page in the page mapping table to the memory address of the second flush record, so that the second page identifier in the mapping table can point to the second flush record. For example, if the target page is target page P2[400, 700), and target page P2[400, 700] has a corresponding flush record 2, the memory address of the original page P2[400, 500] in the mapping entry corresponding to page identifier 2 in the page mapping table can be updated to the memory address of flush record 2.

[0015] S410: Delete the first page from the index tree. Optionally, the electronic device may delete the first page and delete the memory address corresponding to the identifier of the first page from the page mapping table corresponding to the disk. Since the mapping entry corresponding to the identifier of the first page in the page mapping table corresponding to the disk may also store an identifier to be deleted, the electronic device may delete the identifier to be deleted from the mapping entry corresponding to the identifier of the first page. For example, if the first page is page P10 and the identifier corresponding to page P10 is page identifier 10, the electronic device may delete page P10 and delete the memory address corresponding to page P10 and the identifier to be deleted from the mapping entry corresponding to page identifier 10 in the page mapping table. In an embodiment of the present disclosure, the electronic device may determine the first page in the index tree corresponding to the disk and determine the second page corresponding to the first page in the index tree. The electronic device may determine a first key value range corresponding to the first page and a second key value range corresponding to the second page, and determine a target key value range based on the first and second key value ranges. The electronic device may update the page content of the first parent page based on the target key value range and update the index-related information of the first parent page. The electronic device can create a target page corresponding to the first and second pages, store the content of the first and second pages in the target page, and update the index-related information of the target page, thereby deleting the first page from the index tree. Because the first parent page corresponding to the first page can be updated based on the first and second pages before deleting the first page, this avoids the situation where the first and second pages cannot be merged due to the splitting of the first parent page, thereby improving the success rate of page processing in the index tree. The page processing method described above is further described below, based on any of the above embodiments and in conjunction with FIG5 . FIG5 is a schematic diagram of a page processing method provided by an exemplary embodiment of the present disclosure. Referring to FIG5 , the method includes steps ①, ②, ③, ④, ⑤, ⑥, ⑦, ⑧, and ⑨. In step ①, the electronic device can determine that the first page in the index tree Bwe-tree is page P10. In step ②, the electronic device can determine that the second page corresponding to page P10 is page P2 [400, 500]. In step ③, the electronic device can update the first parent page based on the first and second pages. If the first parent page corresponding to page P10 is page P3, the electronic device can update page P3 based on page P2 [400, 500) and page P10.Specifically, the electronic device may determine that the first key value range corresponding to page P10 is [500, 700), and the second key value range corresponding to page P2 [400, 500) is [400, 500), and determine the target key value range as [400, 700) based on the first key value range [500, 700) and the second key value range [400, 500), and then generate the target record (P2, 700) based on the target key value range [400, 700). The electronic device may determine in page P3 that the first index record corresponding to page P10 is (P10, 700), and the second index record corresponding to page P2 [400, 500) is (P2, 500), and then update the second index record (P2, 500) to the target record (P2, 700), and delete the first index record (P10, 700). The updated page P3 includes multiple index records: (P1, 400) (P2, 700) (P4, 1000). oAfter step ④, the electronic device may determine update record 1 for page P3 and store it on disk as P3 page fragment 2. Since P3 page fragment 1 is already stored on disk, P3 page fragment 2 may include the storage address of P3 page fragment 1. The electronic device may generate disk write record 1. Disk write record 1 may include the memory address of page P3 and the first storage address of update record 1 (i.e., P3 page fragment 2) on disk. In step ⑤, the electronic device may update the mapping entry corresponding to page identifier 3 in the page mapping table. Specifically, the electronic device may update the memory address of page P3 to the memory address of disk write record 1 in the mapping entry corresponding to page identifier 3. In step ⑥, the electronic device may merge the first and second pages. Specifically, the electronic device may create a target page and store the content of page P10 and page P2 ([400, 500)) on the target page. The target page may then store multiple key-value pairs within the target key value range [400, 700). The electronic device may use the right sibling page P4 corresponding to page P10 as the right sibling page P4 corresponding to the target page. The target page may be represented as target page P2 [400, 700). Before merging page P10 and page P2 [400, 500), the electronic device may set a pending deletion flag in the mapping item corresponding to page flag 10 in the page mapping table. In step ⑦, the electronic device may store the target page P2 [400, 700) as P2 page fragment 1 to the disk, and set a confirmation deletion flag corresponding to page P10 in the target page P2 [400, 700). The electronic device may generate a disk record 2 corresponding to the target page P2 [400, 700). ODisk flush record 2 may include the memory address of target page P2 [400, 700) and the second storage address of target page P2 [400, 700) (i.e., P2 page fragment 1) on disk. In step ⑧, the electronic device may update the mapping entry corresponding to page identifier 2 in the page mapping table. Specifically, the memory address of page P2 [400, 500) may be updated in the mapping entry corresponding to page identifier 2 to the memory address of disk flush record 2. In step ⑨, the electronic device may delete page P10 and delete the memory address corresponding to page identifier 10 and the pending deletion identifier from the mapping entry corresponding to page identifier 10 in the page mapping table. It should be emphasized that in the technical solution of the present disclosure, since a first page less than or equal to a first threshold can be determined in the index tree and the first and second pages can be merged, the number of pages in the index tree is reduced, the problem of read amplification caused by too many pages in the index tree is avoided, and the efficiency of data processing in the index tree is improved. In an embodiment of the present disclosure, an electronic device may determine a first page in an index tree corresponding to a disk and a second page corresponding to the first page in the index tree. The electronic device may determine that the first and second pages update a first parent page and update the index-related information of the first parent page. The electronic device may create target pages corresponding to the first and second pages, store the content of the first and second pages in the target pages, update the index-related information of the target pages, and then delete the first page from the index tree. Because the first parent page corresponding to the first page can be updated based on the first and second pages before deleting the first page, this avoids the situation where the first and second pages cannot be merged due to the splitting of the first parent page, thereby improving the success rate of page processing in the index tree. Figures 3-5 above illustrate a page processing method for merging pages in an index tree. The technical solution of the present disclosure also provides a page processing method for splitting pages in an index tree. The following describes the page processing method for splitting pages in an index tree in conjunction with Figures 6-8. Figure 6 is a flow chart of another page processing method provided by an exemplary embodiment of the present disclosure. Referring to Figure 6, the method may include:

[0016] S601. Determine a third page in the index tree. The page size of the third page may be greater than or equal to a second threshold. For example, the second threshold may be 16 KB. OOptionally, the first portion of content and the second portion of content may be determined in the third page. The first portion of content may be the right portion of content, and the second portion of content may be the left portion of content. The size of the second portion of content in the third page may be greater than or equal to a first threshold. The electronic device may determine, in the index tree corresponding to the disk, a page with a size greater than or equal to the second threshold as the third page. For example, if the second threshold is 16 KB and the page size of page P2[400,700) is 16 KB, the electronic device may determine page P2[400,700) as the third page.

[0017] S602. Split the third page to obtain a fourth page and a fifth page. In an optional embodiment, splitting the third page to obtain the fourth page and the fifth page can be performed in the following manner: creating the fourth page and the fifth page; determining a first portion of content and a second portion of content in the third page; storing the first portion of content in the fourth page, and storing the second portion of content in the fifth page. The electronic device can create the fourth page and the fifth page in memory. The electronic device can determine a first portion of content and a second portion of content in the third page, where the first portion of content can be the right portion of content and the second portion of content can be the left portion of content. For example, if the third page is page P2 [400, 700), the electronic device can determine in page P2 [400, 700) that the first portion of content is multiple key-value pairs within [500, 700), and the second portion of content is multiple key-value pairs within [400, 500). The electronic device can then store the first portion of content on the fourth page, assuming the fourth page is page P10; and the second portion of content can be stored on the fifth page, which can be represented as page P2 [400, 500]. Since a pointer to a right sibling page is stored on any page, after the first portion of content on the third page is stored on the fourth page, since the first portion of content is the right portion of content, a pointer to the right sibling page of the third page can also be stored on the fourth page, and the right sibling page corresponding to the third page is used as the right sibling page corresponding to the fourth page. For example, if the third page is page P2 [400, 700), and its corresponding right sibling page is page P4, then after the first portion of content is stored in the fourth page, a pointer to page P4 can be stored in the fourth page to indicate that the right sibling page of the fourth page is page P4. OSince the first portion of content is stored in the fourth page and the second portion of content is stored in the fifth page, and the second portion of content is right adjacent to the first portion of content, the fourth page can serve as the right sibling page of the fifth page. Therefore, after storing the second portion of content in the fifth page, a pointer to the fourth page can also be stored in the fifth page to indicate that the fifth page's right sibling page is the fourth page. For example, if the first portion of content stored in the fourth page consists of multiple key-value pairs within the range [500, 700), and the second portion of content stored in the fifth page consists of multiple key-value pairs within the range [400, 500), and if the fourth page is page P10, a pointer to page P10 can be stored in the fifth page (page P2 [400, 500)) to indicate that the right sibling page of page P2 [400, 500) is page P10.

[0018] S603. Update index-related information for the fourth and fifth pages. In an optional embodiment, the index-related information for the fourth page can be updated in the following manner: determining the third storage address of the fourth page on the disk; generating a third disk-write record corresponding to the fourth page; and storing an identifier of the fourth page and the memory address of the third disk-write record in a corresponding page mapping table on the disk. The electronic device can determine the third storage address of the fourth page on the disk and store the fourth page on the disk. The electronic device can also set a pending allocation (Pending Allocation) flag on the fourth page. The pending allocation flag indicates that the fourth page is to be mounted to the index tree. For example, if the fourth page is page P10, the third storage address of page P10 on the disk can be determined, and page P10 can be stored on the disk. The electronic device can also set a pending allocation flag on page P10 on the disk. The electronic device can generate a third disk-write record corresponding to the fourth page in memory and mount the third disk-write record after the fourth page. The third disk-write record can include the memory address and the third storage address of the fourth page. Optionally, the second disk flush record may also include a data increment count, a page fragment count, and the page size of the fourth page. For example, if the fourth page is page P10, the electronic device may generate disk flush record 3 corresponding to page P10. Disk flush record 3 may include the memory address of page P10, a data increment count of 0, a page fragment count of 1, a page size of 6 KB, and the third storage address of page P10 on the disk. The electronic device may store the identifier of the fourth page and the memory address of the third disk flush record in a corresponding page mapping table on the disk, so that the identifier of the fourth page in the page mapping table points to the third disk flush record. Optionally, the electronic device may also set a pending allocation identifier in the mapping entry corresponding to the identifier of the fourth page in the page mapping table. For example, if the fourth page is page P10, the page identifier 10 may be stored in the page mapping table, and the memory address of disk flush record 3 and the pending allocation identifier may be stored in the mapping entry corresponding to the page identifier 10. In an optional embodiment, the index-related information of the fifth page can be updated in the following manner: determining the fourth storage address of the fifth page on the disk; generating a fourth disk-written record corresponding to the fifth page; and updating the memory address corresponding to the third page in a page mapping table corresponding to the disk to the memory address of the fourth disk-written record. The electronic device can determine the fourth storage address of the fifth page on the disk and store the fifth page on the disk. The electronic device can also set a confirmed allocation (ValidingAllocation) flag for the fourth page in the fifth page.The allocation confirmation flag can be used to indicate that the fourth page has been mounted to the index tree. For example, if the fifth page is page P2[400, 500), the fourth storage address of page P2[400, 500) on the disk can be determined, and page P2[400, 500) can be stored on the disk. The electronic device can also set a confirmed allocation flag for page P10 in page P2[400, 500) on the disk. The electronic device can generate a fourth disk-push record corresponding to the fifth page in memory and mount the fourth disk-push record after the fifth page. The fourth disk-push record can include the memory address and the fourth storage address of the fifth page. Optionally, the fourth disk-push record can also include a data increment count, a page fragment count, and the page size of the fifth page. For example, if the fifth page is page P2[400, 500), the electronic device may generate disk flush record 4 corresponding to page P2[400, 500]. Disk flush record 4 may include the memory address of page P2[400, 500), a data increment count of 0, a page fragment count of 1, a page size of 10 KB, and the fourth storage address of page P2[400, 500] on the disk. In the page mapping table corresponding to the disk, the memory address corresponding to the third page is updated to the address of the fourth disk flush record in the memory, so that the identifier of the third page in the page mapping table can point to the fourth disk flush record. For example, if the third page is page P2[400, 700) and the fifth page is page P2[400, 500), then since both the third and fifth pages correspond to page identifier 2 and the mapping entry corresponding to page identifier 2 stores the memory address of the third page, the electronic device can update the memory address corresponding to the third page in the mapping entry corresponding to page identifier 2 in the page mapping table to the memory address of disk record 4. Alternatively, since a pointer to the fourth page is already stored in the fifth page and a confirmed allocation flag is set for the fourth page, the electronic device can delete the pending allocation flag in the page mapping table, in the mapping entry corresponding to the fourth page identifier, and in the fourth page on disk. For example, if the fourth page is page P10, the pending allocation flag can be deleted in the page mapping table, in the mapping entry corresponding to page identifier 10, and in page P10 on disk.

[0019] S603: Determine the second parent page corresponding to the third page, and update the page content and index-related information of the second parent page. In an optional embodiment, the page content of the second parent page can be updated in the following manner: determine a third index record corresponding to the third page in the second parent page; determine a fourth key value range corresponding to the fourth page and a fifth key value range corresponding to the fifth page; generate a fourth index record corresponding to the fourth page based on the fourth key value range; update the maximum key value in the third key value range in the third index record to the maximum key value in the fifth key value range in the second parent page, and add a fourth index record. The third index record may include an identifier of the third page and the maximum key value in the third key value range corresponding to the third page. The fourth index record may include an identifier of the fourth page and the maximum key value in the fourth key value range. For example, if the second parent page is page P3, and page P3 includes multiple index records: (P1, 400), (P2, 700), (P4, 1000), and if the third page is page P2 [400, 700), then the third index record in page P3 can be determined to be (P2, 700). If the fourth page is page P10, then the electronic device can determine that the fourth key value range corresponding to page P10 is [500, 700). If the fifth page is page P2 [400, 500), then the fifth key value range corresponding to the fifth page can be determined to be [400, 500). The electronic device can generate a fourth index record corresponding to page P10 as (P10, 700) based on the fourth key value range [500, 700). o Since the maximum key value in the fifth key value range is 500, the electronic device can update the third index record (P2, 700) to (P2, 500) on page P3 and add a fourth index record (P10, 700) to page P3. The updated page P3 may include multiple index records: (P1, 400) (P2, 500) (P10, 700) (P4, 1000) oIn an optional embodiment, the index-related information of the second parent page can be updated in the following manner: determining the fifth storage address on disk of the second update record corresponding to the second parent page; generating a fifth disk-written record corresponding to the second parent page; and updating the memory address corresponding to the second parent page in the corresponding page mapping table to the memory address of the fifth disk-written record. The second update record is a record of updating the page content of the second parent page. The electronic device can store the second update record on disk as the first page fragment corresponding to the second parent page and determine the fifth storage address on disk of the second update record. Optionally, if the second page fragment corresponding to the second parent page is already stored on disk and the second page fragment is stored on disk before the first page fragment, after the second update record is stored on disk as the first page fragment, the first page fragment can also include the storage address of the second page fragment, thereby linking the first page fragment and the second page fragment corresponding to the second parent page. For example, if the second parent page is page P3, and update record 2 corresponding to page P3 is: updating the third index record (P2, 700) to (P2, 500) in page P3, and adding the fourth index record (P10, 700) in page P3, then update record 2 can be stored on disk as page fragment 2 corresponding to page P3. If page fragment 1 corresponding to page P3 already exists on disk, and page fragment 1 is stored on disk before page fragment 2, page fragment 2 corresponding to page P3 can include the storage address of page fragment 1. The electronic device can generate a fifth disk flush record corresponding to the second parent page in memory and link the fifth disk flush record to the second parent page. The fifth disk flush record can include the memory address and the fifth storage address of the second parent page. Optionally, the fifth disk flush record can also include a data increment count, a page fragment count, and the page size of the second parent page. For example, if the second parent page is page P3, the electronic device may generate disk flush record 5 corresponding to page P3. Disk flush record 5 may include the memory address of page P3, a data increment count of 0, a page fragment count of 2, a page size of 2 KB, and the fifth storage address on disk of update record 2 (i.e., page fragment 2 corresponding to page P3). Because the mapping entry corresponding to the identifier of the second parent page in the page mapping table stores the memory address of the second parent page before the first disk flush record is generated, after generating the fifth disk flush record corresponding to the second parent page in memory, the electronic device may update the memory address of the second parent page in the page mapping table to the memory address of the fifth disk flush record, so that the identifier of the second parent page in the page mapping table can point to the fifth disk flush record.For example, if the second parent page is page P3, and page P3 has a corresponding disk flush record 5, then the memory address of page P3 can be updated to the memory address of disk flush record 5 in the mapping entry corresponding to page identifier 3 in the page mapping table. In an embodiment of the present disclosure, the electronic device can determine the third page in the index tree, split the third page to obtain the fourth and fifth pages, and update the index-related information for the fourth and fifth pages. The electronic device can also determine the second parent page corresponding to the third page and update the page content and index-related information of the second parent page. Because the third page with a size greater than the second threshold can be determined in the index tree and split, the problem of read amplification caused by the need to load the entire content of the third page into memory when reading due to the third page's excessive size is avoided, thereby improving the efficiency of data processing in the index tree. Furthermore, the page processing process provided in the technical solution of the present disclosure is simpler than the page processing process in the prior art BW-Tree, thereby improving the efficiency of page processing in the index tree. The following further describes the above-mentioned page processing method based on the embodiment shown in FIG6 and in conjunction with FIG7 . FIG7 is a schematic diagram of another page processing method provided by an exemplary embodiment of the present disclosure. Referring to FIG7 , the method includes steps ①, ②, ③, ④, ⑤, ⑥, ⑦, ⑧, and ⑨. In step ①, the electronic device may determine in the index tree Bwe-tree that the third page is page P2 [400, 700]. In step ②, the electronic device may split the third page, i.e., page P2 [400, 700), to obtain a fourth page and a fifth page. Specifically, the electronic device may create the fourth and fifth pages. The electronic device may determine in page P2 [400, 700) that the first portion of content is multiple key-value pairs within [500, 700), and the second portion of content is multiple key-value pairs within [400, 500). The electronic device may store the multiple key-value pairs within [500, 700) in the fourth page, and the fourth page is page P10. The electronic device can also use the right sibling page P4 corresponding to page P2 [400, 700) as the right sibling page P4 corresponding to page P10; store multiple key-value pairs in [400, 500) in the fifth page, and the fifth page can be represented as page P2 [400, 500). o The electronic device can set the right sibling page of page P2 [400, 500) to page P10. In step ③, the electronic device can store page P10 to disk and set a pending allocation flag in page P10. The electronic device can generate a disk record corresponding to page P10.O Disk write record 3 may include the memory address of page P10, a data increment count of 0, a page fragment count of 1, a page size of 6 KB, and the third storage address of page P10 on the disk. In step 4, the electronic device may store the identifier of page P10 and the memory address of disk write record 3 in a corresponding page mapping table on the disk, and set a pending allocation identifier. In step 5, the electronic device may store page P2[400, 500) on the disk and set a confirmed allocation identifier for page P10 in P2[400, 500). The electronic device may generate disk write record 4 corresponding to page P2[400, 500). Disk write record 4 may include the memory address of page P2[400, 500), a data increment count of 0, a page fragment count of 1, a page size of 10 KB, and the fourth storage address of page P2[400, 500) on the disk. In step 6, the electronic device can update the mapping entry corresponding to page identifier 2 in the page mapping table. Specifically, in the mapping entry corresponding to page identifier 2, the memory address of page P2 [400, 700) can be updated to the memory address of disk record 4. Since the confirmed allocation identifier corresponding to page P10 is already set in page P2 [400, 500) on disk, the electronic device can delete the pending allocation identifier in the page mapping table, in the mapping entry corresponding to page identifier 10, and in page P10 on disk. In step 7, the electronic device can update the page content of the second parent page. If the second parent page is page P3, the electronic device can update the page content of page P3. Specifically, the electronic device may determine that the third index record in page P3 is (P2, 700). The electronic device may determine that the fourth key value range corresponding to page P10 is [500, 700), and the fifth key value range corresponding to the fifth page (i.e., page P2 [400, 500)) is [400, 500]. The electronic device may generate a fourth index record corresponding to page P10 as (P10, 700) based on the fourth key value range [500, 700). oSince the maximum key value in the fifth key value range is 500, the electronic device can update the third index record (P2, 700) to (P2, 500) in page P3, and add a fourth index record (P10, 700) in page P3. The updated page P3 may include multiple index records: (P1, 400) (P2, 500) (P10, 700) (P4, 1000) In step ⑧, the electronic device can determine the update record 2 for page P3. OThe electronic device may store the second update record for page P3 as P3 page fragment 2 to disk. Since P3 page fragment 1 is already stored on disk, P3 page fragment 2 may include the storage address of P3 page fragment 1. The electronic device may generate disk write record 5 corresponding to page P3. Disk write record 5 may include the memory address of page P3, a data increment count of 0, a page fragment count of 2, a page size of 2 KB, and the fifth storage address of update record 2 (i.e., page fragment 2 corresponding to page P3) on disk. In step 9, the electronic device may update the memory address of page P3 to the memory address of disk write record 5 in the mapping entry corresponding to page identifier 3 in the page mapping table. In the disclosed embodiment, the electronic device may determine the third page in the index tree, split the third page to obtain the fourth and fifth pages, and update the index-related information of the fourth and fifth pages. The electronic device may also determine the second parent page corresponding to the third page and update the page content and index-related information of the second parent page. Because third pages larger than the second threshold can be identified in the index tree and split, the problem of read amplification caused by the need to load the entire contents of the third page into memory when reading due to the third page's large size is avoided, thereby improving the efficiency of data processing in the index tree. Furthermore, the page processing process provided in the technical solution of the present disclosure is simpler than the page processing process in the prior art BW tree, thereby improving the efficiency of page processing in the index tree. Because electronic devices perform page processing in the index tree in multiple steps, a malfunction in the electronic device may cause some steps to be executed during page splitting or merging, resulting in an incomplete index tree. The following describes the situation of an incomplete index tree with reference to FIG8 . FIG8 is a schematic diagram of an incomplete index tree provided by an exemplary embodiment of the present disclosure. Referring to FIG8 , if the data operation request is to read the data corresponding to key value 600, the electronic device can determine page P2 [400, 500) based on the index record (P2, 700) in page P3 and search for the data corresponding to key value 600 in page P2 [400, 500). However, the key value range actually corresponding to page P2 [400, 500) is [400, 500). Key value 600 exceeds the key value range [400, 500) corresponding to page P2 [400, 500). The data corresponding to key value 600 is actually stored in page P10. At this point, the electronic device can determine that the index tree is incomplete.To address the situation described in FIG8 , the electronic device can determine whether the index tree is in the process of page splitting or merging, and proactively execute the remaining steps in page processing to repair the integrity of the index tree. The following describes a page processing method for repairing the integrity of the index tree, with reference to FIG9 . FIG9 is a schematic flow chart of another page processing method provided by an exemplary embodiment of the present disclosure. Referring to FIG9 , the method may include:

[0020] S901. Receive a data operation request. The data operation request may include a target key value. For example, the electronic device may receive data operation request 1. Data operation request 1 may include a target key value 600.

[0021] S902. Search the index tree for the sixth page corresponding to the target key value. Optionally, the electronic device may search the index tree layer by layer to determine the third parent page. Then, based on the index record and the target key value in the third parent page, the electronic device may determine the target index record corresponding to the target key value, and determine the page corresponding to the target index record as the sixth page corresponding to the target key value. The third parent page is the parent page of the sixth page. For example, if the electronic device determines in the index tree that the third parent page is page P3, and if page P3 includes multiple index records: (P1, 400), (P2, 700), (P4, 1000), and the target key value is 600, the electronic device may determine, based on the target key value 600 and the index records, that the target index record corresponding to the target key value 600 is (P2, 700). Furthermore, the electronic device may determine that the page P2 [400, 500] corresponding to the target index record (P2, 700) is the sixth page.

[0022] S903. If the data corresponding to the target key value does not exist in the sixth page, integrity repair is performed on the index tree to obtain the target index tree. In an optional embodiment, integrity repair can be performed on the index tree to obtain the target index tree in the following manner: determining the sixth key value range corresponding to the sixth page; if it is determined that the target key value is greater than the maximum key value in the sixth key value range, determining the seventh page; and performing integrity repair on the index tree based on the page size of the seventh page to obtain the target index tree. The seventh page is the right sibling page of the sixth page. After determining the sixth key value range corresponding to the sixth page, the electronic device can determine whether the target key value is greater than the maximum key value in the sixth key value range. If not, the target key value is within the sixth key value range, the index tree is complete, and integrity repair is not required. If so, the target key value is not within the sixth key value range, the index tree is incomplete, and the right sibling page of the sixth page can be determined to be the seventh page. In this case, integrity repair can be performed on the index tree based on the page size of the seventh page. For example, if the sixth page is page P2[400, 500), if the electronic device determines that the sixth key value range corresponding to page P2[400, 500) is [400, 500), and if the target key value is 600, the electronic device can determine that the target key value 600 is greater than the maximum key value 500 in the sixth key value range [400, 500]. If the right sibling page of page P2[400, 500) is page P10, the seventh page can be determined to be page P10, and the index tree can be repaired based on the page size of page P10. Optionally, the index tree can be repaired based on the page size of the seventh page to obtain the target index tree. This can include the following two cases: Case 1: If the page size of the seventh page is greater than or equal to the third threshold. In this case, it indicates that a page split is in progress, and the electronic device can then mount the seventh page to the index tree to obtain the target index tree. Specifically, the electronic device may update the page content and index-related information of the third parent page in the index tree to mount the seventh page to the index tree to obtain the target index tree.The execution process of updating the page content and index-related information of the third parent page can refer to the execution process in step S603, which is as follows: In an optional embodiment, the page content of the third parent page can be updated in the following manner: determining the fourth index record corresponding to the sixth page in the third parent page; determining the seventh key value range corresponding to the seventh page; generating the fifth index record corresponding to the sixth page based on the sixth key value range; generating the sixth index record corresponding to the seventh page based on the seventh key value range; in the third parent page, updating the fourth index record to the fifth index record, and adding the sixth index record. For example, if the third parent page is page P3, and page P3 includes multiple index records: (P1, 400), (P2, 700), (P4, 1000), and if the sixth page is page P2 [400, 500), then the fourth index record corresponding to the sixth page can be determined in page P3 to be (P2, 700). If the seventh page is page P10, then the electronic device can determine that the seventh key value range corresponding to page P10 is [500, 700]. The electronic device can generate a fifth index record (P2, 500) corresponding to the sixth page based on the sixth key value range [400, 500), and generate a sixth index record (P10, 700) corresponding to page P10 based on the seventh key value range [500, 700). o The electronic device may update the fourth index record (P2, 700) to the fifth index record (P2, 500) on page P3, and add a sixth index record (P10, 700) on page P3. o The updated page P3 may contain multiple index records: (P1, 400) (P2, 500) (P10, 700) (P4, 1000) oIn an optional embodiment, the index-related information of the third parent page can be updated in the following manner: determining the sixth storage address on disk for the third update record corresponding to the third parent page; generating a sixth flush record corresponding to the third parent page; and updating the memory address corresponding to the third parent page in the corresponding page mapping table to the memory address of the sixth flush record. For example, if the third parent page is page P3, and update record 3 corresponding to page P3 is: updating the fourth index record (P2, 700) to (P2, 500) in page P3 and adding a sixth index record (P10, 700) to page P3, then update record 2 can be stored on disk. The electronic device can generate flush record 6 corresponding to page P3. Flush record 6 can include the memory address of page P3 and the fifth storage address on disk for update record 3. The electronic device can update the mapping entry corresponding to page identifier 3 in the page mapping table to the memory address of flush record 6. Case 2: If the page size of the seventh page is less than the third threshold. In this case, it indicates that a page merge is in progress. The electronic device can then merge the seventh page into the sixth page in the index tree to obtain a target index tree. Specifically, the electronic device can merge the sixth and seventh pages and delete the seventh page from the index tree to obtain the target index tree. The process of merging the sixth and seventh pages and deleting the seventh page from the index tree can be seen in steps S407 to S410, specifically as follows: In an optional embodiment, the sixth and seventh pages can be merged in the following manner: creating a target page corresponding to the sixth and seventh pages; storing the content of the sixth and seventh pages in the target page; and updating the index-related information of the target page. Before creating the target page, a determination can be made in the page mapping table regarding whether a pending deletion flag exists in the mapping entry corresponding to the identifier of the seventh page. If no pending deletion flag exists, a pending deletion flag can be set in the mapping entry corresponding to the identifier of the seventh page. For example, if the seventh page is page P10, and if the mapping entry corresponding to page identifier 10 in the page mapping table does not contain a to-be-deleted identifier, the to-be-deleted identifier can be set in the mapping entry. For example, if the seventh page is page P10 and the sixth page is page P2[400, 500), the electronic device can create target pages corresponding to page P10 and page P2[400, 500].If page P10 stores multiple key-value pairs within the seventh key value range [500, 700), and the sixth page, page P2 [400, 500), stores multiple key-value pairs within the second key value range [400, 500), then the electronic device can store the contents of page P10 and page P2 [400, 500) to the target page. The target page can store multiple key-value pairs within the target key value range [400, 700), and the target page can be represented as target page P2 [400, 700). Since the right sibling page of page P10 is page P4, after the electronic device stores the contents of page P10 and page P2 [400, 500) to the target page, it can also store a pointer to page P4 to indicate that the right sibling page of the target page is page P4. In an optional embodiment, the index-related information of the target page can be updated in the following manner: determining the seventh storage address of the target page on disk; generating a seventh disk flush record corresponding to the target page; and updating the memory address of the sixth page in the corresponding page mapping table on disk to the memory address of the seventh disk flush record. The electronic device can determine the seventh storage address of the target page on disk and store the target page on disk. The electronic device can also set a deletion confirmation flag corresponding to the seventh page on the target page. For example, if the target page is target page P2[400,700), the electronic device can determine the seventh storage address of target page P2[400,700] on disk and store target page P2[400,700] on disk. If the seventh page is page P10, the electronic device can also set a deletion confirmation flag corresponding to page P10 on target page P2[400,700] on disk. The electronic device may generate a disk write record 7 corresponding to the target page P2 [400, 700). Disk write record 7 may include the memory address of the target page P2 [400, 700] and the seventh storage address of the target page P2 [400, 700] on the disk. The electronic device may update the original memory address of page P2 [400, 500) to the memory address of disk write record 7 in the mapping entry corresponding to page identifier 2 in the page mapping table. The electronic device may delete the seventh page and delete the memory address corresponding to the identifier of the first page and the pending deletion identifier in the corresponding page mapping table on the disk. For example, if the seventh page is page P10 and the identifier corresponding to page P10 is page identifier 10, the electronic device may delete page P10 and delete the memory address corresponding to page identifier 10 and the pending deletion identifier in the mapping entry corresponding to page identifier 10 in the page mapping table.In an embodiment of the present disclosure, an electronic device can receive a data operation request and search the index tree for the sixth page corresponding to the target key value. If the sixth page does not contain data corresponding to the target key value, the index tree is repaired to obtain the target index tree. Since the electronic device can proactively repair the index tree when determining that the index tree is incomplete, ensuring the integrity of the index tree, the accuracy of reading and writing data based on the index tree is improved. It should be noted that, in the present disclosure, the various processing steps shown in any of the above embodiments do not constitute specific limitations on the page processing method. In other embodiments of the present disclosure, the page processing method may include more or fewer steps than those in the corresponding embodiment. For example, the page processing method may include some of the steps in the embodiment of FIG. 4 , or some steps in the embodiment of FIG. 4 may be replaced by steps with equivalent functions, or some steps in the embodiment of FIG. 4 may be split into multiple steps, etc. FIG. 10 is a schematic structural diagram of a page processing device provided in an embodiment of the present disclosure. Referring to FIG. 10 , the page processing device 10 may include a first determination module 11, a second determination module 12, an update module 13, and a processing module 14. The first determination module 11 is configured to determine a first page in an index tree corresponding to a disk, the index tree including multiple pages used to index data blocks or stored data on the disk; the second determination module 12 is configured to determine a second page corresponding to the first page in the index tree; the update module 13 is configured to update a first parent page corresponding to the first page based on the first and second pages, the first parent page used to index the first page; and the processing module 14 is configured to merge the first and second pages and delete the first page from the index tree. The page processing device provided in the embodiments of the present disclosure can implement the technical solutions described in the aforementioned method embodiments. The implementation principles and beneficial effects thereof are similar and are not further described here. In a possible implementation, the update module 13 is specifically used to: determine a first key value range corresponding to the first page, and a second key value range corresponding to the second page; determine a target key value range based on the first key value range and the second key value range, where the target key value range includes the first key value range and the second key value range; update the page content of the first parent page according to the target key value range, and update the index-related information of the first parent page.In one possible embodiment, the update module 13 is specifically configured to: determine, in the first parent page, a first index record corresponding to the first page and a second index record corresponding to the second page, the first index record including the identifier of the first page and the maximum key value in the first key value range, and the second index record including the identifier of the second page and the maximum key value in the second key value range; generate a target record based on the target key value range, the target record including the identifier of the second page and the maximum key value in the target key value range; update the second index record in the first parent page to the target record, and delete the first index record. In one possible embodiment, the update module 13 is specifically configured to: determine a first storage address on the disk of a first update record corresponding to the first parent page; generate a first disk-written record corresponding to the first parent page, the first disk-written record including the memory address of the first parent page and the first storage address; and update the memory address corresponding to the first parent page in a page mapping table corresponding to the disk to the memory address of the first disk-written record. In one possible embodiment, the processing module 14 is specifically configured to: create a target page corresponding to the first page and the second page; store the content of the first page and the second page to the target page; and update index-related information of the target page. In one possible embodiment, the processing module 14 is specifically configured to: determine a second storage address of the target page on disk; generate a second disk-written record corresponding to the target page, the second disk-written record including the memory address of the target page and the second storage address; and update the memory address of the second page in a page mapping table corresponding to the disk to the memory address of the second disk-written record. In one possible embodiment, the processing module 14 is specifically configured to: delete the first page; and delete the memory address corresponding to the identifier of the first page in the page mapping table corresponding to the disk. In a possible implementation, the second determination module 12 is specifically configured to: determine the left sibling page corresponding to the first page as the second page; or determine at least one adjacent page corresponding to the first page in the index tree, determine the page size of each adjacent page, and determine the second page in the at least one adjacent page based on the page size of each adjacent page, where the sum of the page sizes of the first page and the second page is less than or equal to a preset threshold.In one possible implementation, the first determination module 11 is further configured to determine a third page in the index tree, where the page size of the third page is greater than or equal to a second threshold; the processing module 14 is further configured to split the third page to obtain a fourth page and a fifth page; the update module 13 is further configured to update index-related information for the fourth and fifth pages; the second determination module 12 is further configured to determine a second parent page corresponding to the third page; and the update module 13 is further configured to update page content and index-related information for the second parent page. In one possible implementation, the processing module 14 is specifically configured to: create the fourth and fifth pages; determine a first portion of content and a second portion of content in the third page; store the first portion of content in the fourth page, and store the second portion of content in the fifth page. In one possible implementation, the update module 13 is specifically configured to: determine a third storage address of the fourth page on the disk; generate a third disk flush record corresponding to the fourth page, wherein the third disk flush record includes the memory address of the fourth page and the third storage address; and store the identifier of the fourth page and the memory address of the third disk flush record in a page mapping table corresponding to the disk. In another possible implementation, the update module 13 is specifically configured to: determine a fourth storage address of the fifth page on the disk; generate a fourth disk flush record corresponding to the fifth page, wherein the fourth disk flush record includes the memory address of the fifth page and the fourth storage address; and update the memory address corresponding to the third page in the page mapping table corresponding to the disk to the memory address of the fourth disk flush record. In a possible implementation, the update module 13 is specifically used to: determine a third index record corresponding to the third page in the second parent page, where the third index record includes an identifier of the third page and a maximum key value in a third key value range corresponding to the third page; determine a fourth key value range corresponding to the fourth page and a fifth key value range corresponding to the fifth page; generate a fourth index record corresponding to the fourth page based on the fourth key value range, where the fourth index record includes an identifier of the fourth page and a maximum key value in the fourth key value range; in the second parent page, update the maximum key value in the third key value range in the third index record to the maximum key value in the fifth key value range, and add the fourth index record.In one possible implementation, the update module 13 is specifically configured to: determine the fifth storage address of the second update record corresponding to the second parent page on the disk; generate a fifth disk-written record corresponding to the second parent page, the fifth disk-written record including the memory address of the second parent page and the fifth storage address; and update the memory address corresponding to the second parent page in the page mapping table corresponding to the disk to the memory address of the fifth disk-written record. The page processing device provided in this embodiment of the present disclosure can implement the technical solution shown in the above-mentioned method embodiment. Its implementation principles and beneficial effects are similar and are not further described here. Figure 11 is a schematic structural diagram of another page processing device provided in this exemplary embodiment of the present disclosure. Referring to FIG. 11 , based on the embodiment shown in FIG. 10 , the page processing device 10 may further include: a receiving module 15, a search module 16, and a repair module 17. The receiving module 15 is configured to receive a data operation request including a target key value; the search module 16 is configured to search the index tree for the sixth page corresponding to the target key value; and the repair module 17 is configured to, if the data corresponding to the target key value does not exist on the sixth page, perform integrity repair on the index tree to obtain a target index tree. The page processing device provided in the disclosed embodiment may implement the technical solutions shown in the above-described method embodiments. The implementation principles and beneficial effects are similar and are not further described here. In one possible implementation, the repair module 17 is specifically configured to: determine a sixth key value range corresponding to the sixth page; if it is determined that the target key value is greater than the maximum key value in the sixth key value range, determine a seventh page, the seventh page being the right sibling page of the sixth page; and perform integrity repair on the index tree based on the page size of the seventh page to obtain the target index tree. In one possible implementation, the repair module 17 is specifically configured to: if the page size of the seventh page is greater than or equal to a third threshold, mount the seventh page to the index tree to obtain the target index tree; and if the page size of the seventh page is less than the third threshold, merge the seventh page into the sixth page in the index tree to obtain the target index tree. In one possible implementation, the page size of the first page is less than or equal to the first threshold. The page processing device provided in this embodiment of the present disclosure can implement the technical solutions shown in the above-mentioned method embodiments. The implementation principles and beneficial effects are similar and will not be further described here. Figure 12 is a schematic structural diagram of an electronic device provided in accordance with an exemplary embodiment of the present disclosure.Referring to Figure 12 , the electronic device 20 may include a processor 21 and a memory 22. Exemplarily, the processor 21 and the memory 22 are interconnected via a bus 23. The memory 22 stores computer-executable instructions; the processor 21 executes the computer-executable instructions stored in the memory 22, causing the processor 21 to perform the method described in the above method embodiment. Accordingly, embodiments of the present disclosure provide a computer-readable storage medium storing computer-executable instructions. When executed by the processor, the computer-executable instructions are used to implement the method described in the above method embodiment. Accordingly, embodiments of the present disclosure may also provide a computer program product, including a computer program. When executed by the processor, the computer program can implement the method described in the above method embodiment. Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The present invention is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine. The instructions, executed by the processor of the computer or other programmable data processing device, generate means for implementing the functions specified in one or more processes in the flowcharts and / or one or more blocks in the block diagrams. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in one or more processes in the flowchart and / or one or more blocks in the block diagram.These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing the computer or other programmable device to execute a series of operational steps to produce a computer-implemented process. The instructions executed on the computer or other programmable device thus provide steps for implementing the functions specified in one or more flow charts and / or one or more blocks in a block diagram. In a typical configuration, the electronic device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory. Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash memory. OMemory is an example of computer-readable media. Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can implement information storage using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change RAM (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact discs (CD-ROMs), digital versatile discs (DVDs) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmitting medium that can be used to store information that can be accessed by an electronic device. As defined herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves. It should also be noted that the terms "comprise," "include," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, product, or apparatus comprising a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, product, or apparatus. Without further limitation, the phrase "comprising a..." does not preclude the presence of additional identical elements in the process, method, product, or apparatus comprising the recited elements. The foregoing description is merely an example of the present disclosure and is not intended to limit the present disclosure. Various modifications and variations of the present disclosure will be apparent to those skilled in the art. Any modifications, equivalent substitutions, improvements, and the like made within the spirit and principles of the present disclosure are intended to be encompassed by the claims of the present disclosure.

Claims

27 Claims 1. A page processing method, comprising: Determine a first page in an index tree corresponding to the disk, wherein the index tree includes a plurality of pages, and the pages are used to index data or store data; Determine a second page corresponding to the first page in the index tree, and update a first parent page corresponding to the first page based on the first page and the second page, where the first parent page is used to index the first page; merge the first page and the second page, and delete the first page from the index tree.

2. The method according to claim 1, updating a first parent page corresponding to the first page according to the first page and the second page, comprising: Determining a first key value range corresponding to the first page and a second key value range corresponding to the second page; Determine a target key value range according to the first key value range and the second key value range, where the target key value range includes the first key value range and the second key value range; and update page content of the first parent page and index-related information of the first parent page according to the target key value range.

3. The method according to claim 2, updating the page content of the first parent page according to the target key value range, comprising: Determine a first index record corresponding to the first page and a second index record corresponding to the second page in the first parent page, wherein the first index record includes an identifier of the first page and a maximum key value in the first key value range, and the second index record includes an identifier of the second page and a maximum key value in the second key value range; generate a target record according to the target key value range, wherein the target record includes an identifier of the second page and a maximum key value in the target key value range; update the second index record in the first parent page to the target record, and delete the first index record.

4. The method according to claim 2 or 3, wherein updating the index-related information of the first parent page comprises: Determine a first storage address of a first update record corresponding to the first parent page in the disk; generating a first disk-written record corresponding to the first parent page, wherein the first disk-written record includes a memory address of the first parent page and the first storage address; In the page mapping table corresponding to the disk, the memory address corresponding to the first parent page is updated to the memory address of the first disk-written record.

5. The method according to claim 1 , wherein the merging process of the first page and the second page comprises: Creating target pages corresponding to the first page and the second page; Storing the contents of the first page and the second page to the target page; Update the index related information of the target page.

6. The method according to claim 5, wherein updating the index-related information of the target page comprises: Determining a second storage address of the target page in the disk; generating a second disk-written record corresponding to the target page, wherein the second disk-written record includes the memory address of the target page and the second storage address; In the page mapping table corresponding to the disk, the memory address of the second page is updated to the memory address of the second disk-written record.

7. The method according to any one of claims 1 to 6, wherein deleting the first page in the index tree comprises: Deleting the first page; In the page mapping table corresponding to the disk, the memory address corresponding to the identifier of the first page is deleted.

8. The method according to any one of claims 1 to 7, wherein determining the second page corresponding to the first page in the index tree comprises: determining the left sibling page corresponding to the first page as the second page; Alternatively, at least one adjacent page corresponding to the first page is determined in the index tree, a page size of each adjacent page is determined, and the second page is determined from the at least one adjacent page based on the page size of each adjacent page, where the sum of the page sizes of the first page and the second page is less than or equal to a preset threshold.

9. The method according to any one of claims 1 to 8, further comprising: determining a third page in the index tree, where a page size of the third page is greater than or equal to a second threshold; Splitting the third page to obtain a fourth page and a fifth page, and updating index-related information of the fourth page and the fifth page; Determine a second parent page corresponding to the third page, and update page content and index-related information of the second parent page.

10. The method according to claim 9, wherein splitting the third page to obtain a fourth page and a fifth page comprises: creating the fourth page and the fifth page; Determining the first part of content and the second part of content on the third page; The first portion of content is stored in the fourth page, and the second portion of content is stored in the fifth page.

11. The method according to claim 9 or 10, wherein updating the index-related information of the fourth page comprises: determining a third storage address of the fourth page in the disk; generating a third disk-written record corresponding to the fourth page, wherein the third disk-written record includes the memory address of the fourth page and the third storage address; The identifier of the fourth page and the memory address of the third disk-written record are correspondingly stored in the page mapping table corresponding to the disk.

12. The method according to any one of claims 9 to 11, wherein updating the index-related information of the fifth page comprises: determining a fourth storage address of the fifth page on the disk; generating a fourth disk-write record corresponding to the fifth page, wherein the fourth disk-write record includes a memory address of the fifth page and the fourth storage address; and updating, in a page mapping table corresponding to the disk, the memory address corresponding to the third page to the memory address of the fourth disk-write record.

13. The method according to any one of claims 9 to 12, wherein updating the page content of the second parent page comprises: Determining a third index record corresponding to the third page in the second parent page, wherein the third index record includes an identifier of the third page and a maximum key value in a third key value range corresponding to the third page; determining a fourth key value range corresponding to the fourth page and a fifth key value range corresponding to the fifth page; generating a fourth index record corresponding to the fourth page based on the fourth key value range, the fourth index record including an identifier of the fourth page and a maximum key value in the fourth key value range; In the second parent page, the maximum key value in the third key value range in the third index record is updated to the maximum key value in the fifth key value range, and the fourth index record is added.

14. The method according to any one of claims 9 to 13, updating index-related information of the second parent page, include: Determine a fifth storage address of a second update record corresponding to the second parent page in the disk; Generate a fifth disk-written record corresponding to the second parent page, where the fifth disk-written record includes the memory address of the second parent page and the fifth storage address; and update the memory address corresponding to the second parent page to the memory address of the fifth disk-written record in a page mapping table corresponding to the disk.

15. The method according to any one of claims 1 to 14, further comprising: receiving a data operation request, wherein the data operation request includes a target key value; Searching the index tree for a sixth page corresponding to the target key value; If the data corresponding to the target key value does not exist in the sixth page, integrity repair processing is performed on the index tree to obtain a target index tree.

16. The method according to claim 15, wherein the step of performing integrity repair on the index tree to obtain a target index tree comprises: Determining a sixth key value range corresponding to the sixth page; when it is determined that the target key value is greater than a maximum key value in the sixth key value range, determining a seventh page, where the seventh page is a right sibling page corresponding to the sixth page; and performing integrity repair processing on the index tree according to a page size of the seventh page to obtain the target index tree.

17. The method according to claim 16, performing integrity repair processing on the index tree according to the page size of the seventh page to obtain the target index tree, comprising: If the page size of the seventh page is greater than or equal to a third threshold, mounting the seventh page to the index tree to obtain the target index tree; If the page size of the seventh page is smaller than the third threshold, then in the index tree, the seventh page is merged into the sixth page to obtain the target index tree.

18. The method according to any one of claims 1 to 17, wherein a page size of the first page is less than or equal to a first threshold.

19. A page processing device, comprising: A first determination module, a second determination module, an update module, and a processing module, wherein the first determination module is configured to determine a first page in an index tree corresponding to a disk, the index tree including multiple pages, the pages being used to index data blocks or stored data in the disk; the second determination module is configured to determine a second page corresponding to the first page in the index tree; the update module is configured to update a first parent page corresponding to the first page based on the first page and the second page, the first parent page being used to index the first page; and the processing module is configured to merge the first page and the second page and delete the first page from the index tree.

20. An electronic device, 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, and the instructions are executed by the at least one processor to enable the electronic device to perform the method according to any one of claims 1 to 18.

21. A computer-readable storage medium storing computer-executable instructions, wherein when a processor executes the computer-executable instructions, the method according to any one of claims 1 to 18 is implemented.

22. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Dynamically adaptive LSM (Log-structured merge) tree combination method and system

    CN105159915A

  • Facet-oriented academic big data storage and query method

    CN110134661A

  • Processing method and device for index data and electronic equipment

    CN110990404A

  • Pl over-limit control method and device for data deduplication operation and readable storage medium

    CN111949624A

  • B+ tree operation device

    CN112989130A