Method and device for reading differential bitmap data
By querying the differential bitmap in the preset cache of the client interface layer and querying and cacheing the differential bitmap of adjacent data shards when it does not exist in the cache, the problem of low reading efficiency of differential bitmap data is solved, and system performance and stability are improved.
Patent Information
- Application Number
- CN202411161233.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2044-08-22
AI Technical Summary
In the prior art, the reading efficiency of differential bitmap data is low, resulting in high query delays and excessive storage system resources, affecting system performance and stability.
By querying the difference bitmap in the preset cache of the client interface layer, it will be obtained directly if it exists. Otherwise, by querying and cacheing the placement group, the direct request for the placement group is reduced, and the difference bitmap of adjacent data shards is prequeled and cached, and the reading process is optimized.
It improves the reading efficiency of differential bitmap data, reduces query delay and storage system load, and improves the stability and reliability of the system.
Smart Images

Figure CN119105704B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data reading technology, and in particular to a method and device for reading differential bitmap data. Background Art
[0002] A differential bitmap volume is a technology used to store data changes. It relies on snapshot technology and records the differential data blocks between snapshots. By reading the differential bitmap volume, you can understand the data changes that have occurred between different snapshots, thereby achieving fast incremental backups, saving backup time and space, and improving backup efficiency and security. In most cases, users need to segment the differential bitmap volume and then start multiple tasks to read it. For the storage system, this is a multi-stream sequential read. Each bit in the snapshot bitmap and differential bitmap corresponds to each data block of the source volume and is initially 0. When the source volume receives a write operation from the host, the bit corresponding to the corresponding data block in the snapshot bitmap is changed to 1. The differential bitmap is generated by merging two (or more) adjacent snapshot bitmaps, which are mapped to the user to form a differential bitmap volume for reading. Currently, when querying the differential bitmap of a single chunk (data shard), it is necessary to send a query request to multiple PGs (Placement Groups) corresponding to the chunk, obtain the primary copy within each PG group, read the snapshot bitmap belonging to this chunk, and return it to the client interface layer. The client interface layer converts and splices the snapshot bitmaps returned by each PG into a differential bitmap volume, resulting in low query efficiency.
[0003] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0004] The embodiments of the present application provide a method and apparatus for reading difference bitmap data, so as to at least solve the technical problem of low efficiency in reading difference bitmap data in the related art.
[0005] According to one aspect of an embodiment of the present application, a method for reading difference bitmap data is provided, including: receiving a query request, the query request including at least: a target data shard to be queried; traversing a preset cache of a client interface layer, and if the preset cache contains a difference bitmap of the target data shard, obtaining the difference bitmap of the target data shard from the preset cache; if the preset cache does not contain a difference bitmap of the target data shard, querying the difference bitmap of the target data shard through a placement group; and outputting the difference bitmap of the target data shard.
[0006] Optionally, querying the difference bitmap of the target data shard through the placement group includes: obtaining from a preset data table whether the target data shard has been queried; if the target data shard has not been queried, sending the query request to the placement group, and storing all difference bitmaps corresponding to the target data shard in the preset cache; and obtaining the difference bitmap of the target data shard from the preset cache.
[0007] Optionally, after sending the query request to the placement group, the method further includes: determining an identifier corresponding to the target data shard in the preset data table as a valid value, where the valid value is used to indicate that the target data shard has been queried.
[0008] Optionally, the method further includes: when the target data shard has been queried, sending a join request to the waiting queue to join the waiting queue; when a wake-up instruction is received, obtaining a difference bitmap of the target data shard from the preset cache.
[0009] Optionally, the method further includes: if the duration of receiving the query request exceeds a preset duration threshold and the identifier corresponding to the target data shard is not obtained, determining that the target data shard has not been queried.
[0010] Optionally, the method further includes: issuing the wake-up instruction when it is detected that all difference bitmaps corresponding to the target data fragment are stored in the preset cache.
[0011] Optionally, after the placement group receives the query request, the method further includes: obtaining adjacent data shards of the target data shard; pre-querying the difference bitmaps corresponding to the adjacent data shards, and storing the difference bitmaps corresponding to the adjacent data shards in the preset cache.
[0012] According to another aspect of an embodiment of the present application, a device for reading difference bitmap data is also provided, including: a receiving module for receiving a query request, the query request including at least: a target data shard to be queried; a query module for traversing a preset cache of a client interface layer, and obtaining a difference bitmap of the target data shard from the preset cache when the preset cache contains a difference bitmap of the target data shard; and querying a difference bitmap of the target data shard through a placement group when the preset cache does not contain a difference bitmap of the target data shard; and an output module for outputting a difference bitmap of the target data shard.
[0013] According to another aspect of the embodiments of the present application, a computer device is also provided, including: a memory for storing program instructions; a processor, connected to the memory, for executing the program instructions of the following functions: receiving a query request, the query request including at least: a target data shard to be queried; traversing a preset cache of a client interface layer, and obtaining a difference bitmap of the target data shard from the preset cache if the preset cache contains a difference bitmap of the target data shard; if the preset cache does not contain a difference bitmap of the target data shard, querying the difference bitmap of the target data shard through a placement group; and outputting the difference bitmap of the target data shard.
[0014] According to another aspect of the embodiments of the present application, a non-volatile storage medium is provided, which includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the above-mentioned method for reading difference bitmap data by running the computer program.
[0015] In an embodiment of the present application, a query request is received, wherein the query request includes at least: a target data shard to be queried; a preset cache of a client interface layer is traversed, and when a differential bitmap of the target data shard is contained in the preset cache, the differential bitmap of the target data shard is obtained from the preset cache; when the differential bitmap of the target data shard is not contained in the preset cache, the differential bitmap of the target data shard is queried through a placement group; and a differential bitmap of the target data shard is output. By using the preset cache of the client interface layer, the purpose of pre-reading the pre-acquired differential bitmap in the cache is achieved, and when the required differential bitmap does not exist in the preset cache, a query request is sent to the placement group, thereby achieving the technical effect of improving the efficiency of differential bitmap reading, and further solving the technical problem of low efficiency in reading differential bitmap data in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0017] Figure 1 is a hardware structure block diagram of a computer terminal for implementing a method for reading difference bitmap data according to an embodiment of the present application;
[0018] Figure 2 This is a flow chart of a method for reading difference bitmap data of the present application;
[0019] Figure 3 This is a schematic diagram of striping processing in an embodiment of the present application;
[0020] Figure 4 is a flowchart of another method for reading difference bitmap data according to an embodiment of the present application;
[0021] Figure 5 2 is a schematic structural diagram of a device for reading differential bitmap data according to an embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0023] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0024] The method for reading difference bitmap data provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG1 shows a hardware structure block diagram of a computer terminal for implementing a method for reading difference bitmap data. Figure 1 As shown, the computer terminal 10 may include one or more (illustrated by 102a, 102b, ..., 102n in the figure) processors (the processor may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, a keyboard, a cursor control device, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, and a BUS bus. Those skilled in the art will understand that Figure 1The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0025] It should be noted that the one or more processors and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry." The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuitry may be a single, independent processing module, or may be incorporated in whole or in part into any of the other components of the computer terminal 10. As described in the embodiments of the present application, the data processing circuitry serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0026] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method for reading the difference bitmap data in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implementing the above-mentioned method for reading the difference bitmap data. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely located relative to the processor, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0027] The transmission module 106 is configured to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by the communications provider of the computer terminal 10. In one embodiment, the transmission module 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission module 106 may be a radio frequency (RF) module, which is configured to communicate with the Internet wirelessly.
[0028] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 .
[0029] It should be noted that, in some optional embodiments, the above Figure 1The computer device shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. Figure 1 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the computer device described above.
[0030] In the above-mentioned operating environment, an embodiment of the present application provides an embodiment of a method for reading differential bitmap data. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0031] Figure 2 is a flow chart of a method for reading difference bitmap data according to an embodiment of the present application. Figure 2 As shown, the method includes the following steps:
[0032] Step S202: receiving a query request, wherein the query request includes at least: a target data shard to be queried;
[0033] Step S204: traverse the preset cache of the client interface layer, and if the preset cache contains the difference bitmap of the target data shard, obtain the difference bitmap of the target data shard from the preset cache; if the preset cache does not contain the difference bitmap of the target data shard, query the difference bitmap of the target data shard through the placement group;
[0034] Step S206: outputting a difference bitmap of the target data slice.
[0035] The method for reading the differential bitmap data in the above-mentioned steps S202 to S206 adopts a method of receiving a query request, wherein the query request at least includes: the target data shard to be queried; traversing the preset cache of the client interface layer, and obtaining the differential bitmap of the target data shard from the preset cache when the differential bitmap of the target data shard is contained in the preset cache; and querying the differential bitmap of the target data shard through the placement group when the differential bitmap of the target data shard is not contained in the preset cache; and outputting the differential bitmap of the target data shard, through the preset cache of the client interface layer, achieves the purpose of pre-reading the differential bitmap that has been pre-acquired in the cache, and sending a query request to the placement group when the required differential bitmap does not exist in the preset cache, thereby achieving the technical effect of improving the efficiency of differential bitmap reading, and further solving the technical problem of low efficiency in reading differential bitmap data in the related art. The following is a detailed description.
[0036] It should be noted that a snapshot saves the data of a volume at a certain point in time. The data in the snapshot is read-only and is generally used for daily data backup and rapid data recovery. In a distributed storage system, the input and output of the same chunk are usually processed on only one thread. When continuous input and output happen to be distributed in the same chunk, one thread will be busy while the other threads will be idle. Through striping, a chunk is divided into multiple small data blocks, and then mapped to multiple adjacent chunks. Figure 3 As shown, a chunk can be divided into multiple smaller data blocks (length0, length1, etc.) and the input and output load on the chunk can be balanced across multiple threads. A differential bitmap is a technology used to store data changes. It relies on snapshot technology and records the differential data blocks between snapshots. By reading the differential bitmap, you can understand the data changes that occurred between snapshots, thereby achieving fast incremental backups, saving backup time and space, and improving backup efficiency and security. In most cases, users will need to segment the differential bitmap volume and launch multiple tasks to read it. For the storage system, this is a multi-stream sequential read. Each bit in the snapshot bitmap and differential bitmap corresponds to a data block in the source volume and is initially set to 0. When the source volume receives a write operation from the host, the bit corresponding to the corresponding data block in the snapshot bitmap is changed to 1. The differential bitmap is generated by merging two (or more) adjacent snapshot bitmaps.
[0037] In related technologies, due to the influence of striping, querying the differential bitmap of a single chunk requires sending query requests to multiple PGs, which may lead to low query efficiency and occupy too many input and output resources, thereby placing a high load on the storage system and affecting system performance. In related technologies, for query efficiency, the differential bitmap is written to the hard disk so that it does not need to be remapped when reading. However, this method does not take into account the use scenario of the differential bitmap. The differential bitmap is used when performing incremental data queries and has a short timeliness. Although the differential bitmap volume itself does not take up too much space, as the number of differential bitmaps stored increases, the additional storage space occupied will increase, and reading and writing also shortens the life of the hard disk.
[0038] For example, a host queries a target volume for a differential bitmap with an offset of 0, a length of 4KB, and snapshots 999999 to 999998. In related art, the client interface layer first converts the differential bitmap offset and length to the target volume's offset of 0 and a length of 128MB. According to the data read process, the query needs to be sent to 128 / 4 = 32 PGs. The primary replica within each PG group reads the snapshot bitmap for snapshot 999998, which corresponds to the chunk corresponding to the differential bitmap, and returns it to the client interface layer. The client interface layer then converts and concatenates the snapshot bitmaps returned by each PG into a differential bitmap volume and returns it to the host, thus completing the query. As can be seen, differential bitmaps are generated based on the differential data blocks between target volume snapshots. Therefore, each differential bitmap is associated with a specific snapshot. Since snapshot bitmaps are typically distributed across different storage nodes, each storage node is responsible for managing specific data blocks. When querying a differential bitmap volume, the corresponding snapshot bitmap data needs to be read from each storage node, making network bandwidth and storage nodes performance constraints, resulting in reduced query efficiency.
[0039] In the case of querying in a striped manner, take the stripe length = 32 and stripe width = 32 as an example. After striping, a chunk is divided into 32 (stripe width) small data blocks, and then mapped to 32 adjacent chunks, so that the query of a single chunk is decomposed into 32 query subtasks. Therefore, querying a single chunk requires forwarding requests to 32 different PGs. This can take advantage of the parallelism of the distributed storage system, reduce the time for query and data processing, and improve the overall data throughput. However, for differential bitmap volumes, the valid data for reading a single 4MB chunk is only 4MB / 32=128KB, which is converted into a differential bitmap of 128KB / 4KB=32 bits. This will result in too little valid information for a single chunk query request.
[0040] Taking the host querying the target volume offset 0, length 4KB, snapshot 999999 to snapshot 999998 difference bitmap information as an example, in the related technology, the client interface layer first converts the offset and length of the difference bitmap into the offset 0 and length 128MB of the source volume. According to the data reading process and striping, it is known that the query information needs to be sent to 128 / 4*32=1024 PGs. The master copy in each PG group reads the snapshot bitmap of snapshot 999998 belonging to this chunk and returns it to the client interface layer. The client interface layer converts and splices the snapshot bitmap returned by each PG into a difference bitmap, and returns it to the host. At this point, the query ends.
[0041] It can be seen that after superimposing striped queries, the number of requests for PG increases exponentially. In this high concurrency situation, network bandwidth or storage nodes will become performance bottlenecks, resulting in excessively high query latency. A large number of I / O operations will occupy storage system resources, which may affect the performance of other operations on the storage system, placing a high load on the storage system and affecting system stability and reliability.
[0042] In order to reduce the number of query requests and improve the stability of the storage system, the method for reading the difference bitmap data provided by the present application is adopted. In step S204, the specific method of querying the difference bitmap of the target data shard through the placement group includes: obtaining from a preset data table whether the target data shard has been queried; if the target data shard has not been queried, sending the query request to the placement group, and storing all difference bitmaps corresponding to the target data shard in the preset cache; and obtaining the difference bitmap of the target data shard from the preset cache.
[0043] In some embodiments of the present application, after sending the query request to the placement group, the identifier corresponding to the target data shard is determined as a valid value in the preset data table, and the valid value is used to indicate that the target data shard has been queried.
[0044] In an optional manner, the valid value may be set to 1 and the invalid value may be set to 0.
[0045] In the case that the target data slice has been queried, a joining request is sent to the waiting queue to join the waiting queue; in the case that a wake-up instruction is received, a difference bitmap of the target data slice is obtained from the preset cache.
[0046] In another optional manner, when the duration of receiving the query request exceeds a preset duration threshold and the identifier corresponding to the target data shard is not obtained, it is determined that the target data shard has not been queried.
[0047] When it is detected that all difference bitmaps corresponding to the target data slice are stored in the preset cache, the wake-up instruction is issued.
[0048] It can be understood that the wake-up instruction is used to wake up the query request and return the difference bitmap required by the query request.
[0049] After the placement group receives the query request, the method further includes: obtaining adjacent data shards of the target data shard; pre-querying difference bitmaps corresponding to the adjacent data shards, and storing the difference bitmaps corresponding to the adjacent data shards in the preset cache.
[0050] Figure 4Another method for reading difference bitmap data is shown. Figure 4 As shown, first check whether the data already exists in the cache. If so, return the data in the cache directly to avoid requesting the same chunk from the same PG again. If not, check the "query incomplete bitmap" (preset data table). If the "query incomplete bitmap" is 1, that is, the query request has been issued (the chunk has been queried), then add the request to the waiting queue and wait for the result to return. If the "query incomplete bitmap" is 0 (the chunk has not been queried), send a request to the PG and set the "query incomplete bitmap" to 1. After waiting for the query to return, cache all the obtained difference bitmap data for subsequent queries and wake up the request waiting for this part of the data.
[0051] After the client interface layer issues a request to query the difference bitmap for a specific chunk, it pre-queries the difference bitmap data for adjacent chunks. This way, when the chunk is actually queried, some of the adjacent chunks' data is already in the cache and can be used directly, reducing the query latency of the difference bitmap volume. The cache size can be adjusted based on actual conditions. A prefetch strategy can be used to load the data blocks that will be accessed, further reducing the latency of input and output requests.
[0052] Figure 5 is an image data acquisition device according to an embodiment of the present application, such as Figure 5 As shown, including:
[0053] The receiving module 50 is configured to receive a query request, wherein the query request includes at least: a target data shard to be queried;
[0054] A query module 52 is configured to traverse a preset cache of the client interface layer, and if the preset cache contains a difference bitmap of the target data shard, obtain the difference bitmap of the target data shard from the preset cache; if the preset cache does not contain a difference bitmap of the target data shard, query the difference bitmap of the target data shard through a placement group;
[0055] The output module 54 is configured to output a difference bitmap of the target data slice.
[0056] The query module 52 includes: a query submodule, which is used to query the difference bitmap of the target data shard through the placement group, including: obtaining from the preset data table whether the target data shard has been queried; if the target data shard has not been queried, sending the query request to the placement group and storing all difference bitmaps corresponding to the target data shard in the preset cache; obtaining the difference bitmap of the target data shard from the preset cache.
[0057] The query submodule includes: a first determination unit, a joining unit, and a second determination unit. The first determination unit is used to send the query request to the placement group. The method also includes: determining the identifier corresponding to the target data shard as a valid value in the preset data table, and the valid value is used to indicate that the target data shard has been queried.
[0058] The joining unit is used to send a joining request to the waiting queue to join the waiting queue when the target data slice has been queried; and obtain the difference bitmap of the target data slice from the preset cache when a wake-up instruction is received.
[0059] The second determining unit is configured to determine that the target data slice has not been queried if the duration of receiving the query request exceeds a preset duration threshold and the identifier corresponding to the target data slice is not obtained.
[0060] The second determining unit includes: a detecting subunit, configured to issue the wake-up instruction when detecting that all difference bitmaps corresponding to the target data fragment are stored in the preset cache.
[0061] The query submodule also includes: a pre-query unit, which is used to, after the placement group receives the query request, the method also includes: obtaining adjacent data fragments of the target data fragment; pre-querying the difference bitmap corresponding to the adjacent data fragments, and storing the difference bitmap corresponding to the adjacent data fragments in the preset cache.
[0062] It should be noted that Figure 5 The image data acquisition device shown is used to perform Figure 2 A method for reading difference bitmap data is shown, so the relevant explanations in the method for reading difference bitmap data are also applicable to this image data acquisition device and will not be repeated here.
[0063] An embodiment of the present application also provides a computer device, comprising: a memory for storing program instructions; receiving a query request, the query request including at least: a target data shard to be queried; traversing a preset cache of a client interface layer, and if the preset cache contains a difference bitmap of the target data shard, obtaining the difference bitmap of the target data shard from the preset cache; if the preset cache does not contain a difference bitmap of the target data shard, querying the difference bitmap of the target data shard through a placement group; and outputting the difference bitmap of the target data shard.
[0064] It should be noted that the above-mentioned computer equipment is used to execute Figure 2The method for reading the difference bitmap data shown in the figure, therefore the relevant explanations in the above method for reading the difference bitmap data are also applicable to the computer device and will not be repeated here.
[0065] An embodiment of the present application also provides a non-volatile storage medium, which includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the following method for reading difference bitmap data by running the computer program: receiving a query request, the query request at least including: a target data shard to be queried; traversing a preset cache of a client interface layer, and if the preset cache contains a difference bitmap of the target data shard, obtaining the difference bitmap of the target data shard from the preset cache; if the preset cache does not contain a difference bitmap of the target data shard, querying the difference bitmap of the target data shard through a placement group; and outputting the difference bitmap of the target data shard.
[0066] It should be noted that the above non-volatile storage medium is used to execute Figure 2 The method for reading the difference bitmap data shown in FIG. 4 is a method for reading the difference bitmap data, so the relevant explanations in the above method for reading the difference bitmap data are also applicable to the non-volatile storage medium and will not be repeated here.
[0067] An embodiment of the present application further provides a computer program product, including a computer program, which implements the steps of the method described in each embodiment of the present application when executed by a processor.
[0068] An embodiment of the present application further provides another computer program product, comprising a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.
[0069] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0070] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0071] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0072] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected to achieve the purpose of the present embodiment according to actual needs.
[0073] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0074] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program code.
[0075] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for reading difference bitmap data, characterized in that: include: Receive a query request, wherein the query request includes at least: a target data shard to be queried; Traversing a preset cache of a client interface layer, and if the preset cache contains a difference bitmap of the target data shard, obtaining the difference bitmap of the target data shard from the preset cache; and if the preset cache does not contain a difference bitmap of the target data shard, querying the difference bitmap of the target data shard through a placement group, including: Obtain from a preset data table whether the target data shard has been queried; If the target data shard has not been queried, sending the query request to the placement group, and storing all difference bitmaps corresponding to the target data shard in the preset cache; Obtaining a difference bitmap of the target data slice from the preset cache; Output a difference bitmap of the target data slice.
2. The method according to claim 1, characterized in that After sending the query request to the placement group, the method further includes: In the preset data table, the identifier corresponding to the target data slice is determined as a valid value, where the valid value is used to indicate that the target data slice has been queried.
3. The method according to claim 1, characterized in that The method further comprises: When the target data shard has been queried, sending a join request to the waiting queue to join the waiting queue; When the wake-up instruction is received, the difference bitmap of the target data slice is obtained from the preset cache.
4. The method according to claim 1, wherein The method further comprises: If the duration of receiving the query request exceeds a preset duration threshold and the identifier corresponding to the target data slice is not obtained, it is determined that the target data slice has not been queried.
5. The method according to claim 3, characterized in that The method further comprises: When it is detected that all difference bitmaps corresponding to the target data slice are stored in the preset cache, the wake-up instruction is issued.
6. The method according to claim 1, wherein After the placement group receives the query request, the method further includes: Obtaining adjacent data slices of the target data slice; The difference bitmaps corresponding to the adjacent data slices are pre-queried, and the difference bitmaps corresponding to the adjacent data slices are stored in the preset cache.
7. A device for reading differential bitmap data, characterized in that: include: A receiving module, configured to receive a query request, wherein the query request includes at least: a target data shard to be queried; A query module is configured to traverse a preset cache of a client interface layer, and if the preset cache contains a difference bitmap of the target data shard, obtain the difference bitmap of the target data shard from the preset cache; if the preset cache does not contain a difference bitmap of the target data shard, query the difference bitmap of the target data shard through a placement group; An output module, configured to output a difference bitmap of the target data slice; Querying the difference bitmap of the target data shard by the placement group includes: obtaining from a preset data table whether the target data shard has been queried; If the target data shard has not been queried, sending the query request to the placement group, and storing all difference bitmaps corresponding to the target data shard in the preset cache; Obtain a difference bitmap of the target data slice from the preset cache.
8. A computer device, characterized in that: include: a memory for storing program instructions; A processor, connected to the memory, and configured to execute program instructions for the following functions: receiving a query request, the query request including at least: a target data shard to be queried; traversing a preset cache of a client interface layer, and if a difference bitmap of the target data shard is included in the preset cache, obtaining a difference bitmap of the target data shard from the preset cache; and if the difference bitmap of the target data shard is not included in the preset cache, querying the difference bitmap of the target data shard through a placement group, including: Obtain from a preset data table whether the target data shard has been queried; If the target data shard has not been queried, sending the query request to the placement group, and storing all difference bitmaps corresponding to the target data shard in the preset cache; Obtain a difference bitmap of the target data slice from the preset cache; and output the difference bitmap of the target data slice.
9. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by a processor, the method for reading difference bitmap data according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Data difference log query method and device, equipment and storage medium
CN116225748A
Distributed block storage volume snapshot rollback method and device, equipment and storage medium
CN118069432A