Dynamic compression method and device for unstructured encrypted data, medium and product
By obtaining the attribute information of unstructured data, dynamically selecting and adjusting compression algorithms, the problem of inefficient storage of unstructured data in traditional storage technology is solved, and efficient data compression and storage is achieved.
Patent Information
- Application Number
- CN202411917541.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-03-25
AI Technical Summary
Traditional data storage technology has problems of inefficient storage when processing large-scale unstructured data, especially due to the existence of redundant information, the storage space occupation and data retrieval complexity.
Dynamically select and adjust compression algorithms to achieve efficient data compression by obtaining attribute information of unstructured data, including sensitivity, access frequency, usage scenarios and data types.
On the premise of ensuring data security, reduce data redundancy, reduce storage space usage, improve storage efficiency of unstructured data, and optimize data access speed and processing efficiency.
Smart Images

Figure CN119690352A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a dynamic compression method for unstructured encrypted data, an electronic device, a readable storage medium, and a computer program product. Background Art
[0002] Traditional data storage technologies often suffer from low storage efficiency when processing large-scale unstructured data. On the one hand, unstructured data usually contains a large amount of redundant information, such as duplicate files, similar images or audio clips, etc. This redundant information not only takes up valuable storage space, but also increases the complexity of data retrieval and processing. On the other hand, traditional storage technologies often lack optimization methods for unstructured data, resulting in low storage efficiency and difficulty in meeting storage needs in a big data environment. Summary of the invention
[0003] The purpose of this application is to provide a dynamic compression method for unstructured encrypted data, an electronic device, a readable storage medium and a computer program product, which can reduce data redundancy, significantly reduce storage space occupancy and improve the storage efficiency of unstructured data while ensuring data security.
[0004] The first aspect of the present application provides a method for dynamic compression of unstructured encrypted data, comprising:
[0005] Determine the preprocessed and dynamically encrypted unstructured data as unstructured encrypted data, and obtain first attribute information and second attribute information of the unstructured encrypted data; the first attribute information includes sensitivity information and access frequency information, and the second attribute information includes usage scenario information and data type information;
[0006] Based on the first attribute information, determining an initial compression algorithm corresponding to the unstructured encrypted data;
[0007] Based on the second attribute information, the initial compression algorithm is adjusted to obtain an adjusted compression algorithm;
[0008] The unstructured encrypted data is compressed based on the adjusted compression algorithm to obtain compressed data.
[0009] In the above implementation process, the method can ensure that the dynamically compressed unstructured data has been layered, segmented, deduplicated and encrypted, thereby clarifying the premise of dynamic data compression. At the same time, by obtaining the first attribute information (sensitivity information and access frequency information) and the second attribute information (usage scenario information and data type information), it can provide a comprehensive data basis for the subsequent selection of a suitable compression algorithm, making the compression process more accurate and efficient. Among them, sensitivity information helps to identify the importance of data, thereby determining whether a higher protection level is required when compressing; access frequency information can reflect the activity of data, thereby determining whether a more efficient compression algorithm is needed when compressing to reduce decompression time; usage scenario information can guide the selection of compression algorithms to adapt to different storage or transmission requirements; and data type information helps to identify the structural characteristics of data, so that the method can select the most suitable compression method for this type of data. Secondly, the method can also preliminarily select a suitable compression algorithm based on the sensitivity and access frequency of the data, ensuring that the compression efficiency is improved as much as possible while protecting data security. Then, the method can also fine-tune the initial compression algorithm by considering the usage scenario and data type, so that the final compression algorithm is more in line with actual needs, further ensuring the pertinence and efficiency of compression. Finally, using a finely tuned compression algorithm to compress data can effectively reduce data volume, reduce storage and transmission costs, and improve data access speed and overall processing efficiency while ensuring data security.
[0010] Further, the determining, based on the first attribute information, an initial compression algorithm corresponding to the unstructured encrypted data includes:
[0011] When the first attribute information includes high-sensitivity information and high-access-frequency information, determining that the initial compression algorithm corresponding to the unstructured encrypted data is a lightweight compression algorithm or a null algorithm; or
[0012] When the first attribute information includes sensitivity information, determining that the initial compression algorithm corresponding to the unstructured encrypted data is a standard compression algorithm; or
[0013] When the first attribute information includes low-sensitivity information and low-access frequency information, it is determined that the initial compression algorithm corresponding to the unstructured encrypted data is a high-compression ratio algorithm.
[0014] In the above implementation process, the method can intelligently select compression algorithms of different levels according to the sensitivity and access frequency of the data, thereby ensuring the security and access efficiency of highly sensitive and frequently accessed data, and facilitating the efficient compression of low-sensitivity and low-access-frequency data, thereby achieving optimal utilization of storage resources and improving overall data processing performance.
[0015] Further, adjusting the initial compression algorithm based on the second attribute information to obtain an adjusted compression algorithm includes:
[0016] When the data type information in the second attribute information is text type information, adjusting the initial compression algorithm based on a dictionary compression algorithm to obtain an adjusted compression algorithm; or
[0017] When the data type information in the second attribute information is image or video type information, adjusting the initial compression algorithm based on the compression encoding history of the image or video to obtain an adjusted compression algorithm; or
[0018] When the scene information in the second attribute information is a real-time processing scene, the initial compression algorithm is adjusted based on a high-speed decompression requirement to obtain an adjusted compression algorithm; the high-speed decompression requirement corresponds to a low compression rate requirement; or
[0019] When the scene information in the second attribute information is an archival storage scene, the initial compression algorithm is adjusted based on a high compression rate requirement to obtain an adjusted compression algorithm; the high compression rate requirement corresponds to a low-speed decompression requirement.
[0020] In the above implementation process, the method can fine-tune the initial compression algorithm according to the data type and scene information, realize the targeted optimization of the compression algorithm, and thus comprehensively improve the flexibility and efficiency of data processing.
[0021] Furthermore, the method further comprises:
[0022] Calculating a checksum of the compressed data;
[0023] generating metadata based on the identifier of the compressed data, the adjusted compression algorithm, the original data size, the compressed data size, and the checksum;
[0024] The metadata is stored.
[0025] In the above implementation process, the method can ensure the integrity and traceability of compressed data by calculating the checksum of compressed data and generating metadata. The metadata records the key information in the compression process, which is convenient for subsequent data management and recovery, and is conducive to improving the reliability and security of data processing.
[0026] Furthermore, the method further comprises:
[0027] Acquire historical query records of the compressed data; the historical query records include the number of accesses to the compressed data, access time series, and access user records;
[0028] Adjusting the initial compression strategy corresponding to the adjusted compression algorithm based on the historical query record to obtain an adjusted compression strategy;
[0029] The original data of the compressed data is recompressed based on the adjusted compression strategy to obtain compressed data.
[0030] In the above implementation process, the method can dynamically adjust the compression strategy by analyzing the historical query records of compressed data, so that the compression strategy can better adapt to changes in data access patterns, thereby improving data compression efficiency and access speed and optimizing the use of storage resources.
[0031] Further, the adjusting the initial compression strategy corresponding to the adjusted compression algorithm based on the historical query record to obtain the adjusted compression strategy includes:
[0032] Based on the historical query records, calculating the query frequency and anomaly score of the compressed data;
[0033] An initial compression strategy corresponding to the adjusted compression algorithm is adjusted based on the query frequency and the anomaly score to obtain an adjusted compression strategy.
[0034] In the above implementation process, the method can fine-tune the compression strategy by calculating the query frequency and anomaly score of the compressed data, thereby improving the flexibility of data compression and access, and realizing effective identification and processing of abnormal access situations, which is beneficial to optimizing the allocation of storage resources and compression efficiency.
[0035] Further, the adjusting the initial compression strategy corresponding to the adjusted compression algorithm based on the query frequency and the anomaly score to obtain the adjusted compression strategy includes:
[0036] When the query frequency increases and the sensitivity of the compressed data is low, the initial compression strategy corresponding to the adjusted compression algorithm is adjusted to lower the compression level, and a lightweight compression algorithm with a faster decompression speed is determined as the compression algorithm for the adjusted compression strategy; or
[0037] When the abnormal score indicates the presence of an attack and the sensitivity of the compressed data is low, the initial compression strategy corresponding to the adjusted compression algorithm is adjusted to increase the compression level, and a compression algorithm with higher data recovery complexity is determined as the compression algorithm for the adjusted compression strategy.
[0038] In the above implementation process, the method can dynamically adjust the compression strategy according to the query frequency and anomaly score, thereby ensuring that the data can be compressed efficiently and securely in different scenarios.
[0039] A second aspect of the present application provides a dynamic compression device for unstructured encrypted data, the dynamic compression device for unstructured encrypted data comprising:
[0040] A first acquisition unit, configured to determine the preprocessed and dynamically encrypted unstructured data as unstructured encrypted data, and to acquire first attribute information and second attribute information of the unstructured encrypted data; the first attribute information includes sensitivity information and access frequency information, and the second attribute information includes usage scenario information and data type information;
[0041] a determining unit, configured to determine an initial compression algorithm corresponding to the unstructured encrypted data based on the first attribute information;
[0042] A first adjustment unit, configured to adjust the initial compression algorithm based on the second attribute information to obtain an adjusted compression algorithm;
[0043] A compression unit is used to compress the unstructured encrypted data based on the adjusted compression algorithm to obtain compressed data.
[0044] Further, the determining unit is specifically configured to determine that the initial compression algorithm corresponding to the unstructured encrypted data is a lightweight compression algorithm or a null algorithm when the first attribute information includes high-sensitivity information and high-access-frequency information; or
[0045] When the first attribute information includes sensitivity information, determining that the initial compression algorithm corresponding to the unstructured encrypted data is a standard compression algorithm; or
[0046] When the first attribute information includes low-sensitivity information and low-access frequency information, it is determined that the initial compression algorithm corresponding to the unstructured encrypted data is a high-compression ratio algorithm.
[0047] Further, the first adjustment unit is specifically configured to adjust the initial compression algorithm based on a dictionary compression algorithm to obtain an adjusted compression algorithm when the data type information in the second attribute information is text type information; or
[0048] When the data type information in the second attribute information is image or video type information, adjusting the initial compression algorithm based on the compression encoding history of the image or video to obtain an adjusted compression algorithm; or
[0049] When the scene information in the second attribute information is a real-time processing scene, the initial compression algorithm is adjusted based on a high-speed decompression requirement to obtain an adjusted compression algorithm; the high-speed decompression requirement corresponds to a low compression rate requirement; or
[0050] When the scene information in the second attribute information is an archival storage scene, the initial compression algorithm is adjusted based on a high compression rate requirement to obtain an adjusted compression algorithm; the high compression rate requirement corresponds to a low-speed decompression requirement.
[0051] Furthermore, the dynamic compression device for unstructured encrypted data further comprises:
[0052] A calculation unit, configured to calculate a checksum of the compressed data;
[0053] a generating unit, configured to generate metadata based on an identifier of the compressed data, the adjusted compression algorithm, a size of the original data, a size of the compressed data, and the checksum;
[0054] A storage unit is used to store the metadata.
[0055] Furthermore, the dynamic compression device for unstructured encrypted data further comprises:
[0056] A second acquisition unit is used to acquire the historical query record of the compressed data; the historical query record includes the number of accesses to the compressed data, the access time series and the access user record;
[0057] A second adjustment unit, configured to adjust the initial compression strategy corresponding to the adjusted compression algorithm based on the historical query record to obtain an adjusted compression strategy;
[0058] The compression unit is used to re-compress the original data of the compressed data based on the adjusted compression strategy to obtain compressed data.
[0059] Furthermore, the second adjustment unit includes:
[0060] A calculation subunit, configured to calculate a query frequency and an anomaly score of the compressed data based on the historical query records;
[0061] The adjustment subunit is used to adjust the initial compression strategy corresponding to the adjusted compression algorithm based on the query frequency and the anomaly score to obtain the adjusted compression strategy.
[0062] Further, the adjustment subunit is specifically used to adjust the compression level of the initial compression strategy corresponding to the adjusted compression algorithm to be lowered when the query frequency increases and the sensitivity of the compressed data is low, and determine a lightweight compression algorithm with a faster decompression speed as the compression algorithm of the adjusted compression strategy; or
[0063] When the abnormal score indicates the presence of an attack and the sensitivity of the compressed data is low, the initial compression strategy corresponding to the adjusted compression algorithm is adjusted to increase the compression level, and a compression algorithm with higher data recovery complexity is determined as the compression algorithm for the adjusted compression strategy.
[0064] A third aspect of the present application provides an electronic device, which includes a memory and a processor, the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to perform the dynamic compression method for unstructured encrypted data described in any one of the first aspect of the present application.
[0065] A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer program instructions. When the computer program instructions are read and executed by a processor, the method for dynamic compression of unstructured encrypted data described in any one of the first aspects of the present application is executed.
[0066] A fifth aspect of the present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it executes the dynamic compression method for unstructured encrypted data described in any one of the first aspects of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0068] Figure 1 A schematic diagram of a flow chart of a method for dynamic compression of unstructured encrypted data provided in an embodiment of the present application;
[0069] Figure 2 A system architecture diagram of a secure encryption system for unstructured data provided in an embodiment of the present application;
[0070] Figure 3 A schematic diagram of a flow chart of another method for dynamic compression of unstructured encrypted data provided in an embodiment of the present application;
[0071] Figure 4 A schematic diagram of the structure of a dynamic compression device for unstructured encrypted data provided by an embodiment of the present application;
[0072] Figure 5 A schematic diagram of the structure of another dynamic compression device for unstructured encrypted data provided in an embodiment of the present application. DETAILED DESCRIPTION
[0073] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0074] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0075] Example 1
[0076] Please see Figure 1 , Figure 1 A flowchart of a method for dynamic compression of unstructured encrypted data provided by this embodiment. The method for dynamic compression of unstructured encrypted data includes:
[0077] S101. Determine the unstructured data that has been preprocessed and dynamically encrypted as unstructured encrypted data, and obtain first attribute information and second attribute information of the unstructured encrypted data; the first attribute information includes sensitivity information and access frequency information, and the second attribute information includes usage scenario information and data type information.
[0078] In this embodiment, the sensitivity information includes the sensitivity level s i , specifically including: high sensitivity, medium sensitivity, and low sensitivity.
[0079] In this embodiment, the access frequency information includes the access frequency f i , specifically including: high-frequency access and low-frequency access.
[0080] In this embodiment, the scene information includes the use scene u i , specifically including: specific business scenarios and regular business scenarios.
[0081] In this embodiment, the data type information includes the data type t i , specifically including: text, images, videos, etc.
[0082] In this embodiment, the method can also obtain encryption strength information, which includes encryption strength e i , the encryption strength e i Determined by the encryption algorithm and key length used.
[0083] S102: Determine an initial compression algorithm corresponding to the unstructured encrypted data based on the first attribute information.
[0084] In this embodiment, the unstructured encrypted data refers to data obtained after layering, segmenting, deduplication, and encryption of the unstructured data, wherein the unstructured encrypted data is a general term for multiple encrypted data blocks.
[0085] In this embodiment, when the sensitivity information in the first attribute information indicates that the data is high-sensitivity data (s i When the data is highly sensitive, the encryption strength is high, the randomness of the data is large, and the compression effect is poor. Therefore, in order to ensure its query performance, you can choose to skip compression or use a lightweight compression algorithm (such as LZ4). i Similarly, for unstructured encrypted data (for high-frequency access), to ensure its query performance, this method can choose to skip compression or use a lightweight compression algorithm (such as LZ4).
[0086] In this embodiment, when the sensitivity information in the first attribute information indicates that the data is medium sensitivity data (s i When the sensitivity is medium, the data needs to be balanced between compression effect and decompression performance. Therefore, this method can select a standard compression algorithm (such as Gzip) to achieve a balance between compression rate and decompression speed.
[0087] In this embodiment, when the sensitivity information in the first attribute information indicates that the data is low-sensitivity data (s i When the sensitivity is low, the compression ratio can be improved to minimize the storage space occupation. Therefore, the method can select a high compression ratio algorithm (such as Zstandard) so that it can achieve a higher compression ratio at an acceptable decompression speed.
[0088] S103. Based on the second attribute information, adjust the initial compression algorithm to obtain an adjusted compression algorithm.
[0089] In this embodiment, the method can also adjust the compression algorithm based on the data type. For example, when the data type is a text data type, dictionary compression can be enabled to improve compression efficiency; when the data type is an image or video data type, it can be identified whether the data has been compressed and encoded to avoid repeated compression that causes performance waste.
[0090] In this embodiment, the method can also adjust the compression algorithm based on the usage scenario. For example, for real-time processing scenarios, the method can give priority to algorithms with fast decompression speeds; for archival storage scenarios, the method can accept slower decompression speeds in exchange for higher compression rates.
[0091] S104: compress the unstructured encrypted data based on the adjusted compression algorithm to obtain compressed data.
[0092] Please see Figure 2 , Figure 2 A system architecture diagram of a secure encryption system for unstructured data is shown. The secure encryption system for unstructured data includes six components, namely a data preprocessing system, a data dynamic encryption system, a data dynamic compression system, a data storage system, a data query system, and a key management system. It can be seen that the above-mentioned data dynamic compression system corresponds to the "dynamic compression of encrypted data" in the figure, that is, the data dynamic compression system is used to execute the dynamic compression method of unstructured encrypted data proposed in this application, specifically for dynamic data compression processing of unstructured encrypted data.
[0093] In this embodiment, the execution subject of the method may be a computing device such as a computer or a server, and no limitation is made in this embodiment.
[0094] In this embodiment, the execution subject of the method may also be a smart device such as a smart phone, a tablet computer, etc., which is not limited in this embodiment.
[0095] It can be seen that the implementation of the dynamic compression method for unstructured encrypted data described in this embodiment can reduce data redundancy, significantly reduce storage space occupancy, and improve the storage efficiency of unstructured data while ensuring data security.
[0096] Example 2
[0097] Please see Figure 3 , Figure 3 A flowchart of a method for dynamic compression of unstructured encrypted data provided by this embodiment. The method for dynamic compression of unstructured encrypted data includes:
[0098] S201. Determine the unstructured data that has been preprocessed and dynamically encrypted as unstructured encrypted data, and obtain first attribute information and second attribute information of the unstructured encrypted data; the first attribute information includes sensitivity information and access frequency information, and the second attribute information includes usage scenario information and data type information.
[0099] In this embodiment, the unstructured encrypted data is EncryptedData={c 1 ,c 2 ,...,c n}; Among them, the unstructured encrypted data block c i ∈EncryptedData;
[0100] The sensitivity information in the first attribute information includes a sensitivity classification, which is S={s 1 ,s 2 ,...,s n};
[0101] The access frequency information in the first attribute information includes an access frequency classification, and the access frequency classification is F={f 1 ,f 2 ,...,f n};
[0102] The usage scenario information in the second attribute information includes a usage scenario classification, which is U={u 1 ,u 2 ,...,u n};
[0103] The data type information in the second attribute information includes the data type T={t 1 ,t 2 ,...,t n};
[0104] The unstructured encrypted data may further include third attribute information, where the third attribute information includes encryption strength E={e 1 ,e 2 ,...,e n}.
[0105] As an optional implementation manner, before determining the initial compression algorithm corresponding to the unstructured encrypted data based on the first attribute information, the method further includes:
[0106] The data structure is initialized so that the data structure for storing the unstructured encrypted data and metadata is an empty set.
[0107] In this embodiment, this step is intended to set This allows the acquired data to be directly inserted to avoid data conflicts.
[0108] S202. Determine an initial compression algorithm corresponding to the unstructured encrypted data based on the first attribute information.
[0109] In this embodiment, the method may preset a compression policy set CompressPolicy, so that when step S202 is implemented, a corresponding compression policy can be selected from the compression policy set, thereby determining a corresponding compression algorithm.
[0110] As an optional implementation, determining an initial compression algorithm corresponding to the unstructured encrypted data based on the first attribute information includes:
[0111] When the first attribute information includes high-sensitivity information and high-access-frequency information, determining that the initial compression algorithm corresponding to the unstructured encrypted data is a lightweight compression algorithm or a null algorithm; or
[0112] When the first attribute information includes sensitivity information, determining that the initial compression algorithm corresponding to the unstructured encrypted data is a standard compression algorithm; or
[0113] When the first attribute information includes low-sensitivity information and low-access frequency information, it is determined that the initial compression algorithm corresponding to the unstructured encrypted data is a high-compression ratio algorithm.
[0114] For example, the method can be based on a compression policy set CompressPolicy, according to s i , f i ,u i , t i , e i And other attributes, comprehensively select the most suitable compression algorithm and parameters. For example:
[0115] (1) For highly sensitive and frequently accessed data: Due to the high encryption strength and frequent access, compression may be skipped and the data may be directly stored.
[0116] (2) For medium-sensitivity data: Select an algorithm that balances compression rate and decompression speed, such as Gzip.
[0117] (3) For low-sensitivity and infrequently accessed data: Select a high compression algorithm, such as Zstandard, to minimize storage space.
[0118] S203. Based on the second attribute information, adjust the initial compression algorithm to obtain an adjusted compression algorithm.
[0119] As an optional implementation manner, based on the second attribute information, the initial compression algorithm is adjusted to obtain an adjusted compression algorithm, including:
[0120] When the data type information in the second attribute information is text type information, adjusting the initial compression algorithm based on the dictionary compression algorithm to obtain an adjusted compression algorithm; or
[0121] When the data type information in the second attribute information is image or video type information, the initial compression algorithm is adjusted based on the compression encoding history of the image or video to obtain an adjusted compression algorithm; or
[0122] When the scene information in the second attribute information is a real-time processing scene, the initial compression algorithm is adjusted based on the high-speed decompression requirement to obtain an adjusted compression algorithm; the high-speed decompression requirement corresponds to the low compression rate requirement; or
[0123] When the scene information in the second attribute information is an archiving storage scene, the initial compression algorithm is adjusted based on a high compression rate requirement to obtain an adjusted compression algorithm; the high compression rate requirement corresponds to the low-speed decompression requirement.
[0124] S204: compress the unstructured encrypted data based on the adjusted compression algorithm to obtain compressed data.
[0125] In this embodiment, the compressed data obtained after compression is CompressedData={c′ 1 ,c′ 2 ,...,c′ n}.
[0126] In this embodiment, the method can adjust the compression algorithm to compress the unstructured encrypted data to ensure that the data integrity is not affected during the decompression and decryption process.
[0127] S205: Calculate the checksum of the compressed data.
[0128] In this embodiment, the method can calculate the checksum of the compressed data (ie, the compressed data block) for subsequent data integrity verification.
[0129] S206: Generate metadata based on the identifier of the compressed data, the adjusted compression algorithm, the original data size, the compressed data size and the checksum.
[0130] In this embodiment, the generated metadata is M={m 1 ,m 2 ,...,m n}.
[0131] In this embodiment, the metadata content needs to include necessary information (such as data block identifier i, compression algorithm compressAlgo i , compression parameters, original size size(c i ), compressed size size(c′ i ), checksum(c′ i ) etc.) to ensure that data can be processed correctly during decompression, decryption and query.
[0132] S207: Store metadata.
[0133] In this embodiment, the metadata m i With compressed data block c′ i (i.e., compressed data blocks obtained by compressing encrypted data blocks in unstructured encrypted data) correspond one to one, and this storage format can support fast retrieval.
[0134] S208, obtaining historical query records of compressed data; the historical query records include the number of accesses to the compressed data, access time series, and access user records.
[0135] In this embodiment, the historical query record is QueryHistory={q 1,q 2 ,...,q m}, the historical query record contains all query records in the system, which may include query content, time, user information, accessed data blocks, etc.
[0136] For example, this method can traverse the query history QueryHistory, assuming q i ∈QueryHistory, and extract the set of data blocks involved in the query c k ∈Blocks(q i ). For each data block c k Do the following:
[0137] (1) Cumulative calculation of each data block c k The number of visits Count(c k )=Count(c k-1 )+1;
[0138] (2) Record the access time series of data blocks TimeSeries (c k );
[0139] (3) Record user access records UserAccess(c k ,User(q i )).
[0140] S209: Calculate the query frequency and anomaly score of the compressed data based on the historical query records.
[0141] For example, this method can re-traverse each data block c in the historical query k ∈Blocks(QueryHistory), calculate the query frequency and access pattern score for each data, and dynamically adjust the compression based on the calculation results, including:
[0142] (1) Calculate the query frequency Freq(c k ): For each data block c k ∈CompressedData:Freq(c k )=Count(c k ) / TotalTime, where TotalTime is the total time of the statistical period.
[0143] (2) Analyze the query pattern and calculate the anomaly score AnomalyScore (c k ): Use statistical methods or machine learning algorithms (such as isolation forest and cluster analysis) to analyze access time, user behavior, etc. and calculate anomaly scores.
[0144] S210: Adjust the initial compression strategy corresponding to the adjusted compression algorithm based on the query frequency and the anomaly score to obtain an adjusted compression strategy.
[0145] As an optional implementation, the initial compression strategy corresponding to the compression algorithm is adjusted based on the query frequency and the anomaly score to obtain the adjusted compression strategy, including:
[0146] When the query frequency increases and the sensitivity of the compressed data is low, the compression level of the initial compression strategy corresponding to the adjusted compression algorithm is lowered, and a lightweight compression algorithm with a faster decompression speed is determined as the compression algorithm for the adjusted compression strategy; or
[0147] When the anomaly score indicates that there is an attack behavior and the sensitivity of the compressed data is low, the compression level of the initial compression strategy corresponding to the adjusted compression algorithm is adjusted to increase, and a compression algorithm with higher data recovery complexity is determined as the compression algorithm for the adjusted compression strategy.
[0148] In this embodiment, the method can determine the frequently accessed data blocks based on the preset query frequency threshold FreqThreshold; and detect potential attack behaviors through the preset anomaly score threshold AnomalyThreshold.
[0149] In this embodiment, the method can dynamically adjust the compression strategy according to the query frequency and the settlement result of the query mode, as shown below:
[0150] (1) If Freq(c k )>FreqThreshold and the sensitivity of the data block is s k If it is not for high sensitivity, reduce the compression level. Select a lightweight compression algorithm compressAlgo′ with faster decompression speed k , such as adjusting from Gzip to LZ4 and recompressing the data block: c′ k =compressAlgo′ k .compress(c k ), and update the metadata m k The compression algorithm is compressAlgo′ k and compression parameters. Conversely c′ k =c k , m′ k =m k .
[0151] (2) If AnomalyScore(c k )>AnomalyThreshold and the sensitivity of the data block is s kNot for high sensitivity, increase the compression level. Select a compression algorithm with a higher compression ratio compressAlgo" k , such as adjusting from LZ4 to Zstandard. Recompress the data block to get c″ k =compressAlgo″ k .compress(c′ k ) and update the metadata m k The compression algorithm is compressAlgo″ k and compression parameters. On the contrary c″ k =c′ k ,m″ k =m′ k .
[0152] (3) If the data block does not meet the above conditions, keep the original compression strategy, i.e. c″ k =c k ,m″ k =m k .
[0153] S211. Re-compress the original data of the compressed data based on the adjusted compression strategy to obtain compressed data.
[0154] In this embodiment, the compressed data obtained by recompression is AdjustedData = {c" 1 ,c″ 2 ,...,c″ n}.
[0155] In this embodiment, the metadata will also be updated accordingly as the compressed data is recompressed, wherein the updated metadata is M′={m″ 1 ,m″ 2 ,...,m″ n}; wherein the metadata includes the latest compression algorithm and parameter information.
[0156] By implementing this implementation method, the method can automatically and dynamically adjust the compression strategy according to the query history and access mode during the data query process. When facing frequently accessed data blocks, the method can choose to skip compression or use a lightweight compression algorithm to reduce the query decompression time; when facing infrequently accessed data blocks, an algorithm with a higher compression ratio can be used. An example is as follows:
[0157] (1) When the query frequency of a data block increases, this method can choose to reduce the compression level to reduce the decompression overhead and improve the query efficiency;
[0158] (2) When the system detects possible attack behavior, this method can improve the compression strength and increase the complexity of data recovery to enhance data security.
[0159] In this embodiment, the execution subject of the method may be a computing device such as a computer or a server, and no limitation is made in this embodiment.
[0160] In this embodiment, the execution subject of the method may also be a smart device such as a smart phone, a tablet computer, etc., which is not limited in this embodiment.
[0161] It can be seen that the implementation of the dynamic compression method for unstructured encrypted data described in this embodiment can achieve the effects of reducing storage usage and improving transmission efficiency through the dynamic compression method, while also ensuring the query performance and security of the data. On the other hand, the dynamic compression method will adjust the strategy according to factors such as the sensitivity, access frequency and usage scenario of the data, so that it can be aligned with the dynamic encryption algorithm used during encryption, thereby achieving close coordination between the compression function and the encryption function, ensuring the compression effect and security.
[0162] Example 3
[0163] This embodiment shows three example processes of dynamic compression of unstructured encrypted data, and the three example processes correspond to three different data types, wherein:
[0164] When the data type is text, the sample text is: " User information: Name: Alice, Address: 123 Street, transaction details: purchased 500 items ". The specific example process steps are as follows:
[0165] S1. Conduct Selection of initial compression strategy
[0166] (1) Block 1 (high sensitivity): Due to the high encryption strength (such as AES-256), the encrypted data is highly random and has a poor compression effect, so block 1 is not initially compressed.
[0167] (2) Block 2 (medium sensitivity): Use the lightweight Gzip compression algorithm to initially compress the AES-128 encrypted data to reduce storage space usage. The calculation method is:
[0168] CompressedBlock2=Gzip_Compress(EncryptedBlock2)
[0169] S2. Compression strategy adjustment
[0170] (1) Monitoring query frequency: The system monitors the access frequency of each data block. For example, if the number of accesses to block 2 reaches or exceeds a threshold (e.g., 15 times), the compression adjustment mechanism is triggered.
[0171] (2) Dynamically adjust the compression algorithm: When the system detects that the query frequency of block 2 exceeds the threshold, the compression algorithm is adjusted from Gzip to the more efficient LZ4 algorithm to reduce decompression overhead and improve query efficiency. The calculation method is:
[0172] AdjustedCompressedBlock2=LZ4_Compress(AdjustedBlock2)
[0173] (3) Metadata update: Update the metadata of block 2 and record that the compression algorithm is changed from Gzip to LZ4.
[0174] S3. Re-compress according to the new compression strategy
[0175] After the system adjusts the compression algorithm, the encrypted block 2 is compressed again: CompressedBlock2=LZ4_Compress(AdjustedBlock2).
[0176] This step ensures that the compression operation of block 2 is always consistent with the latest compression strategy.
[0177] When the data type is an image data type, the example scenario is: a user uploads an ID card photo containing a personal face and ID card number, and the image needs to be securely stored and managed while supporting efficient query and defending against potential attacks. The specific example process steps are as follows:
[0178] S1. Initial compression strategy selection
[0179] (1) Block 1 (high sensitivity, initial encryption strength is AES-256): Since the data encrypted by AES-256 is highly random, it is difficult for traditional compression algorithms to effectively compress it, and may even cause data expansion. To avoid unnecessary decompression overhead, block 1 is not compressed in the initial stage.
[0180] (2) Block 3 (low sensitivity, initial encryption algorithm is RC4): The data encrypted by RC4 still retains a certain pattern and structure, which is suitable for using a compression algorithm. Therefore, the lightweight LZ4 compression algorithm is selected to provide fast compression and decompression performance and reduce storage space usage.
[0181] S2. Compression strategy adjustment
[0182] (1) Increased access frequency of block 1: The system detects that the access frequency of block 1 has increased significantly, exceeding a preset threshold (e.g., 15 times). Highly accessed data blocks require optimized query performance.
[0183] (2) Encryption strength adjustment: To improve query efficiency, the encryption strength of block 1 is reduced from AES-256 to AES-128. As the encryption strength is reduced, the randomness of the data is reduced, and the compression effect of the compression algorithm may be improved.
[0184] (3) Currently, only block 1 needs to be adjusted for compression strategy. After the encryption strength of block 1 is reduced, the Zstandard (Zstd) compression algorithm that takes both compression rate and decompression speed into consideration can be selected to compress the encrypted block 1 after adjustment, thereby further optimizing storage and query efficiency.
[0185] S3. Recalculate the compressed block 1 according to the new compression strategy: CompressedE 1,k =Zstd_Compress(AdjustedE 1,k )
[0186] Among them, AdjustedE 1,k It is the data block of block 1 encrypted by AES-128, and the corresponding key is K 1 ′, use the Zstd algorithm to compress and get the compressed data block CompressedE 1,k .
[0187] S4. Metadata Update
[0188] After adjusting the compression strategy, the metadata of the data block needs to be updated to ensure that the system can correctly handle compression and decompression operations. Currently, only block 1 compression information needs to be recorded: block 1 metadata needs to be updated to record the new compression algorithm as Zstd, the compression state as compressed, the compression ratio and other related parameters.
[0189] When the data type is a video data type, the example scenario is: a company's internal meeting record video contains sensitive business secrets, and the video needs to be securely stored and managed while supporting efficient query and defending against potential attacks. The specific example process steps are as follows:
[0190] S1. Initial compression strategy selection
[0191] (1) Block 1 (high sensitivity, initial encryption is AES-256) initial compression strategy:
[0192] ①Compress first, then encrypt: Since the data after AES-256 encryption is highly random and cannot be effectively compressed, the original video data block B 1,k Compress first, then encrypt.
[0193] ② Use efficient video compression coding: Use H.265 (HEVC) coding to compress the original data block, obtain the compressed data block, and calculate CompressedB 1,k =H265_Compress(B 1,k )
[0194] ③ Encrypt the compressed data: Encrypt the compressed data block to obtain the encrypted data block and calculate E′ 1,k =OPE_AES256_Encrypt(CompressedB 1,k ,K 1 )
[0195] (2) Block 2 (medium sensitivity, initial encryption is AES-128) initial compression strategy:
[0196] ① Encrypt first, then compress: Since the encryption strength of medium-sensitivity data is low and the storage space may need to be further optimized, you can consider compressing it after encryption.
[0197] ② Encrypt the original data block: Use AES-128 to encrypt data block B 2,l Encrypt, get the encrypted data block, calculate E 2,l =AES128_Encrypt(B 2,l ,K 2 )
[0198] ③Use standard video compression coding: compress the encrypted data block, use H.264 encoding, obtain the compressed encrypted data block, and calculate CompressedE 2,l =H264_Compress(E 2,l )
[0199] (3) Block 3 (low sensitivity) initial compression strategy, depending on the situation. For low-sensitivity data, if the data volume is large, you can choose to compress the original data to save storage space.
[0200] ① If you do not encrypt, compress directly: If you decide not to encrypt, you can directly compress the original data block B 3,m Compress and calculate CompressedB 3,m =Lightweight_Compress(B 3,m )
[0201] ② Lightweight encryption followed by compression: If encryption is required, a lightweight encryption algorithm (such as RC4) can be used, followed by compression. First, the encrypted value E is calculated. 3,m =RC4_Encrypt(B 3,m ,K 3), and then compress the encrypted value CompressedE 3,m =Lightweight_Compress(E 3,m ).
[0202] S2. Dynamic compression strategy adjustment
[0203] (1) Block 1 (highly sensitive data): If the system detects abnormal access behavior to block 1, it suspects an attack and needs to improve data security.
[0204] (2) Block 2 (medium sensitivity data): When block 2 is frequently accessed and the access frequency exceeds the set threshold, the query efficiency needs to be optimized.
[0205] S3: According to the detected abnormal situation, block 1 is compressed and adjusted respectively.
[0206] (1) Detecting abnormal behavior: The system finds that the user has a high sensitivity data block E 1,k The query frequency of is abnormally high, which may pose a risk of inference attack.
[0207] (2) Adjust the compression and encryption strategies. The specific steps are as follows:
[0208] ① Improve compression complexity: Recompress the original data block: Upgrade the compression algorithm from H.265 to the more efficient and complex AV1 encoding to increase the computational complexity of decompression and improve data security. Calculation:
[0209] AdjustedCompressedB 1,k =AV1_Compress(B 1,k )
[0210] ② Improve encryption strength: Use hybrid encryption technology: Use a more advanced encryption algorithm on the recompressed data block, such as combining symmetric encryption and asymmetric encryption to obtain an enhanced encrypted data block, and calculate:
[0211] EnhancedE 1,k =HybridEncrypt(AdjustedCompressedB 1,k ,K′ 1 )
[0212] ③ Update key: Generate a new key K′ 1 , and updated in the key management module.
[0213] (3) Metadata update: record the new compression and encryption algorithms, that is, update the compression algorithm of block 1 to AV1, the encryption method to hybrid encryption, and the key identifier to K′ in the metadata. 1 .
[0214] S4: Detect that the access frequency of block 2 exceeds the threshold, and perform B on block 2. 2,l Perform dynamic compression adjustment. The specific steps are as follows:
[0215] (1) First, reduce the encryption strength and convert data block B 2,l The encryption algorithm is reduced from AES-128 to lightweight AES-64 to speed up decryption. Generate a new key K′ 2 , and updated in the key management module. Then calculate the encrypted value:
[0216] AdjustedE 2,l =AES64_Encrypt(B 2,l ,K′ 2 ).
[0217] (2) Adjust the compression algorithm and use a faster compression algorithm. In order to further improve the query efficiency, use a lightweight compression algorithm, such as LZ4, on the adjusted encrypted data block to calculate the compression value:
[0218] AdjustedCompressedE 2,l =LZ4_Compress(AdjustedE 2,l ).
[0219] (3) Update metadata to record the new encryption and compression algorithms. Update the metadata of block 2 to record the encryption algorithm as AES-64, the compression algorithm as LZ4, and the key identifier as K′ 2 .
[0220] It can be seen that the implementation of the dynamic compression method for unstructured encrypted data described in this embodiment can reduce data redundancy, significantly reduce storage space occupancy, and improve the storage efficiency of unstructured data while ensuring data security.
[0221] Example 4
[0222] Please see Figure 4 , Figure 4 A schematic diagram of the structure of a dynamic compression device for unstructured encrypted data provided by this embodiment. Figure 4 As shown, the dynamic compression device for unstructured encrypted data includes:
[0223] The first acquisition unit 310 is used to determine the pre-processed and dynamically encrypted unstructured data as unstructured encrypted data, and acquire first attribute information and second attribute information of the unstructured encrypted data; the first attribute information includes sensitivity information and access frequency information, and the second attribute information includes usage scenario information and data type information;
[0224] A determination unit 320, configured to determine an initial compression algorithm corresponding to the unstructured encrypted data based on the first attribute information;
[0225] A first adjustment unit 330, configured to adjust the initial compression algorithm based on the second attribute information to obtain an adjusted compression algorithm;
[0226] The compression unit 340 is used to compress the unstructured encrypted data based on the adjusted compression algorithm to obtain compressed data.
[0227] In this embodiment, the explanation of the dynamic compression device for unstructured encrypted data can refer to the description in Embodiment 1 or Embodiment 2, which will not be further elaborated in this embodiment.
[0228] It can be seen that the implementation of the dynamic compression device for unstructured encrypted data described in this embodiment can reduce data redundancy, significantly reduce storage space occupancy, and improve the storage efficiency of unstructured data while ensuring data security.
[0229] Example 5
[0230] Please see Figure 5 , Figure 5 A schematic diagram of the structure of a dynamic compression device for unstructured encrypted data provided by this embodiment. Figure 5 As shown, the dynamic compression device for unstructured encrypted data includes:
[0231] The first acquisition unit 310 is used to determine the pre-processed and dynamically encrypted unstructured data as unstructured encrypted data, and acquire first attribute information and second attribute information of the unstructured encrypted data; the first attribute information includes sensitivity information and access frequency information, and the second attribute information includes usage scenario information and data type information;
[0232] A determination unit 320, configured to determine an initial compression algorithm corresponding to the unstructured encrypted data based on the first attribute information;
[0233] A first adjustment unit 330, configured to adjust the initial compression algorithm based on the second attribute information to obtain an adjusted compression algorithm;
[0234] The compression unit 340 is used to compress the unstructured encrypted data based on the adjusted compression algorithm to obtain compressed data.
[0235] As an optional implementation, the determination unit 320 is specifically configured to determine that the initial compression algorithm corresponding to the unstructured encrypted data is a lightweight compression algorithm or a null algorithm when the first attribute information includes high-sensitivity information and high-access-frequency information; or
[0236] When the first attribute information includes sensitivity information, determining that the initial compression algorithm corresponding to the unstructured encrypted data is a standard compression algorithm; or
[0237] When the first attribute information includes low-sensitivity information and low-access frequency information, it is determined that the initial compression algorithm corresponding to the unstructured encrypted data is a high-compression ratio algorithm.
[0238] As an optional implementation manner, the first adjustment unit 330 is specifically configured to adjust the initial compression algorithm based on the dictionary compression algorithm to obtain an adjusted compression algorithm when the data type information in the second attribute information is text type information; or
[0239] When the data type information in the second attribute information is image or video type information, the initial compression algorithm is adjusted based on the compression encoding history of the image or video to obtain an adjusted compression algorithm; or
[0240] When the scene information in the second attribute information is a real-time processing scene, the initial compression algorithm is adjusted based on the high-speed decompression requirement to obtain an adjusted compression algorithm; the high-speed decompression requirement corresponds to the low compression rate requirement; or
[0241] When the scene information in the second attribute information is an archiving storage scene, the initial compression algorithm is adjusted based on a high compression rate requirement to obtain an adjusted compression algorithm; the high compression rate requirement corresponds to the low-speed decompression requirement.
[0242] As an optional implementation, the dynamic compression device for unstructured encrypted data further includes:
[0243] A calculation unit 350, configured to calculate a checksum of the compressed data;
[0244] A generating unit 360, configured to generate metadata based on an identifier of the compressed data, an adjusted compression algorithm, an original data size, a compressed data size, and a checksum;
[0245] The storage unit 370 is used to store metadata.
[0246] As an optional implementation, the dynamic compression device for unstructured encrypted data further includes:
[0247] The second acquisition unit 380 is used to acquire the historical query record of the compressed data; the historical query record includes the number of accesses to the compressed data, the access time series, and the access user record;
[0248] A second adjustment unit 390 is used to adjust the initial compression strategy corresponding to the adjusted compression algorithm based on the historical query record to obtain an adjusted compression strategy;
[0249] The compression unit 340 is used to re-compress the original data of the compressed data based on the adjusted compression strategy to obtain compressed data.
[0250] As an optional implementation, the second adjustment unit 390 includes:
[0251] A calculation subunit 391, for calculating the query frequency and anomaly score of the compressed data based on the historical query records;
[0252] The adjustment subunit 392 is used to adjust the initial compression strategy corresponding to the adjusted compression algorithm based on the query frequency and the anomaly score to obtain the adjusted compression strategy.
[0253] As an optional implementation, the adjustment subunit 392 is specifically used to adjust the compression level of the initial compression strategy corresponding to the adjusted compression algorithm to be lowered when the query frequency increases and the sensitivity of the compressed data is low, and determine a lightweight compression algorithm with a faster decompression speed as the compression algorithm for adjusting the compression strategy; or
[0254] When the anomaly score indicates that there is an attack behavior and the sensitivity of the compressed data is low, the compression level of the initial compression strategy corresponding to the adjusted compression algorithm is adjusted to increase, and a compression algorithm with higher data recovery complexity is determined as the compression algorithm for the adjusted compression strategy.
[0255] In this embodiment, the explanation of the dynamic compression device for unstructured encrypted data can refer to the description in Embodiment 1 or Embodiment 2, which will not be further elaborated in this embodiment.
[0256] It can be seen that the implementation of the dynamic compression device for unstructured encrypted data described in this embodiment can reduce data redundancy, significantly reduce storage space occupancy, and improve the storage efficiency of unstructured data while ensuring data security.
[0257] An embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the dynamic compression method for unstructured encrypted data in Embodiment 1 or Embodiment 2 of the present application.
[0258] An embodiment of the present application provides a computer-readable storage medium storing computer program instructions. When the computer program instructions are read and executed by a processor, the dynamic compression method for unstructured encrypted data in Embodiment 1 or Embodiment 2 of the present application is executed.
[0259] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0260] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0261] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0262] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0263] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0264] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
Claims
1. A dynamic compression method for unstructured encrypted data, characterized in that: include: Determine the preprocessed and dynamically encrypted unstructured data as unstructured encrypted data, and obtain first attribute information and second attribute information of the unstructured encrypted data; the first attribute information includes sensitivity information and access frequency information, and the second attribute information includes usage scenario information and data type information; Based on the first attribute information, determining an initial compression algorithm corresponding to the unstructured encrypted data; Based on the second attribute information, the initial compression algorithm is adjusted to obtain an adjusted compression algorithm; The unstructured encrypted data is compressed based on the adjusted compression algorithm to obtain compressed data.
2. The method for dynamic compression of unstructured encrypted data according to claim 1, characterized in that: The determining, based on the first attribute information, an initial compression algorithm corresponding to the unstructured encrypted data includes: When the first attribute information includes high-sensitivity information and high-access-frequency information, determining that the initial compression algorithm corresponding to the unstructured encrypted data is a lightweight compression algorithm or a null algorithm; or When the first attribute information includes sensitivity information, determining that the initial compression algorithm corresponding to the unstructured encrypted data is a standard compression algorithm; or When the first attribute information includes low-sensitivity information and low-access frequency information, it is determined that the initial compression algorithm corresponding to the unstructured encrypted data is a high-compression ratio algorithm.
3. The dynamic compression method for unstructured encrypted data according to claim 1, characterized in that: The adjusting the initial compression algorithm based on the second attribute information to obtain an adjusted compression algorithm includes: When the data type information in the second attribute information is text type information, adjusting the initial compression algorithm based on a dictionary compression algorithm to obtain an adjusted compression algorithm; or When the data type information in the second attribute information is image or video type information, adjusting the initial compression algorithm based on the compression encoding history of the image or video to obtain an adjusted compression algorithm; or When the scene information in the second attribute information is a real-time processing scene, the initial compression algorithm is adjusted based on a high-speed decompression requirement to obtain an adjusted compression algorithm; the high-speed decompression requirement corresponds to a low compression rate requirement; or When the scene information in the second attribute information is an archival storage scene, the initial compression algorithm is adjusted based on a high compression rate requirement to obtain an adjusted compression algorithm; the high compression rate requirement corresponds to a low-speed decompression requirement.
4. The method for dynamic compression of unstructured encrypted data according to claim 1, characterized in that: The method further comprises: Calculating a checksum of the compressed data; generating metadata based on the identifier of the compressed data, the adjusted compression algorithm, the original data size, the compressed data size, and the checksum; The metadata is stored.
5. The method for dynamic compression of unstructured encrypted data according to claim 1, characterized in that: The method further comprises: Acquire historical query records of the compressed data; the historical query records include the number of accesses to the compressed data, access time series, and access user records; Adjusting the initial compression strategy corresponding to the adjusted compression algorithm based on the historical query record to obtain an adjusted compression strategy; The original data of the compressed data is recompressed based on the adjusted compression strategy to obtain compressed data.
6. The method for dynamic compression of unstructured encrypted data according to claim 5, characterized in that: The adjusting the initial compression strategy corresponding to the adjusted compression algorithm based on the historical query record to obtain the adjusted compression strategy includes: Based on the historical query records, calculating the query frequency and anomaly score of the compressed data; An initial compression strategy corresponding to the adjusted compression algorithm is adjusted based on the query frequency and the anomaly score to obtain an adjusted compression strategy.
7. The method for dynamic compression of unstructured encrypted data according to claim 6, characterized in that: The adjusting the initial compression strategy corresponding to the adjusted compression algorithm based on the query frequency and the anomaly score to obtain the adjusted compression strategy includes: When the query frequency increases and the sensitivity of the compressed data is low, the initial compression strategy corresponding to the adjusted compression algorithm is adjusted to lower the compression level, and a lightweight compression algorithm with a faster decompression speed is determined as the compression algorithm for the adjusted compression strategy; or When the abnormal score indicates the presence of an attack and the sensitivity of the compressed data is low, the initial compression strategy corresponding to the adjusted compression algorithm is adjusted to increase the compression level, and a compression algorithm with higher data recovery complexity is determined as the compression algorithm for the adjusted compression strategy.
8. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to perform the dynamic compression method for unstructured encrypted data according to any one of claims 1 to 7.
9. A readable storage medium, characterized in that: The readable storage medium stores computer program instructions, and when the computer program instructions are read and executed by a processor, the dynamic compression method for unstructured encrypted data according to any one of claims 1 to 7 is executed.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program executes the dynamic compression method for unstructured encrypted data according to any one of claims 1 to 7.
Citation Information
Cited By
Data storage method and device based on extended attributes, equipment and medium
CN120872918A
An extended attribute-based data storage method, device, equipment and medium
CN120872918B