Data updating method and device, electronic equipment and medium
By decoupling the update and write operations of Object-Map in the Ceph storage system, and asynchronously updating and synchronizing Object-Map, the performance bottleneck caused by Object-Map updates is resolved, and write IO performance is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA TELECOM CLOUD TECH CO LTD
- Filing Date
- 2025-11-27
- Publication Date
- 2026-04-21
AI Technical Summary
In RBD block storage services, updates to the Object-Map become a performance bottleneck for write operations, affecting the system's write I/O performance.
This decouples updates to the object-map data structure from write operations, updates the object-map asynchronously, and restores the correct object-map through synchronous operations, thus avoiding the impact of updates on write performance.
By decoupling the update and write operations of the Object-Map and updating the Object-Map asynchronously, the problem of IO performance degradation caused by Object-Map updates is solved, ensuring the efficiency of write operations.
Smart Images

Figure CN121901167A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of storage technology, specifically relating to a data update method, a data update device, an electronic device, and a storage medium. Background Technology
[0002] Ceph storage is an open-source distributed storage system that supports block storage, object storage, and file storage services through a unified architecture, providing highly reliable, scalable, and high-performance data storage solutions. RBD (RADOS Block Device) is one of the core components of the Ceph distributed storage system. By abstracting storage resources into virtual block devices, it provides high-performance, scalable block-level storage services for scenarios such as virtual machines and databases, allowing users to use it like a regular hard drive. In the RBD block storage service, an image represents a logical block storage device in a Ceph storage system, composed of multiple Rados (Reliable Automatic Distributed Object Storage) objects. The Object-Map is an important metadata result in the RBD block storage service, used to track the distribution of Rados objects within an image. Its design purpose is to efficiently obtain the data distribution and statistical information of the entire image. A special Rados object is used in RBD to store Object-Map information.
[0003] In the RBD block storage service, when an image is opened, the Object-Map is read first to obtain the distribution of Rados objects in that image. However, when a new image is opened, the Object-Map is empty, so every write operation needs to trigger an update to the Object-Map. The Object-Map is stored in a special Rados object, therefore, updating the Object-Map becomes the performance bottleneck for write operations. Summary of the Invention
[0004] To solve, or at least partially solve, the above-mentioned technical problems, this application is implemented as follows: In a first aspect, embodiments of this application provide a data update method, the method comprising: In response to receiving a write operation, identify the current state of the object mapping data structure corresponding to the write operation; When the current state of the object mapping data structure is the fourth specified state, the information of the object data indicated by the write operation is written into the object mapping data structure; According to the update cycle corresponding to the object mapping data structure, the information of the object data recorded in the object mapping data structure is periodically synchronized to the object storage system.
[0005] In an optional embodiment, the method further includes: If the current state of the object mapping data structure is not the fourth specified state, update the information of the object data indicated by the write operation to the intermediate object mapping data structure; When the current state of the object mapping data structure is updated to the third specified state, the information of the object data recorded in the intermediate object mapping data structure is written into the object mapping data structure. In response to the information of the object data recorded in the intermediate object mapping data structure being written into the object mapping data structure, the current state of the object mapping data structure is updated to the fourth specified state.
[0006] In an optional embodiment, the method further includes: In response to the first startup of the block storage device, the first object mapping data structure corresponding to the block storage device is obtained from the object storage system; The first object mapping data structure is synchronized; wherein, the synchronization operation on the object mapping data structure corresponding to the block storage device is used to restore the object mapping data structure corresponding to the block storage device. In response to the completion of the synchronization operation, the current state of the first object mapping data structure is the fourth specified state.
[0007] In an optional embodiment, the synchronization operation on the first object mapping data structure includes: Traverse the first object mapping data structure to determine the undetermined objects in the first object mapping data structure; For each pending object, a confirmation request is sent to the object storage system to determine whether the pending object exists; Based on the confirmation result corresponding to the confirmation request, the first object mapping data structure is modified; In response to the completion of the correction of the first object mapping data structure, the current state of the first object mapping data structure is the third specified state.
[0008] In an optional embodiment, the synchronization operation on the first object mapping data structure includes: During the synchronization operation of the first object mapping data structure, in response to receiving a write operation indicating that object data is to be written to the block storage device, the information of the object data indicated by the write operation is updated to the intermediate object mapping data structure. Write the information of the object data recorded in the intermediate object mapping data structure into the first object mapping data structure; In response to the information of the object data recorded in the intermediate object mapping data structure being written into the first object mapping data structure, the current state of the first object mapping data structure is updated to the fourth specified state.
[0009] In an optional embodiment, the synchronization operation on the first object mapping data structure includes: Synchronization operations are performed on the first object mapping data structure according to the specified synchronization state machine; the specified synchronization state machine includes a first specified state, a second specified state, a third specified state, and a fourth specified state; Specifically, the first object mapping data structure corresponding to the block storage device obtained from the object storage system is in the first designated state; the first object mapping data structure for determining the pending object is in the second designated state; and the corrected first object mapping data structure is in the third designated state.
[0010] In an optional embodiment, determining the object to be determined in the first object mapping data structure includes: Based on the tagging information of each object data recorded in the first object mapping data structure, the undetermined objects in the first object mapping data structure are determined.
[0011] Secondly, embodiments of this application provide a data updating device, including: The identification module is used to identify the current state of the object mapping data structure corresponding to the write operation in response to receiving a write operation; The writing module is used to write the information of the object data indicated by the write operation into the object mapping data structure when the current state of the object mapping data structure is the fourth specified state. The update module is used to periodically synchronize the information of the object data recorded in the object mapping data structure to the object storage system according to the update period corresponding to the object mapping data structure.
[0012] In an optional embodiment, the device further includes a synchronization module for: If the current state of the object mapping data structure is not the fourth specified state, update the information of the object data indicated by the write operation to the intermediate object mapping data structure; When the current state of the object mapping data structure is updated to the third specified state, the information of the object data recorded in the intermediate object mapping data structure is written into the object mapping data structure. In response to the information of the object data recorded in the intermediate object mapping data structure being written into the object mapping data structure, the current state of the object mapping data structure is updated to the fourth specified state.
[0013] In an optional embodiment, the synchronization module is further configured to: In response to the first startup of the block storage device, the first object mapping data structure corresponding to the block storage device is obtained from the object storage system; The first object mapping data structure is synchronized; wherein, the synchronization operation on the object mapping data structure corresponding to the block storage device is used to restore the object mapping data structure corresponding to the block storage device. In response to the completion of the synchronization operation, the current state of the first object mapping data structure is the fourth specified state.
[0014] In an optional embodiment, the synchronization module is further configured to: Traverse the first object mapping data structure to determine the undetermined objects in the first object mapping data structure; For each pending object, a confirmation request is sent to the object storage system to determine whether the pending object exists; Based on the confirmation result corresponding to the confirmation request, the first object mapping data structure is modified; In response to the completion of the correction of the first object mapping data structure, the current state of the first object mapping data structure is the third specified state.
[0015] In an optional embodiment, the synchronization module is further configured to: During the synchronization operation of the first object mapping data structure, in response to receiving a write operation indicating that object data is to be written to the block storage device, the information of the object data indicated by the write operation is updated to the intermediate object mapping data structure. Write the information of the object data recorded in the intermediate object mapping data structure into the first object mapping data structure; In response to the information of the object data recorded in the intermediate object mapping data structure being written into the first object mapping data structure, the current state of the first object mapping data structure is updated to the fourth specified state.
[0016] In an optional embodiment, the synchronization module is further configured to: Synchronization operations are performed on the first object mapping data structure according to the specified synchronization state machine; the specified synchronization state machine includes a first specified state, a second specified state, a third specified state, and a fourth specified state; Specifically, the first object mapping data structure corresponding to the block storage device obtained from the object storage system is in the first designated state; the first object mapping data structure for determining the pending object is in the second designated state; and the corrected first object mapping data structure is in the third designated state.
[0017] In an optional embodiment, the synchronization module is further configured to: determine the undetermined object in the first object mapping data structure based on the tagging information of each object data recorded in the first object mapping data structure.
[0018] Thirdly, embodiments of this application provide an electronic device, including a processor, a memory, and a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, they implement the data update method provided in any embodiment of this application.
[0019] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, and when the program or instructions are executed by a processor, they implement the data update method provided in any embodiment of this application.
[0020] The technical solution provided in this application has at least the following beneficial effects: The data update method provided in this application embodiment, in response to receiving a write operation, identifies the current state of the object mapping data structure corresponding to the write operation; if the current state of the object mapping data structure is a fourth specified state, the information of the object data indicated by the write operation is written into the object mapping data structure; according to the update cycle corresponding to the object mapping data structure, the information of the object data recorded in the object mapping data structure is periodically synchronized to the object storage system, decoupling the update of the object mapping data structure from the write operation process, and asynchronously updating the object mapping data structure, thereby avoiding the update of the object mapping data structure from affecting the write performance of the system. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0022] Figure 1 The schematic diagram illustrates a flow chart of a data update method according to an embodiment of this application; Figure 2 The schematic diagram illustrates a data update method according to another embodiment of this application; Figure 3 A flowchart illustrating a data update method according to yet another embodiment of this application is shown; Figure 4A schematic diagram of a synchronization state machine according to an embodiment of this application is shown; Figure 5 A schematic diagram of the structure of a data update apparatus according to an embodiment of this application is shown; Figure 6 A schematic diagram of the structure of an electronic device according to an embodiment of this application is shown. Detailed Implementation
[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0024] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0025] The data update method provided in this application can be applied to Ceph storage systems. To address the technical problem of object-map data structure (Object-Map) updates affecting write I / O performance (I / O (Input / Output) is the core operation for data exchange between a computer system and external devices (such as disks, networks, and terminals; its essence is the process of moving data between different storage media, also known as a write operation), this application decouples the update of the object-map data structure (Object-Map) from the write operation, updating the object-map data structure (Object-Map) asynchronously. Furthermore, since the Object-Map uses asynchronous updates, there may be differences between the persistent storage in the object storage system and the actual Object-Map. To solve this technical problem, an Object-Map synchronization operation needs to be added. The Object-Map synchronization operation is used to recover the correct Object-Map. During the recovery process, the synchronization progress of the Object-Map can be represented by updating the current state of the Object-Map. The Object-Map synchronization operation can be executed when the block storage device (image) is opened for the first time.
[0026] The data update method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0027] Figure 1 A schematic flowchart illustrating a data update method according to an embodiment of this application is shown. Figure 1 As shown, the data update method includes: Step S101: In response to receiving a write operation, identify the current state of the object mapping data structure corresponding to the write operation. The write operation is used to write object data to the Ceph storage system. The identified object mapping data structure is the object mapping data structure read into memory by the Ceph storage system. If the current state of the object mapping data structure is the fourth specified state, proceed to step S102. If the current state of the object mapping data structure is not the fourth specified state, proceed to step S105.
[0028] In this embodiment, the update and write operations of the object-map data structure (Object-Map) are decoupled, and the Object-Map is updated asynchronously. Furthermore, since the Object-Map is updated asynchronously, there may be a difference between the persistent storage in the object storage system and the actual distribution of object data. To address this technical problem, this embodiment uses the current state of the Object-Map to identify whether the obtained Object-Map differs from the actual distribution of object data. If the current state of the Object-Map is identified as the fourth specified state (e.g., ReadyState), it can be determined that there is no difference between the Object-Map and the actual distribution of object data, meaning the distribution of object data recorded in the Object-Map is correct. Therefore, the information of the object data indicated by the write operation can be written to the Object-Map. If it is detected that the current state of the Object-Map is not the fourth specified state, it can be determined that there is a difference between the Object-Map and the actual distribution of object data. That is, there is an error in the distribution of object data recorded by the Object-Map. The object data indicated by the write operation cannot be written to the Object-Map, and the information of the object data indicated by the write operation should be written to the intermediate object mapping data structure (denoted as TempObject-Map).
[0029] Upon receiving a write operation, the object data indicated by the write operation must also be written to the Ceph storage system. Optionally, a write success message can be sent back after the object data indicated by the write operation has been successfully written.
[0030] Step S102: Write the information of the object data indicated by the write operation into the object mapping data structure.
[0031] Step S103: Write the information of the object data of the write operation instruction into the intermediate object mapping data structure.
[0032] Step S104: When the current state of the object mapping data structure is updated to the third specified state, write the information of the object data recorded in the intermediate object mapping data structure into the object mapping data structure.
[0033] After writing the object data information of the write operation instruction into the intermediate object mapping data structure, it is necessary to merge the intermediate object mapping data structure with the current object mapping data structure at an appropriate time, that is, to write the information recorded in the intermediate object mapping data structure into the current object mapping data structure. This embodiment uses a third specified state (e.g., QueryObjectState) to indicate that the information recorded in the intermediate object mapping data structure can be written into the current object mapping data structure. When it is detected that the current state of the current object mapping data structure has been updated to the third specified state, the object data information recorded in the intermediate object mapping data structure is written into that object mapping data structure.
[0034] Step S105: In response to the information of the object data recorded in the intermediate object mapping data structure being written into the object mapping data structure, the current state of the object mapping data structure is updated to the fourth specified state.
[0035] After writing the object data information recorded in the intermediate object mapping data structure into the object mapping data structure, the current state of the object mapping data structure is updated to the fourth specified state. The fourth specified state indicates that the object data information of the received write operation instruction can be directly written into the object mapping data structure, rather than into the intermediate object mapping data structure.
[0036] Step S106: According to the update cycle corresponding to the object mapping data structure, periodically synchronize the information of the object data recorded in the object mapping data structure to the object storage system for persistent storage.
[0037] Writing write operation instructions to the object data in the Object-Map or TempObject-Map does not affect the writing of the write operation instructions to the Ceph storage system. Updates to the Object-Map are also independent of writing the write operation instructions to the Ceph storage system; updates only occur during the Object-Map's update cycle. Updating the Object-Map refers to writing the current Object-Map to the object storage system (Rados cluster) for persistent storage. As an optional example, Object-Map updates can be controlled using timers. For example, updating the current Object-Map to the object storage system (Rados cluster) every minute, or updating newly added object data in the current Object-Map to the object storage system (Rados cluster). The Rados cluster (Reliable Autonomic Distributed Object Store) is the foundation of the Ceph storage system. In the Ceph storage system, all data is stored as objects. Physically, RADOS consists of a large number of storage device nodes, each with its own hardware resources and running an operating system and file system.
[0038] This application decouples the updating and writing operations of the object-map data structure (Object-Map) and updates the Object-Map asynchronously, thus solving the problem of decreased IO performance caused by Object-Map updates. Furthermore, since the Object-Map is updated asynchronously, there may be differences between the persistent storage in the object storage system and the actual Object-Map. To address this technical problem, an Object-Map synchronization operation is added to recover the correct Object-Map. This synchronization operation can represent the synchronization progress of the Object-Map by updating its current state. If the current state of the Object-Map is the fourth specified state, it can be determined that there is no difference between the Object-Map and the actual object data distribution, meaning the distribution of the object data recorded in the Object-Map is correct. In this case, the information of the object data indicated by the write operation can be written to the Object-Map. If the current state of the Object-Map is not the fourth specified state, it can be determined that there is a difference between the Object-Map and the actual distribution of object data. That is, there is an error in the distribution of object data recorded in the Object-Map. The object data indicated by the write operation cannot be written to the Object-Map, and the information of the object data indicated by the write operation should be written to the intermediate object mapping data structure (denoted as TempObject-Map). If it is detected that the current state of the current object mapping data structure has been updated to the third specified state, the information of the object data recorded in the intermediate object mapping data structure should be written to the object mapping data structure.
[0039] Figure 2 and Figure 3 This illustration shows a flowchart of a data update method according to another embodiment of this application, illustrating the synchronization operation of an object mapping data structure. For example... Figure 2 As shown, the process for performing synchronization operations on object mapping data structures includes: Step S201: In response to the first startup of the block storage device, obtain the first object mapping data structure corresponding to the block storage device from the object storage system. That is, when the block storage device (image) starts up for the first time, read the persistent first object mapping data structure from the object storage system (Rados cluster) and decode it into memory to obtain a basic in-memory object mapping data structure. Since the object mapping data structure is updated asynchronously, it may not be consistent with the actual object data distribution. However, by reading the object mapping data structure, some object data that is not of interest can be filtered out.
[0040] Step S202: Perform a synchronization operation on the first object mapping data structure; wherein, performing a synchronization operation on the object mapping data structure corresponding to the block storage device is used to restore the object mapping data structure corresponding to the block storage device.
[0041] like Figure 3 As shown, the synchronization operation on the first object mapping data structure can be performed according to the following procedure: Step S301: Traverse the first object mapping data structure to determine the objects to be determined in the first object mapping data structure.
[0042] In an optional embodiment, the object data recorded in the first object mapping data structure can be marked to identify actual existing object data. Then, based on the marking information of each object data recorded in the first object mapping data structure, the undetermined objects in the first object mapping data structure are determined. For example, "1" can be used to mark actual existing object data recorded in the first object mapping data structure, and "0" can be used to mark uncertain object data in the first object mapping data structure. The first object mapping data structure is traversed, and object data marked "0" is selected as undetermined objects to obtain a list of undetermined objects (denoted as UnSureObjectList). Next, it is necessary to further confirm whether any undetermined objects exist in the list of undetermined objects.
[0043] Step S302: For each pending object, send an acknowledgment request to the object storage system to determine whether the pending object exists. For each pending object, send an acknowledgment request to the object storage system (rados cluster) to determine whether the pending object exists in the object storage system (rados cluster).
[0044] Step S303: Modify the first object mapping data structure according to the confirmation result corresponding to the confirmation request.
[0045] Step S304: In response to the completion of the correction of the first object mapping data structure, the current state of the first object mapping data structure is the third specified state. When all pending objects have been confirmed, the distribution of object data recorded in the first object mapping data structure is consistent with the actual object data distribution. At this time, the first object mapping data structure is in the third specified state.
[0046] Step S305: During the synchronization operation of the first object mapping data structure, in response to receiving a write operation indicating that object data is to be written to the block storage device, the information of the object data indicated by the write operation is written to the intermediate object mapping data structure. That is, when steps S301-S304 are executed, the first object mapping data structure has not yet been synchronized. During the execution of steps S301-S304, if a write operation indicating that object data is to be written to the block storage device is received, the information of the object data indicated by the write operation is written to the intermediate object mapping data structure.
[0047] Step S306: Write the object data information recorded in the intermediate object mapping data structure into the first object mapping data structure. After executing step S305, the first object mapping data structure is in the third specified state, and the object data information recorded in the intermediate object mapping data structure can be written into the first object mapping data structure.
[0048] Step S307: In response to the information of the object data recorded in the intermediate object mapping data structure being written into the first object mapping data structure, the current state of the first object mapping data structure is updated to the fourth specified state. The first object mapping data structure updated to the fourth specified state completes the synchronization operation.
[0049] Step S203: In response to the completion of the synchronization operation, the current state of the first object mapping data structure is the fourth specified state.
[0050] In order to solve the problem that the distribution of object data recorded in the asynchronously updated object mapping data structure may be inconsistent with the actual distribution of object data, this application embodiment performs a synchronization operation on the object mapping data structure to restore the correct object mapping data structure.
[0051] In an optional embodiment, the synchronization operation of the first object mapping data structure can be controlled by specifying a synchronization state machine. The specified synchronization state machine includes a first specified state (e.g., denoted as InitState, the initial state), a second specified state (e.g., denoted as LoadPersistedState), a third specified state (e.g., denoted as QueryObjectState), and a fourth specified state (e.g., denoted as ReadyState).
[0052] Figure 4 The synchronization state machine of the data update method according to an embodiment of this application is shown. For example... Figure 4 As shown, when the block storage device is started for the first time, the object mapping data structure is read from the object storage system (rados cluster). At this time, the object mapping data structure is in the first specified state (e.g., denoted as InitState). This first specified state is the initial state, which is used to initialize some data structures.
[0053] Traverse the object mapping data structure, determine the object mapping data structure of the object to be determined based on the tag information of each object data recorded in the object mapping data structure, and update the current state of the object mapping data structure to the second specified state.
[0054] For each pending object, an acknowledgment request is sent to the object storage system (Rados cluster) to determine whether the object exists in the object storage system (Rados cluster). Based on the acknowledgment result corresponding to the acknowledgment request, the object mapping data structure is corrected. The corrected object mapping data structure is in the third specified state.
[0055] Since write operations occur during the synchronization of the object mapping data structure, in order to ensure that the object data indicated by the write operation is recorded in the object mapping data structure, the object data of the received write operation indication is recorded in the intermediate object mapping data structure during the synchronization of the object mapping data structure.
[0056] After the pending object in the object mapping data structure is corrected, i.e., after the current state of the object mapping data structure is updated to the third specified state, the object data information recorded in the intermediate object mapping data structure is written back to the object mapping data structure, and the current state of the object mapping data structure is updated to the fourth specified state. The object mapping data structure updated to the fourth specified state completes the synchronization operation.
[0057] Figure 5 A schematic diagram of the structure of a data update apparatus according to an embodiment of this application is shown. Figure 5 As shown, the data update device 500 includes: The identification module 501 is used to identify the current state of the object mapping data structure corresponding to the write operation in response to receiving a write operation; The writing module 502 is used to write the information of the object data indicated by the write operation into the object mapping data structure when the current state of the object mapping data structure is the fourth specified state. The update module 503 is used to periodically synchronize the information of the object data recorded in the object mapping data structure to the object storage system according to the update period corresponding to the object mapping data structure.
[0058] The data update apparatus provided in this application can be applied to Ceph storage systems. To address the technical problem of object-map data structure (Object-Map) updates affecting write I / O performance (I / O (Input / Output) is the core operation for data exchange between a computer system and external devices (such as disks, networks, and terminals; its essence is the process of moving data between different storage media, also known as a write operation), this application decouples the object-map data structure (Object-Map) update from the write operation, updating the object-map data structure (Object-Map) asynchronously. Furthermore, since the Object-Map uses asynchronous updates, there may be differences between the persistent storage in the object storage system and the actual Object-Map. To solve this technical problem, an Object-Map synchronization operation needs to be added. The Object-Map synchronization operation is used to recover the correct Object-Map. During the recovery process, the synchronization progress of the Object-Map can be represented by updating the current state of the Object-Map. The Object-Map synchronization operation can be executed when the block storage device (image) is opened for the first time.
[0059] In an optional embodiment, the device further includes a synchronization module for: If the current state of the object mapping data structure is not the fourth specified state, update the information of the object data indicated by the write operation to the intermediate object mapping data structure; When the current state of the object mapping data structure is updated to the third specified state, the information of the object data recorded in the intermediate object mapping data structure is written into the object mapping data structure. In response to the information of the object data recorded in the intermediate object mapping data structure being written into the object mapping data structure, the current state of the object mapping data structure is updated to the fourth specified state.
[0060] In an optional embodiment, the synchronization module is further configured to: In response to the first startup of the block storage device, the first object mapping data structure corresponding to the block storage device is obtained from the object storage system; The first object mapping data structure is synchronized; wherein, the synchronization operation on the object mapping data structure corresponding to the block storage device is used to restore the object mapping data structure corresponding to the block storage device. In response to the completion of the synchronization operation, the current state of the first object mapping data structure is the fourth specified state.
[0061] In an optional embodiment, the synchronization module is further configured to: Traverse the first object mapping data structure to determine the undetermined objects in the first object mapping data structure; For each pending object, a confirmation request is sent to the object storage system to determine whether the pending object exists; Based on the confirmation result corresponding to the confirmation request, the first object mapping data structure is modified; In response to the completion of the correction of the first object mapping data structure, the current state of the first object mapping data structure is the third specified state.
[0062] In an optional embodiment, the synchronization module is further configured to: During the synchronization operation of the first object mapping data structure, in response to receiving a write operation indicating that object data is to be written to the block storage device, the information of the object data indicated by the write operation is updated to the intermediate object mapping data structure. Write the information of the object data recorded in the intermediate object mapping data structure into the first object mapping data structure; In response to the information of the object data recorded in the intermediate object mapping data structure being written into the first object mapping data structure, the current state of the first object mapping data structure is updated to the fourth specified state.
[0063] In an optional embodiment, the synchronization module is further configured to: Synchronization operations are performed on the first object mapping data structure according to the specified synchronization state machine; the specified synchronization state machine includes a first specified state, a second specified state, a third specified state, and a fourth specified state; Specifically, the first object mapping data structure corresponding to the block storage device obtained from the object storage system is in the first designated state; the first object mapping data structure for determining the pending object is in the second designated state; and the corrected first object mapping data structure is in the third designated state.
[0064] In an optional embodiment, the synchronization module is further configured to: determine the undetermined object in the first object mapping data structure based on the tagging information of each object data recorded in the first object mapping data structure.
[0065] This embodiment decouples the updating and writing operations of the object-map data structure (Object-Map) and updates the object-map data structure (Object-Map) asynchronously. Furthermore, since the Object-Map uses asynchronous updates, there may be a difference between the persistent storage in the object storage system and the actual distribution of object data. To solve this problem, this embodiment identifies whether the obtained Object-Map differs from the actual distribution of object data by checking the current state of the Object-Map. If the current state of the Object-Map is identified as the fourth specified state (e.g., ReadyState), it can be determined that there is no difference between the Object-Map and the actual distribution of object data, meaning the distribution of object data recorded in the Object-Map is correct, and the information of the object data indicated by the write operation can be written to the Object-Map. If the current state of the Object-Map is not identified as the fourth specified state, it can be determined that there is a difference between the Object-Map and the actual distribution of object data, meaning there is an error in the distribution of object data recorded in the Object-Map, and the object data indicated by the write operation cannot be written to the Object-Map. Instead, the information of the object data indicated by the write operation is written to an intermediate object-map data structure (denoted as TempObject-Map).
[0066] The above-described apparatus can execute the method provided in the embodiments of the present invention, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in this embodiment can be found in the data update method provided in the embodiments of the present invention.
[0067] Figure 6 A schematic diagram of the structure of an electronic device according to an embodiment of the present invention is shown. Figure 6 As shown, the electronic device includes: The system includes a processor 601, a communication interface 602, a memory 603, and a communication bus 604. The processor 601, communication interface 602, and memory 603 communicate with each other via the communication bus 604. Memory 603 is used to store computer programs; When processor 601 executes a program stored in memory 603, it performs the following steps: In response to receiving a write operation, identify the current state of the object mapping data structure corresponding to the write operation; When the current state of the object mapping data structure is the fourth specified state, the information of the object data indicated by the write operation is written into the object mapping data structure; According to the update cycle corresponding to the object mapping data structure, the information of the object data recorded in the object mapping data structure is periodically synchronized to the object storage system.
[0068] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0069] The communication interface is used for communication between the aforementioned terminal and other devices.
[0070] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0071] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0072] In another embodiment of the present invention, a computer-readable storage medium is also provided, which stores instructions that, when executed on a computer, cause the computer to perform any of the data update methods described in the above embodiments.
[0073] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the data update methods described in the above embodiments.
[0074] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0075] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0076] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0077] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A data update method, characterized in that, include: In response to receiving a write operation, identify the current state of the object mapping data structure corresponding to the write operation; When the current state of the object mapping data structure is the fourth specified state, the information of the object data indicated by the write operation is written into the object mapping data structure; According to the update cycle corresponding to the object mapping data structure, the information of the object data recorded in the object mapping data structure is periodically synchronized to the object storage system.
2. The method according to claim 1, characterized in that, The method further includes: If the current state of the object mapping data structure is not the fourth specified state, update the information of the object data indicated by the write operation to the intermediate object mapping data structure; When the current state of the object mapping data structure is updated to the third specified state, the information of the object data recorded in the intermediate object mapping data structure is written into the object mapping data structure. In response to the information of the object data recorded in the intermediate object mapping data structure being written into the object mapping data structure, the current state of the object mapping data structure is updated to the fourth specified state.
3. The method according to claim 2, characterized in that, The method further includes: In response to the first startup of the block storage device, the first object mapping data structure corresponding to the block storage device is obtained from the object storage system; The first object mapping data structure is synchronized; wherein, the synchronization operation on the object mapping data structure corresponding to the block storage device is used to restore the object mapping data structure corresponding to the block storage device. In response to the completion of the synchronization operation, the current state of the first object mapping data structure is the fourth specified state.
4. The method according to claim 3, characterized in that, The synchronization operation on the first object mapping data structure includes: Traverse the first object mapping data structure to determine the undetermined objects in the first object mapping data structure; For each pending object, a confirmation request is sent to the object storage system to determine whether the pending object exists; Based on the confirmation result corresponding to the confirmation request, the first object mapping data structure is modified; In response to the completion of the correction of the first object mapping data structure, the current state of the first object mapping data structure is the third specified state.
5. The method according to claim 4, characterized in that, The synchronization operation on the first object mapping data structure includes: During the synchronization operation of the first object mapping data structure, in response to receiving a write operation indicating that object data is to be written to the block storage device, the information of the object data indicated by the write operation is updated to the intermediate object mapping data structure. Write the information of the object data recorded in the intermediate object mapping data structure into the first object mapping data structure; In response to the information of the object data recorded in the intermediate object mapping data structure being written into the first object mapping data structure, the current state of the first object mapping data structure is updated to the fourth specified state.
6. The method according to claim 5, characterized in that, The synchronization operation on the first object mapping data structure includes: Synchronization operations are performed on the first object mapping data structure according to the specified synchronization state machine; the specified synchronization state machine includes a first specified state, a second specified state, a third specified state, and a fourth specified state; Specifically, the first object mapping data structure corresponding to the block storage device obtained from the object storage system is in the first designated state; the first object mapping data structure for determining the pending object is in the second designated state; and the corrected first object mapping data structure is in the third designated state.
7. The method according to claim 5, characterized in that, The step of determining the undetermined object in the first object mapping data structure includes: Based on the tagging information of each object data recorded in the first object mapping data structure, the undetermined objects in the first object mapping data structure are determined.
8. A data update device, characterized in that, include: The identification module is used to identify the current state of the object mapping data structure corresponding to the write operation in response to receiving a write operation; The writing module is used to write the information of the object data indicated by the write operation into the object mapping data structure when the current state of the object mapping data structure is the fourth specified state. The update module is used to periodically synchronize the information of the object data recorded in the object mapping data structure to the object storage system according to the update period corresponding to the object mapping data structure.
9. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the method as described in any one of claims 1-7.
10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the method as described in any one of claims 1-7.