Distributed data privacy protection method and system based on hierarchical encryption

By employing layered encryption and distributed storage, the risk of data leakage caused by the coupling of encrypted data and decryption keys is resolved. This achieves dual encryption protection and decentralized storage, thereby enhancing data security and resistance to cracking.

CN122137677APending Publication Date: 2026-06-02SHANDONG SIJI TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANDONG SIJI TECH CO LTD
Filing Date
2026-04-30
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

In existing technologies, the ciphertext data and decryption keys or decryption capabilities are overly coupled in storage or management, resulting in a high risk of overall data leakage. Single-layer encryption mechanisms are weak, and the high coupling between keys and ciphertext allows attackers to obtain ciphertext data and its decryption methods at once, causing irreversible data leakage.

Method used

A distributed data privacy protection method with layered encryption is adopted. By generating first-level and second-level encryption keys, the original data is encrypted in two layers. The target ciphertext is divided into first-level ciphertext fragments and second-level ciphertext fragments, which are stored on different storage server nodes to achieve decentralized storage of ciphertext data.

Benefits of technology

It enhances the anti-cracking capability of data in encrypted storage, prevents the exposure of ciphertext due to the security failure of a single storage node, effectively solves the security risk of excessive coupling between key and ciphertext, and improves the security of data privacy protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122137677A_ABST
    Figure CN122137677A_ABST
Patent Text Reader

Abstract

This invention discloses a distributed data privacy protection method and system based on layered encryption, relating to the field of data security and privacy protection technology. The method includes: acquiring the original data to be protected; generating a first-level encryption key and a second-level encryption key based on the attribute identifiers of the original data; performing a first encryption operation on the original data based on the first-level encryption key to determine intermediate ciphertext; performing a second encryption operation on the intermediate ciphertext based on the second-level encryption key to determine target ciphertext; dividing the target ciphertext into a first ciphertext fragment and a second ciphertext fragment based on a preset data segmentation strategy, and determining fragmentation sequence indication information; and distributing the first ciphertext fragment and the second ciphertext fragment to a first storage server node and a second storage server node respectively for storage based on a first storage allocation strategy. Through the first and second encryption operations, the anti-cracking capability of the data in the encrypted storage state is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data security and privacy protection technology, specifically to a distributed data privacy protection method and system based on layered encryption. Background Technology

[0002] With the increasing demand for data exchange and storage between information systems, the risk of leakage of sensitive data during transmission, storage, and access is becoming increasingly severe. Existing data security protection methods generally employ a single-level encryption operation on the data to be protected, storing the encrypted ciphertext along with the corresponding encryption key or key index in the same storage node or management domain. The strength of this single encryption level highly depends on the confidentiality of the encryption key at that level. Once this key is leaked due to management oversight, internal attacks, or system vulnerabilities, the entire security barrier upon which the encrypted data relies collapses. Attackers can directly recover the ciphertext from plaintext, causing irreversible data leakage. Furthermore, the coupling between the ciphertext data and the key information or authorization credentials necessary for decryption in terms of storage location is too high. In many existing solutions, the ciphertext data and the key materials used for decryption are stored in the same data center or server cluster. When the data center suffers external intrusion or unauthorized internal access, attackers can obtain the ciphertext data and its corresponding decryption methods at once, rendering the encryption protection measures ineffective. Summary of the Invention

[0003] (a) Technical problems to be solved Existing methods often involve excessive coupling between encrypted data and decryption keys or decryption capabilities in storage or management, leading to the risk of overall data leakage. To address the shortcomings of existing technologies, this invention provides a distributed data privacy protection method and system based on layered encryption.

[0004] (II) Technical Solution To achieve the above objectives, the present invention provides the following technical solution: a distributed data privacy protection method based on layered encryption, specifically comprising the following steps: S1. Obtain the original data to be protected, and generate a first-level encryption key and a second-level encryption key based on the attribute identifier of the original data; S2. Based on the first-level encryption key, perform the first encryption operation on the original data to determine the intermediate ciphertext; S3. Based on the second-level encryption key, perform a second encryption operation on the intermediate ciphertext to determine the target ciphertext; S4. Based on the preset data segmentation strategy, the target ciphertext is segmented into a first ciphertext fragment and a second ciphertext fragment, and the fragmentation sequence indication information is determined. S5. Based on the first storage allocation strategy, the first ciphertext fragment and the second ciphertext fragment are distributed to the first storage server node and the second storage server node for storage, respectively.

[0005] Preferably, in step S1, a data write request is received from the data production terminal. Based on the data source identifier carried in the data write request, an identity verification operation is performed on the data production terminal. After the verification is successful, a secure transmission channel is established between the data production terminal and the data production terminal. The raw data stream sent by the data production terminal is received through the secure transmission channel. An integrity verification operation is performed on the raw data stream. After the verification is successful, the raw data to be protected is determined. Obtain the attribute identifiers of the raw data, which include a security sensitivity level identifier and a random factor. Based on the security sensitivity level identifier, determine the value of the number of nested encryption layers. Obtain the secure root key. Based on the secure root key and the first sub-factor of the random factor, generate the first-level encryption key. Based on the first-level encryption key and the second sub-factor of the random factor, generate the second-level encryption key. When the number of nested encryption layers is greater than two, generate subsequent level encryption keys layer by layer based on the encryption key generated in the previous layer and the corresponding next sub-factor, until all level encryption keys that match the number of nested encryption layers are generated.

[0006] Preferably, in step S2, the data structure description information of the original data is obtained, and based on the data structure description information, the starting offset position and encryption range of the first encryption operation are determined. Using the first-level encryption key, the corresponding byte segment of the original data is subjected to the first round of encryption transformation processing at the starting offset position and encryption range of the first encryption operation. After the first round of encryption transformation processing is completed, the intermediate ciphertext is obtained.

[0007] Preferably, in step S3, the data structure description information of the intermediate ciphertext is obtained, the encryption boundary of the second encryption operation is determined based on the data structure description information, and the second-level encryption key is used to perform a second round of encryption transformation on all byte segments of the intermediate ciphertext within the encryption boundary of the second encryption operation. After the second round of encryption transformation is completed, the target ciphertext is obtained.

[0008] Preferably, in step S4, the overall data length value of the target ciphertext is obtained, the segmentation granularity parameter and segmentation ratio parameter defined in the preset data segmentation strategy are obtained, the first segmentation boundary position and the second segmentation boundary position are determined in the target ciphertext based on the segmentation granularity parameter, and the target ciphertext is segmented based on the first segmentation boundary position and the second segmentation boundary position to obtain the first ciphertext fragment and the second ciphertext fragment. Based on the original arrangement order of the first and second ciphertext fragments in the target ciphertext, fragment sequence indication information is generated, wherein the fragment sequence indication information includes at least the sequence identifier of the first ciphertext fragment, the sequence identifier of the second ciphertext fragment, and the splicing order relationship between the two.

[0009] Preferably, in step S5, the first running status information of the first storage server node and the second running status information of the second storage server node are obtained; Based on the first operating status information, the first current load weight of the first storage server node is determined. Based on the second operating status information, the second current load weight of the second storage server node is determined. Based on the first current load weight and the second current load weight, it is determined whether the difference between the two exceeds the difference threshold. When the difference exceeds the difference threshold and the first current load weight is greater than the second current load weight, the data size allocated to the first ciphertext fragment is reduced, and the data size allocated to the second ciphertext fragment is increased accordingly to determine the adjusted distribution ratio. According to the adjusted distribution ratio, the target ciphertext is re-segmented to obtain the updated first and second ciphertext fragments; Based on the first current load weight and the second current load weight, the distribution order is determined, wherein the storage server node with the lower current load weight is taken as the priority write target. According to the determined distribution order, the corresponding ciphertext fragment is first written to the storage server node pointed to by the priority write target, and after receiving the confirmation response, another ciphertext fragment is written to another storage server node. Based on the first operating status information, the first current load weight of the first storage server node is determined, including the following steps: Extract the instantaneous CPU utilization, network bandwidth utilization, concurrent read / write request queue length, and available storage space from the first running status information; Based on the preset state mapping rules, the instantaneous occupancy rate of the central processing unit is converted into a processor state score, the network bandwidth utilization rate is converted into a network state score, the concurrent read / write request queue length is converted into a queue state score, and the available storage space is converted into a storage state score. The processor status score, network status score, queue status score, and storage status score are weighted and summed, and the result is determined as the first current load weight.

[0010] Preferably, the method further includes obtaining a data access request, the data access request carrying the attribute identifier of the visitor, and obtaining the first ciphertext fragment and the second ciphertext fragment from the first storage server node and the second storage server node respectively based on the attribute identifier of the visitor. Based on the fragmentation sequence indication information, a reassembly operation is performed on the first ciphertext fragment and the second ciphertext fragment to determine the reassembled target ciphertext. Based on the visitor's attribute identifier, a first decryption assistance request is sent to the first decryption management server. Based on the first decryption assistance request, the first decryption management server performs the first stripping operation on the target ciphertext to determine the intermediate ciphertext. Specifically, this includes the following steps: Based on the attribute identifier carried in the first decryption assistance request, an outer decryption permission verification operation is performed on the visitor. After the verification is successful, the first decryption parameter, which is pre-allocated and stored in the first decryption management server, is obtained. The first decryption parameter has a decryption correspondence with the second-level encryption key. The header identifier area of ​​the target ciphertext is read to obtain the encryption strategy identifier and encryption initialization vector used in the outer encryption operation. The block length and iteration round of the outer decryption operation are determined based on the encryption strategy identifier. The parameter component that matches the length value of the block length is extracted from the first decryption parameter. According to the iteration round, the outer decryption operation sequence for the target ciphertext is constructed using the parameter component and the encryption initialization vector. The outer decryption operation sequence defines the order in which byte replacement and position permutation are performed on the ciphertext body of the target ciphertext in each round. The outer decryption operation sequence is used to perform decryption transformation on the ciphertext body of the target ciphertext in order to strip away the outer encryption shell of the target ciphertext. After the decryption and transformation process is completed, the intermediate ciphertext is obtained. The intermediate ciphertext is then encapsulated in a temporary session security container and forwarded to the second decryption management server through the intranet channel. After confirming that the second decryption management server has received the intermediate ciphertext, the copy of the intermediate ciphertext generated inside the first decryption management server is destroyed. Based on the intermediate ciphertext, a second decryption assistance request is sent to the second decryption management server. Based on the second decryption assistance request, the second decryption management server performs a second stripping operation on the intermediate ciphertext to determine the original data, including the following steps: Receive the temporary session security container forwarded by the first decryption management server through the intranet channel, and extract the intermediate ciphertext from the temporary session security container; Based on the attribute identifier carried in the second decryption assistance request, an inner decryption permission verification operation is performed on the visitor. After the verification is successful, the second decryption parameter, which is pre-allocated and stored in the second decryption management server, is obtained. The second decryption parameter has a decryption correspondence with the first-level encryption key. The middle header identifier area of ​​the intermediate ciphertext is read to obtain the inner encryption strategy identifier and the inner encryption initialization vector used in the inner encryption operation. The block length and iteration round of the inner layer decryption operation are determined based on the inner layer encryption strategy identifier. The parameter component that matches the block length of the inner layer decryption operation is extracted from the second decryption parameter. Based on the iteration round of the inner layer decryption operation, the inner layer decryption operation sequence for the intermediate ciphertext is constructed using the parameter component and the inner layer encryption initialization vector. The inner layer decryption operation sequence defines the order in which byte replacement and position permutation are performed on all byte segments of the intermediate ciphertext in each round. The inner decryption operation sequence is used to perform decryption transformation on all byte segments of the intermediate ciphertext in order to strip away the inner encryption shell of the intermediate ciphertext. After the decryption and transformation are completed, the original data is obtained and returned to the party that initiated the data access request through a secure transmission channel.

[0011] This invention also provides a distributed data privacy protection system based on layered encryption, comprising: Key generation module: Obtains the original data to be protected, and generates a first-level encryption key and a second-level encryption key based on the attribute identifiers of the original data; First encryption operation module: Based on the first-level encryption key, it performs the first encryption operation on the original data to determine the intermediate ciphertext; Second encryption operation module: Based on the second-level encryption key, it performs a second encryption operation on the intermediate ciphertext to determine the target ciphertext; Ciphertext segmentation module: Based on a preset data segmentation strategy, the target ciphertext is segmented into a first ciphertext fragment and a second ciphertext fragment, and the fragmentation sequence indication information is determined; Storage allocation module: Based on the first storage allocation strategy, the first ciphertext fragment and the second ciphertext fragment are distributed to the first storage server node and the second storage server node for storage, respectively.

[0012] (III) Beneficial Effects This invention provides a distributed data privacy protection method and system based on layered encryption, which has the following beneficial effects: This invention constructs a two-layer protection structure for the original data through a first encryption operation and a second encryption operation, which improves the anti-cracking ability of the data in the encrypted storage state and effectively solves the problem of high security vulnerability of single-layer encryption mechanism. By dividing the target ciphertext into a first ciphertext fragment and a second ciphertext fragment and storing them on the first storage server node and the second storage server node respectively, the ciphertext data is distributed and stored. Each storage server node only holds an incomplete target ciphertext fragment. The security failure of a single storage node will not lead to the overall exposure of the target ciphertext. This effectively solves the security risk problem of excessive coupling between key and ciphertext in the prior art. Attached Figure Description

[0013] Figure 1This is a flowchart of the method of the present invention; Figure 2 This is a diagram showing the relationship between key generation and encryption levels in this invention. Figure 3 This is a system block diagram of the present invention. Detailed Implementation

[0014] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0015] Please see Figures 1-2 This invention provides a distributed data privacy protection method based on layered encryption, comprising the following steps: S1. Obtain the original data to be protected, and generate a first-level encryption key and a second-level encryption key based on the attribute identifier of the original data; Furthermore, in S1, a data write request is received from the data production terminal. Based on the data source identifier carried in the data write request, an identity verification operation is performed on the data production terminal. After the verification is passed, a secure transmission channel is established between the data production terminal and the data production terminal. The original data stream sent by the data production terminal is received through the secure transmission channel. An integrity verification operation is performed on the original data stream. After the verification is passed, the original data to be protected is determined. Obtain the attribute identifiers of the raw data, which include a security sensitivity level identifier and a random factor. Based on the security sensitivity level identifier, determine the value of the nested encryption layer, where the value is at least two layers. Obtain the secure root key. Based on the secure root key and the first sub-factor of the random factor, generate the first-level encryption key. Based on the first-level encryption key and the second sub-factor of the random factor, generate the second-level encryption key. When the number of nested encryption layers is greater than two, generate subsequent level encryption keys layer by layer based on the encryption key generated in the previous layer and the corresponding next sub-factor, until all level encryption keys that match the number of nested encryption layers are generated.

[0016] It should be noted that during the stage of acquiring the original data to be protected, a data write request is received from the data production terminal. The data write request carries a data source identifier used to identify the legitimacy of the data source. After receiving the data write request, the data encryption terminal performs an identity verification operation on the data production terminal based on the data source identifier to confirm that the data production terminal has the authorization to write data to this system. After the identity verification operation is successful, a secure transmission channel is established between the data encryption terminal and the data production terminal. The secure transmission channel is used to provide data confidentiality and data integrity protection between the data encryption terminal and the data production terminal, preventing the original data from being eavesdropped or tampered with during transmission. Through the secure transmission channel, the data encryption terminal receives the original data stream sent by the data production terminal. After receiving the original data stream completely, the data encryption terminal performs an integrity check operation on the original data stream to verify whether any bytes have been lost or erroneous during transmission. This ensures that the received data content is completely consistent with the data content sent by the data production terminal. Only when the integrity check operation results in a successful check can the data encryption terminal identify the original data stream as the original data to be protected. After identifying the original data to be protected, the data encryption terminal performs a multi-level encryption key generation process based on the attribute identifier of the original data. The attribute identifier of the original data is a set of descriptive information associated with the original data, which includes two parts: security sensitivity level identifier and random factor. The security sensitivity level identifier is used to characterize the importance of the original data in terms of confidentiality. Different security sensitivity levels correspond to different numbers of nested encryption layers. The data encryption terminal determines the value of the number of nested encryption layers based on the security sensitivity level identifier. This value is at least two layers to ensure that even if the outer encryption mechanism is compromised, the inner encryption mechanism can still provide a second layer of protection for the original data. The random factor, as another component of the attribute identifier, is generated by the data production terminal when generating a data write request and is provided along with the request. It contains multiple distinct sub-factors, each of which is used to generate the corresponding level of encryption key. After determining the number of nested encryption layers, the data encryption terminal begins to generate encryption keys layer by layer. First, the data encryption terminal obtains the security root key, which is pre-configured in its internal secure storage area. The security root key is the initial seed for generating encryption keys at all levels and has the highest security level. It is only accessed and used in the trusted execution environment of the data encryption terminal. Based on the secure root key and the first sub-factor in the random factor, the data encryption terminal performs a key generation operation to obtain the first-level encryption key. The specific implementation of the first-level encryption key generation operation is as follows: the secure root key and the first sub-factor are combined in a predetermined concatenation order, and a one-way transformation process is performed on the combination result to output a first-level encryption key with a fixed length. Since the one-way transformation process has the irreversible property, the secure root key cannot be derived from the first-level encryption key, thus ensuring the security of the root key. The data encryption terminal generates a second-level encryption key based on the generated first-level encryption key and the second sub-factor in the random factor using the same type of one-way transformation processing. The first-level encryption key and the second sub-factor are combined in a predetermined concatenation order, and the combination result is subjected to one-way transformation processing to obtain the second-level encryption key. When the number of nested encryption layers is greater than two, the data encryption terminal continues to generate encryption keys for subsequent layers in a progressive order. The encryption key generated at each layer is used as the input key for generating the key for the next layer. The key is then combined with the sub-factors in the random factors corresponding to that layer and subjected to one-way transformation processing. For example, when generating the third-level encryption key, the data encryption terminal combines the second-level encryption key with the third sub-factor in the random factors and performs one-way transformation processing to obtain the third-level encryption key. There is a strict dependency between the encryption keys at each level. That is, the encryption key at the next level depends on the encryption key at the previous level and the corresponding sub-factors, while the encryption key at the lowest level indirectly depends on the security root key. Finally, all the encryption keys generated at each level are temporarily stored in the secure cache area inside the data encryption terminal in hierarchical order. Specifically, the steps for identity verification are as follows: During the process of performing identity verification on the data production terminal, the data encryption terminal performs multi-level legality verification based on the data source identifier carried in the data write request to ensure that only authorized data production terminals can submit the original data to be protected to this system. The data source identifier is a piece of identity credential information attached by the data production terminal when initiating the data write request. It contains at least two components: a unique terminal identifier and a terminal authentication credential. After receiving the data write request, the data encryption terminal first extracts the unique terminal identifier from the data source identifier in the protocol header area of ​​the write request. The terminal unique identifier is an unchangeable, fixed-length character sequence assigned to the data production terminal by the data encryption terminal during the registration phase. It is used to uniquely identify the data production terminal. Based on the authorized terminal registration table, the data encryption terminal compares the extracted terminal unique identifier with the legal terminal identifiers already recorded in the authorized terminal registration table one by one. If the terminal unique identifier does not have a corresponding record in the authorized terminal registration table, the data encryption terminal determines that the data production terminal is an unauthorized terminal, immediately terminates the identity verification operation process, and returns a connection refusal response to the data production terminal. If the terminal unique identifier matches a corresponding record in the authorized terminal registration table, the data encryption terminal further extracts the terminal authentication certificate from the data source identifier. The terminal authentication certificate is a piece of confidential certificate data that is negotiated and generated by the data production terminal and the data encryption terminal during the registration stage. It is stored in the secure storage area of ​​the data production terminal and is submitted with each data write request. The data encryption terminal reads the pre-stored authentication credential associated with the unique identifier of the authorized terminal from the matched authorized terminal registration table. The data encryption terminal performs a byte-by-byte consistency comparison between the received terminal authentication credential and the pre-stored authentication credential. The comparison operation checks whether the lengths of the two authentication credentials are the same and whether the values ​​at the corresponding byte positions are completely the same. If the comparison result shows that there is a difference in length or a difference in value at any corresponding byte position, the data encryption terminal determines that the identity verification has failed and refuses to establish a subsequent secure transmission channel. After the terminal's unique identifier and terminal authentication credential pass the above verification steps, the data encryption terminal does not immediately declare that the identity verification has passed. Instead, it performs a further round of dynamic challenge-response verification. The data encryption terminal is equipped with a random number generation unit, which generates a time-sensitive random challenge value during each identity verification operation. The random challenge value is a one-time, fixed-length random byte sequence, which is formed by combining the current count value of the clock counter inside the data encryption terminal with the output value of the hardware noise source. The data encryption terminal sends the random challenge value to the data production terminal through the response channel of the data write request, and requires the data production terminal to return the corresponding response value within the specified time window. After receiving a random challenge value, the data production terminal uses the response derivation credential shared with the data encryption terminal stored internally to perform a one-way transformation on the random challenge value to obtain a response value. The data encryption terminal synchronously uses the same response derivation credential to perform a one-way transformation on the same random challenge value and compares the locally generated response value with the received response value. If the two response values ​​are completely consistent, the data encryption terminal finally confirms that the identity verification operation of the data production terminal has passed and allows the next stage of the secure transmission channel establishment process to proceed. If the response values ​​do not match, or if the data production terminal fails to return a response value within the specified time window, the identity verification operation ends in failure, and the data encryption terminal releases the resources occupied by this request and records the corresponding failure event. Through the aforementioned triple identity verification mechanism, which includes terminal unique identifier verification, terminal authentication credential comparison, and dynamic challenge response verification, the data encryption terminal can effectively identify the true identity of the data production terminal and prevent unauthorized terminals from forging data source identifiers to bypass access control.

[0017] S2. Based on the first-level encryption key, perform the first encryption operation on the original data to determine the intermediate ciphertext; Furthermore, in step S2, the data structure description information of the original data is obtained. Based on the data structure description information, the starting offset position and encryption range of the first encryption operation are determined. Using the first-level encryption key, the corresponding byte segment of the original data is subjected to the first round of encryption transformation processing at the starting offset position and encryption range of the first encryption operation. After the first round of encryption transformation processing is completed, the intermediate ciphertext is obtained.

[0018] It should be noted that the first layer of encryption protection is applied to the original data using the first-level encryption key, thereby converting the original data into intermediate ciphertext. The first encryption operation obtains the data structure description information of the original data through the data encryption terminal. The data structure description information is a piece of metadata attached to the original data, which records the organization of the original data in memory or storage medium. Specifically, it includes the total byte length of the original data, the starting byte offset of the data body, and the ending byte offset of the data body. The raw data may contain additional fields for non-encryption purposes, such as version identifier fields or checksum fields, which should not be included in the scope of encryption operations. The data structure description information defines which byte segments in the raw data belong to the payload part that needs to be encrypted and which byte segments belong to the reserved part that should be kept as is. The data encryption terminal parses the data structure description information, reads the starting byte offset of the data body, and determines the offset as the starting offset position of the first encryption operation. The data encryption terminal reads the ending byte offset of the data body from the data structure description information, calculates the byte span between the starting offset position and the ending byte offset position, and determines the continuous byte range covered by the byte span as the encryption range of the first encryption operation. After determining the starting offset position and encryption range of the first encryption operation, the data encryption terminal uses the first-level encryption key that has been generated and temporarily stored in the security cache area to perform the first round of encryption transformation processing on the corresponding byte segment within the encryption range. The specific steps of the first round of encryption transformation processing are as follows: The data encryption terminal first divides the byte segment within the encryption range into several byte groups of equal length according to the preset group length value. The value of the byte group length is determined by the data encryption terminal during initialization according to the security strength requirements and is a fixed value, for example, the group length is determined to be sixteen bytes or thirty-two bytes. If the actual length of the last byte block within the encryption range is less than the preset block length, the data encryption terminal will use padding to add padding bytes to the end of the block so that its length reaches the preset block length value. The data encryption terminal uses the first-level encryption key as the transformation driving parameter and performs a rotation process on each byte group in sequence. For a single byte group, the rotation process includes two sub-operations: byte position rearrangement and byte value transformation. The byte position rearrangement sub-operation refers to rearranging each byte in the byte group according to the position mapping sequence derived from the first-level encryption key. The position mapping sequence is generated as follows: take a byte at a specified offset position in the first-level encryption key, take the remainder of the byte's value divided by the total number of bytes in the group to obtain the first mapping position, take the byte at the next offset position in the first-level encryption key, and obtain the second mapping position in the same way. Repeat the above operation until the number of mapping position sequences equal to the total number of bytes in the group is obtained, and each position value in the mapping position sequence is unique. After the byte position rearrangement sub-operation is completed, the original order of each byte in the byte group is completely disrupted, forming a new arrangement. The byte value transformation sub-operation refers to replacing the binary value of each byte based on the byte position rearrangement. The data encryption terminal constructs a replacement reference table based on the continuous byte stream in the first-level encryption key. The replacement reference table is 256 bytes long and covers all possible value ranges of a single byte. For each byte in the byte block, the data encryption terminal uses the current value of the byte as the offset, reads the byte value at the corresponding offset position from the replacement reference table, and replaces the original value of the byte with the read value. After completing the two sub-operations of byte position rearrangement and byte value transformation for a byte block, the data encryption terminal performs an XOR operation on the byte block and the rotation constant in the first-level encryption key. The data encryption terminal performs the above-mentioned rotation process, which includes byte position rearrangement, byte value transformation and XOR mixing operation, on each byte group within the encryption range according to the byte group division order. After completing the rotation process on all byte groups, the data encryption terminal removes the padding bytes that were previously added to the end of the last byte group to meet the group length requirement, and restores the original byte length of the data body within the encryption range. The data encryption terminal concatenates the encrypted byte segment that has undergone encryption transformation with the reserved byte segment in the original data that is outside the encryption scope. The concatenation operation follows the layout order indicated by the original data structure description information, that is, the reserved byte segment is placed before or after the encrypted byte segment, so that the concatenated data as a whole still conforms to the structure specification of the original data. The concatenated data as a whole is the intermediate ciphertext generated by the first encryption operation. The data encryption terminal stores the intermediate ciphertext completely in its internal secure cache area. Through the execution of the first encryption operation, the payload portion of the original data undergoes byte-level rearrangement and numerical replacement while maintaining the integrity of the data structure. Its original content characteristics are completely masked by the encryption transformation driven by the first-level encryption key. Even if an attacker obtains the intermediate ciphertext in subsequent processes, due to the lack of the first-level encryption key, they cannot restore the rearranged and replaced byte segments in the intermediate ciphertext to the payload of the original data. Thus, the first layer of security is provided for the original data in the inner layer of the nested encryption system.

[0019] S3. Based on the second-level encryption key, perform a second encryption operation on the intermediate ciphertext to determine the target ciphertext; Furthermore, in step S3, the data structure description information of the intermediate ciphertext is obtained. Based on the data structure description information, the encryption boundary of the second encryption operation is determined. Using the second-level encryption key, within the encryption boundary of the second encryption operation, a second round of encryption transformation processing is performed on all byte segments of the intermediate ciphertext. After the second round of encryption transformation processing is completed, the target ciphertext is obtained.

[0020] It should be noted that after completing the first encryption operation and obtaining the intermediate ciphertext, the data encryption terminal immediately enters the second encryption operation stage. The second encryption operation is the outer encryption step in the nested encryption system. The data encryption terminal first obtains the data structure description information of the intermediate ciphertext. The intermediate ciphertext is the output product of the first encryption operation. When it is generated, a piece of data structure description information is attached. The data structure description information records the total byte length of the intermediate ciphertext, the starting byte offset of the payload part, the ending byte offset of the payload part, and the layout of each byte segment inside the intermediate ciphertext. Since the first encryption operation only applies encryption transformation to the payload portion of the original data, the intermediate ciphertext is actually composed of the encrypted byte segment that has undergone the first round of encryption transformation and the reserved byte segment that has not undergone encryption. The data encryption terminal parses the data structure description information of the intermediate ciphertext, reads the start byte offset and end byte offset of the intermediate ciphertext, and determines the entire continuous byte range between the start byte offset and the end byte offset as the encryption boundary of the second encryption operation. The encryption boundary of the second encryption operation covers all byte segments of the intermediate ciphertext. That is, whether it is the transformed byte segment generated by the first encryption operation or the reserved byte segment that did not participate in the first encryption operation, it is included in the scope of the second encryption operation. After determining the encryption boundary of the second encryption operation, the data encryption terminal uses the second-level encryption key that has been previously generated and temporarily stored in the security cache area to perform a second round of encryption transformation on all byte segments of the intermediate ciphertext located within the encryption boundary. The specific steps of the second round of encryption transformation are as follows: The data encryption terminal first divides all byte segments within the encryption boundary into several byte groups of equal length according to the group length value associated with the second-level encryption key. The value of the group length is determined by the data encryption terminal during system initialization based on the security strength requirements. For the last byte block within the encryption boundary, if its actual length is less than the preset block length, the data encryption terminal uses padding to append padding bytes to the end of the byte block, making its length reach the preset block length value. The padding byte value is determined by the data encryption terminal according to padding rules; for example, padding bytes are inserted at each required byte position, and the value of the padding byte is equal to the number of bytes to be padded. Subsequently, the data encryption terminal uses the second-level encryption key as the transformation driving parameter to perform rotation processing on each byte block sequentially. For a single byte group, the rotation process includes two sub-operations: byte position rearrangement and byte value transformation. Both of these sub-operations are executed independently based on the parameters derived from the second-level encryption key and are not related to the first-level encryption key derived parameters used in the corresponding sub-operations of the first encryption operation. The specific steps of the byte position rearrangement sub-operation are as follows: Take a byte at the specified offset position in the second-level encryption key, take the remainder of the value of the byte with respect to the total number of bytes in the block, and obtain the first mapping position; take the byte at the next offset position in the second-level encryption key, and obtain the second mapping position in the same way. Repeat the above steps until a sequence of mapping positions equal to the total number of bytes in the block is obtained. During the generation of the mapping position sequence, if a mapping position value is repeated with an already generated mapping position value, the current byte is skipped and the byte at the next offset position in the second-level encryption key is taken and recalculated until a complete mapping position sequence with no repetition is obtained. The byte position rearrangement sub-operation moves each byte in the byte group from its original position to the new position indicated by the corresponding sequence number in the sequence according to the mapping position sequence. The specific steps of the byte value transformation sub-operation are as follows: The data encryption terminal constructs a replacement reference table based on the continuous byte stream in the second-level encryption key. The replacement reference table is constructed by reading the byte stream of the second-level encryption key byte by byte from the beginning position. If the 256 bytes are not filled when the end of the key is reached, the reading is reversed to the beginning position of the key and the reading continues until the replacement reference table with a length of 256 bytes is filled. For each byte in a byte block, the data encryption terminal uses the current value of the byte as an offset, reads the byte value at the corresponding offset position from the replacement reference table, and replaces the original value of the byte with the read value. After completing the two sub-operations of byte position rearrangement and byte value transformation for a byte block, the data encryption terminal performs an XOR operation on the byte block and the rotation constant in the second-level encryption key. The specific method of the XOR operation is as follows: the byte block is divided into several segments of equal length to the rotation constant in sequence, and each segment is XORed bit by bit with the rotation constant. The result of the operation overwrites the original byte content of the segment. The rotation constant is a continuous byte segment at a fixed offset position in the second-level encryption key, and its length matches the segment length of the byte block.

[0021] After completing the rotation process of all byte blocks, the data encryption terminal removes the padding bytes that were previously added to the end of the last byte block to meet the block length requirement, restoring the original byte length of the data body within the encryption boundary. Since the encryption boundary of the second encryption operation covers all byte segments of the intermediate ciphertext, the data after removing the padding bytes is the target ciphertext generated by the second encryption operation.

[0022] S4. Based on the preset data segmentation strategy, the target ciphertext is segmented into a first ciphertext fragment and a second ciphertext fragment, and the fragmentation sequence indication information is determined. Furthermore, in step S4, the total data length value of the target ciphertext is obtained, the segmentation granularity parameter and segmentation ratio parameter defined in the preset data segmentation strategy are obtained, the first segmentation boundary position and the second segmentation boundary position are determined in the target ciphertext based on the segmentation granularity parameter, and the target ciphertext is segmented based on the first segmentation boundary position and the second segmentation boundary position to obtain the first ciphertext fragment and the second ciphertext fragment. Based on the original arrangement order of the first and second ciphertext fragments in the target ciphertext, fragment sequence indication information is generated, wherein the fragment sequence indication information includes at least the sequence identifier of the first ciphertext fragment, the sequence identifier of the second ciphertext fragment, and the splicing order relationship between the two.

[0023] It should be noted that before the segmentation operation begins, the data encryption terminal first obtains the total data length value of the target ciphertext. The total data length value is a numerical attribute of the target ciphertext that has been determined since the output of the second encryption operation. It represents the number of consecutive bytes occupied by the target ciphertext in memory or storage medium. The data encryption terminal reads the storage record of the target ciphertext in the secure cache area, extracts the byte count information of the target ciphertext, and thus obtains the overall data length value. The data encryption terminal obtains the segmentation granularity parameter and segmentation ratio parameter defined in the preset data segmentation strategy. The segmentation granularity parameter is used to specify the minimum alignment unit of the segmentation operation, and its value is determined by the data encryption terminal during the system initialization phase based on the data block writing characteristics of the storage server node. The introduction of the granularity parameter ensures that the slicing operation is always performed at an integer multiple of the granularity parameter, thereby guaranteeing that the ciphertext fragments obtained after slicing can be aligned with the data block boundaries of the storage server nodes when written, improving data writing efficiency and storage space utilization. The slicing ratio parameter is used to specify the relative proportion of the data size between the first ciphertext fragment and the second ciphertext fragment. Its value is determined by the data encryption terminal according to the system configuration. The slicing ratio parameter determines how the total data size of the target ciphertext is distributed between the first ciphertext fragment and the second ciphertext fragment. Different slicing ratio parameters can adapt to the differences in storage capacity or load balancing requirements of different storage server nodes. After obtaining the overall data length value, segmentation granularity parameter, and segmentation ratio parameter, the data encryption terminal begins to determine the positions of the first and second segmentation boundaries. Using the segmentation granularity parameter as the base unit, the data encryption terminal divides the overall data length value of the target ciphertext by the segmentation granularity parameter and performs a floor operation on the division result to obtain the number of complete granularity units contained in the target ciphertext. The data encryption terminal allocates the number of complete granular units according to the data volume ratio between the first and second ciphertext fragments specified by the segmentation ratio parameter. For example, when the segmentation ratio parameter is 1:1, the data encryption terminal divides the number of complete granular units into two equal parts, that is, divides the number of complete granular units by two and takes the integer quotient, which is the number of granular units that should be included in the first ciphertext fragment. The remaining number of granular units is allocated to the second ciphertext fragment. When the segmentation ratio parameter is 2:1, the data encryption terminal allocates the number of complete granular units in a 2:1 ratio, that is, the first ciphertext fragment is allocated two-thirds of the number of granular units, and the second ciphertext fragment is allocated one-third of the number of granular units. After determining the first ciphertext fragment... After determining the number of granular units that a fragment should contain, the data encryption terminal multiplies this number by the fragmentation granularity parameter to obtain the first fragmentation boundary position. The first fragmentation boundary position is the byte offset from the start byte of the target ciphertext to the end position of the first ciphertext fragment. The second fragmentation boundary position is the end position of the target ciphertext, which is the byte offset corresponding to the total data length value. The first and second fragmentation boundary positions together define the respective coverage range of the first and second ciphertext fragments in the target ciphertext: the first ciphertext fragment covers all byte segments of the target ciphertext from the start position to the first fragmentation boundary position, and the second ciphertext fragment covers all byte segments of the target ciphertext from the first fragmentation boundary position to the second fragmentation boundary position. After determining the positions of the first and second ciphertext segments, the data encryption terminal performs a segmentation operation on the target ciphertext to obtain the first and second ciphertext segments. The data encryption terminal takes the starting byte of the target ciphertext as the starting point for reading and reads each byte from the starting position to the first ciphertext segment position in sequence. The read continuous byte sequence is treated as an independent data block, and a segmentation header identifier is appended to the head of the data block. The fragment header identifier includes the fragment type identifier, fragment sequence number, and byte length within the fragment. It is used to identify the nature and location of the data block in the subsequent reassembly stage. The data block with the fragment header identifier is the first ciphertext fragment. Starting from the first split boundary, read each byte from the first split boundary to the second split boundary in sequence. Treat the read continuous byte sequence as another independent data block and add a fragment header identifier to the head of the data block to obtain the second ciphertext fragment. After the splitting operation is completed, the first ciphertext fragment and the second ciphertext fragment are temporarily stored as independent ciphertext objects in the secure cache area inside the data encryption terminal. Fragment sequence indication information is metadata used to record the original arrangement order of each ciphertext fragment in the target ciphertext. It provides the necessary order basis for fragment reassembly operation in the subsequent data access stage. The data encryption terminal constructs fragment sequence indication information based on the original arrangement order of the first ciphertext fragment and the second ciphertext fragment in the target ciphertext, that is, the objective fact that the first ciphertext fragment is located at the beginning of the target ciphertext and the second ciphertext fragment is located at the end of the target ciphertext. The fragment sequence indication information includes at least the following three components: The sequence identifiers of the first ciphertext fragment, the sequence identifiers of the second ciphertext fragment, and the splicing order between the two; The sequence identifier of the first ciphertext fragment is a character sequence assigned by the data encryption terminal to uniquely identify the fragment. It can be composed of the fragment sequence number and the fragment generation timestamp. The sequence identifier of the second ciphertext fragment is generated in the same way. The concatenation order means that when reassembling the target ciphertext, the data body of the first ciphertext fragment should be placed before the data body of the second ciphertext fragment, and the two should be joined end to end to form a continuous byte stream.

[0024] S5. Based on the first storage allocation strategy, the first ciphertext fragment and the second ciphertext fragment are distributed to the first storage server node and the second storage server node for storage, respectively.

[0025] Furthermore, in step S5, the first operating status information of the first storage server node and the second operating status information of the second storage server node are obtained. Based on the first operating status information, the first current load weight of the first storage server node is determined. Based on the second operating status information, the second current load weight of the second storage server node is determined. Based on the first current load weight and the second current load weight, it is determined whether the difference between the two exceeds the difference threshold. When the difference exceeds the difference threshold and the first current load weight is greater than the second current load weight, the data size allocated to the first ciphertext fragment is reduced, and the data size allocated to the second ciphertext fragment is increased accordingly to determine the adjusted distribution ratio. According to the adjusted distribution ratio, the target ciphertext is re-segmented to obtain the updated first and second ciphertext fragments; Based on the first current load weight and the second current load weight, the distribution order is determined, wherein the storage server node with the lower current load weight is taken as the priority write target. According to the determined distribution order, the corresponding ciphertext fragment is first written to the storage server node pointed to by the priority write target, and after receiving the confirmation response, another ciphertext fragment is written to another storage server node. Based on the first operating status information, the first current load weight of the first storage server node is determined, including the following steps: Extract the instantaneous CPU utilization, network bandwidth utilization, concurrent read / write request queue length, and available storage space from the first running status information; Based on the preset state mapping rules, the instantaneous occupancy rate of the central processing unit is converted into a processor state score, the network bandwidth utilization rate is converted into a network state score, the concurrent read / write request queue length is converted into a queue state score, and the available storage space is converted into a storage state score. The processor status score, network status score, queue status score, and storage status score are weighted and summed, and the result is determined as the first current load weight.

[0026] It should be noted that after completing the segmentation of the target ciphertext and obtaining the first and second ciphertext fragments, the data encryption terminal enters the distributed storage and distribution stage of the ciphertext fragments, sending the independent first and second ciphertext fragments to the first and second storage server nodes respectively for persistent storage, so that the complete ciphertext data is distributed on different storage devices at the physical storage level. The first storage allocation strategy dynamically adjusts the data allocation ratio between encrypted fragments and the writing order of encrypted fragments based on the real-time operating status of the first and second storage server nodes. Through the dynamic adjustment mechanism, the data encryption terminal can effectively adapt to the differences in load status between storage server nodes, avoiding the problem of increased write latency or write failure caused by writing a large amount of data to high-load nodes. This ensures secure distributed data storage while improving the overall execution efficiency and success rate of data write operations. Before the distribution operation officially begins, the data encryption terminal first obtains the first running status information of the first storage server node and the second running status information of the second storage server node. The first running status information and the second running status information are a set of indicator data reflecting the current workload and resource availability of each storage server node after the data encryption terminal sends status query requests to the first storage server node and the second storage server node respectively. For the first storage server node, the data encryption terminal extracts four specific indicators from the first running status information returned by it: instantaneous CPU occupancy rate, network bandwidth utilization rate, concurrent read / write request queue length, and available storage space balance. The instantaneous CPU utilization rate represents the proportion of clock cycles in which the CPU of the first storage server node is in a non-idle state at the current moment. The network bandwidth utilization rate represents the ratio between the actual amount of data transmitted by the network interface of the first storage server node at the current moment and its maximum transmission capacity. The concurrent read / write request queue length represents the number of read / write operation requests waiting to be processed inside the first storage server node. The available storage space margin represents the number of bytes in the storage medium of the first storage server node that have not yet been occupied. The data encryption terminal uses the same method to extract the above four similar indicators from the second running status information returned by the second storage server node, and uses them as the corresponding status values ​​of the second storage server node. After acquiring the above four indicators, the data encryption terminal converts these indicators into a first current load weight and a second current load weight that comprehensively reflect the load level of the storage server node. For the first storage server node, the data encryption terminal performs indicator conversion operations according to preset state mapping rules. The state mapping rules are a set of conversion relationships determined by the data encryption terminal during the system initialization phase, which specifies the mapping method between different numerical ranges of each indicator and the corresponding state score. For the instantaneous utilization rate of the central processing unit, the data encryption terminal determines the percentage range in which the utilization rate value is located. If the utilization rate is lower than the first utilization threshold, a state score is assigned to the first processor; if the utilization rate is between the first and second utilization thresholds, a state score is assigned to the second processor; if the utilization rate is higher than the second utilization threshold, a state score is assigned to the second processor. Using thresholds, a state score is assigned to the third processor, where the state score of the first processor is less than that of the second processor, and the state score of the second processor is less than that of the third processor. For network bandwidth utilization, the data encryption terminal uses a similar interval judgment method, assigning a corresponding network state score based on the percentage interval in which the utilization value falls. For the concurrent read / write request queue length, the data encryption terminal compares the queue length value with the first queue length threshold and the second queue length threshold, assigning a corresponding queue state score based on the comparison result. For available storage space, the data encryption terminal compares the remaining value with the first storage space threshold and the second storage space threshold. Since a larger available storage space indicates a lighter node load, the assigned storage state score decreases as the remaining space increases. After completing the independent conversion of the four indicators, the data encryption terminal obtains the first processor status score, the first network status score, the first queue status score, and the first storage status score. The data encryption terminal performs a weighted summation operation on these four status scores. The weight coefficients used in the weighted summation operation are set by the data encryption terminal during system initialization. Each status score is multiplied by its corresponding weight coefficient to obtain the weighted score for that item. The four weighted scores are then added one by one, and the sum is the first current load weight of the first storage server node. The larger the value of the first current load weight, the heavier the overall load of the first storage server node at the current moment, and the weaker its ability to process new data write requests. The data encryption terminal uses the same indicator extraction, score conversion, and weighted summation process to calculate the second current load weight of the second storage server node based on the second running status information. After obtaining the first current load weight and the second current load weight, the data encryption terminal determines whether the original ciphertext fragment distribution ratio needs to be adjusted based on these two weight values. The data encryption terminal first calculates the absolute value of the difference between the first current load weight and the second current load weight, and compares the absolute value of the difference with a pre-set difference threshold. The difference threshold is a numerical limit defined internally by the data encryption terminal to determine whether the load difference is significant. Its specific value is determined by historical operating experience during initialization. If the calculated difference does not exceed the difference threshold, it indicates that the load difference between the first storage server node and the second storage server node is still within an acceptable range. The data encryption terminal maintains the distribution ratio of the first ciphertext fragment and the second ciphertext fragment determined based on the preset data splitting strategy unchanged, and directly uses the generated first ciphertext fragment and the second ciphertext fragment to enter the subsequent writing process. If the calculated difference exceeds the difference threshold, the data encryption terminal will further determine the relationship between the first current load weight and the second current load weight. When the difference exceeds the difference threshold and the first current load weight is greater than the second current load weight, it indicates that the load of the first storage server node is significantly higher than that of the second storage server node. Based on this, the data encryption terminal performs a dynamic adjustment operation on the distribution ratio: the data encryption terminal reduces the amount of data allocated to the first ciphertext segment, and at the same time correspondingly increases the amount of data allocated to the second ciphertext segment. The data encryption terminal subtracts an adjustment step size from the number of granular units originally allocated to the first ciphertext segment, and adds the subtracted granular units to the number of granular units originally allocated to the second ciphertext segment. The value of the adjustment step size is dynamically determined by the data encryption terminal based on the segmentation granularity parameter and the current load weight difference. The larger the load weight difference, the larger the adjustment step size. After determining the adjusted distribution ratio, the data encryption terminal re-segments the target ciphertext according to the adjusted distribution ratio. The specific steps of re-segmenting are as follows: The data encryption terminal recalculates the first and second segmentation boundary positions based on the adjusted distribution ratio, segments the target ciphertext according to the new boundary positions, generates updated first and second ciphertext fragments, and updates the byte length information within the fragment header accordingly. The updated first and second ciphertext fragments will replace the original fragment versions and become the data objects that are subsequently written to the storage server nodes. After determining the first and second ciphertext fragments to be written, the data encryption terminal determines the distribution order of the ciphertext fragments based on the first current load weight and the second current load weight. The distribution order refers to the order in which the data encryption terminal writes the first and second ciphertext fragments to the first storage server node and the second storage server node, respectively. The data encryption terminal compares the values ​​of the first current load weight and the second current load weight, and determines the storage server node with the lower current load weight as the priority write target. If the first current load weight is less than the second current load weight, the first storage server node is determined as the priority write target; if the second current load weight is less than the first current load weight, the second storage server node is determined as the priority write target. Lighter-loaded storage server nodes can process data write requests faster. Prioritizing writes to them can effectively shorten the waiting time for a single write operation and avoid blocking issues that may be caused by writing to high-load nodes first. After determining the priority write target, the data encryption terminal starts the write operation according to the determined distribution order. If the priority write target is the second storage server node, the data encryption terminal first establishes a data connection with the second storage server node and sends the second ciphertext fragment as the first write data block to the second storage server node. After successfully receiving and persistently saving the second ciphertext fragment, the second storage server node returns an acknowledgment response to the data encryption terminal. After receiving the acknowledgment response, the data encryption terminal then establishes a data connection with the first storage server node, sends the first ciphertext fragment as the second write data block to the first storage server node, and waits for the first storage server node to return an acknowledgment response. After both the first and second storage server nodes return confirmation responses, the data encryption terminal associates the storage location information of the first and second ciphertext fragments, namely the network address and storage path of the storage server node where the fragment is located, with the previously generated fragment sequence indication information, and saves the association record in the metadata storage area accessible by the access coordination server.

[0027] Furthermore, the method also includes obtaining a data access request, the data access request carrying the visitor's attribute identifier, and obtaining the first ciphertext fragment and the second ciphertext fragment from the first storage server node and the second storage server node respectively based on the visitor's attribute identifier. Based on the fragmentation sequence indication information, a reassembly operation is performed on the first ciphertext fragment and the second ciphertext fragment to determine the reassembled target ciphertext. Based on the visitor's attribute identifier, a first decryption assistance request is sent to the first decryption management server. Based on the first decryption assistance request, the first decryption management server performs the first stripping operation on the target ciphertext to determine the intermediate ciphertext. Specifically, this includes the following steps: Based on the attribute identifier carried in the first decryption assistance request, an outer decryption permission verification operation is performed on the visitor. After the verification is successful, the first decryption parameter, which is pre-allocated and stored in the first decryption management server, is obtained. The first decryption parameter has a decryption correspondence with the second-level encryption key. The header identifier area of ​​the target ciphertext is read to obtain the encryption strategy identifier and encryption initialization vector used in the outer encryption operation. The block length and iteration round of the outer decryption operation are determined based on the encryption strategy identifier. The parameter component that matches the length value of the block length is extracted from the first decryption parameter. According to the iteration round, the outer decryption operation sequence for the target ciphertext is constructed using the parameter component and the encryption initialization vector. The outer decryption operation sequence defines the order in which byte replacement and position permutation are performed on the ciphertext body of the target ciphertext in each round. The outer decryption operation sequence is used to perform decryption transformation on the ciphertext body of the target ciphertext in order to strip away the outer encryption shell of the target ciphertext. After the decryption and transformation process is completed, the intermediate ciphertext is obtained. The intermediate ciphertext is then encapsulated in a temporary session security container and forwarded to the second decryption management server through the intranet channel. After confirming that the second decryption management server has received the intermediate ciphertext, the copy of the intermediate ciphertext generated inside the first decryption management server is destroyed. Based on the intermediate ciphertext, a second decryption assistance request is sent to the second decryption management server. Based on the second decryption assistance request, the second decryption management server performs a second stripping operation on the intermediate ciphertext to determine the original data, including the following steps: Receive the temporary session security container forwarded by the first decryption management server through the intranet channel, and extract the intermediate ciphertext from the temporary session security container; Based on the attribute identifier carried in the second decryption assistance request, an inner decryption permission verification operation is performed on the visitor. After the verification is successful, the second decryption parameter, which is pre-allocated and stored in the second decryption management server, is obtained. The second decryption parameter has a decryption correspondence with the first-level encryption key. The middle header identifier area of ​​the intermediate ciphertext is read to obtain the inner encryption strategy identifier and the inner encryption initialization vector used in the inner encryption operation. The block length and iteration round of the inner layer decryption operation are determined based on the inner layer encryption strategy identifier. The parameter component that matches the block length of the inner layer decryption operation is extracted from the second decryption parameter. Based on the iteration round of the inner layer decryption operation, the inner layer decryption operation sequence for the intermediate ciphertext is constructed using the parameter component and the inner layer encryption initialization vector. The inner layer decryption operation sequence defines the order in which byte replacement and position permutation are performed on all byte segments of the intermediate ciphertext in each round. The inner decryption operation sequence is used to perform decryption transformation on all byte segments of the intermediate ciphertext in order to strip away the inner encryption shell of the intermediate ciphertext. After the decryption and transformation are completed, the original data is obtained and returned to the party that initiated the data access request through a secure transmission channel.

[0028] It should be noted that after the distributed storage of encrypted fragments is completed, the original data is securely stored in the first storage server node and the second storage server node. When a legitimate data accesser needs to read the original data, the data access and decryption recovery phase begins. The data access request is initiated by the data accesser through their terminal device to the access coordination server. The request carries the accesser's attribute identifier, which is a unique identity credential assigned to the accesser by the access coordination server during the registration phase. It contains at least two components: the accesser's identity number and the accesser's authentication code. After receiving a data access request, the access coordination server extracts the visitor's attribute identifier from the request and compares it with the legitimate visitor registration information maintained in the system to preliminarily confirm whether the visitor is qualified to initiate a data access request. After initial confirmation, the access coordination server searches for the fragment storage record associated with the original data in the metadata storage area based on the index information of the original data to be accessed specified in the data access request. The fragment storage record contains the specific storage path of the first encrypted fragment in the first storage server node, the specific storage path of the second encrypted fragment in the second storage server node, and the corresponding fragment sequence indication information. Based on the fragmented storage records, the access coordination server sends fragment retrieval instructions to the first storage server node and the second storage server node respectively. After receiving the fragment retrieval instruction, the first storage server node reads the first encrypted fragment from its storage medium and returns it to the access coordination server. The second storage server node returns the second encrypted fragment in the same way. After receiving both ciphertext fragments, the access coordination server performs a reassembly operation on the first and second ciphertext fragments according to the splicing order recorded in the fragment sequence indication information. The access coordination server reads the fragment header identifier of the first ciphertext fragment, obtains its fragment type identifier and the byte length within the fragment, and extracts the data body portion from the first ciphertext fragment accordingly. The same method is used to extract the data body portion from the second ciphertext fragment. The access coordination server places the data body portion of the first ciphertext fragment first and the data body portion of the second ciphertext fragment last, and combines the two end to end into a continuous byte sequence. The merged byte sequence is the reassembled target ciphertext. After the reassembly operation is completed, the access coordination server obtains a complete ciphertext object that is completely consistent with the target ciphertext generated in the encryption stage.

[0029] After obtaining the reconstructed target ciphertext, the access coordination server initiates the first phase of the collaborative decryption process, requesting the first decryption management server to perform the first stripping operation on the target ciphertext. Based on the visitor's attribute identifier, the access coordination server constructs a first decryption assistance request and encapsulates the target ciphertext into the assistance request, which is then sent to the first decryption management server through a secure communication link. After receiving the first decryption assistance request, the first decryption management server performs an outer decryption permission verification operation on the visitor. The specific steps of the outer decryption permission verification operation are as follows: The first decryption management server extracts the visitor's attribute identifier from the first decryption assistance request and compares it with the outer decryption authorization list maintained internally by the first decryption management server. The outer decryption authorization list records the attribute identifier list of each visitor who has been explicitly granted outer decryption permission. If the extracted attribute identifier exists in the list, the outer decryption permission verification operation passes. If it does not exist, the first decryption management server refuses to perform subsequent stripping operations and returns an insufficient permission response to the access coordination server. After successful verification, the first decryption management server retrieves the pre-allocated first decryption parameter from its internal security parameter storage area. The first decryption parameter is generated by the data encryption terminal during the data encryption stage and corresponds to the second-level encryption key. After completing the encryption operation, the data encryption terminal pre-distributes the first decryption parameter to the first decryption management server through a dedicated secure channel and stores it internally. The first decryption parameter is the inverse transformation driving parameter corresponding to the second-level encryption key in the decryption operation, and the two have a reversible mapping relationship. After obtaining the first decryption parameters, the first decryption management server reads the header identifier area of ​​the target ciphertext. The header identifier area of ​​the target ciphertext is a piece of structured metadata attached to the front of the target ciphertext during the second encryption operation. It records the encryption strategy identifier and encryption initialization vector used by the outer encryption operation. The encryption strategy identifier is an identifier used to describe the specific transformation method of the outer encryption operation. Its value is generated by the data encryption terminal according to the encryption transformation parameters used when the second encryption operation is executed and written into the header of the target ciphertext. The encryption initialization vector is a random byte sequence generated by the data encryption terminal before the second encryption operation begins. It provides the initial state variables for the encryption transformation to avoid the problem of producing the same ciphertext when encrypting the same plaintext with the same key. The first decryption management server reads the block length and iteration rounds of the outer decryption operation from the encryption policy identifier. The block length determines the number of bytes read and transformed each time the outer decryption operation processes the main body of the target ciphertext, and the iteration rounds determine the number of rounds the outer decryption operation needs to repeat the transformation operation. The first decryption management server extracts a continuous byte segment from the first decryption parameter that matches the length value of the block based on the block length value. The first decryption management server constructs the outer decryption operation sequence round by round using the first decryption parameter component and the encryption initialization vector according to the iteration round. For the first round of outer decryption operation, the first decryption management server performs an XOR operation on the encryption initialization vector and the first sub-component in the parameter component. The result is used as the round key for the first round. Based on the round key, the first decryption management server defines the order of byte replacement and position permutation of the ciphertext body of the target ciphertext according to the inverse transformation logic of the outer encryption operation. The order of byte substitution is determined by the substitution mapping table derived from the byte values ​​in the round key, and the order of position substitution is determined by the position mapping sequence obtained by taking the remainder of the byte values ​​in the round key with respect to the block length. After the first round operation sequence is constructed, the first decryption management server continues to use the output state of the first round and the next sub-component in the parameter component to generate the round key for the second round, and defines the operation order for the second round. The above operations are repeated until the operation sequence is constructed for the number of rounds equal to the number of iteration rounds. The operation sequences of all rounds are collectively called the outer decryption operation sequence. The outer decryption operation sequence defines which positions of the ciphertext body should be extracted in each round, what values ​​should be replaced with these bytes, and which new positions should be placed in these bytes. After constructing the outer decryption operation sequence, the first decryption management server uses the outer decryption operation sequence to perform decryption transformation processing on the ciphertext body of the target ciphertext. The decryption transformation processing starts from the first byte block of the ciphertext body and strictly follows the round order specified by the outer decryption operation sequence and the byte-level operation order within each round to perform byte replacement and position permutation round by round and group by group on the ciphertext body. In each round, the first decryption management server reads the current byte block, replaces the value of each byte with the value at the corresponding position in the table according to the replacement mapping table corresponding to the round, then rearranges the replaced bytes according to the position mapping sequence corresponding to the round, and finally performs an XOR operation on the byte block and the round key of the round to complete one round of transformation. After all iterations of transformation, the original outer encryption shell of the ciphertext body is peeled off layer by layer, and its content is restored to the state before the second encryption operation is executed, that is, the intermediate ciphertext generated by the first encryption operation. After the decryption transformation is completed, the first decryption management server obtains the complete intermediate ciphertext and encapsulates the intermediate ciphertext into a temporary session security container. The temporary session security container is a protected data area built in memory by the first decryption management server. It has independent access control attributes and only allows the second decryption management server to read it through the internal network channel. The first decryption management server forwards the temporary session security container containing the intermediate ciphertext to the second decryption management server through the internal network channel. The intranet channel is a dedicated, non-public network connection between the first decryption management server and the second decryption management server. It is used only for secure data exchange between the two decryption management servers. After the first decryption management server confirms that the second decryption management server has successfully received the temporary session security container, the first decryption management server immediately destroys the intermediate ciphertext copy generated inside it, that is, it releases the memory area occupied by the temporary session security container and clears all residual data in the memory area, ensuring that the intermediate ciphertext will not leave any recoverable trace inside the first decryption management server. After the first decryption management server completes the first stripping operation and forwards the intermediate ciphertext to the second decryption management server, the second decryption management server immediately starts the second stripping operation. The second decryption management server receives the temporary session security container forwarded by the first decryption management server through the intranet channel and extracts the intermediate ciphertext from the temporary session security container. The second decryption management server receives the second decryption assistance request indirectly forwarded by the access coordination server through the first decryption management server, or directly receives the second decryption assistance request sent separately from the access coordination server. The second decryption assistance request also carries the accessor's attribute identifier. The second decryption management server performs inner decryption permission verification operations on visitors based on attribute identifiers. The inner decryption authorization list maintained internally by the second decryption management server records the attribute identifier list of visitors who have been granted inner decryption permissions. The attribute identifier list is independent of the outer decryption authorization list and can be configured separately by the administrator, thereby achieving more granular hierarchical control of decryption permissions. If the visitor's attribute identifier exists in the inner decryption authorization list, the verification is successful; otherwise, the second decryption management server refuses to perform subsequent operations. After successful verification, the second decryption management server retrieves the pre-allocated second decryption parameter from its internal security parameter storage area. The second decryption parameter is the decryption parameter generated by the data encryption terminal during the data encryption stage and corresponds to the first-level encryption key. After completing the encryption operation, the data encryption terminal pre-distributes it to the second decryption management server through a dedicated secure channel. The second decryption parameter is the inverse transform driving parameter corresponding to the first-level encryption key in the decryption operation. After obtaining the second decryption parameters, the second decryption management server reads the middle header identifier area of ​​the middle ciphertext. The middle header identifier area is a piece of structured metadata attached to the front of the middle ciphertext during the first encryption operation. It records the inner encryption strategy identifier and the inner encryption initialization vector used by the inner encryption operation. The second decryption management server reads the block length and iteration round of the inner decryption operation from the inner encryption strategy identifier. The block length of the inner decryption operation is determined by the data encryption terminal when performing the first encryption operation. Its value may be the same as or different from the block length of the outer decryption operation. The second decryption management server extracts a continuous byte segment matching the length value from the second decryption parameters based on the block length of the inner decryption operation, using it as the parameter component of the inner decryption operation. The second decryption management server constructs the inner decryption operation sequence round by round using the parameter component and the inner encryption initialization vector according to the iteration round of the inner decryption operation. For the first round of inner decryption operation, the second decryption management server performs an XOR operation on the inner encryption initialization vector and the first sub-component in the parameter component to obtain the round key for the first round. Based on this round key, the order of byte replacement and position permutation for all byte segments of the intermediate ciphertext is defined. The round key for each subsequent round is generated based on the output state of the previous round and the corresponding sub-component of the parameter component. After the inner decryption operation sequence is constructed, the second decryption management server uses the inner decryption operation sequence to perform decryption transformation processing on all byte segments of the intermediate ciphertext. The decryption transformation processing starts from the first byte of the intermediate ciphertext and performs byte replacement and position per step by step and group by group according to the round order specified by the inner decryption operation sequence and the byte-level operation order within each round. After all iterations of transformation processing, the original inner encryption shell of the intermediate ciphertext is peeled off layer by layer, and its content is restored to the state before the first encryption operation was executed, that is, the complete original data. After the decryption and transformation process is completed, the second decryption management server obtains the original data. After confirming that the original data has been completely restored, the second decryption management server returns the original data to the initiator of the data access request, namely the terminal device of the data accesser, through a newly established secure transmission channel. After confirming that the data accessor has successfully received the original data, the second decryption management server destroys the original data copy generated internally and the data residue in the temporary session security container, completing the entire data access and decryption recovery process. Please see Figure 3 The present invention also provides a distributed data privacy protection system based on layered encryption, comprising: Key generation module: Obtains the original data to be protected, and generates a first-level encryption key and a second-level encryption key based on the attribute identifiers of the original data; First encryption operation module: Based on the first-level encryption key, it performs the first encryption operation on the original data to determine the intermediate ciphertext; Second encryption operation module: Based on the second-level encryption key, it performs a second encryption operation on the intermediate ciphertext to determine the target ciphertext; Ciphertext segmentation module: Based on a preset data segmentation strategy, the target ciphertext is segmented into a first ciphertext fragment and a second ciphertext fragment, and the fragmentation sequence indication information is determined; Storage allocation module: Based on the first storage allocation strategy, the first ciphertext fragment and the second ciphertext fragment are distributed to the first storage server node and the second storage server node for storage, respectively.

[0030] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0031] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0032] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

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

[0034] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of protection of the described technical solution.

Claims

1. A distributed data privacy protection method based on layered encryption, characterized in that, Includes the following steps: S1. Obtain the original data to be protected, and generate a first-level encryption key and a second-level encryption key based on the attribute identifier of the original data; S2. Based on the first-level encryption key, perform the first encryption operation on the original data to determine the intermediate ciphertext; S3. Based on the second-level encryption key, perform a second encryption operation on the intermediate ciphertext to determine the target ciphertext; S4. Based on the preset data segmentation strategy, the target ciphertext is segmented into a first ciphertext fragment and a second ciphertext fragment, and the fragmentation sequence indication information is determined. S5. Based on the first storage allocation strategy, the first ciphertext fragment and the second ciphertext fragment are distributed to the first storage server node and the second storage server node for storage, respectively.

2. The distributed data privacy protection method based on layered encryption according to claim 1, characterized in that, In step S1, a data write request is received from the data production terminal. Based on the data source identifier carried in the data write request, an identity verification operation is performed on the data production terminal. After the verification is successful, a secure transmission channel is established between the data production terminal and the data production terminal. The raw data stream sent by the data production terminal is received through the secure transmission channel. An integrity verification operation is performed on the raw data stream. After the verification is successful, the raw data to be protected is determined. Obtain the attribute identifiers of the raw data, which include a security sensitivity level identifier and a random factor. Based on the security sensitivity level identifier, determine the value of the number of nested encryption layers. Obtain the secure root key. Based on the secure root key and the first sub-factor of the random factor, generate the first-level encryption key. Based on the first-level encryption key and the second sub-factor of the random factor, generate the second-level encryption key. When the number of nested encryption layers is greater than two, generate subsequent level encryption keys layer by layer based on the encryption key generated in the previous layer and the corresponding next sub-factor, until all level encryption keys that match the number of nested encryption layers are generated.

3. The distributed data privacy protection method based on layered encryption according to claim 1, characterized in that, In step S2, the data structure description information of the original data is obtained. Based on the data structure description information, the starting offset position and encryption range of the first encryption operation are determined. Using the first-level encryption key, the corresponding byte segment of the original data is subjected to the first round of encryption transformation processing at the starting offset position and encryption range of the first encryption operation. After the first round of encryption transformation processing is completed, the intermediate ciphertext is obtained.

4. The distributed data privacy protection method based on layered encryption according to claim 1, characterized in that, In step S3, the data structure description information of the intermediate ciphertext is obtained. Based on the data structure description information, the encryption boundary of the second encryption operation is determined. Using the second-level encryption key, the second round of encryption transformation is performed on all byte segments of the intermediate ciphertext within the encryption boundary of the second encryption operation. After the second round of encryption transformation is completed, the target ciphertext is obtained.

5. The distributed data privacy protection method based on layered encryption according to claim 1, characterized in that, In step S4, the total data length value of the target ciphertext is obtained, the segmentation granularity parameter and segmentation ratio parameter defined in the preset data segmentation strategy are obtained, the first segmentation boundary position and the second segmentation boundary position are determined in the target ciphertext based on the segmentation granularity parameter, and the segmentation operation is performed on the target ciphertext based on the first segmentation boundary position and the second segmentation boundary position to obtain the first ciphertext fragment and the second ciphertext fragment. Based on the original arrangement order of the first and second ciphertext fragments in the target ciphertext, fragment sequence indication information is generated, wherein the fragment sequence indication information includes at least the sequence identifier of the first ciphertext fragment, the sequence identifier of the second ciphertext fragment, and the splicing order relationship between the two.

6. The distributed data privacy protection method based on layered encryption according to claim 1, characterized in that, In step S5, the first running status information of the first storage server node and the second running status information of the second storage server node are obtained. Based on the first operating status information, the first current load weight of the first storage server node is determined. Based on the second operating status information, the second current load weight of the second storage server node is determined. Based on the first current load weight and the second current load weight, it is determined whether the difference between the two exceeds the difference threshold. When the difference exceeds the difference threshold and the first current load weight is greater than the second current load weight, the data size allocated to the first ciphertext fragment is reduced, and the data size allocated to the second ciphertext fragment is increased accordingly to determine the adjusted distribution ratio. According to the adjusted distribution ratio, the target ciphertext is re-segmented to obtain the updated first and second ciphertext fragments.

7. The distributed data privacy protection method based on layered encryption according to claim 6, characterized in that, Based on the first current load weight and the second current load weight, the distribution order is determined, wherein the storage server node with the lower current load weight is taken as the priority write target. According to the determined distribution order, the corresponding ciphertext fragment is first written to the storage server node pointed to by the priority write target, and after receiving the confirmation response, another ciphertext fragment is written to another storage server node. Based on the first operating status information, the first current load weight of the first storage server node is determined, including the following steps: Extract the instantaneous CPU utilization, network bandwidth utilization, concurrent read / write request queue length, and available storage space from the first running status information; Based on the preset state mapping rules, the instantaneous occupancy rate of the central processing unit is converted into a processor state score, the network bandwidth utilization rate is converted into a network state score, the concurrent read / write request queue length is converted into a queue state score, and the available storage space is converted into a storage state score. The processor status score, network status score, queue status score, and storage status score are weighted and summed, and the result is determined as the first current load weight.

8. The distributed data privacy protection method based on layered encryption according to claim 1, characterized in that, The method further includes obtaining a data access request, the data access request carrying the visitor's attribute identifier, and obtaining a first ciphertext fragment and a second ciphertext fragment from a first storage server node and a second storage server node, respectively, based on the visitor's attribute identifier. Based on the fragmentation sequence indication information, a reassembly operation is performed on the first ciphertext fragment and the second ciphertext fragment to determine the reassembled target ciphertext. Based on the visitor's attribute identifier, a first decryption assistance request is sent to the first decryption management server. Based on the first decryption assistance request, the first decryption management server performs the first stripping operation on the target ciphertext to determine the intermediate ciphertext. Specifically, this includes the following steps: Based on the attribute identifier carried in the first decryption assistance request, an outer decryption permission verification operation is performed on the visitor. After the verification is successful, the first decryption parameter, which is pre-allocated and stored in the first decryption management server, is obtained. The first decryption parameter has a decryption correspondence with the second-level encryption key. The header identifier area of ​​the target ciphertext is read to obtain the encryption strategy identifier and encryption initialization vector used in the outer encryption operation. The block length and iteration round of the outer decryption operation are determined based on the encryption strategy identifier. The parameter component that matches the length value of the block length is extracted from the first decryption parameter. According to the iteration round, the outer decryption operation sequence for the target ciphertext is constructed using the parameter component and the encryption initialization vector. The outer decryption operation sequence defines the order in which byte replacement and position permutation are performed on the ciphertext body of the target ciphertext in each round. The outer decryption operation sequence is used to perform decryption transformation on the ciphertext body of the target ciphertext in order to strip away the outer encryption shell of the target ciphertext. After the decryption and transformation process is completed, the intermediate ciphertext is obtained, encapsulated in a temporary session security container, and forwarded to the second decryption management server through the intranet channel. After confirming that the second decryption management server has received the intermediate ciphertext, the copy of the intermediate ciphertext generated inside the first decryption management server is destroyed.

9. The distributed data privacy protection method based on layered encryption according to claim 8, characterized in that, Based on the intermediate ciphertext, a second decryption assistance request is sent to the second decryption management server. Based on the second decryption assistance request, the second decryption management server performs a second stripping operation on the intermediate ciphertext to determine the original data, including the following steps: Receive the temporary session security container forwarded by the first decryption management server through the intranet channel, and extract the intermediate ciphertext from the temporary session security container; Based on the attribute identifier carried in the second decryption assistance request, an inner decryption permission verification operation is performed on the visitor. After the verification is successful, the second decryption parameter, which is pre-allocated and stored in the second decryption management server, is obtained. The second decryption parameter has a decryption correspondence with the first-level encryption key. The middle header identifier area of ​​the intermediate ciphertext is read to obtain the inner encryption strategy identifier and the inner encryption initialization vector used in the inner encryption operation. The block length and iteration round of the inner layer decryption operation are determined based on the inner layer encryption strategy identifier. The parameter component that matches the block length of the inner layer decryption operation is extracted from the second decryption parameter. Based on the iteration round of the inner layer decryption operation, the inner layer decryption operation sequence for the intermediate ciphertext is constructed using the parameter component and the inner layer encryption initialization vector. The inner layer decryption operation sequence defines the order in which byte replacement and position permutation are performed on all byte segments of the intermediate ciphertext in each round. The inner decryption operation sequence is used to perform decryption transformation on all byte segments of the intermediate ciphertext in order to strip away the inner encryption shell of the intermediate ciphertext. After the decryption and transformation are completed, the original data is obtained and returned to the party that initiated the data access request through a secure transmission channel.

10. A distributed data privacy protection system based on layered encryption for executing the distributed data privacy protection method based on layered encryption as described in any one of claims 1-9, characterized in that, include: Key generation module: Obtains the original data to be protected, and generates a first-level encryption key and a second-level encryption key based on the attribute identifiers of the original data; First encryption operation module: Based on the first-level encryption key, it performs the first encryption operation on the original data to determine the intermediate ciphertext; Second encryption operation module: Based on the second-level encryption key, it performs a second encryption operation on the intermediate ciphertext to determine the target ciphertext; Ciphertext segmentation module: Based on a preset data segmentation strategy, the target ciphertext is segmented into a first ciphertext fragment and a second ciphertext fragment, and the fragmentation sequence indication information is determined; Storage allocation module: Based on the first storage allocation strategy, the first ciphertext fragment and the second ciphertext fragment are distributed to the first storage server node and the second storage server node for storage, respectively.