Metadata storage method and device, metadata processing method and device and electronic equipment

Through the distributed storage method, the problem of single point failure risk in metadata storage is solved, the reliability and scalability of metadata are improved, and high-pressure nodes are avoided.

CN118796102APending Publication Date: 2024-10-18CHINA MOBILE GROUP ZHEJIANG +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410159058.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-02-04
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

There is a single point of failure risk in existing metadata storage solutions, resulting in poor reliability.

Method used

Using a distributed storage method, the first index node receives the client's storage instruction, stores the target metadata and its corresponding key to the target area, writes the storage instruction as a log entry, and sends it to multiple second index nodes. , the storage is not completed until a preset number of confirmations are received, and success feedback is sent to the client.

Benefits of technology

Distributed storage avoids the concentration of metadata on a single central node, improves storage reliability, and improves scalability and fault tolerance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796102A_ABST
    Figure CN118796102A_ABST
Patent Text Reader

Abstract

The invention discloses a metadata storage method and device, a metadata processing method and device and electronic equipment, and the storage method comprises the steps that a storage instruction sent by a client side is received, the storage instruction indicates that target metadata and keys corresponding to the target metadata are stored in a target area, and the target metadata are stored in the target area; the target area is a storage area determined by the client according to a key corresponding to the target metadata; the storage instruction serves as a log entry to be written into a log, the storage instruction is sent to multiple second index nodes, and the multiple second index nodes comprise the target area; and under the condition that indication information sent by a preset number of second index nodes is received, storing the target metadata and a key corresponding to the target metadata to the target area, and sending feedback information to the client, the feedback information is used for indicating that the target metadata and the key corresponding to the target metadata are successfully stored.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data storage, and in particular to a metadata storage method, processing method, device and electronic device. Background Art

[0002] Currently, for the storage of metadata, a centralized metadata storage solution is mainly used. In the centralized metadata storage solution, all metadata are centrally stored on a single central node. Therefore, there may be a risk of single point failure and poor reliability. Summary of the invention

[0003] The present application discloses a metadata storage method, a processing method, a device and an electronic device to solve the problem of poor metadata storage reliability.

[0004] In order to solve the above problems, this application adopts the following technical solutions:

[0005] In a first aspect, an embodiment of the present application discloses a metadata storage method, which is applied to a first index node, and includes: receiving a storage instruction sent by a client, wherein the storage instruction indicates that target metadata and a key corresponding to the target metadata are stored in a target area, and the target area is a storage area determined by the client according to the key corresponding to the target metadata; writing the storage instruction as a log entry into a log, and sending the storage instruction to multiple second index nodes, wherein the multiple second index nodes include the target area; upon receiving indication information sent by a preset number of second index nodes, storing the target metadata and the key corresponding to the target metadata in the target area, and sending feedback information to the client, wherein the feedback information is used to indicate that the target metadata and the key corresponding to the target metadata are stored successfully.

[0006] In a second aspect, an embodiment of the present application discloses a metadata processing method, which is applied to a client, comprising: determining a key corresponding to the target metadata based on target metadata; determining a target area for storing the target metadata based on the key corresponding to the target metadata; and sending a storage instruction to a first index node based on the target metadata, the key corresponding to the target metadata, and the target area, wherein the storage instruction instructs the target metadata and the key corresponding to the target metadata to be stored in the target area, and the first index node includes the target area.

[0007] In a third aspect, an embodiment of the present application discloses a metadata storage device, which is applied to a first index node, and includes: a first receiving module, used to receive a storage instruction sent by a client, wherein the storage instruction indicates that target metadata and a key corresponding to the target metadata are stored in a target area, and the target area is a storage area determined by the client according to the key corresponding to the target metadata; a first sending module, used to write the storage instruction as a log entry into a log, and send the storage instruction to multiple second index nodes, wherein the multiple second index nodes include the target area; a storage module, used to store the target metadata and the key corresponding to the target metadata in the target area upon receiving indication information sent by a preset number of second index nodes, and send feedback information to the client, wherein the feedback information is used to indicate that the target metadata and the key corresponding to the target metadata are stored successfully.

[0008] In a fourth aspect, an embodiment of the present application discloses a metadata processing device, which is applied to a client, and includes: a first determination module, used to determine a key corresponding to the target metadata based on the target metadata; a second determination module, used to determine a target area for storing the target metadata based on the key corresponding to the target metadata; a second sending module, used to send a storage instruction to a first index node based on the target metadata, the key corresponding to the target metadata, and the target area, wherein the storage instruction instructs to store the target metadata and the key corresponding to the target metadata in the target area, and the first index node includes the target area.

[0009] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method described in the first aspect or the second aspect are implemented.

[0010] In a sixth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect or the second aspect are implemented.

[0011] In the seventh aspect, an embodiment of the present application provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions, which, when executed by a computer, cause the computer to execute: the steps of the method described in the first aspect or the second aspect.

[0012] The technical solution adopted in this application can achieve the following beneficial effects:

[0013] The embodiment of the present application provides a method for storing metadata, wherein a first index node receives a storage instruction sent by a client indicating that target metadata and a key corresponding to the target metadata are stored in a target area, where the target area is a storage area determined by the client according to the key corresponding to the target metadata, and then appends the storage instruction to the log as a log entry, and sends the storage instruction to multiple second index nodes including the target area, and upon receiving instruction information sent by a preset number of second index nodes, stores the target metadata and the key corresponding to the target metadata in the target area, and sends feedback information indicating that the target metadata and the key corresponding to the target metadata have been successfully stored to the client. The present application can avoid the centralized storage of all metadata on a single central node by distributing the target metadata and the key corresponding to the target metadata, without high-pressure nodes, thereby improving the reliability of metadata storage. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 A device architecture diagram disclosed in an embodiment of the present application;

[0015] Figure 2 A flowchart of a metadata storage method disclosed in an embodiment of the present application;

[0016] Figure 3 A storage flow chart disclosed in an embodiment of the present application;

[0017] Figure 4 A schematic diagram of an index node disclosed in an embodiment of the present application;

[0018] Figure 5 A flowchart of leader node election disclosed in an embodiment of the present application;

[0019] Figure 6 A flowchart of a metadata processing method disclosed in an embodiment of the present application;

[0020] Figure 7 A schematic diagram of the structure of a metadata storage device disclosed in an embodiment of the present application;

[0021] Figure 8 A schematic diagram of the structure of a metadata processing device disclosed in an embodiment of the present application;

[0022] Fig. 9 A schematic diagram of the structure of an electronic device disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0023] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0024] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the electrically connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0025] The architecture diagram of the device involved in the solution disclosed in this application is as follows Figure 1 As shown, the apparatus includes a client, a cluster management device (Operator), multiple index nodes (index node, inode), an event bus (Event Bus) and a search engine, wherein the client can communicate with the cluster management device, multiple index nodes, the event bus and the search engine, and the client can directly operate the index node, the cluster management device is mainly used to maintain the node information of all index nodes, and is responsible for the expansion and contraction of the index nodes, the index node can be an electronic device, and the index nodes can communicate with each other, the first index node is a leader node (Leader), the second index node is a follower node (Follower), the event bus is a device related to the message queue, and the event bus is used to record the change event information of the index node, the search engine can be a device cluster, and the search engine can be retrieved through the event bus.

[0026] The metadata storage method, processing method, device and electronic device disclosed in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.

[0027] The present application discloses a metadata storage method, which is applied to a first index node. Figure 2 FIG. 1 is a flow chart of a metadata storage method disclosed in an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:

[0028] S220. Receive a storage instruction sent by the client, wherein the storage instruction instructs to store target metadata and a key corresponding to the target metadata in a target area, and the target area is a storage area determined by the client according to the key corresponding to the target metadata.

[0029] Exemplarily, taking the target metadata as the metadata of the target file as an example, assuming that the / data / test / ck.txt file is written in the test bucket area, the target metadata may include the storage path path of the target file (e.g., / data / test / ), the name name of the target file (e.g., ck.txt), the creation timestamp create_at of the target file (e.g., 1702974764), the size of the target file, etc., and the key corresponding to the target metadata is determined according to the target metadata, for example, the key corresponding to the target metadata may be B_{bucket}_i_{path}{name} (e.g., B_test_i_ / data / test / ck.txt), B_{bucket}_I_{index_key}_{index_val}_{path}{name} (e.g., B_test_I_create_at_1702974764_ / data / test / ck.txt), etc. The key corresponding to the target metadata may include part of the metadata of the target file.

[0030] The target area is a storage area determined by the client according to the key corresponding to the target metadata. For example, the client obtains the correspondence between the key corresponding to the metadata and the storage area from the cluster management device, and then determines the target area corresponding to the key corresponding to the target metadata according to the key corresponding to the target metadata and the correspondence between the key corresponding to the metadata and the storage area. Alternatively, the client can determine the lexicographic order of the key according to the key corresponding to the target metadata, obtain the storage area division information from the cluster management device, and determine the target area corresponding to the key corresponding to the target metadata according to the lexicographic order of the key and the storage area division information. Exemplarily, the storage area division information includes area1[infinitely small, A] and area2[A, infinitely large]. If the lexicographic order of the key belongs to area1, area1 is determined as the target area corresponding to the key corresponding to the target metadata.

[0031] S240: Write the storage instruction into a log as a log entry, and send the storage instruction to a plurality of second index nodes, wherein the plurality of second index nodes include the target area.

[0032] In the present application, the log entry may be appended to the log. It should be noted that the log here may be the log of the first index node.

[0033] That is to say, Figure 3 As shown, after receiving the storage instruction sent by the client, the first index node appends the storage instruction as a new log entry to the log (rocksdb), and sends storage instructions to multiple second index nodes in parallel, instructing the multiple second index nodes to store the target metadata and the keys corresponding to the target metadata to the target area.

[0034] S260. Upon receiving indication information sent by a preset number of second index nodes, store the target metadata and the key corresponding to the target metadata in the target area, and send feedback information to the client, wherein the feedback information is used to indicate that the target metadata and the key corresponding to the target metadata are stored successfully.

[0035] It should be noted that the preset number may be less than the total number of second index nodes including the target area, and the indication information sent by the second index node is used to indicate that the second index node has successfully stored the target metadata and the key corresponding to the target metadata. That is to say, after the preset number of second index nodes successfully store the target metadata and the key corresponding to the target metadata, the first index node also stores the target metadata and the key corresponding to the target metadata to the target area, and then sends feedback information to the client. Subsequently, the target metadata and the key corresponding to the target metadata may continue to be stored in the target area of ​​more second index nodes through asynchronous replication, that is, AP is given priority in C (consistency), A (availability) and P (partition tolerance) to ensure the final consistency. Exemplarily, the preset number may be 1.

[0036] In addition, in the present application, the target metadata and the key corresponding to the target metadata are stored in the target area to facilitate subsequent reading of the target metadata.

[0037] The embodiment of the present application provides a method for storing metadata, wherein a first index node receives a storage instruction sent by a client indicating that target metadata and a key corresponding to the target metadata are stored in a target area, where the target area is a storage area determined by the client according to the key corresponding to the target metadata, and then appends the storage instruction to the log as a log entry, and sends the storage instruction to multiple second index nodes including the target area, and upon receiving instruction information sent by a preset number of second index nodes, stores the target metadata and the key corresponding to the target metadata in the target area, and sends feedback information indicating that the target metadata and the key corresponding to the target metadata have been successfully stored to the client. The present application can avoid the centralized storage of all metadata on a single central node by distributing the target metadata and the key corresponding to the target metadata, without high-pressure nodes, thereby improving the reliability of metadata storage.

[0038] In addition, since this application uses distributed storage, expansion and repair are more flexible, which can improve the storage capacity, computing performance, etc. of the storage system, and can be applied to business scenarios of East Data West Storage.

[0039] In the embodiment of the present application, after sending the feedback information to the client, it may also include: sending the feedback information to the multiple second index nodes at the same time as sending the heartbeat information to the multiple second index nodes next time.

[0040] In one implementation, the database of the first index node and the database of the second index node may be a database in a log-structured merge tree (LSM tree) format. Since the LSM tree structure has the characteristic of sequential writing, using the database in the LSM tree format as the database of the index node can improve the writing performance of the index node.

[0041] In addition, the LSM tree structure can effectively manage read and write caches, perform hierarchical storage, and support heterogeneous storage. Write cache technology combined with high-speed storage can improve overall storage performance.

[0042] In one implementation, the database used by the index node may be RocksDB, that is, the index node uses RocksDB as a storage engine and provides KV storage in LSM tree format.

[0043] In this application, each index node has a RocksDB instance, and RocksDB stores multiple AreaRange segments, such as Figure 4 As shown. The storage structure of the index node is an ordered dictionary that can be regarded as infinite and is sorted according to the key byte order. If the range is divided into multiple ranges at a specified point, each range is an area. In the initial stage (i.e. before the division), there is only one area with an interval of [infinitely small, infinitely large]. When the stored key sequence gradually increases to exceed the preset size (e.g. 64M), the cluster management device will divide the area into two areas and store the truncated position in the corresponding left and right intervals of the area. For example, the initial area is divided from A, and the intervals of the two areas after the division are [infinitely small, A] and [A, infinitely large] respectively. In addition, the cluster management device can also try to merge adjacent small areas at regular intervals.

[0044] It should be noted that the areas in different index nodes may be different. For example, Figure 4As shown, index node 1 includes Inode area1, Inode area2, Inode area3 and Inode area4, index node 2 includes Inodearea3, Inode area1, Inode area5 and Inode area6, index node 3 includes Inode area6, Inodearea2, Inode area4 and Inode area5, index node 4 includes Inode area1, Inode area5, Inodearea3, and index node 5 includes Inode area4, Inode area2 and Inode area6, that is, the same data will not be stored in all index nodes at the same time.

[0045] In the embodiment of the present application, Raft is used as a distributed consensus algorithm. Before receiving the storage instruction sent by the client, a leader node is first elected. Figure 5 As shown, when the server starts, it is initialized as a follower node. The leader node periodically sends heartbeat information to all follower nodes. If the follower node does not receive the heartbeat information of the leader node within the preset time, the follower node waits for a random period of time and then initiates the leader node election. At this time, the follower node that initiates the leader node election acts as a candidate node. The candidate node will accept votes from other nodes. If the vote is successful, the candidate node acts as a leader node and starts to provide services for the client's request. In addition, if the candidate node finds that there is already a leader node during the election process, or that other nodes have a higher term, it will return to a follower node. If the candidate node is successfully elected as a leader node and finds a leader node with a higher term, it will return to a follower node. Exemplarily, the condition for a successful vote can be that more than half of the nodes vote to agree that the candidate node is the leader node.

[0046] The metadata storage method disclosed in the present application can be applied to the storage of massive data.

[0047] The present application embodiment discloses a metadata processing method, which is applied to a client. Figure 6 FIG. 1 is a flowchart of a metadata processing method disclosed in an embodiment of the present application. Figure 6 As shown, the method comprises the following steps:

[0048] S620: Determine a key corresponding to the target metadata according to the target metadata.

[0049] Exemplarily, taking the target metadata as the metadata of the target file as an example, assuming that the / data / test / ck.txt file is written in the test bucket area, the target metadata may include the storage path path of the target file (e.g., / data / test / ), the name name of the target file (e.g., ck.txt), the creation timestamp create_at of the target file (e.g., 1702974764), the size of the target file, etc., and the key corresponding to the target metadata is determined according to the target metadata, for example, the key corresponding to the target metadata may be B_{bucket}_i_{path}{name} (e.g., B_test_i_ / data / test / ck.txt), B_{bucket}_I_{index_key}_{index_val}_{path}{name} (e.g., B_test_I_create_at_1702974764_ / data / test / ck.txt), etc. The key corresponding to the target metadata may include part of the metadata of the target file.

[0050] S640: Determine a target area for storing the target metadata according to a key corresponding to the target metadata.

[0051] Exemplarily, the client obtains the correspondence between the key corresponding to the metadata and the storage area from the cluster management device, and then determines the target area corresponding to the key corresponding to the target metadata based on the key corresponding to the target metadata and the correspondence between the key corresponding to the metadata and the storage area. Alternatively, the client may determine the lexicographic order of the key based on the key corresponding to the target metadata, obtain the storage area division information from the cluster management device, and determine the target area corresponding to the key corresponding to the target metadata based on the lexicographic order of the key and the storage area division information. Exemplarily, the storage area division information includes area1[infinitely small, A] and area2[A, infinitely large]. If the lexicographic order of the key belongs to area1, area1 is determined as the target area corresponding to the key corresponding to the target metadata.

[0052] S660. Send a storage instruction to a first index node according to the target metadata, the key corresponding to the target metadata, and the target area, wherein the storage instruction indicates that the target metadata and the key corresponding to the target metadata are stored in the target area, and the first index node includes the target area.

[0053] In the present application, the first index node is a leader node. Exemplarily, the database of the first index node is a database in LSM tree format, for example, the database may be RocksDB.

[0054] The embodiment of the present application provides a method for processing metadata, wherein the client determines the key corresponding to the target metadata based on the target metadata, determines the target area for storing the target metadata based on the key corresponding to the target metadata, and then sends a storage instruction to the first index node including the target area based on the target metadata, the key corresponding to the target metadata, and the target area, wherein the storage instruction instructs to store the target metadata and the key corresponding to the target metadata in the target area. The present application can avoid all metadata being stored in a single central node by distributing the target metadata and the key corresponding to the target metadata, thereby eliminating high-pressure nodes and improving the reliability of metadata storage.

[0055] In addition, when the client sends a storage instruction to the follower node, the follower node returns the leader node information to the client after receiving the storage instruction, and the client resends the storage instruction to the leader node after receiving the leader node information sent by the follower node.

[0056] In the present application, before determining the key corresponding to the target metadata according to the target metadata, the method may further include: receiving the target metadata.

[0057] In the embodiment of the present application, after sending the storage instruction to the first index node, the method may further include: writing the storage instruction to an event bus, that is, the event bus records the change information of the index node. The event bus can be subscribed by other functional modules to implement different functions.

[0058] In one implementation, after writing the storage instruction to the event bus, the method may further include: sending the query request to a search engine in response to a query request sent by a user terminal, wherein the search engine subscribes to data of the event bus; receiving query information sent by the search engine in response to the query request, and sending the query information to the user terminal. In other words, the search engine may obtain the change information of the index node through the event bus, and then respond to the query request sent by the user terminal. Exemplarily, the search engine may be Elasticsearch.

[0059] In an embodiment of the present application, after sending a storage instruction to the first index node, it may also include: receiving data information input by the user end, wherein the data information is partial information of a key corresponding to the target metadata; determining a storage area corresponding to the data information according to the data information; traversing the storage area, obtaining metadata information corresponding to the data information, and sending the metadata information to the user end. Exemplarily, the key corresponding to the target metadata is B_test_i_ / data / test / ck.txt, and the data information input by the user end may be B_test_i_ / data / test / , and the storage areas corresponding to the data information are determined to be area1 and area2, then the client randomly selects an index node including area1 for scan traversal, obtains metadata information corresponding to the data information, and after the traversal is completed, scans the index nodes including area2 again to obtain metadata information corresponding to the data information, and finally sends a list of all metadata information obtained to the user end.

[0060] After receiving the metadata information list, the user end can select any metadata information to send to the client. The client determines the key corresponding to the metadata information based on the received metadata information, and then determines the storage area for storing the metadata information based on the key corresponding to the metadata information, sends a get request to any index node including the storage area for storing the metadata information, receives the metadata information returned by the index node, and returns it to the client.

[0061] In an implementation manner, before sending the storage instruction to the first index node, the method may further include: acquiring all index node information from a cluster management device, and establishing connections with all index nodes according to all index node information.

[0062] The metadata storage method provided in the embodiment of the present application can be executed by a metadata storage device. In the embodiment of the present application, the metadata storage device executing the metadata storage method is taken as an example to illustrate the device of the metadata storage method provided in the embodiment of the present application.

[0063] The metadata storage device disclosed in the present application is applied to the first index node.

[0064] Figure 7 Schematic diagram of a metadata storage device disclosed in an embodiment of the present application. Figure 7 As shown, the metadata storage device 700 includes: a first receiving module 710 , a first sending module 720 and a storage module 730 .

[0065] In the present application, a first receiving module 710 is used to receive a storage instruction sent by a client, wherein the storage instruction indicates that target metadata and a key corresponding to the target metadata are stored in a target area, and the target area is a storage area determined by the client based on the key corresponding to the target metadata; a first sending module 720 is used to write the storage instruction as a log entry into a log, and send the storage instruction to multiple second index nodes, wherein the multiple second index nodes include the target area; a storage module 730 is used to store the target metadata and the key corresponding to the target metadata in the target area upon receiving indication information sent by a preset number of second index nodes, and send feedback information to the client, wherein the feedback information is used to indicate that the target metadata and the key corresponding to the target metadata are stored successfully.

[0066] In one implementation, the database of the first index node and the database of the second index node are databases in a log-structured merge tree format.

[0067] In one implementation, the database is RocksDB.

[0068] The metadata storage device provided in the embodiment of the present application can implement each process implemented in the metadata storage method embodiment, and will not be described again here to avoid repetition.

[0069] The metadata processing method provided in the embodiment of the present application can be executed by a metadata processing device. In the embodiment of the present application, the metadata processing method is executed by a metadata processing device as an example to illustrate the device of the metadata processing method provided in the embodiment of the present application.

[0070] The metadata processing device disclosed in the present application is applied to a client.

[0071] Figure 8 Schematic diagram of a metadata processing device disclosed in an embodiment of the present application. Figure 8 As shown, the metadata processing device 800 includes: a first determination module 810 , a second determination module 820 and a second sending module 830 .

[0072] In the present application, a first determination module 810 is used to determine a key corresponding to the target metadata based on the target metadata; a second determination module 820 is used to determine a target area for storing the target metadata based on the key corresponding to the target metadata; a second sending module 830 is used to send a storage instruction to a first index node based on the target metadata, the key corresponding to the target metadata, and the target area, wherein the storage instruction indicates that the target metadata and the key corresponding to the target metadata are stored in the target area, and the first index node includes the target area.

[0073] In one implementation, the processing device further includes: a writing module, configured to write the storage instruction into an event bus after sending the storage instruction to the first index node.

[0074] In one implementation, the processing device also includes: a second sending module 830, which is also used to send the query request to the search engine in response to the query request sent by the user terminal after the storage instruction is written to the event bus, wherein the search engine subscribes to the data of the event bus; a second receiving module, which is used to receive the query information sent by the search engine in response to the query request, and send the query information to the user terminal.

[0075] In one implementation, the processing device also includes: a second receiving module, used to receive data information input by the user terminal after sending the storage instruction to the first index node, wherein the data information is partial information of the key corresponding to the target metadata; the second determination module 820, further used to determine the storage area corresponding to the data information based on the data information; the second sending module 830, further used to traverse the storage area, obtain the metadata information corresponding to the data information, and send the metadata information to the user terminal.

[0076] The metadata processing device provided in the embodiment of the present application can implement each process implemented in the metadata processing method embodiment, and will not be described again here to avoid repetition.

[0077] Alternatively, if Fig. 9 As shown, an embodiment of the present application further provides an electronic device 900, including a processor 901 and a memory 902, wherein the memory 902 stores a program or instruction that can be executed on the processor 901, and when the program or instruction is executed by the processor 901, the various steps of the above-mentioned metadata storage method embodiment are implemented, or, when the program or instruction is executed by the processor 901, the various steps of the above-mentioned metadata processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0078] It should be noted that the electronic devices in the embodiments of the present application include mobile electronic devices and non-mobile electronic devices.

[0079] The embodiment of the present application further provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned metadata storage method embodiment is implemented; or, when the program or instruction is executed by a processor, each process of the above-mentioned metadata processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0080] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0081] An embodiment of the present application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes: the steps of the metadata storage method mentioned above, or the steps of the metadata processing method mentioned above.

[0082] The above embodiments of the present application focus on describing the differences between the various embodiments. As long as the different optimization features between the various embodiments are not contradictory, they can be combined to form a better embodiment. Considering the simplicity of the text, they will not be repeated here.

[0083] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A method for storing metadata, characterized in that: Applied to the first index node, including: Receiving a storage instruction sent by a client, wherein the storage instruction instructs to store target metadata and a key corresponding to the target metadata in a target area, where the target area is a storage area determined by the client according to the key corresponding to the target metadata; writing the storage instruction into a log as a log entry, and sending the storage instruction to a plurality of second index nodes, wherein the plurality of second index nodes include the target area; Upon receiving indication information sent by a preset number of second index nodes, the target metadata and the key corresponding to the target metadata are stored in the target area, and feedback information is sent to the client, wherein the feedback information is used to indicate that the target metadata and the key corresponding to the target metadata are stored successfully.

2. The storage method according to claim 1, characterized in that: The database of the first index node and the database of the second index node are databases in a log structure merge tree format.

3. The storage method according to claim 2, characterized in that: The database is RocksDB.

4. A method for processing metadata, characterized in that: Applied to the client, including: According to the target metadata, determining a key corresponding to the target metadata; determining, according to a key corresponding to the target metadata, a target area for storing the target metadata; A storage instruction is sent to a first index node according to the target metadata, a key corresponding to the target metadata, and the target area, wherein the storage instruction indicates that the target metadata and the key corresponding to the target metadata are stored in the target area, and the first index node includes the target area.

5. The processing method according to claim 4, characterized in that: After sending the storage instruction to the first index node, the method further includes: The storage instruction is written to the event bus.

6. The processing method according to claim 5, characterized in that: After writing the storage instruction into the event bus, the method further includes: In response to a query request sent by a user, sending the query request to a search engine, wherein the search engine subscribes to data of the event bus; Receive query information sent by the search engine in response to the query request, and send the query information to the user terminal.

7. The processing method according to claim 4, characterized in that: After sending the storage instruction to the first index node, the method further includes: Receiving data information input by a user, wherein the data information is partial information of a key corresponding to the target metadata; According to the data information, determining a storage area corresponding to the data information; The storage area is traversed to obtain metadata information corresponding to the data information, and the metadata information is sent to the user end.

8. A metadata storage device, characterized in that: Applied to the first index node, including: A first receiving module is used to receive a storage instruction sent by a client, wherein the storage instruction indicates to store target metadata and a key corresponding to the target metadata in a target area, and the target area is a storage area determined by the client according to the key corresponding to the target metadata; A first sending module, configured to write the storage instruction into a log as a log entry, and send the storage instruction to a plurality of second index nodes, wherein the plurality of second index nodes include the target area; A storage module is used to store the target metadata and the key corresponding to the target metadata in the target area upon receiving indication information sent by a preset number of second index nodes, and send feedback information to the client, wherein the feedback information is used to indicate that the target metadata and the key corresponding to the target metadata are successfully stored.

9. A metadata processing device, characterized in that: Applied to the client, including: A first determination module, configured to determine a key corresponding to the target metadata according to the target metadata; A second determination module, configured to determine a target area for storing the target metadata according to a key corresponding to the target metadata; A second sending module is used to send a storage instruction to the first index node according to the target metadata, the key corresponding to the target metadata and the target area, wherein the storage instruction indicates that the target metadata and the key corresponding to the target metadata are stored in the target area, and the first index node includes the target area.

10. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the metadata storage method according to any one of claims 1 to 3 are implemented; or when the program or instruction is executed by the processor, the steps of the metadata processing method according to any one of claims 4 to 7 are implemented.

11. A computer program product, characterized in that The computer program product includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer is caused to execute: the steps of the metadata storage method as described in any one of claims 1 to 3, or the steps of the metadata processing method as described in any one of claims 4 to 7.