A data processing method, device, equipment and readable storage medium

By recording memory block addresses during the controller's memory allocation phase and skipping the mapping process, service recovery can be performed directly. Combined with the mapping relationship established during IO processing, the problem of excessively long controller service recovery time is solved, achieving fast recovery and reliable storage services.

CN116149565BActive Publication Date: 2026-02-27ZHENGZHOU YUNHAI INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310165854.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-24
Publication Date
2026-02-27
Estimated Expiration
2043-02-24

AI Technical Summary

Technical Problem

When the controller recovers from the storage node's online state, the process of establishing the mapping relationship between memory and B+ tree nodes prolongs the service recovery time, affecting the performance of the storage service.

Method used

When the controller requests memory, it records the address of each memory block and skips the mapping process between memory and B+ tree nodes after the memory request is completed, directly executing the service recovery process; when I/O is received, it constructs the mapping relationship between B+ tree nodes and target address segments to store metadata information.

Benefits of technology

It shortens the service recovery time of the controller, ensures the reliability and uninterruptedness of the storage service, and avoids the performance impact caused by mapping latency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116149565B_ABST
    Figure CN116149565B_ABST
Patent Text Reader

Abstract

The application discloses a data processing method and device, equipment and a readable storage medium in the computer technical field. When a controller in a storage node applies for memory, the address of each memory block of the controller application is recorded; if the memory application is completed, the mapping process of the memory and the B+ tree node is skipped, and the service recovery process of the controller is executed, so that the service of the controller can be recovered as soon as possible. After the service recovery is completed, the memory is mapped with the B+ tree node in the IO processing process, and the storage of the IO metadata information can also be completed. It can be seen that the application can shorten the service recovery time of the controller, and does not affect the storage of the metadata information, thereby guaranteeing the reliability and uninterruptedness of the storage service. Correspondingly, the data processing device, equipment and readable storage medium provided by the application also have the above technical effects.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a data processing method and device, equipment and readable storage medium. BACKGROUND

[0002] At present, when a storage node is online, the controller in the storage node will first apply for memory, and then map each segment of the applied memory to each node of a B+ tree.

[0003] Since the memory applied for by the controller is large, and a B+ tree node maps a fixed length of memory address, it is necessary to perform mapping in a loop to enable each segment of the memory applied for by the controller to have a mapping relationship with different B+ tree nodes. After each segment of the memory applied for by the controller has a mapping relationship with different B+ tree nodes, the other service processes of the controller can continue to be recovered. As a result, the service recovery time of the controller is prolonged, the storage service is obviously interrupted, and the service performance is affected.

[0004] Therefore, how to reduce the service recovery time of the controller is a problem to be solved by those skilled in the art. SUMMARY

[0005] Therefore, the purpose of the present application is to provide a data processing method, device, equipment and readable storage medium to reduce the service recovery time of the controller. The specific scheme is as follows:

[0006] In a first aspect, the present application provides a data processing method, comprising:

[0007] When a controller in a storage node applies for memory, the address of each memory block applied for by the controller is recorded;

[0008] If the memory application is completed, the service recovery process of the controller is performed;

[0009] If the service recovery is completed, when the storage node receives an IO to be processed, a mapping relationship between the B+ tree node where the metadata information of the IO to be processed is located and a target address segment is constructed; the target address segment is any segment of address in any memory block;

[0010] The metadata information is stored in the target address segment based on the mapping relationship.

[0011] Optionally, the recording of the address of each memory block applied for by the controller comprises:

[0012] The starting address of each memory block applied for by the controller is recorded by using an array; wherein the size of each memory block is equal, and the total number of memory blocks is a target value.

[0013] Optionally, it further comprises:

[0014] determining whether the B+ tree node is mapped with a memory address segment;

[0015] If the B+ tree node is not mapped with a memory address segment, performing a step of constructing a mapping relationship between a B+ tree node in which metadata information of the IO to be processed is located and a target address segment, and storing the metadata information to the target address segment based on the mapping relationship.

[0016] Optionally, the method further comprises:

[0017] If the B+ tree node is mapped with a memory address segment, storing the metadata information to the memory address segment mapped by the B+ tree node.

[0018] Optionally, the determining process of the target address segment comprises:

[0019] determining a quotient of an ID of the B+ tree node and a preset value as identification information of a target memory block to which the target address segment belongs, and obtaining a target start address of the target address segment according to the ID of the B+ tree node and the preset value; the preset value is a total number of preset memory lengths included in a single memory block;

[0020] determining the target memory block based on the identification information, and determining the target address segment based on the target start address and the preset memory length in the target memory block.

[0021] Optionally, the storage node is any node in a cluster for constructing a thin pool.

[0022] Optionally, the storage node comprises a plurality of controllers.

[0023] In a second aspect, the present application provides a data processing apparatus, comprising:

[0024] a recording module configured to record addresses of each memory block applied by a controller in a storage node when the controller applies for memory;

[0025] a recovery module configured to perform a service recovery process of the controller if memory application is completed;

[0026] an IO processing module configured to, if the service recovery is completed, construct a mapping relationship between a B+ tree node in which metadata information of an IO to be processed is located and a target address segment when the storage node receives the IO to be processed; the target address segment is any address segment in any memory block; and store the metadata information to the target address segment based on the mapping relationship.

[0027] Optionally, the recording module is specifically configured to:

[0028] An array is used to record a starting address of each memory block applied for by the controller; wherein, sizes of the memory blocks are equal, and a total number of the memory blocks is a target value.

[0029] Optionally, the method further comprises:

[0030] A judging module is configured to judge whether the B+ tree node is mapped with a memory address segment.

[0031] An executing module is configured to, if the B+ tree node is not mapped with a memory address segment, execute a step of constructing a mapping relationship between the B+ tree node where the metadata information of the IO to be processed is located and a target address segment, and storing the metadata information to the target address segment based on the mapping relationship.

[0032] Optionally, the method further comprises:

[0033] A storing module is configured to, if the B+ tree node is mapped with a memory address segment, store the metadata information to the memory address segment mapped by the B+ tree node.

[0034] Optionally, the determining process of the target address segment comprises:

[0035] A quotient of an ID of the B+ tree node and a preset value is determined as identification information of a target memory block where the target address segment belongs, and a target starting address of the target address segment is obtained based on the ID of the B+ tree node and the preset value; the preset value is a total number of preset memory lengths included in a single memory block.

[0036] The target memory block is determined based on the identification information, and the target address segment is determined based on the target starting address and the preset memory length in the target memory block.

[0037] Optionally, the storage node is any node in a cluster for constructing a thin pool.

[0038] Optionally, the storage node comprises a plurality of controllers.

[0039] In a third aspect, the present application provides an electronic device, comprising:

[0040] A memory is configured to store a computer program.

[0041] A processor is configured to execute the computer program to implement the data processing method disclosed above.

[0042] In a fourth aspect, the present application provides a readable storage medium for saving a computer program, wherein the computer program is executed by a processor to implement the data processing method disclosed above.

[0043] It can be seen that the application provides a data processing method, including: when a controller in a storage node applies for memory, recording an address of each memory block of the controller application; if the memory application is completed, executing a service recovery process of the controller; if the service recovery is completed, when the storage node receives an IO to be processed, constructing a mapping relationship between a B+ tree node in which metadata information of the IO to be processed is located and a target address segment; the target address segment is any address segment in any memory block; and storing the metadata information to the target address segment based on the mapping relationship.

[0044] It can be seen that when the controller in the storage node applies for memory, the application records the address of each memory block of the controller application; if the memory application is completed, the mapping process of the memory and the B+ tree node is skipped, and the service recovery process of the controller is executed instead, so that the service of the controller can be recovered as soon as possible. After the service recovery is completed, the application maps the memory and the B+ tree node in the IO processing process, so that the storage of the IO metadata information can also be completed. That is, when the storage node receives the IO to be processed, the application constructs a mapping relationship between the B+ tree node in which the metadata information of the IO to be processed is located and the target address segment; the target address segment is any address segment in any memory block; and stores the metadata information to the target address segment based on the mapping relationship. It can be seen that the application can shorten the service recovery time of the controller, and will not affect the storage of the metadata information, so as to ensure the reliability and uninterruptedness of the storage service.

[0045] Correspondingly, the data processing device, equipment and readable storage medium provided by the application also have the above technical effects. BRIEF DESCRIPTION OF DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiment or prior art description. Obviously, the drawings in the following description are only embodiments of the application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of the provided drawings.

[0047] Figure 1 A flow chart of a data processing method disclosed by the application;

[0048] Figure 2 A flow chart of another data processing method disclosed by the application;

[0049] Figure 3 A schematic diagram of a data processing device disclosed by the application;

[0050] Figure 4 A schematic diagram of an electronic device disclosed by the application. DETAILED DESCRIPTION

[0051] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative effort belong to the scope of protection of the present application.

[0052] At present, when a storage node is online, the controller in the storage node will first apply for memory, and then map each segment of the applied memory to each node of a B+ tree. Since the memory applied for by the controller is large, and a B+ tree node maps a fixed length of memory address, it is necessary to perform mapping in a loop to enable each segment of the memory applied for by the controller to have a mapping relationship with different B+ tree nodes. After each segment of the memory applied for by the controller has a mapping relationship with different B+ tree nodes, the other service processes of the controller can continue to be restored. As a result, the service recovery time of the controller is prolonged, the storage service is obviously interrupted, and the service performance is affected. Therefore, the present application provides a data processing scheme, which can skip the mapping of memory and B+ tree nodes in the memory application, and directly execute the service recovery process of the controller, so that the service of the controller can be restored as soon as possible, and the service recovery time of the controller is shortened. After the service recovery is completed, the present application maps the memory and the B+ tree nodes in the IO processing process, so that the storage of the IO metadata information is not affected.

[0053] A data processing method provided by an embodiment of the present application will be described below. The data processing method described below can be mutually referred to with other embodiments described below.

[0054] Referring to Figure 1 The embodiment of the present application discloses a data processing method, comprising:

[0055] S101, when a controller in a storage node applies for memory, recording the address of each memory block applied for by the controller.

[0056] In the embodiment, the storage node is any node in a cluster for constructing a thin pool. Moreover, the storage node can include one or more controllers. For example, the storage node is a node including two controllers. Generally, when the storage node joins the cluster or the newly created cluster needs to create a thin pool or a controller switching occurs in the node, the controller in the storage node will apply for memory. The memory application stage can be regarded as part of the controller recovery process.

[0057] The size of the memory applied for by the controller each time can be determined with reference to a preset table. The preset table records the total memory size of a node and the size of the memory that can be applied for each time corresponding to the total memory size. For example, the total memory size of a node is 128G, and the size of the memory that can be applied for each time is set to 10G; for another example, the total memory size of a node is 256G, and the size of the memory that can be applied for each time is set to 32G. The specific content in the preset table can be flexibly determined based on experience and actual needs.

[0058] The memory applied for by the controller each time can be divided into a plurality of memory blocks of the same size, so as to subsequently perform mapping of the memory and the B+ tree node. For example, the memory applied for by the controller each time is divided into blocks of 1M size, and then the starting address of each memory block is recorded, thereby realizing recording of the address of each memory block applied for by the controller. In a specific embodiment, recording the address of each memory block applied for by the controller includes: recording the starting address of each memory block applied for by the controller by using an array; wherein the sizes of the memory blocks are equal, and the total number of the memory blocks is a target value. Of course, the code or label of each memory block can also be recorded by using an array, as long as different memory blocks can be distinguished.

[0059] In an example, the total number of the memory blocks can be set to 51200, and then the array records 51200 elements, which are the starting addresses of each memory block. It should be noted that the memory length mapped by a B+ tree node is fixed, and the preset memory length is, for example, 512 bytes. If a memory block is 1M in size and the preset memory length is 512 bytes, then one memory block can map 2048 B+ tree nodes. That is, one memory block can be divided into 2048 address segments, and each address segment can be mapped with a B+ tree node. For a more detailed use process of the B+ tree, reference can be made to the related art, and the present embodiment will not be described here.

[0060] In S102, if the memory application is completed, a service recovery process of the controller is performed.

[0061] After the controller in the storage node applies for the memory, the present embodiment skips the mapping process of the memory and the B+ tree node, and directly performs the service recovery process of the controller. In the service recovery process of the controller, the memory management service (such as garbage collection) of the controller, the IO flow transfer and the control service, etc. can be recovered.

[0062] In S103, if the service recovery is completed, when the storage node receives an IO to be processed, a mapping relationship between the B+ tree node in which the metadata information of the IO to be processed is located and a target address segment is constructed; the target address segment is any address segment in any memory block.

[0063] S104. Store metadata information in the target address range based on the mapping relationship.

[0064] In one specific implementation, when a storage node receives an I / O operation to be processed, it first determines whether the B+ tree node is mapped to a memory address segment. If the B+ tree node is not mapped to a memory address segment, a mapping relationship is constructed between the B+ tree node containing the metadata information of the I / O to be processed and the target address segment. Based on the mapping relationship, the metadata information is stored in the target address segment. If the B+ tree node is mapped to a memory address segment, there is no need to construct a mapping relationship; the metadata information is directly stored in the memory address segment mapped by the B+ tree node. The I / O to be processed is either a read operation or a write operation. Therefore, when processing I / O, it is first checked whether the B+ tree node containing the metadata of the current I / O is mapped to corresponding memory. If it is, the memory mapped by the B+ tree node is used to store the metadata of the current I / O; otherwise, memory mapping is performed on the B+ tree node.

[0065] In one specific implementation, the process of determining the target address segment includes: determining the identifier information of the target memory block to which the target address segment belongs by the quotient of the B+ tree node ID and a preset value; obtaining the target starting address of the target address segment based on the B+ tree node ID and the preset value; the preset value being the total number of preset memory lengths included in a single memory block; determining the target memory block based on the identifier information; and determining the target address segment within the target memory block based on the target starting address and the preset memory length. For example, if a memory block is 1MB in size and the preset memory length is 512 bytes, then the preset value is 2048. The quotient of the B+ tree node ID containing the metadata information of the currently processed IO and 2048 is the identifier information of the target memory block. The identifier information of the target memory block can be the starting address of the target memory block recorded in the above array, or it can be other codes or labels. The address offset can be obtained by taking the remainder of the B+ tree node ID divided by 2048, and then the target starting address of the target address segment is calculated based on the address offset. The target memory block can then be determined by querying the array above. Then, within the target memory block, 512 bytes of memory space are taken starting from the target address of the target address segment to determine the target address segment.

[0066] It can be seen that, when the controller in the storage node applies for memory, the address of each memory block applied for by the controller is recorded; if the memory application is completed, the mapping process of the memory and the B+ tree node is skipped, and the service recovery process of the controller is executed, so that the service of the controller can be recovered as soon as possible. After the service recovery is completed, the memory and the B+ tree node are mapped in the IO processing process, so that the storage of the IO metadata information can also be completed. That is, when the storage node receives the IO to be processed, the mapping relationship between the B+ tree node in which the metadata information of the IO to be processed is located and the target address segment is constructed; the target address segment is any address segment in any memory block; and the metadata information is stored in the target address segment based on the mapping relationship. It can be seen that, the application can not only shorten the service recovery time of the controller, but also will not affect the storage of the metadata information, so as to ensure the reliability and uninterruptedness of the storage service.

[0067] The following describes a scheme with a cluster formed by two or more double-controlled storage nodes as an example. The cluster is used to construct a thin pool, each storage node in the cluster is an IO GROUP (Input / Output GROUP), and each storage node includes two controllers. All the storage nodes in the cluster share a CSM (Control State Machine), which can control the management information of the cluster. There is an Agent module on each controller. The memory sizes of the storage nodes constituting the cluster can be different. A storage node is a storage device. The storage device can construct a full-flash thin pool based on the cluster provided in the embodiment. The storage device can specifically include at least one processor, at least one memory, a power supply, a communication interface, an input / output interface, a display, a communication bus, and the like.

[0068] The memory used by the metadata of the simplified pool is applied through a DMM (Dynamic Memory Management). When an offline node rejoins the cluster, the CSM informs the Agent in each controller in the node through a message mechanism that memory needs to be applied. Then, the Agent in each controller in the node applies for memory according to the size of the memory needed to be applied, in multiple times, with 1 MB as a memory block, and saves the first address of the memory obtained each time in an array according to the order of the application. The array is defined by the Agent, and 51200 elements can be recorded in the array, and each element in the array can be recorded as iobUnit, and corresponds to an ID. The Agent also defines the following content: the macro constant NODE_PER_UNIT = 2048, indicating that each 1 MB memory block can be divided into 2048 sectors, and the 2048 sectors are mapped with 2048 B+ tree nodes. The macro constant NODE_MEMORY_SIZE = 512 bytes, indicating the size of a sector.

[0069] After the memory application is completed, the Agent informs the CSM through a message mechanism that the memory application has been completed. After receiving the message, the CSM starts other recovery processes of the controller. That is, the mapping of the memory and the B+ tree nodes is not performed in the memory application process, and after the memory application is completed, other recovery processes of the controller are directly started to complete the recovery of the controller as soon as possible.

[0070] After the recovery of the controller is completed, the node can process IOs by using the memory applied by the controller. In the IO processing process, the metadata of the current IO is stored in the memory by means of the B+ tree nodes. At this time, it is first checked whether the B+ tree node where the metadata of the current IO is located is mapped with corresponding memory. If the B+ tree node does not have corresponding memory, the node ID of the B+ tree node is obtained, and the formula iobUnitId = nodeID / NODE_PER_UNIT is used to calculate the number iobUnitId of the memory block to be used by the B+ tree node. According to the number iobUnitId, the corresponding array element is searched in the aforementioned array, and the memory first address unitAddr of the memory block corresponding to iobUnitId is taken out. Then, the address offset unitOffset is calculated according to the formula unitOffset = nodeID%NODE_PER_UNIT, and then the memory address addr2 is calculated in the memory block numbered iobUnitId with the address offset unitOffset. Then, 512 bytes of continuous memory starting from the memory address addr2 is taken as the memory mapped by the current B+ tree node, and is used to store the metadata of the current IO. If the B+ tree node has mapped memory, the metadata of the current IO is directly stored in the memory mapped by the B+ tree node.

[0071] Please refer to Figure 2 In the memory application phase, the embodiment applies for a memory block of 1MB size multiple times and records it, and the mapping between the memory and the B+ tree node can be referred to the record subsequently. The embodiment separates the mapping step between the memory and the B+ tree node from the memory application phase, and performs other recovery procedures immediately after the memory application without the mapping step, so that the overall recovery time of the controller can be shortened. Because the mapping between the memory and the B+ tree node needs to be performed multiple times, and the loop prolongs the time length of the memory application procedure, and further causes the overall recovery time of the controller to be prolonged. The embodiment performs 51200 times of mapping in the IO processing procedure, and the mapping between the memory applied by one controller and the B+ tree node can be completed, while the existing technology needs to be looped 104857600 times. It is verified by experiments that compared with the existing technology, the overall recovery time of the controller can be shortened from tens of seconds to 500 milliseconds. In order to normally complete the metadata storage, the embodiment adds a step in the IO processing procedure: when a B+ tree node is used for the first time, the mapping relationship between the B+ tree node and the corresponding memory is created to store the metadata.

[0072] It can be seen that the embodiment shortens the overall recovery time of the controller by applying for the memory by the memory block and changing the timing of the mapping between the B+ tree node and the memory, and does not affect the storage of the metadata information, so that the reliability and uninterruptedness of the storage service are ensured.

[0073] Next, a data processing apparatus provided by the embodiment of the application is introduced, and the data processing apparatus described below can be referred to the data processing method described above.

[0074] Please refer to Figure 3 As shown in the figure, the embodiment of the application discloses a data processing apparatus, which comprises:

[0075] The recording module 301 is configured to record the address of each memory block applied by the controller when the controller in the storage node applies for the memory.

[0076] The recovery module 302 is configured to perform the service recovery procedure of the controller if the memory application is completed.

[0077] The IO processing module 303 is configured to, if the service recovery is completed, construct the mapping relationship between the B+ tree node in which the metadata information of the IO to be processed is located and the target address segment when the storage node receives the IO to be processed, the target address segment being any address segment in any memory block, and store the metadata information to the target address segment based on the mapping relationship.

[0078] In a specific implementation, the recording module is specifically configured to:

[0079] The starting address of each memory block applied for by the array record controller is recorded; wherein, the sizes of the memory blocks are equal, and the total number of the memory blocks is a target value.

[0080] In one embodiment, the method further comprises:

[0081] The judging module is configured to judge whether the B+ tree node is mapped with the memory address segment.

[0082] The executing module is configured to, if the B+ tree node is not mapped with the memory address segment, execute the step of constructing the mapping relationship between the B+ tree node in which the metadata information of the IO to be processed is located and the target address segment, and storing the metadata information into the target address segment based on the mapping relationship.

[0083] In one embodiment, the method further comprises:

[0084] The storing module is configured to, if the B+ tree node is mapped with the memory address segment, store the metadata information into the memory address segment mapped by the B+ tree node.

[0085] In one embodiment, the determining process of the target address segment comprises:

[0086] The quotient of the ID of the B+ tree node and a preset value is determined as the identification information of the target memory block to which the target address segment belongs, and the target starting address of the target address segment is obtained based on the ID of the B+ tree node and the preset value; the preset value is the total number of preset memory lengths included in a single memory block.

[0087] The target memory block is determined based on the identification information, and the target address segment is determined based on the target starting address and the preset memory length in the target memory block.

[0088] In one embodiment, the storage node is any node in a cluster for constructing a thin pool.

[0089] In one embodiment, the storage node comprises a plurality of controllers.

[0090] The more specific working processes of the modules and units in the embodiments can refer to the corresponding contents disclosed in the foregoing embodiments, and will not be described herein.

[0091] It can be seen that the data processing apparatus provided in the embodiments skips the mapping process between the memory and the B+ tree node after the memory application is completed, and instead executes the service recovery process of the controller, so that the service of the controller can be recovered as soon as possible. After the service recovery is completed, the memory is mapped with the B+ tree node in the IO processing process, so that the storage of the metadata information of the IO can also be completed. It can be seen that the application can not only shorten the service recovery time of the controller, but also will not affect the storage of the metadata information, so as to ensure the reliability and uninterruptedness of the storage service.

[0092] An electronic device provided by an embodiment of the present application is described below. The electronic device described below can be referred to the data processing method and device described above.

[0093] Referring to Figure 4 The electronic device provided by an embodiment of the present application includes:

[0094] The memory 401 is configured to store a computer program.

[0095] The processor 402 is configured to execute the computer program to implement the method disclosed in any of the above embodiments.

[0096] In this embodiment, when the processor executes the computer program stored in the memory, the following steps can be specifically implemented: when the controller in the storage node applies for memory, the address of each memory block applied for by the controller is recorded; if the memory application is completed, the service recovery process of the controller is executed; if the service recovery is completed, when the storage node receives an IO to be processed, a mapping relationship between the B+ tree node in which the metadata information of the IO to be processed is located and a target address segment is constructed; the target address segment is any address segment in any memory block; and the metadata information is stored in the target address segment based on the mapping relationship.

[0097] In this embodiment, when the processor executes the computer program stored in the memory, the following steps can be specifically implemented: the starting address of each memory block applied for by the controller is recorded by using an array; and the size of each memory block is equal, and the total number of memory blocks is a target value.

[0098] In this embodiment, when the processor executes the computer program stored in the memory, the following steps can be specifically implemented: it is judged whether the B+ tree node is mapped with a memory address segment; if the B+ tree node is not mapped with a memory address segment, the step of constructing a mapping relationship between the B+ tree node in which the metadata information of the IO to be processed is located and a target address segment is executed; and the metadata information is stored in the target address segment based on the mapping relationship.

[0099] In this embodiment, when the processor executes the computer program stored in the memory, the following steps can be specifically implemented: if the B+ tree node is mapped with a memory address segment, the metadata information is stored in the memory address segment mapped by the B+ tree node.

[0100] In the embodiment, the processor, when executing the computer program stored in the memory, can specifically implement the following steps: determining the quotient of the ID of the B+ tree node and a preset value as identification information of a target memory block to which a target address segment belongs, and obtaining a target starting address of the target address segment according to the ID of the B+ tree node and the preset value; the preset value is a total number of preset memory lengths included in a single memory block; determining the target memory block based on the identification information, and determining the target address segment based on the target starting address and the preset memory length in the target memory block.

[0101] Further, the embodiment of the application further provides a server as the electronic device. The server can specifically include at least one processor, at least one memory, a power supply, a communication interface, an input / output interface and a communication bus. The memory is used to store a computer program, the computer program is loaded and executed by the processor to realize the related steps in the data processing method disclosed in any of the preceding embodiments.

[0102] In the embodiment, the power supply is used to provide working voltage for each hardware device on the server; the communication interface can create a data transmission channel between the server and external devices, and the communication protocol followed by the communication interface is any communication protocol applicable to the technical solution of the application, which is not limited specifically herein; the input / output interface is used to obtain external input data or output data to the outside, and the specific interface type can be selected according to the specific application needs, which is not limited specifically herein.

[0103] In addition, the memory as a carrier for resource storage can be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the resources stored thereon include an operating system, a computer program and data, etc., and the storage mode can be temporary storage or permanent storage.

[0104] The operating system is used to manage and control each hardware device and computer program on the server to realize the operation and processing of the processor on the data in the memory, and can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program capable of completing the data processing method disclosed in any of the preceding embodiments, the computer program can further include a computer program capable of completing other specific work. In addition to the data including virtual machines, the data can further include the developer information of the virtual machines.

[0105] Further, the embodiment of the application further provides a terminal as the electronic device. The terminal can specifically include but is not limited to a smart phone, a tablet computer, a notebook computer or a desktop computer, etc.

[0106] Generally, the terminal in the embodiment includes a processor and a memory.

[0107] The processor can include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor can be implemented in at least one of a hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), a PLA (Programmable Logic Array). The processor can also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also referred to as a CPU (Central Processing Unit). The coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor can be integrated with a GPU (Graphics Processing Unit) that is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor can further include an AI (Artificial Intelligence) processor for processing machine learning-related computing operations.

[0108] The memory can include one or more computer-readable storage media that can be non-transitory. The memory can also include a high-speed random access memory, and a nonvolatile memory such as one or more disk storage devices, flash storage devices. In the present embodiment, the memory is at least used to store the following computer programs, wherein the computer programs are loaded and executed by the processor, and can implement the related steps in the data processing method executed by the terminal side disclosed in any of the preceding embodiments. In addition, the resources stored in the memory can also include an operating system and data, and the storage mode can be temporary storage or permanent storage. The operating system can include Windows, Unix, Linux, and the like. The data can include, but is not limited to, application update information.

[0109] In some embodiments, the terminal can further include a display screen, an input / output interface, a communication interface, a sensor, a power supply, and a communication bus.

[0110] A readable storage medium provided by the embodiments of the present application is described below. The readable storage medium described below can be mutually referred to with the data processing method, device and equipment described above.

[0111] A readable storage medium for storing a computer program, wherein the computer program is executed by a processor to implement the data processing method disclosed in the foregoing embodiments. The readable storage medium is a computer readable storage medium, which is a carrier for storing resources, and can be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc. The resources stored on the readable storage medium include an operating system, a computer program and data, etc. The storage mode can be temporary storage or permanent storage.

[0112] In the embodiment, the computer program executed by the processor can specifically implement the following steps: when the controller in the storage node applies for memory, recording the address of each memory block applied for by the controller; if the memory application is completed, executing a service recovery process of the controller; if the service recovery is completed, when the storage node receives an IO to be processed, constructing a mapping relationship between a B+ tree node in which metadata information of the IO to be processed is located and a target address segment; the target address segment is any address segment in any memory block; and storing the metadata information to the target address segment based on the mapping relationship.

[0113] In the embodiment, the computer program executed by the processor can specifically implement the following steps: using an array to record the starting address of each memory block applied for by the controller; wherein the size of each memory block is equal, and the total number of the memory blocks is a target value.

[0114] In the embodiment, the computer program executed by the processor can specifically implement the following steps: judging whether the B+ tree node is mapped with a memory address segment; if the B+ tree node is not mapped with a memory address segment, executing the step of constructing a mapping relationship between the B+ tree node in which the metadata information of the IO to be processed is located and a target address segment; and storing the metadata information to the target address segment based on the mapping relationship.

[0115] In the embodiment, the computer program executed by the processor can specifically implement the following steps: if the B+ tree node is mapped with a memory address segment, storing the metadata information to the memory address segment mapped by the B+ tree node.

[0116] In the embodiment, the computer program executed by the processor can specifically implement the following steps: determining the quotient of the ID of the B+ tree node and a preset value as the identification information of a target memory block to which the target address segment belongs, obtaining a target starting address of the target address segment according to the ID of the B+ tree node and the preset value; the preset value is the total number of a preset memory length included in a single memory block; determining the target memory block based on the identification information, and determining the target address segment based on the target starting address and the preset memory length in the target memory block.

[0117] The terms "first", "second", "third", "fourth" and the like in the context of the present application, if exist, are used for distinguishing between similar objects and not necessarily for describing a sequential or chronological order. It is to be understood that the data so distinguished can be interchanged under appropriate circumstances such that the embodiments of the present application described herein can be practised in other than the described order. Also, the terms "comprise", "comprising", "include", "including", and the like are to be construed in an inclusive, rather than an exclusive sense as that term is generally interpreted by those of ordinary skill in the art. Additionally, the terms "comprise", "comprising", "include", "including", and the like are used synonymously with the term "have" or "having".

[0118] It should be noted that the terms "comprise", "comprising", "include", "including", and the like are used synonymously with the term "have" or "having" in the context of describing the technical features of the present application. Thus, for instance, a device or a part thereof "comprising" a particular technical feature means that the device or the part thereof "has" the particular technical feature. The use of these terms in the present description is merely to cover a "open ended" as opposed to a "closed ended" transition. Thus, these terms are used in their broadest sense and do not necessarily denote a limitation of the number of technical features the device or the part thereof can have. In other words, the use of these terms in the present description is merely to cover the possibility that the device or the part thereof "has" one or more technical features.

[0119] The various embodiments in the specification are described with progressive manner as the embodiments focus on different aspects of the present application, the same or similar parts among the various embodiments can be mutually referred to.

[0120] The steps of a method or algorithm described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module can reside in RAM, flash memory, ROM, electrically programmable ROM (EPROM or EEPROM), registers, hard disk, a removable disk, a CD-ROM, or any other form of readable storage medium known in the art. An exemplary storage medium is coupled to the processor such that the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium can be integral to the processor. The processor and the storage medium can reside in an ASIC.

[0121] The principles and implementations of the present application have been described in the specification with specific examples. The above description of the embodiments is only for the purpose of understanding the present application. Those skilled in the art can make changes to the specific embodiments and applications according to the principles and implementations of the present application. In summary, the content of the specification should not be understood as limiting the present application.

Claims

1. A data processing method, characterized in that, include: When a controller in a storage node requests memory, the address of each memory block requested by the controller is recorded; If the memory allocation is completed, the service recovery process of the controller is executed; If the service is restored, when the storage node receives the IO to be processed, it constructs a mapping relationship between the B+ tree node containing the metadata information of the IO to be processed and the target address segment. The target address segment is any address segment within any memory block; The metadata information is stored in the target address range based on the mapping relationship.

2. The method according to claim 1, characterized in that, The recording of the address of each memory block requested by the controller includes: An array is used to record the starting address of each memory block requested by the controller; wherein the size of each memory block is equal and the total number of memory blocks is the target value.

3. The method according to claim 1, characterized in that, Also includes: Determine whether the B+ tree node is mapped to a memory address segment; If the B+ tree node does not map a memory address segment, then the mapping relationship between the B+ tree node containing the metadata information of the IO to be processed and the target address segment is constructed. The step of storing the metadata information to the target address segment based on the mapping relationship.

4. The method according to claim 3, characterized in that, Also includes: If the B+ tree node is mapped to a memory address segment, then the metadata information is stored in the memory address segment mapped to the B+ tree node.

5. The method according to any one of claims 1 to 4, characterized in that, The process of determining the target address range includes: The quotient of the B+ tree node's ID and a preset value is determined as the identification information of the target memory block to which the target address segment belongs. The target starting address of the target address segment is obtained based on the B+ tree node's ID and the preset value. The preset value is the total number of preset memory lengths included in a single memory block. The target memory block is determined based on the identification information, and the target address segment is determined within the target memory block based on the target starting address and the preset memory length.

6. The method according to claim 5, characterized in that, The storage node can be any node in the cluster used to build the thin pool.

7. The method according to claim 6, characterized in that, The storage node includes multiple controllers.

8. A data processing apparatus, characterized in that, include: A recording module is used to record the address of each memory block requested by the controller when the controller in the storage node requests memory; The recovery module is used to execute the service recovery process of the controller if the memory allocation is completed. The IO processing module is used to construct a mapping relationship between the B+ tree node containing the metadata information of the IO to be processed and the target address segment when the storage node receives the IO to be processed after the service recovery is completed. The target address segment is any address segment within any memory block; The metadata information is stored in the target address range based on the mapping relationship.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the method as described in any one of claims 1 to 7.

10. A readable storage medium, characterized in that, Used to store a computer program, wherein the computer program, when executed by a processor, implements the method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for storing data

    CN103995855A

  • Fault recovery method for meta-data service, server, client and system

    CN108900337A