Homomorphic encryption-based sensitive data security encryption protection method and system
Patent Information
- Application Number
- CN202611342012.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-01
- Publication Date
- 2026-10-16
AI Technical Summary
[0004]本发明提供基于同态加密的敏感数据安全加密保护方法及系统,解决相关技术中医疗敏感数据在滑动时间窗口统计查询场景下重复扣减隐私预算、截断策略不一致以及噪声重复叠加导致查询精度下降的技术问题
[0016] By identifying the upper bound parameter of patient contribution caused by the addition of new records in the encrypted field, the correlation multiple is crossed. The state transition data subject is processed, and its overlapping segments are encrypted and re-truncated in a consistent manner. This ensures that the truncation decisions for the same data subject are consistent in the two queries, eliminating the semantic leakage channel caused by inconsistent truncation decisions and blocking the way for attackers to infer information about changes in the behavior of the data subject through differences in statistical results.
Smart Images

Figure CN122932947A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data security technology, specifically to a method and system for secure encryption protection of sensitive data based on homomorphic encryption. Background Technology
[0002] In cross-institutional data sharing scenarios, multiple institutions store sensitive data in encrypted form in a jointly encrypted database. Data analysts periodically submit statistical query requests involving the association of multiple encrypted tables. The encrypted database receives newly uploaded encrypted data from each institution in an incremental update mode, and the data records covered by the queries have a high degree of overlap between adjacent queries.
[0003] Existing homomorphic encryption protection methods typically employ differential privacy noise applied uniformly to the entire dataset to handle multi-table join queries. In this approach, the Cartesian product generated by multi-table join operations amplifies the global sensitivity with the join factor. The encryption noise calibrated according to the amplified sensitivity far exceeds the effective statistical signal, rendering the query results unusable. When sensitivity is controlled by truncating the number of record rows based on contribution, the insertion of new records may cause the join factor of some data subjects to cross the truncation boundary. Inconsistent truncation decisions for the same data subject in two consecutive queries allow attackers to infer behavioral changes in the data subject through differences in statistical results, posing a semantic leakage risk. Furthermore, each query independently consumes the entire privacy budget, while adjacent queries cover highly overlapping data records, causing the privacy budget to be quickly exhausted, making it unsuitable for continuous statistical queries. Summary of the Invention
[0004] This invention provides a method and system for secure encryption protection of sensitive data based on homomorphic encryption, which solves the technical problems in related technologies such as repeated deduction of privacy budget, inconsistent truncation strategies, and decreased query accuracy caused by repeated noise accumulation in the sliding time window statistical query scenario for medical sensitive data.
[0005] This invention discloses a method for secure encryption protection of sensitive data based on homomorphic encryption, comprising at least step A and step B, wherein step A includes: Receive medical sensitive data statistical query requests, compare the data time range covered by the current query with historical query records, determine the overlapping encrypted medical data segments and the incremental encrypted medical data segments, and retrieve the previous truncation decision record from the truncation status cache; Perform homomorphic operations on each patient in the incrementally encrypted medical data segment to generate an updated association multiple vector, and then correlate the updated association multiple with the upper bound parameter of patient contribution. Compare and identify the set of patients in state transition with the set of stable patients; Step B includes: performing re-truncation on the associated records of the state-transitioning patient set in the overlapping encrypted medical data segment. OK; Perform homomorphic aggregation operations on the overlapping segments and the incremental segments respectively; For overlapping medical statistical ciphertext, the previous encryption noise is reused; for incremental medical statistical ciphertext, fresh encryption noise is generated based on the global sensitivity after truncation and then superimposed. Calculate the incremental deviation correction amount applied to the merged noisy statistical ciphertext and output the medical statistical query results.
[0006] Furthermore, the step of performing homomorphic operations on each patient in the incremental encrypted medical data segment to generate an updated association multiple vector includes: performing homomorphic counting operations on the number of new medical records and the number of new prescription records for each patient in the incremental encrypted medical data segment; performing homomorphic multiplication operations on the count of new medical records and the count of new prescription records to obtain the ciphertext of the incremental association row count for each patient due to the new records; and performing homomorphic addition operations on the ciphertext of the incremental association row count and the previous association multiple ciphertext stored in the truncated state cache to generate an updated association multiple vector that incrementally affects patients.
[0007] Furthermore, the identification of the patient set undergoing state transitions and the stable patient set includes: the updated association multiple for each patient. Upper bound parameter of patient contribution Perform homomorphic comparison operations; ensure that the previous association multiple is strictly less than... And the correlation multiple after the update is strictly greater than Patient classification status change patient set The updated association multiplier will increase but will not cross [the threshold]. Patients whose association fold remained unchanged after the update, and patients whose previous association fold had reached or exceeded [a certain threshold]. Patients were classified into the stable patient group. ;in, For the first The updated association multiple for each patient. Number the patient index.
[0008] Furthermore, the associated records of the patient set undergoing state transitions within the overlapping encrypted medical data segment are re-truncated to the previous section. The process includes: retrieving an encrypted row index sequence of all associated records for each patient in the state-transition patient set from the overlapping encrypted medical data segment, sorted in ascending order by visit timestamp; multiplying each encrypted associated record by an encrypted selection bit, and then... The selection bit corresponding to the first record is encrypted with 1, and the selection bit corresponding to the remaining records is encrypted with 0. The truncation operation is completed in the ciphertext field. The statistical value of the truncated overlapping segment is homomorphically subtracted from the untruncated statistical value of the patient in the previous query to generate the ciphertext of the change in the medical statistical value of the overlapping segment.
[0009] Furthermore, the step of generating fresh encrypted noise and superimposing it on the incremental segment medical statistical ciphertext based on the truncated global sensitivity includes: based on the global sensitivity after truncating the incremental encrypted medical data segment. and incremental privacy budget component Calculate the incremental noise scale parameter ; Generate a sequence in the ciphertext field that follows the parameter . Fresh encrypted noise with a Laplace distribution is superimposed onto the truncated incremental segment of the medical statistical ciphertext using homomorphic addition; among which... Global sensitivity after incremental segment truncation The incremental privacy budget allocation from the privacy budget ledger is based on the proportion of new patient records to all records. is the scale parameter for Laplace noise.
[0010] Furthermore, the generation in the ciphertext domain follows the parameter... The fresh encrypted noise following the Laplace distribution includes: pre-generating random numbers that follow the target Laplace distribution during system initialization and encrypting and storing them as a pre-generated encrypted noise table; and using the calculated scale parameters during query execution. Extract from the pre-stored encrypted noise in the corresponding parameter range and superimpose it as fresh encrypted noise onto the truncated incremental segment of medical statistical ciphertext.
[0011] Furthermore, the calculation of the incremental deviation correction amount applied to the merged noisy statistical ciphertext includes: the statistical correlation multiple exceeding... The collection of truncated patients Calculate the actual association multiple for each truncated patient. With cutoff boundary The difference is summed and then divided by the total number of patients participating in the aggregation. Obtain the ciphertext of the current truncation bias correction. : ; The current truncation bias correction amount is encrypted. Ciphertext of correction amount for previous truncation deviation Perform homomorphic subtraction to obtain the ciphertext of the incremental deviation correction. The incremental bias correction ciphertext is applied to the merged noisy medical statistical ciphertext using homomorphic addition; where, For the current association multiple exceeding The collection of patients who were cut off For the first The actual association multiple of the truncated patients, For the index number of the truncated patient, The total number of patients participating in the aggregation. This is the ciphertext of the truncation bias correction amount cached during the previous query.
[0012] Furthermore, step B also includes: writing the updated association multiple values and truncation Boolean flags for each patient into the truncation state cache; writing the updated combined encrypted noise into the noise cache; and deducting only the privacy budget component corresponding to this incremental encrypted medical data segment from the privacy budget ledger. The budget will not be deducted repeatedly for overlapping encrypted medical data segments; among them, The privacy budget component allocated to incremental encrypted medical data segments.
[0013] Furthermore, the homomorphic aggregation operation includes: when the aggregation function type is drug frequency counting, performing homomorphic summation on the encrypted occurrence count of the target drug identifier in each patient's associated record after truncation; when the aggregation function type is the mean of the test index, performing homomorphic summation on the encrypted target test value in each patient's associated record after truncation, and combining it with the encrypted total number of valid records participating in the aggregation for mean calculation.
[0014] This invention discloses a sensitive data security encryption protection system based on homomorphic encryption, used to execute the aforementioned sensitive data security encryption protection method based on homomorphic encryption, comprising: The query parsing module is used to receive medical sensitive data statistical query requests, extract the association key, target encrypted medical table identifier and aggregation function type, compare historical query records to determine the range division of overlapping encrypted medical data segments and incremental encrypted medical data segments, and retrieve the previous truncation decision record from the truncation status cache. The correlation multiple calculation module is used to perform homomorphic counting and homomorphic multiplication operations on the new medical records and prescription records of each patient in the incremental encrypted medical data segment, and generate an updated correlation multiple vector. The state transition identification module is used to perform a homomorphic comparison operation between the updated association multiple vector and the previous association multiple, and to identify the set of patients with state transitions and the set of stable patients. The uniform truncation module is used to re-truncate the associated records of the patient set in the overlapping encrypted medical data segment to the beginning. Okay, generate the encrypted data of the changes in medical statistics for the overlapping segment, and keep the truncation decision unchanged for the stable patient set; The homomorphic aggregation module is used to perform homomorphic aggregation operations corresponding to the aggregation function on the consistent overlapping encrypted medical data segment and the truncated incremental encrypted medical data segment respectively; The noise overlay module is used to retrieve the previously encrypted noise multiplexed in the overlapping segment of the medical statistics ciphertext from the noise cache, and generate fresh encrypted noise based on the global sensitivity and incremental privacy budget components after the incremental segment is truncated and overlaid on the incremental segment of the medical statistics ciphertext. The bias correction module is used to calculate the truncated bias correction amount based on the updated correlation multiple distribution of all patients, and obtain the incremental bias correction amount ciphertext by subtracting it from the previous truncated bias correction amount, and then apply it to the merged noisy medical statistical ciphertext. The cache update and output module is used to write the updated truncated decision records and combined encrypted noise into the truncated state cache and noise cache respectively, deduct the incremental privacy budget component from the privacy budget ledger, and perform decryption operation on the bias-corrected encrypted medical statistics results to output the final query results.
[0015] The present invention has the following beneficial effects.
[0016] By identifying the upper bound parameter of patient contribution caused by the addition of new records in the encrypted field, the correlation multiple is crossed. The state transition data subject is processed, and its overlapping segments are encrypted and re-truncated in a consistent manner. This ensures that the truncation decisions for the same data subject are consistent in the two queries, eliminating the semantic leakage channel caused by inconsistent truncation decisions and blocking the way for attackers to infer information about changes in the behavior of the data subject through differences in statistical results.
[0017] By constraining the global sensitivity to the upper bound parameter of contribution Within the specified range, the level of encrypted noise matches the effective statistical signal, avoiding the problem of noise overwhelming the effective statistical information due to amplified sensitivity in multi-table association scenarios.
[0018] By generating fresh encrypted noise only for incremental data segments and deducting privacy budget proportionally, overlapping segments reuse previous encrypted noise without repeatedly consuming the budget, enabling data analysts to continuously obtain query results on statistical trends of data subject groups within a limited privacy budget. Attached Figure Description
[0019] Figure 1 This is a flowchart of a method for secure encryption protection of sensitive medical data based on homomorphic encryption, provided in an embodiment of the present invention. Figure 2 This is a schematic diagram showing the comparison of the previous and updated correlation multiples for each patient according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the distribution of incremental correlation rows for each patient provided in an embodiment of the present invention; Figure 4 This is a schematic diagram comparing the medication counts of each patient in the overlapping and incremental segments according to an embodiment of the present invention; Figure 5 This is a schematic diagram comparing the number of rows retained in the overlapping segment and the incremental segment for each patient according to an embodiment of the present invention; Figure 6 This is a schematic diagram of privacy budget consumption status tracking provided in an embodiment of the present invention; Figure 7 This is a schematic diagram illustrating the relationship between the correlation multiples of each patient and the upper cutoff bound k provided in an embodiment of the present invention; Figure 8 This is a schematic diagram comparing the relevant parameters of the truncation deviation correction amount before and after the present invention embodiment; Figure 9 This is a schematic diagram of the heat map of the changes in the cutoff state of each patient provided in the embodiments of the present invention. Detailed Implementation
[0020] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, some features described in the examples may be combined in other examples.
[0021] At least one embodiment of the present invention discloses a method for secure encryption protection of sensitive medical data based on homomorphic encryption, see [link to relevant documentation]. Figure 1 This includes the following steps: Step 1: Parse the medical statistics query request and divide the encrypted data segment range.
[0022] The system receives medical sensitive data statistical query requests submitted by data analysts and extracts the association key, target encrypted medical table identifier, and aggregation function type. The association key is the patient identifier, the target encrypted medical table identifier includes the encrypted medical visit record table identifier and the encrypted prescription medication record table identifier, and the aggregation function type includes medication frequency count or test index mean. The system compares the time range of the medical data covered by the current query with the queryer's historical query records to determine the scope of overlapping encrypted medical data segments and incrementally encrypted medical data segments. It retrieves the truncation decision records corresponding to each patient identifier from the truncation state cache from the previous query, obtaining the association multiple and truncation row number for each patient in the previous query.
[0023] It should be noted that overlapping encrypted medical data segments refer to the set of encrypted medical records where the current query time range intersects with the previous query time range, while incremental encrypted medical data segments refer to the set of newly added encrypted medical records where the current query time range exceeds the previous query time range. Truncated decision records include the correlation multiple of each patient identifier in the previous query and a Boolean flag indicating whether the record was truncated.
[0024] Step 2: Calculate the updated correlation multiple vector of the incremental impact on patients.
[0025] Extract patient identifiers from each record in the incrementally encrypted medical data segment. On the patient identifier association key, perform a homomorphic counting operation on the number of new medical records and prescription records for each patient. Perform a homomorphic multiplication operation on the count of new medical records and the count of new prescription records to obtain the ciphertext of the incremental association row count for each patient due to new medical records. Perform a homomorphic addition operation on the ciphertext of the incremental association row count and the ciphertext of the previous association multiple stored in the truncated state cache to generate the updated association multiple vector that incrementally affects patients.
[0026] It should be noted that each component in the updated association multiple vector for patients affected by the incremental change corresponds to a patient identifier, the value of which is equal to the product of the number of medical records and prescription records for that patient within the entire time range covered by the current query. In other words, it represents the total number of associated rows generated after the patient's medical records and prescriptions are associated. For patients not appearing in the incremental encrypted medical data segment, their updated association multiple is the same as the association multiple in the previous query, and is directly read from the truncated state cache without needing to perform homomorphic addition.
[0027] Step 3: Identify the patient set in state transition and the stable patient set.
[0028] Perform a homomorphic comparison operation between the updated patient association multiple vector and the previous association multiple in the truncated state cache. Let the upper bound parameter for patient contribution be... The updated correlation multiple for each patient and Compare the results. Identify those that satisfy the condition that the previous association multiple is strictly less than... And the correlation multiple after the update is strictly greater than Patients were categorized into the group of patients undergoing state changes. The association multiplier increased after the update, but did not cross [a certain threshold]. Patients whose association fold remained unchanged after the update, and patients whose previous association fold was equal to or greater than 1. Patients were categorized into the stable patient group. .
[0029] in, For the first The updated association multiple for each patient. Number the patient index. An upper bound parameter is contributed for predefined patients to limit the maximum impact of a single patient on the aggregated statistical results.
[0030] It should be noted that the previous correlation multiple was equal to or exceeded The patient whose truncation was performed in the previous query remains unchanged in the current query. Therefore, they are included in the stable patient set rather than the state-transition patient set, and there is no need to perform the truncation operation again.
[0031] Step 4: Perform a uniform re-truncation on patients with state changes.
[0032] Set of patients undergoing state changes For each patient, retrieve the encrypted row index sequence of all their associated medical records from the overlapping encrypted medical data segment. Based on the encrypted row index sequence sorted in ascending chronological order, truncate the associated records to the previous time. Okay, keep the previous one The first line of encrypted associated records is discarded. The encrypted associated records for the row and subsequent rows. A homomorphic subtraction operation is performed between the truncated overlapping segment medical statistics and the untruncated statistics for the same patient in the previous query, generating an encrypted representation of the change in overlapping segment medical statistics due to re-truncation. For a stable patient set... The overlapping medical records will retain the original truncation decision.
[0033] It should be noted that the encrypted row index sequence refers to the sequence of row identifiers for each associated record in the encrypted database, arranged in ascending order according to the visit timestamp. (Truncation to the beginning) A row refers to retaining only the earliest time. The number of associated records participating in subsequent aggregation operations is limited to a minimum, ensuring that the patient's contribution to the aggregation result does not exceed [a certain percentage]. .
[0034] In this embodiment, to ensure that the re-truncation operation does not expose the specific content of the truncated record, the truncation process is implemented in the ciphertext field through homomorphic selection operation: each encrypted associated record is multiplied by an encrypted selection bit, where the selection bit is either an encrypted 1 or an encrypted 0. The selection bit for the first record is encrypted with 1, and the selection bit for the remaining records is encrypted with 0, thus completing the truncation operation without decryption.
[0035] Step 5: Perform homomorphic aggregation operations on the overlapping segments and the incremental segments respectively.
[0036] For the unified overlapping encrypted medical data segments, homomorphic aggregation operations corresponding to the aggregation function are performed on the patient's visit and prescription association records according to the truncation decision, generating unified overlapping segment medical statistical ciphertext. For incremental encrypted medical data segments, truncation is performed according to the updated association multiple for each patient, and segments with an updated association multiple exceeding [a certain threshold] are truncated. Incremental association records of patients were truncated to After the row is processed, a homomorphic aggregation operation is performed to generate a truncated incremental segment of medical statistics ciphertext.
[0037] It should be noted that when the aggregation function type is medication frequency counting, the homomorphic aggregation operation performs a homomorphic summation on the encrypted occurrence counts of the target drug identifier in each patient's associated record after truncation. When the aggregation function type is the mean of a test indicator, the homomorphic aggregation operation performs a homomorphic summation on the encrypted target test value in each patient's associated record after truncation, and combines this summation with the encrypted total number of valid records participating in the aggregation for subsequent mean calculation.
[0038] Step 6: Perform segmented differential privacy noise superposition.
[0039] Retrieve the encrypted noise value from the previous medical query from the noise cache. Perform homomorphic addition on the uniformized overlapping medical statistics ciphertext, adding the multiplexed noise onto the uniformized overlapping medical statistics ciphertext.
[0040] The incremental noise scale parameter is calculated based on the global sensitivity value after truncating the incrementally encrypted medical data segment. The global sensitivity value is... That is, the maximum change in the aggregated result after a single patient is removed is equal to the upper bound parameter of the patient contribution. The incremental privacy budget portion is allocated from the privacy budget ledger based on the proportion of new patient records to all records. Calculate the incremental noise scale parameters Generate a sequence in the ciphertext field that conforms to the parameter... Fresh encrypted noise with a Laplace distribution is added to the truncated incremental segment of medical statistical ciphertext using homomorphic addition.
[0041] in, Global sensitivity after incremental segment truncation Contribute upper bound parameters to patients. For the privacy budget component allocated to the incremental segment, This represents the scale parameter of the Laplace noise. It should be noted that... and All are dimensionless pure numerical quantities: This represents the largest integer contribution of a single patient to the aggregated count results after truncation. The privacy budget figures are allocated proportionally, with both having the same dimensions, and their ratio is... As a scaling parameter of the Laplace distribution, it has the same dimensions as the aggregate statistics and can be directly used for noise calibration.
[0042] In this embodiment of the application, to prevent the generation of encrypted Laplace noise from introducing additional privacy leaks, a pre-generated encrypted noise table is adopted: during the system initialization phase, a large number of random numbers following the target Laplace distribution are pre-generated and encrypted and stored; during querying, the calculated scale parameter is used. Randomly sample from pre-stored encrypted noise within the corresponding parameter range to avoid online noise sampling during query execution.
[0043] Step 7: Calculate the incremental deviation correction amount and apply the correction.
[0044] Based on the updated association fold distribution of all patients' visits and prescriptions, the truncation bias correction was recalculated. The truncation bias correction was calculated as follows: the statistical association fold exceeded... The number of patients, and for each cutoff patient, calculate their actual association multiple and cutoff threshold. The difference is summed and then divided by the total number of patients participating in the aggregation. Obtain the ciphertext of the current truncation bias correction. : ; in, For the current association multiple exceeding The collection of patients who were cut off For the first The actual association multiple of the truncated patients, For the index number of the truncated patient, Contribute upper bound parameters to patients. The total number of patients participating in the aggregation. , , All quantities are dimensionless integers. Its dimensions are consistent with aggregate statistics, and it can be directly applied to statistical ciphertext.
[0045] The current truncation bias correction amount is encrypted. Ciphertext of correction amount for previous truncation deviation Perform homomorphic subtraction to obtain the ciphertext of the incremental deviation correction. .in, This is the encrypted truncation bias correction amount calculated and cached during the previous query. This is the difference between the current truncation bias correction and the previous truncation bias correction. The incremental bias correction ciphertext is applied to the merged noisy medical statistics ciphertext using a homomorphic addition operation to generate the complete encrypted and protected medical statistics result after bias correction.
[0046] It should be noted that the purpose of truncation bias correction is to compensate for the systematic underestimation of aggregate statistics caused by the truncation operation. This is because the truncation operation limits the contribution of patients with high fold association to a limited number of cases. Within this range, the aggregation result is offset downward relative to the true value, and the truncation bias correction is used to offset this systematic offset.
[0047] Step 8: Update the cache status and output the medical statistics query results.
[0048] The updated truncation decision records for each patient are written to the truncation state cache, including the updated correlation multiple values and truncation Boolean flags. The updated combined encrypted noise is written to the noise cache for reuse in subsequent queries. Only the privacy budget component corresponding to this incremental medical data is deducted from the privacy budget ledger. The budget is not deducted repeatedly from overlapping segments. The decryption operation is performed on the fully encrypted medical statistics results after deviation correction, and the final medical statistics query results are output.
[0049] On the other hand, this invention also proposes a medical sensitive data security encryption protection system based on homomorphic encryption, comprising: The query parsing module is used to receive medical sensitive data statistical query requests, extract the association key, target encrypted medical table identifier and aggregation function type, compare historical query records to determine the range division of overlapping encrypted medical data segments and incremental encrypted medical data segments, and retrieve the previous truncation decision record from the truncation status cache.
[0050] The correlation multiple calculation module is used to perform homomorphic counting and homomorphic multiplication operations on the new medical records and prescription records of each patient in the incremental encrypted medical data segment, and generate the updated correlation multiple vector that incrementally affects the patients.
[0051] The state transition identification module is used to perform a homomorphic comparison operation between the updated association multiple vector and the previous association multiple, and to identify the set of patients with state transitions and the set of stable patients.
[0052] The uniform truncation module is used to re-truncate the associated records of the patient set in the overlapping encrypted medical data segment to the beginning. Okay, generate the encrypted data of changes in medical statistics for overlapping segments, while keeping the truncation decision unchanged for stable patient sets.
[0053] The homomorphic aggregation module is used to perform homomorphic aggregation operations corresponding to the aggregation function on the consistent overlapping encrypted medical data segment and the truncated incremental encrypted medical data segment, respectively, to generate consistent overlapping segment medical statistical ciphertext and truncated incremental segment medical statistical ciphertext.
[0054] The noise superposition module is used to retrieve the previously encrypted noise value from the noise cache and reuse it to unify the overlapping segment of the medical statistics ciphertext. It also generates fresh encrypted Laplace noise based on the global sensitivity and incremental privacy budget components after the incremental segment is truncated and superimposed onto the truncated incremental segment of the medical statistics ciphertext.
[0055] The bias correction module is used to calculate the truncated bias correction amount based on the updated correlation multiple distribution of all patients, and to obtain the incremental bias correction amount ciphertext by subtracting it from the previous truncated bias correction amount, and then apply it to the merged noisy medical statistical ciphertext.
[0056] The cache update and output module is used to write the updated truncated decision records and combined encrypted noise into the truncated state cache and noise cache respectively, deduct the incremental privacy budget component from the privacy budget ledger, and perform decryption operation on the bias-corrected encrypted medical statistics results to output the final query results.
[0057] By way of example, the system proposed in this invention may also include various features and combinations thereof in the method embodiments, which will not be elaborated here.
[0058] This invention identifies, within a homomorphic ciphertext domain, parameters that cause the association multiple to cross the upper bound of patient contribution due to newly added patient visit or prescription records. The system analyzes the state transitions of patients and performs consistent re-truncation on their overlapping encrypted medical records. This ensures that the truncation decisions for the same patient remain consistent across two queries, thus eliminating semantic leakage channels caused by inconsistent truncation decisions and blocking attackers from inferring changes in patient visit frequency or medication behavior through differences in medical statistics. This is achieved by constraining global sensitivity to an upper bound on patient contribution. Within this scope, the level of encrypted noise matches medical statistical signals such as drug usage frequency, avoiding the problem of noise overwhelming effective statistical information in scenarios involving multiple tables related to patient visits and prescriptions. By generating fresh noise only for newly added patient medical record segments and deducting privacy budget proportionally, overlapping segments reuse previously encrypted noise without repeatedly consuming the budget, enabling data analysts to continuously obtain statistical results on the disease diagnosis and treatment trends of patient groups within a limited privacy budget.
[0059] See Figures 2-9 The following application examples are proposed: A regional chronic disease joint monitoring platform aggregates patient treatment data from Hospital A, Hospital B, and Hospital C. The three institutions upload patient visit records and prescription medication records to a joint encrypted database using homomorphic encryption, creating encrypted visit record tables and encrypted prescription medication record tables. A health research institution submits a request to the platform for statistics on the frequency of metformin use in patients with type 2 diabetes. The current query period is from January of year A to March of year B, and the previous query period was from January of year A to December of year A. Five patients with type 2 diabetes are registered in the joint encrypted database, and the upper bound parameter is contributed by these patients. Total privacy budget The ledger has been consumed after the last query. .
[0060] The query parsing module extracts the association key (patient identifier), target encrypted medical table identifiers (encrypted medical record table identifier V and encrypted prescription record table identifier P), and aggregation function type (metformin dosing count) from the request submitted by the health research institution. It compares the current query time range with historical query records, defining the entire year of year A as the overlapping encrypted medical data segment and the first quarter of year B as the incremental encrypted medical data segment. It retrieves the previous truncation decision records for patients 1 to 4 from the truncation status cache; patient 5 has no historical cache.
[0061] Table 1 Query Request Parsing and Data Segmentation Results
[0062] Table 2. Retrieval results of cached data from the previous query with truncation status.
[0063] In the incremental encrypted medical data segment (Q1 of Year B), patients with newly added records are Patient 1, Patient 3, and Patient 5, while Patient 2 and Patient 4 have no newly added data during this period. Homomorphic counting is performed on each of the three patients to obtain the number of newly added medical records and the number of newly added prescription records. The incremental association row count ciphertext is obtained through homomorphic multiplication, and then homomorphic addition is performed with the previous association multiple ciphertext stored in the truncated state cache to generate the updated association multiple vector. The updated association multiples for Patient 2 and Patient 4 are directly read from the cache without performing homomorphic addition.
[0064] Table 3. Incremental impact on patient association fold after update
[0065] Updated association fold and parameters for all patients Perform a homomorphic comparison operation. The previous association fold of patient 1 (4) is strictly less than... After the update, the correlation multiple of 6 is strictly greater than If the conditions for state transition are met, the patient should be included in the state transition patient set. Patient 2's association multiple after the update was 4, which did not exceed [a certain threshold]. , included in the stable patient group Patient 3's correlation multiple after the update did not exceed 3. , classified The fold increase in the previous association rate for patient 4 has exceeded [a certain threshold]. The truncation decision remains unchanged and is classified as follows: Patient 5's correlation multiple after the update did not exceed 2. , classified .
[0066] Table 4 Patient Status Classification Results
[0067] For the set of state transitions For Patient 1, retrieve the encrypted row index sequence of their medical visit and prescription association records from the overlapping encrypted medical data segment. This sequence consists of 4 rows, sorted in ascending order by visit timestamp. Perform truncation to the beginning. Okay, because the number of rows associated with patient 1 within the overlapping segment is less than 4. All four lines are preserved, and the encrypted change in medical statistics for overlapping segments is 0. Stable patient set. The cutoff decisions remained unchanged for all patients. Patient 4 continued to use the cutoff decision, while patients 2 and 3 continued to use the uncutoff decision.
[0068] Table 5 Results of overlapping segment re-truncation treatment in patients with state changes
[0069] Homomorphic aggregation is performed on the consistent, overlapping encrypted medical data segments according to the truncation decisions for each patient, and the ciphertext of metformin dosing frequency is counted. For the incremental encrypted medical data segments, the association multiple after patient 1's update exceeds 6. The first 5 rows from the entire time series are selected, with 4 rows from the overlapping segment and 1 row from the incremental segment; the remaining patients are aggregated according to the actual number of associated rows in the incremental segment. Patient 4 retains 5 rows in the overlapping segment (previously truncated to...). Patient 5 was only recorded in the incremental segment.
[0070] Table 6. Segmentation Aggregation Results of Overlapping and Incremental Segments
[0071] Retrieves the encrypted noise value from the previous query from the noise cache, and reuses it in the standardized overlapping segment of the medical statistics ciphertext using homomorphic addition, without generating new noise. Global sensitivity is based on incremental segment truncation. Based on the proportion of medical records in the first quarter of year B to all query-covered records, the incremental privacy budget component is allocated from the privacy budget ledger. Calculate the Laplace noise scale parameters From the pre-generated encrypted noise table, by The corresponding parameter range is randomly sampled for encrypted noise, which is then superimposed onto the incremental segment of the medical statistical ciphertext using homomorphic addition.
[0072] Table 7 Incremental Segment Differential Privacy Parameter Configuration
[0073] The correlation multiple after updating the total number of patients exceeded [a certain value]. The collection of truncated patients This includes patient 1 (association fold 6) and patient 4 (association fold 6). The actual association fold and cutoff threshold for each truncated patient are calculated. Sum the differences and divide by the total number of patients participating in the aggregation. According to the formula ; Obtain the ciphertext of the current truncation bias correction. ,in For the amputated patient The actual correlation multiple, To cut off the upper boundary, The total number of patients participating in the aggregation. The correction amount for the previous truncation deviation (encrypted). Perform homomorphic subtraction to obtain the ciphertext of the incremental deviation correction. Homomorphic addition is applied to the merged, noisy medical statistical ciphertext. The previous query truncated the patient set to only contain patient 4; the current query adds patient 1 to the truncated patient set. This reflects the compensatory increment of this change in the aggregate statistics.
[0074] Table 8 Comparison of relevant parameters for truncation deviation correction
[0075] The updated association multiples and truncation Boolean flags for patients 1 through 5 are written to the truncation state cache. The combination of overlapping segment reuse noise and incremental segment fresh encrypted noise is written to the noise cache for reuse in future queries. Only deducted from the privacy budget ledger. Overlapping segments will not be deducted from the budget repeatedly. The complete encrypted medical statistics results after deviation correction will be decrypted, and the statistics on metformin usage frequency in type 2 diabetes patients from January of year A to March of year B will be output.
[0076] Table 9 Updated Truncated State Cache Records
[0077] Throughout the implementation process, data originates from query requests submitted by health research institutions. Step 1 involves parsing to form the scope of overlapping and incremental segments, as well as the retrieval results of the previous truncated state cache. Step 2 generates an updated association multiple vector based on homomorphic counting and homomorphic multiplication of the incremental segments. This vector flows into Step 3 to identify Patient 1 as a patient undergoing state transition. Step 4 performs consistent re-truncation on the overlapping segments of Patient 1, confirming that the statistical values of the overlapping segments remain unchanged, thus maintaining the consistency of the truncation decisions before and after the query. Step 5 aggregates the segments to generate encrypted medication counts for each patient. Step 6 applies reuse noise and fresh noise to the overlapping and incremental segments respectively. Step 7 calculates the incremental deviation correction based on the current association multiple distribution of all patients and applies compensation. Step 8 writes the updated state back to the cache, consuming only the incremental segment budget, and outputs the final statistical results. The truncated state cache and noise cache form a closed loop between Step 1 and Step 8, ensuring the continuity of data flow and the continuous availability of the privacy budget in incremental query scenarios.
[0078] The embodiments of the present invention have been described above. However, the embodiments are not limited to the specific implementation methods described above. The specific implementation methods described above are merely illustrative and not restrictive. Those skilled in the art can make more equivalent embodiments under the guidance of the present embodiments, and all of them are within the protection scope of the present embodiments.
Claims
1. A method for secure encryption protection of sensitive data based on homomorphic encryption, characterized in that, It includes at least steps A and B, wherein step A includes: Receive medical sensitive data statistical query requests, compare the data time range covered by the current query with historical query records, determine the overlapping encrypted medical data segments and the incremental encrypted medical data segments, and retrieve the previous truncation decision record from the truncation status cache; Perform homomorphic operations on each patient in the incrementally encrypted medical data segment to generate an updated association multiple vector, and then correlate the updated association multiple with the upper bound parameter of patient contribution. Compare and identify the set of patients in state transition with the set of stable patients; Step B includes: Perform re-truncation to the front of the associated records of the patient set in the overlapping encrypted medical data segment for state transitions. ; Perform homomorphic aggregation operations on the overlapping segments and the incremental segments respectively; For overlapping medical statistical ciphertext, the previous encryption noise is reused; for incremental medical statistical ciphertext, fresh encryption noise is generated based on the global sensitivity after truncation and then superimposed. Calculate the incremental deviation correction amount applied to the merged noisy statistical ciphertext and output the medical statistical query results.
2. The method for secure encryption protection of sensitive data based on homomorphic encryption according to claim 1, characterized in that, The process of performing homomorphic operations on each patient in the incrementally encrypted medical data segment to generate an updated association multiple vector includes: Perform homomorphic counting operations on the number of new medical records and the number of new prescription records for each patient in the incremental encrypted medical data segment; Perform a homomorphic multiplication operation on the count of new medical records and the count of new prescription records to obtain the ciphertext of the incremental associated rows for each patient due to the new records; Perform a homomorphic addition operation on the incremental association row number ciphertext and the previous association multiple ciphertext stored in the truncated state cache to generate the updated association multiple vector that incrementally affects patients.
3. The method for secure encryption protection of sensitive data based on homomorphic encryption according to claim 1, characterized in that, The set of patients with changing states and the set of stable patients are identified, including: Updated association multiple for each patient Upper bound parameter of patient contribution Perform homomorphic comparison operations; The previous correlation multiple must be strictly less than And the correlation multiple after the update is strictly greater than Patient classification status change patient set ; The updated correlation multiplier increased but did not cross [a certain threshold]. Patients whose association fold remained unchanged after the update, and patients whose previous association fold had reached or exceeded [a certain threshold]. Patients were classified into the stable patient group. ; in, For the first The updated association multiple for each patient, Number the patient index.
4. The method for secure encryption protection of sensitive data based on homomorphic encryption according to claim 1, characterized in that, The associated records of the patient set undergoing state transitions within the overlapping encrypted medical data segment are re-truncated to the beginning. Lines, including: Retrieve the encrypted row index sequence of all associated records for each patient in the patient set of state transitions from the overlapping encrypted medical data segment, sorted in ascending order by visit timestamp; Multiply each encrypted associated record by an encryption selection bit, and the first... The selection bit corresponding to the first record is encrypted with 1, and the selection bit corresponding to the remaining records is encrypted with 0. The truncation operation is completed in the ciphertext field. The statistical value of the truncated overlapping segment is homomorphically subtracted from the untruncated statistical value of the patient in the previous query to generate the ciphertext of the change in the medical statistical value of the overlapping segment.
5. The method for secure encryption protection of sensitive data based on homomorphic encryption according to claim 1, characterized in that, The process of generating fresh encrypted noise based on truncated global sensitivity and superimposing it on incremental segment medical statistical ciphertext includes: Global sensitivity based on incremental encrypted medical data segment truncation and incremental privacy budget component Calculate the incremental noise scale parameter ; Generate a sequence in the ciphertext field that follows the parameter: Fresh encrypted noise with a Laplace distribution is superimposed onto the truncated incremental segment of medical statistical ciphertext using homomorphic addition. in, Global sensitivity after incremental segment truncation The incremental privacy budget allocation from the privacy budget ledger is based on the proportion of new patient records to all records. is the scale parameter for Laplace noise.
6. The method for secure encryption protection of sensitive data based on homomorphic encryption according to claim 5, characterized in that, The parameter obtained in the ciphertext domain is... Fresh encrypted noise with a Laplace distribution includes: During the system initialization phase, random numbers that follow the target Laplace distribution are pre-generated and encrypted and stored as a pre-generated encrypted noise table; The query is executed based on the calculated scale parameters. Extract from the pre-stored encrypted noise in the corresponding parameter range and superimpose it as fresh encrypted noise onto the truncated incremental segment of medical statistical ciphertext.
7. The method for secure encryption protection of sensitive data based on homomorphic encryption according to claim 1, characterized in that, The calculation of the incremental deviation correction amount applied to the merged noisy statistical ciphertext includes: Statistical correlation multiple exceeds The collection of truncated patients Calculate the actual association multiple for each truncated patient. With cutoff boundary The difference is summed and then divided by the total number of patients participating in the aggregation. Obtain the ciphertext of the current truncation bias correction. : ; The current truncation bias correction amount is encrypted. Ciphertext of correction amount for previous truncation deviation Perform homomorphic subtraction to obtain the ciphertext of the incremental deviation correction. The incremental deviation correction ciphertext is applied to the merged noisy medical statistical ciphertext using homomorphic addition. in, For the current association multiple exceeding The collection of patients who were cut off For the first The actual association multiple of the truncated patients, For the index number of the truncated patient, The total number of patients participating in the aggregation. This is the ciphertext of the truncation bias correction amount cached during the previous query.
8. The method for secure encryption protection of sensitive data based on homomorphic encryption according to claim 1, characterized in that, Step B further includes: Write the updated correlation multiple values and truncation Boolean flags for each patient to the truncation state cache; write the updated combined encrypted noise to the noise cache; Only the privacy budget portion corresponding to this incremental encrypted medical data segment will be deducted from the privacy budget ledger. Do not deduct budget from overlapping encrypted medical data segments; in, The privacy budget component allocated to incremental encrypted medical data segments.
9. The method for secure encryption protection of sensitive data based on homomorphic encryption according to claim 1, characterized in that, The homomorphic aggregation operation includes: When the aggregation function type is medication frequency counting, perform homomorphic summation on the encrypted occurrence count of the target drug identifier in the associated records of each patient after truncation; When the aggregation function type is the mean of the test index, homomorphic summation is performed on the encrypted target test values in the associated records of each patient after truncation, and the summation is combined with the encrypted total number of valid records participating in the aggregation for the mean calculation.
10. A sensitive data security encryption protection system based on homomorphic encryption, used to execute the sensitive data security encryption protection method based on homomorphic encryption as described in any one of claims 1 to 9, characterized in that, include: The query parsing module is used to receive medical sensitive data statistical query requests, extract the association key, target encrypted medical table identifier and aggregation function type, compare historical query records to determine the range division of overlapping encrypted medical data segments and incremental encrypted medical data segments, and retrieve the previous truncation decision record from the truncation status cache. The correlation multiple calculation module is used to perform homomorphic counting and homomorphic multiplication operations on the new medical records and prescription records of each patient in the incremental encrypted medical data segment, and generate an updated correlation multiple vector. The state transition identification module is used to perform a homomorphic comparison operation between the updated association multiple vector and the previous association multiple, and to identify the set of patients with state transitions and the set of stable patients. The uniform truncation module is used to re-truncate the associated records of the patient set in the overlapping encrypted medical data segment to the beginning. Okay, generate the encrypted data of the changes in medical statistics for the overlapping segment, and keep the truncation decision unchanged for the stable patient set; The homomorphic aggregation module is used to perform homomorphic aggregation operations corresponding to the aggregation function on the consistent overlapping encrypted medical data segment and the truncated incremental encrypted medical data segment respectively; The noise overlay module is used to retrieve the previously encrypted noise multiplexed in the overlapping segment of the medical statistics ciphertext from the noise cache, and generate fresh encrypted noise based on the global sensitivity and incremental privacy budget components after the incremental segment is truncated and overlaid on the incremental segment of the medical statistics ciphertext. The bias correction module is used to calculate the truncated bias correction amount based on the updated correlation multiple distribution of all patients, and obtain the incremental bias correction amount ciphertext by subtracting it from the previous truncated bias correction amount, and then apply it to the merged noisy medical statistical ciphertext. The cache update and output module is used to write the updated truncated decision records and combined encrypted noise into the truncated state cache and noise cache respectively, deduct the incremental privacy budget component from the privacy budget ledger, and perform decryption operation on the bias-corrected encrypted medical statistics results to output the final query results.