Medical Data Analysis System and Method Based on Homomorphic Encryption Technology
Through the segmentation of medical data flow and business dimension division, dynamically divide simple and complex tasks, parallel computing and gradual decryption, the limitations of homomorphic encryption technology in complex computing in medical data processing are solved, and efficient data analysis and privacy protection are achieved.
Patent Information
- Application Number
- CN202510629553.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-05-16
AI Technical Summary
Existing homomorphic encryption technologies are difficult to handle complex calculations and queries in medical data processing, especially under different data analysis tasks. The calculation range is limited and complex operations cannot be directly performed.
By dividing the medical data stream into independent fragments and dividing the molecule set according to the business dimension, the complexity of the analysis task is evaluated, divided into simple and complex tasks, simple tasks are directly encrypted and stored, complex tasks are decomposed into sub-tasks in parallel calculations and gradually decrypted and summarized results.
It effectively improves task processing efficiency, ensures data privacy protection, optimizes data processing speed and efficiency, and overcomes the limitations of homomorphic encryption when processing complex calculations.
Smart Images

Figure CN120197198B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data analysis, and particularly to a medical data analysis system and method based on homomorphic encryption technology. Background Art
[0002] With the rapid development of information technology, especially in the fields of medical care, medical insurance, drug and consumable management, big data and data analysis technologies are playing an increasingly important role in ensuring drug supply chain management, cost supervision, inventory management, sales analysis, etc. However, these fields involve a large amount of sensitive data, such as drug sales records, drug procurement and inventory data, etc. Therefore, how to ensure data privacy and security while performing efficient data analysis has become a technical problem that needs to be solved urgently.
[0003] To solve this problem, homomorphic encryption technology, as an emerging encryption technology, can perform data operations in the encrypted state, and the calculation results are the same as those of the operations on the original data, thus avoiding the risk of plaintext data leakage. This technology has the advantage of protecting data privacy and reduces the need for decryption operations to a certain extent. However, although homomorphic encryption technology has significant advantages in protecting data privacy, it still faces challenges in practical applications. For example, medical data includes drug sales records, procurement and inventory data, etc. Due to the different analysis tasks corresponding to different data, the corresponding data processing processes are also different. Although homomorphic encryption can perform basic operations such as addition and multiplication, its calculation range is relatively limited, and some complex operations may not be directly executable in the encrypted state. Therefore, in practical applications, especially in the process of medical data processing, a major challenge faced by homomorphic encryption technology is how to handle complex calculations and queries. Summary of the Invention
[0004] The purpose of the present invention is to provide a medical data analysis system and method based on homomorphic encryption technology to solve the problems raised in the above background art.
[0005] To solve the above technical problems, the present invention provides the following technical solutions:
[0006] A medical data analysis method based on homomorphic encryption technology includes the following steps:
[0007] Step S100. Obtain a medical data stream from a database, divide the medical data stream into independent segments according to a preset time window, further divide each independent segment according to a business dimension to generate a number of subsets; obtain a list of analysis tasks for medical data, extract the requirement information of each analysis task from the list of analysis tasks, and correspond each analysis task to the corresponding subset;
[0008] Step S200. Based on the correspondence between the analysis tasks and the subsets, and combining the requirement information of the analysis tasks and the medical data of the corresponding subsets, evaluate the complexity of the analysis tasks to obtain a complexity evaluation coefficient;
[0009] Step S300. According to the complexity evaluation coefficient of the analysis tasks, divide the analysis tasks in the analysis task list of the medical data into simple analysis tasks and complex analysis tasks; for the simple analysis tasks, directly encrypt and store the medical data of the corresponding subsets;
[0010] Step S400. For the complex analysis tasks, according to the corresponding requirement information, decompose the complex analysis tasks into several subtasks, analyze the dependency relationships between the subtasks to obtain a subtask execution order list; for the decomposed subtasks, use a parallel computing architecture to perform parallel encryption processing on each subtask, and after the subtasks are completed, according to the order list and execution results of the subtasks, summarize the results of the subtasks by means of step-by-step decryption.
[0011] Further, step S100 includes:
[0012] S101. Obtain the medical data stream from the database, divide the medical data stream into independent segments according to a preset time window, and label them as {T1, T2,..., Tn}, where T1 represents the medical data segment corresponding to the first preset time window, T2 represents the medical data segment corresponding to the second preset time window, and so on, Tn represents the medical data segment corresponding to the nth preset time window, and n represents the number of independent segments obtained by dividing the acquired medical data stream according to the preset time window; for each independent segment Ti, where i ranges from 1 to n; divide according to the business dimension of the medical data corresponding to the independent segment Ti, where the business dimensions include dimensions such as procurement, sales, and inventory; classify the medical data belonging to the same business dimension into one category, thereby generating several subsets, labeled as {S1, S2,..., Sm}, where S1 represents the set composed of the medical data of the first business dimension, S2 represents the set composed of the medical data of the second business dimension, and so on, Sm represents the set composed of the medical data of the mth business dimension, and m represents the number of business dimensions;
[0013] S102. Obtain the analysis task list of the medical data of each independent segment, extract the requirement information of each analysis task from the analysis task list, and obtain the business dimension of the medical data corresponding to each analysis task according to the requirement information; sequentially match the business dimension of the medical data corresponding to the analysis task with the business dimension corresponding to the subset Sj, where j ranges from 1 to m; according to the matching result, correspond each analysis task with the corresponding subset.
[0014] Further, step S200 includes:
[0015] S201. Based on the correspondence between the analysis tasks and the subsets, for each analysis task, obtain the data storage amount of the medical data of the corresponding subset, and calculate the data scale index DSI of the analysis task according to the data storage amount of the medical data of the subset. The specific calculation formula is:
[0016] DSI = [∑j = 1k Size(Sj)] / max(Size(S1), Size(S2),..., Size(Sm));
[0017] Among them, k represents the number of subsets corresponding to the analysis task, Size(Sj) represents the data storage amount of the medical data of the j-th subset, and max(Size(S1), Size(S2),..., Size(Sm)) represents the maximum value of the data storage amounts of all subsets S1, S2,..., Sm; through the requirement information of the analysis task, obtain the calculation process of the corresponding analysis task, count the number C of each type of calculation operation, and the operation frequency F corresponding to each operation type, and calculate the calculation density index CDI of the analysis task. The specific calculation formula is: CDI = [∑g = 1G (Cg × Fg)] / T; where Cg represents the number of the g-th type of calculation operation, that is, the amount of calculation involved in this operation type (such as the number of executions, the amount of calculation, etc.); Fg represents the operation frequency corresponding to the g-th type of calculation operation, and T represents the total duration of the analysis task, and G represents the total number of types of calculation operations of the analysis task;
[0018] S202. According to the data scale index DSI and the calculation density index CDI corresponding to the analysis task, evaluate the complexity of the analysis task, and thus calculate the complexity evaluation coefficient R. The corresponding calculation formula is: R = α × DSI + β × CDI. In the calculation formula of the complexity evaluation coefficient R, the data values corresponding to the data scale index DSI and the calculation density index CDI participate in the operation, and the corresponding units are not considered; where α and β respectively represent the weight coefficients corresponding to the data scale index DSI and the calculation density index CDI, and α + β = 1.
[0019] Further, step S300 includes:
[0020] S301. For each independent segment, summarize the complexity evaluation coefficient R of each analysis task in the corresponding analysis task list; compare the complexity evaluation coefficient R with a preset threshold R0, where the preset threshold R0 is obtained based on historical experience, business requirements, or expert advice; if the complexity evaluation coefficient R is less than the threshold R0, then classify the corresponding analysis task as a simple analysis task; if the complexity evaluation coefficient R is greater than or equal to the threshold R0, then classify the corresponding analysis task as a complex analysis task;
[0021] S302. For each simple analysis task, obtain the corresponding subset Sj, perform homomorphic encryption on the medical data of each corresponding subset Sj, and the encrypted medical data is represented as: E(Sj) = Encrypt(Sj), where Encrypt represents the homomorphic encryption operation, Sj represents the original data subset, and perform corresponding data processing on the encrypted data E(Sj), and store the data processing result in the database.
[0022] Further, step S400 includes:
[0023] S401. For each complex analysis task, obtain the corresponding requirement information, obtain the analysis process of the corresponding medical data according to the requirement information, and decompose the complex analysis task into several subtasks; for each subtask, calculate the complexity evaluation coefficient R1 corresponding to the subtask according to the calculation process of the complexity evaluation coefficient R of each analysis task in the analysis task list. If the complexity evaluation coefficient R1 corresponding to the subtask is greater than or equal to the threshold R0, continue to decompose until the complexity evaluation coefficient R1 corresponding to all subtasks is less than the threshold R0;
[0024] S402. For each complex analysis task, summarize all subtasks to obtain the corresponding subtask set K, and K = {k1, k2,..., kv}, where k1 represents the first subtask, k2 represents the second subtask, and so on, kv represents the vth subtask, and v represents the number of subtasks after the decomposition of the complex analysis task; according to the subtask set K, take each subtask as a node. If subtask ka needs to be completed before subtask kb, then there is a directed edge from ka to kb; traverse each subtask in the subtask set K to form a directed acyclic graph DAG; according to the directed acyclic graph DAG, perform topological sorting to obtain the subtask execution order list Sk;
[0025] S403. For each subtask in the subtask set K, perform homomorphic encryption processing on the medical data required by the subtask before execution; for subtask ka, the corresponding medical data Da is encrypted into ciphertext Wa, and Wa = Encrypt(Da, Keya), where Keya represents the key used to encrypt the medical data of subtask ka, and Wa is the encrypted medical data; after all subtasks are completed with encryption processing, perform corresponding medical data processing according to the order of the subtask execution order list Sk; for each subtask, select a suitable parallel computing architecture for processing. Common parallel computing architectures include:
[0026] Multi-core CPU architecture: Utilize the computing power of multi-core processors to execute multiple subtasks simultaneously.
[0027] Distributed computing architecture: It parallelly executes subtasks through a cluster composed of multiple computers and is suitable for processing large-scale data.
[0028] Graphics Processing Unit (GPU) architecture: Utilizes the parallel computing power of the GPU to process complex computing tasks, especially suitable for tasks that require a large amount of parallel computing.
[0029] After the subtasks are executed, decrypt the ciphertext results Wa of each subtask, expressed as: Qa = Decrypt(Wa, Keya); where Qa represents the result of the decrypted subtask; according to the subtask execution order list Sk, starting from the first subtask, decrypt the results of each subtask one by one. After decrypting the results of all subtasks, summarize the corresponding subtask results in order to obtain the analysis result of the complex analysis task, and store the analysis result in the database.
[0030] A medical data analysis system based on homomorphic encryption technology includes: a data processing and segmentation module, a task complexity evaluation module, a task division and storage module, and a task decomposition and parallel computing module;
[0031] The data processing and segmentation module obtains the medical data stream, segments the medical data stream into independent segments according to a preset time window, and further divides each independent segment according to the business dimension to generate several subsets; obtains the analysis task list of the medical data, extracts the requirement information of each analysis task from the analysis task list, and corresponds each analysis task to the corresponding subset;
[0032] The task complexity evaluation module extracts the corresponding task information from the corresponding analysis tasks for each subset, and combines the task information and the corresponding medical data to evaluate the complexity of the analysis task, thereby obtaining the complexity evaluation coefficient;
[0033] The task division and storage module divides the analysis tasks in the analysis task list of the medical data into simple analysis tasks and complex analysis tasks according to the complexity evaluation coefficient and the association relationship between different subsets; for simple analysis tasks, directly encrypt and store the medical data of the corresponding subset;
[0034] For complex analysis tasks, the task decomposition and parallel computing module decomposes the complex analysis tasks into several subtasks according to the corresponding task information, analyzes the dependency relationship between the subtasks, thereby obtaining the subtask execution order list; for the decomposed subtasks, uses the parallel computing architecture to perform parallel encryption processing on each subtask. After the subtasks are executed, according to the order list and execution results of the subtasks, summarize the results of the subtasks by means of step-by-step decryption.
[0035] Furthermore, the data processing and segmentation module includes a data acquisition unit and a data segmentation unit;
[0036] The data acquisition unit obtains the medical data stream from the database, slices the medical data stream according to a preset time window, and slices the medical data into independent segments; the data segmentation unit further divides each independent segment according to the business dimension to generate several subsets; obtains the analysis task list of the medical data, extracts the requirement information of each analysis task from the analysis task list, and corresponds each analysis task to the corresponding subset.
[0037] Furthermore, the task complexity evaluation module includes a data scale evaluation unit, a calculation density evaluation unit, and a complexity evaluation unit;
[0038] The data scale evaluation unit calculates the data scale index of each analysis task according to the storage amount of the medical data in the subset corresponding to each analysis task; the calculation density evaluation unit calculates the calculation density index of each task according to the requirement information of each analysis task; the complexity evaluation unit evaluates the complexity of the analysis task and calculates the complexity evaluation coefficient according to the data scale index and the calculation density index.
[0039] Furthermore, the task division and storage module includes a task classification unit and an encrypted storage unit;
[0040] The task classification unit divides the analysis tasks into simple analysis tasks and complex analysis tasks according to the complexity evaluation coefficient of the analysis task and a preset threshold; for the simple analysis tasks, the encrypted storage unit encrypts the data subsets involved in the analysis tasks using the homomorphic encryption technology.
[0041] Furthermore, the task decomposition and parallel computing module includes a task decomposition unit, a dependency analysis unit, and a parallel encryption and execution unit;
[0042] For the complex analysis tasks, the task decomposition unit decomposes the analysis tasks into several subtasks according to the requirement information and calculates the complexity evaluation coefficient of each subtask; if the complexity evaluation coefficient of the subtask still exceeds the threshold, continue to decompose until the complexity evaluation coefficients of all subtasks are lower than the threshold; the dependency analysis unit analyzes the dependency relationships between the subtasks in the task, constructs a directed acyclic graph between the subtasks, performs topological sorting according to the directed acyclic graph, and generates an execution order list for each subtask; the parallel encryption and execution unit performs homomorphic encryption processing on the medical data of each subtask, processes the subtasks using the parallel computing architecture, decrypts the data and results of each subtask one by one after execution, finally merges the results in order, and stores the analysis results of the complex tasks.
[0043] Compared with the prior art, the beneficial effects of the present invention are as follows: The analysis method proposed by the present invention can dynamically divide tasks according to the complexity of tasks, distinguishing complex analysis tasks from simple analysis tasks; for simple analysis tasks, the data is directly encrypted and stored, while for complex tasks, a strategy of decomposition and parallel computing is adopted, effectively improving the task processing efficiency. For complex analysis tasks, through the decomposition of tasks and the analysis of the dependency relationships of subtasks, the analysis process can be accelerated through parallel computing. When executing subtasks, by gradually decrypting and summarizing the results, the data privacy during the calculation process is ensured, and at the same time, the speed and efficiency of data processing are optimized. The present invention can not only handle simple operations such as basic addition and multiplication, but also overcome the limitations of homomorphic encryption in dealing with complex calculations through the strategies of subtask decomposition and dynamic analysis of tasks; by decomposing tasks and encrypting each subtask and then gradually decrypting and summarizing, it is ensured that even in the face of complex calculation requirements, effective analysis can still be carried out while protecting data privacy. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings are used to provide a further understanding of the present invention, and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention, and do not constitute a limitation to the present invention. In the accompanying drawings:
[0045] Figure 1 is a schematic diagram of the modules of the medical data analysis system based on homomorphic encryption technology of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0046] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0047] Please refer to Figure 1 , the present invention provides the following technical solutions:
[0048] A medical data analysis system based on homomorphic encryption technology includes: a data processing and splitting module, a task complexity evaluation module, a task partitioning and storage module, and a task decomposition and parallel computing module;
[0049] The data processing and splitting module obtains the medical data stream, splits the medical data stream into independent segments according to a preset time window, further divides each independent segment according to the business dimension to generate several subsets; obtains the analysis task list of the medical data, extracts the requirement information of each analysis task from the analysis task list, and corresponds each analysis task to the corresponding subset;
[0050] For each subset, the task complexity evaluation module extracts corresponding task information from the corresponding analysis tasks, and combines the task information and the corresponding medical data to evaluate the complexity of the analysis tasks, thereby obtaining a complexity evaluation coefficient;
[0051] The task division and storage module divides the analysis tasks in the analysis task list of medical data into simple analysis tasks and complex analysis tasks according to the complexity evaluation coefficient and the association relationship between different subsets; for simple analysis tasks, the medical data of the corresponding subset is directly encrypted and stored;
[0052] For complex analysis tasks, the task decomposition and parallel computing module decomposes the complex analysis tasks into several subtasks according to the corresponding task information, analyzes the dependency relationship between the subtasks, thereby obtaining a subtask execution order list; for the decomposed subtasks, a parallel computing architecture is used to perform parallel encryption processing on each subtask. After the subtasks are executed, according to the order list and execution results of the subtasks, the results of the subtasks are summarized by means of step-by-step decryption.
[0053] The data processing and segmentation module includes a data acquisition unit and a data segmentation unit;
[0054] The data acquisition unit acquires a medical data stream from a database, segments the medical data stream according to a preset time window, and segments the medical data into independent segments; the data segmentation unit further divides each independent segment according to the business dimension to generate several subsets; obtains the analysis task list of medical data, extracts the requirement information of each analysis task from the analysis task list, and corresponds each analysis task to the corresponding subset.
[0055] The task complexity evaluation module includes a data scale evaluation unit, a calculation density evaluation unit, and a complexity evaluation unit;
[0056] The data scale evaluation unit calculates the data scale index of each analysis task according to the storage volume of the medical data of the subset corresponding to each analysis task; the calculation density evaluation unit calculates the calculation density index of each task according to the requirement information of each analysis task; the complexity evaluation unit evaluates the complexity of the analysis task according to the data scale index and the calculation density index and calculates the complexity evaluation coefficient.
[0057] The task division and storage module includes a task classification unit and an encrypted storage unit;
[0058] The task classification unit divides the analysis tasks into simple analysis tasks and complex analysis tasks according to the complexity evaluation coefficient of the analysis tasks and a preset threshold; for simple analysis tasks, the encrypted storage unit uses homomorphic encryption technology to encrypt the data subsets involved in the analysis tasks.
[0059] The task decomposition and parallel computing module includes a task decomposition unit, a dependency analysis unit, and a parallel encryption and execution unit;
[0060] For complex analysis tasks, the task decomposition unit decomposes the analysis task into several subtasks according to the requirement information and calculates the complexity evaluation coefficient of each subtask; if the complexity evaluation coefficient of the subtask still exceeds the threshold, continue to decompose until the complexity evaluation coefficients of all subtasks are lower than the threshold; the dependency analysis unit analyzes the dependency relationships between the subtasks in the task, constructs a directed acyclic graph between the subtasks, performs topological sorting according to the directed acyclic graph, and generates an execution order list for each subtask; the parallel encryption and execution unit performs homomorphic encryption processing on the medical data of each subtask, processes the subtasks using a parallel computing architecture, decrypts the data and results of each subtask one by one after execution, finally merges the results in order, and stores the analysis results of the complex task.
[0061] A medical data analysis method based on homomorphic encryption technology includes the following steps:
[0062] Step S100. Obtain the medical data stream from the database, divide the medical data stream into independent segments according to a preset time window, further divide each independent segment according to the business dimension to generate several subsets; obtain the analysis task list of the medical data, extract the requirement information of each analysis task from the analysis task list, and correspond each analysis task to the corresponding subset;
[0063] Step S200. Based on the correspondence between the analysis task and the subset, and combining the requirement information of the analysis task and the medical data of the corresponding subset, evaluate the complexity of the analysis task to obtain the complexity evaluation coefficient;
[0064] Step S300. According to the complexity evaluation coefficient of the analysis task, divide the analysis tasks in the analysis task list of the medical data into simple analysis tasks and complex analysis tasks; for simple analysis tasks, directly encrypt and store the medical data of the corresponding subset;
[0065] Step S400. For complex analysis tasks, according to the corresponding requirement information, decompose the complex analysis task into several subtasks, analyze the dependency relationships between the subtasks to obtain the subtask execution order list; for the decomposed subtasks, use a parallel computing architecture to perform parallel encryption processing on each subtask, and after the subtasks are executed, according to the order list and execution results of the subtasks, summarize the results of the subtasks by gradually decrypting.
[0066] Step S100 includes:
[0067] S101. Obtain the medical data stream from the database, divide the medical data stream into independent segments according to a preset time window, and label them as {T1, T2,..., Tn}, where T1 represents the medical data segment corresponding to the first preset time window, T2 represents the medical data segment corresponding to the second preset time window, and so on. Tn represents the medical data segment corresponding to the nth preset time window, and n represents the number of independent segments obtained by dividing the acquired medical data stream according to the preset time window; for each independent segment Ti, where i ranges from 1 to n; divide according to the business dimensions of the medical data corresponding to the independent segment Ti, where the business dimensions include dimensions such as procurement, sales, and inventory; classify the medical data belonging to the same business dimension into one category, thereby generating several subsets, labeled as {S1, S2,..., Sm}, where S1 represents the set composed of the medical data of the first business dimension, S2 represents the set composed of the medical data of the second business dimension, and so on. Sm represents the set composed of the medical data of the mth business dimension, and m represents the number of business dimensions;
[0068] S102. Obtain the analysis task list of the medical data for each independent segment, extract the requirement information of each analysis task from the analysis task list, and obtain the business dimension of the medical data corresponding to each analysis task according to the requirement information; sequentially match the business dimension of the medical data corresponding to the analysis task with the business dimension corresponding to the subset Sj, where j ranges from 1 to m; according to the matching result, correspond each analysis task to the corresponding subset.
[0069] In this embodiment, it is assumed that a continuous medical data stream is obtained from the database, and the data stream contains multi-dimensional information such as procurement, sales, and inventory. According to the preset time window (for example, 1 hour, 1 day, etc.), this data stream is divided into multiple independent time periods, and each time period is called an "independent segment".
[0070] For example, it is assumed that the preset time window is 1 day, and the medical data stream obtained from the database is:
[0071] Time range: from 00:00:00 on March 1, 2025 to 23:59:59 on March 7, 2025; the medical data stream contains information such as procurement, sales, and inventory.
[0072] This data stream is divided into multiple independent segments according to the preset time window:
[0073] T1: from 00:00:00 on March 1, 2025 to 23:59:59 on March 1, 2025;
[0074] T2: from 00:00:00 on March 2, 2025 to 23:59:59 on March 2, 2025;
[0075] And so on until Tn, where n is the number of segments segmented.
[0076] The data in each time period Ti will be divided according to business dimensions (such as procurement, sales, inventory, etc.). The pharmaceutical data of each business dimension will be grouped into a subset. For example: The data of segment T1 may include the following dimensions:
[0077] Procurement: Procurement data 1, Procurement data 2...;
[0078] Sales: Sales data 1, Sales data 2...;
[0079] Inventory: Inventory data 1, Inventory data 2...;
[0080] These data will be grouped into different subsets S1, S2, S3, etc. according to business dimensions:
[0081] S1: Data of the procurement dimension (including Procurement data 1, Procurement data 2, etc.);
[0082] S2: Data of the sales dimension (including Sales data 1, Sales data 2, etc.);
[0083] S3: Data of the inventory dimension (including Inventory data 1, Inventory data 2, etc.);
[0084] For each Ti (such as T2, T3, etc.), the business dimension division will also be carried out in the same way to generate the corresponding subsets S1, S2, S3, etc.
[0085] The system will extract the requirement information of each analysis task from the analysis task list. For example, assume the analysis task list is as follows:
[0086] Task 1: Analyze the procurement data of a specific drug;
[0087] Task 2: Analyze the sales data of a specific drug;
[0088] Task 3: Analyze the procurement and sales trends of a specific drug and calculate the inventory turnover rate;
[0089] The requirement information of each analysis task clarifies the business dimensions to be analyzed. For Task 1, the requirement information indicates that the data of the "procurement" dimension needs to be analyzed; for Task 2, the requirement information indicates that the data of the "sales" dimension needs to be analyzed; for Task 3, the requirement information indicates that the data of the "procurement, sales, and inventory" dimensions needs to be analyzed.
[0090] According to the business dimension of the analysis task, match it with the business dimension in subset Sj; Task 1 (procurement task) needs to analyze procurement data, so it will be matched with all subsets containing the procurement dimension; for example, S1 contains data of the procurement dimension, and Task 1 will correspond to S1. Task 2 (sales task) needs to analyze sales data, so it will be matched with all subsets containing the sales dimension. For example, S2 contains data of the sales dimension, and Task 2 will correspond to S2. Task 3 (inventory turnover rate) needs to analyze procurement, sales, and inventory data, so it will be matched with all subsets containing the procurement, sales, and inventory dimensions. For example, S1, S2, and S3 contain data of the procurement, sales, and inventory dimensions, and Task 3 will correspond to S1, S2, and S3.
[0091] Finally, Analysis Tasks 1, 2, and 3 are matched with the corresponding subsets to form the following mapping:
[0092] Task 1 → S1 (procurement data); Task 2 → S2 (sales data); Task 3 → S1 (procurement data), S2 (sales data), and S3 (inventory data).
[0093] Step S200 includes:
[0094] S201. Based on the correspondence between the analysis task and the subset, for each analysis task, obtain the data storage amount of the medical data of the corresponding subset, and calculate the data scale index DSI of the analysis task according to the data storage amount of the medical data of the subset. The specific calculation formula is:
[0095] DSI = [∑k j = 1 Size(Sj)] / max(Size(S1), Size(S2),..., Size(Sm));
[0096] where k represents the number of subsets corresponding to the analysis task, Size(Sj) represents the data storage amount of the medical data of the j-th subset, and max(Size(S1), Size(S2),..., Size(Sm)) represents the maximum value of the data storage amounts in all subsets S1, S2,..., Sm; through the requirement information of the analysis task, obtain the calculation process of the corresponding analysis task, count the number C of each type of calculation operation, and the operation frequency F corresponding to each operation type, and calculate the calculation density index CDI of the analysis task. The specific calculation formula is: CDI = [∑G g = 1 (Cg × Fg)] / T; where Cg represents the number of the g-th type of calculation operation, that is, the amount of calculation involved in this operation type (such as the number of executions, the amount of calculation, etc.); Fg represents the operation frequency corresponding to the g-th type of calculation operation, T represents the total duration of the analysis task, and G represents the total number of types of calculation operations of the analysis task;
[0097] S202. Evaluate the complexity of the analysis task according to the data scale index DSI and the computing density index CDI corresponding to the analysis task, so as to calculate the complexity evaluation coefficient R, and the corresponding calculation formula is: R = α × DSI + β × CDI. In the calculation formula of the complexity evaluation coefficient R, the data values corresponding to the data scale index DSI and the computing density index CDI participate in the operation, and the corresponding units are not considered; where α and β respectively represent the weight coefficients corresponding to the data scale index DSI and the computing density index CDI, and α + β = 1.
[0098] In this embodiment, taking Task 3 as an example, assume the following:
[0099] Task 3 involves S1 (purchase data), S2 (sales data) and S3 (inventory data), and their storage amounts are 100GB, 200GB and 50GB respectively; the sum of the storage amounts = 100GB + 200GB + 50GB = 350GB;
[0100] The maximum storage amount is max(100GB, 200GB, 50GB) = 200GB;
[0101] DSI = (350GB) / (200GB) = 1.75.
[0102] The calculation operations of Task 3 are as follows:
[0103] Operation 1: Execute 80 times, with a frequency of 0.1 times per second.
[0104] Operation 2: Execute 40 times, with a frequency of 0.15 times per second.
[0105] Operation 3: Execute 10 times, with a frequency of 0.3 times per second.
[0106] Total duration: 15 seconds.
[0107] CDI = [(80 × 0.1) + (40 × 0.15) + (10 × 0.3)] / 15 = (8 + 6 + 3) / 15 = 1.133.
[0108] Calculate the complexity evaluation coefficient R according to the data scale index DSI and the computing density index CDI. Assume the weight coefficients α = 0.6 and β = 0.4.
[0109] R = (0.6 × 1.75) + (0.4 × 1.133) = 1.05 + 0.4532 = 1.5032.
[0110] Step S300 includes:
[0111] S301. For each independent segment, summarize the complexity evaluation coefficient R of each analysis task in the corresponding analysis task list; compare the complexity evaluation coefficient R with a preset threshold R0, where the preset threshold R0 is obtained based on historical experience, business requirements, or expert advice; if the complexity evaluation coefficient R is less than the threshold R0, classify the corresponding analysis task as a simple analysis task; if the complexity evaluation coefficient R is greater than or equal to the threshold R0, classify the corresponding analysis task as a complex analysis task;
[0112] S302. For each simple analysis task, obtain the corresponding subset Sj, perform homomorphic encryption on the medical data of each corresponding subset Sj, and the encrypted medical data is represented as: E(Sj)=Encrypt(Sj), where Encrypt represents the homomorphic encryption operation, Sj represents the original data subset, and perform corresponding data processing on the encrypted data E(Sj), and store the data processing result in the database.
[0113] Step S400 includes:
[0114] S401. For each complex analysis task, obtain the corresponding requirement information, obtain the analysis process of the corresponding medical data according to the requirement information, and decompose the complex analysis task into several subtasks; for each subtask, calculate the complexity evaluation coefficient R1 corresponding to the subtask according to the calculation process of the complexity evaluation coefficient R of each analysis task in the analysis task list. If the complexity evaluation coefficient R1 corresponding to the subtask is greater than or equal to the threshold R0, continue to decompose until the complexity evaluation coefficient R1 of all subtasks is less than the threshold R0;
[0115] S402. For each complex analysis task, summarize all subtasks to obtain the corresponding subtask set K, and K={k1,k2,...,kv}, where k1 represents the first subtask, k2 represents the second subtask, and so on, kv represents the vth subtask, and v represents the number of subtasks after the complex analysis task is decomposed; according to the subtask set K, regard each subtask as a node. If subtask ka needs to be completed before subtask kb, then there is a directed edge from ka to kb; traverse each subtask in the subtask set K to form a directed acyclic graph DAG; according to the directed acyclic graph DAG, perform topological sorting to obtain the subtask execution order list Sk;
[0116] In this embodiment, since topological sorting is a sorting algorithm for a directed acyclic graph (DAG), the purpose is to sort all nodes in the graph so that for each directed edge ka→kb, node ka appears before node kb in the sorting.
[0117] Basic steps of topological sorting:
[0118] Initialization: First, find all subtasks without pre - dependencies; that is, nodes (subtasks) with an in - degree of 0, which can be executed independently.
[0119] Gradually remove nodes: Select a node with an in - degree of 0 to execute and remove it from the graph; after removing the node, the edges connected to it in the graph will also be deleted.
[0120] Update in - degrees: For the nodes connected to the deleted node, update their in - degrees. If the in - degree of a certain node becomes 0, it can also start to execute.
[0121] Repeat execution: Repeat this process until all subtasks are executed and sorted.
[0122] Among them, the specific implementation of topological sorting usually adopts depth - first search (DFS) or breadth - first search (BFS) algorithms.
[0123] S403. For each subtask in the subtask set K, homomorphically encrypt the medical data required by the subtask before execution; for subtask ka, the corresponding medical data Da is encrypted into ciphertext Wa, and Wa = Encrypt(Da, Keya), where Keya represents the key used to encrypt the medical data of subtask ka, and Wa is the encrypted medical data; after all subtasks are encrypted, perform corresponding medical data processing according to the order of the subtask execution order list Sk; for each subtask, select a suitable parallel computing architecture for processing. Common parallel computing architectures include:
[0124] Multi - core CPU architecture: Utilize the computing power of multi - core processors to execute multiple subtasks simultaneously.
[0125] Distributed computing architecture: Parallelly execute subtasks through a cluster composed of multiple computers, which is suitable for processing large - scale data.
[0126] Graphics Processing Unit (GPU) architecture: Utilize the parallel computing power of GPUs to process complex computing tasks, especially suitable for tasks that require a large amount of parallel computing.
[0127] After the subtask is executed, decrypt the ciphertext result Wa of each subtask, expressed as: Qa = Decrypt(Wa, Keya); where Qa represents the result of the decrypted subtask; according to the subtask execution order list Sk, start from the first subtask and decrypt the results of each subtask one by one. After all subtask results are decrypted, summarize the corresponding subtask results in order to obtain the analysis result of the complex analysis task, and store the analysis result in the database.
[0128] It should be noted that, in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprising", "including" or any other variation thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device.
[0129] Finally, it should be noted that the above are only preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or perform equivalent replacements for some of the technical features. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A medical data analysis method based on homomorphic encryption technology, characterized in that: The method includes the following steps: Step S100. Obtain the medical data stream from the database, divide the medical data stream into independent segments according to a preset time window, further divide each independent segment according to the business dimension to generate several subsets; obtain the analysis task list of the medical data, extract the requirement information of each analysis task from the analysis task list, and correspond each analysis task to the corresponding subset; Step S200. Based on the correspondence between the analysis task and the subset, and combining the requirement information of the analysis task and the medical data of the corresponding subset, evaluate the complexity of the analysis task, so as to obtain the complexity evaluation coefficient; Step S200 includes: S201. Based on the correspondence between the analysis task and the subset, for each analysis task, obtain the data storage amount of the medical data of the corresponding subset, and calculate the data scale index DSI of the analysis task according to the data storage amount of the medical data of the subset. The specific calculation formula is: Among them, k represents the number of subsets corresponding to the analysis task, Size(Sj) represents the data storage volume of the medical data of the j-th subset, and max(Size(S1), Size(S2),..., Size(Sm)) represents the maximum data storage volume among all subsets S1, S2,..., Sm; by analyzing the demand information of the analysis task, the calculation process corresponding to the analysis task is obtained, the number C of each type of calculation operation is counted, and the operation frequency F corresponding to each operation type is calculated, and the calculation density index CDI of the analysis task is calculated. The specific calculation formula is: Among them, Cg represents the number of the g-th type of calculation operation; Fg represents the operation frequency corresponding to the g-th type of calculation operation, T represents the total duration of the analysis task, and G represents the total number of types of calculation operations of the analysis task; S202. According to the data scale index DSI and the calculation density index CDI corresponding to the analysis task, evaluate the complexity of the analysis task, so as to calculate the complexity evaluation coefficient R. The corresponding calculation formula is: R = α × DSI + β × CDI, where α and β respectively represent the weight coefficients corresponding to the data scale index DSI and the calculation density index CDI, and α + β = 1; Step S300. According to the complexity evaluation coefficient of the analysis task, divide the analysis tasks in the analysis task list of the medical data into simple analysis tasks and complex analysis tasks; for the simple analysis tasks, directly encrypt and store the medical data of the corresponding subset; Step S400. For complex analysis tasks, according to the corresponding requirement information, decompose the complex analysis task into several sub-tasks, analyze the dependency relationship between the sub-tasks, so as to obtain the sub-task execution sequence list; for the decomposed sub-tasks, use a parallel computing architecture to perform parallel encryption processing on each sub-task. After the sub-tasks are executed, according to the sequence list and execution results of the sub-tasks, summarize the results of the sub-tasks by means of step-by-step decryption; Step S400 includes: S401. For each complex analysis task, obtain the corresponding requirement information, obtain the analysis process of the corresponding medical data according to the requirement information, and decompose the complex analysis task into several sub-tasks; for each sub-task, calculate the complexity evaluation coefficient R1 corresponding to the sub-task according to the calculation process of the complexity evaluation coefficient R of each analysis task in the analysis task list. If the complexity evaluation coefficient R1 corresponding to the sub-task is greater than or equal to the threshold R0, continue to decompose until the complexity evaluation coefficient R1 corresponding to all sub-tasks is less than the threshold R0; S402. For each complex analysis task, aggregate all subtasks to obtain the corresponding subtask set K, where K = {k1, k2,..., kv}, k1 represents the first subtask, k2 represents the second subtask, and so on, kv represents the v-th subtask, and v represents the number of subtasks after the complex analysis task is decomposed; according to the subtask set K, each subtask is regarded as a node, and if subtask ka needs to be completed before subtask kb, then there is a directed edge from ka to kb; traverse each subtask in the subtask set K to form a directed acyclic graph DAG; according to the directed acyclic graph DAG, perform topological sorting to obtain the subtask execution order list Sk; S403. For each subtask in the subtask set K, perform homomorphic encryption processing on the medical data required by the subtask before execution; for subtask ka, the corresponding medical data Da is encrypted into ciphertext Wa, and Wa = Encrypt(Da, Keya), where Keya represents the key used to encrypt the medical data of subtask ka, and Wa is the encrypted medical data; after all subtasks are encrypted, perform corresponding medical data processing according to the order of the subtask execution order list Sk; after the subtask is executed, decrypt the ciphertext result Wa of each subtask, which is expressed as: Qa = Decrypt(Wa, Keya); where Qa represents the result of the subtask after decryption; according to the subtask execution order list Sk, starting from the first subtask, decrypt the results of each subtask one by one, and after the results of all subtasks are decrypted, summarize the corresponding subtask results in order to obtain the analysis result of the complex analysis task, and store the analysis result in the database.
2. The method for analyzing medical data based on the homomorphic encryption technology according to claim 1, wherein: The step S100 includes; S101. Obtain the medical data stream from the database, divide the medical data stream into independent segments according to a preset time window, and label them as {T1, T2,..., Tn}, where T1 represents the medical data segment corresponding to the first preset time window, T2 represents the medical data segment corresponding to the second preset time window, and so on, Tn represents the medical data segment corresponding to the n-th preset time window, and n represents the number of independent segments obtained by dividing the acquired medical data stream according to the preset time window; for each independent segment Ti, where i ranges from 1 to n; divide according to the business dimension of the medical data corresponding to the independent segment Ti, and classify the medical data belonging to the same business dimension into one category to generate several subsets, labeled as {S1, S2,..., Sm}, where S1 represents the set composed of medical data in the first business dimension, S2 represents the set composed of medical data in the second business dimension, and so on, Sm represents the set composed of medical data in the m-th business dimension, and m represents the number of business dimensions; S102. Obtain the analysis task list of the medical data for each independent segment, extract the requirement information of each analysis task from the analysis task list, and obtain the business dimension of the medical data corresponding to each analysis task according to the requirement information; sequentially match the business dimension of the medical data corresponding to the analysis task with the business dimension corresponding to the subset Sj, where j ranges from 1 to m; according to the matching result, correspond each analysis task to the corresponding subset.
3. The pharmaceutical data analysis method based on the homomorphic encryption technology according to claim 1, wherein: The step S300 includes: S301. For each independent segment, summarize the complexity evaluation coefficient R of each analysis task in the corresponding analysis task list; compare the complexity evaluation coefficient R with a preset threshold R0. If the complexity evaluation coefficient R is less than the threshold R0, classify the corresponding analysis task as a simple analysis task; if the complexity evaluation coefficient R is greater than or equal to the threshold R0, classify the corresponding analysis task as a complex analysis task. S302. For each simple analysis task, obtain the corresponding subset Sj, perform homomorphic encryption on the medical data of each corresponding subset Sj, and the encrypted medical data is expressed as: E(Sj) = Encrypt(Sj), where Encrypt represents the homomorphic encryption operation and Sj represents the original data subset, and perform corresponding data processing on the encrypted data E(Sj), and store the data processing result in the database.
4. A medical data analysis system based on homomorphic encryption technology, which is applied to the medical data analysis method based on homomorphic encryption technology according to any one of claims 1-3, and is characterized in that: The system includes: a data processing and segmentation module, a task complexity evaluation module, a task classification and storage module, and a task decomposition and parallel computing module; The data processing and segmentation module obtains the medical data stream, segments the medical data stream into independent segments according to a preset time window, further divides each independent segment according to the business dimension, and generates a number of subsets; obtains the analysis task list of the medical data, extracts the requirement information of each analysis task from the analysis task list, and corresponds each analysis task to the corresponding subset. The task complexity evaluation module extracts the corresponding task information from the corresponding analysis tasks for each subset, and combines the task information and the corresponding medical data to evaluate the complexity of the analysis tasks, so as to obtain the complexity evaluation coefficient. The task complexity evaluation module includes a data scale evaluation unit, a calculation density evaluation unit, and a complexity evaluation unit; The data scale evaluation unit calculates the data scale index of each analysis task according to the storage amount of the medical data of the subset corresponding to each analysis task; the calculation density evaluation unit calculates the calculation density index of each task according to the requirement information of each analysis task; the complexity evaluation unit evaluates the complexity of the analysis tasks and calculates the complexity evaluation coefficient according to the data scale index and the calculation density index. The task classification and storage module classifies the analysis tasks in the analysis task list of the medical data into simple analysis tasks and complex analysis tasks according to the complexity evaluation coefficient and the association relationship between different subsets; for the simple analysis tasks, directly encrypt and store the medical data of the corresponding subsets. For complex analysis tasks, the task decomposition and parallel computing module decomposes the complex analysis tasks into several subtasks according to the corresponding task information, analyzes the dependency relationships between the subtasks, and thus obtains a subtask execution sequence list. For the decomposed subtasks, a parallel computing architecture is used to perform parallel encryption processing on each subtask. After the subtasks are completed, according to the sequence list and execution results of the subtasks, the results of the subtasks are aggregated in a step-by-step decryption manner. The task decomposition and parallel computing module includes a task decomposition unit, a dependency relationship analysis unit, and a parallel encryption and execution unit. For complex analysis tasks, the task decomposition unit decomposes the analysis tasks into several subtasks according to the requirement information and calculates the complexity evaluation coefficient of each subtask. If the complexity evaluation coefficient of a subtask still exceeds the threshold, it continues to be decomposed until the complexity evaluation coefficients of all subtasks are lower than the threshold. The dependency relationship analysis unit analyzes the dependency relationships between the subtasks in the task, constructs a directed acyclic graph between the subtasks, performs topological sorting according to the directed acyclic graph, and generates an execution sequence list for each subtask. The parallel encryption and execution unit performs homomorphic encryption processing on the medical data of each subtask, processes the subtasks using a parallel computing architecture, decrypts the data and results of each subtask one by one after execution, finally merges the results in order, and stores the analysis results of the complex task.
5. The pharmaceutical data analysis system based on the homomorphic encryption technology according to claim 4, wherein: The data processing and splitting module includes a data acquisition unit and a data splitting unit. The data acquisition unit obtains the medical data stream from the database, splits the medical data stream according to a preset time window, and cuts the medical data into independent segments. The data splitting unit further divides each independent segment according to the business dimension to generate several subsets. An analysis task list of the medical data is obtained, the requirement information of each analysis task is extracted from the analysis task list, and each analysis task is corresponded to the corresponding subset.
6. The pharmaceutical data analysis system based on the homomorphic encryption technology according to claim 4, characterized in that: The task partitioning and storage module includes a task classification unit and an encrypted storage unit. The task classification unit divides the analysis tasks into simple analysis tasks and complex analysis tasks according to the complexity evaluation coefficient of the analysis tasks and a preset threshold. For simple analysis tasks, the encrypted storage unit uses homomorphic encryption technology to encrypt the data subsets involved in the analysis tasks.
Citation Information
Patent Citations
Data processing method, system and device, computer equipment and storage medium
CN119293815A
Task management method, system, device and medium based on graph structure
CN119781961A