A database implementation of virtual directory metadata
By creating two tables, Objects and Details, and optimizing the index, the problems of high complexity and low retrieval efficiency in virtual directory metadata management under the traditional linked list structure are solved, achieving efficient file operations and data consistency management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 深圳市宇泰科技有限公司
- Filing Date
- 2026-03-04
- Publication Date
- 2026-06-23
AI Technical Summary
When storing virtual directory metadata using traditional linked list structures, file addition, deletion, and movement operations are complex, retrieval efficiency is low, multi-dimensional queries and tree-structure representation cannot be directly supported, and data consistency maintenance costs are high.
Using a structured design, two tables, Objects and Details, are created. Details stores the physical path and attributes of files, while Objects stores the virtual path and is associated with Details. Files are received and uploaded to the real directory via API. The index is optimized and invalid records are cleaned up regularly to achieve efficient management of file metadata.
It breaks through the performance bottleneck of traditional linked list storage, supports fast path matching and attribute retrieval, reduces the complexity of file operations, ensures data consistency, improves retrieval efficiency, and significantly improves file management efficiency.
Smart Images

Figure CN122262084A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of software technology, specifically relating to a database implementation method for virtual directory metadata. Background Technology
[0002] As an abstraction layer of the physical file system, the server virtual directory decouples the user access path from the actual storage location through a mapping mechanism. This allows users to complete access operations without knowing the exact location of files on the server, significantly improving the convenience and security of data management. However, traditional solutions use a linked list structure to store virtual directory metadata, which has significant performance bottlenecks: file addition, deletion, and movement operations require traversing linked list nodes and adjusting pointers, causing the operation complexity to increase exponentially with the depth of the directory hierarchy; file retrieval requires sequential scanning of the linked list, with an average time complexity of O(n), which is difficult to meet the real-time requirements of high-concurrency scenarios. In existing technologies, the physical storage continuity of the linked list structure is poor, resulting in low disk I / O efficiency; its unidirectional linked nature cannot directly support multi-dimensional retrieval. If it is necessary to query by attributes such as file type and modification time, an additional auxiliary index structure needs to be built. More importantly, the linked list nodes only store unidirectional parent-child relationships, which cannot fully express the tree structure of the virtual directory. This results in the need to recursively traverse the entire linked list when copying files across directories, leading to high costs for maintaining data consistency. Existing technologies suffer from drawbacks such as high operational complexity and low retrieval efficiency due to the use of linked list structures to store virtual directory metadata. Summary of the Invention
[0003] To address the aforementioned issues, this invention provides a database implementation method for virtual directory metadata. This method solves the problems of complex file addition, deletion, and movement operations, low retrieval efficiency, inability to directly support multi-dimensional queries and tree-structured representations, and high data consistency maintenance costs associated with traditional linked list structures for storing virtual directory metadata. To achieve the above objectives, this invention adopts the following technical solution: The database implementation method for virtual directory metadata includes the following steps: Using a structured design, two tables, Objects and Details, are created. Details stores the physical path and attributes of files, while Objects stores the virtual path and is associated with Details, resulting in a basic table structure. Files are received via API, uploaded to the real directory, and a record is added to the Details table to obtain the ID. The virtual directory ID is queried from the Objects table, and a file record is added to the Objects table to obtain the uploaded file metadata record. The source file ID is retrieved from the Objects table, a virtual directory record is added to the Objects table, and the ID is obtained. A copied file record is added to the Objects table to obtain the copied file metadata record. The target virtual directory ID is retrieved by querying the Objects table. Records including the ID are retrieved, and their Details_IDs are extracted. The actual file information is obtained from the Details table to obtain the file details within the directory. The ID of the file to be deleted is retrieved from the Objects table. The number of records corresponding to the ID is checked. If there is only one record, the Details record and the actual file are deleted, resulting in the database state after the deletion operation. The Path field of the Objects table and the indexes of commonly used fields in the Details table are periodically analyzed to optimize the indexes and improve query efficiency. Invalid records are periodically cleaned up, and data is backed up to obtain the database of virtual directory metadata.
[0004] Furthermore, the structured design involves creating two tables, Objects and Details. Details stores the physical paths and attributes of files, while Objects stores virtual paths and is associated with Details, resulting in the basic table structure. This includes the following steps: extracting information through requirement analysis to determine the physical paths, attributes, and virtual paths of files that need to be stored; acquiring the data and creating the Details table to store the physical paths and attributes of files; creating the Objects table to store virtual paths, and establishing an association between the Objects and Details tables so that each virtual path corresponds to a physical path and attribute record in the Details table, thus obtaining the basic table structure and achieving effective management of virtual paths, physical paths, and attributes of files.
[0005] Furthermore, the process of receiving files via API, uploading them to the real directory, adding a record to the Details table to obtain the ID, querying the virtual directory ID in the Objects table, adding a file record to the Objects table, and obtaining the uploaded file metadata record includes the following steps: receiving the uploaded file using the API interface, uploading the file to the server's real directory via system calls, and extracting the file's physical path and attribute information in the real directory; adding a new record to the Details table to store the file path and attributes, and the unique ID of the new record; querying the Objects table to extract the record ID matching the target virtual directory path, and combining the obtained Details table ID with the virtual directory ID; adding a new record to the Objects table, associating the file with the specified virtual directory, and obtaining the complete metadata record of the file in the virtual directory.
[0006] Furthermore, the process of querying the Objects table to obtain the source file ID, adding a virtual directory record to the Objects table, obtaining the ID, adding a copied file record to the Objects table, and obtaining the copied file metadata record includes the following steps: retrieving the Objects table, extracting its unique ID by matching the source file path, and inserting the target virtual directory path as a new record into the Objects table; obtaining the automatically generated ID, combining the virtual directory ID with the source file ID through a concatenation operation to generate the associated ID of the copied file in the Objects table; inserting the associated ID and the source file's Details table ID together to form a new record into the Objects table, completing the file copying relationship mapping, and obtaining a complete metadata record of the copied file containing virtual directory ownership information.
[0007] Furthermore, the step of obtaining the target virtual directory ID by querying the Objects table, retrieving records including the ID, extracting the Details_ID of these records, and obtaining the actual file information from the Details table to obtain the file details within the directory includes the following steps: retrieving the Objects table using a query operation, locating the target virtual directory by path matching, and extracting the IDs of all records under the directory; for each record, extracting the associated Details_ID field value, using the extracted Details_ID as a query condition, and obtaining detailed information about the corresponding file's actual path, attributes, and MD5 value from the Details table; and by integrating the records in the Objects table with the query results in the Details table, associating the virtual directory structure with the file physical information to obtain a complete list of file details within the target virtual directory.
[0008] Furthermore, the process of querying the Objects table to obtain the ID of the file to be deleted, checking the number of records corresponding to the ID, and deleting the Details record and the actual file to obtain the database status after the deletion operation includes the following steps: retrieving the Objects table using a query operation, extracting the unique ID of the file to be deleted by matching the file path, and making a conditional judgment by counting the number of associated records of the unique ID in the Objects table; when the number of records is one, extracting its Details_ID field value, deleting the corresponding record in the Details table, and deleting the file entity in the server's actual directory through a system call; completing the synchronous deletion at the data layer and physical layer, querying the two tables to verify data consistency, and obtaining the database status after the deletion operation.
[0009] Furthermore, the process of periodically analyzing the indexes of the Path field in the Objects table and the commonly used fields in the Details table, optimizing the indexes to improve query efficiency, periodically cleaning up invalid records, and backing up data to obtain the database of virtual directory metadata includes the following steps: Extracting query frequency data for the Path field in the Objects table and the commonly used fields in the Details table through monitoring; optimizing the index structure based on the analysis results; creating composite indexes for high-frequency query fields to improve retrieval efficiency; identifying and cleaning up redundant Objects data without corresponding Details records by scanning the relationship between the two tables; performing a full data backup to an independent storage medium; and verifying the backup integrity; and synchronizing the optimized index structure and the cleaned database to the production environment to obtain the database of virtual directory metadata.
[0010] Furthermore, the step of analyzing requirements to extract information and determining the physical path, attributes, and virtual path data of the files to be stored includes the following steps: Using a requirements analysis method, by studying the functional requirements of the virtual directory service, core data elements for file management are extracted, and the absolute path and file attribute information of the files in the physical storage medium are obtained; the virtual path structure data required for user access is extracted, including directory hierarchy relationships and access permission identifiers; the physical path, file attributes, and virtual path are mapped to a data structure, and a dual-table association model is determined; physical storage and logical access are decoupled through unique identifiers; and through the above analysis, a metadata storage design specification that meets the requirements of the virtual directory service is obtained.
[0011] Furthermore, the retrieval of the Objects table, which involves extracting the unique ID of the source file by matching the source file path and inserting the target virtual directory path as a new record into the Objects table, includes the following steps: Using a database retrieval operation, a path matching query is performed in the Objects table to extract the unique ID of the record that is completely identical to the source file path; the target virtual directory path is inserted as a new data item into the Path field of the Objects table, generating a new record ID containing an auto-incrementing sequence number; the new record ID is hierarchically concatenated with the source file ID through an association mechanism to form a complete directory tree structure identifier; the concatenated ID is used as a foreign key to associate with the corresponding record in the Details table, obtaining the complete metadata mapping relationship of the source file under the target virtual directory.
[0012] In the technical solution provided by this invention, a structured design is adopted, creating two tables: Objects and Details. Details stores the physical path and attributes of files, while Objects stores the virtual path and is associated with Details, resulting in the basic table structure. Files are received via API, uploaded to the real directory, and a record is added to the Details table to obtain the ID. The virtual directory ID is then queried from the Objects table, and a file record is added to the Objects table, resulting in the uploaded file metadata record. The source file ID is retrieved from the Objects table, a virtual directory record is added to the Objects table, and the ID is obtained. A copied file record is then added to the Objects table, resulting in the copied file metadata record. The target virtual directory ID is retrieved by querying the Objects table, records including the ID are retrieved, and the Details_ID of these records is extracted. The actual file information is obtained from the Details table, resulting in the file details within the directory. The ID of the file to be deleted is retrieved from the Objects table, and the number of records corresponding to the ID is checked. If there is only one record, the Details record and the actual file are deleted, resulting in the database status after the deletion operation. The Path field of the Objects table and the indexes of commonly used fields in the Details table are analyzed periodically to optimize the indexes and improve query efficiency. Invalid records are periodically cleaned up, and data is backed up, resulting in the database of virtual directory metadata. Attached Figure Description
[0013] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention.
[0014] Figure 1 This is a schematic diagram of the first embodiment of a database implementation method for virtual directory metadata in this invention.
[0015] Figure 2This is a schematic diagram of a second embodiment of a database implementation method for virtual directory metadata in this invention.
[0016] Figure 3 This is a schematic diagram of a third embodiment of a database implementation method for virtual directory metadata in this invention.
[0017] Figure 4 This is a schematic diagram of the fourth embodiment of a database implementation method for virtual directory metadata in this invention.
[0018] Figure 5 This is a schematic diagram of the fifth embodiment of a database implementation method for virtual directory metadata in this invention. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0020] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0021] A database implementation method for virtual directory metadata, such as Figure 1As shown, the process includes the following steps: Using a structured design, two tables, Objects and Details, are created. Details stores the physical path and attributes of files, while Objects stores the virtual path and is associated with Details, resulting in the basic table structure. Files are received via API, uploaded to the real directory, and a record is added to the Details table to obtain the ID. The virtual directory ID is then queried from the Objects table, and a file record is added to the Objects table, resulting in the uploaded file metadata record. The source file ID is retrieved from the Objects table, a virtual directory record is added to the Objects table, and the ID is obtained. A copied file record is added to the Objects table, resulting in the copied file metadata record. The target virtual directory ID is retrieved by querying the Objects table, records including the ID are retrieved, and the Details_ID of these records is extracted. The actual file information is obtained from the Details table, resulting in the file details within the directory. The file ID to be deleted is retrieved from the Objects table, and the number of records corresponding to the ID is checked. If there is only one record, the Details record and the actual file are deleted, resulting in the database status after the deletion operation. The Path field of the Objects table and the indexes of commonly used fields in the Details table are periodically analyzed to optimize indexes and improve query efficiency. Invalid records are periodically cleaned up, and data is backed up, resulting in the database containing the virtual directory metadata.
[0022] like Figure 2 As shown, in this embodiment, by analyzing the requirements and extracting information, the physical path, attributes, and virtual path data of the files to be stored are determined; the data is acquired, and a Details table is created to store the physical path and attributes of the files; an Objects table is created to store the virtual paths, and a relationship is established between the Objects table and the Details table, so that the physical path and attributes of each virtual path in the Objects table are recorded in the Details table, thus obtaining the basic table structure and realizing the effective management of virtual paths, file physical paths, and attributes.
[0023] By constructing a dual-table association model through structured design, efficient management of virtual directory metadata is achieved. In terms of performance, file physical paths and attributes are centrally stored in the Details table, while virtual paths are independently stored in the Objects table and linked via foreign keys, resulting in a clear and highly scalable data structure. In terms of functionality, the design overcomes the performance bottleneck of traditional linked list storage, supporting fast path matching and attribute retrieval, reducing file operation complexity from O(n) to O(1); simultaneously, a transaction mechanism ensures data consistency, guaranteeing that physical files are updated synchronously when virtual paths change.
[0024] like Figure 3As shown, in this embodiment, an API interface is used to receive uploaded files, and the files are uploaded to the server's real directory through system calls. The physical path and attribute information of the files in the real directory are extracted. A new record is added to the Details table to store the file path and attributes, as well as the unique ID of the new record. The Objects table is queried to extract the record ID that matches the target virtual directory path. The obtained Details table ID is combined with the virtual directory ID. A new record is added to the Objects table to associate the file with the specified virtual directory, thus obtaining the complete metadata record of the file in the virtual directory.
[0025] The API interface receives uploaded files, offering convenient and efficient operation, and quickly uploads files to the server's real directory. The physical path and attributes of the files are extracted and stored in the Details table for precise management of basic file information. After obtaining a unique ID, a record ID matching the virtual directory path is associated with it, and a record is added to the Objects table to associate the file with the specified virtual directory, thus fully constructing the file metadata. This process automates the management of files from upload to virtual directory association, facilitating file classification, retrieval, and access, and improving the efficiency and accuracy of system file management.
[0026] like Figure 4 As shown, in this embodiment, the Objects table is retrieved, and its unique ID is extracted by matching the source file path. The target virtual directory path is then inserted into the Objects table as a new record. An automatically generated ID is obtained, and the virtual directory ID is combined with the source file ID through a concatenation operation to generate the associated ID of the copied file in the Objects table. The associated ID and the source file's Details table ID are combined to form a new record and inserted into the Objects table, completing the file copying relationship mapping and obtaining a complete metadata record of the copied file containing virtual directory ownership information.
[0027] By retrieving the Objects table and matching the source file path to extract a unique ID, the source file can be accurately located. The target virtual directory path is then inserted to form a new record, and an automatically generated ID is obtained, laying the foundation for subsequent association operations. A connection ID is cleverly established by concatenating the virtual directory ID and the source file ID. Inserting the new record completes the file copy relationship mapping, resulting in a complete metadata record containing virtual directory ownership information. This process achieves efficient file copy management under virtual directories, ensuring accurate data association.
[0028] like Figure 5As shown, in this embodiment, a query operation is used to retrieve the Objects table, the target virtual directory is located by path matching, and the IDs of all records in the directory are extracted. For each record, the associated Details_ID field value is extracted, and the extracted Details_ID is used as a query condition to obtain detailed information about the real path, attributes, and MD5 value of the corresponding file in the Details table. By integrating the records in the Objects table and the query results in the Details table, the virtual directory structure is associated with the physical information of the files to obtain a complete list of file details in the target virtual directory.
[0029] By querying the Objects table and matching paths to locate the target virtual directory, a specific range can be quickly and accurately pinpointed. Extracting the IDs of all records within the directory provides guidance for obtaining detailed file information. Querying the Details table using the associated Details_ID allows for comprehensive access to key information such as the file's actual path, attributes, and MD5 value. Finally, integrating the results from both tables tightly links the virtual directory structure with the file's physical information, generating a complete list of file details within the target virtual directory. This greatly facilitates the unified management and viewing of files within virtual directories, improving the accuracy and efficiency of file information processing.
[0030] In this embodiment, a query operation is used to retrieve the Objects table, and the unique ID of the file to be deleted is extracted by matching the file path. The condition is judged by counting the number of associated records of the unique ID in the Objects table. When there is only one record, its Details_ID field value is extracted, the corresponding record is deleted in the Details table, and the file entity in the actual directory of the server is deleted by system call. The data layer and physical layer are deleted synchronously. The two tables are queried to verify the data consistency and obtain the database status after the deletion operation.
[0031] By querying the Objects table and matching paths to extract the unique ID of the file to be deleted, the target file can be accurately located. Counting the number of related records for conditional judgment avoids accidental deletion and ensures data security. When the number of records is zero, the Details_ID is extracted and the corresponding record is deleted, simultaneously deleting the actual file entity on the server. This achieves synchronized cleanup at the data and physical layers, ensuring data integrity. Finally, querying both tables verifies consistency and promptly identifies potential problems. This embodiment standardizes the file deletion process and effectively prevents data residue and corruption.
[0032] In this embodiment, query frequency data of the Path field in the Objects table and commonly used fields in the Details table are monitored and extracted. Based on the analysis results, the index structure is optimized, and a composite index is built for the high-frequency query fields to improve retrieval efficiency. By scanning the relationship between the two tables, redundant Objects data without corresponding Details records is identified and cleaned up. A full data backup is performed to an independent storage medium to verify the integrity of the backup. The optimized index structure and the cleaned database are synchronized to the production environment to obtain the database of virtual directory metadata.
[0033] By monitoring the query frequency data of the two tables and optimizing the index structure accordingly, composite indexes were created for frequently queried fields, significantly improving retrieval efficiency and making data queries faster and more accurate. The join relationships between the two tables were scanned to clean up redundant Objects data without corresponding Details records, effectively freeing up storage space and improving database performance. A full data backup was performed to independent media and its integrity was verified, providing double insurance for data security. Finally, the optimized and cleaned database was synchronized to the production environment, resulting in a more efficient and cleaner virtual directory metadata database.
[0034] In this embodiment, a requirements analysis method is adopted. By studying the functional requirements of the virtual directory service, core data elements of file management are extracted, and the absolute path and file attribute information of the file in the physical storage medium are obtained. The virtual path structure data required for user access is extracted. The virtual path structure data includes directory hierarchy and access permission identifiers. The physical path, file attributes and virtual path are mapped to the data structure to determine the use of a dual-table association model. The physical storage and logical access are decoupled through a unique identifier. Through the above analysis, a metadata storage design specification that meets the requirements of the virtual directory service is obtained.
[0035] By employing requirements analysis methods, we precisely studied the functional requirements of the virtual directory service, comprehensively extracted core data elements for file management, and clearly grasped the key information regarding physical file storage. Simultaneously, we extracted the virtual path structure data required for user access, laying the foundation for constructing a reasonable access system. We mapped the physical and virtual paths using data structures and determined a dual-table association model, using unique identifiers to decouple physical storage from logical access, effectively solving the correspondence problem between the two. The resulting metadata storage design specifications provide a scientific and reasonable storage architecture for the virtual directory service.
[0036] In this embodiment, a database retrieval operation is used. By performing a path matching query in the Objects table, a unique ID of the record that is completely consistent with the source file path is extracted. The target virtual directory path is used as a new data item and inserted into the Path field of the Objects table to generate a new record ID containing an auto-incrementing sequence number. The new record ID and the source file ID are hierarchically concatenated through an association mechanism to form a complete directory tree structure identifier. The concatenated ID is used as a foreign key to associate with the corresponding record in the Details table to obtain the complete metadata mapping relationship of the source file under the target virtual directory.
[0037] By performing path matching queries on the Objects table, records matching the source file path can be accurately located, and unique IDs can be obtained, providing accurate basis for subsequent operations. Inserting the target virtual directory path generates a new record ID, enriching the directory information. A hierarchical concatenation mechanism is used to construct a directory tree structure identifier by combining the old and new record IDs, and this structure is used as a foreign key to link to the Details table, cleverly building a complete metadata mapping relationship between the source file and the target virtual directory. This method achieves efficient management and accurate location of files in the virtual directory, improving the logic and systematic nature of data processing.
[0038] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples and are not intended to limit the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. A database implementation method for virtual directory metadata, characterized in that, The database implementation method for the virtual directory metadata includes the following steps: Using a structured design, two tables, Objects and Details, are created. Details stores the physical path and attributes of the files, while Objects stores the virtual path and is associated with Details, resulting in the basic table structure. The system receives files via API, uploads them to the real directory, adds a record to the Details table to obtain the ID, queries the virtual directory ID in the Objects table, adds a file record to the Objects table, and obtains the uploaded file metadata record. Query the Objects table to get the source file ID, add a virtual directory record to the Objects table, get the ID, add a copy file record to the Objects table, and get the copy file metadata record; The target virtual directory ID is obtained by querying the Objects table. The retrieval includes records with IDs. The Details_ID of these records is extracted, and the actual file information is obtained from the Details table to obtain the file details in the directory. Query the Objects table to get the ID of the file to be deleted, check the number of records corresponding to the ID, and if there is only one record, delete the Details record and the actual file to get the database status after the deletion operation; Regularly analyze the indexes of the Path field in the Objects table and the commonly used fields in the Details table, optimize the indexes to improve query efficiency, regularly clean up invalid records, back up data, and obtain the database of virtual directory metadata.
2. The database implementation method for virtual directory metadata according to claim 1, characterized in that, The method employs a structured design, creating two tables: Objects and Details. Details stores the physical paths and attributes of files, while Objects stores virtual paths and is associated with Details, resulting in the basic table structure. This includes the following steps: By analyzing the requirements and extracting information, we can determine the physical path, attributes, and virtual path data of the files that need to be stored. Retrieve data, create a Details table, and store the file's physical path and attributes; Create an Objects table to store virtual paths. Establish a relationship between the Objects table and the Details table so that the physical path and attribute records of each virtual path in the Objects table are recorded in the Details table, thus obtaining the basic table structure and realizing the effective management of virtual paths, file physical paths and attributes.
3. The database implementation method for virtual directory metadata according to claim 1, characterized in that, The process of receiving a file via API, uploading it to a real directory, adding a record to the Details table to obtain its ID, querying the virtual directory ID in the Objects table, adding a file record to the Objects table, and obtaining the uploaded file metadata record includes the following steps: The API interface is used to receive uploaded files, and the files are uploaded to the server's real directory through system calls. The physical path and attribute information of the files in the real directory are then extracted. Add a new record to the Details table to store the file path and attributes, and a unique ID for the new record; Query the Objects table, extract the record IDs that match the target virtual directory path, and combine the obtained Details table IDs with the virtual directory IDs; Add a new record to the Objects table, associate the file with the specified virtual directory, and obtain the complete metadata record of the file in the virtual directory.
4. The database implementation method for virtual directory metadata according to claim 1, characterized in that, The process of retrieving the source file ID from the Objects table, adding a virtual directory record to the Objects table, retrieving the ID, adding a copied file record to the Objects table, and obtaining the copied file metadata record includes the following steps: Search the Objects table, extract its unique ID by matching the source file path, and insert the target virtual directory path as a new record into the Objects table; Obtain the automatically generated ID, and combine the virtual directory ID with the source file ID through a concatenation operation to generate the associated ID of the copied file in the Objects table; The associated ID and the source file's Details table ID are combined to form a new record, which is then inserted into the Objects table. This completes the file copy relationship mapping and yields a complete metadata record for the copied file, including information about the virtual directory's ownership.
5. The database implementation method for virtual directory metadata according to claim 1, characterized in that, The steps of obtaining the target virtual directory ID by querying the Objects table, retrieving records including the ID, extracting the Details_ID from these records, obtaining the actual file information from the Details table, and obtaining the file details within the directory include the following: The Objects table is retrieved using a query operation, the target virtual directory is located by path matching, and the IDs of all records in the directory are extracted. For each record, extract the associated Details_ID field value, use the extracted Details_ID as a query condition, and retrieve detailed information about the corresponding file's actual path, attributes, and MD5 value from the Details table; By integrating the records in the Objects table and the query results in the Details table, the virtual directory structure is associated with the physical information of the files, resulting in a complete list of file details within the target virtual directory.
6. The database implementation method for virtual directory metadata according to claim 1, characterized in that, The process involves querying the Objects table to obtain the ID of the file to be deleted, checking the number of records corresponding to the ID, and if there is only one record, deleting the Details record and the actual file to obtain the database status after the deletion operation. This includes the following steps: The Objects table is retrieved using a query operation. The unique ID of the file to be deleted is extracted by matching the file path. The condition is determined by counting the number of associated records of the unique ID in the Objects table. When there is only one record, extract its Details_ID field value, delete the corresponding record in the Details table, and delete the file entity in the actual directory of the server through a system call; Complete the synchronous deletion of the data layer and physical layer, query the two tables to verify data consistency, and obtain the database status after the deletion operation.
7. The database implementation method for virtual directory metadata according to claim 1, characterized in that, The process of periodically analyzing the indexes of the Path field in the Objects table and commonly used fields in the Details table, optimizing the indexes to improve query efficiency, periodically cleaning up invalid records, backing up data, and obtaining a database of virtual directory metadata includes the following steps: By monitoring and extracting query frequency data for the Path field of the Objects table and commonly used fields of the Details table, the index structure is optimized based on the analysis results, and composite indexes are created for high-frequency query fields to improve retrieval efficiency. By scanning the relationship between the two tables, redundant data of Objects without corresponding Details records is identified and cleaned up. A full data backup is then performed to an independent storage medium to verify the integrity of the backup. The optimized index structure and the cleaned database are synchronized to the production environment to obtain a database of virtual directory metadata.
8. A database implementation method for virtual directory metadata according to claim 2, characterized in that, The process of analyzing demand information to determine the physical path, attributes, and virtual path data of the files to be stored includes the following steps: Using a requirements analysis approach, we studied the functional requirements of virtual directory services, extracted core data elements for file management, and obtained the absolute path and file attribute information of files in the physical storage medium. Extract the virtual path structure data required for user access. The virtual path structure data includes directory hierarchy and access permission identifiers. Map the physical path, file attributes and virtual path to the data structure and determine the use of a dual-table association model. By using unique identifiers to decouple physical storage from logical access, and through the above analysis, a metadata storage design specification that meets the requirements of virtual directory services is obtained.
9. A database implementation method for virtual directory metadata according to claim 4, characterized in that, The process of retrieving the Objects table, extracting its unique ID by matching the source file path, and inserting the target virtual directory path as a new record into the Objects table includes the following steps: Using database retrieval operations, a unique ID of the record that is exactly the same as the source file path is extracted by performing a path matching query in the Objects table; Insert the target virtual directory path as a new data item into the Path field of the Objects table, generating a new record ID containing an auto-incrementing sequence number; By using an association mechanism, the new record ID is hierarchically concatenated with the source file ID to form a complete directory tree structure identifier. The concatenated ID is then used as a foreign key to associate with the corresponding record in the Details table, thus obtaining the complete metadata mapping relationship of the source file under the target virtual directory.