Sectional encryption table type data storage method
By segmenting and differentiating tabular data, this technology solves the problems of conflict between encryption and statistical efficiency, insufficient encryption strength for sensitive data, and strong binding between data logical structure and physical storage. It enables strong obfuscation and diffusion of sensitive data and aggregation analysis without decryption, thereby improving data security and business availability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-20
- Publication Date
- 2026-03-31
AI Technical Summary
Existing technologies for tabular data storage suffer from several problems, including conflicts between encryption and statistical efficiency, insufficient encryption strength for sensitive data, strong binding between data logical structure and physical storage, weak resistance to data leakage, the potential for complete data leakage due to single-point leaks, and the need for decryption before statistical analysis can be performed.
By segmenting and identifying tabular data, applying statistical fragments for irreversible encryption, performing multi-round nonlinear and linear transformations for iterative encryption of sensitive information fields, assembling table structure information with two types of ciphertext to form low-density encryption, storing the data in fixed-length and non-fixed-length regions respectively, mapping it to a multi-dimensional spatial point set, dynamically sharding it across multiple edge nodes, and using homomorphic encryption for statistical operations in the ciphertext state.
It achieves strong obfuscation and diffusion capabilities for sensitive data, disperses logically adjacent data to different physical regions, and enables aggregation analysis without decryption, thus providing integrated protection that balances data security and business availability.
Smart Images

Figure CN121765743A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a segmented encrypted table-based data storage method. Background Technology
[0002] In key sectors such as finance, healthcare, and government, tabular data, as the core data carrier, typically contains both sensitive content such as personally identifiable information (PII) and financial data, as well as analytical content such as statistical summary indicators, facing the dual demands of secure storage and efficient utilization.
[0003] Currently, mainstream table-based data encryption solutions can be divided into three categories: First, full-table encryption (such as MySQLTDE technology), which achieves security protection by encrypting the entire database file, but the encryption and decryption process incurs significant performance overhead, especially in high-concurrency statistical scenarios where response latency increases dramatically; Second, column-level encryption, which encrypts only sensitive fields individually, but data must be decrypted before statistical analysis, leading not only to index failure and a sharp drop in query performance, but also introducing the risk of data leakage during the decryption process; Third, encrypted computation schemes based on homomorphic encryption, which support direct computation of ciphertext, but existing technologies suffer from high computational complexity and severe ciphertext expansion, making them difficult to adapt to the actual business needs of large-scale table-based data.
[0004] At the storage architecture level, traditional solutions often employ centralized storage or simple distributed sharding, which presents two major vulnerabilities: First, the data logical structure is strongly bound to the physical storage, allowing attackers to infer sensitive data relationships by stealing table structure information; second, the sharding strategy is fixed, meaning that leakage of a single node could lead to the direct interpretation of some data, and there is a lack of fragment-level invalidation protection mechanisms. Furthermore, while erasure coding strategies in distributed systems such as HDFS can improve availability, they still pose a risk of accidental data deletion in extreme cases, further exacerbating the imbalance between storage security and efficiency. Summary of the Invention
[0005] The technical problem to be solved by this invention is to provide a segmented encrypted table-based data storage method that can achieve integrated protection of high-strength encryption of sensitive data, efficient and calculable statistical data, leakage-resistant storage structure, and fragmented distribution to prevent reconstruction, thus taking into account both data security and business availability.
[0006] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows: Firstly, a segmented encrypted table-based data storage method, the method comprising: By analyzing tabular data, application statistics segments, sensitive information fields, and table structure information are identified. The application statistics fragment is irreversibly encrypted to obtain the first ciphertext data; Based on the sensitive information field, the plaintext data of the sensitive information field is obfuscated and diffused by performing multiple rounds of iterative operations of nonlinear and linear transformations, and combined with a pre-allocated encryption key, to obtain the second ciphertext data. The table structure information, the first ciphertext data, and the second ciphertext data are assembled and integrated to obtain a logically complete encrypted information table. The encrypted information table is then subjected to low-density encryption to obtain the third ciphertext data. The first ciphertext data, the second ciphertext data, and the third ciphertext data are stored in the designated fixed-length area and the variable-length area, respectively. The encrypted data in the non-fixed length region is mapped to a set of data points in a multi-dimensional space. The data point set is traversed and rearranged based on a continuous space filling curve, and logically adjacent data contents are distributed to different physical storage areas to obtain rearranged data. Based on the rearranged data, dynamic sharding calculation is performed to decompose it into multiple invalidation fragments, which are then distributed and stored in multiple edge nodes to obtain distributed encrypted data. Based on distributed storage, encrypted data is used to perform statistical operations directly in the ciphertext state through homomorphic encryption, so as to obtain aggregated analysis data without decryption.
[0007] Furthermore, by analyzing the tabular data, application statistical segments, sensitive information fields, and table structure information were identified, including: Receive tabular data to be processed, and perform structural parsing on the tabular data to extract the header information and data body content; The data body content is classified by field, and the field classification results are obtained based on predefined business rules and data classification strategies; Fields in the field classification results that are used for statistical summarization but do not contain personal identification information are identified as application statistical fragments; fields that contain personal identification information or financial data are identified as sensitive information fields. The header information is identified and extracted to obtain column names, row identifiers, and inter-table relationships; these are then used as table structure information.
[0008] Furthermore, the application statistical fragment is irreversibly encrypted to obtain the first ciphertext data, including: Using statistical fragments as input data, a fixed-length data output is obtained by compressing and mapping the input data. Based on the fixed-length data output, a ciphertext digest with collision resistance is obtained by performing multi-round bitwise operations and modulo operations. The ciphertext digest is associated with the corresponding data segment index to obtain the associated ciphertext digest and index; The encrypted digest and index after association and binding are stored in a fixed-length area to form the first encrypted data.
[0009] Furthermore, based on the sensitive information field, through iterative operations of multiple rounds of nonlinear and linear transformations, and combined with a pre-allocated encryption key, the plaintext data of the sensitive information field is obfuscated and diffused to obtain the second ciphertext data, including: Divide the sensitive information field into multiple fixed-length data groups; Multiple rounds of encryption operations are performed on each data group, i.e., non-linear replacement operations are performed. The data groups are obfuscated by looking up the replacement table to obtain the replaced data. The replaced data is mapped to a preset geometric space, the positions of the data elements are rearranged through spatial coordinate transformation, and the spatial distribution structure of the data is changed according to a preset traversal path to obtain spatially rearranged data. Based on spatially rearranged data, linear transformation operations are performed, and data diffusion is achieved through matrix operations to obtain diffused data. Based on the diffused data, in each round of encryption operation, the pre-allocated encryption key is combined with the key expansion calculation to form the round key. The round key is then mixed with the data group for operation to complete the iterative operation of the current round. After completing multiple rounds of iterative operations, the data processed in each round of iterative operations are grouped and recombined to obtain the second ciphertext data. The second ciphertext data is then associated with the corresponding metadata and key identifier.
[0010] Furthermore, the table structure information, the first ciphertext data, and the second ciphertext data are assembled and integrated to obtain a logically complete encrypted information table. This encrypted information table is then subjected to low-density encryption to obtain the third ciphertext data, which includes: Establish a data organization framework based on table structure information; Based on the data organization framework, the first ciphertext data and the second ciphertext data are logically assembled to obtain the encrypted information table; Based on the encrypted information table, low-density encryption is used. Fast encryption is performed through preset iteration rounds and preset linear transformation layers. While maintaining data confidentiality, processing efficiency is optimized to obtain the processed encrypted result. The processed encryption result is serialized to form a standard format third ciphertext data string. Based on the standard format third ciphertext data string, the final third ciphertext data is obtained.
[0011] Furthermore, the first ciphertext data, the second ciphertext data, and the third ciphertext data are stored in designated fixed-length and variable-length regions, respectively, including: The ciphertext digest and index of the first ciphertext data are stored in a fixed-length area; the second ciphertext data, along with the corresponding metadata and key identifier, are stored in a variable-length area; and the third ciphertext data is stored as a complete data unit in a specific logical segment of the variable-length area. By logically associating the index information stored in the fixed-length region with the encrypted data content stored in the variable-length region, the established indexing mechanism enables rapid data location and access.
[0012] Furthermore, the encrypted data in the variable-length region is mapped to a set of data points in a multi-dimensional space. Based on a continuous space-filling curve, the data point set is traversed and rearranged, distributing logically adjacent data content to different physical storage areas, resulting in rearranged data, including: Based on encrypted data stored in a non-fixed-length region, a multi-dimensional spatial coordinate mapping relationship is established, and the encrypted data is converted into a set of data points in a multi-dimensional space based on the multi-dimensional spatial coordinate mapping relationship. By using a continuous space-filling curve to traverse and sort the data point set, and based on the spatial traversal characteristics of the space-filling curve, the spatial distribution of the data point set is changed, and the spatial traversal result of the data point set is obtained. Based on the spatial traversal results of the data point set, logically adjacent data content is redistributed to different physical storage areas to complete the spatial rearrangement of the data and obtain the rearranged data.
[0013] Furthermore, based on the rearranged data, dynamic sharding calculation is performed to decompose it into multiple invalidation fragments. These invalidation fragments are then distributed and stored across multiple edge nodes, resulting in distributed encrypted data, including: Based on the rearranged data, the fragmentation parameters are dynamically determined according to the current data characteristics, network transmission conditions and security policy requirements to form a fragmentation strategy; Based on the sharding strategy, dynamic sharding calculation is used to shard the rearranged data to obtain multiple independent data fragments. Add an invalidation identifier to each data fragment to make the individual fragments unreadable, forming a set of invalidated fragments; The invalidated fragment set is distributed and stored across multiple edge nodes. By controlling the fragment distribution, it is ensured that the fragments stored on any single node are insufficient to reconstruct the complete data, thus obtaining encrypted data in distributed storage.
[0014] Furthermore, based on encrypted data stored in distributed storage, statistical operations are performed directly in the ciphertext state using homomorphic encryption to obtain aggregated analysis data that does not require decryption, including: Based on encrypted data from distributed storage, statistical query requests are received and parsed to obtain the operation type and data range; Based on the operation type and data range, obtain the corresponding encrypted data fragments from the edge nodes, and perform homomorphic encryption operations based on the encrypted data fragments while maintaining the ciphertext state. By performing homomorphic encryption operations, aggregation calculations are directly performed on the ciphertext data to obtain statistical results of the encryption state; The statistical results of the encrypted state are decrypted to obtain the final aggregated analysis data, thus completing the entire data processing flow.
[0015] Secondly, a segmented encrypted table-based data storage system includes: The analysis module is used to identify application statistics segments, sensitive information fields, and table structure information by analyzing tabular data; The processing module performs irreversible encryption on the application statistical fragments to obtain the first ciphertext data; based on the sensitive information field, it performs iterative operations of multiple rounds of nonlinear and linear transformations, and combines them with a pre-allocated encryption key to obfuscate and diffuse the plaintext data of the sensitive information field to obtain the second ciphertext data; it assembles and integrates the table structure information, the first ciphertext data, and the second ciphertext data to obtain a logically complete encrypted information table; and it performs low-density encryption on the encrypted information table to obtain the third ciphertext data. The storage module is used to store the first ciphertext data, the second ciphertext data, and the third ciphertext data in a set fixed-length area and a variable-length area, respectively. The mapping module is used to map encrypted data in non-fixed-length regions into a set of data points in multi-dimensional space. It traverses and rearranges the data point set based on a continuous space-filling curve, dispersing logically adjacent data contents to different physical storage areas to obtain rearranged data. The calculation module is used to decompose the rearranged data into multiple invalidation fragments through dynamic sharding calculation, and distribute the invalidation fragments to multiple edge nodes to obtain distributed encrypted data. The execution module is used to perform statistical operations directly on encrypted data based on distributed storage using homomorphic encryption to obtain aggregated analysis data without decryption.
[0016] Thirdly, a computing device includes: One or more processors; A storage device for storing one or more programs that, when executed by one or more processors, cause the one or more processors to implement the method.
[0017] Fourthly, a computer-readable storage medium storing a program that, when executed by a processor, implements the method.
[0018] The above-described solution of the present invention has at least the following beneficial effects: Because it employs a technique of first segmenting and identifying application statistical fragments, sensitive information fields, and table structure information in tabular data, and then performing differentiated encryption, it performs irreversible encryption on application statistical fragments, iterative encryption of sensitive information fields through multiple rounds of nonlinear and linear transformations, and low-density encryption on the table structure information and the encrypted information table formed by assembling the two types of ciphertext. This overcomes the problems of encryption and statistical efficiency conflicts and insufficient encryption strength for sensitive data in existing technologies. Consequently, it enables statistical data to support analysis without needing to be restored, and sensitive data possesses strong obfuscation and diffusion capabilities. Furthermore, by storing the three types of ciphertext in fixed-length and variable-length regions respectively, mapping the variable-length region data to a multi-dimensional spatial point set, and traversing and rearranging it through a space-filling curve, and then based on the rearrangement... The technology of dynamically sharding data to form invalidated fragments and distributing them across multiple edge nodes overcomes the problems of strong binding between data logic and physical storage, weak anti-leakage capabilities, and the risk of complete data leakage due to single-point leaks in traditional storage architectures. This achieves the effect of distributing logically adjacent data to different physical regions and preventing fragments from a single node from reconstructing complete data. Furthermore, by employing homomorphic encryption, which directly performs statistical operations on encrypted data in distributed storage under ciphertext conditions, the technology overcomes the leakage risks and poor adaptability of encrypted computations caused by the need for decryption in existing solutions. This achieves an integrated protection effect that allows for the acquisition of aggregated analysis data without decryption, balancing data security and business availability. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating a segmented encrypted table-based data storage method provided by an embodiment of the present invention.
[0020] Figure 2 This is a schematic diagram of a segmented encrypted table-based data storage system provided by an embodiment of the present invention. Detailed Implementation
[0021] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0022] like Figure 1 As shown, an embodiment of the present invention proposes a segmented encrypted table-based data storage method, the method comprising the following steps: Step 1: By analyzing the tabular data, identify application statistical segments, sensitive information fields, and table structure information; Step 2: Irreversibly encrypt the application statistics fragment to obtain the first ciphertext data; Step 3: Based on the sensitive information field, through multiple rounds of iterative operations of nonlinear and linear transformations, and combined with a pre-allocated encryption key, the plaintext data of the sensitive information field is obfuscated and diffused to obtain the second ciphertext data; Step 4: Assemble and integrate the table structure information, the first ciphertext data, and the second ciphertext data to obtain a logically complete encrypted information table. Perform low-density encryption on the encrypted information table to obtain the third ciphertext data. Step 5: Store the first ciphertext data, the second ciphertext data, and the third ciphertext data in the designated fixed-length area and the variable-length area, respectively. Step 6: Map the encrypted data in the non-fixed length region to a set of data points in a multi-dimensional space. Based on a continuous space filling curve, traverse and rearrange the set of data points to distribute logically adjacent data content to different physical storage areas, and obtain rearranged data. Step 7: Based on the rearranged data, the data is decomposed into multiple invalidation fragments through dynamic sharding calculation. The invalidation fragments are then distributed and stored in multiple edge nodes to obtain the encrypted data in distributed storage. Step 8: Based on the encrypted data of distributed storage, statistical operations are performed directly in the ciphertext state using homomorphic encryption to obtain aggregated analysis data that does not require decryption.
[0023] In this embodiment of the invention, application statistical segments, sensitive information fields, and table structure information in tabular data can be accurately identified, providing a clear basis for subsequent differentiated processing. Irreversible encryption of application statistical segments ensures that statistical data can support analysis without decryption, while also preventing the leakage of statistical information. Iterative encryption of sensitive information fields using multiple rounds of nonlinear and linear transformations enhances data obfuscation and diffusion effects, significantly improving the anti-cracking capability of sensitive data. Low-density encryption is applied to the assembled encrypted information table, protecting the table structure security without excessively consuming processing resources. The three types of ciphertext are stored in fixed-length and variable-length regions respectively. By leveraging indexing mechanisms, data can be quickly located and access efficiency improved. Spatial rearrangement of non-fixed-length data areas disperses logically adjacent data across different physical regions, reducing the risk of misinterpretation through association. The rearranged data is dynamically sharded and distributed across multiple edge nodes, with invalidation markers added to fragments, ensuring that even if a single node is leaked, the complete data cannot be reconstructed. Homomorphic encryption enables statistical operations to be performed directly in encrypted form, providing aggregation analysis results without decryption, thus avoiding the risk of data leakage during decryption. Overall, it balances data security and business availability, making it suitable for various scenarios with data security and analysis requirements.
[0024] In a preferred embodiment of the present invention, step 1 above may include: Step 1.1: Receive the tabular data to be processed and perform structural parsing on the tabular data to extract the header information and data body content. Specifically, this includes receiving tabular data from business scenarios such as financial transaction systems, medical electronic medical record systems, or government information management platforms. This data is usually in the form of structured tables and contains multiple business records. Next, the received tabular data is scanned row by row and formatted. By analyzing the data delimiters, field length rules, and data type characteristics, the boundaries between the header area and the data body area are clearly distinguished. The header area is the first row or the first few rows of content in the table that define field attributes, and the data body area is the multiple rows of data storing specific business records. Then, the header information containing field names, data type descriptions, etc., is extracted from the header area, and the specific numerical or text content corresponding to each business record is extracted from the data body area as the data body content. The header information and data body content after structural parsing will serve as the basic input for field classification operations.
[0025] Step 1.2 involves classifying the data content by field. Based on predefined business rules and data classification strategies, the field classification results are obtained. Specifically, this includes: First, loading the predefined business rules and data classification strategies. The business rules are formulated by technical personnel in various fields according to actual business needs. For example, in the financial field, the transaction amount field needs to be marked as financially related, and the user ID number field needs to be marked as identity-related. In the medical field, the number of visits field needs to be marked as statistically related, and the patient name field needs to be marked as identity-related. The data classification strategy is based on field semantic annotation and data sensitivity level classification, dividing the fields in the data content into four levels: high sensitivity, medium sensitivity, low sensitivity, and non-sensitive. Subsequently, semantic analysis and attribute matching are performed on each field in the data content. The content features of each field are compared with the field descriptions in the predefined business rules. At the same time, combined with the sensitivity level standards in the data classification strategy, the classification label corresponding to each field is determined, ultimately forming a field classification result that includes field name, field type, and sensitivity level.
[0026] Step 1.3 identifies fields in the field classification results that are used for statistical summarization and do not contain personal identification information as application statistical fragments; fields containing personal identification information or financial data are identified as sensitive information fields. Specifically, this includes: firstly, filtering the classification labels of each field one by one, selecting fields marked as used for statistical summarization and with a sensitivity level of non-sensitive, and further verifying whether the content of these fields contains personal identification information. Personal identification information includes, but is not limited to, names, ID card numbers, mobile phone numbers, home addresses, and other information that can directly or indirectly identify an individual. If the verification confirms that there is no personal identification information, then these fields are determined. To apply statistical segments, such as the total number of monthly outpatients in a department or the annual incidence rate of a certain disease in the medical field, or the total number of quarterly transactions in a branch in the financial field; next, fields marked with category tags as containing personal identification information or with a high sensitivity level and belonging to finance are filtered out. The finance-related fields include bank account numbers, transaction amounts, balances, and other content related to funds. These fields are identified as sensitive information fields, such as patient ID numbers and medical insurance card numbers in the medical field, and user bank account numbers and transaction amounts in the financial field. Through this identification process, two types of core data in the tabular data are clearly distinguished.
[0027] Step 1.4 involves identifying and extracting the header information to obtain column names, row identifiers, and inter-table relationships. These column names, row identifiers, and inter-table relationships are then treated as table structure information. Specifically, this includes: extracting field names from the header information, which are the column names of the tabular data, such as patient ID, visit date, department, or transaction amount. These column names will be used as field identifiers when assembling the encrypted information table. Next, it analyzes whether the header information contains fields used to uniquely identify each data record. These fields typically have attributes such as primary keys and unique identifiers, such as the unique patient number in medical tabular data or the transaction serial number in financial tabular data. These fields are identified as row identifiers, which will be used for record location during data storage and access. Then, by identifying the reference identifiers and association descriptions of the fields in the header information, such as the related patient basic information table.ID or related account information table account number marked after the field name, the field correspondence between the current tabular data and other tabular data is analyzed to extract the inter-table relationships. Finally, the extracted column names, row identifiers, and inter-table relationships are integrated into complete table structure information.
[0028] In this embodiment of the invention, by first receiving the tabular data to be processed and parsing out the header information and data body content, a clear structural foundation is provided for data classification and identification. Then, based on predefined business rules and data classification strategies, the data body content is classified into fields to ensure that the classification results meet actual business needs and are accurate. Subsequently, application statistical segments used for statistical summarization without personal identification information, as well as sensitive information fields containing personal identification information or financial data, are clearly identified, achieving effective differentiation of key data types and providing a clear basis for subsequent differentiated encryption processing. Finally, column names, row identifiers, and inter-table relationships are extracted from the header information as table structure information, further improving the core elements of data organization. Overall, this lays a precise and clear data foundation for encryption, assembly, and integration steps, effectively improving the pertinence and operational reliability of the entire segmented encrypted tabular data storage method.
[0029] In a preferred embodiment of the present invention, step 2 above may include: Step 2.1: Using application statistical fragments as input data, the input data is compressed and mapped to obtain a fixed-length data output. Based on the fixed-length data output, multi-round bitwise operations and modulo operations are performed to obtain a ciphertext digest with anti-collision properties. Specifically, this includes: obtaining the identified application statistical fragments, such as the total number of daily transactions at a branch in a financial scenario, the total number of weekly visits to a department in a medical scenario, etc., which do not require restoration of the original content and are only used for statistics; then processing the original data of these application statistical fragments, according to the character length and content characteristics of the data, and dividing them into different categories. The raw data of the application statistics segments are uniformly converted into fixed-length data output. The fixed length can be set to 256 bits or 512 bits according to business needs to ensure the uniformity of the output data format. Then, multiple rounds of bit operations are performed on the fixed-length data output. Bit operations include XOR, shift, AND operations, etc., and the binary bits of the data are recombined in each round of operation. After multiple rounds of bit operations, modulo operations are further performed. By setting a fixed modulus, the operation results are modulo-processed to eliminate the impact of data length differences. After multiple rounds of bit operations and modulo operations, a ciphertext digest with collision resistance is finally obtained.
[0030] Step 2.2 involves associating the ciphertext digest with the corresponding data fragment index to obtain the associated ciphertext digest and index. Specifically, after obtaining the ciphertext digest, the data fragment index corresponding to each application statistics fragment is first acquired. This data fragment index is formed based on the extracted table structure information, including the table name, column name, row identifier, and data storage start position of the application statistics fragment. This index information can accurately locate the original application statistics fragment in the tabular data. Next, an association mapping table is established, matching each ciphertext digest with its corresponding data fragment index one by one. In the association mapping table, each record contains two fields: the ciphertext digest value and the complete data fragment index, ensuring that one ciphertext digest uniquely corresponds to one data fragment index, preventing confusion. Subsequently, the records in the association mapping table are validated to check for duplicate ciphertext digests or missing indexes. If any anomalies are found, the ciphertext digest formation or index information is re-executed. After successful validation, the associated ciphertext digest and index are obtained.
[0031] Step 2.3 involves storing the associated ciphertext digest and index in a fixed-length area to form the first ciphertext data. Specifically, this includes: First, dividing the storage area based on the associated ciphertext digest and index, setting up a dedicated fixed-length area. The storage space in this area is allocated according to a fixed number of bytes. The length of each storage unit is determined by the ciphertext digest length plus the data fragment index length. For example, if the ciphertext digest is 256 bits (32 bytes) and the data fragment index is 64 bits (8 bytes), then each storage unit is set to 40 bytes, ensuring that the associated ciphertext digest and index can be completely stored in one storage unit. Next, according to the record order in the association mapping table, each set of ciphertext digest + data fragment index is sequentially written into the storage unit of the fixed-length area. During the writing process, the address information of each storage unit is recorded and corresponds to the storage start position in the data fragment index, facilitating quick location of the corresponding storage unit through the index during data access. Then, the data written to the fixed-length area undergoes an integrity check. By comparing the data verification values before and after writing, it is confirmed that the data has not been lost or tampered with. After the check passes, the associated data stored in the fixed-length area forms the first ciphertext data.
[0032] In this embodiment of the invention, the application statistical fragment is used as input data. First, a fixed-length data output is obtained through compression mapping transformation. Then, a ciphertext digest with anti-collision characteristics is generated through multiple rounds of bitwise operations and modular operations. This process not only retains the core features required by the application statistical fragment to support statistical analysis, but also avoids the risk of statistical information being restored and leaked due to the irreversibility of the ciphertext digest. At the same time, the fixed-length output format also provides a unified format for data storage and processing. The ciphertext digest is associated and bound with the corresponding data fragment index, so that each ciphertext digest can accurately correspond to the location information of the original application statistical fragment. This provides a key association basis for quickly matching the ciphertext digest with the original statistical data fragment during data access, effectively solving the problem of low efficiency in accessing and locating statistical data. The associated and bound ciphertext digest and index are stored in a fixed-length area to form the first ciphertext data. The fixed-length area storage method not only facilitates unified management and fast reading of the first ciphertext data, but also clearly distinguishes it from other ciphertext data stored in non-fixed-length areas.
[0033] In a preferred embodiment of the present invention, step 3 above may include: Step 3.1 involves dividing the sensitive information fields into multiple fixed-length data groups. Specifically, this includes: first, acquiring the sensitive information fields, such as user bank account numbers and transaction amounts in financial scenarios, and patient ID numbers and medical insurance card numbers in medical scenarios, which require high-strength protection; then, dividing the original data of the sensitive information fields into multiple fixed-length data groups, with the group length set to 128 bits or 256 bits to ensure that the number of bytes in each group is consistent; during the division process, if the total length of the sensitive information fields is less than the length of a group, the length is padded according to a preset padding rule (such as adding specific bytes); if the total length exceeds the group length, the data is split sequentially to avoid data truncation or inconsistent lengths.
[0034] Step 3.2 involves performing multiple rounds of encryption operations on each data block, i.e., performing a non-linear substitution operation. This involves obfuscating the data blocks by looking up a substitution table to obtain the substituted data. Specifically, after completing the data block formation, multiple rounds of encryption operations are performed on each fixed-length data block. The first round is a non-linear substitution. First, a predefined non-linear substitution table is loaded. This table is a mapping table based on cryptographic security design (such as an S-box structure). Each input value in the table corresponds to a unique non-linear output value, and the output value has no obvious linear correlation with the input value. Next, each byte or bit block in the data block is used as an index to find the corresponding substitution value in the non-linear substitution table, and the original data unit is replaced with the substitution value. For example, 0x01 in the data block is mapped to 0xab through the substitution table, and 0x02 is mapped to 0xcd. Through this non-linear substitution operation, the original characteristics of the data blocks are broken, the linear correlation between data is severed, and preliminary data obfuscation is achieved, resulting in the substituted data.
[0035] Step 3.3 involves mapping the replaced data to a preset geometric space, rearranging the positions of data elements through spatial coordinate transformation, and changing the spatial distribution structure of the data according to a preset traversal path to obtain spatially rearranged data. Specifically, this includes: using the replaced data as the processing object, first mapping the replaced data to a preset geometric space. This geometric space can be set to two-dimensional or three-dimensional space depending on the data complexity. For example, 128-bit data can be divided into eight 16-bit sub-blocks, each sub-block corresponding to a coordinate point (x, y) in two-dimensional space, where x is the sub-block number and y is the sub-block value; then, a spatial coordinate transformation operation is performed, by transforming the coordinate points... Transformations such as rotation, translation, or flipping are performed to change the initial position of data elements in geometric space. Then, the transformed coordinates are traversed according to a preset traversal path (such as a serpentine path or a spiral path), and the data elements are rearranged in traversal order. For example, data originally arranged in the order of 1, 2, 3, 4 becomes 1, 2, 4, 3 after traversing the serpentine path. Through spatial coordinate transformation and specific path traversal, the spatial distribution structure of the replaced data is completely changed, and logically adjacent data elements are dispersed to different positions, further enhancing the data obfuscation effect and making it more difficult for attackers to infer the original data pattern from data fragments. After completing the spatial rearrangement, the spatially rearranged data is obtained.
[0036] Step 3.4: Based on the spatially rearranged data, perform a linear transformation operation to achieve data diffusion through matrix operations, obtaining the diffused data. Specifically, after acquiring the spatially rearranged data, initiate the linear transformation operation. First, load a predefined linear transformation matrix, designed based on cryptographic diffusion principles. The values of the matrix elements ensure that a change in one bit affects multiple bits after the operation. Next, convert the spatially rearranged data into column or row vector form and perform matrix multiplication with the linear transformation matrix. For example, multiply each element in the data vector with the element of the corresponding row of the matrix and sum the results to obtain new vector elements. Through this matrix operation, changes in each data bit in the spatially rearranged data will be propagated to multiple other data bits, achieving uniform data diffusion throughout the entire group. After the linear transformation is completed, the diffused data is obtained.
[0037] Step 3.5: Based on the diffused data, in each round of encryption operation, a round key is generated by combining the pre-allocated encryption key with the key expansion calculation. The round key is then mixed with data groups for a mixed operation to complete the iterative operation of the current round. Specifically, this includes: obtaining the diffused data and simultaneously calling the pre-allocated encryption key (this key is generated by the key management center according to user permissions and has uniqueness and randomness); then performing key expansion calculation according to the preset key expansion method (such as splitting the initial key into multiple subkeys and then generating multiple round keys through cyclic shifting, XOR, etc.) to generate a corresponding round key for each round of encryption operation. Each round has a unique round key. In the current round of iteration, the generated round key is mixed with the diffused data. The mixing operation can be performed using XOR or modulo addition. For example, each byte in the round key is XORed with the corresponding byte in the diffused data to obtain the fused key information. Each round of iteration repeats the process of nonlinear substitution, spatial rearrangement, linear transformation, and round key mixing. Each round uses a different round key, ensuring that the key information is continuously updated during the encryption process. After the current round of iteration is completed, the processed data will enter the next round of iteration until the preset number of iterations is completed.
[0038] Step 3.6: After completing multiple rounds of iterative computation, the data groups processed in each round are recombined to obtain the second ciphertext data. The second ciphertext data is then associated with its corresponding metadata and key identifier. Specifically, this involves: after all rounds of iterative computation are completed, collecting the data groups processed in each round, and reassembling and integrating these processed groups according to their original splitting order to form a complete encrypted data block, i.e., the second ciphertext data; next, associating the second ciphertext data with corresponding metadata, which includes information such as the generation time of the second ciphertext data, the name of the original sensitive information field, the encryption round, and the length of the data group; simultaneously, binding the second ciphertext data with a key identifier, which corresponds one-to-one with the initial encryption key. The key identifier allows for quick location of the corresponding decryption key, preventing key-ciphertext mismatches; by establishing an association between the second ciphertext data and its metadata and key identifier, the integrity and traceability of the second ciphertext data can be ensured.
[0039] In this embodiment of the invention, the security protection capability of sensitive data is significantly improved by refining the encryption processing of sensitive information fields; dividing sensitive information fields into fixed-length data groups provides a regular processing unit for multi-round encryption operations, ensuring that the encryption operation is orderly and efficient; breaking the original feature association of sensitive data through nonlinear replacement and obfuscation processing initially improves the anti-cracking capability; mapping the replaced data to geometric space and rearranging it further disrupts the data structure, strengthens the obfuscation effect, and makes it more difficult for attackers to predict the original data pattern; achieving data diffusion through linear transformation and matrix operations allows the key influence to cover more data bits, avoiding the risk of local data leakage; combining round keys for mixed operations, injecting new key information in each round of iteration, greatly reduces the possibility of overall leakage after a single key is cracked; recombining data groups and associating metadata and key identifiers not only forms complete second ciphertext data, but also provides a clear basis for subsequent decryption and data management.
[0040] In a preferred embodiment of the present invention, step 4 above may include: Step 4.1: Based on the table structure information, establish a data organization framework. This includes: obtaining table structure information, which includes column names, row identifiers, and inter-table relationships for table data, such as the patient ID column, visit date column, row identifiers 001-100, and the associated patient basic information table ID in a medical data table; then, building a data organization framework based on this table structure information, dividing the framework into three core areas: table structure description area, statistical encrypted storage area, and sensitive encrypted storage area; the table structure description area stores column names and row identifiers to ensure that data assembly corresponds to the field positions in the original table; the statistical encrypted storage area reserves space matching the length of the first encrypted data, and each storage location is labeled with the corresponding column name and row identifier index; the sensitive encrypted storage area plans storage units according to the number and length of the second encrypted data groups and associates them with the corresponding key identifier positions.
[0041] Step 4.2: Based on the data organization framework, logically assemble the first and second encrypted data to obtain an encrypted information table. Specifically, this includes: logically assembling the encrypted data based on the data organization framework; importing the first encrypted data (which includes a encrypted digest and index associated with the data fragment index) into the framework's statistical encrypted storage area; and accurately matching the corresponding encrypted digest to the corresponding column name and row identifier in the table structure description area based on the index information in the first encrypted data (e.g., the patient visit count column: rows 100 to 200), ensuring that each unit of the first encrypted data corresponds to a statistical entry in the original table. Field location; then, the second ciphertext data (encrypted block data associated with metadata and key identifiers) is imported into the sensitive ciphertext storage area. Based on the metadata of the second ciphertext data (such as the patient ID number column: rows 1 to 50), each encrypted block data is mapped to the sensitive field column name and row identifier marked in the framework. At the same time, the key identifier is stored in a designated subordinate location in the sensitive ciphertext storage area. Finally, the table structure description area is filled in with the inter-table relationships to ensure that the assembled data can reflect the logical relationship of the original table data. Through this assembly, a logically complete encrypted information table is obtained.
[0042] Step 4.3: Based on the encrypted information table, low-density encryption is employed. This involves rapid encryption using a preset number of iterations and a preset linear transformation layer, optimizing processing efficiency while maintaining data confidentiality to obtain the processed encrypted result. Specifically, this includes: using the encrypted information table as the processing target, performing low-density encryption; firstly, determining the core parameters of low-density encryption: setting the number of iterations to 2-3 rounds, and using a preset and simplified 3rd or 4th order transformation matrix (rather than a higher order matrix) for the linear transformation layer to reduce computational complexity; during encryption, firstly, performing a comprehensive scan of the table structure description area and ciphertext storage area in the encrypted information table to identify non-sensitive structural information that does not require high-strength encryption (such as column name identifiers and storage area division markers), performing only one round of simplified linear transformation on this information; performing 2-3 rounds of iterative calculations on the boundary association information between the statistical ciphertext storage area and the sensitive ciphertext storage area, with each round containing only one non-linear replacement and one simplified linear transformation to avoid excessive encryption and resource consumption; through this differentiated low-density processing method, the processed encrypted result is obtained.
[0043] Step 4.4 involves serializing the processed encryption result to form a standard-formatted third-ciphertext data string. Based on this standard-formatted third-ciphertext data string, the final third-ciphertext data is obtained. Specifically, this includes: performing a serialization conversion operation on the processed encryption result; using a preset standard data exchange format, converting the table structure description area, statistical ciphertext storage area, and sensitive ciphertext storage area content in the processed encryption result into structured key-value pairs or tagged data; during the conversion process, escaping special characters to ensure the resulting string conforms to the standard format requirements; after completing the serialization conversion, integrating all structured data into a standard-formatted and continuous string, which is the third-ciphertext data string; through serialization, the optimized encryption result is converted into a unified and easily stored string format, facilitating storage in variable-length areas and enabling compatible transmission between different systems, ultimately yielding the third-ciphertext data.
[0044] In this embodiment of the invention, by integrating and optimizing encrypted data, a balance between high efficiency and security in the overall encryption of tabular data is achieved. A data organization framework is established based on the table structure information, providing a clear structural basis for the integration of different types of ciphertext and ensuring logically ordered data. Assembling the first and second ciphertext data according to the framework to form an encrypted information table preserves the overall correlation of the data and avoids logical chaos caused by fragmentation. Low-density encryption processing is adopted, achieving rapid encryption with fewer iterations and simplified linear transformations. While ensuring the security of the table structure and ciphertext integration information, it avoids the performance loss of traditional full-volume high-strength encryption, thus improving processing efficiency. The encryption result is serialized to form a third ciphertext data in a standard format, facilitating subsequent storage and transmission and unifying the data format.
[0045] In a preferred embodiment of the present invention, step 5 above may include: Step 5.1: Store the ciphertext digest and index from the first ciphertext data in a fixed-length area; store the second ciphertext data, along with the corresponding metadata and key identifier, in a variable-length area; store the third ciphertext data as a complete data unit in a specific logical segment of the variable-length area. Specifically, this includes: initializing the storage area, clearly defining the physical boundaries and storage rules between the fixed-length and variable-length areas; for the fixed-length area, based on the characteristics of the first ciphertext data (the fixed total length of the ciphertext digest and index), divide the fixed-length area into multiple equal-length storage units, with the length of each storage unit exactly matching the total number of bytes in a set of ciphertext digests + indexes. For example, if each set of data is 40 bytes, then the storage unit length is set to 40 bytes; then, according to the order of the indexes in the first ciphertext data, write each set of ciphertext digests + indexes sequentially into the storage units of the fixed-length area, and record the starting address of each unit to ensure that each... Each index and its corresponding ciphertext digest are uniquely matched within a fixed-length region and stored in a fixed location. For the second ciphertext data, its associated metadata (generation time, data length, etc.) and key identifier are read first, and the three are integrated into a single data block. Since the data block lengths of different second ciphertext data may vary (e.g., different numbers of groups for different sensitive fields result in different data block lengths), a dynamic space allocation mechanism is enabled for the variable-length region. Storage space of the corresponding size is allocated according to the actual length of each data block. After writing the data block, its start and end addresses in the variable-length region are recorded. Finally, a specific logical segment is divided within the variable-length region (e.g., the beginning part of the variable-length region, distinguished from other regions by a special identifier). The third ciphertext data is written as a complete data unit into the specific logical segment. During writing, identification information, such as the start of the third ciphertext data and the total data length, is added to the header of the specific logical segment.
[0046] Step 5.2 involves logically associating the index information stored in the fixed-length region with the encrypted data content stored in the variable-length region. Based on the established indexing mechanism, rapid data location and access are achieved. Specifically, this includes: after data storage is completed, establishing the logical association between the fixed-length region and the variable-length region; firstly, extracting the index information within each storage unit in the fixed-length region. This index information includes the type identifier of the corresponding data (e.g., statistical data, sensitive data), the associated table structure field names (e.g., visitor count column, patient ID number column), and the preset variable-length region data association identifier; then, traversing the storage records in the variable-length region to extract the start address, end address, and metadata of the second encrypted data block. The system extracts the segment name and the start address and identifier information of a specific logical segment of the third encrypted data. Then, it constructs an index + data address association table to map and bind the index information of the fixed-length region to the encrypted data in the variable-length region. For example, the index identified as statistical data or the number of visits is bound to the start and end addresses of the corresponding second encrypted data block in the variable-length region; the index identified as table structure data is bound to the start address of a specific logical segment of the third encrypted data. When data needs to be accessed, by querying the index + data address association table and inputting the index of the fixed-length region, the storage address of the corresponding encrypted data in the variable-length region can be quickly obtained, directly locating the target data without traversing the entire variable-length region.
[0047] In this embodiment of the invention, the orderly storage and access efficiency of encrypted data are effectively improved through regional storage and logical association design. The ciphertext digest and index of the first ciphertext data are stored in a fixed-length region, which is adapted to its fixed length and the need for fast reading, facilitating rapid location later. The second ciphertext data (including metadata and key identifier) and the third ciphertext data (complete unit) are stored in variable-length regions respectively, which flexibly adapts to the possible length changes of the two types of ciphertext, avoiding space waste or data truncation caused by fixed-length storage. At the same time, the third ciphertext data is stored in a specific logical segment, further reducing storage chaos. By establishing a logical association between the fixed-length region index and the encrypted data in the variable-length region, an efficient indexing mechanism is formed, which solves the problems of slow data location and difficult association in traditional storage. This allows the encrypted data corresponding to the variable-length region to be quickly found through the index of the fixed-length region during later access, without having to traverse the entire storage area.
[0048] In a preferred embodiment of the present invention, step 6 above may include: Step 6.1: Based on the encrypted data stored in the non-fixed-length region, establish a multi-dimensional spatial coordinate mapping relationship. Based on the multi-dimensional spatial coordinate mapping relationship, convert the encrypted data into a set of data points in the multi-dimensional space. Specifically, the encrypted data stored in the non-fixed-length region includes second ciphertext data (containing metadata and key identifiers) and third ciphertext data (complete data units). Then, analyze the characteristics of these encrypted data to determine the dimensional parameters of the multi-dimensional space. The dimensions can be set to 3-5 dimensions according to the data attributes. For example, the data generation time, data length, corresponding original field sensitivity level, and storage start address can be used as coordinate values for different dimensions. Subsequently, assign a unique multi-dimensional coordinate to each encrypted data block: taking the second ciphertext data as an example, convert its generation time into a timestamp as the x-axis coordinate, the data length as the y-axis coordinate, and the sensitivity level (high, medium, and low corresponding to 1, 2, and 3) as the z-axis coordinate. The third ciphertext data is mapped to the same multi-dimensional space according to similar rules. Through this mapping, each encrypted data block is converted into a data point in the multi-dimensional space, and all data points together constitute a set of data points.
[0049] Step 6.2 involves traversing and sorting the data point set using a continuous space-filling curve. Based on the spatial traversal characteristics of the space-filling curve, the spatial distribution of the data point set is altered, resulting in a spatial traversal of the data point set. Specifically, this includes: selecting a continuous space-filling curve based on the data point set. The characteristic of this type of curve is that it can traverse all points in the multidimensional space along a continuous path, and the path alternates between different regions, avoiding concentration in a single subspace; dividing the multidimensional space into grid cells matching the size of the data point set, ensuring that each data point falls within a unique grid; then forming a continuous path through all grid cells according to the generation rules of the selected space-filling curve; then recording the coordinates of the data points along this path sequentially, assigning a sequence number to each data point according to the traversal order, for example, the first data point is numbered 1, the second 2, and so on; through this traversal sorting, data points that might have been logically adjacent (such as consecutive data blocks in the same field) become dispersed in sequence, completely changing the spatial distribution pattern of the data point set, thus obtaining the spatial traversal result of the data point set.
[0050] Step 6.3: Based on the spatial traversal results of the data point set, logically adjacent data content is redistributed to different physical storage intervals to complete the spatial rearrangement of the data, resulting in rearranged data. Specifically, this includes: starting the spatial rearrangement of the data based on the spatial traversal results of the data point set (i.e., the point numbers sorted by the curve path); firstly, obtaining the physical storage interval division information of non-fixed-length regions, which are independent storage blocks pre-divided into fixed sizes, each block having a unique physical address identifier; then, according to the sequence number of the traversal results, writing the encrypted data blocks associated with the corresponding data points sequentially into different physical storage intervals: for example, the data block corresponding to the data point with sequence number 1 is written to physical interval A, and the one with sequence number 2 is written to physical interval B. Even two data blocks that were originally logically adjacent (such as two sensitive records of the same patient) will be assigned to intervals with discontinuous physical addresses because their sequence numbers are far apart after traversal; during the writing process, the established index mechanism is updated to re-associate the new physical address of each encrypted data block with the original index; after completing the redistribution of all data blocks, the rearranged data is obtained.
[0051] In this embodiment of the invention, spatialization and data rearrangement effectively enhance the anti-leakage capability of encrypted data. A multi-dimensional spatial coordinate mapping is established based on encrypted data in non-fixed-length regions, converting the encrypted data into a set of data points. This provides an operable spatial carrier for data to move away from traditional linear storage and achieve spatial rearrangement, avoiding the association risks caused by data accumulation in a single linear form. A continuous spatial filling curve is used to traverse and sort the data point set. Leveraging the unique spatial traversal characteristics of the curve, the original distribution pattern of the data points is disrupted, further severing the inherent logical connections between data points. Compared to traditional linear storage methods, it is more difficult for attackers to infer association relationships through data location. Based on the traversal results, logically adjacent data content is redistributed to different physical storage areas, completely breaking the strong binding relationship of logical adjacency equaling physical adjacency in traditional storage. Even if data in some physical storage areas is leaked, attackers will find it difficult to piece together complete and valid information from scattered data connections.
[0052] In a preferred embodiment of the present invention, step 7 above may include: Step 7.1: Based on the rearranged data, dynamically determine the sharding parameters according to the current data characteristics, network transmission conditions, and security policy requirements to form a sharding strategy. Specifically, this includes: acquiring the rearranged data and analyzing its data characteristics, including the total data size, the average length of a single data block, and the proportion of data blocks with different sensitivities; simultaneously monitoring the current network transmission conditions, recording the real-time bandwidth, data transmission latency, and current storage load of each edge node; furthermore, reading the preset security policy requirements, including the minimum fragment dispersion (e.g., distributed across at least 5 nodes), the maximum proportion of fragments stored on a single node (e.g., not exceeding 20% of the total fragments), and the fragment redundancy of highly sensitive data blocks (e.g., generating an additional redundant fragment); based on this information, dynamically determine the sharding parameters: fragment size is adapted to network bandwidth (nodes with high bandwidth can have slightly larger fragments, and nodes with low bandwidth can have slightly smaller fragments), the total number of fragments is calculated according to the dispersion requirements of the security policy (e.g., if the total data is 1000KB and a single fragment is 50KB, then at least 20 fragments are generated), and a certain number of redundant fragments are set for highly sensitive data blocks. These parameters are integrated to form a complete sharding strategy.
[0053] Step 7.2, based on the fragmentation strategy, uses dynamic fragmentation calculation to fragment the rearranged data, resulting in multiple independent data fragments. Specifically, this includes: performing dynamic fragmentation calculation based on the fragmentation strategy; firstly, sequentially cutting the rearranged data according to the fragment size determined in the strategy, ensuring that each fragment contains a complete data block unit, such as one fragment corresponding to one or more complete encrypted data blocks, avoiding splitting a single data block into different fragments; for highly sensitive data blocks, generating additional redundant fragments according to the strategy requirements, with redundant fragments having the same content as the original fragments but marked with different fragment numbers; during the cutting process, checking the independence of each fragment in real time: by comparing the data block identifiers contained in the fragments, ensuring that no two fragments contain the same core sensitive information (e.g., multiple records of the same patient will not appear in the same fragment simultaneously), if duplication occurs, adjusting the cutting position and re-framing; after cutting, assigning a unique fragment ID to each fragment (containing data type identifier, fragmentation batch number, and sequence number), ultimately resulting in multiple independent data fragments.
[0054] Step 7.3: Add an invalidation identifier to each data fragment to render the individual fragment unreadable, forming an invalidated fragment set. Specifically, this involves adding an invalidation identifier to each fragment based on its individual data fragment. The invalidation identifier consists of three parts: a randomly generated interference byte, a check sequence associated with the fragment ID (used to verify fragment integrity), and an unauthorized, unresolvable flag (a fixed value). These identifiers are added to the header (interference byte) and tail (check sequence and flag) of each data fragment. For example, for a 50KB fragment, a 5KB random byte is added to the header, and a 1KB check sequence and flag are added to the tail, forming a 56KB fragment with an identifier. After addition, a readability test is performed on each identified fragment to attempt to read its content. If valid data cannot be identified, invalidation is considered successful. If some content can still be identified, it is reconstructed into a longer interference byte and added again. After all fragments pass the test, an invalidated fragment set is formed.
[0055] Step 7.4 involves distributing the invalidated fragment set across multiple edge nodes. By controlling the fragment distribution, it is ensured that the fragments stored on any single node are insufficient to reconstruct the complete data, thus obtaining encrypted data in distributed storage. Specifically, this includes: using the invalidated fragment set as the storage object and performing distributed storage operations. First, suitable nodes are selected from the edge node pool, prioritizing nodes with low load, stable transmission, and good security records. The number of nodes selected must meet the basic requirements for distributed fragment storage. Next, fragments are allocated, following several core rules: avoiding the concentration of fragments with consecutive IDs on the same node; storing fragments of highly sensitive data and their redundant fragments separately on different nodes; controlling the number of fragments stored on a single node within a reasonable range to ensure no leakage risk due to excessive node storage; after fragments are written to nodes, the storage location of each fragment is recorded, including the node identifier and storage path, and this location information is associated with an indexing mechanism for quick location of all relevant fragments during access; finally, the fragment storage status of each node is checked to confirm that no fragment stored on any node can reconstruct the complete data individually or in combination. After confirmation, the encrypted data in distributed storage is obtained.
[0056] In this embodiment of the invention, the collaborative design of dynamic sharding and distributed storage improves the scenario adaptability of encrypted data storage and strengthens anti-leakage security protection. The sharding parameters are dynamically determined based on the characteristics of the rearranged data, network transmission conditions, and security policy requirements (such as fragment dispersion), avoiding the rigidity of traditional fixed sharding strategies that cannot adapt to different environments, making the sharding scheme more aligned with actual application needs. Dynamic sharding calculation based on this sharding strategy yields multiple independent data fragments, ensuring that the sharding results do not compromise the independence of subsequent data processing and are adaptable to the storage capabilities of edge nodes. An invalidation identifier is added to each data fragment, rendering individual fragments unreadable. Even if a fragment is stolen, attackers cannot directly obtain valid information, filling the vulnerability of traditional sharding lacking fragment-level protection. The invalidated fragments are distributed and stored across multiple edge nodes, with strict control over the number of fragments stored on each node, ensuring that no fragment on any node is sufficient to reconstruct complete data, completely resolving the risk of complete data leakage from a single point of failure in traditional centralized storage or simple distributed storage.
[0057] In a preferred embodiment of the present invention, step 8 above may include: Step 8.1: Based on encrypted data from distributed storage, receive and parse statistical query requests to obtain the operation type and data range. Specifically, this includes receiving statistical query requests from business terminals, such as monthly transaction total statistics from the financial system or quarterly outpatient statistics for a specific disease from the medical system. Next, parse the request content to extract the operation type and data range: the operation type includes specific statistical methods such as summation, average, and counting; the data range specifies the statistical time interval, the types of fields involved (such as transaction amount field, outpatient visit field), and the associated table identifiers (such as bank transaction table, hospital visit table). After parsing, verify the permissions of the request initiator to confirm whether they have permission to access the corresponding range of statistical data.
[0058] Step 8.2: Based on the operation type and data range, obtain the corresponding encrypted data fragments from the edge nodes. Based on the encrypted data fragments, perform homomorphic encryption operations while maintaining the ciphertext state. Specifically, this includes: based on the operation type and data range, calling the recorded fragment storage location information to locate the encrypted data fragments in the edge nodes that match the data range; for example, if the data range is the transaction amount from a certain month to a certain year, filter out the edge nodes where the fragments storing the encrypted data related to the transaction amount during that period are located; then, send fragment acquisition requests to these edge nodes. After verifying the legality of the requests, the nodes transmit the corresponding encrypted data fragments to the computing nodes; after receiving the fragments, the computing nodes do not perform decryption processing, but directly load the preset homomorphic encryption operation parameters (such as the public key corresponding to the encryption key and the operation rules), and initialize the homomorphic encryption operation environment while keeping all data fragments in the ciphertext state.
[0059] Step 8.3 involves performing homomorphic encryption operations to directly aggregate calculations on the ciphertext data, obtaining statistical results of the encrypted state. Specifically, this includes: under the prepared ciphertext state and computational environment, performing aggregate calculations on the encrypted data fragments according to the operation type; for summation operations, homomorphic addition is performed to accumulate the numerical items from multiple ciphertext fragments, ensuring each data item remains encrypted throughout the calculation and preventing the leakage of the original value; for averaging operations, the sum is calculated first, followed by the reciprocal of the number of items, and the two are combined to obtain the average result of the encrypted state; for counting operations, homomorphic logic operations are used to count the number of ciphertext data entries that meet the conditions. Throughout the entire aggregation calculation process, all intermediate and final results are in ciphertext form, ensuring the confidentiality of the original encrypted data and eliminating redundant steps of decryption, calculation, and encryption in traditional schemes, thus improving statistical efficiency. After the calculation is completed, the statistical results of the encrypted state are obtained.
[0060] Step 8.4 involves decrypting the statistical results of the encrypted state to obtain the final aggregated analysis data, thus completing the entire data processing flow. Specifically, this includes: after obtaining the statistical results of the encrypted state, first verifying the requester's decryption permissions to confirm whether they have the authority to obtain the final plaintext statistical results; after successful verification, obtaining the decryption key corresponding to the statistical results; then using the decryption key to decrypt the statistical results of the encrypted state, converting the ciphertext statistical results into plaintext aggregated analysis data; after decryption, performing an integrity check on the plaintext results, comparing the checksums before and after decryption to confirm that the results have not been tampered with; after successful verification, returning the final aggregated analysis data to the requester to complete the entire data processing flow.
[0061] In this embodiment of the invention, the layered design of encrypted statistics and result decryption avoids the risk of leakage of original data while ensuring the efficiency and availability of statistical analysis. It receives and parses statistical query requests, clarifies the operation type and data range, and provides clear guidance for accurate fragment acquisition and avoidance of invalid calculations, laying a foundation for efficient processing. Based on the request information, it obtains corresponding encrypted data fragments from edge nodes and initiates homomorphic encryption operations in the encrypted state throughout the process, allowing processing without decrypting the original data, thus completely solving the leakage risk caused by the mandatory decryption of statistics in traditional solutions. Relying on homomorphic encryption, it directly performs aggregation calculations on the encrypted data, ensuring that the original encrypted data is not exposed during the statistical process and eliminating redundant steps of decryption, calculation, and re-encryption, significantly improving statistical efficiency. It only decrypts the encrypted statistical results, not the original encrypted data, further narrowing the decryption scope and reducing security risks. Overall, it achieves the goal of encrypted retention of original data and on-demand decryption of statistical results.
[0062] like Figure 2As shown, embodiments of the present invention also provide a segmented encrypted table-based data storage system, comprising: The analysis module is used to identify application statistics segments, sensitive information fields, and table structure information by analyzing tabular data; The processing module performs irreversible encryption on the application statistical fragments to obtain the first ciphertext data; based on the sensitive information field, it performs iterative operations of multiple rounds of nonlinear and linear transformations, and combines them with a pre-allocated encryption key to obfuscate and diffuse the plaintext data of the sensitive information field to obtain the second ciphertext data; it assembles and integrates the table structure information, the first ciphertext data, and the second ciphertext data to obtain a logically complete encrypted information table; and it performs low-density encryption on the encrypted information table to obtain the third ciphertext data. The storage module is used to store the first ciphertext data, the second ciphertext data, and the third ciphertext data in a set fixed-length area and a variable-length area, respectively. The mapping module is used to map encrypted data in non-fixed-length regions into a set of data points in multi-dimensional space. It traverses and rearranges the data point set based on a continuous space-filling curve, dispersing logically adjacent data contents to different physical storage areas to obtain rearranged data. The calculation module is used to decompose the rearranged data into multiple invalidation fragments through dynamic sharding calculation, and distribute the invalidation fragments to multiple edge nodes to obtain distributed encrypted data. The execution module is used to perform statistical operations directly on encrypted data based on distributed storage using homomorphic encryption to obtain aggregated analysis data without decryption.
[0063] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for storing piecewise-encrypted formula data, characterized by, The method comprises: By analyzing the tabular data, identifying application statistics fragments, sensitive information fields and table structure information; For the application statistics fragments, irreversible encryption processing is performed to obtain first ciphertext data; Based on the sensitive information fields, through the iterative operation processing of multiple rounds of nonlinear transformation and linear transformation, and combined with the pre-allocated encryption key, the plaintext data of the sensitive information fields is confused and diffused to obtain second ciphertext data; The table structure information, the first ciphertext data and the second ciphertext data are assembled and integrated to obtain a logically complete encrypted information table, and low-density encryption processing is performed on the encrypted information table to obtain third ciphertext data; The first ciphertext data, the second ciphertext data and the third ciphertext data are respectively stored in a set fixed-length area and a non-fixed-length area; The encrypted data in the non-fixed-length area is mapped into a data point set in a multi-dimensional space, the data point set is traversed and rearranged based on a continuous space-filling curve, logically adjacent data contents are dispersed to different physical storage intervals to obtain rearranged data; Based on the rearranged data, through dynamic sharding calculation, the data is decomposed into multiple invalidation fragments, and the invalidation fragments are distributed stored in multiple edge nodes to obtain distributed stored encrypted data; Based on the distributed stored encrypted data, statistical operations are directly performed in a ciphertext state through a homomorphic encryption method to obtain aggregated analysis data without decryption.
2. The method of claim 1, wherein, By analyzing the tabular data, identifying application statistics fragments, sensitive information fields and table structure information, comprising: Receiving the tabular data to be processed, and performing structure analysis on the tabular data to extract table header information and data body content; Classifying the data body content based on predefined business rules and data classification strategies to obtain field classification results; Identifying the fields in the field classification results that are used for statistical summary and do not contain personal identity information as application statistics fragments; identifying the fields containing personal identity information or financial data as sensitive information fields; Extracting the table header information to obtain column names, row identifiers and inter-table association relationships; taking the column names, row identifiers and inter-table association relationships as table structure information.
3. The method of claim 2, wherein, For the application statistics fragments, irreversible encryption processing is performed to obtain first ciphertext data, comprising: Taking the application statistics fragments as input data, converting the input data through compression mapping to obtain fixed-length data output, based on the fixed-length data output, performing multiple rounds of bit operations and modulus operations to obtain ciphertext digests with anti-collision characteristics; Associating and binding the ciphertext digests with corresponding data fragment indexes to obtain associated and bound ciphertext digests and indexes; Storing the associated and bound ciphertext digests and indexes in the fixed-length area to form the first ciphertext data.
4. The method of claim 3, wherein, Based on the sensitive information fields, through the iterative operation processing of multiple rounds of nonlinear transformation and linear transformation, and combined with the pre-allocated encryption key, the plaintext data of the sensitive information fields is confused and diffused to obtain second ciphertext data, comprising: Dividing the sensitive information fields into multiple fixed-length data groups; A plurality of rounds of encryption operations are performed on each data packet, i.e., a nonlinear substitution operation is performed, the data packet is obfuscated by looking up a substitution table, and post-substitution data is obtained; The post-substitution data is mapped into a preset geometric space, the positions of data elements are rearranged through space coordinate transformation, and the spatial distribution structure of the data is changed according to a preset traversal path, to obtain spatially rearranged data; Based on the spatially rearranged data, a linear transformation operation is performed, data diffusion is achieved through matrix operations, and post-diffusion data is obtained; Based on the post-diffusion data, in each round of encryption operation, a round key is formed by key expansion calculation in combination with a pre-allocated encryption key, and the round key is mixed with the data packet to complete the iteration operation of the current round; After completing the plurality of rounds of iteration operations, the data packets processed after each round of iteration operation are recombined to obtain second ciphertext data, and the second ciphertext data is associated with corresponding metadata and a key identifier.
5. The method of claim 4, wherein, The table structure information, the first ciphertext data and the second ciphertext data are assembled and integrated to obtain a logically complete encryption information table, the encryption information table is subjected to low-density encryption processing to obtain third ciphertext data, including: Based on the table structure information, a data organization framework is established; According to the data organization framework, the first ciphertext data and the second ciphertext data are logically assembled to obtain an encryption information table; Based on the encryption information table, low-density encryption processing is adopted, fast encryption is performed through a preset number of iteration rounds and a preset linear transformation layer, the processing efficiency is optimized while maintaining data confidentiality, to obtain a processed encryption result; The processed encryption result is serialized and converted to form a third ciphertext data string in a standard format, and based on the third ciphertext data string in the standard format, final third ciphertext data is obtained.
6. The method of claim 5, wherein, The first ciphertext data, the second ciphertext data and the third ciphertext data are respectively stored in a set fixed-length area and a non-fixed-length area, including: The ciphertext digest and the index in the first ciphertext data are stored in the fixed-length area; the second ciphertext data and the corresponding metadata and the key identifier are jointly stored in the non-fixed-length area; and the third ciphertext data is stored as a complete data unit in a specific logical segment of the non-fixed-length area; The index information stored in the fixed-length area is logically associated with the encrypted data content stored in the non-fixed-length area, and based on the established index mechanism, fast positioning and access of data can be achieved.
7. The method of claim 6, wherein, The encrypted data in the non-fixed-length area is mapped into a data point set in a multi-dimensional space, the data point set is traversed and rearranged based on a continuous space-filling curve, logically adjacent data content is dispersed to different physical storage intervals, and rearranged data is obtained, including: Based on the encrypted data stored in the non-fixed-length area, a multi-dimensional space coordinate mapping relationship is established, and the encrypted data is converted into a data point set in a multi-dimensional space based on the multi-dimensional space coordinate mapping relationship; The data point set is sorted by traversing the data point set using a continuous space-filling curve, and the spatial distribution of the data point set is changed based on the space traversal characteristics of the space-filling curve, to obtain a data point set space traversal result; Based on the spatial traversal result of the data point set, the logically adjacent data contents are re-allocated to different physical storage intervals to complete the spatial rearrangement of the data, and rearranged data is obtained.
8. The method of claim 7, wherein, Based on the rearranged data, through dynamic sharding calculation, the data is decomposed into multiple invalidation fragments, and the invalidation fragments are distributed and stored in multiple edge nodes to obtain distributed storage encrypted data, including: Based on the rearranged data, the sharding parameters are dynamically determined according to the current data characteristics, network transmission conditions and security policy requirements to form a sharding strategy; Based on the sharding strategy, the rearranged data is sharded through dynamic sharding calculation to obtain multiple independent data fragments; An invalidation identifier is added to each data fragment to make the single fragment lose direct readability, and an invalidation fragment set is formed; The invalidation fragment set is distributed and stored in multiple edge nodes, and the fragment distribution is controlled to ensure that the fragments stored in any node are insufficient to reconstruct the complete data, so as to obtain distributed storage encrypted data.
9. The method of claim 8, wherein, Based on the distributed storage encrypted data, statistical operation is directly performed in the ciphertext state through homomorphic encryption to obtain aggregation analysis data without decryption, including: Based on the distributed storage encrypted data, the statistical query request is received and parsed to obtain the operation type and data range; According to the operation type and data range, the corresponding encrypted data fragments are obtained from the edge nodes, and homomorphic encryption operation is performed based on the encrypted data fragments while keeping the ciphertext state; Through homomorphic encryption operation, aggregation calculation is directly performed on the ciphertext data to obtain statistical results in the encrypted state; The statistical results in the encrypted state are decrypted to obtain the final aggregation analysis data to complete the entire data processing flow.
10. A segmented encrypted formula data storage system implementing the method of any of claims 1 to 9, characterized in that, Including: The analysis module is used to analyze the table data to identify application statistical fragments, sensitive information fields and table structure information; The processing module is used to perform irreversible encryption processing on the application statistical fragments to obtain first ciphertext data; Based on the sensitive information fields, the plaintext data of the sensitive information fields is confused and diffused through multiple rounds of nonlinear transformation and linear transformation iteration operation processing combined with a pre-allocated encryption key to obtain second ciphertext data; The table structure information, the first ciphertext data and the second ciphertext data are assembled and integrated to obtain a logically complete encrypted information table, and the encrypted information table is subjected to low-density encryption processing to obtain third ciphertext data; The storage module is used to store the first ciphertext data, the second ciphertext data and the third ciphertext data in the set fixed-length area and the non-fixed-length area respectively; The mapping module is used to map the encrypted data in the non-fixed-length area to a data point set in a multi-dimensional space, and the data point set is traversed and rearranged based on a continuous space-filling curve to disperse logically adjacent data contents to different physical storage intervals to obtain rearranged data; The calculation module is used to, based on the rearranged data, through dynamic sharding calculation, decompose the data into multiple invalidation fragments, and distribute and store the invalidation fragments in multiple edge nodes to obtain distributed storage encrypted data. The execution module is used for directly executing statistical operation in a cipher text state through a homomorphic encryption mode based on the distributed storage encryption data, so as to obtain the aggregated analysis data without decryption.