Method, electronic device and computer program product for storing and querying data

By adopting hierarchical structure and hash ring mapping in an edge computing environment, the search mechanism of distributed storage systems is optimized, and the performance degradation caused by node decentralization is solved, and more efficient data storage and query are achieved.

CN115079935BActive Publication Date: 2025-09-05EMC IP HLDG CO LLC
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110275311.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-15
Publication Date
2025-09-05
Estimated Expiration
2041-03-15

AI Technical Summary

Technical Problem

In the existing distributed storage system based on edge computing, the decentralized organization of nodes leads to a degradation in the performance of the lookup mechanism and fails to fully utilize the heterogeneity of nodes, resulting in limited overall system performance.

Method used

A distributed storage system adopts a hierarchical structure, using the topological relationship of nodes to query metadata in a smaller range, map nodes to different levels of hash rings through a hash ring, first store data in a smaller range, and then expand to a larger range, and select storage nodes based on the topological structure of nodes.

Benefits of technology

It improves data access speed, reduces query time, enhances data access efficiency, and ensures data availability through backup mechanisms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115079935B_ABST
    Figure CN115079935B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method for storing data, comprising: storing the data on a first node, the first node being selected from a first node set comprising a first edge node and its child nodes; selecting a second node for storing the data from a second node set comprising a second edge node and its child nodes, the first edge node being a child node of the second edge node; and storing the data on the second node. The present disclosure also provides a method for querying data. The present disclosure can reduce the time required to query data in a distributed storage system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of computers, and more particularly, to a method for storing data, a method for querying data, an electronic device, a non-transitory computer storage medium, and a computer program product. Background Art

[0002] Currently, more and more clouds, edge nodes, and a large number of clients are participating in 5G networks and edge computing in the form of nodes. They are connected together to form a distributed storage system to provide users with high throughput and high availability of data.

[0003] Unfortunately, existing distributed storage systems based on edge computing are organized in a decentralized manner across all nodes. Consequently, as the number of participating nodes increases, data lookup mechanisms (such as distributed hash tables) require longer search paths or more hops to find metadata related to them, leading to performance degradation. Furthermore, existing distributed storage systems fail to consider node heterogeneity, treating data equally and failing to fully utilize the computing resources of high-performance devices, which in turn limits overall system performance. Summary of the Invention

[0004] Embodiments of the present disclosure provide a solution for storing and querying data.

[0005] According to a first aspect of the present disclosure, a method for storing data is provided, comprising: storing the data on a first node, the first node being selected from a first node set including a first edge node and its child nodes; selecting a second node for storing the data from a second node set including a second edge node and its child nodes, the first edge node being a child node of the second edge node; and storing the data on the second node.

[0006] According to a second aspect of the present disclosure, a method for querying data is provided, comprising: using a hash value of the data to query the data in a first node set including a first edge node and its child nodes; and in response to a failure in querying the data in the first node set, using the hash value of the data to query the data in a second node set including a second edge node and its child nodes, wherein the first edge node is a child node of the second edge node.

[0007] According to a third aspect of the present disclosure, an electronic device is provided, comprising: at least one processing unit; and at least one memory, wherein the at least one memory is coupled to the at least one processing unit and stores instructions for execution by the at least one processing unit, wherein the instructions, when executed by the at least one processing unit, enable the electronic device to execute a method according to any one of the first or second aspects above.

[0008] According to a fourth aspect of the present disclosure, a non-transitory computer storage medium is provided, comprising machine-executable instructions, which, when executed by a device, cause the device to perform the method according to any one of the first or second aspects above.

[0009] According to a fifth aspect of the present disclosure, a computer program product is further provided, comprising machine-executable instructions, which, when executed by a device, enable the device to perform the method according to any one of the first or second aspects above.

[0010] This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the disclosure, nor is it intended to limit the scope of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The above and other objects, features and advantages of the present disclosure will become more apparent through a more detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings, wherein like reference numerals generally represent like components throughout the exemplary embodiments of the present disclosure.

[0012] Figure 1 A schematic diagram illustrating an exemplary distributed storage system capable of implementing embodiments of the present disclosure is illustrated;

[0013] Figure 2 A schematic flow chart of a method for storing data according to an embodiment of the present disclosure is illustrated;

[0014] Figure 3 A conceptual diagram illustrating selecting a storage node based on a hash ring according to an embodiment of the present disclosure is illustrated;

[0015] Figure 4 A conceptual diagram illustrating multiple hash rings based on a topology structure between nodes of a distributed storage system according to an embodiment of the present disclosure is illustrated;

[0016] Figure 5 The diagram shows an embodiment of the present disclosure based on Figure 4 Conceptual diagram of multiple hash rings used to select storage nodes;

[0017] Figure 6 A schematic flow chart of a method for querying data according to an embodiment of the present disclosure is illustrated;

[0018] Figure 7 A schematic flow chart of a method for querying data in a node set according to an embodiment of the present disclosure is illustrated;

[0019] Figure 8 The use of an embodiment according to the present disclosure is illustrated Figure 4 Conceptual diagram of querying data using multiple hash rings as shown; and

[0020] Figure 9 A schematic block diagram of an example device that may be used to implement embodiments of the present disclosure is illustrated. DETAILED DESCRIPTION

[0021] The preferred embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although preferred embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0022] As used herein, the term "including" and its variations represent open inclusion, i.e., "including but not limited to." Unless otherwise stated, the term "or" means "and / or." The term "based on" means "based at least in part on." The terms "an example embodiment" and "an embodiment" mean "at least one example embodiment." The term "another embodiment" means "at least one additional embodiment." The terms "first," "second," etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0023] As mentioned above, all nodes in edge computing-based distributed storage systems are typically organized in a decentralized manner. When a client requests access to application data, it first needs to locate the data by searching for the application data's metadata in the distributed hash table (DHT) of the distributed storage system. However, this metadata request must be forwarded multiple times across the decentralized global nodes before the metadata indicating the application data's storage location is retrieved. Furthermore, a significant number of these global nodes are unstable, making metadata retrieval time-consuming or even impossible, resulting in degraded system performance.

[0024] On the other hand, this distributed storage system ignores the heterogeneity of nodes, treating each node equally and assigning data storage tasks to them. This results in some nodes with weaker performance (for example, user terminal devices) having insufficient storage space to store data or storing hot data, which also leads to a decline in overall system performance.

[0025] In view of this, multiple embodiments of the present disclosure are provided to solve or at least alleviate the above-mentioned problems. Multiple embodiments of the present disclosure utilize the topological relationship between nodes in a distributed storage system to improve the search mechanism of the distributed storage system, so that metadata of application data is preferentially queried within a relatively small range, thereby improving the speed of data access.

[0026] Figure 1 FIG. 1 shows a schematic diagram of an exemplary distributed storage system 100 capable of implementing embodiments of the present disclosure. Figure 1 As shown, the distributed storage system 100 in the edge computing environment can be generally implemented as a hierarchical structure, including a terminal layer 110, a far edge layer 120, a middle edge layer 130, a near edge layer 140 and a cloud 150.

[0027] The terminal layer 110 generally includes various types of terminal nodes 111, 112, 113, 114, etc. (also referred to as clients), such as desktop computers, laptops, smart phones, wearable devices, security cameras, smart cars, etc. The terminal nodes 111-114 join the distributed storage system 100 through wired or wireless connections according to their geographical location, network configuration, etc., so as to be communicatively coupled to each other. For example, the terminal node 111 can be a smart phone, which accesses the corresponding cell according to its geographical location, connects to the nearest far edge node, and switches from one edge node to another as the location changes. For another example, the terminal node 112 can be a smart car, which connects to a nearby Internet of Vehicles edge node according to its location, and switches to the corresponding Internet of Vehicles edge node during driving.

[0028] The far edge layer 120 includes far edge nodes 121, 122, 123, and 124 deployed to communicate with the terminal nodes 111-114 of the terminal layer 110. The far edge nodes can generally be mobile edge computing (MEC) devices that have more computing resources (e.g., processor performance, storage capacity, access speed, etc.) than the terminal nodes. For example, the far edge devices 121-124 can be computing devices deployed near a base station that can locally process and store at least a portion of the data from the terminal nodes with minimal latency.

[0029] In the hierarchical structure of the distributed storage system 100, the middle edge layer 130 including the middle edge nodes 131 and 132 is located above the far edge layer 120. The middle edge nodes 131, 132 are typically computing devices (e.g., small computing clusters) with more computing resources (e.g., processor performance, storage capacity, access speed, etc.) than the far edge nodes 121-124, and can be connected to each other, downward to the far edge nodes 121-124, and upward to the near edge node 141 of the near edge layer 140 through a core network (not shown).

[0030] Similarly, near edge node 141 located at near edge layer 140 may have more computing resources than intermediate edge nodes 121 - 124 and is connected to cloud 150 through a core network.

[0031] The cloud 150 may include a plurality of server device clusters provided by various cloud service providers and integrated through software and hardware computing, which provide services as a whole.

[0032] According to an embodiment of the present disclosure, one or more terminal nodes 111-114 may be connected to one of the remote edge nodes 121-124 as its service node via various wired or wireless networks. Figure 1 As shown, terminal nodes 111 and 112 are connected to far-edge node 121, and terminal nodes 113 and 114 are connected to far-edge node 123. It should be understood that this connection can change dynamically over time. For example, terminal node 112 (e.g., a smart car) can drive into the coverage area of ​​far-edge node 121 and connect to far-edge node 121, and then leave the coverage area and disconnect. In other words, each of far-edge nodes 121-124 can serve as a center for all terminal nodes within its coverage area to control the terminal nodes connected to it. Each far-edge node and its terminal nodes form a corresponding node set.

[0033] like Figure 1 As shown, each of the far edge nodes 121-124 is connected to a corresponding intermediate edge node. For example, far edge nodes 121 and 122 are connected to intermediate edge node 131, and far edge nodes 123 and 124 are connected to intermediate edge node 133. The intermediate edge nodes can control the far edge nodes at the next level. Similarly, intermediate edge nodes 131 and 133 are connected to near edge node 141. The near edge node can control the intermediate edge node at the next level, and can further control the far edge nodes and terminal nodes at the next level. Therefore, in Figure 1 In the distributed storage system 100 shown, all nodes form a hierarchical structure in the form of a tree topology.

[0034] according to Figure 1 In the tree topology shown, the far edge node 121 has the terminal nodes 111 and 112 as its child nodes, and the far edge node 121 is in turn a child node of the middle edge node 131, which is in turn a child node of the near edge node 141. Figure 1 In Figure 1, terminal node 112 is indirectly connected to intermediate edge node 131 and is therefore also considered a child node of intermediate edge node 131. In this document, child nodes refer to both direct and indirect child nodes. For example, the child nodes of intermediate node edge 131 include far edge nodes 121 and 122, as well as the child nodes 111 and 112 of far edge node 121. Similarly, the child nodes of near edge node 141 include Figure 1 Shows all nodes located below it.

[0035] In the distributed storage system 100, each node has storage capacity and communication capacity, and can establish a communication path with the requesting node to transmit the requested data in response to data access requests from other nodes. According to an embodiment of the present disclosure, application data and metadata of the application data are stored in the distributed storage system 100, and the metadata may include at least the storage location of the application data, the size of the application data, the source of the application data, etc. According to an embodiment of the present disclosure, a node requesting access to application data can query the metadata of the application data, thereby obtaining the storage location of the application data, and thereby establishing a communication path with the corresponding node to access the application data. As described above, the data search mechanism of the existing distributed storage system is not conducive to the efficient acquisition of metadata of application data, resulting in a decrease in system performance. The following reference Figures 2 to 9 And combined Figure 1 The method of storing and querying data according to the embodiments of the present disclosure is further described in detail.

[0036] although Figure 1 The distributed storage system 100 is shown as including a specific number of terminal nodes, far edge nodes, intermediate edge nodes, and near edge nodes, but those skilled in the art will appreciate that the number of nodes of the distributed storage system 100 is not limited thereto. Figure 1 The distributed storage system 100 is shown as a topological structure as shown in the figure, but its topological structure is not limited thereto, for example, it can include more or fewer levels and any other connected tree topology.

[0037] Figure 2 A schematic flow chart of a method 200 for storing data according to an embodiment of the present disclosure is illustrated.

[0038] In box 210, the data is stored in a first node, and the first node is selected from a first node set including a first edge node and its child nodes. According to an embodiment of the present disclosure, the data can be metadata of application data generated by a node of the distributed storage system 100. For example, the terminal node 111 can capture video data, etc., and expects to upload it to the distributed storage system 100. After determining the storage location of the application data (for example, one or more nodes in the distributed storage system), the metadata of the application data is generated. The metadata includes at least the storage location of the application data, the size of the data, the source of the application data, etc., and will be stored in one or more nodes in the distributed storage system 100 based on the embodiment of the present disclosure.

[0039] As mentioned above and with reference to Figure 1 , as an example only, the terminal node 111 generating the data may be a child node of the far edge node 121. Therefore, the far edge node 121 is determined as the first edge node, and a node is selected from the first node set including the far edge node 121 and its child nodes to store the data. In some embodiments, the node in the first node set for storing the data may be determined based on a comparison between the node in the first node set and the hash value of the data. Figures 3 to 5 Detailed description.

[0040] Figure 3 The diagram shows a conceptual diagram of selecting a storage node based on a hash ring according to an embodiment of the present disclosure. The hash ring 300 refers to a virtual ring to which the hash value space generated by the hash function is mapped. For example, when the value range of the hash space is 0 to 2 32 When -1, the hash value can be evenly mapped to the virtual ring, so that the hash value 0 is mapped to the 12 o'clock position of the ring, and the hash value 2 is mapped to the 12 o'clock position of the ring. 31 Mapped at the 6 o'clock position of the ring, etc. According to an embodiment of the present disclosure, the same hash function can be used to calculate the hash value of each node in the first node set and the hash value of the data to be stored. For example, the hash value of the node identifier (for example, the node IP address) can be calculated and mapped to the hash ring 300. Figure 3 As shown, for example only, the nodes in the node set are mapped to positions 31, 32, 33, and 34 on the hash ring 300 according to their hash values. Similarly, for example only, data A and data B are mapped to positions 301 and 302 on the hash ring 300 according to their hash values. Figure 3As shown, position 301 representing data A is between position 31 and position 32, so according to a predetermined rule, the node corresponding to the first position 32 in a clockwise direction starting from position 301 can be selected as the node for storing data A. Similarly, the node corresponding to position 34 can be selected to store data B. From the above, the nodes in the node set are distributed at corresponding positions on the hash ring according to their hash values, so the hash value of the data can be compared with the hash value of the node to determine the hash value of one or more nodes closest to the hash value of the data, thereby further determining the one or more nodes for storing the data. For example purposes, although Figure 3 Only four positions corresponding to nodes are shown, but depending on the number of nodes in the node set, the number of positions representing nodes on the hash ring can be arbitrary. The following describes multiple hash rings based on the node topology structure in an edge computing environment according to an embodiment of the present disclosure.

[0041] Figure 4 A conceptual diagram of multiple hash rings 400 based on a node topology structure according to an embodiment of the present disclosure is illustrated. Figure 4 The distributed storage system 100 includes three levels of hash rings: the innermost first-level hash ring, the middle second-level hash ring, and the outermost third-level hash ring. For clarity, hash rings at the same level use the same or similar-shaped markers to indicate the location of node hash values. According to the tree topology of its edge computing environment, each node in the distributed storage system 100 is mapped to a corresponding position in one or more of the three hash rings.

[0042] According to an embodiment of the present disclosure, the first level hash ring is formed based on a first node set including a far edge node and its child nodes (e.g., connected terminal nodes). For example only, the first node set includes Figure 1 As shown in FIG. 1 , the remote edge node 121, the terminal node 111, and the terminal node 112 are shown. It should be understood that the first-level hash ring may include more terminal nodes, depending on the number of terminal nodes connected to the remote edge node. Figure 4 As shown, according to its hash value, a terminal node can be mapped to position 41-1 on the first-level hash ring. Thus, the nodes of the first node set including the far edge node and its child nodes are all mapped to corresponding positions on the first-level hash ring.

[0043] The second level hash ring is formed based on the second node set including the middle edge node and its child nodes. More specifically, the second node set includes the middle edge node, the edge far edge nodes that are the child nodes of the middle edge node, and their terminal nodes. For example, Figure 1The intermediate edge node 131 shown in FIG. 1 has child nodes including remote edge nodes 121 and 122 and terminal nodes 111 and 112. It should be understood that, depending on the topological relationship in the distributed storage system, the second-level hash ring may include more or fewer remote edge nodes and more or fewer terminal nodes. These nodes are mapped to corresponding positions on the second-level hash ring according to their hash values. For example, Figure 4 As shown, the same node corresponding to position 41-1 is further mapped to position 41-2 on the second-level hash ring. It should be understood that compared to the first-level hash ring, the second-level hash ring includes more node positions, for example, positions 42-2, 43-2, etc. Specifically, the node corresponding to position 42-1 from another first-level hash ring is mapped to node 42-2 on the second-level hash ring. Thus, the nodes of the second node set including the intermediate edge node and its child nodes are mapped to corresponding positions on the second-level hash ring.

[0044] Similarly, the third level hash ring is formed based on the third node set including the near edge node and its child nodes. More specifically, the third node set includes the near edge node, the intermediate edge node that is the child node of the near edge node, the far edge node and their terminal nodes. For example only, Figure 1 The near edge node 141 shown has child nodes including Figure 1 All nodes shown. Figure 4 As shown, the same node corresponding to positions 41-1 and 41-2 is further mapped to position 41-3 on the third-level hash ring, and the node corresponding to position 42-2 is further mapped to position 42-3 on the third-level hash ring. Thus, the nodes of the third node set including the near-edge node and its child nodes are mapped to corresponding positions on the third-level hash ring.

[0045] It should be noted that all hash rings can use the same hash function so that the same node is mapped to the same relative position on these hash rings. For example, the positions 41-1, 41-2, and 41-3 of the same node are all located at approximately 7 o'clock on the hash ring, and the positions 42-1, 42-2, and 42-3 of the same node are all located at approximately 12 o'clock on the hash ring.

[0046] return Figure 2, in box 220, a second node for storing data is selected from a second node set including a second edge node and its child nodes, and the first edge node is a child node of the second edge node. According to an embodiment of the present disclosure, the first node for storing data is first selected based on a first-level hash ring formed by the first node set, and the second node for storing data is also selected based on a second-level hash ring formed by the second node set. The second edge node of the second node set is a parent node of the first edge node of the first node set, so compared to storing the data in the first node set with a smaller range, the data is also stored in the second node set with a larger range according to the topological relationship of the edge nodes.

[0047] At block 230, the data is stored in the second node. Once the first node is selected from the second set of nodes including the second edge node and its child nodes, the data can be stored in the second node. For example, the data can be transmitted to the second node by establishing a communication connection with the second node.

[0048] In some embodiments, the method 200 may further include selecting a third node for storing data based on a third-level hash ring formed by a third node set. Specifically, the method 200 may include selecting a third node for storing data from a third node set including a third edge node and its child nodes, wherein the second edge node is a child node of the third edge node; and storing the data on the third node.

[0049] In some embodiments, the first node can be determined based on a comparison of the hash values ​​of the nodes in the first node set and the data, and the second node can be determined based on a comparison of the hash values ​​of the nodes in the second node set and the data. Similarly, the third node can be determined based on a comparison of the hash values ​​of the nodes in the third node set and the data. Figure 5 Detailed description.

[0050] Figure 5 The use of an embodiment according to the present disclosure is illustrated. Figure 4 Conceptual diagram of multiple hash rings used to select storage nodes

[0051] Reference Figure 5 , based on the hash value of data C, data C is mapped to a certain position on the first-level hash ring. At this time, node 41-1 is at the position of the node closest to it (for example, the first node position in the clockwise direction). Therefore, in the first node set corresponding to the first-level hash ring, the node corresponding to position 41-1 is selected as the first node for storing data C. Once the first node is selected from the first node set of the first edge node and its child nodes, the data can be stored in the determined first node.

[0052] Then, according to an embodiment of the present disclosure, a second node can also be selected on the second-level hash ring to store data. As shown in the figure, position 43-2 on the second-level hash ring is closer to data C than position 41-2, and therefore replaces position 41-2 to become the position of the hash value closest to data C. Thus, in the second node set, the node corresponding to position 43-2 is selected as the second node for storing data C. Accordingly, a copy of data C can be sent to this node and stored. Similarly, in the third node set corresponding to the third-level hash ring, the node corresponding to position 43-3 can be selected as the node for storing data C. As shown in the figure, positions 43-2 and 43-3 represent the same hash value, and both belong to the same physical node, thereby omitting repeated storage of data.

[0053] As another example, based on the hash value of data D, data D is mapped to a certain position on the first-level hash ring. At this time, position 42-1 is the position closest to data D. Therefore, in the first node set corresponding to the first-level hash ring, the node corresponding to position 42-1 can be selected as the first node for storing data D. Then, similarly, by comparison with the hash value of data D, the node corresponding to position 44-2 in the second node set is selected as the second node for storing data D. Similarly, in the third node set, the node corresponding to position 45-3 on the third-level hash ring is selected as the third node for storing data D. Therefore, copies of data D are sent to the nodes corresponding to positions 44-2 and 45-3 and stored. For data D, positions 42-1, 44-2, and 45-3 can represent different hash values ​​from each other and belong to different physical nodes, so copies of data D are sent to these nodes and stored respectively.

[0054] According to the method 200 of the embodiment of the present disclosure, data is not distributedly stored globally, but is first stored in a smaller range and then expanded to a larger range for storage, thereby reducing the time required to query data and improving the efficiency of accessing data.

[0055] In some cases, nodes, especially terminal nodes, dynamically join or leave the distributed storage system, so the data stored by the nodes can be backed up to a higher-level node regularly or when a specific event occurs (for example, input from an administrator of the distributed storage system) to persist the data and enhance data availability. For example, the data stored at the terminal nodes 111 and 112 can be backed up to a far-edge node 121 with a longer lifespan and stronger performance. In some embodiments, the far-edge node 121 can further back up its stored data to an intermediate edge node 131 with better performance, or even to a near-edge node 141. As a result, data such as a distributed hash table is not only stored in a distributed manner in node sets of different ranges, but is also backed up in a centralized manner to a central node with richer resources in each node set, thereby improving data access efficiency while ensuring data availability.

[0056] Furthermore, when a node selected from the set of nodes does not have sufficient capacity to store data, such as insufficient storage capacity or high network latency, the data may be transmitted to a central node of the set of nodes. In some embodiments, the method 200 may further include: in response to a failure to store the data at the first node, storing the data at a first edge node (e.g., a remote edge node), and in response to a failure to store the data at the second node, storing the data at a second edge node (e.g., an intermediate edge node).

[0057] According to an embodiment of the present disclosure, a node for storing data may store a hash value of the data in association with the data itself, so that corresponding data can be quickly obtained through the hash value of the data during query.

[0058] According to an embodiment of the present disclosure, a method for querying the data stored as described above is also provided. When a user wants to access application data in a distributed storage system, the metadata of the application data can be queried more quickly to at least obtain the storage location of the application data.

[0059] According to the above reference Figures 2 to 5 The method described, data such as metadata can be stored at least one node in the first node set, and at least one node in the second node set and the third node set with a larger number of nodes. Based on the above process of storing data, a corresponding process of querying data is also provided. When a user queries a certain data, the distributed storage system based on edge computing can first query the data in the lowest level first node set, and when the query fails, the query is expanded to the second node set, and if it fails again, the query is expanded to the third node set. The following reference Figure 6-8 The process of querying data in a distributed storage system according to an embodiment of the present disclosure is described in detail.

[0060] Figure 6 A schematic flow chart of a method 600 for querying data according to an embodiment of the present disclosure is shown. At block 610, a hash value of the data is used to query a first set of nodes including a first edge node and its child nodes for the data. The data may be metadata of application data, for example, including a storage location of the application data.

[0061] It should be understood that the number of nodes in a node set may be quite large and dynamically changing, so it is unrealistic for each node to save and dynamically update information about other nodes. In some cases, a node in a node set only knows the existence of a portion of the nodes in the set (for example, nodes within a range of IP addresses), and stores the hash values ​​and addresses of the other nodes it knows as entries in the routing table. In other words, the node can maintain a routing table about the first node set. Figure 7 Describes in detail the process of searching for data within a node collection.

[0062] Figure 7 A schematic flow chart of a method 700 for querying data in a node set according to an embodiment of the present disclosure is shown. In block 710, a query request including a hash value of data is received. For example, one or more child nodes of a first edge child node may receive a query request, and the query request may include a hash value of metadata of application data to be accessed. The node storing the metadata in the first node set may be located by the hash value of the metadata. In some embodiments, a first node in the first node set may be determined based on a comparison of the nodes in the first node set with the hash value.

[0063] In block 720, the node receiving the query request may calculate the distance between its own hash value and the hash value carried in the query request, and calculate the distance between the hash value of the data and other nodes it knows. Figures 2 to 5 As described in [1], nodes are mapped to a hash ring based on their hash values. The node with the closest hash value to the data is selected to store the data based on the comparison of the data's hash value with the nodes in the node set. Therefore, when querying data, the node storing the data is determined in a similar manner.

[0064] At block 730, it is determined whether it is the closest node. If not, at block 750, the query is forwarded to the node in the routing table that is closest to the hash value of the data. According to an embodiment of the present disclosure, the closest node can be iteratively located by forwarding the query.

[0065] If it is determined in box 730 that it is the closest node, then go to box 740 and query the hash value of the data in the node. If the hash value of the data is queried, it means that the data is obtained and the process ends. If the current node cannot query the hash value of the data, it means that the data cannot be queried in the node closest to the hash value of the data. In this case, the data can be queried from the edge node (for example, a far edge node) that is the central node of the first node set. As described above, the central node of the node set can receive data regularly or based on events (for example, input from an administrator of a distributed storage system) to ensure the availability of the data. If the data cannot be queried at the central node, it can be considered that the query for data in the first node set has failed.

[0066] return Figure 6 In response to a failure to query the data in the first node set, at block 620, a hash value of the data is used to query the data in a second node set including a second edge node and its child nodes, where the first edge node is a child node of the second edge node. Depending on the topology between edge nodes, the second node set may include more nodes than the first node set, and the data may be stored in other nodes in the second node set that are not in the first node set. Similarly, each node may maintain a routing table for the second node set, wherein entries in the table associate and store hash values ​​and addresses of other nodes known to the node.

[0067] Combine Figure 8 Describes the process of switching from querying data on a first set of nodes to querying data on a second set of nodes. Figure 8 The use of an embodiment according to the present disclosure is illustrated Figure 4 Conceptual diagram of multiple hash rings used to query data.

[0068] For example, when the node corresponding to position 42-1 on the first-level hash ring cannot find data in the first node set (which means that the hash value of the node in the first node set is closest to the data), it can use its routing table on the second node set to find data. Figure 7The method 700 shown is similar, and the distance between the other nodes in the second node set routing table and the hash value of the data is calculated at the node corresponding to position 42-1, and the node closest to the hash value of the data among itself and other nodes is determined. In other words, the node closest to the hash value of the data, which may store the data, is located based on the second-level hash ring. The query can then be forwarded to the determined closest node, thereby iteratively locating the closest node on the second-level hash ring, and querying the hash value of the data on the closest node. For example, via the node corresponding to position 42-1 on the first-level hash ring, the query is forwarded to the second-level hash ring, and the node corresponding to position 44-2 is determined as the closest node in the second node set. Accordingly, the hash value of the data can be queried on the node corresponding to position 44-2. If the hash value of the data is queried, the process ends. If the current node cannot query the hash value of the data, it means that the data cannot be queried in the node closest to the hash value of the data. In this case, the data can be queried from the edge node (e.g., the middle edge node) that is the center node of the second node set. If the data cannot be found in the central node, it can be considered that the data query in the second node set has failed.

[0069] In some embodiments, the query data from the second node set may be switched to the query data from the third node set. The third node set may include a third edge node and its child nodes, and the second edge node is a child node of the third edge node. For example, the third edge node may be a near edge node at the upper level of the second edge node. Figure 8 , the query is forwarded to the third-level hash ring via the node corresponding to position 44-2 on the second-level hash ring, and the node corresponding to position 45-3 is determined as the closest node in the third node set. Through a similar process as described above, data is queried on the third-level hash ring.

[0070] According to the embodiments of the present disclosure, queries are implemented gradually from small to large scopes rather than directly on a global scale, and data queries and data access in most applications occur locally with low communication delays. Therefore, the data query method according to the embodiments of the present disclosure can reduce the number of hops required for the query and the average delay required for each hop, thereby significantly reducing the query time and improving the efficiency of accessing data.

[0071] Figure 9The schematic block diagram of the example device 900 that can be used to implement the embodiment of the present disclosure is illustrated.For example, the backup system and / or recovery system according to the embodiment of the present disclosure can be implemented by device 900.As shown in the figure, device 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to the computer program instructions stored in a read-only memory (ROM) 902 or the computer program instructions loaded into a random access memory (RAM) 903 from a storage unit 908.In RAM 903, various programs and data required for the operation of device 900 can also be stored.CPU 901, ROM 902 and RAM 903 are connected to each other by bus 904.Input / output (I / O) interface 905 is also connected to bus 904.

[0072] Various components in the device 900 are connected to the I / O interface 905, including an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a magnetic disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0073] The various processes and processing described above, such as method 200 and / or method 700, may be performed by the processing unit 901. For example, in some embodiments, method 200 and / or method 700 may be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 900 via ROM 902 and / or communication unit 909. When the computer program is loaded into RAM 903 and executed by CPU 901, one or more actions of method 200 and / or method 700 described above may be performed.

[0074] The present disclosure may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.

[0075] A computer-readable storage medium can be a tangible device that can hold and store instructions for use by an instruction execution device. A computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination thereof. As used herein, a computer-readable storage medium is not to be construed as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through an electrical wire.

[0076] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in the computer-readable storage medium in each computing / processing device.

[0077] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, and conventional procedural programming languages ​​such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., utilizing an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions. The electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0078] Various aspects of the present disclosure are described herein with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present disclosure. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer-readable program instructions.

[0079] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine such that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0080] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0081] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and the part of the module, program segment or instruction contains one or more executable instructions for realizing the prescribed logical function. In some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the prescribed function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0082] The embodiments of the present disclosure have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons skilled in the art to understand the embodiments disclosed herein.

Claims

1. A method for storing data, comprising: storing the data in a first node, the first node being selected from a first node set including a first edge node and its child nodes, the first node set including nodes of a first ring of a first level in a structure of multiple hash rings; Selecting a second node for storing the data from a second node set including a second edge node and its child nodes, wherein the first edge node is a child node of the second edge node; as well as storing the data in the second node, The method further comprises: Using the hash value of the data to query the first set of nodes for the data; and In response to not finding the data in the first set of nodes, querying the second set of nodes for the data using the hash value of the data; wherein the second node set includes nodes of a second ring of a second level in the structure of the plurality of hash rings, wherein in the structure of the plurality of hash rings, the nodes of the first ring of the first level are arranged within the nodes of the second ring of the second level; wherein the first node is determined based on a comparison of a hash value of a node in the first node set and the hash value of the data; wherein the second node is determined based on a comparison of a hash value of a node in the second node set and the hash value of the data; and The nodes of the first ring of the first level include at least one node corresponding to a far edge node based on the distance relative to a specified cloud, and the nodes of the second ring of the second level include at least one node corresponding to a near edge node based on the distance relative to the specified cloud, and the near edge node is closer to the specified cloud than the far edge node.

2. The method according to claim 1, further comprising: selecting a third node for storing the data from a third node set including a third edge node and its child nodes, wherein the second edge node is a child node of the third edge node; as well as The data is stored in the third node.

3. The method according to claim 1, further comprising: In response to a failure in storing the data on the first node, storing the data on the first edge node; as well as In response to a failure in storing the data on the second node, the data is stored on the second edge node. The method according to claim 1 , wherein the data is metadata of another data and includes at least a storage location of the another data. The method according to claim 1 , wherein the child node of the first edge node is a terminal device.

6. According to the method according to any one of claims 1 to 5, the hash value of the data and the data are stored in association with each other.

7. A method for querying data, comprising: Using a hash value of the data, querying a first node set including a first edge node and its child nodes for the data, the first node set including nodes of a first ring of a first level in a structure of multiple hash rings; as well as In response to a failure in querying the data in the first set of nodes, querying the data in a second set of nodes including a second edge node and its child nodes using the hash value of the data, wherein the first edge node is a child node of the second edge node, wherein the second node set includes nodes of a second ring of a second level in the structure of the plurality of hash rings, wherein in the structure of the plurality of hash rings, the nodes of the first ring of the first level are arranged within the nodes of the second ring of the second level, Querying the data in the first node set includes: determining the first node based on a comparison of hash values ​​of nodes in the first set of nodes and the hash value of the data; querying the first node for the data using the hash value of the data; The nodes of the first ring of the first level include at least one node corresponding to a far edge node based on the distance relative to a specified cloud, and the nodes of the second ring of the second level include at least one node corresponding to a near edge node based on the distance relative to the specified cloud, and the near edge node is closer to the specified cloud than the far edge node.

8. The method according to claim 7, further comprising: The query is received from one of the child nodes of the first edge node.

9. The method according to claim 7, further comprising: In response to a failure in querying the data at the first node, determining a second node in the second set of nodes via the first node and based on a comparison of nodes in the second set of nodes with the hash value; as well as The data is queried in the second node.

10. The method according to claim 7, further comprising: In response to a failure in querying the data at the first node, querying the data at the first edge node in the first node set. The method according to claim 7 , wherein the data is metadata of another data and includes at least a storage location of the another data.

12. An electronic device comprising: at least one processing unit; At least one memory, the at least one memory being coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions, when executed by the at least one processing unit, causing the electronic device to perform the method according to any one of claims 1 to 11.

13. A non-transitory computer storage medium comprising machine-executable instructions which, when executed by a device, cause the device to perform the method according to any one of claims 1 to 11.

14. A computer program product comprising machine-executable instructions which, when executed by a device, cause the device to perform the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Method and apparatus for managing data recovery of distributed storage system

    US20170109247A1

  • Distributed coordination of caching and processing by networking devices

    US20190079869A1

  • Multi-entity resource, security, and service management in edge computing deployments

    WO2020226979A8