An extended attribute-based data storage method, device, equipment and medium
By employing layered encryption and dynamic compression techniques, combined with a B-tree index structure and intelligent caching mechanism, the efficiency and security issues in extended attribute storage are resolved, improving query performance and protecting sensitive data.
Patent Information
- Application Number
- CN202511404094.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-29
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2045-09-29
AI Technical Summary
Existing extended attribute storage solutions have bottlenecks in storage efficiency, data security, and query performance, especially with large data volumes, leading to wasted storage space, decreased query performance, and easy leakage of sensitive data.
Layered encryption technology is used to encrypt extended attribute data. Combined with dynamic compression algorithm and B-tree index structure, query path and caching mechanism are optimized, and intelligent key management system and multi-threaded parallel processing technology are utilized.
It improves the efficiency and security of extended attribute storage, enhances query performance, reduces storage space usage, and ensures the security of sensitive data.
Smart Images

Figure CN120872918B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer technology, and particularly relates to a data storage method and device based on extended attributes, equipment and medium. BACKGROUND
[0002] As an important feature of the file system, extended attributes allow users or systems to attach arbitrary forms of metadata to objects such as files, directories, etc. Unlike traditional file attributes (such as file name, size, modification time, etc.), the biggest advantage of extended attributes lies in their flexibility. It can store various types of additional data, such as file security tags, access control information, encryption status, file tags, etc. Due to its flexibility and extensibility, extended attributes have been widely used in modern operating systems, especially in supporting large-scale data storage, cloud computing and network file systems. Through these extended attributes, the file system not only provides additional information storage, but also helps to enhance the management and security control capabilities of the file. For example, in a network file system, extended attributes can be used to store network sharing information, version control data; in a cloud storage environment, extended attributes can be used to record file metadata, access control lists, etc. These application scenarios show the importance of extended attributes in modern storage systems.
[0003] Although extended attributes provide powerful functionality, as the amount of data and the number of attributes increase, the existing extended attribute storage and management mechanisms face a series of technical bottlenecks. First, the existing extended attribute storage scheme performs poorly in storage efficiency. When the number of extended attributes is large, the existing storage structure, such as embedding extended attributes directly into inode, is prone to waste of space. Especially when storing large amounts of attribute data, a single storage structure often cannot meet these needs, resulting in insufficient use of storage space and even affecting the scalability of the file system. Second, in terms of performance, the existing extended attribute storage scheme also has significant bottlenecks. Extended attributes often involve frequent query, update and deletion operations. When processing a large number of extended attributes, the traditional linear storage method cannot provide efficient query performance, especially when the amount of data increases dramatically, the performance of query and access decreases significantly. In addition, the frequent disk access of extended attributes also increases the I / O operation overhead, further affecting the overall performance. Especially when storing a large amount of attribute data in the file system, each query or modification of the extended attribute requires more disk time, resulting in slower system response speed and performance degradation. More seriously, with the increasing information security problems, a large amount of sensitive data (such as security tags, user permissions, encryption keys, etc.) may be involved in extended attributes. Many existing file systems do not encrypt extended attributes when storing them, which may expose sensitive data to the risk of leakage. Without effective encryption, malicious users can obtain data that should not be disclosed by obtaining the extended attributes of the file, thereby compromising the security of the file system. In addition, for encrypted extended attribute data, most existing technologies lack flexible and efficient key management mechanisms. File systems usually use a relatively simple encryption scheme or rely on external security modules (such as HSM, i.e. Hardware Security Module, hardware security module) for encryption, resulting in complexity and insecurity in key management and use.
[0004] As can be seen from the above, how to improve the storage efficiency, data security and query performance of extended attribute storage is a problem to be solved. SUMMARY
[0005] Therefore, the purpose of the present application is to provide an extended attribute-based data storage method, device, equipment and medium, which can improve the storage efficiency, data security and query performance of extended attribute storage. The specific scheme is as follows:
[0006] In a first aspect, the present application provides an extended attribute-based data storage method, comprising:
[0007] The extended attribute data is hierarchically encrypted based on an attribute type of the extended attribute data to obtain corresponding encrypted extended attribute data; the attribute type includes a user-defined extended attribute, a system extended attribute, and a security attribute.
[0008] A data compression algorithm is determined based on a data type of the encrypted extended attribute data, and the encrypted extended attribute data is dynamically compressed based on the data compression algorithm to obtain to-be-stored data; the data type includes text data, binary data, and structured data; the to-be-stored data includes an attribute name, an attribute value size before and after compression, and data compression algorithm information.
[0009] The to-be-stored data is stored in a preset storage space, so that, when an access and query request for data in the preset storage space is received, an access and query operation is performed on the data in the preset storage space by using a preset index structure.
[0010] Optionally, the hierarchically encrypting the extended attribute data based on an attribute type of the extended attribute data to obtain corresponding encrypted extended attribute data comprises:
[0011] A target encryption algorithm is determined from a preset encryption algorithm based on an attribute type of the extended attribute data, and a corresponding encryption key is generated based on the attribute type by using a preset key management system; the preset encryption algorithm includes a symmetric encryption algorithm, an asymmetric encryption algorithm, and a hash encryption algorithm;
[0012] An encryption operation is performed on the extended attribute data by using the target encryption algorithm and the encryption key to obtain encrypted extended attribute data.
[0013] Optionally, after the data compression algorithm is determined based on a data type of the encrypted extended attribute data, the method further comprises:
[0014] The data compression algorithm is adjusted based on a data access frequency, a data size, and a current load condition of the encrypted extended attribute data.
[0015] Optionally, after the to-be-stored data is stored in a preset storage space, the method further comprises:
[0016] An index corresponding to the to-be-stored data is created by using a preset index structure, and data in the preset storage space is managed based on the index; the index includes a name, an attribute value type, an attribute value length, and a storage location of the to-be-stored data.
[0017] Optionally, the access and query operation is performed on the data in the preset storage space by using a preset index structure, comprising:
[0018] determining a query path based on a query path optimization mechanism using a preset index structure, and querying data in the preset storage space based on the query path;
[0019] caching data in the preset storage space that meets a preset caching condition based on an intelligent caching mechanism using the preset index structure, so as to perform an access operation on the cached data; the preset caching condition is a condition that a historical access frequency is greater than a preset access frequency threshold.
[0020] Optionally, the storing the to-be-stored data into the preset storage space comprises:
[0021] For to-be-stored data that meets a preset storage condition in terms of data size, storing the to-be-stored data into the preset storage space using a sparse storage technique;
[0022] For to-be-stored data that is to be stored continuously, storing the to-be-stored data into the preset storage space using a data block merging mechanism.
[0023] Optionally, the data storage method based on extended attributes further comprises:
[0024] In the process of decrypting data, verifying data integrity of the encrypted extended attribute data using a preset message authentication code.
[0025] In a second aspect, the present application provides a data storage device based on extended attributes, comprising:
[0026] a data encryption module configured to perform hierarchical encryption processing on the extended attribute data based on an attribute type of the extended attribute data, to obtain corresponding encrypted extended attribute data; the attribute type comprises a user-defined extended attribute, a system extended attribute, and a security attribute;
[0027] a data compression module configured to determine a corresponding data compression algorithm based on a data type of the encrypted extended attribute data, and perform dynamic compression on the encrypted extended attribute data based on the data compression algorithm, to obtain to-be-stored data; the data type comprises text data, binary data, and structured data; the to-be-stored data contains attribute name, attribute value size before and after compression, and data compression algorithm information;
[0028] a data storage module configured to store the to-be-stored data into a preset storage space, so as to perform access and query operations on data in the preset storage space using a preset index structure when receiving an access and query request for the data in the preset storage space.
[0029] In a third aspect, the present application provides an electronic device, comprising:
[0030] a memory for storing the computer program;
[0031] a processor for executing the computer program to implement the aforementioned extended attribute-based data storage method.
[0032] In a fourth aspect, the present application provides a computer readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned extended attribute-based data storage method.
[0033] The present application provides an extended attribute-based data storage method, which first performs hierarchical encryption processing on the extended attribute data based on the attribute type of the extended attribute data, to obtain corresponding encrypted extended attribute data; the attribute type includes user-defined extended attribute, system extended attribute and security attribute; then determines a corresponding data compression algorithm based on the data type of the encrypted extended attribute data, and performs dynamic compression on the encrypted extended attribute data based on the data compression algorithm, to obtain to-be-stored data; the data type includes text data, binary data and structured data; the to-be-stored data contains attribute name, size before and after attribute value compression, and data compression algorithm information; finally, the to-be-stored data is stored in a preset storage space, so that when an access and query request for the data in the preset storage space is received, an access and query operation is performed on the data in the preset storage space by using a preset index structure.
[0034] As can be seen from the above, by introducing dynamic compression technology, the present application selects a suitable compression algorithm according to the characteristics of the extended attribute data, which significantly reduces the occupation of the storage space; the hierarchical encryption method based on the attribute type effectively protects the security of sensitive data by applying different encryption algorithms with different strengths for different types of extended attribute data; the query path optimization mechanism and the intelligent caching mechanism through the preset index structure significantly improve the query and access performance of the extended attribute. Thus, the storage efficiency, data security and query performance of the extended attribute storage can be improved. BRIEF DESCRIPTION OF DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of the provided drawings.
[0036] Figure 1 A flow chart of an extended attribute-based data storage method disclosed by the present application;
[0037] Figure 2 A schematic diagram of a data storage device based on extended attributes is disclosed in the present application.
[0038] Figure 3 An electronic device structure diagram is disclosed in the present application. DETAILED DESCRIPTION
[0039] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.
[0040] As an important feature of the file system, extended attributes allow users or systems to attach arbitrary forms of metadata to objects such as files, directories, etc. Unlike traditional file attributes (such as file name, size, modification time, etc.), the biggest advantage of extended attributes lies in their flexibility. It can store various types of additional data, such as file security tags, access control information, encryption status, file labels, etc. Due to its flexibility and scalability, extended attributes have been widely used in modern operating systems, especially in supporting large-scale data storage, cloud computing, and network file systems. Extended attributes provide great flexibility and scalability for file systems, but existing technologies still have great deficiencies in storage efficiency, query performance, security, and support in large data environments. Therefore, the present application discloses a data storage scheme based on extended attributes, which can improve the storage efficiency, data security, and query performance of extended attribute storage.
[0041] Referring to Figure 1 The embodiments of the present application disclose a data storage method based on extended attributes, which comprises:
[0042] Step S11, based on the attribute type of the extended attribute data, the extended attribute data is processed by hierarchical encryption to obtain corresponding encrypted extended attribute data.
[0043] In this embodiment, according to the attribute type and sensitivity of the extended attribute, the extended attribute is divided into multiple categories, and different encryption algorithms and encryption strengths are used for each category of attribute. This hierarchical encryption strategy can balance the encryption strength and performance overhead according to the actual needs of the data, so as to ensure the confidentiality of the data while avoiding the storage expansion and computational overhead caused by excessive encryption. Among them, the attribute type includes but is not limited to user-defined extended attributes, system extended attributes, and security attributes. Specifically, the hierarchical encryption processing of the extended attribute data based on the attribute type of the extended attribute data to obtain the corresponding encrypted extended attribute data can include:
[0044] The target encryption algorithm is determined from the attribute type of the extended attribute data based on a preset encryption algorithm, and a corresponding encryption key is generated based on the attribute type by using a preset key management system; for user-defined extended attributes (such as attributes of the user. type), these attributes generally contain less sensitive information (such as user comments, labels, personalized settings, etc.), and therefore, in some embodiments, a symmetric encryption algorithm (AES-128 encryption algorithm; AES, Advanced Encryption Standard) can be used for encryption. The AES-128 encryption algorithm has high security, and at the same time, due to its short key length, it has high computational efficiency and is suitable for protecting low-sensitivity data. For system-generated extended attributes (such as attributes of the system. type), these attributes contain operating system configurations, log information, or metadata of the file system, and have high sensitivity but do not belong to absolute sensitive data. Therefore, in some embodiments, AES-192 or AES-256 can be used as the encryption algorithm. The AES-256 algorithm has stronger security and is suitable for protecting medium-sensitivity data and can resist stronger attacks. For the security attributes of the file (such as attributes of the security. type), these attributes contain file access control information, encrypted file identification, permission policies, and other key sensitive data. In some embodiments, the encryption algorithm AES-256 can be used in combination with HMAC-SHA-256 (HMAC, Hash-based Message Authentication Code; SHA, Secure Hash Algorithm) for encryption protection to ensure the confidentiality and integrity of the data. HMAC-SHA-256 provides a message authentication code and can effectively prevent data tampering.
[0045] The encryption and decryption process of extended attributes requires ensuring data security without compromising performance. When encrypting extended attributes, first determine the applicable encryption algorithm (such as AES-128, AES-256) based on the attribute type. A random key is generated for each type of extended attribute for data encryption. The key management system is responsible for generating, distributing, and storing keys. For symmetric encryption algorithms (such as AES), encryption keys are managed according to attribute categories to ensure key security. The selected encryption algorithm and key are used to encrypt the value of the extended attribute. The length information of the attribute is also encrypted during the encryption process to prevent side-channel attacks. The encrypted attribute value is stored with its metadata (such as attribute name, original size, etc.). Metadata itself is also encrypted to prevent metadata leakage. Further, when reading extended attributes, first find the corresponding encrypted data block from the file system by attribute name. According to the attribute type, obtain the corresponding decryption key through the key management system. For encrypted file system metadata, the key is also dynamically provided by the key management system. Use the obtained key and selected decryption algorithm (such as AES decryption algorithm) to decrypt the value of the extended attribute. The decryption process restores the original attribute value and ensures that the decrypted data is identical to the data stored at the time.
[0046] It should be noted that the above intelligent key management system can implement operations such as encryption key generation, distribution, storage, update, revocation, etc. All encryption keys are randomly generated when generated, and the length meets the requirements of the encryption algorithm. The key is generated by the hardware security module and stored inside the hardware security module, ensuring that the key is not exposed in plaintext. The intelligent key management system is responsible for managing the life cycle of the key, including key creation, update, revocation, and expiration. Each encryption operation is bound to a key version number to trace the history of the key when needed. When a key is considered insecure or expired, the intelligent key management system automatically updates the key and re-encrypts all extended attributes encrypted with the key to ensure system security. In addition, the intelligent key management system also supports key revocation mechanism, when a key is leaked, immediately revoke its use permission and replace it with a new key.
[0047] Further, in order to ensure the data integrity of the extended attribute during storage and transmission, the present application also combines HMAC for message authentication. Specifically, during data decryption, the data integrity of the encrypted extended attribute data is verified using a preset message authentication code. That is, each encrypted extended attribute value is attached with an HMAC based on SHA-256, ensuring data integrity and preventing replay attacks. HMAC can effectively prevent data from being tampered with during storage and transmission. If the HMAC check fails during decryption, it indicates that the data has been tampered with, and the system will refuse to provide the value of the extended attribute. At the same time, HMAC authentication ensures that the data has not been tampered with and can verify the source of the data, preventing attackers from using old data for replay attacks.
[0048] It is worth mentioning that, considering the performance bottleneck that may be caused by the encryption and decryption process, the present application takes a number of optimization measures during the encryption operation to ensure that the encryption process does not have a significant impact on the response performance of the file system. The specific optimization measures include: supporting hardware acceleration (such as the AES-NI instruction set built into the CPU) to accelerate the encryption and decryption process. Hardware acceleration can significantly reduce CPU occupancy and delay, improving the execution efficiency of the encryption operation. For large-scale encryption and decryption of extended attributes, the present application supports multi-threaded parallel processing, distributing the encryption operation to multiple CPU cores, thereby improving processing speed and reducing the performance burden caused by encryption and decryption. For frequently accessed extended attributes, the encrypted data is stored in the cache to reduce the decryption overhead each time it is read.
[0049] Step S12, determining a corresponding data compression algorithm based on the data type of the encrypted extended attribute data, and dynamically compressing the encrypted extended attribute data based on the data compression algorithm to obtain the to-be-stored data.
[0050] In this embodiment, the most suitable compression algorithm is automatically selected according to the characteristics of different data types. The data types include but are not limited to text data, binary data and structured data. Specifically, for the extended attributes dominated by text (such as tags, categories, etc.), in some specific embodiments, LZ77 or LZ78 algorithm can be selected for compression. This algorithm is suitable for text data with obvious repetitive patterns, and can efficiently reduce storage space by searching for repetitive string patterns. The advantage of this algorithm is that it has high compression rate, and the compression and decompression speed of regular text data is relatively fast, which is suitable for the performance requirements of the file system. For the extended attributes involving binary data (such as encrypted file signatures, etc.), in some specific embodiments, compression algorithms such as Zlib or Snappy can be used. Zlib provides a good balance between compression rate and performance, which is suitable for data that needs to be frequently accessed in the file system, especially in scenarios where the decompression speed requirement is high, the efficient decompression characteristics of Snappy will be fully utilized. For structured data (such as JSON, XML or custom data structure, etc.; JSON, which stands for JavaScript Object Notation, is a simple notation for representing objects in JavaScript; XML, which stands for eXtensible Markup Language, is a markup language that defines a method to encode documents digitally), in some specific embodiments, efficient compression algorithms such as Brotli or LZ4 can be used. Brotli algorithm has high compression ratio and fast decompression speed, which is suitable for processing complex structured data. It can reduce the storage space occupation while maintaining high decompression performance. That is, by dynamically selecting the appropriate compression algorithm, this embodiment can adjust the storage method according to the specific data characteristics of the extended attributes, achieving maximum storage efficiency.
[0051] Further, considering that frequent access of the extended attribute can cause too much compression and decompression overhead, the embodiment designs an adaptive compression rate and performance balancing mechanism. Specifically, after determining the corresponding data compression algorithm based on the encrypted extended attribute data type, the method can further include: for the extended attribute with low access frequency, a higher compression rate is used to save storage space and reduce the occupation of disk space as much as possible; and for the extended attribute with high access frequency, a lower compression rate algorithm or uncompressed data is selected to avoid the performance loss caused by frequent compression and decompression. For small extended attribute data (such as simple tag information within a few hundred bytes), since the time cost of compression and decompression is high, the original data can be directly stored; and for large extended attribute data (such as data greater than 1 MB), the application will select to store after compression to reduce the storage space occupation. The compression strategy is dynamically adjusted according to the system load. In high load, the system will prefer to use a low compression rate algorithm to reduce the impact on CPU and I / O performance; and in low load, the system will tend to use a higher compression rate algorithm to improve storage efficiency.
[0052] In step S13, the to-be-stored data is stored in the preset storage space, so that when an access and query request for the data in the preset storage space is received, the data in the preset storage space is executed by using a preset index structure to perform access and query operations.
[0053] In the embodiment, the to-be-stored data is stored in the preset storage space according to a specific data format. The to-be-stored data includes attribute name, attribute value size before and after compression, and data compression algorithm information.
[0054] Further, in order to solve the problem of low query efficiency in extended attribute storage, the embodiment introduces an index structure based on B-tree (Balanced Tree) to store the data and metadata of the extended attributes. Specifically, after storing the to-be-stored data in the preset storage space, the method can further include: creating a B-tree index for each file's extended attribute, which contains metadata such as the name of the extended attribute, the type of the attribute value, the length of the attribute value, and the storage location of the attribute value. When the extended attribute is stored in the file system, the index information of the attribute is first generated and inserted into the B-tree. The file system can directly locate the storage block where the extended attribute is located through the B-tree index, thereby greatly speeding up the query process. With the add, delete, modify, and query operations of the file system, the number of extended attributes will change. In order to maintain the efficiency of the B-tree index, a dynamic balancing mechanism is adopted to ensure that the index is still in a balanced state after each insertion or deletion operation. At the physical storage level, through the multi-level B-tree index structure, each layer on the storage medium corresponds to a subtree, thereby shortening the access path and speeding up the extended attribute search process. Through this multi-level index mechanism, the embodiment can maintain high query efficiency when storing a large number of extended attributes.
[0055] In the embodiment, the query efficiency of the extended attribute is further improved by optimizing the query path and the cache mechanism. Specifically, the method of performing access and query operations on the data in the preset storage space using the preset index structure can include: determining a query path based on a query path optimization mechanism using the preset index structure, and querying the data in the preset storage space based on the query path; and caching the data in the preset storage space that meets a preset cache condition based on an intelligent cache mechanism using the preset index structure, so as to perform access operations on the cached data; the preset cache condition is a condition that the number of historical access times is greater than a preset access time threshold. In one specific embodiment, the query path can be dynamically adjusted according to the access history of the file and the access frequency of the extended attribute. For frequently accessed extended attributes, the system will preferentially use a shorter query path for retrieval, reducing unnecessary I / O operations. In the case of multi-level indexing, the system can intelligently select the optimal query path to avoid unnecessary level traversal, thereby further improving the query efficiency.
[0056] In this embodiment, in order to further optimize the utilization efficiency of the storage space, the application introduces a sparse storage technology in the storage process. Specifically, the storing the to-be-stored data into the preset storage space can include: for the to-be-stored data whose data size meets the preset storage condition, storing the to-be-stored data into the preset storage space by using the sparse storage technology; for the to-be-stored data stored continuously, storing the to-be-stored data into the preset storage space by using a data block merging mechanism. That is, for very small extended attributes (such as file tags, status bits, etc.), this embodiment avoids occupying too much space by using a sparse storage mode. For small blocks of continuously stored data, the application further optimizes the storage layout and reduces storage fragmentation by using a data block merging mechanism (similar to the write merging algorithm of SSD).
[0057] It is worth mentioning that the query and access performance of the extended attribute is closely related to the disk I / O operation, and frequent disk read-write operations can significantly reduce the system performance. Therefore, this embodiment reduces the multiple accesses to the disk during a single query by supporting batch query function. When the file system needs to query multiple extended attributes at the same time, the application combines all the queries into one operation for disk access by constructing a one-time batch query request, thereby reducing the number of disk access and the delay. In order to solve the disk I / O waiting problem that may occur in the query process, this embodiment introduces a read-ahead (ReadAhead) and prefetch (Prefetch) mechanism. When the system issues a query request, the read-ahead mechanism loads the related data block from the disk into the memory in advance to avoid waiting during the query process. The prefetch mechanism loads the extended attribute data block that is expected to be accessed in advance according to the user's access mode, thereby reducing the disk I / O operation during the query. In a high-concurrency access scenario, multiple query requests may be initiated at the same time. This embodiment designs an I / O priority scheduling mechanism to dynamically adjust the disk access order according to the urgency of different query requests and the importance of data. For example, for system management related extended attributes, the system will prioritize its query request; while for low-priority user-defined extended attributes, the system can delay its access to reduce the delay of high-priority tasks. This embodiment allows multiple query requests to be performed simultaneously, and distributes the query tasks to multiple processing cores for parallel execution through a multi-thread mechanism. In this way, the throughput of the extended attribute query can be significantly improved, especially in large-scale data storage and high-concurrency scenarios, which can fully utilize the multi-core CPU computing power and shorten the query response time. When performing complex query operations, this embodiment supports parallel traversal of B-tree indexes. By distributing different sub-trees of the B-tree index to multiple threads for simultaneous processing, the speed of index query can be greatly improved. In addition, during the sorting and aggregation of query results, the system uses multi-threading to process the results in parallel, thereby speeding up the generation of query return results.
[0058] As can be seen from the above, the attribute type-based hierarchical encryption method adopted in the embodiment of the application effectively protects the security of sensitive data by applying different encryption algorithms of different strengths for different types of extended attribute data, and avoids the performance overhead and storage inflation problems caused by encryption operations. The encryption strength of attribute data can be dynamically adjusted according to its importance and sensitivity, thereby reducing unnecessary consumption of computing resources while ensuring data security. The hierarchical encryption mechanism ensures that different attribute types of extended attributes use appropriate encryption methods according to requirements, achieving a relatively ideal balance between system performance and data protection. In addition, while performing encrypted storage, the efficiency of data access is maintained, reducing the performance impact caused by encryption, especially in high-concurrency access scenarios, while still ensuring the query and access speed of encrypted extended attributes. By introducing dynamic compression technology, according to the characteristics of extended attribute data, a suitable compression algorithm is selected to significantly reduce the storage space occupation, and the compression strategy can be dynamically adjusted according to factors such as attribute type, data content and access frequency, thereby optimizing the utilization rate of storage space. Especially in large-scale data storage environments, the demand for storage media can be effectively reduced, and the hardware investment and operating costs can be reduced. Through the combination of data blocking and compression technology, the efficient use of storage space is ensured while the access performance of extended attribute data is not affected. By introducing B-tree index structure, query path optimization, intelligent caching mechanism and parallel query technology, the query and access performance of extended attributes is significantly improved, which can effectively reduce disk I / O operations and improve data retrieval speed. In addition, the embodiment of the application supports parallel processing of multiple extended attributes through parallel query technology, fully utilizes the computing resources of multi-core processors, thereby further improving the query throughput and processing capacity, especially in high-concurrency environments, which can significantly improve the query efficiency of the system. In summary, the embodiment of the application significantly improves the efficiency, data security and query performance of extended attribute storage through dynamic compression, hierarchical encryption, optimized storage structure and enhanced query performance.
[0059] Referring to Figure 2 The embodiment of the application discloses a data storage device based on extended attributes, comprising:
[0060] A data encryption module 11 is configured to perform hierarchical encryption processing on the extended attribute data based on the attribute type of the extended attribute data, to obtain corresponding encrypted extended attribute data; the attribute type includes user-defined extended attributes, system extended attributes and security attributes.
[0061] The data compression module 12 is configured to determine a corresponding data compression algorithm based on a data type of the encrypted extended attribute data, and perform dynamic compression on the encrypted extended attribute data based on the data compression algorithm to obtain to-be-stored data; the data type includes text data, binary data, and structured data; and the to-be-stored data includes an attribute name, a size before and after compression of an attribute value, and data compression algorithm information.
[0062] The data storage module 13 is configured to store the to-be-stored data into a preset storage space, so as to perform access and query operations on data in the preset storage space by using a preset index structure when an access and query request for the data in the preset storage space is received.
[0063] In some embodiments, the data encryption module 11 can specifically include:
[0064] The target encryption algorithm determination unit is configured to determine a target encryption algorithm from preset encryption algorithms based on an attribute type of the extended attribute data, and generate a corresponding encryption key based on the attribute type by using a preset key management system; the preset encryption algorithms include symmetric encryption algorithms, asymmetric encryption algorithms, and hash encryption algorithms.
[0065] The data encryption unit is configured to perform an encryption operation on the extended attribute data by using the target encryption algorithm and the encryption key to obtain encrypted extended attribute data.
[0066] In some embodiments, the data storage module 13 can specifically include:
[0067] The query path optimization unit is configured to determine a query path based on a query path optimization mechanism by using a preset index structure, and query data in the preset storage space based on the query path.
[0068] The access data caching unit is configured to cache data in the preset storage space that meets a preset caching condition based on an intelligent caching mechanism by using a preset index structure, so as to perform an access operation on the cached data; the preset caching condition is a condition that a historical access frequency is greater than a preset access frequency threshold.
[0069] The first data storage unit is configured to store to-be-stored data that meets a preset storage condition in terms of data size into a preset storage space by using a sparse storage technology.
[0070] The second data storage unit is configured to store to-be-stored data that is to be stored continuously into a preset storage space by using a data block merging mechanism.
[0071] In some specific embodiments, the data storage device based on extended attributes may further include:
[0072] A data compression algorithm adjustment unit is used to adjust the data compression algorithm based on the data access frequency, data size, and current load of the encrypted extended attribute data.
[0073] The data management unit is used to create an index corresponding to the data to be stored using a preset index structure, and to manage the data in the preset storage space based on the index; the index includes the name, attribute value type, attribute value length, and storage location of the data to be stored;
[0074] The data decryption unit is used to verify the data integrity of the encrypted extended attribute data using a preset message verification code during the data decryption process.
[0075] Furthermore, embodiments of this application also disclose an electronic device, Figure 3 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the extended attribute-based data storage method disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0076] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0077] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0078] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which can be Windows Server, Netware, Unix, Linux, etc. The computer program 222 can further include computer programs capable of performing other specific tasks in addition to the computer program capable of performing the extended attribute-based data storage method performed by the electronic device 20 disclosed in any of the preceding embodiments.
[0079] Further, the present application also discloses a computer readable storage medium for storing a computer program; wherein the computer program is executed by a processor to implement the extended attribute-based data storage method disclosed in the preceding embodiments. The specific steps of the method can refer to the corresponding content disclosed in the preceding embodiments, which will not be repeated here.
[0080] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be mutually referred to. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the relevant parts can refer to the method part.
[0081] The skilled person can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized by electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in general terms in the above description. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0082] The steps of the method or algorithm described in combination with the embodiments disclosed herein can be directly implemented by hardware, a software module executed by a processor, or a combination of both. The software module can be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0083] Finally, it needs to be pointed out that in this document, relational terms such as first and second and the like can only be intended to distinguish one entity or operation from another entity or operation without necessarily requiring or implying any actual such relationship or order between such entities or operations. Moreover, the terms "comprising", "including", or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without more limitations, an element defined by the statement "comprising a" does not exclude the existence of additional identical elements in the process, method, article, or apparatus including the stated element.
[0084] The above detailed description of the technical solutions provided by the present application has been provided, and the principles and implementation modes of the present application have been described by applying specific examples. The above description of the examples is only for the purpose of helping to understand the method of the present application and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed, and the above description of the content of the specification should not be understood as a limitation of the present application.
Claims
1. A data storage method based on extended attributes, characterized in that, include: The extended attribute data is subjected to hierarchical encryption based on the attribute type of the extended attribute data to obtain the corresponding encrypted extended attribute data. The attribute types include user-defined extended attributes, system extended attributes, and security attributes; Based on the data type of the encrypted extended attribute data, a corresponding data compression algorithm is determined, and the encrypted extended attribute data is dynamically compressed based on the data compression algorithm to obtain the data to be stored; the data type includes text data, binary data, and structured data; the data to be stored includes attribute name, the size of the attribute value before and after compression, and data compression algorithm information; The data to be stored is stored in a preset storage space so that when an access and query request for the data in the preset storage space is received, the data in the preset storage space can be accessed and queried using a preset index structure. The step of performing layered encryption processing on the extended attribute data based on the attribute type to obtain the corresponding encrypted extended attribute data includes: The target encryption algorithm is determined from the preset encryption algorithms based on the attribute type of the extended attribute data, and the corresponding encryption key is generated by the preset key management system based on the attribute type; the preset encryption algorithms include symmetric encryption algorithms, asymmetric encryption algorithms, and hash encryption algorithms; The extended attribute data is encrypted using the target encryption algorithm and the encryption key to obtain encrypted extended attribute data. The step of using a preset index structure to perform access and query operations on data in the preset storage space includes: The query path is determined using a preset index structure and a query path optimization mechanism, and the data in the preset storage space is queried based on the query path. The data in the preset storage space that meets the preset caching conditions is cached using a preset index structure and an intelligent caching mechanism, so that access operations can be performed on the cached data; the preset caching conditions are that the number of historical accesses is greater than a preset access number threshold.
2. The data storage method based on extended attributes according to claim 1, characterized in that, After determining the corresponding data compression algorithm based on the data type of the encrypted extended attribute data, the method further includes: The data compression algorithm is adjusted based on the data access frequency, data size, and current load of the encrypted extended attribute data.
3. The data storage method based on extended attributes according to claim 1, characterized in that, After storing the data to be stored in the preset storage space, the method further includes: An index corresponding to the data to be stored is created using a preset index structure, and the data in the preset storage space is managed based on the index; the index includes the name, attribute value type, attribute value length, and storage location of the data to be stored.
4. The data storage method based on extended attributes according to claim 1, characterized in that, The step of storing the data to be stored into a preset storage space includes: For data to be stored that meets the preset storage conditions, sparse storage technology is used to store the data to be stored in the preset storage space; For data to be stored in contiguous blocks, a data block merging mechanism is used to store the data to be stored in a preset storage space.
5. The data storage method based on extended attributes according to any one of claims 1 to 4, characterized in that, Also includes: During the data decryption process, a preset message verification code is used to verify the data integrity of the encrypted extended attribute data.
6. A data storage device based on extended attributes, characterized in that, include: The data encryption module is used to perform layered encryption processing on the extended attribute data based on the attribute type of the extended attribute data to obtain the corresponding encrypted extended attribute data; the attribute type includes user-defined extended attributes, system extended attributes, and security attributes; The data compression module is used to determine the corresponding data compression algorithm based on the data type of the encrypted extended attribute data, and to dynamically compress the encrypted extended attribute data based on the data compression algorithm to obtain the data to be stored; the data type includes text data, binary data, and structured data; the data to be stored includes attribute name, the size of the attribute value before and after compression, and data compression algorithm information; The data storage module is used to store the data to be stored in a preset storage space so that when an access and query request for the data in the preset storage space is received, the access and query operations in the preset storage space can be performed using a preset index structure. The data encryption module includes: The target encryption algorithm determination unit is used to determine the target encryption algorithm from the preset encryption algorithms based on the attribute type of the extended attribute data, and to generate the corresponding encryption key based on the attribute type using the preset key management system; the preset encryption algorithms include symmetric encryption algorithms, asymmetric encryption algorithms, and hash encryption algorithms; A data encryption unit is used to encrypt the extended attribute data using the target encryption algorithm and the encryption key to obtain encrypted extended attribute data. The data storage module includes: The query path optimization unit is used to determine the query path based on the query path optimization mechanism using a preset index structure, and to query the data in the preset storage space based on the query path; The access data caching unit is used to cache data in the preset storage space that meets the preset caching conditions based on a preset index structure and an intelligent caching mechanism, so as to perform access operations on the cached data; the preset caching conditions are the conditions that the number of historical accesses is greater than a preset access number threshold.
7. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the data storage method based on extended attributes as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, Used to store computer programs, wherein the computer programs, when executed by a processor, implement the data storage method based on extended attributes as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Encrypted file access method and device, equipment and storage medium
CN119670130A
Dynamic compression method and device for unstructured encrypted data, medium and product
CN119690352A