Storage type change method, related device and medium

By processing in segments in the physical data storage space and updating in stages in the metadata storage space, the problem of inconsistency between file data and metadata storage type change stage data is solved, and data consistency in the data storage type change process is achieved.

CN118760657BActive Publication Date: 2024-11-19TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411253382.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-09
Publication Date
2024-11-19
Estimated Expiration
2044-09-09

AI Technical Summary

Technical Problem

In advanced file storage management, the problem that the file data in the entity data storage space is inconsistent with the data in the storage type change stage of the metadata storage space, resulting in the actual data type not matching the data in the storage type change stage during the data storage type change process. Condition.

Method used

By dividing the target file into multiple data segments in the physical data storage space and assigning change instructions to each data segment, setting the storage type change phase data in the metadata storage space to be changed, changing and changed, ensuring that The storage type change instruction for each data segment updates the metadata storage type change phase data after execution.

Benefits of technology

It effectively reduces the inconsistency between the actual data type of file data in the physical data storage space and the data in the storage type change stage of the metadata storage space, and ensures data consistency during the data storage type change process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760657B_ABST
    Figure CN118760657B_ABST
Patent Text Reader

Abstract

The present disclosure provides a storage type change method, related devices and media. The method includes: in response to a storage type change request for a target file in a physical data storage space, setting the storage type change stage data of the target file to be changed in the metadata storage space corresponding to the physical data storage space. Allocate a change indication for each data segment, and set the storage type change stage data of the target file to be changed in the metadata storage space. Make each data segment execute the change indication, and after the change indication of each data segment is executed, set the storage type change stage data of the target file to changed in the metadata storage space. The present disclosure can reduce the inconsistency between the actual data type of the file data in the physical data storage space and the storage type change stage data of the metadata storage space during the data storage type change process. The present disclosure can be applied to various scenarios such as computers, artificial intelligence, and cloud technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a storage type changing method, a related device and a medium. Background Art

[0002] At present, in advanced file storage management, file data and metadata are generally stored in different spaces. That is, file data is stored in the physical data storage space, and metadata is stored in the metadata storage space. Metadata refers to the basic attribute data of the file, such as size, author, storage time, storage address, etc. In some cases, the data type of the file data stored in the physical data storage space will be changed, for example, the shallow storage type (deleted after a relatively short storage time) is changed to the deep storage type (stored for a relatively long time). Therefore, a special attribute data, namely, the storage type change phase data, is included in the metadata to indicate whether the data type change is completed (such as whether the shallow storage type is changed to the deep storage type). However, it often happens that the actual data type of the file data in the physical data storage space is inconsistent with the storage type change phase data of the metadata storage space (such as the file data has actually changed from the shallow storage type to the deep storage type, but the storage type change phase data of the metadata storage space still indicates the shallow storage type). Summary of the invention

[0003] The embodiments of the present disclosure provide a storage type change method, related devices and media, which can reduce the inconsistency between the actual data type of file data in the physical data storage space and the data in the storage type change stage of the metadata storage space during the data storage type change process.

[0004] According to one aspect of the present disclosure, a storage type changing method is provided, the method comprising:

[0005] In response to a storage type change request for a target file in a physical data storage space, setting storage type change phase data of the target file to be changed in a metadata storage space corresponding to the physical data storage space, wherein the target file is stored in the physical data storage space as a plurality of data segments;

[0006] Allocating a change indication to each of the data segments, and setting the storage type change phase data of the target file as being changed in the metadata storage space;

[0007] Each of the data segments is caused to execute the change instruction, and after the change instruction of each of the data segments is executed, the storage type change phase data of the target file is set as changed in the metadata storage space.

[0008] According to one aspect of the present disclosure, a storage type changing device is provided, the device comprising:

[0009] a setting unit, configured to respond to a storage type change request for a target file in a physical data storage space, and set the storage type change phase data of the target file to be changed in a metadata storage space corresponding to the physical data storage space, wherein the target file is stored in the physical data storage space as a plurality of data segments;

[0010] A first changing unit, configured to allocate a change indication to each of the data segments, and set the storage type change phase data of the target file as being changed in the metadata storage space;

[0011] The second change unit is used to make each of the data segments execute the change instruction, and after the change instruction of each of the data segments is executed, set the storage type change phase data of the target file as changed in the metadata storage space.

[0012] Optionally, the data segment includes a storage type field;

[0013] The second changing unit is used for:

[0014] After the change instruction of the single data segment is executed, the storage type field of the data segment is set to a target storage type, wherein the target storage type is the storage type to which the storage type change request is to be changed;

[0015] After the storage type fields of the respective data segments are all the target storage type, the storage type change phase data of the target file is set as changed in the metadata storage space.

[0016] Optionally, the metadata storage space includes a target tree, and each file in the physical data storage space corresponds to a file node in the target tree;

[0017] The setting unit is used for:

[0018] In the target tree of the metadata storage space, determining a target file node corresponding to the target file;

[0019] The storage type change phase data in the target file node is set to be changed.

[0020] Optionally, the target tree is generated by:

[0021] Obtain the file storage architecture where the target file is located in the physical data storage space;

[0022] The file storage architecture is used as the root node of the target tree, the folders in the file storage architecture are used as branch nodes of the target tree, and the files under the folders are used as leaf nodes extending from the branch nodes.

[0023] Optionally, the storage type change request is generated in the following manner:

[0024] Acquire multiple candidate storage type change rules for the file storage architecture where the target file in the physical data storage space is located;

[0025] For each of the candidate storage type change rules, determining in the target tree a file path pointed to by the candidate storage type change rule;

[0026] Determining a target storage type change rule from among the plurality of candidate storage type change rules based on the lengths of the respective file paths;

[0027] If it is determined that the triggering condition of the target storage type change rule is met, the storage type change request is generated, wherein the target file node of the target file belongs to the file path pointed to by the target storage type change rule.

[0028] Optionally, the candidate storage type change rule is generated in the following manner:

[0029] In response to a rule configuration request for the file storage architecture, obtaining rule triggering time and storage type change information;

[0030] Determine a rule-associated file in each file of the file storage architecture, and generate a file path based on the position of a leaf node corresponding to the rule-associated file in the target tree;

[0031] Based on a preset storage type conversion rule, performing a first verification on the storage type change information;

[0032] If it is determined that the first verification passes, the candidate storage type change rule is generated based on the rule triggering time, the storage type change information, and the file path.

[0033] Optionally, the first changing unit is used to:

[0034] In the target tree, a plurality of metadata blocks corresponding to the target file node are obtained, wherein the metadata block contains at least one target metadata;

[0035] Acquire a preset mapping table, wherein the preset mapping table includes a plurality of candidate data segments in the physical data storage space and candidate metadata corresponding to each of the candidate data segments in the metadata storage space;

[0036] For each metadata block, comparing the target metadata with each candidate metadata in the preset mapping table;

[0037] Determine the candidate data segment corresponding to the candidate metadata consistent with the target metadata as the target data segment, wherein the target data segment is the data segment into which the target file is segmented;

[0038] Based on the storage type to which the storage type change request is to be changed, a change indication is generated, and the change indication is allocated to each of the target data segments.

[0039] Optionally, the plurality of candidate data segments in the physical data storage space are generated in the following manner:

[0040] Obtain multiple candidate file storage architectures;

[0041] For each candidate file of the candidate file storage architecture, the candidate file is divided according to a predetermined size to obtain a plurality of file data blocks;

[0042] One of the file data blocks is used as a candidate data segment, and a plurality of the candidate data segments are stored in a preset storage bucket of the physical data storage space.

[0043] Optionally, the storage type changing device further includes a calling unit, and the calling unit is used to:

[0044] Obtaining a data acquisition request for the metadata storage space;

[0045] Performing protocol conversion on the data acquisition request based on a preset protocol conversion interface to obtain a converted acquisition request;

[0046] Based on the converted acquisition request, the metadata in the metadata storage space is called through a preset data access interface.

[0047] Optionally, the target tree is stored in a target sub-storage space of the metadata storage space;

[0048] The storage type changing device further includes an acquisition unit, and the acquisition unit is used to:

[0049] In response to a metadata access request for a file storage architecture where the target file is located, obtaining an architecture index of the file storage architecture;

[0050] Based on the architecture index, data query is performed through a preset data management interface to obtain the storage location of the target tree in the target sub-storage space;

[0051] Based on the storage location, the target tree is called through a preset data access interface to obtain file metadata in the target tree.

[0052] Optionally, the first changing unit is used to:

[0053] If the type of the target file is a first type, then in the target tree, a plurality of file subnodes extending from the target file node are obtained, wherein the first type is used to indicate that the target file includes a plurality of partition files, and each of the partition files has a corresponding file subnode in the target tree;

[0054] For each of the file subnodes, in the target tree, a plurality of metadata blocks of the file subnode are obtained, wherein the metadata block includes at least one target metadata;

[0055] Acquire a preset mapping table, wherein the preset mapping table includes a plurality of candidate data segments in the physical data storage space and candidate metadata corresponding to each of the candidate data segments in the metadata storage space;

[0056] For each metadata block, comparing the target metadata with each candidate metadata in the preset mapping table;

[0057] Determine the candidate data segment corresponding to the candidate metadata consistent with the target metadata as an intermediate data segment, wherein the intermediate data segment is the data segment into which the partition file is segmented;

[0058] Integrate the plurality of intermediate data segments into a target data segment, wherein the target data segment is the data segment into which the target file is segmented;

[0059] Based on the storage type to which the storage type change request is to be changed, a change indication is generated, and the change indication is allocated to each of the target data segments.

[0060] Optionally, the second changing unit is used to:

[0061] After the change instructions of the data segments of a single partition file are executed, setting the storage type change phase data of the partition file to changed in the metadata storage space;

[0062] After the storage type change phase data of each of the partition files is changed, the storage type change phase data of the target file is set as changed in the metadata storage space.

[0063] Optionally, the storage type changing device further comprises a display unit, and the display unit is used to:

[0064] In response to a request to obtain the status of the storage type change stage data for the target file, the status of the storage type change stage data is displayed as changed.

[0065] Optionally, the multiple metadata blocks corresponding to the target file node are updated in the following manner:

[0066] For each metadata block, performing data detection on the metadata block;

[0067] If it is determined that the target metadata of the metadata block does not reach the preset number, a preset data append interface is called to supplement the metadata corresponding to the preset supplementary data into the metadata block to update the metadata of the metadata block.

[0068] Optionally, the multiple metadata blocks corresponding to the target file node are updated in the following manner:

[0069] In response to a data segmentation request for a target metadata block among the multiple metadata blocks, data segmentation is performed on the target metadata in the target metadata block, and the correspondence between the segmented target metadata and the candidate data segments is updated.

[0070] According to one aspect of the present disclosure, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the storage type changing method as described above when executing the computer program.

[0071] According to one aspect of the present disclosure, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the storage type changing method as described above is implemented.

[0072] According to one aspect of the present disclosure, a computer program product is provided. The computer program product includes a computer program. The computer program is read and executed by a processor of a computer device, so that the computer device executes the storage type changing method as described above.

[0073] In the disclosed embodiment, when the storage type change rule for the target file is hit, the server will respond to the storage type change request for the target file in the physical data storage space, and first update the storage type change stage data of the file target, that is, in the metadata storage space corresponding to the physical data storage space, the storage type change stage data of the target file is set to be changed to indicate that the storage type of the target file needs to be changed. Further, since the target file is divided into multiple data segments in the physical data storage space, after the storage type change stage data is set to be changed, it is necessary to assign a change instruction to each data segment to realize the marking of each data segment, and after the change instruction is assigned to each data segment, the storage type change stage data of the target file is set to be changed in the metadata storage space to realize the update of the storage type change stage data. Next, for each data segment, each data segment is made to execute the change instruction and change the storage type. Further, the execution of the change instruction by each data segment is detected, and after the change instruction of each data segment is detected to be executed, it is determined that the storage type of all data segments has been changed. At this time, in the metadata storage space, the storage type change phase data of the target file is set to have been changed, so that the storage type change phase data of the target file at the current time is shown as changed. This method closely combines the change processing of the file data in the physical data storage space with the update of the storage type change phase data in the metadata storage space, so that in the process of data storage type change, the inconsistency between the actual data type of the file data in the physical data storage space and the storage type change phase data of the metadata storage space can be reduced.

[0074] Other features and advantages of the present disclosure will be described in the following description, and partly become apparent from the description, or understood by practicing the present disclosure. The purpose and other advantages of the present disclosure can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] The accompanying drawings are used to provide further understanding of the technical solution of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solution of the present disclosure and do not constitute a limitation on the technical solution of the present disclosure.

[0076] Figure 1 is a system architecture diagram of a system to which the storage type changing method according to an embodiment of the present disclosure is applied;

[0077] Figure 2A-2F A schematic diagram showing a method for changing a storage type according to an embodiment of the present disclosure applied to a data storage type change scenario;

[0078] Figure 3is a flow chart of a storage type changing method according to an embodiment of the present disclosure;

[0079] Figure 4 is a flow chart of setting storage type change stage data to be changed according to an embodiment of the present disclosure;

[0080] Figure 5 is a flowchart of generating a target tree according to an embodiment of the present disclosure;

[0081] Figure 6 is a schematic diagram of an implementation process of generating a target tree according to an embodiment of the present disclosure;

[0082] Figure 7 is a flow chart of generating a storage type change request according to an embodiment of the present disclosure;

[0083] Figure 8 is a schematic diagram of an implementation process of generating a storage type change request according to an embodiment of the present disclosure;

[0084] Fig. 9 is a flowchart of generating a candidate storage type change rule according to an embodiment of the present disclosure;

[0085] Fig.10 is a specific structural diagram of a storage type conversion rule according to an embodiment of the present disclosure;

[0086] Fig.11 is a flow chart for assigning a change indication to a target data segment according to one embodiment of the present disclosure;

[0087] Fig.12 It is a specific schematic diagram of the mapping relationship between metadata blocks and data segments according to an embodiment of the present disclosure;

[0088] Fig.13 is a flow chart of setting storage type change phase data to changed according to an embodiment of the present disclosure;

[0089] Fig.14 It is a schematic diagram of an implementation process of changing the storage type of a data segment of a target file according to an embodiment of the present disclosure;

[0090] Fig.15 is a flow chart of allocating a change indication to a target data segment according to another embodiment of the present disclosure;

[0091] Fig.16 is a flowchart of setting storage type change phase data to changed according to another embodiment of the present disclosure;

[0092] Fig.17is a flowchart of generating candidate data segments according to one embodiment of the present disclosure;

[0093] Fig.18 is a schematic diagram of an implementation process of identifying data segments of a storage bucket according to an embodiment of the present disclosure;

[0094] Fig.19 is a flow chart of accessing metadata storage space according to one embodiment of the present disclosure;

[0095] Fig. 20 is a schematic diagram of an implementation process of accessing metadata storage space according to an embodiment of the present disclosure;

[0096] Fig.21 is a flowchart of accessing metadata storage space according to another embodiment of the present disclosure;

[0097] Fig. 22 is a schematic diagram of an implementation process of accessing metadata storage space according to another embodiment of the present disclosure;

[0098] Fig.23 is a flow chart of updating a metadata block according to an embodiment of the present disclosure;

[0099] Figure 24A-24B is a schematic diagram of an implementation process of updating a metadata block according to an embodiment of the present disclosure;

[0100] Fig.25 is a schematic diagram of implementation details of a storage type change method according to an embodiment of the present disclosure;

[0101] Fig.26 is a schematic diagram of implementation details of a storage type change method according to another embodiment of the present disclosure;

[0102] Fig. 27 is a module diagram of a storage type changing device according to an embodiment of the present disclosure;

[0103] Fig.28 is a terminal structure diagram of a storage type changing method according to an embodiment of the present disclosure;

[0104] Fig.29 It is a server structure diagram of a storage type changing method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0105] In order to make the purpose, technical solution and advantages of the present disclosure more clear, the present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not used to limit the present disclosure.

[0106] The following describes the system architecture and scenarios for application of the embodiments of the present disclosure.

[0107] Figure 1 It is a system architecture diagram used by the storage type change method according to the embodiment of the present disclosure, which includes an object terminal 140, the Internet 130, a gateway 120, a data processing server 110, and the like.

[0108] The object terminal 140 includes various forms such as desktop computers, laptop computers, PDAs (personal digital assistants), mobile phones, vehicle-mounted terminals, home theater terminals, and dedicated terminals. In addition, it can be a single device or a collection of multiple devices. The object terminal 140 can communicate with the Internet 130 in a wired or wireless manner to exchange data. The object terminal 140 includes a data processing platform, which is used to receive a data storage type change request for a certain file from a target object, and send the data storage type change request to a data processing server, so that the data processing server changes the type of the data of the file in the physical data storage space 150 and the metadata storage space 160.

[0109] The data processing server 110 refers to a computer system that can provide certain services to the object terminal 140. Compared with the ordinary object terminal 140, the data processing server 110 has higher requirements in terms of stability, security, performance, etc. The data processing server 110 can be a high-performance computer in a network platform, a cluster of multiple high-performance computers, a part of a high-performance computer (such as a virtual machine), a combination of parts of multiple high-performance computers (such as virtual machines), etc. The data processing server 110 includes multiple types of services, wherein the implementation of each service of the data processing server 110 is often associated with some intermediate databases or storage media, etc. The data processing server 110 is used to change the type of the data of the file in the physical data storage space 150 and the metadata storage space 160 according to the data storage type change request of the target object for a certain file, and when the type is changed, the actual data type of the file data in the physical data storage space is kept consistent with the storage type change phase data of the metadata storage space.

[0110] The gateway 120 is also called an internetwork connector or a protocol converter. The gateway realizes network interconnection at the transport layer and is a computer system or device that acts as a converter. The gateway is a translator between two systems that use different communication protocols, data formats or languages, or even completely different architectures. At the same time, the gateway can also provide filtering and security functions. The message sent by the object terminal 140 to the data processing server 110 must be sent to the corresponding data processing server 110 through the gateway 120. The message sent by the data processing server 110 to the object terminal 140 must also be sent to the corresponding object terminal 140 through the gateway 120.

[0111] The embodiments of the present disclosure can be applied in various scenarios, such as Figure 2A-2F The data storage type change scenario shown, etc.

[0112] like Figure 2A As shown, when the target object wants to change the data type of the file data in a certain file system, the target object will log in to the data processing platform on the object terminal and enter the storage type change process. At this time, a prompt field "Please enter the relevant information of the file system to be changed to the storage type" will be displayed on the page, and an editing area for entering the file system name will be provided. At this time, the target object will enter "File System KK1" in the editing area for entering the file system name and click the "Confirm" button to confirm that the data type of the file data in the file system KK1 needs to be changed.

[0113] like Figure 2B As shown, after the target object clicks the "Confirm" button, a prompt field will be displayed on the page: "The file data of the files of file system KK1 is stored in the physical data storage space, and the metadata is stored in the metadata storage space. The following is the storage structure of file system KK1 in the metadata storage space. Please confirm whether to continue setting the storage type change rules." The tree storage structure of file system KK1 is displayed. Among them, file system KK1 contains a folder 1 and a file 1. Folder 1 has a subfolder (folder 2) and a file 2. Folder 2 has a file 3. At this time, the target object clicks the "Confirm" button to confirm to continue setting the storage type change rules for each file of file system KK1.

[0114] like Figure 2CAs shown, after the target object clicks the "Confirm" button, a prompt field "Please enter the storage type change rule for file system KK1" will be displayed on the page, and an input area for entering specific rule information will be provided. At this time, the target object enters Rule 1 "For files in the path " / File 1", settle to deep archive type in 7 days"; enters Rule 2 "For files in the path " / Folder 1", cool to low-frequency storage type in 5 days", and enters Rule 3 "For files in the path " / Folder 1 / Folder 2 / File 3", cool to archive storage type in 10 days" in the input area for entering specific rule information. Among them, Rule 1 is the change rule for File 1, Rule 2 is the change rule for File 2 and File 3, and Rule 3 is the change rule for File 3.

[0115] like Figure 2D As shown, after the target object clicks the "Confirm" button, the server will filter the rules based on the specific paths of the files corresponding to each rule in the tree storage structure of the file system KK1. At this time, a prompt window will be displayed on the page, wherein the prompt window has a prompt field "Since the file path pointed to by rule 3 is the longest, only rule 3 is a valid storage type change rule, and the storage type change operation for file 3 will be executed according to rule 3" to determine that the data type change for the file system KK1 is executed according to rule 3.

[0116] like Figure 2E As shown, since Rule 3 is "For files in the path " / Folder 1 / Folder 2 / File 3", the file data will be downgraded to the archive storage type in 10 days", when 10 days have passed, the execution of Rule 3 will be automatically triggered. At this time, a prompt window will be displayed on the page, wherein the prompt window has a prompt field "The time condition of Rule 3 has been reached, and the file data of File 3 will be changed to the archive storage type through asynchronous processing" to prompt the target object server that the data type change of File 3 will be executed.

[0117] like Figure 2F As shown, after prompting the target object server that it is going to execute the data type change of file 3, the server will first display a prompt field "The storage type change of file 3 has been completed", and change the file data and storage type change phase data of file 3 through asynchronous execution.

[0118] The following is a general description of the embodiments of the present disclosure.

[0119] According to an embodiment of the present disclosure, a storage type changing method is provided.

[0120] This storage type change method is generally used in business scenarios where the file data and metadata of a file are stored in different spaces and the data type of the file data needs to be flexibly changed, such as Figure 2A-2F The data storage type change scenario shown. The disclosed embodiment provides a solution for changing the storage type change stage data in stages according to different processing stages of file data during the data storage type change process, which can reduce the inconsistency between the actual data type of file data in the physical data storage space and the storage type change stage data of the metadata storage space during the data storage type change process.

[0121] like Figure 3 As shown, a storage type change method according to an embodiment of the present disclosure may include:

[0122] Step 310: In response to a storage type change request for a target file in the physical data storage space, in the metadata storage space corresponding to the physical data storage space, set the storage type change phase data of the target file to be changed;

[0123] Step 320: Allocate a change indication to each data segment, and set the storage type change phase data of the target file to "changing" in the metadata storage space;

[0124] Step 330: Make each data segment execute the change instruction, and after the change instruction of each data segment is executed, set the storage type change phase data of the target file as changed in the metadata storage space.

[0125] Steps 310 - 330 are described in detail below.

[0126] In step 310, in response to a storage type change request for a target file in a physical data storage space, storage type change phase data of the target file is set as pending change in a metadata storage space corresponding to the physical data storage space.

[0127] Physical data storage space refers to a storage space used to store file data of files. In the physical data storage space, the file data of each file can be stored and managed as an object. For example, the file data of a file is taken as an object, or the file data of a file is divided into multiple data segments, and each data segment is taken as a separate object. In the physical data storage space, each object usually includes the data itself, a varying amount of metadata, and a unique identifier of the object.

[0128] The target file refers to a file whose storage type needs to be changed, wherein the target file is divided into multiple data segments for storage in the physical data storage space.

[0129] Each data segment is used to indicate a portion of file data in the target file. The collection of multiple data segments constitutes the complete file data of the target file.

[0130] A storage type change request refers to a request generated when a storage type change rule for a target file is triggered. A storage type change request is a request that is automatically triggered when various indicators at the current time point meet the conditions required by the storage type change rule.

[0131] The metadata storage space refers to a storage space used to store metadata of each file, etc.

[0132] The storage type change phase data is used to indicate whether the storage type change of the file data of the target file is completed.

[0133] In the specific implementation of this embodiment, when all indicators at the current time point meet the conditions for changing the storage type of the target file, a storage type change request for the target file in the physical data storage space is generated. Based on this, the server will receive the storage type change request, first find the target file in the metadata storage space corresponding to the physical data storage space, and then set the storage type change stage data of the target file to be changed, so as to realize fast search and marking of the target file.

[0134] To save space, the generation process of the storage type change request of the embodiment of the present disclosure and the specific implementation process of setting the storage type change phase data of the target file to be changed in the metadata storage space corresponding to the physical data storage space will be described in detail below.

[0135] In step 320, a change indication is allocated to each data segment, and in the metadata storage space, the storage type change phase data of the target file is set to being changed.

[0136] The change indication is used to indicate the storage type to which each data segment of the target file is to be changed.

[0137] In the specific implementation of this embodiment, first, a change indication is generated according to the storage type to be changed indicated by the storage type change request. Then, the change indication is assigned to each data segment, so that each data segment is assigned to the change indication. Further, after it is determined that each data segment is assigned to the change indication, the storage type change stage data of the target file is set to changing in the metadata storage space.

[0138] To save space, the specific implementation process of allocating a change indication to each data segment in the embodiment of the present disclosure will be described in detail below, but will not be repeated here.

[0139] In step 330, each data segment is made to execute the change instruction, and after the change instruction of each data segment is executed, the storage type change phase data of the target file is set as changed in the metadata storage space.

[0140] When this embodiment is implemented, first, for each data segment, each data segment is caused to execute the change instruction, and the current storage type of the data segment is changed to the storage type required by the change instruction. Then, after it is determined that the change instruction of each data segment has been executed, the storage type change phase data of the target file is set as changed in the metadata storage space, so that the storage type change phase data and the actual storage type of each data segment maintain good consistency.

[0141] To save space, the specific implementation process of setting the storage type change phase data of the target file as changed in the metadata storage space in the embodiment of the present disclosure will be described in detail below.

[0142] Through the above steps 310-330, in the embodiment of the present disclosure, when the storage type change rule for the target file is hit, the server will respond to the storage type change request for the target file in the physical data storage space, and first update the storage type change stage data of the file target, that is, in the metadata storage space corresponding to the physical data storage space, the storage type change stage data of the target file is set to be changed to indicate that the storage type of the target file needs to be changed. Further, since the target file is divided into multiple data segments for storage in the physical data storage space, after the storage type change stage data is set to be changed, it is necessary to allocate a change instruction to each data segment to realize the marking of each data segment, and after the change instruction is allocated to each data segment, the storage type change stage data of the target file is set to changing in the metadata storage space to realize the update of the storage type change stage data. Next, for each data segment, each data segment is made to execute the change instruction and change the storage type. Further, the execution of the change instruction by each data segment is detected, and after the change instruction of each data segment is detected to be executed, it is determined that the storage type of all data segments has been changed. At this time, in the metadata storage space, the storage type change phase data of the target file is set to have been changed, so that the storage type change phase data of the target file at the current time is shown as changed. This method closely combines the change processing of the file data in the physical data storage space with the update of the storage type change phase data in the metadata storage space, so that in the process of data storage type change, the inconsistency between the actual data type of the file data in the physical data storage space and the storage type change phase data of the metadata storage space can be reduced.

[0143] The above is a general description of steps 310 to 330. The specific implementation of step 310, step 320, and step 330 will be described in detail below.

[0144] Step 310 is described in detail below.

[0145] In step 310, in response to a storage type change request for a target file in a physical data storage space, the storage type change phase data of the target file is set as pending change in a metadata storage space corresponding to the physical data storage space, wherein the target file is divided into multiple data segments for storage in the physical data storage space.

[0146] In one embodiment, in order to meet the actual needs of the object as quickly as possible on the object terminal and shorten the waiting time for data conversion, after setting the storage type change phase data of the target file to be changed, the storage type change method further includes:

[0147] In response to a request to obtain the state of the storage type change stage data for the target file, the state of the storage type change stage data is displayed as changed.

[0148] The status acquisition request refers to a request initiated when the target object wants to check whether the storage type of the file data of the target file has been converted.

[0149] Specifically, when the target object wants to check whether the storage type of the file data of the target file has been converted, the target object will initiate a status acquisition request for the storage type change phase data of the target file through the data processing platform on the target terminal. Then, with authorization, the server will receive the status acquisition request and, in response to the status acquisition request, display the status of the storage type change phase data as changed, thereby realizing the asynchronous change of the storage type of the file data of the target file.

[0150] The advantage of this embodiment is that, during the data storage type change process, the status of the data in the storage type change stage is first displayed as changed. When the data in the storage type change stage is actually still to be changed, the change indication is allocated to each data segment of the target file asynchronously, and the change indicator light process is executed, so that the data in the storage type change stage of the target file is displayed as changed (settled) on the object terminal in advance, and the actual change process is executed asynchronously on the server, which can achieve the fastest possible satisfaction of the actual needs of the object on the object terminal, while shortening the waiting time for data conversion, which is beneficial to provide guarantee for overhead calculation.

[0151] In the embodiment of the present disclosure, the metadata storage space includes a target tree, and each file in the physical data storage space corresponds to a file node in the target tree.

[0152] The target tree refers to a tree structure formed by the metadata storage space for the file storage architecture where each file is maintained. The file storage architecture refers to the file system to which each file belongs.

[0153] In the metadata storage space, a file storage architecture corresponds to a target tree, and files under different file storage architectures correspond to file nodes in different target trees.

[0154] For example, the tree structure formed by the file storage architecture where the target file is located is a specific target tree in the metadata storage space. When there are file storage architecture A, file storage architecture B, and file storage architecture C, the metadata storage space will include three target trees, namely, target tree 1 corresponding to file storage architecture A, target tree 2 corresponding to file storage architecture B, and target tree 3 corresponding to file storage architecture C. If the target file is a file in file storage architecture B, then the target file node of the target file will exist in target tree 2.

[0155] To save space, the specific process of generating the target tree in the embodiment of the present disclosure will be described in detail below, but will not be repeated here.

[0156] Please refer to Figure 4 In one embodiment, step 310 specifically includes but is not limited to the following steps 410-420:

[0157] Step 410: Determine the target file node corresponding to the target file in the target tree of the metadata storage space;

[0158] Step 420: Set the storage type change phase data in the target file node to be changed.

[0159] Steps 410 - 420 are described in detail below.

[0160] In step 410, a target file node corresponding to the target file is determined in the target tree of the metadata storage space.

[0161] The target file node refers to a tree node corresponding to the target file in the target tree.

[0162] In the specific implementation of this embodiment, since in the target tree of the metadata storage space, the file and each file node are in one-to-one correspondence, the file index of the file is often directly used as the node index of the file node, wherein the file index is used to uniquely identify each file, and the node index is used to uniquely identify each file node. Based on this, first, the target file index of the target file is obtained. Then, in the target tree of the metadata storage space, the file node whose node index of the file node is consistent with the target file index is searched, and the found file node is used as the target file node corresponding to the target file.

[0163] In another embodiment, since the storage type change request is generated based on a preset and effective storage type change rule (i.e., the target storage type change rule described below), and the target storage type change rule has already specified the specific path of the file in the target tree to which the target storage type change rule is applied when it is set, based on this, when determining the target file node corresponding to the target file, the file path corresponding to the target storage type change rule can also be obtained from the storage type change request, and the file node pointed to by the file path in the target tree is used as the target file node corresponding to the target file.

[0164] In step 420, first, the field value corresponding to the storage type change phase data is searched in the node information of the target file node. Then, the field value corresponding to the storage type change phase data found is set to be changed, indicating that the target file corresponding to the target file node needs to change the data storage type.

[0165] The advantage of this embodiment is that each data in the metadata storage space is formed into a target tree, and each file becomes a specific node in the target tree, which can improve the storage rationality of the metadata of each file and the query convenience of the file node of each file. In addition, the metadata storage space maintains the target tree corresponding to each file storage architecture, which can make the file directories and files under each file storage architecture managed separately, and make the data management of the metadata storage space more organized. Based on the target tree, after finding the target file node corresponding to the target file, the field value of the storage type change stage data in the target file node is changed to pending change, which can improve the convenience of data change.

[0166] Please refer to Figure 5 In one embodiment, the process of generating the target tree includes but is not limited to the following steps 510-520:

[0167] Step 510: Obtain the file storage architecture where the target file in the physical data storage space is located;

[0168] Step 520: Use the file storage architecture as the root node of the target tree, use the folders in the file storage architecture as the branch nodes of the target tree, and use the files under the folders as leaf nodes extending from the branch nodes.

[0169] Steps 510 - 520 are described in detail below.

[0170] In step 510, a file storage architecture where a target file in a physical data storage space is located is obtained.

[0171] The file storage architecture refers to a structure for storing and organizing files. The file storage structure can be simply understood as a file system. The file storage architecture contains multiple folders (file directories) and files. In the file storage architecture, when you know the directory and file name of a file, you can find the file.

[0172] In the specific implementation of this embodiment, since the physical data storage space often stores the relevant data of each file storage architecture (file system) as a whole, after the file storage architecture where the target file is located is stored in the physical data storage space, the file storage architecture where the target file is located can be obtained from the object storing the file storage architecture or from the physical data storage space with authorization.

[0173] In step 520, the file storage architecture is used as the root node of the target tree, the folders in the file storage architecture are used as branch nodes of the target tree, and the files under the folders are used as leaf nodes extending from the branch nodes.

[0174] Branch nodes refer to some intermediate nodes of the target tree. Branch nodes correspond to folders in the file storage architecture, so branch nodes can also be understood as some directory nodes in the target tree.

[0175] Leaf nodes correspond to various files in the file storage architecture, so leaf nodes can also be understood as some file nodes in the target tree.

[0176] In the specific implementation of this embodiment, when constructing the target tree corresponding to the file storage architecture where the target file is located, first, the file storage architecture is used as the root node of the target tree. Then, according to the subordinate relationship between each folder (file directory) and each file in the file storage architecture, the folders in the file storage architecture are used as branch nodes of the target tree in a hierarchical nested form, and each file under the folder is used as a leaf node extending from the branch node, until each folder and each file has a corresponding node, and a complete target tree corresponding to the file storage architecture can be obtained.

[0177] like Figure 6As shown, it is a schematic diagram of the structure of the target tree of a file storage architecture (file system) in the metadata storage space. Specifically, there are folder Dir1 and file file1 in the file system, and there are file file2 and folder Dir2 in folder Dir1. Based on this, the target tree has three levels, the first level is the root node composed of the file storage architecture; the second level is composed of folder Dir1 and file file1, wherein folder Dir1 corresponds to the directory node (branch node) of the first level, and file file1 corresponds to the file node (leaf node) of the first level; the third level is composed of folder Dir2 and file file2, wherein folder Dir2 corresponds to the directory node (branch node) of the second level, and file file2 corresponds to the file node (leaf node) of the second level. In addition, in the target tree, the file path of folder Dir1 is " / Dir1"; the file path of folder Dir2 is " / Dir1 / Dir2"; the file path of file file1 is " / file1"; the file path of file file2 is " / Dir1 / file2".

[0178] The benefit of this embodiment is that, for each file storage architecture, the file storage architecture is used as the root node of the target tree, the folder in the file storage architecture is used as the branch node of the target tree, and the files under the folder are used as leaf nodes extending from the branch node, so that the data in the file storage architecture can be stored and managed in the form of a tree structure, so that the data in the metadata storage space is constructed into multiple target trees, so that the relevant data of each file is recorded as node data in each file node, which can improve the query convenience and storage security of the relevant data of each file. In addition, the hierarchical relationship in the target tree can also clearly reflect the ownership relationship of each file in the file storage architecture, which can make the overall structure of the file storage architecture have a better degree of visualization.

[0179] Please refer to Figure 7 In one embodiment, the process of generating a storage type change request includes but is not limited to the following steps 710-740:

[0180] Step 710: obtaining a plurality of candidate storage type change rules for the file storage architecture where the target file in the physical data storage space is located;

[0181] Step 720: for each candidate storage type change rule, determine the file path pointed to by the candidate storage type change rule in the target tree;

[0182] Step 730: Determine a target storage type change rule from a plurality of candidate storage type change rules based on the lengths of the respective file paths;

[0183] Step 740: If it is determined that the triggering condition of the target storage type change rule is met, a storage type change request is generated.

[0184] Steps 710 - 740 are described in detail below.

[0185] In step 710, a plurality of candidate storage type change rules for a file storage architecture where a target file in a physical data storage space is located are obtained.

[0186] The candidate storage type change rule is used to indicate the conditions under which the file in the file storage architecture where the target file is located must meet in order to change the storage type of the file data to a certain type.

[0187] In the specific implementation of this embodiment, since the multiple candidate storage type change rules for the file storage architecture where the target file in the physical data storage space is located are pre-set by the target object. Based on this, with authorization, when the target object sets the candidate storage type change rule, when the target object determines that the candidate storage type change rule is set, the server will detect this rule setting event for the file storage architecture where the target file is located, thereby obtaining multiple candidate storage type change rules for the file storage architecture where the target file is located.

[0188] To save space, the specific implementation process of generating the candidate storage type change rule in the embodiment of the present disclosure will be described in detail below. No further description will be given here.

[0189] In step 720, for each candidate storage type change rule, the file path pointed to by the candidate storage type change rule is determined in the target tree.

[0190] The file path is used to indicate which specific files the candidate storage type change rule applies to in the file storage architecture where the target file is located, and indicates the specific locations of these files in the target tree.

[0191] In the specific implementation of this embodiment, since the target object often sets which files or file directories (folders) the candidate storage type change rule is associated with when setting the candidate storage type change rule, based on this, the location of the folder or file selected when setting the candidate storage type change rule can be searched in the target tree, and the path from the leaf node corresponding to the file or the branch node corresponding to the folder to the root node is determined as the file path pointed to by the candidate storage type change rule.

[0192] In step 730, based on the lengths of the respective file paths, a target storage type change rule is determined from a plurality of candidate storage type change rules.

[0193] The length is used to indicate how many levels the file path pointed to by the candidate storage type change rule spans in the target tree.

[0194] The target storage type change rule is used to indicate a candidate storage type change rule that is finally valid among multiple candidate storage type change rules that are set.

[0195] In the specific implementation of this embodiment, based on the lengths of the various file paths, the candidate storage type change rule with the largest file path length is used as the target storage type change rule.

[0196] It should be noted that, in the embodiment of the present disclosure, the effective candidate storage type change rule follows the principle of the longest file path (pointing to a file with a smaller level in the target tree).

[0197] In step 740, if it is determined that the triggering condition of the target storage type change rule is met, a storage type change request is generated.

[0198] The trigger condition is used to indicate the environmental conditions that must be met to trigger the target storage type change rule, wherein the trigger condition can be a certain state reached at the current time, or a certain operating condition satisfied by the current network state, and so on.

[0199] In the specific implementation of this embodiment, first, the triggering condition of the target storage type change rule is determined. Then, when it is detected that the current environmental conditions have reached the triggering condition of the target storage type change rule, a storage type change request is generated according to the target file pointed to by the target storage type change rule and the storage type to be changed.

[0200] The target file node of the target file belongs to the file path pointed to by the target storage type change rule.

[0201] like Figure 8As shown, this is the rule matching process for the target tree of the file system K. Specifically, the target tree of the file system K consists of five levels. Among them, the first level is the root node of the file system K; the second level is the directory node corresponding to the folder usr, and the directory node corresponding to the folder tmp; the third level is the directory node corresponding to the subfolder local of the folder usr; the fourth level is the directory node corresponding to the subfolder workspace of the subfolder local of the folder usr, and the directory node corresponding to the subfolder service; the fifth level is the file node of the file A and the file node of the file B in the subfolder workspace, and the file node of the file C and the file node of the subfolder service. Based on this, when the target object is to set the candidate storage type change rules for the file system K, the candidate storage type change rules are rule 1 "for files in the path " / usr / local / ", 15 days to sink to the deep archive type", rule 2 "for files in the path " / usr / local / workspace", 10 days to cool down to the low-frequency storage type", and rule 3 "for files in the path " / usr / local / service", 10 days to cool down to the archive storage type". It can be seen that rule 1 points to the directory node corresponding to the third-level folder local, which is applicable to files A, B, C, and D. Rule 2 points to the directory node corresponding to the fourth-level folder workspace, which is applicable to files A and B. Rule 3 points to the directory node corresponding to the fourth-level folder service, which is applicable to files C and D. Based on the principle of the longest file path length, the valid candidate storage type change rules are rule 2 and rule 3.

[0202] The advantage of this embodiment is that when generating a storage type change request, among the pre-set multiple candidate storage type change rules, according to the longest path matching rule, the candidate storage type change rule with a longer file path and applicable to the file node at a smaller level in the target tree is used as the final valid rule (target storage type change rule), which can achieve reasonable screening of multiple candidate storage type change rules, so that when the trigger condition of the target storage type change rule is hit, the storage type change request is quickly generated, which can improve the generation accuracy and rationality of the storage type change request.

[0203] Please refer to Fig. 9 In one embodiment, the process of generating the candidate storage type change rule includes but is not limited to the following steps 910-940:

[0204] Step 910: In response to a rule configuration request for a file storage architecture, obtain rule triggering time and storage type change information;

[0205] Step 920: determine the rule-associated file in each file of the file storage architecture, and generate a file path based on the position of the leaf node corresponding to the rule-associated file in the target tree;

[0206] Step 930: Perform a first verification on the storage type change information based on a preset storage type conversion rule;

[0207] Step 940: If it is determined that the first verification passes, a candidate storage type change rule is generated based on the rule triggering time, the storage type change information, and the file path.

[0208] Steps 910-940 are described in detail below.

[0209] In step 910, in response to a rule configuration request for a file storage architecture, rule triggering time and storage type change information are obtained.

[0210] A rule configuration request refers to a request initiated when the target object wants to set storage type change rules for files under certain file directories in the file storage architecture.

[0211] The rule trigger time is used to indicate the specific time requirement for executing the candidate storage type change rule. The rule trigger time can be a specific time point or a time interval different from the current time point.

[0212] The storage type change information is used to indicate the storage type to which the file data of the file is to be converted.

[0213] In the specific implementation of this embodiment, when the target object wants to configure rules for files in a certain file storage architecture, the target object will edit the rule trigger time and storage type change information, and provide the rule trigger time and storage type change information to the server along with the initiated rule matching request. Based on this, with authorization and permission, the server will respond to the rule configuration request and obtain the rule trigger time and storage type change information configured by the target object on the front-end interface.

[0214] In step 920, the rule-associated file is determined in each file of the file storage architecture, and a file path is generated based on the position of the leaf node corresponding to the rule-associated file in the target tree.

[0215] In the specific implementation of this embodiment, first, according to the storage type change information provided by the target object, the files to be changed in storage type pointed to by the storage type change information are obtained, so that in each file of the file storage architecture, the files to be changed in storage type pointed to by the storage type change information are determined as rule-associated files. Then, the file node corresponding to the rule-associated file is searched in the target tree, and the path connecting the file node to the root node is used as the file path.

[0216] In step 930, a first verification is performed on the storage type change information based on a preset storage type conversion rule.

[0217] The storage type conversion rule is used to indicate the conversion requirements that must be met for the conversion of the storage type of file data, and is used to define which conversions between storage types are feasible and which conversions between storage types are not feasible.

[0218] In the specific implementation of this embodiment, when the first verification is performed on the storage type change information, first, the storage type indicated to be converted is extracted from the storage type change information. Next, for the rule-associated file pointed to by the storage type change information, the storage type of the rule-associated file at the current time point is obtained. Further, according to the storage type conversion rule, it is determined whether the storage type of the rule-associated file at the current time point supports conversion to the storage type to which the storage type change information is to be converted. If the storage type conversion rule supports conversion from the storage type at the current time point to the storage type to which the storage type change information is to be converted, it is determined that the first verification has passed. If the storage type conversion rule does not support conversion from the storage type at the current time point to the storage type to which the storage type change information is to be converted, it is determined that the first verification has failed, and the rule configuration request of the target object is rejected.

[0219] In step 940, if it is determined that the first verification passes, a candidate storage type change rule is generated based on the rule triggering time, the storage type change information, and the file path.

[0220] In the specific implementation of this embodiment, if it is determined that the first verification passes, it indicates that the target file supports the conversion of the storage type from the current time point to the storage type to be converted by the storage type change information. Therefore, the rule trigger time, storage type change information, and file path can be assembled into a candidate storage type change rule.

[0221] For example, a candidate storage type change rule can be expressed as "For files in the path " / usr / local / workspace", downgrade to a low-frequency storage type in 10 days", where "10 days" is the rule trigger time, "downgrade to a low-frequency storage type" is the storage type change information, and " / usr / local / workspace" is the file path.

[0222] like Fig.10 As shown, it is a schematic diagram of the specific structure of the storage type conversion rule, in which the storage type of the file data of the file includes but is not limited to the standard type (Normal), the intelligent tiering standard type (intelligentNormal), the low-frequency type (Degrade), the archive storage type (arch), the intelligent tiering low-frequency type (intelligentDegrade), and the deep archive storage type (deepArch). In addition, there is a special storage type: delete. Based on this, when executing the storage type change, the supported changes include the following situations: support conversion from the standard type to the intelligent tiering standard type; support conversion between the low-frequency type and the intelligent tiering low-frequency type; support conversion from the intelligent tiering standard type to the low-frequency type; support conversion from the low-frequency type, the intelligent tiering standard type, or the intelligent tiering low-frequency type to the archive storage type; support conversion from the archive storage type to the deep archive storage type; support conversion from the archive storage type or the deep archive storage type to the delete type. In the specific structure of the storage type conversion rule, the priority of each storage type increases from bottom to top, and the upper storage type takes precedence over the lower storage type. When executing the deletion type, the file node can be deleted according to the file path in the target tree, or the file node can be deleted according to the node ID in the target tree.

[0223] The benefit of this embodiment is that when generating candidate storage type change rules based on the rule trigger time and storage type change information provided by the target object, a storage type conversion rule is set to limit the supported storage type change methods. Only when the storage type change information provided by the target object meets the storage type conversion rule (when the first verification passes), the rule trigger time, storage type change information, and file path will be assembled into candidate storage type change rules, which can improve the rationality of the generation of candidate storage type change rules and thereby improve the feasibility of storage type change of file data.

[0224] Step 320 is described in detail below.

[0225] In step 320, a change indication is allocated to each data segment, and in the metadata storage space, the storage type change phase data of the target file is set to being changed.

[0226] Please refer to Fig.11 In one embodiment, step 320 specifically includes but is not limited to the following steps 1110-1150:

[0227] Step 1110: In the target tree, obtain multiple metadata blocks corresponding to the target file node;

[0228] Step 1120: Obtain a preset mapping table;

[0229] Step 1130: for each metadata block, compare the target metadata with each candidate metadata in the preset mapping table;

[0230] Step 1140: determine the candidate data segment corresponding to the candidate metadata consistent with the target metadata as the target data segment;

[0231] Step 1150: Generate a change indication based on the storage type to be changed in the storage type change request, and assign the change indication to each target data segment.

[0232] Steps 1110 - 1150 are described in detail below.

[0233] In step 1110, in the target tree, multiple metadata blocks corresponding to the target file node are obtained.

[0234] The metadata block refers to a block structure in the metadata storage space used to store metadata of a target file node.

[0235] The metadata block includes at least one target metadata. One target metadata is used to indicate basic characteristic information of a data segment of the target file node. Different target metadata are used to indicate basic characteristic information of different data segments.

[0236] In the specific implementation of this embodiment, with authorization, the server can obtain node information, metadata structure, etc. related to the target file node in the metadata storage space. Based on this, data can be extracted from the obtained metadata structure related to the target file node to obtain multiple metadata blocks corresponding to the target file node.

[0237] For example, in the physical data storage space, the target file is divided into four data segments of equal length. Then in the metadata storage space, the target file node will have four metadata blocks (blocks), each of which records the target metadata (range) corresponding to a data segment (object).

[0238] In step 1120, a preset mapping table is obtained.

[0239] The preset mapping table includes a plurality of candidate data segments in the physical data storage space and candidate metadata corresponding to each candidate data segment in the metadata storage space.

[0240] The candidate data segments refer to the file data of each file stored in the physical data storage space.

[0241] The candidate metadata refers to the file metadata of each file stored in the metadata storage space.

[0242] In the specific implementation of this embodiment, since the preset mapping table is constructed according to the correspondence between the file data and metadata of each file when the file data of each file is stored in the physical data storage space and the metadata of the file is stored in the metadata storage space, and is continuously updated with the continuous file storage, based on this, with authorization, the server can directly call the preset mapping table that has been maintained, and obtain the mapping relationship between the file data of each file stored in the physical data storage space and the file metadata of each file stored in the metadata storage space from the preset mapping table.

[0243] In step 1130, for each metadata block, the target metadata is compared with each candidate metadata in the preset mapping table to determine which candidate metadata the target metadata is consistent with.

[0244] In step 1140 , the candidate data segment corresponding to the candidate metadata consistent with the target metadata is determined as the target data segment.

[0245] The target data segments are the data segments into which the target file is segmented.

[0246] In the specific implementation of this embodiment, if the candidate metadata in the preset mapping table is consistent with the target metadata, it indicates that the candidate metadata and the target metadata are the same metadata, and the candidate data segment corresponding to the candidate metadata consistent with the target metadata is determined as the target data segment.

[0247] In step 1150, a change indication is generated based on the storage type to which the storage type change request is to be changed, and the change indication is allocated to each target data segment.

[0248] In the specific implementation of this embodiment, first, the storage type to which the storage type change request is to be changed is filled into the preset template, and the preset template filled with the storage type to be changed is used as a change indication. Then, the change indication is assigned to each target data segment, so that each target data segment is assigned to a change indication. Among them, the change indications assigned to each target data segment of the target file are basically the same.

[0249] like Fig.12 The figure shows a specific metadata structure of a file node (a leaf node corresponding to file A.txt) in a target tree of a file storage architecture, and a schematic diagram of the mapping relationship between the metadata of file A and the file data. Specifically, in the physical storage space, the file data of file A is equally divided into four candidate data segments, namely candidate data segment 1 (object1), candidate data segment 2 (object2), candidate data segment 3 (object3), and candidate data segment 4 (object4). In the target tree, the metadata of the file node of file A is composed of four metadata blocks, wherein the four metadata blocks are metadata block 1 (block1) storing target metadata 1, metadata block 2 (block2) storing target metadata 2, metadata block 3 (block3) storing target metadata 3, and metadata block 4 (block4) storing target metadata 4. Target metadata 1 is used to describe the basic characteristics of candidate data segment 1, target metadata 2 is used to describe the basic characteristics of candidate data segment 2, target metadata 3 is used to describe the basic characteristics of candidate data segment 3, and target metadata 4 is used to describe the basic characteristics of candidate data segment 4. It can be seen that in the target tree, each target metadata of file A corresponds to a candidate data segment in the physical data storage space.

[0250] The benefit of this embodiment is that, in the metadata storage space, the file metadata of each file is stored in blocks, that is, the file metadata is stored and managed in the form of multiple metadata blocks. At the same time, a mapping relationship between the file metadata of each file and the file data (multiple data segments) is also constructed in the metadata storage space. When a storage type change request for a target file is received, the target file node can be quickly found in the metadata storage space, and based on the target metadata stored in each metadata block of the found target file node, and the mapping relationship between the target metadata and the data segment of the physical data storage space, the target data segment can be quickly and accurately found in the physical storage space, thereby improving the efficiency of finding the target data segment and the efficiency of allocating change instructions to each target data segment.

[0251] Step 330 is described in detail below.

[0252] In step 330, each data segment is made to execute the change instruction, and after the change instruction of each data segment is executed, the storage type change phase data of the target file is set as changed in the metadata storage space.

[0253] If the storage type of each data segment of the target file is simply changed without calibrating the storage type of each data segment of the target file, it will be impossible to accurately determine whether the storage type of each data segment has been changed, which will increase the difficulty of verifying the storage type change process and the change result. Based on this, the embodiment of the present disclosure provides a storage type change solution based on updating the field value of the storage type field of each data segment, which can clearly describe and calibrate the storage type change process and improve the queryability of the storage type change process.

[0254] In the embodiment of the present disclosure, the data segment includes a storage type field. The storage type field is used to indicate which storage type the actual storage type of each data segment of the target file is at the current time point.

[0255] Please refer to Fig.13 In one embodiment, step 330 specifically includes but is not limited to the following steps 1310-1320:

[0256] Step 1310: After the change instruction of a single data segment is executed, the storage type field of the data segment is set to the target storage type;

[0257] Step 1320: After the storage type fields of all data segments are the target storage type, the storage type change phase data of the target file is set to changed in the metadata storage space.

[0258] Steps 1310 - 1320 are described in detail below.

[0259] In step 1310, after the change instruction of a single data segment is executed, the storage type field of the data segment is set to the target storage type.

[0260] The target storage type is the storage type to which the storage type change request is to be changed.

[0261] In the specific implementation of this embodiment, first, for a single data segment, the data segment is caused to execute a change instruction, and the current storage type of the data segment is changed to the target storage type required by the change instruction. Then, after the change instruction of the data segment is executed, the storage type field of the data segment is set to the target storage type.

[0262] In step 1320, after the storage type fields of each data segment are all the target storage type, the storage type change phase data of the target file is set to changed in the metadata storage space.

[0263] When this embodiment is implemented, first, the storage type field of each data segment is respectively detected to determine whether the storage type field of each data segment is set to the target storage type. Then, after determining that the storage type field of each data segment is the target storage type, it indicates that the storage type of all data segments of the target file has been changed. Based on this, the storage type change phase data of the target file is set to changed in the metadata storage space, so that the storage type change phase data of the target file can be consistent with the real storage type of each data segment.

[0264] like Fig.14 As shown, it is a specific illustration of allocating change instructions to each data segment of the target file and executing the change instructions. Specifically, in the physical data storage space, the target file is divided into four data segments, namely data segment 1, data segment 2, and data segment 3. Among them, before the storage type is changed, the change instructions of each data segment of the target file are empty, and the storage type field is the archive storage type. Based on this, when the storage type change request requires the storage type of the file data of the target file to be converted into a deep archive storage type, the server will generate a change instruction "become deep archive storage" and allocate change instructions to the four data segments of the target file respectively to realize the marking of each data segment. At this time, the change instructions of each data segment of the target file are all "become deep archive storage", but the storage type field of each data segment is still archive storage. Furthermore, during the storage type change, each data segment executes the change instruction and performs the storage type change according to the change instruction. After the storage type change of each data segment is completed (the change instruction has been executed), the change instruction of each data segment of the target file becomes a null value again. However, the storage type field of each data segment has changed from the original archive storage to deep archive storage.

[0265] The advantage of this embodiment is that a storage type field is set for each data segment to record the actual storage type of the data segment at the current moment. By using the storage type field to clearly mark the storage type of each data segment of the target file, the storage type field of each data segment is modified after the change instruction of each data segment is executed. This method can more accurately determine whether the storage type of each data segment has been changed, so that the process of storage type change can be clearly described and marked, the queryability of the storage type change process is improved, and the difficulty of verifying the storage type change result is reduced.

[0266] The following is a detailed description of a process of changing the storage class of a first type of target file in an embodiment of the present disclosure.

[0267] Since the file types of each file in each file storage architecture often have certain differences, for example, for some ordinary files, the ordinary file often has only one file node in the target tree, while for some hierarchical files composed of multiple sub-files, the hierarchical file often has multiple sub-nodes under the file node in the target tree. If only the metadata and data segments corresponding to the file node itself are considered when changing the storage type of file data of various files, it often leads to the situation that the storage type of the file data is inconsistent with the data of the storage type change stage of the file node. For example, when the file data of the hierarchical file is not all changed to the target storage type, the storage type change stage data is changed. Based on this, the embodiment of the present disclosure provides a solution for changing the storage type of a specific type of target file, which can reduce the situation that the storage type of the file data of a specific type of target file (file in hierarchical form) is inconsistent with the data of the storage type change stage of the file node.

[0268] Please refer to Fig.15 In one embodiment, step 320 specifically includes but is not limited to the following steps 1510-1570:

[0269] Step 1510: If the type of the target file is the first type, then in the target tree, obtain multiple file child nodes extending from the target file node;

[0270] Step 1520: For each file subnode, obtain multiple metadata blocks of the file subnode in the target tree;

[0271] Step 1530: Obtain a preset mapping table;

[0272] Step 1540: for each metadata block, compare the target metadata with each candidate metadata in the preset mapping table;

[0273] Step 1550: determine the candidate data segment corresponding to the candidate metadata consistent with the target metadata as the intermediate data segment;

[0274] Step 1560: Integrate the multiple intermediate data segments into a target data segment;

[0275] Step 1570: Generate a change indication based on the storage type to be changed in the storage type change request, and assign the change indication to each target data segment.

[0276] Steps 1510-1570 are described in detail below.

[0277] In step 1510, if the type of the target file is the first type, then in the target tree, a plurality of file child nodes extending from under the target file node are obtained.

[0278] The first type is used to indicate that the target file includes multiple partition files.

[0279] Partition files refer to the sub-files under the target file, and the collection of partition files can form a first type of target file.

[0280] In a specific example, the first type of target file is an MPU file (Memory Pool Unit), which may be a file related to cache management of the file system, etc.; the partition file of the target file is a Part file (Partition), which may represent specific information of a specific area (for example, the size and location of a specific partition, etc.).

[0281] Each partition file has a corresponding file subnode in the target tree. The file subnode is used to indicate the location of each partition file in the target tree.

[0282] It should be noted that, since each partition file is a component of the target file, the partition file can be regarded as a sub-file of the target file. There is a subordinate relationship between the target file and the partition file. Therefore, in the target tree, the file sub-node of the partition file is generally a leaf node of the next level of the target file node corresponding to the target file, and the file sub-node is extended from each target file node.

[0283] In the specific implementation of this embodiment, if the type of the target file is the first type, it means that the target file is composed of multiple partition files. First, the target file node corresponding to the target file is obtained in the target tree. Then, the leaf nodes under the target file node are determined as multiple file child nodes corresponding to the multiple partition files.

[0284] Steps 1520-1550 are similar to the above steps 1110-1140 and will not be described in detail to save space.

[0285] In step 1560, multiple intermediate data segments are integrated into a target data segment.

[0286] The intermediate data segments are the data segments that the partition file is divided into, and the target data segments are the data segments that the target file is divided into.

[0287] In the specific implementation of this embodiment, since each intermediate data segment represents a part of the file data of each partition file, and the target file is composed of multiple partition files, based on this, all the intermediate data segments are aggregated into a set, and all the data segments in the set represent all the file data of the target file. Therefore, the data segments in the set are used as target data segments.

[0288] Step 1570 is similar to the above step 1150. To save space, it will not be described again.

[0289] The advantage of this embodiment is that it takes into account the change of the data storage type of hierarchical files such as MPU files. When determining the first type of the target file, the file subnodes of each partition file corresponding to the target file are first determined in the target tree. Further, the storage type is changed based on each partition file as the basic unit. Based on the data segments corresponding to the metadata of the file subnodes of each partition file, all target data segments corresponding to the target file are integrated. The target data segments corresponding to the target file can be quickly collected, and the same change instructions are assigned to each target data segment. This method can meet the needs of storage type changes for different types of files and has good universality. In addition, for hierarchical target files, the storage type change of file data can also be performed through the file nodes in the target tree and the mapping relationship between the metadata and the data segments in the file nodes, which can reduce the inconsistency between the storage type of the file data of a specific type of target file (hierarchical file) and the data of the file node during the storage type change stage.

[0290] Please refer to Fig.16 In this embodiment, step 330 specifically includes but is not limited to the following steps 1610-1620:

[0291] Step 1610: After the change instructions of each data segment of a single partition file are executed, the storage type change phase data of the partition file is set as changed in the metadata storage space;

[0292] Step 1620: After the storage type change phase data of each partition file is changed, the storage type change phase data of the target file is set as changed in the metadata storage space.

[0293] Steps 1610-1620 are described in detail below.

[0294] In step 1610, for each partition file, each data segment in the partition file is caused to execute the change instruction. When it is determined that the change instructions of each data segment in the partition file have been executed, it indicates that the data segments of the partition file have completed the storage type change. Therefore, in the metadata storage space, the storage type change phase data of the partition file is set to have been changed. The specific process is similar to the above steps 1310-1320. To save space, it is not repeated here.

[0295] In step 1620, first, it is detected whether the storage type change phase data of each partition file has become changed, so as to determine whether the storage type of the file data of each partition file has been changed. Then, when it is determined that the storage type change phase data of each partition file has been changed, it indicates that the storage type of the file data of each partition file has been changed. Therefore, the storage type change phase data of the target file can be set as changed in the metadata storage space.

[0296] The advantage of this embodiment is that when the data storage type is changed, the storage type change is performed with each partition file as the basic unit. After the storage type change of each data segment of a single partition file is completed, the storage type change stage data of the partition file is set to changed, and after the storage type change stage data of all partition files has become changed, the storage type change stage data of the target file is updated, thereby realizing a bottom-up (from segment to total) data change, which can effectively improve the setting accuracy of the storage type change stage data of the target file, reduce the risk caused by modifying the storage type change stage data of the target file before the file data of some partition files are completely changed, and is conducive to improving the consistency of the storage type of the file data of a specific type of target file and the storage type change stage data of the file node in the data storage type change.

[0297] The following is a detailed description of a process of generating multiple candidate time periods in one embodiment of the present disclosure.

[0298] Please refer to Fig.17 In one embodiment, the process of generating multiple candidate data segments of the entity data storage space includes but is not limited to the following steps 1710-1730:

[0299] Step 1710: Obtain multiple candidate file storage architectures;

[0300] Step 1720: for each candidate file storage architecture, the candidate file is segmented according to a predetermined size to obtain a plurality of file data blocks;

[0301] Step 1730: Take a file data block as a candidate data segment, and store multiple candidate data segments in a preset storage bucket of the physical data storage space.

[0302] Steps 1710-1730 are described in detail below.

[0303] In step 1710, multiple candidate file storage architectures are obtained.

[0304] The candidate file storage architecture refers to the storage structure system where each file in the physical data storage space is located, wherein the candidate file storage architecture can be understood as different file systems.

[0305] In the specific implementation of this embodiment, when obtaining multiple candidate file storage architectures, it is possible to request each object to obtain the file system set by each object with authorization and use the file system as the candidate file storage architecture. It is also possible to obtain each file stored in a directory according to a certain architecture from each data source, and regard the obtained architecture and its subordinate directories and files as the candidate file storage architecture.

[0306] In step 1720, for each candidate file storage architecture, the candidate file is divided into predetermined sizes to obtain a plurality of file data blocks.

[0307] Candidate files refer to each file in each file directory (folder) in the candidate file storage architecture.

[0308] The predetermined size is used to limit the data amount of data contained in each file data block.

[0309] The file data block is used to indicate the segmented, independent data unit.

[0310] In the specific implementation of this embodiment, for the candidate files of each candidate file storage architecture, the candidate files are segmented according to a predetermined size, so that the file data in the candidate files are divided into multiple data blocks with the same data volume, and multiple file data blocks corresponding to the candidate files are obtained.

[0311] In step 1730, a file data block is taken as a candidate data segment, and a plurality of candidate data segments are stored in a preset storage bucket of the physical data storage space.

[0312] A preset storage bucket refers to a container in a physical data storage space for storing file data. There is no upper limit on the capacity of a preset storage bucket. The preset storage bucket can achieve flat management of the file data of each candidate file in the physical data storage space, eliminating the hierarchical structure of each candidate file in the folder / directory in the candidate file storage architecture.

[0313] In the specific implementation of this embodiment, when storing the file data of each candidate file, a file data block is used as a candidate data segment (object), and multiple candidate data segments are stored in a preset storage bucket of the physical data storage space to achieve unified storage and management of multiple candidate data segments.

[0314] like Fig.18As shown in the figure, it is the specific process of setting the bucket label of a bucket in the physical data storage space. Specifically, the storage type transformation rules applicable to each candidate data segment stored in the bucket are low-frequency / low-cost storage (fsid_standard_IA), archive storage (fsid_archive), and deep archive storage (fsid_deep_archive). When assigning change instructions to each data segment of the target file, the change instruction is used as the keyword key, and the storage type to which each data segment is to be changed is used as the value value. For this bucket, according to the rules predetermined by the bucket, the converted value value (storage type) can be low-frequency / low-cost storage, archive storage, or deep archive storage.

[0315] The advantage of this embodiment is that the candidate files of each candidate file storage structure are divided into predetermined sizes, so that each candidate data segment stored in the physical data storage space can have a relatively uniform data size; at the same time, when the file data of each candidate file is stored in the physical data storage space, the storage bucket is used as a container to store each candidate data segment, which can realize flat management and storage of file data, eliminate the inherent hierarchical characteristics of the candidate files in the candidate file storage architecture, and improve the simplicity of data storage in the physical data storage space.

[0316] The following is a detailed description of the process of accessing metadata storage space in one embodiment of the present disclosure.

[0317] After the file data and metadata of a file are stored in different management platforms respectively, users often need to access the metadata storage space for some business needs, and obtain metadata of certain files from the metadata storage space. However, requests initiated by users through different business ports often have problems such as request incompatibility, which will result in the inability to make the request reach the metadata storage space normally, resulting in the problem of metadata acquisition failure. For example, a business request initiated by a user through the external interface of the physical data storage space cannot be directly transmitted to the metadata storage space. Based on this, the embodiment of the present disclosure provides a method based on protocol conversion to obtain file metadata of the metadata storage space, which can improve the reliability and success rate of metadata acquisition.

[0318] In one embodiment, after storing the plurality of candidate data segments in a preset storage bucket of the physical data storage space, the storage type changing method further includes:

[0319] Access metadata storage space.

[0320] Please refer to Fig.19In this embodiment, the process of accessing the metadata storage space includes but is not limited to the following steps 1910-1930:

[0321] Step 1910: Obtain a data acquisition request for metadata storage space;

[0322] Step 1920: Perform protocol conversion on the data acquisition request based on a preset protocol conversion interface to obtain a converted acquisition request;

[0323] Step 1930: Based on the converted acquisition request, the metadata in the metadata storage space is called through a preset data access interface.

[0324] Steps 1910-1930 are described in detail below.

[0325] In step 1910, a data acquisition request for the metadata storage space is acquired.

[0326] A data acquisition request refers to a request initiated by a user (eg, a target object) when the user wants to obtain file metadata of a certain file.

[0327] In the specific implementation of this embodiment, when an object wants to obtain file metadata of a certain file, the object will initiate a data acquisition request on the data processing platform of the object terminal. Based on this, the server can obtain the data acquisition request for the metadata storage space with authorization.

[0328] In step 1920, protocol conversion is performed on the data acquisition request based on a preset protocol conversion interface to obtain a converted acquisition request.

[0329] The protocol conversion interface is used to perform protocol conversion on the data acquisition request initiated by the user to obtain a request that meets the predetermined protocol requirements.

[0330] For example, when the protocol conversion interface is a Gateway interface, the protocol conversion interface can convert a request based on the S3 protocol into a request based on posix semantics, wherein the request based on posix semantics is a protocol type that can be received by the metadata server layer of the metadata storage space.

[0331] The converted acquisition request is used to indicate the protocol conversion result of the data acquisition request. The request contents of the converted acquisition request and the data acquisition request are basically the same, except that the transmission protocols based on the two are different.

[0332] In the specific implementation of this embodiment, first, the server forwards the data acquisition request to the protocol conversion interface. Then, the protocol conversion interface performs protocol conversion on the data acquisition request, converting the protocol of the data acquisition request into a protocol type acceptable to the metadata storage space, and obtaining a converted acquisition request.

[0333] In step 1930, based on the converted acquisition request, the metadata in the metadata storage space is called through a preset data access interface.

[0334] The data access interface is used to implement request forwarding and send requests that meet the requirements of the predetermined protocol to the management end of the metadata storage space.

[0335] In the specific implementation of this embodiment, first, the preset data access interface sends the converted acquisition request to the metadata service layer of the metadata storage space, and then the metadata service layer verifies the converted acquisition request. After verifying the request content and request initiating object of the converted acquisition request and determining that the request verification is passed, the metadata service layer calls the metadata in the metadata storage space, and feeds back the metadata in the metadata storage space to the object through the data access interface and the protocol conversion interface.

[0336] like Fig. 20 As shown in the figure, it is an example of accessing the metadata storage space based on protocol conversion. Specifically, when the user Actor wants to obtain the file metadata in the metadata storage space, it will first send the data acquisition request to the access layer (COS CGI) of the entity data storage space through the interface (object storage API) of the entity data storage space, and then forward the data acquisition request to the protocol conversion interface (Gateway) through the access layer of the entity data storage space for protocol conversion to obtain the converted acquisition request. Further, the converted acquisition request is sent to the metadata service layer (MetaServer) of the metadata storage space through the data access interface (proxy). Similarly, when creating or deleting some data in the metadata storage space, the data deletion request or data creation request can also be forwarded to the data management interface / data management layer (RootServer) through the access layer (COS CGI) of the entity data storage space, and then sent to the metadata service layer (MetaServer) of the metadata storage space by the data management interface / data management layer (RootServer).

[0337] The advantage of this embodiment is that when acquiring file metadata of the metadata storage space, it takes into account the problem of incompatibility of requests initiated by users from different business ports, and provides a method based on protocol conversion to acquire file metadata of the metadata storage space. The protocol conversion interface is used to perform protocol conversion on the data acquisition request, and a converted acquisition request that can be accepted by the metadata storage space is generated. The converted acquisition request is sent to the management end of the metadata storage space through the data access interface. This method can improve the reliability and success rate of metadata acquisition.

[0338] Since the metadata storage space often needs to store a large amount of file metadata, the metadata storage space is often managed by the metadata master service and the metadata slave service to manage the metadata of each file. Therefore, in actual storage, according to the metadata master service and the metadata slave service, a plurality of sub-storage spaces are divided in the metadata storage space. For example, a metadata master service corresponds to a specific sub-storage space, and a metadata slave service also corresponds to a specific sub-storage space. Different metadata master services / metadata slave services manage a sub-storage space respectively. In this way, the file metadata of each file of different file systems will be stored in different sub-storage spaces. Among them, in the embodiment of the present disclosure, the target tree where the target file is located is stored in the target sub-storage space of the metadata storage space.

[0339] The target sub-storage space refers to a specific sub-storage space in the metadata storage space.

[0340] Please refer to Fig.21 In one embodiment, after the target tree is generated in the metadata storage space, the storage type change method further includes but is not limited to the following steps 2110-2130:

[0341] Step 2110: acquiring an architecture index of the file storage architecture in response to a metadata access request for the file storage architecture where the target file is located;

[0342] Step 2120: Based on the architecture index, data query is performed through a preset data management interface to obtain the storage location of the target tree in the target sub-storage space;

[0343] Step 2130: Based on the storage location, call the target tree through a preset data access interface to obtain file metadata in the target tree.

[0344] Steps 2110-2130 are described in detail below.

[0345] In step 2110, in response to a metadata access request for the file storage architecture where the target file is located, an architecture index of the file storage architecture is obtained.

[0346] The metadata access request is a request initiated by a user when the user wants to access metadata in the metadata storage space.

[0347] Since a target tree in the metadata storage space corresponds to a file storage architecture, the architecture index of the file storage architecture can be used to uniquely identify each target tree. Therefore, the architecture index is used to indicate which target tree in the metadata storage space is the file storage architecture.

[0348] In the specific implementation of this embodiment, when the object wants to obtain the metadata of the file storage architecture where the target file is located, the object will initiate a metadata access request for the file storage architecture where the target file is located. Then, the server will respond to the metadata access request for the file storage architecture where the target file is located with authorization and determine the file storage architecture and the architecture index of the file storage architecture according to the target file.

[0349] In step 2120, based on the architecture index, data query is performed through a preset data management interface to obtain the storage location of the target tree in the target sub-storage space.

[0350] The data management interface is used to manage the file system of the metadata storage space and the metadata of the files, where the management includes but is not limited to creating or deleting the target tree corresponding to the file system (file storage architecture), changing the properties of the target tree corresponding to the file system (file storage architecture), etc.

[0351] In some practical applications, the data management interface may be a Root server interface (RS interface).

[0352] The storage location is used to indicate the specific location of the target tree in the target sub-storage space.

[0353] When this embodiment is specifically implemented, first, the candidate architecture index corresponding to each target tree in each sub-storage space in the metadata storage space is obtained through a preset data management interface. Then, data query is performed through the data management interface to find a candidate architecture index consistent with the architecture index among multiple candidate architecture indexes. Finally, the specific position of the target tree corresponding to the candidate architecture index consistent with the architecture index in the metadata storage space (target sub-storage space) is used as the storage position of the target tree where the target file is located in the target sub-storage space.

[0354] In step 2130, based on the storage location, the target tree is called through a preset data access interface to obtain file metadata in the target tree.

[0355] The data access interface is used to provide a metadata interface to the outside world. The data access interface is used to implement protocol conversion and forwarding of requests, and send requests that meet the predetermined protocol requirements to the management end of the metadata storage space.

[0356] File metadata is used to describe the file data of each file.

[0357] When this embodiment is implemented, the specific process of step 2130 is similar to the above step 1930. To save space, it will not be repeated.

[0358] like Fig. 22As shown, it is a specific process of accessing the metadata storage space. Specifically, when the user client wants to access the metadata storage space, it first sends a metadata access request to the data management interface / data management layer (RootServer), and the data management interface / data management layer (RootServer) finds a target tree corresponding to the metadata access request from the target trees maintained by multiple metadata storage master services (MDS Master) and multiple metadata storage slave services (MDS Slave) in the metadata storage space according to the metadata access request, and provides the storage location of the target tree to the user. Further, the user provides the storage location to the data access interface (proxy) through the metadata stream, and then the data access interface searches and calls the corresponding metadata in the metadata storage space according to the storage location and feeds it back to the user, wherein the database in which the various metadata in the metadata storage space are stored can constitute a database cluster (DB cluster), and the database cluster includes multiple types of data such as CDB data, TDSQL data, and CynosDB data. In addition, when the user wants to obtain file data in the physical data storage space, he can directly send a data acquisition request to the physical data storage space, and transmit the data acquisition request to the physical data storage space through the data stream to obtain the corresponding file data.

[0359] The benefit of this embodiment is that when a metadata access request is received, the specific location of the corresponding target data can be queried according to the architecture index of the file storage architecture for each target tree in the metadata storage space, thereby realizing accurate and rapid positioning of the target tree in the metadata storage space. Furthermore, a preset data access interface (Proxy interface) is used to perform protocol conversion and forwarding according to the metadata access request, thereby realizing rapid call of metadata of the target tree in the metadata storage space, which can improve the convenience of metadata acquisition.

[0360] The following is a detailed description of a process for updating metadata blocks of each file in a metadata storage space in an embodiment of the present disclosure.

[0361] Please refer to Fig.23 In one embodiment, the process of updating the metadata blocks of each file in the metadata storage space includes but is not limited to the following steps 2310-2320:

[0362] Step 2310: for each metadata block, perform data detection on the metadata block;

[0363] Step 2320: If it is determined that the target metadata of the metadata block does not reach the preset number, call the preset data append interface to add the metadata corresponding to the preset supplementary data to the metadata block to update the metadata of the metadata block.

[0364] Steps 2310-2320 are described in detail below.

[0365] In step 2310, data detection is performed on each metadata block.

[0366] When this embodiment is specifically implemented, for each metadata block, the number of target metadata in the metadata block is obtained, so as to detect the space utilization of the metadata block according to the number of target metadata.

[0367] In step 2320, if it is determined that the target metadata of the metadata block does not reach the preset number, the preset data append interface is called to add the metadata corresponding to the preset supplementary data to the metadata block to update the metadata of the metadata block.

[0368] The preset number is used to indicate the upper limit of the metadata data that can be accommodated in the metadata block.

[0369] The data append interface is an API interface for uploading metadata corresponding to data to be added to the file data of a file to the metadata block of the file.

[0370] The preset supplementary data is used to indicate specific data additionally added to the file data of the target file in the physical data storage space.

[0371] In the specific implementation of this embodiment, first, the number of target metadata of the metadata block is compared with the preset data. Then, if it is determined that the target metadata of the metadata block does not reach the preset number, it indicates that there is free space in the metadata block where the target metadata is located. Therefore, the preset data append interface is called to add metadata corresponding to the specific data (preset supplementary data) additionally added to the file data of the target file in the physical data storage space to the metadata block, so that the metadata block stores two parts of metadata (target metadata and metadata corresponding to the preset supplementary data), thereby realizing the metadata update of the metadata block.

[0372] like Fig.24AAs shown, it is a schematic diagram of the implementation process of appending metadata to the metadata block 4 of file A. Specifically, the file node in the target tree of the file storage architecture corresponds to a file A, wherein the size of file A is 15M. In the physical data storage space, the winning file A is divided into four data segments of 4M each, namely, data segment 1 of 4M, data segment 2 of 4M, data segment 3 of 4M, and data segment 4 of 3M. The metadata corresponding to these four data segments are respectively stored in four different metadata blocks, wherein the metadata corresponding to data segment 1 is stored in metadata block 1; the metadata corresponding to data segment 2 is stored in metadata block 2; the metadata corresponding to data segment 3 is stored in metadata block 3; the metadata corresponding to data segment 4 is stored in metadata block 4. Since the maximum metadata allowed to be stored in each metadata block is 4M, there is a certain amount of free space in metadata block 4. Based on this, a supplementary data (i.e., data segment 5) can be appended to the file data corresponding to file A in the physical data storage space, and the metadata corresponding to data segment 5 can be stored in metadata block 4 in the target tree, so that the storage space of metadata block 4 can be fully utilized. At this time, metadata block 4 has two metadata, namely, the metadata corresponding to data segment 4 and the metadata corresponding to data segment 5.

[0373] The advantage of this embodiment is that, for the metadata blocks of each file in the metadata storage space, a link for detecting the data amount of the metadata blocks is introduced, so that when there is free space in the metadata blocks, the metadata corresponding to the relevant data added to the file data of the file in the physical data storage space can be added to the metadata blocks of the file, thereby achieving full utilization of the metadata storage space and helping to improve the space utilization rate of the metadata storage space.

[0374] In another embodiment, the process of updating the metadata blocks of each file in the metadata storage space includes but is not limited to the following steps:

[0375] In response to a data segmentation request for a target metadata block among the plurality of metadata blocks, data segmentation is performed on the target metadata in the target metadata block, and the correspondence between the segmented target metadata and the candidate data segments is updated.

[0376] The data splitting request is a request generated when each metadata of a file in the metadata storage space is to be split into smaller blocks.

[0377] The target metadata after segmentation is used to indicate the result of data segmentation of the target metadata, wherein the target metadata after segmentation can be regarded as a component of the target metadata.

[0378] The correspondence relationship is used to indicate the one-to-one correspondence between each metadata in the metadata storage space and each data segment in the entity data storage space after data segmentation.

[0379] In the specific implementation of this embodiment, when the object wants to split the metadata of a metadata block of the target file of the metadata storage space into smaller pieces, the object will request data splitting for the target metadata block among the multiple metadata blocks. Based on this, the server will first determine which metadata block to be split according to the data splitting request, and use the metadata block to be split as the target metadata block. Then, according to the splitting requirements of the data splitting request, the target metadata in the target metadata block is data split to obtain at least two split target metadata, and the corresponding relationship between the original target metadata and the candidate data segment is updated so that at least two split target metadata correspond to the same candidate data segment.

[0380] like Fig. 24B As shown, in the metadata storage space, file A corresponds to four metadata, and the four metadata are stored in different metadata blocks, wherein the 4M metadata 2 stored in metadata block 2 corresponds to the data segment 2 in the physical data storage space, and the 4M metadata 3 stored in metadata block 3 corresponds to the data segment 3 in the physical data storage space. Based on this, when the metadata of metadata block 2 and metadata block 3 are to be segmented, the 4M metadata in metadata block 2 is equally divided into two 2M segmented metadata, and the 4M metadata in metadata block 3 is equally divided into two 2M segmented metadata. At this time, the metadata corresponding to file A in the metadata storage space changes from 4 to 6, but the data segments corresponding to file A in the physical data storage space are still 4. Further, the correspondence between metadata and data segments is updated, so that data segment 2 is changed from originally corresponding to one metadata 2 to corresponding to two 2M segmented metadata (the segmentation result of metadata 2), and data segment 3 is changed from originally corresponding to one metadata 2 to corresponding to two 2M segmented metadata (the segmentation result of metadata 3).

[0381] The advantage of this embodiment is that the metadata of each metadata block of the metadata storage space can be freely divided, and the target metadata with a large data volume can be divided into multiple target metadata with relatively small data volumes. This method can divide the file metadata of the target file into finer granularity. At the same time, after the division is completed, the corresponding relationship between the target metadata after the division and the candidate data segment is also updated, which can improve the accuracy of data mapping.

[0382] The following describes implementation details of a storage type change method according to an embodiment of the present disclosure.

[0383] like Fig.25As shown, it is an asynchronous processing process of hitting the target storage type change rule. Specifically, first, the storage type change process is executed in an asynchronous transmission mode. After matching the target storage type change rule pointing to the target file, if the trigger condition of the target storage type change rule is met, the storage type change stage data is set to be changed at the server backend, and the storage type change stage data seen by the user at the front end is set to have been changed. Next, the file type of the target file is determined. When the target file is a standard file or a partition file, it is searched in the target tree to hit the target file node, and the data segment corresponding to the target file node is assigned a change indication (i.e., labeling), wherein the assignment of the change indication specifically includes determining the target file node, determining the corresponding multiple metadata blocks, and labeling the data segment corresponding to the metadata block. Further, after waiting for all data segments corresponding to all target file nodes to be assigned change indications, the storage type change stage data is set to be changing, and its specific process is similar to the above steps 310-320. In addition, when the target file is an MPU file, first search in the target tree to hit the target file node, then determine the partition file corresponding to the MPU file, obtain the file node corresponding to each partition file, set the storage type change stage data of each partition file to pending change, and then assign change instructions to the data segments of each partition file. After all data segments corresponding to a single partition file have been assigned change instructions, the storage type change stage data of the partition file is set to changing. After the storage type change stage data of all partition files is set to changing, the storage type change stage data of the MPU file is set to changing. The specific process is similar to the above steps 1510-1570. To save space, it will not be repeated.

[0384] like Fig.26As shown, it is a specific process of assigning change instructions to each data segment by asynchronous processing. Specifically, when the storage type change stage data is changed from pending to changing, the storage type change stage data seen by the user has become changed, but the backend of the server is executed asynchronously. After the storage type change stage data is set to pending, the data segment corresponding to the file node corresponding to the target file in the target tree is queried, and each data segment is marked in the physical data storage space. Specifically, the file type of the target file is first determined. When the target file is a standard file or a partitioned file, the change instruction is assigned to the data segment corresponding to the target file node, and it is detected whether all the data segments corresponding to all the target file nodes have been assigned the change instruction, and wait for all the data segments corresponding to all the target file nodes to be assigned the change instruction. Then, when all the data segments are marked, the storage type change stage data is changed to changing. In addition, when the target file is an MPU file, the storage type change stage data of the MPU file needs to be converted from pending change to changing. At this time, the storage type of each partition file in the MPU file is changed separately. When all partition files are changed, the storage type change stage data is changed to changing; if some partition files are not changed, all nodes corresponding to the MPU file are marked, and the specific process is similar to the above steps 310-320 and steps 1510-1570. To save space, it will not be repeated.

[0385] The following describes the apparatus and devices of the embodiments of the present disclosure.

[0386] It is to be understood that, although the steps in the above-mentioned flowcharts are sequentially displayed according to the characterization of arrows, these steps are not necessarily executed in sequence according to the order of arrow characterization. Unless there is a clear description in the present embodiment, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the above-mentioned flowcharts can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.

[0387] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to the characteristics of the target object such as the target object attribute information or attribute information set, the permission or consent of the target object will be obtained first, and the collection, use and processing of these data will comply with relevant laws, regulations and standards. In addition, when the embodiment of the present application needs to obtain the attribute information of the target object, the separate permission or separate consent of the target object will be obtained through a pop-up window or jump to a confirmation page. After clearly obtaining the separate permission or separate consent of the target object, the necessary target object-related data used to enable the normal operation of the embodiment of the present application is obtained.

[0388] Fig. 27 The structure diagram of the storage type change device 2700 provided in the embodiment of the present disclosure. The storage type change device 2700 includes:

[0389] A setting unit 2710 is used to respond to a storage type change request for a target file in a physical data storage space, and set the storage type change phase data of the target file as to be changed in a metadata storage space corresponding to the physical data storage space, wherein the target file is divided into a plurality of data segments for storage in the physical data storage space;

[0390] The first change unit 2720 is used to allocate a change indication to each data segment, and set the storage type change phase data of the target file to be changing in the metadata storage space;

[0391] The second changing unit 2730 is used to make each data segment execute the change instruction, and after the change instruction of each data segment is executed, set the storage type change phase data of the target file as changed in the metadata storage space.

[0392] Optionally, the data segment includes a storage type field;

[0393] The second changing unit 2730 is used for:

[0394] After the change instruction of a single data segment is executed, the storage type field of the data segment is set to the target storage type, wherein the target storage type is the storage type to which the storage type change request is to be changed;

[0395] After the storage type fields of each data segment are all the target storage type, the storage type change phase data of the target file is set to changed in the metadata storage space.

[0396] Optionally, the metadata storage space includes a target tree, and each file in the physical data storage space corresponds to a file node in the target tree;

[0397] The setting unit 2710 is used to:

[0398] In the target tree of the metadata storage space, determining a target file node corresponding to the target file;

[0399] Set the storage type change phase data in the target file node to pending change.

[0400] Optionally, the target tree is generated by:

[0401] Get the file storage architecture where the target file in the entity data storage space is located;

[0402] The file storage architecture is used as the root node of the target tree, the folders in the file storage architecture are used as the branch nodes of the target tree, and the files under the folders are used as leaf nodes extending from the branch nodes.

[0403] Optionally, a storage type change request is generated by:

[0404] Acquire multiple candidate storage type change rules for a file storage architecture where a target file in a physical data storage space is located;

[0405] For each candidate storage type change rule, determine the file path pointed to by the candidate storage type change rule in the target tree;

[0406] Determine a target storage type change rule from a plurality of candidate storage type change rules based on the length of each file path;

[0407] If it is determined that the triggering condition of the target storage type change rule is met, a storage type change request is generated, wherein the target file node of the target file belongs to the file path pointed to by the target storage type change rule.

[0408] Optionally, candidate storage type change rules are generated in the following way:

[0409] In response to a rule configuration request for a file storage architecture, obtain rule triggering time and storage type change information;

[0410] Determine the rule-associated file in each file of the file storage architecture, and generate a file path based on the position of the leaf node corresponding to the rule-associated file in the target tree;

[0411] Based on the preset storage type conversion rule, a first verification is performed on the storage type change information;

[0412] If it is determined that the first verification passes, a candidate storage type change rule is generated based on the rule triggering time, the storage type change information, and the file path.

[0413] Optionally, the first changing unit 2720 is used to:

[0414] In the target tree, a plurality of metadata blocks corresponding to the target file node are obtained, wherein the metadata block contains at least one target metadata;

[0415] Acquire a preset mapping table, wherein the preset mapping table includes a plurality of candidate data segments in the physical data storage space and candidate metadata corresponding to each candidate data segment in the metadata storage space;

[0416] For each metadata block, compare the target metadata with each candidate metadata in a preset mapping table;

[0417] Determine the candidate data segment corresponding to the candidate metadata consistent with the target metadata as the target data segment, wherein the target data segment is the data segment into which the target file is segmented;

[0418] Based on the storage type to which the storage type change request is to be changed, a change indication is generated, and the change indication is allocated to each target data segment.

[0419] Optionally, the plurality of candidate data segments in the entity data storage space are generated in the following manner:

[0420] Obtain multiple candidate file storage architectures;

[0421] For each candidate file storage architecture, the candidate file is divided into a predetermined size to obtain a plurality of file data blocks;

[0422] A file data block is taken as a candidate data segment, and multiple candidate data segments are stored in a preset storage bucket of the physical data storage space.

[0423] Optionally, the storage type changing device 2700 further includes a calling unit (not shown), and the calling unit (not shown) is used to:

[0424] Obtain a data acquisition request for the metadata storage space;

[0425] Performing protocol conversion on the data acquisition request based on a preset protocol conversion interface to obtain a converted acquisition request;

[0426] Based on the converted acquisition request, the metadata in the metadata storage space is called through a preset data access interface.

[0427] Optionally, the target tree is stored in a target sub-storage space of the metadata storage space;

[0428] The storage type changing device 2700 further includes an acquisition unit (not shown), which is used to:

[0429] In response to a metadata access request for a file storage architecture where a target file is located, obtaining an architecture index of the file storage architecture;

[0430] Based on the architecture index, data query is performed through the preset data management interface to obtain the storage location of the target tree in the target sub-storage space;

[0431] Based on the storage location, the target tree is called through a preset data access interface to obtain the file metadata in the target tree.

[0432] Optionally, the first changing unit 2720 is used to:

[0433] If the type of the target file is the first type, then in the target tree, multiple file subnodes extending from the target file node are obtained, wherein the first type is used to indicate that the target file includes multiple partition files, and each partition file has a corresponding file subnode in the target tree;

[0434] For each file subnode, in the target tree, multiple metadata blocks of the file subnode are obtained, wherein the metadata block includes at least one target metadata;

[0435] Acquire a preset mapping table, wherein the preset mapping table includes a plurality of candidate data segments in the physical data storage space and candidate metadata corresponding to each candidate data segment in the metadata storage space;

[0436] For each metadata block, compare the target metadata with each candidate metadata in a preset mapping table;

[0437] Determine the candidate data segments corresponding to the candidate metadata consistent with the target metadata as intermediate data segments, wherein the intermediate data segments are the data segments into which the partition file is segmented;

[0438] Integrate the multiple intermediate data segments into a target data segment, wherein the target data segment is the data segment into which the target file is segmented;

[0439] Based on the storage type to which the storage type change request is to be changed, a change indication is generated, and the change indication is allocated to each target data segment.

[0440] Optionally, the second changing unit 2730 is used to:

[0441] After the change instructions of each data segment of a single partition file are executed, the storage type change phase data of the partition file is set to changed in the metadata storage space;

[0442] After the storage type change phase data of each partition file is changed, the storage type change phase data of the target file is set to changed in the metadata storage space.

[0443] Optionally, the storage type changing device 2700 further includes a display unit (not shown), and the display unit (not shown) is used to:

[0444] In response to a request to obtain the state of the storage type change stage data for the target file, the state of the storage type change stage data is displayed as changed.

[0445] Optionally, multiple metadata blocks corresponding to the target file node are updated in the following manner:

[0446] For each metadata block, performing data detection on the metadata block;

[0447] If it is determined that the target metadata of the metadata block does not reach the preset number, the preset data append interface is called to add the metadata corresponding to the preset supplementary data to the metadata block to update the metadata of the metadata block.

[0448] Optionally, multiple metadata blocks corresponding to the target file node are updated in the following manner:

[0449] In response to a data segmentation request for a target metadata block among the plurality of metadata blocks, data segmentation is performed on the target metadata in the target metadata block, and the correspondence between the segmented target metadata and the candidate data segments is updated.

[0450] Reference Fig.28 , Fig.28 The structural block diagram of the terminal part for implementing the storage type change method of the embodiment of the present disclosure is as follows: the terminal includes: a radio frequency (RF) circuit 2810, a memory 2815, an input unit 2830, a display unit 2840, a sensor 2850, an audio circuit 2860, a wireless fidelity (WiFi) module 2870, a processor 2880, and a power supply 2890. Those skilled in the art can understand that Fig.28 The terminal structure shown does not constitute a limitation on the mobile phone or computer, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0451] The RF circuit 2810 may be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information from the base station, it is sent to the processor 2880 for processing; in addition, the designed uplink data is sent to the base station.

[0452] The memory 2815 may be used to store software programs and modules. The processor 2880 executes various functional applications and data processing of the target terminal by running the software programs and modules stored in the memory 2815 .

[0453] The input unit 2830 may be used to receive input digital or character information and generate key signal input related to the setting and function control of the target terminal. Specifically, the input unit 2830 may include a touch panel 2231 and other input devices 2832.

[0454] The display unit 2840 may be used to display input information or provided information and various menus of the target terminal. The display unit 2840 may include a display panel 2841.

[0455] The audio circuit 2860, the speaker 2861, and the microphone 2862 may provide an audio interface.

[0456] In this embodiment, the processor 2880 included in the terminal can execute the storage type changing method of the previous embodiment.

[0457] The terminals of the embodiments of the present disclosure include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc. The embodiments of the present invention can be applied to various scenarios, including but not limited to data security, blockchain, data storage, information technology, etc.

[0458] Fig.29 A block diagram of the structure of a portion of a server for implementing the storage type change method of an embodiment of the present disclosure. The server may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPUs) 2922 (for example, one or more processors) and memories 2932, and one or more storage media 2930 (for example, one or more mass storage devices) storing application programs 2942 or data 2944. Among them, the memories 2932 and the storage media 2930 may be short-term storage or permanent storage. The program stored in the storage medium 2930 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 2922 may be configured to communicate with the storage medium 2930 and execute a series of instruction operations in the storage medium 2930 on the server.

[0459] The server may also include one or more power supplies 2923, one or more wired or wireless network interfaces 2950, ​​one or more input and output interfaces 2958, and / or one or more operating systems 2941, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0460] The central processor 2922 in the server can be used to execute the storage type changing method of the embodiment of the present disclosure.

[0461] The embodiments of the present disclosure further provide a computer-readable storage medium, which is used to store program codes, and the program codes are used to execute the storage type changing methods of the aforementioned embodiments.

[0462] The embodiment of the present disclosure further provides a computer program product, which includes a computer program. A processor of a computer device reads and executes the computer program, so that the computer device executes and implements the above storage type change method.

[0463] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present disclosure 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 disclosure described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "comprises" and "comprising" 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.

[0464] It should be understood that in the present disclosure, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0465] It should be understood that in the description of the embodiments of the present disclosure, the meaning of multiple (or multiple items) is more than two, greater than, less than, exceed, etc. are understood as not including the number, and above, below, within, etc. are understood as including the number.

[0466] In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0467] In the embodiments of the present disclosure, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0468] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0469] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0470] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.

[0471] It should also be understood that the various implementations provided in the embodiments of the present disclosure can be combined arbitrarily to achieve different technical effects.

[0472] The above is a specific description of the implementation methods of the present disclosure, but the present disclosure is not limited to the above implementation methods. Technical personnel familiar with the art can also make various equivalent modifications or substitutions without violating the spirit of the present disclosure. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present disclosure.

Claims

1. A method for changing a storage type, characterized in that: The method comprises: In response to a storage type change request for a target file in a physical data storage space, setting storage type change phase data of the target file to be changed in a metadata storage space corresponding to the physical data storage space, wherein the target file is divided into a plurality of data segments for storage in the physical data storage space, the metadata storage space includes a target tree, and each file in the physical data storage space corresponds to a file node in the target tree; Allocating a change indication to each of the data segments, and setting the storage type change phase data of the target file as being changed in the metadata storage space; causing each of the data segments to execute the change instruction, and after the change instruction of each of the data segments is executed, setting the storage type change phase data of the target file as changed in the metadata storage space; The allocating a change indication to each data segment comprises: If the type of the target file is the first type, then in the target tree, a plurality of file sub-nodes extending from the target file node corresponding to the target file are obtained, wherein the first type is used to indicate that the target file includes a plurality of partition files, and each of the partition files has a corresponding file sub-node in the target tree; For each of the file subnodes, in the target tree, a plurality of metadata blocks of the file subnode are obtained, wherein the metadata block includes at least one target metadata; Acquire a preset mapping table, wherein the preset mapping table includes a plurality of candidate data segments in the physical data storage space and candidate metadata corresponding to each of the candidate data segments in the metadata storage space; For each metadata block, comparing the target metadata with each candidate metadata in the preset mapping table; Determine the candidate data segment corresponding to the candidate metadata consistent with the target metadata as an intermediate data segment, wherein the intermediate data segment is the data segment into which the partition file is segmented; Integrate the plurality of intermediate data segments into a target data segment, wherein the target data segment is the data segment into which the target file is segmented; Based on the storage type to which the storage type change request is to be changed, a change indication is generated, and the change indication is allocated to each of the target data segments.

2. The method according to claim 1, characterized in that: The data segment includes a storage type field; After the change instructions of each of the data segments are executed, setting the storage type change phase data of the target file as changed in the metadata storage space includes: After the change instruction of the single data segment is executed, the storage type field of the data segment is set to a target storage type, wherein the target storage type is the storage type to which the storage type change request is to be changed; After the storage type fields of the respective data segments are all the target storage type, the storage type change phase data of the target file is set as changed in the metadata storage space.

3. The method according to claim 1, characterized in that The step of setting the storage type change phase data of the target file to be changed in the metadata storage space corresponding to the physical data storage space includes: In the target tree of the metadata storage space, determining a target file node corresponding to the target file; The storage type change phase data in the target file node is set to be changed.

4. The method according to claim 3, characterized in that The target tree is generated in the following way: Obtain the file storage architecture where the target file is located in the physical data storage space; The file storage architecture is used as the root node of the target tree, the folders in the file storage architecture are used as branch nodes of the target tree, and the files under the folders are used as leaf nodes extending from the branch nodes.

5. The method according to claim 3, characterized in that: The storage type change request is generated in the following manner: Acquire multiple candidate storage type change rules for the file storage architecture where the target file in the physical data storage space is located; For each of the candidate storage type change rules, determining in the target tree a file path pointed to by the candidate storage type change rule; Determining a target storage type change rule from among the plurality of candidate storage type change rules based on the lengths of the respective file paths; If it is determined that the triggering condition of the target storage type change rule is met, the storage type change request is generated, wherein the target file node of the target file belongs to the file path pointed to by the target storage type change rule.

6. The method according to claim 5, characterized in that The candidate storage type change rule is generated in the following manner: In response to a rule configuration request for the file storage architecture, obtaining rule triggering time and storage type change information; Determine a rule-associated file in each file of the file storage architecture, and generate a file path based on the position of a leaf node corresponding to the rule-associated file in the target tree; Based on a preset storage type conversion rule, performing a first verification on the storage type change information; If it is determined that the first verification passes, the candidate storage type change rule is generated based on the rule triggering time, the storage type change information, and the file path.

7. The method according to claim 3, characterized in that The allocating a change indication to each data segment comprises: In the target tree, a plurality of metadata blocks corresponding to the target file node are obtained, wherein the metadata block contains at least one target metadata; Acquire a preset mapping table, wherein the preset mapping table includes a plurality of candidate data segments in the physical data storage space and candidate metadata corresponding to each of the candidate data segments in the metadata storage space; For each metadata block, comparing the target metadata with each candidate metadata in the preset mapping table; Determine the candidate data segment corresponding to the candidate metadata consistent with the target metadata as the target data segment, wherein the target data segment is the data segment into which the target file is segmented; Based on the storage type to which the storage type change request is to be changed, a change indication is generated, and the change indication is allocated to each of the target data segments.

8. The method according to claim 7, characterized in that The multiple candidate data segments in the entity data storage space are generated in the following manner: Obtain multiple candidate file storage architectures; For each candidate file of the candidate file storage architecture, the candidate file is divided according to a predetermined size to obtain a plurality of file data blocks; One of the file data blocks is used as a candidate data segment, and a plurality of the candidate data segments are stored in a preset storage bucket of the physical data storage space.

9. The method according to claim 7, characterized in that: After storing the plurality of candidate data segments in a preset storage bucket of the physical data storage space, the storage type changing method further includes: Obtaining a data acquisition request for the metadata storage space; Performing protocol conversion on the data acquisition request based on a preset protocol conversion interface to obtain a converted acquisition request; Based on the converted acquisition request, the metadata in the metadata storage space is called through a preset data access interface.

10. The method according to claim 7, characterized in that The target tree is stored in the target sub-storage space of the metadata storage space; After storing the plurality of candidate data segments in a preset storage bucket of the physical data storage space, the storage type changing method further includes: In response to a metadata access request for a file storage architecture where the target file is located, obtaining an architecture index of the file storage architecture; Based on the architecture index, data query is performed through a preset data management interface to obtain the storage location of the target tree in the target sub-storage space; Based on the storage location, the target tree is called through a preset data access interface to obtain file metadata in the target tree.

11. The method according to claim 1, characterized in that: After the change instructions of each of the data segments are executed, setting the storage type change phase data of the target file as changed in the metadata storage space includes: After the change instructions of the data segments of a single partition file are executed, setting the storage type change phase data of the partition file to changed in the metadata storage space; After the storage type change phase data of each of the partition files is changed, the storage type change phase data of the target file is set as changed in the metadata storage space.

12. The method according to claim 1, characterized in that After setting the storage type change phase data of the target file to be changed, the storage type change method further includes: In response to a request to obtain the status of the storage type change stage data for the target file, the status of the storage type change stage data is displayed as changed.

13. A storage type changing device, characterized in that: The device comprises: A setting unit is configured to respond to a storage type change request for a target file in a physical data storage space, and set the storage type change phase data of the target file to be changed in a metadata storage space corresponding to the physical data storage space, wherein the target file is divided into a plurality of data segments for storage in the physical data storage space, the metadata storage space includes a target tree, and each file in the physical data storage space corresponds to a file node in the target tree; A first changing unit, configured to allocate a change indication to each of the data segments, and set the storage type change phase data of the target file as being changed in the metadata storage space; A second changing unit, configured to make each of the data segments execute the change instruction, and after the change instruction of each of the data segments is executed, set the storage type change phase data of the target file as changed in the metadata storage space; The allocating a change indication to each data segment comprises: If the type of the target file is the first type, then in the target tree, a plurality of file sub-nodes extending from the target file node corresponding to the target file are obtained, wherein the first type is used to indicate that the target file includes a plurality of partition files, and each of the partition files has a corresponding file sub-node in the target tree; For each of the file subnodes, in the target tree, a plurality of metadata blocks of the file subnode are obtained, wherein the metadata block includes at least one target metadata; Acquire a preset mapping table, wherein the preset mapping table includes a plurality of candidate data segments in the physical data storage space and candidate metadata corresponding to each of the candidate data segments in the metadata storage space; For each metadata block, comparing the target metadata with each candidate metadata in the preset mapping table; Determine the candidate data segment corresponding to the candidate metadata consistent with the target metadata as an intermediate data segment, wherein the intermediate data segment is the data segment into which the partition file is segmented; Integrate the plurality of intermediate data segments into a target data segment, wherein the target data segment is the data segment into which the target file is segmented; Based on the storage type to which the storage type change request is to be changed, a change indication is generated, and the change indication is allocated to each of the target data segments.

14. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the storage type changing method according to any one of claims 1 to 12 is implemented.

15. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the storage type changing method according to any one of claims 1 to 12 is implemented.

16. A computer program product, comprising a computer program, wherein the computer program is read and executed by a processor of an electronic device, so that the electronic device executes the storage type changing method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Method and device for managing disk file

    CN105808620A

  • System for importing data into a data repository

    CN109997125A

  • Hard disk migration method, distributed storage cluster system and storage medium

    CN111880751A

  • Monitoring data migration method and system in multi-service cluster scene

    CN116582453A

  • Data migration method and related device

    CN117234412A