Storage component access method and device, equipment and medium
By setting at least two sets of candidate metadata storage components in the storage cluster and forwarding access requests based on the client's access intent and component identification, the problem of limited access performance of the storage cluster is solved, and the scalability and access performance of the metadata storage components are improved.
Patent Information
- Application Number
- CN202411780944.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-25
AI Technical Summary
In the prior art, the storage cluster is only arranged with one set of candidate metadata storage components, resulting in the access performance of the storage cluster being affected as the amount of metadata increases.
Set at least two sets of candidate metadata storage components in the storage cluster, and determine the metadata storage components that the target client needs to access through the access intent and component identification of the target client, thereby forwarding the storage component access request to the correct component.
It realizes the distributed deployment of metadata storage components, improves the storage limit of metadata, ensures the access performance of the storage cluster, and ensures the accuracy and stability of access requests.
Smart Images

Figure CN119690348A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of distributed technology, and in particular to a method, device, equipment and medium for accessing a storage component. Background Art
[0002] In today's big data era, many companies are building their own data lake systems around storage clusters (such as Hadoop clusters, etc.). As companies continue to grow, the amount of data stored in storage clusters increases, and the corresponding file metadata also increases.
[0003] In the prior art, a storage cluster is usually deployed with only one set of candidate metadata storage components. As the amount of metadata increases, its storage limit will be reached quickly, thereby affecting the access performance of the storage cluster. Summary of the invention
[0004] The present invention provides a method, device, equipment and medium for accessing a storage component to solve the problem in the prior art that the storage cluster only has one set of candidate metadata storage components, which may affect the access performance of the storage cluster.
[0005] According to one aspect of the present invention, a method for accessing a storage component is provided. According to the method for accessing a storage component, a storage cluster includes at least two sets of candidate metadata storage components. The method includes:
[0006] Determining the access intention of the target client according to the storage component access request initiated by the target client;
[0007] In the case where the access intention is an intention to add a new directory, determining whether the storage component access request includes a first component identifier to be accessed;
[0008] In a case where the storage component access request includes the first component identifier to be accessed, determining a first target metadata storage component from the at least two sets of candidate metadata storage components according to the first component identifier to be accessed;
[0009] The storage component access request is sent to the first target metadata storage component, so that the first target metadata storage component performs a directory adding operation according to the storage component access request.
[0010] According to another aspect of the present invention, there is provided a storage component access device, which is configured in a storage cluster, the storage cluster including at least two sets of candidate metadata storage components, the device comprising:
[0011] An access intention determination module, used to determine the access intention of the target client according to the storage component access request initiated by the target client;
[0012] A component identification recognition module, used to determine whether the storage component access request contains a first component identification to be accessed when the access intention is an intention to add a new directory;
[0013] a storage component determining module, configured to determine a first target metadata storage component from the at least two sets of candidate metadata storage components according to the first component identifier to be accessed, when the storage component access request includes the first component identifier to be accessed;
[0014] The access request sending module is used to send the storage component access request to the first target metadata storage component, so that the first target metadata storage component performs a directory adding operation according to the storage component access request.
[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0016] at least one processor; and
[0017] a memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for accessing a storage component described in any one of the present invention.
[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement any method for accessing a storage component according to the present invention when the instructions are executed.
[0020] The present invention sets at least two sets of candidate metadata storage components in a storage cluster, determines the access intention of the target client according to the storage component access request initiated by the target client; determines whether the storage component access request contains a first component identifier to be accessed when the access intention is an intention to add a new directory; determines a first target metadata storage component from at least two sets of candidate metadata storage components according to the first component identifier to be accessed when the storage component access request contains the first component identifier to be accessed; sends the storage component access request to the first target metadata storage component, so that the first target metadata storage component performs a directory addition operation according to the storage component access request, and has the beneficial effects of:
[0021] First, since at least two sets of candidate metadata storage components are set up in the storage cluster, a distributed deployment of the metadata storage components is formed, the scalability of the metadata storage components is achieved, the storage limit of the metadata is increased, and the access performance of the storage cluster is guaranteed.
[0022] Secondly, by identifying the first component identifier to be accessed contained in the storage component access request, and then determining the first target metadata storage component that the target client needs to access based on the first component identifier to be accessed, even if at least two sets of candidate metadata storage components are set in the storage cluster, it is still possible to ensure that the storage component access request is forwarded to the correct candidate metadata storage component, thereby ensuring the accuracy and stability of the metadata storage component access.
[0023] Thirdly, it meets the business needs of users to add new directories in candidate metadata storage components, improving the user experience of the storage cluster.
[0024] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0026] Figure 1 A flowchart of a method for accessing a storage component provided in Embodiment 1 of the present invention;
[0027] Figure 2 A flowchart of a method for accessing a storage component provided in Embodiment 2 of the present invention;
[0028] Figure 3 A flowchart of a method for accessing a storage component provided in Embodiment 3 of the present invention;
[0029] Figure 4 A flowchart of a method for accessing a storage component provided in Embodiment 4 of the present invention;
[0030] Figure 5 A flowchart of a method for accessing a storage component provided in Embodiment 5 of the present invention;
[0031] Figure 6 A schematic diagram of the structure of an access device for a storage component provided in Embodiment 6 of the present invention;
[0032] Figure 7 It is a structural diagram of an electronic device for implementing the method for accessing a storage component of an embodiment of the present invention. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0034] It should be noted that the terms "to be visited", "auxiliary", "candidate", "target", "first", "second", "third", "fourth", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0035] Embodiment 1
[0036] Figure 1 This is a flowchart of a method for accessing a storage component provided in the first embodiment of the present invention. This embodiment is applicable to the case where a target client accesses a candidate metadata storage component in a storage cluster to add a new directory. The method can be executed by an access device of the storage component. The access device of the storage component is configured in the storage cluster and can be implemented in the form of hardware and / or software. The storage cluster refers to any cluster with data storage function, such as a Hadoop cluster, etc. The storage cluster includes at least two sets of candidate metadata storage components. Figure 1 As shown, the method includes:
[0037] S101. Determine the access intention of the target client according to a storage component access request initiated by the target client.
[0038] The target client refers to a client that has a need to access the metadata storage component. The types of the target client include but are not limited to a Web client or an APP client, etc. This embodiment does not limit the specific type of the target client. The access intention indicates the intention of the target client to access the candidate metadata storage component in the storage cluster, including but not limited to the intention to add a new directory, the intention to modify the directory, and the intention to query data.
[0039] In one embodiment, the target client generates access intention description information according to the access intention, generates a storage component access request including the access intention description information, and then uses the data channel between the target client and the storage cluster to send the storage component access request to the storage cluster. The storage cluster obtains the storage component access request sent by the target client through the routing component, and sends the storage component access request to the decision component through the routing component.
[0040] The storage cluster parses the storage component access request through the decision component, obtains the access intention description information it carries, and determines the access intention of the target client based on the association between the access intention description information and the access intention.
[0041] For example, assuming that the access intention description information is information A, and there is an association relationship between information A and "add new directory intention", it can be determined that the access intention of the target client is "add new directory intention".
[0042] For another example, assuming that the access intention description information is information B, and there is an association between information B and "modify directory intention", it can be determined that the access intention of the target client is "modify directory intention".
[0043] S102: When the access intention is to add a new directory, determine whether the storage component access request includes a first component identifier to be accessed.
[0044] The new directory intention refers to that the target client wants to create a new directory in the candidate metadata storage component of the storage cluster.
[0045] If the target client specifies to add a new directory in a specific candidate metadata storage component of the storage cluster, a first component identifier to be accessed will be added to the storage component access request. The first component identifier to be accessed represents the component identifier corresponding to the candidate metadata storage component (the candidate metadata storage component for the newly added directory specified by the target client). The component identifier is the unique identity identifier of the candidate metadata storage component, that is, the corresponding candidate metadata storage component can be uniquely determined based on the component identifier.
[0046] Correspondingly, if the target client does not specify to add a new directory in a specific candidate metadata storage component of the storage cluster, the first component identifier to be accessed will not be added to the storage component access request.
[0047] In one implementation, if the storage cluster determines through the decision component that the access intention of the target client is to add a new directory, it further identifies whether the storage component access request includes the first component identifier to be accessed.
[0048] S103: When the storage component access request includes a first component identifier to be accessed, determine a first target metadata storage group from at least two sets of candidate metadata storage components according to the first component identifier to be accessed.
[0049] The candidate metadata storage component refers to a metadata storage component set in a storage cluster, and the metadata storage component refers to a storage component used to store file metadata. The candidate metadata storage component may be composed of a primary storage node and a backup storage node.
[0050] In one embodiment, if the storage cluster determines through a decision component that a storage component access request contains a first component identifier to be accessed, indicating that the target client specifies to add a new directory in a specific candidate metadata storage component of the storage cluster, the storage cluster then determines the candidate metadata storage component specified by the target client from among the candidate metadata storage components as the first target metadata storage group based on the first component identifier to be accessed and the candidate component identifiers corresponding to the candidate metadata storage components.
[0051] In another embodiment, if the storage cluster determines through the decision-making component that the storage component access request does not contain the first component to be accessed identifier, it means that the target client has not specified to add a new directory in a specific candidate metadata storage component of the storage cluster. At this time, the storage cluster determines through the decision-making component, based on the metadata storage capacity of each candidate metadata storage component, a candidate metadata storage component for performing the directory addition operation from each candidate metadata storage component as the second target metadata storage group.
[0052] In another embodiment, if the storage cluster determines through the decision component that the storage component access request does not contain the first component identifier to be accessed, it means that the target client has not specified to add a new directory in a specific candidate metadata storage component of the storage cluster. At this time, the storage cluster randomly selects a group of candidate metadata storage components for performing the directory addition operation as the second target metadata storage group.
[0053] S104: Send the storage component access request to the first target metadata storage component, so that the first target metadata storage component performs a directory adding operation according to the storage component access request.
[0054] In one embodiment, the storage cluster routes the storage component access request to the first target metadata storage component through a routing component. After the first target metadata storage component obtains the storage component access request, according to the directory addition guidance information carried in the storage component access request, such as the name of the new directory, the content of the new directory, etc., a corresponding directory addition operation is performed to add a new directory in the first target metadata storage component.
[0055] Optionally, if the storage cluster determines the second target metadata storage group through the decision component, the storage cluster routes the storage component access request to the second target metadata storage component through the routing component. After the second target metadata storage component obtains the storage component access request, according to the directory addition guidance information carried in the storage component access request, such as the name of the new directory, the content of the new directory, etc., the corresponding directory addition operation is performed to add a new directory in the second target metadata storage component.
[0056] The embodiment of the present invention sets at least two sets of candidate metadata storage components in a storage cluster, determines the access intention of the target client according to the storage component access request initiated by the target client; determines whether the storage component access request contains the first component identifier to be accessed when the access intention is the intention to add a new directory; determines the first target metadata storage component from the at least two sets of candidate metadata storage components according to the first component identifier to be accessed when the storage component access request contains the first component identifier to be accessed; sends the storage component access request to the first target metadata storage component, so that the first target metadata storage component performs the directory adding operation according to the storage component access request, and has the beneficial effects of:
[0057] First, since at least two sets of candidate metadata storage components are set up in the storage cluster, a distributed deployment of the metadata storage components is formed, the scalability of the metadata storage components is achieved, the storage limit of the metadata is increased, and the access performance of the storage cluster is guaranteed.
[0058] Secondly, by identifying the first component identifier to be accessed contained in the storage component access request, and then determining the first target metadata storage component that the target client needs to access based on the first component identifier to be accessed, even if at least two sets of candidate metadata storage components are set in the storage cluster, it is still possible to ensure that the storage component access request is forwarded to the correct candidate metadata storage component, thereby ensuring the accuracy and stability of the metadata storage component access.
[0059] Thirdly, it meets the business needs of users to add new directories in candidate metadata storage components, improving the user experience of the storage cluster.
[0060] Embodiment 2
[0061] Figure 2 This is a flowchart of a method for accessing a storage component provided in Embodiment 2 of the present invention. This embodiment further optimizes and expands the above embodiment and can be combined with the above optional implementations. Figure 2 As shown, the method includes:
[0062] S201. Determine the access intention of the target client according to the storage component access request initiated by the target client.
[0063] S202: When the access intention is to add a new directory, determine whether the storage component access request contains a first component identifier to be accessed.
[0064] S203: When the storage component access request includes the first component identifier to be accessed, obtain candidate component identifiers corresponding to each candidate metadata storage component.
[0065] S204: Match the first component identifier to be accessed with each candidate component identifier, and use the candidate component identifier that matches the first component identifier to be accessed as an auxiliary component identifier.
[0066] S205: Use the candidate metadata storage component corresponding to the auxiliary component identifier as the first target metadata storage component, and send a storage component access request to the first target metadata storage component, so that the first target metadata storage component performs a directory addition operation according to the storage component access request.
[0067] Exemplarily, assuming that the first component to be accessed is identified as "aabbcc", "aabbcc" in each candidate component identifier is used as an auxiliary component identifier. Assuming that the candidate metadata storage component corresponding to the auxiliary component identifier "aabbcc" is candidate metadata storage component A, candidate metadata storage component A is used as the first target metadata storage component for performing the directory addition operation.
[0068] By obtaining the candidate component identifiers corresponding to each candidate metadata storage component respectively; matching the first component identifier to be accessed with each candidate component identifier, and taking the candidate component identifier that matches the first component identifier to be accessed as the auxiliary component identifier; and taking the candidate metadata storage component corresponding to the auxiliary component identifier as the first target metadata storage component, since the candidate component identifiers of each candidate metadata storage component are pre-set in the storage cluster, the first target metadata storage component to be accessed by the target client can be directly determined only by means of component identifier matching, thereby improving the efficiency of determining the first target metadata storage component.
[0069] Optionally, after sending the storage component access request to the first target metadata storage component so that the first target metadata storage component performs a directory adding operation according to the storage component access request, the method further includes:
[0070] When the execution status of the directory adding operation is successful, first execution success prompt information is sent to the target client; when the execution status of the directory adding operation is failed, first execution failure prompt information is sent to the target client.
[0071] The execution status of the directory adding operation includes two states: successful execution and identification execution. Successful execution indicates that the first target metadata storage component successfully adds a directory according to the storage component access request; failed execution indicates that the first target metadata storage component does not successfully add a directory according to the storage component access request. The first successful execution prompt information is used to prompt the target client that the directory is successfully created in the first target metadata storage component, and the first failed execution prompt information is used to prompt the target client that the directory is failed to be created in the first target metadata storage component.
[0072] By sending a first execution success prompt message to the target client when the execution status of the directory addition operation is successful, and sending a first execution failure prompt message to the target client when the execution status of the directory addition operation is failed, the effect of timely feedback of the execution status of the directory addition operation to the target client is achieved, which is conducive to ensuring that the target client can perceive the execution status of the directory addition operation in time so as to continue to decide on subsequent operations.
[0073] Embodiment 3
[0074] Figure 3 This is a flowchart of a method for accessing a storage component provided by Embodiment 3 of the present invention. This embodiment further optimizes and expands the above embodiment and can be combined with the above optional implementations. Figure 3 As shown, the method includes:
[0075] S301. Determine the access intention of the target client according to the storage component access request initiated by the target client.
[0076] S302: When the access intention is to add a new directory, determine whether the storage component access request contains a first component identifier to be accessed.
[0077] S303: When the storage component access request does not include the first component identifier to be accessed, determine the metadata storage capacity corresponding to each candidate metadata storage component.
[0078] The metadata storage capacity reflects the data volume of the file metadata stored by the candidate metadata storage component.
[0079] In one embodiment, if the storage cluster determines through the decision component that the storage component access request does not contain the first component identifier to be accessed, it means that the target client has not specified to add a new directory in a specific candidate metadata storage component of the storage cluster. At this time, the storage cluster determines the metadata storage capacity corresponding to each candidate metadata storage component through the decision component.
[0080] S304: Determine a second target metadata storage component from each candidate metadata storage component according to the ranking result of the metadata storage amount.
[0081] In one embodiment, the storage cluster uses a decision component to sort the metadata storage capacity of each candidate metadata storage component to determine the sorting result of the metadata storage capacity. Further, the storage cluster uses the decision component to select the candidate metadata storage component with the smallest metadata storage capacity as the second target metadata storage component for performing the directory addition operation.
[0082] For example, assuming that the metadata storage capacity corresponding to candidate metadata storage component A is "10GB", the metadata storage capacity corresponding to candidate metadata storage component B is "5GB", the metadata storage capacity corresponding to candidate metadata storage component C is "8GB", and the metadata storage capacity corresponding to candidate metadata storage component D is "15GB", then candidate metadata storage component B will be used as the second target metadata storage component for performing the directory addition operation.
[0083] S305: Send the storage component access request to the second target metadata storage component, so that the second target metadata storage component performs a directory adding operation according to the storage component access request.
[0084] In one embodiment, the storage cluster routes the storage component access request to the second target metadata storage component through a routing component. After the second target metadata storage component obtains the storage component access request, according to the directory addition guidance information carried in the storage component access request, such as the name of the new directory, the content of the new directory, etc., a corresponding directory addition operation is performed to add a new directory in the second target metadata storage component.
[0085] By determining the metadata storage amount corresponding to each candidate metadata storage component when the storage component access request does not include the first component identifier to be accessed; determining the second target metadata storage component from each candidate metadata storage component according to the sorting result of the metadata storage amount; sending the storage component access request to the second target metadata storage component, so that the second target metadata storage component performs the directory adding operation according to the storage component access request, the beneficial effects are:
[0086] First, it ensures that even if the target client does not specify a specific candidate metadata storage component for adding a new directory, it can still meet the user's business needs for adding a new directory in the candidate metadata storage component, thereby ensuring the user's experience with the storage cluster.
[0087] Secondly, since the second target metadata storage component for performing the directory addition operation is determined based on the sorting result of the metadata storage capacity, the directory addition can be implemented in the candidate metadata storage component with a smaller metadata storage capacity, thereby ensuring the storage balance of each candidate metadata storage component.
[0088] Embodiment 4
[0089] Figure 4 This is a flowchart of a method for accessing a storage component provided by Embodiment 4 of the present invention. This embodiment further optimizes and expands the above embodiment and can be combined with the above optional implementations. Figure 4 As shown, the method includes:
[0090] S401: Determine the access intention of the target client according to the storage component access request initiated by the target client.
[0091] S402: When the access intention is to modify the directory, determine the second component identifier to be accessed contained in the storage component access request.
[0092] The intention to modify the directory refers to the target client wanting to modify the directory in a specific candidate metadata storage component of the storage cluster. It is understandable that if the access intention is to modify the directory, the target client will inevitably specify to modify the directory in a specific candidate metadata storage component of the storage cluster, that is, the storage component access request must contain the component identifier corresponding to the candidate metadata storage component (the candidate metadata storage component that the target client specifies to modify the directory) as the second component identifier to be accessed.
[0093] In one implementation, if the storage cluster determines through the decision component that the access intention of the target client is to add a new directory, it further identifies the second component identifier to be accessed contained in the storage component access request.
[0094] S403: Determine a third target metadata storage component from at least two sets of candidate metadata storage components according to the second component identifier to be accessed.
[0095] In one embodiment, the storage cluster determines, through a decision component, the candidate metadata storage component for modifying the directory specified by the target client from among the candidate metadata storage components as the third target metadata storage group based on the second component identifier to be accessed and the candidate component identifiers corresponding to the candidate metadata storage components.
[0096] S404: Send the storage component access request to the third target metadata storage component, so that the third target metadata storage component performs a directory modification operation according to the storage component access request.
[0097] In one embodiment, the storage cluster routes the storage component access request to the third target metadata storage component through a routing component. After the third target metadata storage component obtains the storage component access request, according to the directory modification guidance information carried in the storage component access request, such as modifying the directory name, modifying the directory content, etc., the corresponding directory modification operation is performed to modify the directory in the third target metadata storage component.
[0098] By determining the second component identifier to be accessed contained in the storage component access request when the access intention is to modify the directory; determining the third target metadata storage component from at least two sets of candidate metadata storage components according to the second component identifier to be accessed; and sending the storage component access request to the third target metadata storage component, so that the third target metadata storage component performs the directory modification operation according to the storage component access request, the beneficial effects are:
[0099] On the first aspect, by identifying the second component identifier to be accessed contained in the storage component access request, and then determining the third target metadata storage component that the target client needs to access based on the second component identifier to be accessed, even if at least two sets of candidate metadata storage components are set in the storage cluster, it is still possible to ensure that the storage component access request is forwarded to the correct candidate metadata storage component, thereby ensuring the accuracy and stability of the metadata storage component access.
[0100] Secondly, it meets the business needs of users to modify directories in candidate metadata storage components, improving the user experience of the storage cluster.
[0101] Optionally, after sending the storage component access request to the third target metadata storage component so that the third target metadata storage component performs the directory modification operation according to the storage component access request, the method further includes:
[0102] When the execution status of the directory modification operation is successful, a second execution success prompt message is sent to the target client; when the execution status of the directory modification operation is failed, a second execution failure prompt message is sent to the target client.
[0103] The execution status of the directory modification operation includes two states: successful execution and identification execution. Successful execution indicates that the third target metadata storage component successfully modified the directory according to the storage component access request; failed execution indicates that the third target metadata storage component did not successfully modify the directory according to the storage component access request. The second successful execution prompt information is used to prompt the target client that the directory modification in the third target metadata storage component is successful, and the second failed execution prompt information is used to prompt the target client that the directory modification in the third target metadata storage component is failed.
[0104] By sending a second execution success prompt message to the target client when the execution status of the directory modification operation is successful, and sending a second execution failure prompt message to the target client when the execution status of the directory modification operation is failed, the effect of timely feedback of the execution status of the directory modification operation to the target client is achieved, which is conducive to ensuring that the target client perceives the execution status of the directory modification operation in a timely manner so as to continue to decide on subsequent operations.
[0105] Embodiment 5
[0106] Figure 5 This is a flowchart of a method for accessing a storage component provided in Embodiment 5 of the present invention. This embodiment further optimizes and expands the above embodiment and can be combined with the above optional implementations. Figure 5 As shown, the method includes:
[0107] S501: Determine the access intention of the target client according to the storage component access request initiated by the target client.
[0108] S502: When the access intention is a data query intention, determine the identifier of the data file to be queried contained in the storage component access request.
[0109] The data query intention refers to the target client's desire to query the file content of a specified data file in the candidate metadata storage component of the storage cluster. The data file identifier to be queried indicates the file identifier corresponding to the data file to be queried (the data file specified by the target client for query). The file identifier is the unique identity identifier of the data file, that is, the corresponding data file can be uniquely determined based on the file identifier. File metadata is stored in the data file.
[0110] In one implementation, if the storage cluster determines through the decision component that the access intention of the target client is a data query intention, it further identifies the identifier of the data file to be queried contained in the storage component access request.
[0111] S503. Determine the data file to be queried associated with the data file identifier according to the association relationship between the data file and the data file identifier, and determine the candidate metadata storage component associated with the data file to be queried as the fourth target metadata storage component according to the association relationship between the data file and the candidate metadata storage component.
[0112] Exemplarily, assuming that the identifier of the data file to be queried is "1100011", assuming that in the association relationship between the data file and the data file identifier, the data file identifier "1100011" has an association relationship with the data file X, then "data file X" is used as the data file to be queried. Assuming that in the association relationship between the data file and the candidate metadata storage component, the "data file X" has an association relationship with the candidate metadata storage component 3, then "candidate metadata storage component 3" is used as the fourth target metadata storage component for querying data.
[0113] S504: Send the storage component access request to the fourth target metadata storage component, so that the fourth target metadata storage component performs a data query operation according to the storage component access request.
[0114] In one embodiment, the storage cluster routes the storage component access request to the fourth target metadata storage component through a routing component. After the fourth target metadata storage component obtains the storage component access request, according to the identifier of the data file to be queried carried in the storage component access request, a corresponding data query operation is performed to query the target data file content of the data file to be queried in the fourth target metadata storage component.
[0115] By determining the to-be-queried data file identifier contained in the storage component access request when the access intention is a data query intention; determining the to-be-queried data file associated with the to-be-queried data file identifier according to the association relationship between the data file and the data file identifier, and determining the candidate metadata storage component associated with the to-be-queried data file according to the association relationship between the data file and the candidate metadata storage component as the fourth target metadata storage component; and sending the storage component access request to the fourth target metadata storage component, so that the fourth target metadata storage component performs the data query operation according to the storage component access request, the beneficial effects are:
[0116] Firstly, by identifying the identifier of the data file to be queried contained in the storage component access request, and then determining the fourth target metadata storage component where the data file to be queried required by the target client is located according to the identifier of the data file to be queried, the accuracy and reliability of data query are guaranteed.
[0117] Secondly, it meets the user's business needs for data query in candidate metadata storage components and improves the user experience of the storage cluster.
[0118] Optionally, after sending the storage component access request to the fourth target metadata storage component so that the fourth target metadata storage component performs a data query operation according to the storage component access request, the method further includes:
[0119] The target data file content obtained by the data query operation is obtained, and the target data file content is sent to the target client.
[0120] In one implementation, the storage cluster obtains the target data file content queried by the fourth target metadata storage component, that is, the file content corresponding to the data file to be queried, and the storage cluster further sends the target data file content to the target client.
[0121] By obtaining the target data file content queried by the data query operation and sending the target data file content to the target client, the effect of timely feedback of the queried target data file content to the target client is achieved, which is conducive to ensuring that the target client obtains the required target data file content in a timely manner and ensures the user's usage experience of the storage cluster.
[0122] Embodiment 6
[0123] Figure 6 A schematic diagram of a storage component access device provided in Embodiment 6 of the present invention. The storage component access device is configured in a storage cluster, and the storage cluster includes at least two sets of candidate metadata storage components, such as Figure 6 As shown, the device comprises:
[0124] An access intention determination module 61, configured to determine the access intention of the target client according to a storage component access request initiated by the target client;
[0125] A component identification recognition module 62, configured to determine whether the storage component access request contains a first component identification to be accessed when the access intention is an intention to add a new directory;
[0126] A storage component determining module 63, configured to determine a first target metadata storage component from the at least two sets of candidate metadata storage components according to the first component identifier to be accessed, when the storage component access request includes the first component identifier to be accessed;
[0127] The access request sending module 64 is used to send the storage component access request to the first target metadata storage component, so that the first target metadata storage component performs a directory adding operation according to the storage component access request.
[0128] Optionally, the storage component determination module 63 is specifically configured to:
[0129] Obtain candidate component identifiers corresponding to each of the candidate metadata storage components;
[0130] Matching the first component identifier to be accessed with each of the candidate component identifiers, and using the candidate component identifier that matches the first component identifier to be accessed as an auxiliary component identifier;
[0131] The candidate metadata storage component corresponding to the auxiliary component identifier is used as the first target metadata storage component.
[0132] Optionally, the device further includes a second target metadata storage component determination module, which is specifically configured to:
[0133] In a case where the storage component access request does not include the first component identifier to be accessed, determining the metadata storage capacity corresponding to each of the candidate metadata storage components;
[0134] Determining a second target metadata storage component from each of the candidate metadata storage components according to the ranking result of the metadata storage amount;
[0135] The storage component access request is sent to the second target metadata storage component, so that the second target metadata storage component performs a directory adding operation according to the storage component access request.
[0136] Optionally, the device further comprises a directory modification module, which is specifically used to:
[0137] In a case where the access intention is an intention to modify the directory, determining a second component identifier to be accessed included in the storage component access request;
[0138] Determine, according to the second component identifier to be accessed, a third target metadata storage component from the at least two sets of candidate metadata storage components;
[0139] The storage component access request is sent to the third target metadata storage component, so that the third target metadata storage component performs a directory modification operation according to the storage component access request.
[0140] Optionally, the device further includes a data query module, specifically configured to:
[0141] In the case where the access intention is a data query intention, determining an identifier of a data file to be queried contained in the storage component access request;
[0142] Determine the data file to be queried associated with the data file identifier to be queried according to the association relationship between the data file and the data file identifier, and determine the candidate metadata storage component associated with the data file to be queried as the fourth target metadata storage component according to the association relationship between the data file and the candidate metadata storage component;
[0143] The storage component access request is sent to the fourth target metadata storage component, so that the fourth target metadata storage component performs a data query operation according to the storage component access request.
[0144] Optionally, the device further includes a first prompt information sending module, which is specifically configured to:
[0145] When the execution status of the directory adding operation is successful, sending first execution success prompt information to the target client;
[0146] When the execution status of the directory adding operation is execution failure, sending first execution failure prompt information to the target client;
[0147] Optionally, the device further includes a second prompt information sending module, which is specifically configured to:
[0148] When the execution status of the directory modification operation is successful, sending a second execution success prompt message to the target client;
[0149] When the execution status of the directory modification operation is execution failure, second execution failure prompt information is sent to the target client.
[0150] Optionally, the device further includes a data file content sending module, which is specifically used to:
[0151] The target data file content queried by the data query operation is obtained, and the target data file content is sent to the target client.
[0152] The storage component access device provided in the embodiment of the present invention can execute the storage component access method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0153] According to an embodiment of the present invention, the present invention also provides an electronic device and a readable storage medium.
[0154] Embodiment 7
[0155] Figure 7A schematic diagram of an electronic device 70 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0156] like Figure 7 As shown, the electronic device 70 includes at least one processor 71, and a memory connected to the at least one processor 71, such as a read-only memory (ROM) 72, a random access memory (RAM) 73, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 71 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 72 or the computer program loaded from the storage unit 78 to the random access memory (RAM) 73. In the RAM 73, various programs and data required for the operation of the electronic device 70 can also be stored. The processor 71, the ROM 72, and the RAM 73 are connected to each other via a bus 74. An input / output (I / O) interface 75 is also connected to the bus 74.
[0157] A number of components in the electronic device 70 are connected to the I / O interface 75, including: an input unit 76, such as a keyboard, a mouse, etc.; an output unit 77, such as various types of displays, speakers, etc.; a storage unit 78, such as a disk, an optical disk, etc.; and a communication unit 79, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 79 allows the electronic device 70 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0158] The processor 71 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 71 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 71 executes the various methods and processes described above, such as a method for accessing a storage component.
[0159] In some embodiments, the access method of the storage component may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 78. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 70 via the ROM 72 and / or the communication unit 79. When the computer program is loaded into the RAM 73 and executed by the processor 71, one or more steps of the access method of the storage component described above may be performed. Alternatively, in other embodiments, the processor 71 may be configured to perform the information query method in any other appropriate manner (e.g., by means of firmware).
[0160] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0161] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0162] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0163] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0164] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0165] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0166] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0167] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for accessing a storage component, executed by a storage cluster, characterized in that: The storage cluster includes at least two sets of candidate metadata storage components, and the method includes: Determining the access intention of the target client according to the storage component access request initiated by the target client; In the case where the access intention is an intention to add a new directory, determining whether the storage component access request includes a first component identifier to be accessed; In a case where the storage component access request includes the first component identifier to be accessed, determining a first target metadata storage component from the at least two sets of candidate metadata storage components according to the first component identifier to be accessed; The storage component access request is sent to the first target metadata storage component, so that the first target metadata storage component performs a directory adding operation according to the storage component access request.
2. The method according to claim 1, characterized in that The step of determining a first target metadata storage component from the at least two sets of candidate metadata storage components according to the first component identifier to be accessed includes: Obtain candidate component identifiers corresponding to each of the candidate metadata storage components; Matching the first component identifier to be accessed with each of the candidate component identifiers, and using the candidate component identifier that matches the first component identifier to be accessed as an auxiliary component identifier; The candidate metadata storage component corresponding to the auxiliary component identifier is used as the first target metadata storage component.
3. The method according to claim 1, after determining whether the storage component access request includes the first component identifier to be accessed, further comprising: In a case where the storage component access request does not include the first component identifier to be accessed, determining the metadata storage capacity corresponding to each of the candidate metadata storage components; Determining a second target metadata storage component from each of the candidate metadata storage components according to the ranking result of the metadata storage amount; The storage component access request is sent to the second target metadata storage component, so that the second target metadata storage component performs a directory adding operation according to the storage component access request.
4. The method according to claim 1, after determining the access intention of the target client according to the storage component access request initiated by the target client, further comprising: In a case where the access intention is an intention to modify the directory, determining a second component identifier to be accessed included in the storage component access request; Determine, according to the second component identifier to be accessed, a third target metadata storage component from the at least two sets of candidate metadata storage components; The storage component access request is sent to the third target metadata storage component, so that the third target metadata storage component performs a directory modification operation according to the storage component access request.
5. The method according to claim 1, after determining the access intention of the target client according to the storage component access request initiated by the target client, further comprises: In the case where the access intention is a data query intention, determining an identifier of a data file to be queried contained in the storage component access request; Determine the data file to be queried associated with the data file identifier to be queried according to the association relationship between the data file and the data file identifier, and determine the candidate metadata storage component associated with the data file to be queried as the fourth target metadata storage component according to the association relationship between the data file and the candidate metadata storage component; The storage component access request is sent to the fourth target metadata storage component, so that the fourth target metadata storage component performs a data query operation according to the storage component access request.
6. The method according to claim 4, after sending the storage component access request to the first target metadata storage component so that the first target metadata storage component performs a directory adding operation according to the storage component access request, further comprising: When the execution status of the directory adding operation is successful, sending first execution success prompt information to the target client; When the execution status of the directory adding operation is execution failure, sending first execution failure prompt information to the target client; After sending the storage component access request to the third target metadata storage component so that the third target metadata storage component performs a directory modification operation according to the storage component access request, the method further includes: When the execution status of the directory modification operation is successful, sending a second execution success prompt message to the target client; When the execution status of the directory modification operation is execution failure, second execution failure prompt information is sent to the target client.
7. The method according to claim 5, after sending the storage component access request to the fourth target metadata storage component so that the fourth target metadata storage component performs a data query operation according to the storage component access request, further comprising: The target data file content queried by the data query operation is obtained, and the target data file content is sent to the target client.
8. A storage component access device, configured in a storage cluster, characterized in that: The storage cluster includes at least two sets of candidate metadata storage components, and the device includes: An access intention determination module, used to determine the access intention of the target client according to the storage component access request initiated by the target client; A component identification recognition module, used to determine whether the storage component access request contains a first component identification to be accessed when the access intention is an intention to add a new directory; a storage component determining module, configured to determine a first target metadata storage component from the at least two sets of candidate metadata storage components according to the first component identifier to be accessed, when the storage component access request includes the first component identifier to be accessed; The access request sending module is used to send the storage component access request to the first target metadata storage component, so that the first target metadata storage component performs a directory adding operation according to the storage component access request.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the method for accessing the storage component according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to execute the storage component access method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Data storage method and device, storage cluster, gateway equipment and main equipment
CN111638853A
Data storage system, method and device
CN118192897A