Data updating method and device, storage medium and program product

By creating a mapping relationship with the memory area in the cache area, and writing data directly to the storage service node, the problem of low data update efficiency in the existing technology is solved, and a more efficient data update process is achieved.

CN119127903APending Publication Date: 2024-12-13JINAN INSPUR DATA TECH CO LTD

Patent Information

Application Number
CN202411356755.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

In the prior art, data update efficiency is low, and multiple copies of data are required to lead to a long processing time.

Method used

By creating a mapping relationship with the memory area in the cache area, obtaining the mapping address, and sending the data brushing request carrying the mapping address to the storage service node under the data brushing condition, so that the storage service node can directly access the memory area to write data.

Benefits of technology

It avoids multiple copying processes, improves the efficiency of data updates, reduces CPU burden, and improves data access speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127903A_ABST
    Figure CN119127903A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data updating method and device, a storage medium and a program product, and relates to the field of data processing.The method comprises the steps that in response to a data updating request, first data is obtained; storing the first data in a cache region, and creating a mapping relationship between the first data stored in the cache region and a memory region to obtain a mapping address; under the condition that first data stored in the cache region reaches a data downbrushing condition, a data downbrushing request carrying a mapping address is sent to a storage service node, the data downbrushing request is used for requesting to store the first data in the storage service node, and the storage service node is used for accessing the memory region by using the mapping address; the storage service node is used for storing the first data, obtaining the first data through the mapping relation and writing the first data into the storage service node after obtaining the first data. By adopting the scheme, the problem of data processing is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and more specifically, to a data updating method and device, a storage medium, and a program product. Background Art

[0002] With the rapid development of Internet technology, the scale of data continues to grow, and distributed storage systems are widely used in various scenarios.

[0003] At present, the method usually adopted for processing user requests to update data stored in a distributed storage system is to copy the data to be written to the storage system to the data cache area after receiving the user's request, and then copy the data to be written from the data cache area to the memory area, and then send the data update request to each data node in the distributed storage system, so that these data nodes obtain the above-mentioned data to be written from the memory area and write it into the data node.

[0004] However, when adopting the data updating method provided in the above-mentioned related art, the data to be written into the storage system needs to be copied multiple times, and the multiple copying process takes a certain amount of time.

[0005] Therefore, there is a technical problem in the prior art that the efficiency of data updating is low. Summary of the invention

[0006] The embodiments of the present application provide a data updating method and device, a storage medium, and a program product to at least solve the technical problem of low efficiency of data updating.

[0007] According to one embodiment of the present application, a data update method is provided, including: in response to a data update request, obtaining first data, wherein the first data is data to be written to a storage service node at the cluster end; storing the first data in a cache area, and creating a mapping relationship between the first data stored in the cache area and a memory area to obtain a mapping address; when the first data stored in the cache area meets a data flush condition, sending a data flush request carrying the mapping address to the storage service node, wherein the data flush request is used to request that the first data be stored in the storage service node, the storage service node is used to access the memory area using the mapping address and obtain the first data through the mapping relationship, and the storage service node is further used to write the first data to the storage service node after obtaining the first data.

[0008] According to another embodiment of the present application, a data updating device is provided, including: an acquisition unit, for acquiring first data in response to a data update request, wherein the first data is data to be written to a storage service node at the cluster end; a storage unit, for storing the first data in a cache area, and creating a mapping relationship between the first data stored in the cache area and a memory area to obtain a mapping address; a sending unit, for sending a data flush request carrying the mapping address to the storage service node when the first data stored in the cache area meets a data flush condition, wherein the data flush request is used to request that the first data be stored in the storage service node, the storage service node is used to access the memory area using the mapping address, and obtain the first data through the mapping relationship, and the storage service node is further used to write the first data to the storage service node after obtaining the first data.

[0009] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.

[0010] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0011] According to another embodiment of the present application, a computer program product is provided, including 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.

[0012] Through the embodiment provided by the present application, in response to a data update request, the first data is obtained, wherein the first data is the data to be written to the storage service node of the cluster end. Then, the first data is stored in the cache area, and a mapping relationship between the first data stored in the cache area and the memory area is created to obtain a mapping address. Furthermore, when the first data stored in the cache area meets the data flushing condition, a data flushing request carrying the mapping address is sent to the storage service node, wherein the data flushing request is used to request that the first data be stored in the storage service node, the storage service node is used to access the memory area using the mapping address, and obtain the first data through the mapping relationship, and the storage service node is also used to write the first data to the storage service node after obtaining the first data. In other words, using the embodiment of the present application, after the first data is stored in the cache area, by establishing a mapping relationship for the first data, the storage service node can directly access the memory area based on the mapping address of the first data to obtain the first data stored in the cache area, thereby avoiding the technical problem of low data update efficiency caused by multiple copies of data during the data update process in the related art, and achieving the technical effect of improving the data update efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 is a structural diagram of a data updating method according to an embodiment of the present application;

[0014] Figure 2 is a flow chart of a data updating method according to an embodiment of the present application;

[0015] Figure 3 is a flow chart of a data updating method according to an embodiment of the present application;

[0016] Figure 4 It is a structural block diagram of a data updating device according to an embodiment of the present application. DETAILED DESCRIPTION

[0017] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0018] 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 sequence. 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 an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes 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.

[0019] The method embodiments provided in the embodiments of the present application can be but are not limited to the following Figure 1 Execute in the environment architecture shown, such as Figure 1 As shown, the environment architecture includes: a client 102 and a service cluster end 104, wherein the client includes: a user program 102-1, a cache area 102-2, a memory area 102-3, and a message encoding layer 102-4.

[0020] Specifically, the user program 102-1 is used to provide a front-end data editing environment for the user to obtain the first data edited by the user. After the user submits the first data through the user program, a data update request will be triggered. The client will respond to the data update request, obtain the first data, and then store the first data in the cache area 102-2, and create a mapping relationship between the first data stored in the cache area and the memory area 102-3 to obtain the mapping address.

[0021] Next, when the first data stored in the cache area meets the data flushing condition, the client's message encoding layer 102 - 4 will encode the mapping address of the first data to obtain a data flushing request message, and then send the data flushing request message to the service cluster end 104 .

[0022] The service cluster end 104 includes a plurality of storage service nodes. The storage service node will access the memory area by using the mapping address, obtain the first data through the mapping relationship, and then write the first data into the storage service node.

[0023] Through the embodiment provided by the present application, in response to a data update request, the first data is obtained, wherein the first data is the data to be written to the storage service node of the cluster end. Then, the first data is stored in the cache area, and a mapping relationship between the first data stored in the cache area and the memory area is created to obtain a mapping address. Furthermore, when the first data stored in the cache area meets the data flushing condition, a data flushing request carrying the mapping address is sent to the storage service node, wherein the data flushing request is used to request that the first data be stored in the storage service node, the storage service node is used to access the memory area using the mapping address, and obtain the first data through the mapping relationship, and the storage service node is also used to write the first data to the storage service node after obtaining the first data. In other words, using the embodiment of the present application, after the first data is stored in the cache area, by establishing a mapping relationship for the first data, the storage service node can directly access the memory area based on the mapping address of the first data to obtain the first data stored in the cache area, thereby avoiding the technical problem of low data update efficiency caused by multiple copies of data during the data update process in the related art, and achieving the technical effect of improving the data update efficiency.

[0024] As an optional solution, the data update method, the specific steps are as follows Figure 2 Shown include:

[0025] S202, in response to a data update request, obtaining first data, wherein the first data is data to be written to a storage service node on the cluster side.

[0026] Optionally, the data updating method may be applied to, but not limited to, a data updating scenario of a data storage node in a distributed system. The data updating request may be, but not limited to, a data modification request or a data addition request, which is not limited in this embodiment.

[0027] S204: Store the first data in the cache area, and create a mapping relationship between the first data stored in the cache area and the memory area to obtain a mapping address.

[0028] It should be noted that the first data may be, but is not limited to, user-state data written by a user program. After the client obtains the first data in user state, the first data will be put into kernel state and then stored in the cache area. Since the speed of writing to the cache is higher than the speed of directly writing to the disk, in this embodiment, the priority of the cache read-write method is higher than the priority of direct read-write.

[0029] Furthermore, the above-mentioned creation of a mapping relationship between the first data stored in the cache area and the memory area to obtain the mapping address may include, but is not limited to: using a direct memory access mapping (DMA) function to create a mapping relationship between the first data stored in the cache area and the memory area to obtain a DMA mapping address. The DMA mapping here is a technology that allows a hardware subsystem (such as a network interface card, a graphics card, etc.) to directly access the main memory without the intervention of the CPU. This can improve the efficiency of data transmission because data can be directly transmitted between the hardware and the memory, reducing the burden on the CPU.

[0030] Optionally, in some embodiments, after the mapping relationship between the first data stored in the cache area and the memory area is created to obtain the mapping address, the method further includes: encoding N mapping addresses to obtain a data flush request.

[0031] S206, when the first data stored in the cache area meets the data flush condition, a data flush request carrying the mapping address is sent to the storage service node, wherein the data flush request is used to request that the first data be stored in the storage service node, the storage service node is used to access the memory area using the mapping address, and obtain the first data through the mapping relationship, and the storage service node is also used to write the first data to the storage service node after obtaining the first data.

[0032] It should be noted that the above-mentioned refresh conditions may be but are not limited to: the storage time of the first data in the cache area reaches a predetermined time; or the remaining storage space of the cache area is less than or equal to a predetermined threshold; or interaction scenarios such as consistency, availability and partition tolerance are triggered.

[0033] Optionally, in some embodiments, the storage service node may be, but is not limited to, used to indicate an object storage device (OSD) in a cluster server. Specifically, a cluster server may be, but is not limited to, provided with multiple OSD nodes, which may be distributed in different areas to achieve distributed redundant storage of data.

[0034] It should be noted that in some embodiments, a remote direct memory access (RDMA) network may be used, but is not limited to, to send a data flush request carrying a mapping address to a storage service node. The above memory area may be, but is not limited to, a memory used to indicate RDMA, where RDMA is a high-performance network communication technology that allows a computer system to directly access the memory of a remote computer without the intervention of the operating system kernel. This technology is of great significance in the field of data storage because it can significantly increase data transmission speed and reduce latency.

[0035] Optionally, in some embodiments, the above-mentioned sending of the data flush request carrying the mapping address to the storage service node includes: sending the data flush request carrying the mapping address to the storage service node includes: sending the data flush request carrying the mapping address to the primary storage service node among the storage service nodes; when the first data stored in the cache area meets the data flush condition, after sending the data flush request carrying the mapping address to the storage service node, it also includes: when receiving the first data acquisition request sent by the primary storage service node, parsing the mapping address included in the first data acquisition request, and sending the first data corresponding to the mapping address to the primary storage service node; when receiving the second data acquisition request sent by the slave storage service node in the storage service node, parsing the mapping address included in the second data acquisition request, and sending the first data corresponding to the mapping address to the slave storage service node, wherein the second mapping address in the second data acquisition request is sent by the primary storage service node to the slave storage service node.

[0036] Optionally, after sending the data flush request carrying the second virtual storage address to the storage service node, it also includes: after the storage service node receives the data flush request, determining the type of the data flush request; when the storage service node determines that the type of the data flush request is a modification request type, determining second data corresponding to the first data, wherein the data identifier of the first data and the data identifier of the second data are the same; the storage service node removes the second data and writes the first data to the storage service node; when the storage service node determines that the type of the data flush request is an addition request type, writing the first data to the storage service node.

[0037] Through the embodiment provided by the present application, in response to a data update request, the first data is obtained, wherein the first data is the data to be written to the storage service node of the cluster end. Then, the first data is stored in the cache area, and a mapping relationship between the first data stored in the cache area and the memory area is created to obtain a mapping address. Furthermore, when the first data stored in the cache area meets the data flushing condition, a data flushing request carrying the mapping address is sent to the storage service node, wherein the data flushing request is used to request that the first data be stored in the storage service node, the storage service node is used to access the memory area using the mapping address, and obtain the first data through the mapping relationship, and the storage service node is also used to write the first data to the storage service node after obtaining the first data. In other words, using the embodiment of the present application, after the first data is stored in the cache area, by establishing a mapping relationship for the first data, the storage service node can directly access the memory area based on the mapping address of the first data to obtain the first data stored in the cache area, thereby avoiding the technical problem of low data update efficiency caused by multiple copies of data during the data update process in the related art, and achieving the technical effect of improving the data update efficiency.

[0038] As an optional solution, storing the first data in the cache area includes:

[0039] S1, dividing the first data into N first sub-data, where N is an integer and N is greater than or equal to 1.

[0040] S2, storing N first sub-data in N data pages in the cache area, wherein the i-th first sub-data among the N first sub-data is stored in the i-th data page among the N data pages, and i is a positive integer.

[0041] It should be noted that, in some embodiments, the client first searches for a page in the file cache according to the starting offset of the file accessed by the user. If the page can be found, the first data in the user state is copied to the data page, and the user is informed that the write is successful. Otherwise, a new data page is requested, and the new data page is inserted into the cache area, and then the first data in the user state is copied to the page. After the copy is completed, the user is informed that the write is successful.

[0042] Through the embodiment provided by the present application, the first data is divided into N first sub-data, where N is an integer and N is greater than or equal to 1. Then, the N first sub-data are stored in N data pages in the cache area, where the i-th first sub-data of the N first sub-data is stored in the i-th data page of the N data pages, and i is a positive integer. In other words, by using the embodiment of the present application, by using multiple data pages to store the first data, the system can locate and access the required data pages more quickly, thereby improving the data access speed. In addition, paging storage can reduce the read and write operations on the disk because only the required data pages need to be loaded and stored each time. This can reduce I / O operations and improve system performance.

[0043] As an optional solution, creating a mapping relationship between the first data stored in the cache area and the memory area, and obtaining the mapping address includes:

[0044] A mapping relationship between each data page in the N data pages and the memory area is created respectively to obtain N mapping addresses, wherein the mapping address of the j-th data page in the N data pages is the j-th mapping address in the N mapping addresses, and j is a positive integer.

[0045] It should be noted that, in some embodiments, the DMA address mapping function is called when the data page is mounted, and then the DMA address mapping function is used to create a DMA address for each data page.

[0046] Through the embodiment provided by the present application, a mapping relationship between each data page in the N data pages and the memory area is created respectively, and N mapping addresses are obtained, wherein the mapping address of the j-th data page in the N data pages is the j-th mapping address in the N mapping addresses, and j is a positive integer. In other words, using the embodiment of the present application, by creating a mapping relationship between each data page corresponding to the first data stored in the cache and the memory area, the independent mapping address of each data page can help achieve memory protection. The operating system can allocate an independent address space to each process to prevent a process from accessing or modifying the memory of another process, thereby achieving the technical effect of improving the stability of the system. In addition, by establishing a mapping address with a memory area for each data page, the storage service node can flexibly obtain the first data, thereby improving the flexibility and update efficiency of data updates.

[0047] As an optional solution, after obtaining the first data in response to the data update request, the following steps are also included:

[0048] When the storage time of the first data in the cache area reaches a predetermined time, it is determined that the first data meets the data refresh condition.

[0049] For example, assuming that the time when the first data is stored in the cache area is the first time, and the current time is the second time, when the duration between the second time and the first time reaches the predetermined duration, it can be determined that the first data has met the data refresh condition.

[0050] It should be noted that the above examples are optional examples provided to facilitate explanation of the above steps, and there is no limitation on the method for updating the above data.

[0051] When the remaining storage space of the cache area is less than or equal to a predetermined threshold, it is determined that the first data meets the data flushing condition.

[0052] For example, assuming that the total storage capacity of the cache area is ×, and the currently used storage capacity is y, when the difference between × and y reaches a predetermined threshold, it can be determined that the first data meets the data refresh condition.

[0053] It should be noted that the above examples are optional examples provided to facilitate explanation of the above steps, and there is no limitation on the method for updating the above data.

[0054] When it is determined that a target storage service subnode in the storage service node fails, it is determined that the first data meets a data flushing condition.

[0055] Through the embodiments provided by the present application, when the storage time of the first data in the cache area reaches a predetermined time, it is determined that the first data has reached the data flushing condition; or when the remaining storage space in the cache area is less than or equal to a predetermined threshold, it is determined that the first data has reached the data flushing condition; or when it is determined that the target storage service subnode in the storage service node fails, it is determined that the first data has reached the data flushing condition. In other words, by using the embodiments of the present application, by setting the storage time of the data in the cache area, it can be ensured that frequently accessed data remains in the cache, thereby reducing the number of accesses to the underlying storage and improving the data access speed. When the remaining storage space in the cache area is less than or equal to the predetermined threshold, the data flushing condition is automatically triggered, which can avoid the cache area being occupied by invalid data and ensure that the cache space is used to store the most valuable data. When a storage service node fails, the relevant data can be identified and processed in a timely manner to ensure the stability of the system and the integrity of the data.

[0056] As an optional solution, before sending the data update request carrying the mapping address to the storage service node, the following is also included:

[0057] The mapping address corresponding to the first data is encoded to obtain a data flush request.

[0058] It should be noted that, in some embodiments, the above encoding operation may be but is not limited to being completed at the message encoding layer. Optionally, the above encoding of the mapping address corresponding to the first data to obtain the data flush request may include but is not limited to: encoding N mapping addresses to obtain the data flush request.

[0059] According to the embodiment provided by the present application, the first data can be converted into a format more suitable for network transmission by encoding the first data, which helps to improve the efficiency and reliability of data transmission.

[0060] As an optional solution, encoding the mapping address corresponding to the first data to obtain the data flush request includes:

[0061] Encode N mapping addresses to obtain a data flush request.

[0062] It should be noted that, in some embodiments, the encoding of the N mapping addresses may include, but is not limited to: encoding the N mapping addresses so that the data format thereof complies with the data transmission format of the RDMA network.

[0063] According to the embodiment provided by the present application, the first data can be converted into a format more suitable for network transmission by encoding the first data, which helps to improve the efficiency and reliability of data transmission.

[0064] As an optional solution, when the first data stored in the cache area meets the data flushing condition, after sending the data flushing request carrying the mapping address to the storage service node, the method further includes:

[0065] When receiving the successful refresh prompt information sent by the storage service node, it prompts that the data update request is successfully completed.

[0066] Optionally, the prompt indicating that the data update request is successfully completed may include, but is not limited to, at least one of the following:

[0067] By displaying a prompt message in the user program, the successful completion of the data update request is prompted;

[0068] The successful completion of the data update request is prompted by sending a prompt message to the user account that requested the data update.

[0069] It should be noted that, in some embodiments, after the above prompt successfully completes the data update request, it may include but is not limited to: releasing the storage of the above N data pages and performing DMA de-mapping on the above N data pages to release the above DMA mapping relationship.

[0070] Through the embodiments provided by the present application, when receiving the prompt information of successful flushing sent by the storage service node, the successful completion of the data update request is prompted. For the user interface, timely feedback of operation results can improve the user experience, so that users know that their operations have been received and processed by the system, thereby achieving the technical effect of improving the user experience.

[0071] As an optional solution, sending the data flush request carrying the mapping address to the storage service node includes: sending the data flush request carrying the mapping address to a primary storage service node among the storage service nodes;

[0072] When the first data stored in the cache area meets the data flushing condition, after sending the data flushing request carrying the mapping address to the storage service node, it also includes: when receiving the first data acquisition request sent by the master storage service node, parsing the mapping address included in the first data acquisition request, and sending the first data corresponding to the mapping address to the master storage service node; when receiving the second data acquisition request sent by the slave storage service node in the storage service node, parsing the mapping address included in the second data acquisition request, and sending the first data corresponding to the mapping address to the slave storage service node, wherein the second mapping address in the second data acquisition request is sent by the master storage service node to the slave storage service node.

[0073] It should be noted that, in some embodiments, the above-mentioned service cluster end may include, but is not limited to, multiple storage service nodes, including a master storage service node and multiple slave storage service nodes. In a distributed system, the master storage service node is usually responsible for coordinating and managing the entire system, while the slave storage service node is responsible for performing specific tasks. The master storage service node is responsible for processing requests, allocating tasks, managing data, and maintaining system status. The slave storage service node performs corresponding operations according to the instructions of the master node. Data synchronization is required between the master storage service node and the slave storage service node to ensure data consistency and integrity. The master storage service node is responsible for pushing data updates and changes to the slave storage service node, and the slave storage service node is responsible for receiving and applying these changes. This synchronization can be real-time or regular.

[0074] Optionally, in this embodiment, after the client sends the data flush request carrying the mapping address to the master storage service node, the master storage service node sends the data flush request to each slave storage service node. Then, the master storage service node and the slave storage service node can obtain the first data from the client according to the mapping address included in the data flush request.

[0075] In the embodiment provided by the present application, by sending a data flush request to the master storage service node, so that the master storage service node sends the data flush request to each slave storage service node, each storage service node can obtain the first data from the client based on the mapping address in the data flush request. In other words, by adopting the embodiment of the present application, the method of interacting with the storage service node in a numerical control separation manner is adopted to achieve the technical effect of improving the efficiency of data update.

[0076] As an optional solution, after sending the data flush request carrying the second virtual storage address to the storage service node, the method further includes:

[0077] S1, after receiving the data flush request, the storage service node determines the type of the data flush request;

[0078] S2-1, when the storage service node determines that the type of the data refresh request is a modification request type, determining second data corresponding to the first data, wherein the data identifier of the first data and the data identifier of the second data are the same; the storage service node removes the second data and writes the first data to the storage service node;

[0079] S2-2: When the storage service node determines that the type of the data refresh request is an add request type, the first data is written to the storage service node.

[0080] It should be noted that, in some embodiments, the above data refresh request may, but is not limited to, also carry the user's data update type, for example, a modification request type for modifying already written data, or an addition request type for writing new data.

[0081] Furthermore, after the storage service node receives the data flush request, the type of data update can be determined by parsing the data flush request. In the case where the data update type is a modification request type, the storage service node needs to delete the original data and store the first data entered by the user in the storage area of ​​the original data. In the case where the data update type is an addition request type, the storage service node will directly write the first data into the storage service node.

[0082] As an optional solution, it can be based on but not limited to Figure 3 The following example is used to illustrate how to update the above data:

[0083] S302, data cache, specifically, when the user program issues a 4M write operation, the data in the user state address is copied to four data pages (each data page is 1M in size), and then a write success is reported to the user program, while each data page waits for flushing in the cache.

[0084] S304, data mapping, specifically, performing DMA mapping for each data page to obtain a DMA address.

[0085] S306, message editing, specifically, at the client's osdc layer (used to represent the above-mentioned message encoding layer), the DMA address of each data page (4 in total) is encoded into the message, and the message is sent to the OSD; to ensure performance, all data pages in the same object are loaded into one request and sent to the OSD node as much as possible, and each time a data page is refreshed, all data pages of the same object are searched, and if they exist, they are refreshed together.

[0086] S308: message sending. Specifically, sending the request message to the OSD.

[0087] S310, data is written to disk. Specifically, OSD sends a data flush message carrying a DMA address to the osdc layer. The osdc layer parses all DMA addresses in the message, pulls data from multiple DMA addresses and sends it to OSD, so that the data is written to OSD.

[0088] S312, prompting that the update is successful. Specifically, the client informs the user that the data is successfully refreshed.

[0089] S314, unmapping and cache cleaning, specifically, the client first de-DMA maps the memory of each data page, and then releases the memory of each data page.

[0090] By adopting the embodiment of the present application, after the data is stored in the cache area, a mapping relationship is established for the data so that the storage service node can directly access the memory area based on the mapping address of the data to obtain the data stored in the cache area, thereby avoiding the technical problem of low data update efficiency caused by multiple copying of data during the data update process in the related technology, and achieving the technical effect of improving data update efficiency.

[0091] It should be noted that the above examples are optional examples provided to facilitate explanation of the above steps, and there is no limitation on the method for updating the above data.

[0092] In the present embodiment, a data updating device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions thereof will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and contemplated.

[0093] Figure 4is a structural block diagram of a data updating device according to an embodiment of the present application, such as Figure 4 As shown, the device comprises:

[0094] An acquiring unit 402 is configured to acquire first data in response to a data update request, wherein the first data is data to be written to a storage service node on a cluster end;

[0095] The storage unit 404 is used to store the first data in the cache area, and to create a mapping relationship between the first data stored in the cache area and the memory area to obtain a mapping address;

[0096] The sending unit 406 is used to send a data flush request carrying a mapping address to the storage service node when the first data stored in the cache area meets the data flush condition, wherein the data flush request is used to request that the first data be stored in the storage service node, the storage service node is used to access the memory area using the mapping address and obtain the first data through the mapping relationship, and the storage service node is also used to write the first data to the storage service node after obtaining the first data.

[0097] As an optional solution, the above-mentioned storage unit includes: a division module, used to divide the first data into N first sub-data, wherein N is an integer and N is greater than or equal to 1; a storage module, used to store the N first sub-data in N data pages in a cache area, wherein the i-th first sub-data among the N first sub-data is stored in the i-th data page among the N data pages, and i is a positive integer.

[0098] As an optional solution, the above-mentioned storage unit also includes: a creation module, which is used to create a mapping relationship between each data page in the N data pages and the memory area, and obtain N mapping addresses, wherein the mapping address of the j-th data page in the N data pages is the j-th mapping address in the N mapping addresses, and j is a positive integer.

[0099] As an optional solution, the above-mentioned device also includes: a first determination unit, used to determine that the first data has reached the data flushing condition when the storage time of the first data in the cache area reaches a predetermined time; a second determination unit, used to determine that the first data has reached the data flushing condition when the remaining storage space in the cache area is less than or equal to a predetermined threshold; a third determination unit, used to determine that the first data has reached the data flushing condition when it is determined that a target storage service subnode in the storage service node has failed.

[0100] As an optional solution, the above-mentioned device further includes: an encoding unit, used to encode the mapping address corresponding to the first data to obtain a data flush request.

[0101] As an optional solution, the encoding unit further includes: an encoding module, which is used to encode the N mapping addresses to obtain a data flush request.

[0102] As an optional solution, the above-mentioned device also includes: a prompt unit, which is used to prompt that the data update request is successfully completed when receiving the prompt information of successful refresh sent by the storage service node.

[0103] As an optional solution, the sending unit includes: a sending module, configured to send a data flush request carrying a mapping address to a primary storage service node among the storage service nodes;

[0104] As an optional scheme, the above-mentioned device also includes: a first sending unit, which is used to parse the mapping address included in the first data acquisition request sent by the primary storage service node, and send the first data corresponding to the mapping address to the primary storage service node; a second sending unit, which is used to parse the mapping address included in the second data acquisition request sent by the slave storage service node in the storage service node, and send the first data corresponding to the mapping address to the slave storage service node, wherein the second mapping address in the second data acquisition request is sent by the primary storage service node to the slave storage service node.

[0105] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0106] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0107] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0108] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0109] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0110] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0111] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0112] An embodiment of the present application further provides a computer program product, comprising a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program product, 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.

[0113] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0114] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0115] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for updating data, characterized in that: include: In response to the data update request, first data is obtained, wherein the first data is data to be written to the storage service node of the cluster end; storing the first data in a cache area, and creating a mapping relationship between the first data stored in the cache area and a memory area to obtain a mapping address; When the first data stored in the cache area meets the data flush condition, a data flush request carrying the mapping address is sent to the storage service node, wherein the data flush request is used to request that the first data be stored in the storage service node, the storage service node is used to access the memory area using the mapping address, and obtain the first data through the mapping relationship, and the storage service node is also used to write the first data to the storage service node after obtaining the first data.

2. The data updating method according to claim 1, characterized in that: The storing the first data in the cache area comprises: Divide the first data into N first sub-data, where N is an integer and N is greater than or equal to 1; The N first sub-data are stored in N data pages in the cache area, wherein the i-th first sub-data among the N first sub-data is stored in the i-th data page among the N data pages, and i is a positive integer.

3. The data updating method according to claim 2, characterized in that: The step of creating a mapping relationship between the first data stored in the cache area and the memory area to obtain the mapping address includes: A mapping relationship between each data page in the N data pages and the memory area is created respectively to obtain N mapping addresses, wherein the mapping address of the j-th data page in the N data pages is the j-th mapping address in the N mapping addresses, and j is a positive integer.

4. The data updating method according to claim 1, characterized in that: After obtaining the first data in response to the data update request, the method further includes: When the storage time of the first data in the cache area reaches a predetermined time, determining that the first data meets the data flushing condition; or When the remaining storage space of the cache area is less than or equal to a predetermined threshold, determining that the first data meets the data flushing condition; or When it is determined that a target storage service subnode in the storage service node fails, it is determined that the first data meets a data flushing condition.

5. The data updating method according to claim 1, characterized in that: Before sending the data update request carrying the mapping address to the storage service node, the method further includes: The mapping address corresponding to the first data is encoded to obtain the data flush request.

6. The data updating method according to claim 5, characterized in that: Encoding the mapping address corresponding to the first data to obtain the data flush request includes: The N mapping addresses are encoded to obtain the data flush request.

7. The method according to any one of claims 1 to 6, characterized in that When the first data stored in the cache area meets the data flushing condition, after sending the data flushing request carrying the mapping address to the storage service node, the method further includes: When receiving the successful refresh prompt information sent by the storage service node, it prompts that the data update request is successfully completed.

8. The method according to claim 7, characterized in that The sending of the data flush request carrying the mapping address to the storage service node comprises: sending the data flush request carrying the mapping address to a primary storage service node among the storage service nodes; When the first data stored in the cache area meets the data flushing condition, after sending the data flushing request carrying the mapping address to the storage service node, it also includes: when receiving the first data acquisition request sent by the master storage service node, parsing the mapping address included in the first data acquisition request, and sending the first data corresponding to the mapping address to the master storage service node; when receiving the second data acquisition request sent by the slave storage service node in the storage service node, parsing the mapping address included in the second data acquisition request, and sending the first data corresponding to the mapping address to the slave storage service node, wherein the second mapping address in the second data acquisition request is sent by the master storage service node to the slave storage service node.

9. A data updating device, characterized in that: include: An acquiring unit, configured to acquire first data in response to a data update request, wherein the first data is data to be written to a storage service node at a cluster end; A storage unit, used for storing the first data in a cache area, and creating a mapping relationship between the first data stored in the cache area and a memory area to obtain a mapping address; A sending unit is used to send a data flush request carrying the mapping address to the storage service node when the first data stored in the cache area meets the data flush condition, wherein the data flush request is used to request that the first data be stored in the storage service node, the storage service node is used to access the memory area using the mapping address and obtain the first data through the mapping relationship, and the storage service node is also used to write the first data to the storage service node after obtaining the first data.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method according to any one of claims 1 to 8 when executed by a processor.

11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

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

Citation Information

Patent Citations

  • Multi-node storage system and LUN ownernode switching method

    CN107171865A

  • Data downloading method and device and storage medium

    CN115885264A

  • IO access method and device based on block storage, electronic equipment and medium

    CN116489177A

  • Data processing method and device, electronic equipment and storage medium

    CN116893786A

  • Distributed storage data transmission method, device, system, equipment and medium

    CN117573043A

Cited By

  • Data processing method, device, storage medium and computer program product

    WO2026138562A1