A data desensitization processing method and system for a large model knowledge base

By constructing spatial bounding boxes and generating multi-dimensional desensitized labels in DICOM image reports, the problem of balancing privacy regions and diagnostic information in existing technologies is solved. This achieves the preservation of key diagnostic information while protecting privacy, and improves the retrieval accuracy of large model knowledge bases.

CN122575642BActive Publication Date: 2026-11-27GUIZHOU ELECTRONIC CERTIFICATION TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202611000019.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-07-06
Publication Date
2026-11-27
Estimated Expiration
2046-07-06

AI Technical Summary

Technical Problem

Existing methods for anonymizing medical data for large model knowledge bases cannot achieve a precise balance between protecting privacy areas and retaining medical information, leading to the leakage of privacy information or the loss of diagnostic information. These methods fail to meet the privacy compliance requirements and data integrity needs of medical data sharing.

Method used

By acquiring multimodal medical datasets, we calculate the covariance matrix and eigenvectors of discrete spatial coordinate points of privacy regions in DICOM image reports, construct spatial bounding boxes, and combine the intersection states of regions of clinical interest to generate multidimensional desensitization labels and dynamic desensitization strategies. We then perform position mapping and character replacement to construct vector indexes for large language models.

Benefits of technology

This approach achieves the goal of preserving the integrity of medical information to the greatest extent possible while protecting patient privacy, improves the retrieval accuracy of the medical big data model knowledge base, and avoids the irreversible loss of key imaging features and privacy leaks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122575642B_ABST
    Figure CN122575642B_ABST
Patent Text Reader

Abstract

The application provides a data desensitization processing method and system for a large model knowledge base, relates to the technical field of medical data processing, and comprises the following steps: acquiring a multi-modal medical data set, obtaining a knowledge base original document of sensitive medical data nodes according to entity position features in structured electronic medical record texts and DICOM image reports in the multi-modal medical data set; extracting a discrete space coordinate point set of a preset privacy area in the DICOM image report according to the knowledge base original document of the sensitive medical data nodes, calculating a covariance matrix of the discrete space coordinate point set and solving an eigenvector; taking the eigenvector as a principal axis direction, constructing a space bounding box with the principal axis direction and taking the centroid of the discrete space coordinate point set as the center, and calculating the projection extreme value of the vertex of the space bounding box on the corresponding plane normal vector of the diagnosis and treatment attention area. The application improves the retrieval precision of the medical large model knowledge base.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical data processing technology, and in particular to a data anonymization processing method and system for large model knowledge bases. Background Technology

[0002] Existing methods for anonymizing medical data for large model knowledge bases typically employ fixed-region cropping or global blurring to handle privacy areas in DICOM image reports. Specifically, for regions in DICOM images that may contain patient privacy information, existing methods directly cover them with preset fixed rectangles or uniform blur intensity across the entire image, without considering the actual geometric relationship between privacy areas and areas of clinical interest in three-dimensional space.

[0003] When the privacy-annotated area and the critical diagnostic area where the lesion is located are adjacent or even partially overlap in the DICOM image space, fixed-area desensitization is very likely to cover or blur the key image features in the diagnostic area of ​​interest, resulting in the irreversible loss of visual information that is crucial for clinical diagnosis, such as the edge and texture of the lesion in the desensitized image. On the other hand, if the desensitization range is simply reduced to protect the diagnostic area, it may lead to the leakage of residual privacy-annotated areas. Therefore, existing methods cannot achieve a precise balance between privacy protection of medical images and the fidelity of diagnostic information, and it is difficult to simultaneously meet the privacy compliance requirements in medical data sharing and the data integrity requirements for the construction of large model knowledge bases. Summary of the Invention

[0004] This invention provides a data anonymization method and system for large-scale medical knowledge bases, improving the retrieval accuracy of large-scale medical knowledge bases.

[0005] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows: Firstly, a data anonymization method for large model knowledge bases, the method comprising: Obtain a multimodal medical dataset, and based on the patient's structured electronic medical record text and entity location features in the DICOM image report, obtain the original knowledge base document for sensitive medical data nodes; Based on the original document of the knowledge base of sensitive medical data nodes, the discrete spatial coordinate point set of the preset privacy area in the DICOM image report is extracted, the covariance matrix of the discrete spatial coordinate point set is calculated and the eigenvector is solved; the eigenvector is used as the principal axis direction, and a spatial bounding box with the principal axis direction is constructed with the centroid of the discrete spatial coordinate point set as the center, and the extreme values ​​of the projection of the vertices of the spatial bounding box onto the plane normal vector corresponding to the area of ​​medical interest are calculated. The intersection status between the spatial bounding box and the area of ​​concern for diagnosis and treatment is determined based on the overlapping interval of the projection extreme values. Combined with the hierarchical position of the sensitive medical data node in the medical diagnosis link and the preset medical data classification and grading rules, multi-dimensional desensitization labels for the sensitive medical data node are obtained. Based on the multi-dimensional desensitization tags of sensitive medical data nodes, and combined with the permission node location of the target intelligent agent that initiates the knowledge base query request, a dynamic desensitization strategy for sensitive medical data nodes is obtained. Based on the dynamic desensitization strategy for sensitive medical data nodes, position mapping and character replacement are performed on the sensitive medical data nodes in the original document of the knowledge base to obtain desensitized medical knowledge fragments. Based on the anonymized medical knowledge fragments, a vector index for a large language model is constructed to obtain a medical large model knowledge base with access control.

[0006] Secondly, a data anonymization system for large-scale model knowledge bases includes: The acquisition module is used to acquire multimodal medical datasets. Based on the patient's structured electronic medical record text and entity location features in the DICOM image report, it obtains the original knowledge base document of sensitive medical data nodes. The calculation module is used to extract the discrete spatial coordinate point set of the preset privacy area in the DICOM image report from the original document of the knowledge base of sensitive medical data nodes, calculate the covariance matrix of the discrete spatial coordinate point set and solve the eigenvector; use the eigenvector as the principal axis direction, construct a spatial bounding box with the principal axis direction as the centroid of the discrete spatial coordinate point set, and calculate the extreme values ​​of the projection of the vertices of the spatial bounding box onto the plane normal vector corresponding to the area of ​​medical interest. The judgment module is used to determine the intersection status between the spatial bounding box and the area of ​​concern for diagnosis and treatment based on the overlapping interval of the projection extreme values, and to obtain multi-dimensional desensitization labels for sensitive medical data nodes by combining the hierarchical position of sensitive medical data nodes in the medical diagnosis link and the preset medical data classification and grading rules. The processing module is used to obtain a dynamic desensitization strategy for sensitive medical data nodes based on the multi-dimensional desensitization tags of the sensitive medical data nodes and the location of the permission nodes of the target intelligent agent that initiates the knowledge base query request. The replacement module is used to perform position mapping and character replacement on sensitive medical data nodes in the original document of the knowledge base according to the dynamic desensitization strategy for sensitive medical data nodes, so as to obtain desensitized medical knowledge fragments. The module is used to build vector indexes for large language models based on anonymized medical knowledge fragments, resulting in a medical large model knowledge base with access control.

[0007] Thirdly, a computing device, comprising: One or more processors; A storage device for storing one or more programs that, when executed by one or more processors, cause the one or more processors to implement the method.

[0008] Fourthly, a computer-readable storage medium storing a program that, when executed by a processor, implements the method.

[0009] The above-described solution of the present invention has at least the following beneficial effects: By introducing a method for constructing a spatial bounding box based on the covariance matrix and eigenvectors of discrete spatial coordinate points in the DICOM image space, and accurately determining the intersection state between the spatial bounding box of the privacy region and the region of clinical interest by using the overlapping interval of projection extrema, a refined quantitative discrimination of the spatial overlap relationship between the privacy region and the region of clinical interest is achieved. This method enables the desensitization operation to be performed within the privacy space that needs to be covered, while fully preserving the key image features within the region of clinical interest. Thus, while ensuring that the patient's privacy information is fully desensitized, the integrity of the visual information of medical images that has core value for clinical diagnosis is maintained to the greatest extent. Attached Figure Description

[0010] Figure 1 This is a flowchart illustrating a data anonymization method for large model knowledge bases provided by an embodiment of the present invention.

[0011] Figure 2 This is a schematic diagram of a data anonymization processing system for large model knowledge bases provided by an embodiment of the present invention.

[0012] Figure 3 It is a trend chart showing the correlation between intersection states and sensitivity levels.

[0013] Figure 4 It is a heatmap of desensitization strategies for smart agents with different permissions. Detailed Implementation

[0014] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0015] like Figure 1 As shown, an embodiment of the present invention proposes a data anonymization method for large model knowledge bases, the method comprising the following steps: Step 1: Obtain the multimodal medical dataset. Based on the patient's structured electronic medical record text and entity location features in the DICOM image report, obtain the original knowledge base document of the sensitive medical data node. Step 2: Based on the original document of the knowledge base of sensitive medical data nodes, extract the discrete spatial coordinate point set of the preset privacy area in the DICOM image report, calculate the covariance matrix of the discrete spatial coordinate point set and solve for the eigenvector; take the eigenvector as the principal axis direction, construct a spatial bounding box with the principal axis direction as the centroid of the discrete spatial coordinate point set, and calculate the extreme values ​​of the projection of the vertices of the spatial bounding box onto the plane normal vector corresponding to the area of ​​medical interest. Step 3: Determine the intersection status between the spatial bounding box and the area of ​​concern for diagnosis and treatment based on the overlapping interval of the projection extreme values, and combine the hierarchical position of the sensitive medical data node in the medical diagnosis link with the preset medical data classification and grading rules to obtain the multi-dimensional desensitization label of the sensitive medical data node; Step 4: Based on the multi-dimensional desensitization tags of sensitive medical data nodes, and combined with the permission node location of the target intelligent agent that initiated the knowledge base query request, a dynamic desensitization strategy for sensitive medical data nodes is obtained. Step 5: Based on the dynamic desensitization strategy for sensitive medical data nodes, perform position mapping and character replacement on the sensitive medical data nodes in the original document of the knowledge base to obtain the desensitized medical knowledge fragments. Step 6: Based on the desensitized medical knowledge fragments, construct a vector index for the large language model to obtain a medical large model knowledge base with access control.

[0016] In this embodiment of the invention, by extracting multimodal entity location features, constructing directional bounding boxes based on the covariance matrix and calculating projection extrema to determine spatial intersection status, and then combining the medical diagnostic link hierarchy and the target intelligent agent permission node position to generate multi-dimensional desensitization labels and dynamic desensitization strategies, and performing position mapping and character replacement to construct vector indexes, this invention overcomes the technical problems of existing large model knowledge bases when processing multimodal medical data. These problems include the inability to accurately define image spatial privacy areas due to the use of static global unified masking strategies, resulting in excessive desensitization and loss of key spatial pathological features leading to privacy leaks, and the inability to adapt to dynamic fine-grained permission control in multi-agent collaborative access scenarios. This invention achieves the goal of maximizing the preservation of the spatial topological integrity and key pathological context of multimodal medical data while ensuring the security of patients' multidimensional sensitive privacy data, effectively avoiding knowledge graph fragmentation and illusion phenomena during large model inference, and improving the retrieval accuracy of the medical large model knowledge base.

[0017] In a preferred embodiment of the present invention, step 1 above may include: Step 1.1: Obtain a multimodal medical dataset. Perform semantic parsing on the patient's structured electronic medical record text within the multimodal medical dataset to obtain the entity location features of the patient's structured electronic medical record text. Specifically, this includes: extracting the context window of each character sequence in the patient's structured electronic medical record text from the multimodal medical dataset to obtain a character-level context feature tensor. The multimodal medical dataset refers to a collection of medical data revolving around the same medical event, composed of different representational forms and data structures. It primarily covers two major categories of data: textual semantic modality and three-dimensional image modality. All data is associated through unique patient identifiers and medical event identifiers, possessing cross-modal spatiotemporal correspondence. Specifically, it includes the following data content: Structured electronic medical record text data refers to structured or semi-structured text-based medical records stored in HL7CDA or hospital information system standard field format. Specifically, it includes: patient identity basic information text, medical visit information text, medical history and diagnosis text, medical orders and treatment text, and laboratory test reports. This type of data carries semantic description information of medical events and is used to extract medical entity and location features from the text dimension.

[0018] DICOM image report data refers to medical images and accompanying metadata conforming to the DICOM 3.0 standard. Specifically, it includes: 3D voxel image data, DICOM file header metadata, and image annotation mask data. This type of data carries spatial morphological information about medical events and is used to extract the spatial coordinates and location features of entities in the image dimension.

[0019] Based on the character-level context feature tensor, a pre-trained biomedical named entity recognition model is used to perform character-by-character entity boundary classification on medical record text, obtaining the classification probability distribution of each character belonging to the entity's starting boundary, inside the entity, or outside the entity. The formula for calculating the classification probability distribution is as follows: ; in, This indicates the first in the medical record text Entity label category with 1 character; Indicates the first Embedding vectors of characters; Indicates the first The context window feature vector of n characters, with a window radius of . hour splicing; This indicates the first [number] after encoding by a bidirectional long short-term memory network. The hidden state vector of each character; This represents a vector concatenation operation; Represents the entity classification weight matrix; Indicates entity classification bias; This represents the normalized exponential function.

[0020] Based on the classification probability distribution of each character belonging to the entity's starting boundary, inside the entity, or outside the entity, the Viterbi decoding algorithm is used to globally solve the label state transition path of the character sequence, obtaining the complete character span range of each named entity in the medical record text. The recursive formula for Viterbi decoding is: ; in, This represents the character position index in the medical record text; and They represent the first The and the first The entity label status of each character; Indicates the total number of tag states; Indicates up to the When there are 1 character, the tag status is: The maximum cumulative probability; Indicates from label state Transition to tag state The state transition probability; Indicates the first One character is predicted as the label state. The classification probability.

[0021] Based on the complete character span range of each named entity in the medical record text, an attribute structure containing entity type label and the start and end character index of the entity text span in the original medical record is constructed for each named entity, thereby obtaining the entity location features of the patient's structured electronic medical record text.

[0022] Step 1.2: Perform voxel analysis on the DICOM image report from the multimodal medical dataset to obtain the entity location features of the DICOM image report. Specifically, this includes: reading the DICOM standard label field from the DICOM file header of the DICOM image report from the multimodal medical dataset to obtain the voxel spacing, slice thickness, image origin coordinates, and image orientation vector of the DICOM image report. The formula for calculating the voxel spacing is: ; in, The physical spacing of voxels in the row direction is expressed in mm; The physical spacing of voxels in the column direction is expressed in mm; The layer thickness between adjacent slices is expressed in mm; This represents an array of possible values ​​for the pixel spacing label field in the DICOM standard. This indicates the value of the layer thickness label field in the DICOM standard.

[0023] Based on the voxel spacing, slice thickness, image origin coordinates, and image orientation vector from the DICOM image report, a voxel-level coordinate mapping function is constructed from the image spatial coordinate system to the patient's three-dimensional physical coordinate system. The calculation formula for the coordinate mapping function is as follows: ; in, Represents the discrete pixel coordinates of a voxel in the image space coordinate system. For column indexes, For row index, For slice index; The unit of continuous spatial coordinates in the patient's three-dimensional physical coordinate system after mapping is mm; The unit direction vector representing the row direction of the image; The unit direction vector representing the column direction of the image; The unit direction vector representing the slice normal; This represents the three-dimensional spatial offset coordinates of the image origin in the patient coordinate system.

[0024] Based on the voxel-level coordinate mapping function, physical space coordinate mapping is performed on the voxels at each pixel location in the DICOM image report to obtain the three-dimensional physical space coordinates of each voxel. Based on the three-dimensional physical space coordinates of each voxel, the pixel-level annotation mask region marked in the DICOM label field is extracted from the DICOM image report. Region aggregation is performed on the coordinates of each voxel within the annotation mask region to obtain the entity location features of the DICOM image report.

[0025] Step 1.3: Based on the entity location features of the patient's structured electronic medical record text and the entity location features of the DICOM image report, perform multimodal spatial coordinate alignment to obtain aligned entity location features. Specifically, this includes: extracting medical entities related to anatomical structures and lesions from the entity location features of the patient's structured electronic medical record text to obtain a text-related entity set; and extracting image entities related to anatomical structures and lesions from the entity location features of the DICOM image report to obtain an image-related entity set. Based on the text-related entity set and the image-related entity set, semantic matching of entity names is performed. A standardized thesaurus covering anatomical structures and lesion-type entities is constructed using the UMLS thesaurus, the SNOMEDCT concept system, and the Chinese Medical Subject Headings. Character normalization and medical core stemming are performed on both text and image entity names sequentially. Normalized Levinstein edit distance similarity, character set Jaccard similarity, and longest common subsequence proportion similarity are calculated for each entity name, and weighted summed at 0.4, 0.3, and 0.3 respectively to obtain the final comprehensive similarity. For text entities that fail to match, they are marked as having no spatial correspondence and only the text is anonymized; they are not included in spatial coordinate alignment, resulting in a set of successfully matched entity pairs. Based on the set of successfully matched entity pairs, the semantic position of the text entity and the three-dimensional spatial coordinates of the image entity in each entity pair are extracted to obtain an alignment reference point set. Based on the alignment reference point set, the transformation matrix from the text semantic space to the image three-dimensional space is calculated. The transformation matrix calculation formula is as follows: ; Where T is a 4×4 homogeneous transformation matrix, containing rotation, translation, and scaling components. Let i be the text semantic space coordinate vector of the i-th alignment reference point. Let i be the image's three-dimensional spatial coordinate vector of the i-th alignment reference point. To align the number of reference points, It is an L2 norm; Based on the transformation matrix T, all entity location features of the patient's structured electronic medical record text are mapped to the 3D space of the DICOM image to obtain the aligned entity location features.

[0026] Step 1.4: Based on the aligned entity location features, the patient's structured electronic medical record text and DICOM image report are encapsulated into structured nodes to obtain the original knowledge base document of sensitive medical data nodes. Specifically, this includes: extracting the unique identifier, entity type, spatial coordinates, and association relationships of all entities based on the aligned entity location features to obtain an entity attribute set; constructing parent-child and sibling associations between entities according to the logical relationship of the medical diagnosis link based on the entity attribute set to obtain a medical entity relationship graph; associating the original data of the patient's structured electronic medical record text and DICOM image report to the corresponding entity nodes based on the medical entity relationship graph to obtain an associated entity node set; filtering out entity nodes containing patient privacy information based on the associated entity node set to obtain a sensitive medical data node set; and encapsulating the sensitive medical data node set into a document format conforming to the knowledge base storage specification to obtain the original knowledge base document of sensitive medical data nodes. The sensitive medical data node refers to the smallest structured knowledge unit carrying patient privacy sensitive information obtained by structured encapsulation after performing entity recognition and spatial alignment on multimodal medical data, and is the basic component unit constituting the original knowledge base document.

[0027] In this embodiment of the invention, by performing semantic parsing on the patient's structured electronic medical record text and voxel parsing on the DICOM image report to extract their respective entity position features, and then performing multimodal spatial coordinate alignment, and encapsulating structured nodes based on the aligned entity position features, the technical means overcome the technical problem in the prior art that when processing multimodal medical data, the text semantic description and the physical lesion of the image lack a unified spatial coordinate benchmark, which leads to the inaccurate correspondence of cross-modal information and the easy occurrence of spatial topological breaks and information misalignment during processing. Thus, it achieves accurate alignment and unified encapsulation of text semantic entities and image voxel entities in three-dimensional physical space, and constructs original documents of a knowledge base with cross-modal spatial consistency.

[0028] In a preferred embodiment of the present invention, step 2 above may include: Step 2.1: Based on the original document of the knowledge base of the sensitive medical data node, identify the 3D voxel boundaries of the preset privacy region in the DICOM image report. Extract the discrete spatial coordinate point set of the preset privacy region in the DICOM image report based on the 3D voxel boundaries. Specifically, this includes: extracting the associated DICOM image 3D voxel space and the privacy entity identifier set in the sensitive medical data node based on the original document of the knowledge base of the sensitive medical data node; matching the privacy entity segmentation mask in the DICOM image 3D voxel space based on the privacy entity identifier set to obtain the 3D voxel mask of the preset privacy region; performing 3D Canny edge detection based on the 3D voxel mask of the preset privacy region to extract the 3D voxel boundaries of the privacy region, obtaining a boundary voxel set; and extracting the center 3D world coordinates of each boundary voxel based on the boundary voxel set to obtain the discrete spatial coordinate point set of the preset privacy region in the DICOM image report.

[0029] Step 2.2: Based on the discrete spatial coordinate point set, calculate the covariance matrix of the discrete spatial coordinate point set, and perform eigenvalue decomposition on the covariance matrix to obtain the eigenvectors. Specifically, this includes: calculating the centroid coordinates of the point set based on the discrete spatial coordinate point set. The centroid calculation formula is as follows: ; in, Let be the three-dimensional coordinate vector of the centroid of a discrete set of coordinate points. For the first A three-dimensional coordinate vector of discrete spatial coordinate points This represents the total number of points in the discrete spatial coordinate point set. Based on the discrete spatial coordinate point set and the centroid coordinates, a centering process is performed on each coordinate point to obtain a centralized coordinate point set. The centering calculation formula is as follows: ; in, For the first Given a set of centered coordinate point vectors, calculate the covariance matrix of the discrete space coordinate point set. The formula for calculating the covariance matrix is: ; in, It is a 3×3 covariance matrix. For the first The transpose of the centered coordinate point vector is used to perform eigenvalue decomposition based on the covariance matrix, resulting in the set of eigenvalues ​​and the corresponding set of eigenvectors of the covariance matrix. Based on the set of eigenvalues, the set of eigenvectors is sorted in descending order of eigenvalues ​​to obtain the sorted set of eigenvectors.

[0030] Step 2.3: Using the eigenvectors as the principal axis direction and the centroid of the discrete spatial coordinate point set as the center, calculate the coordinate extrema of the discrete spatial coordinate point set along the principal axis direction. Construct a bounding box with the principal axis direction based on these extrema. Specifically, this includes: taking the first three eigenvectors from the sorted eigenvector set to construct a rotation matrix. The formula for calculating the rotation matrix is: ; in, It is a 3×3 rotation matrix. Given three unit eigenvectors arranged in descending order of eigenvalues, each centralized coordinate point is projected onto the principal axis coordinate system based on the rotation matrix and the centralized coordinate point set. The projection calculation formula is as follows: ; in, For the first The coordinate vectors of a point in the principal axis coordinate system To obtain the transpose of the rotation matrix, based on the set of coordinate points in the principal axis coordinate system, calculate the minimum and maximum coordinate values ​​along each principal axis direction to obtain the set of extreme values ​​of the coordinates along the principal axis directions. The formula for calculating the extreme values ​​of the coordinates is as follows: ; in, For the first Minimum coordinates along each principal axis direction For the first The maximum value of the coordinates along each principal axis direction. For the first The point at the th Coordinate components along each principal axis direction Corresponding to the three principal axes, based on the set of extreme values ​​of the principal axis coordinates and the centroid coordinates, the coordinates of the eight vertices of the bounding box in the world coordinate system are calculated, resulting in a bounding box with principal axis directions. Vertex coordinate calculation formula: ; in, For the first spatial bounding box vertex coordinates ( ), This represents all combinations of taking the positive and negative half lengths in each principal axis direction.

[0031] Step 2.4: Obtain the plane normal vector corresponding to the region of medical interest; calculate the projection scalar of the vertices of the bounding box onto the plane normal vector corresponding to the region of medical interest; and calculate the extreme values ​​of the projections of the vertices of the bounding box onto the plane normal vector corresponding to the region of medical interest based on the projection scalar. Specifically, this includes: extracting the original plane normal vector corresponding to the entity in the region of medical interest from the original document in the knowledge base of the sensitive medical data node; performing normalization processing on the original plane normal vector to obtain the normalized plane normal vector corresponding to the region of medical interest; the normalization calculation formula is as follows: ; in, The unit plane normal vector, The original plane normal vector, Using the L22 norm, based on the bounding box with principal axis directions and the normal vector of the unit plane, calculate the projection scalar of each bounding box vertex onto the plane normal vector, obtaining the set of projection scalars. The formula for calculating the projection scalar is as follows: ; in, For the first The projection scalar of each bounding box vertex This represents the vector dot product operation. Based on the set of projected scalars, the minimum and maximum values ​​of the projected scalars are calculated to obtain the extreme values ​​of the projections of the vertices of the spatial bounding box onto the normal vector of the plane corresponding to the region of clinical interest. The formula for calculating the extreme values ​​of the projections is as follows: ; in, This is the minimum value of the projected extremum. This represents the maximum value of the projected extrema.

[0032] In this embodiment of the invention, a set of discrete spatial coordinate points is extracted by identifying the three-dimensional voxel boundaries of a preset privacy region in a DICOM image report, calculating its covariance matrix, and performing eigenvalue decomposition to solve for the eigenvectors. Then, a spatial bounding box is constructed with the centroid as the center, the eigenvectors as the main axis direction, and the coordinate extrema. The normal vector of the plane corresponding to the region of medical interest is obtained to calculate the projection scalar and projection extrema of the vertices of the spatial bounding box on the normal vector. Therefore, this invention overcomes the technical problems of existing technologies when processing privacy regions in three-dimensional medical images. The conventional axis-aligned bounding box cannot tightly fit irregularly distributed privacy voxels, resulting in redundant spatial boundaries. Furthermore, it cannot quantitatively evaluate the intersection and overlap relationship between the privacy region and the region of medical interest in the three-dimensional spatial normal direction, making it difficult to support spatial-level fine-grained desensitization determination. Thus, it achieves tight fitting and accurate modeling of irregular medical image privacy regions in three-dimensional space, and accurately quantifies the spatial projection extrema and overlap state of the privacy region and the region of medical interest in a specific normal direction.

[0033] In a preferred embodiment of the present invention, step 3 above may include: Step 3.1: Based on the projection extrema, calculate the overlap interval of the projection extrema on the normal vector of the plane corresponding to the region of concern for diagnosis and treatment. Determine the intersection state between the spatial bounding box and the region of concern for diagnosis and treatment based on the overlap interval, and obtain the intersection state determination result. Specifically, this includes: obtaining the minimum and maximum projection values ​​of the region of concern for diagnosis and treatment on the normal vector of the corresponding plane, and recording the minimum projection value of the region of concern for diagnosis and treatment as... The maximum projection value of the area of ​​focus for diagnosis and treatment is recorded as Obtain the projection scalars of all vertices of the bounding box onto the plane normal vector corresponding to the region of interest in diagnosis. From all projection scalars, select the minimum and maximum values, and denote the minimum projection value of the bounding box as... The maximum projection value of the spatial bounding box is denoted as .

[0034] The lower and upper limits of overlap between two projection intervals are calculated using the following formulas: ; ; The length of the overlapping interval is calculated using the following formula: ; The overlapping interval length is determined. If the overlapping interval length is less than or equal to 0.001 meters, the spatial bounding box and the area of ​​concern are considered to be completely non-intersecting. If the overlapping interval length is greater than 0.001 meters, the ratio of the overlapping interval length to the projected interval length of the spatial bounding box is further calculated. The formula for calculating the projected interval length of the spatial bounding box is as follows: ; The formula for calculating the overlap ratio is as follows: ; If the overlap ratio is greater than 0 and less than or equal to 0.05, the spatial bounding box and the region of interest are determined to be edge-intersecting. If the overlap ratio is greater than 0.05 and less than or equal to 0.95, the spatial bounding box and the region of interest are determined to be partially intersecting. If the overlap ratio is greater than 0.95, the spatial bounding box and the region of interest are determined to be completely contained within each other. These determinations are stored as the intersection state judgment results.

[0035] Step 3.2: Based on the intersection state judgment results, determine the data access roles corresponding to the hierarchical positions of sensitive medical data nodes in the medical diagnosis link, obtaining hierarchical position characteristics. Specifically, this includes: pre-constructing a hierarchical position mapping table for the medical diagnosis link. The hierarchical positions of the medical diagnosis link, from low to high, are: patient basic information layer, examination execution information layer, imaging diagnosis information layer, clinical treatment information layer, and prognosis follow-up information layer. Each hierarchical position corresponds to a preset set of data access roles. The data access roles corresponding to the patient basic information layer are administrative personnel and general medical staff; the data access roles corresponding to the examination execution information layer are laboratory technicians and general medical staff; the data access roles corresponding to the imaging diagnosis information layer are radiologists and attending physicians; the data access roles corresponding to the clinical treatment information layer are attending physicians and associate chief physicians; and the data access roles corresponding to the prognosis follow-up information layer are associate chief physicians and chief physicians. Read the pre-associated medical diagnosis link hierarchical location identifier of the sensitive medical data node, obtain the initial corresponding set of data access roles from the hierarchical location mapping table based on the hierarchical location identifier, and adjust the initial corresponding set of data access roles according to the intersection status judgment result. If the intersection status judgment result is completely disjoint, the initial corresponding set of data access roles remains unchanged; if the intersection status judgment result is edge intersection, the role with the lowest permission level in the initial corresponding set of data access roles is removed. If the intersection status judgment result is partial intersection, then the two roles with the lowest permission levels in the initial corresponding data access role set are removed; if the intersection status judgment result is complete inclusion, then the three roles with the lowest permission levels in the initial corresponding data access role set are removed. The adjusted data access role set is used as the hierarchical position feature of the sensitive medical data node. The above role removal rules are designed based on the principle of least privilege: the more severe the overlap between the privacy area and the treatment area, the greater the potential impact of the desensitization operation on the treatment information. Therefore, it is necessary to reduce the range of roles that can access this data, retaining only high-privilege roles with sufficient clinical judgment capabilities, to avoid low-privilege roles making incorrect judgments based on incomplete desensitized data due to a lack of context. For example, Figure 3 As shown, the horizontal axis represents the intersection ratio (0%~100%); the vertical axis represents the sensitivity level (1~3); the curve shows that the higher the intersection ratio, the higher the sensitivity level (level 3 when completely contained); Conclusion: The spatial intersection state directly affects the desensitization intensity. To achieve refined grading, the above role removal rules are designed based on the principle of least privilege: the more severe the overlap between the privacy area and the treatment area, the greater the potential impact of the desensitization operation on the treatment information. Therefore, it is necessary to reduce the range of roles that can access this data, retaining only high-privilege roles with sufficient clinical judgment capabilities, to avoid low-privilege roles making incorrect judgments based on incomplete desensitized data due to a lack of context.

[0036] Step 3.3: Based on the hierarchical location characteristics and the preset medical data classification and grading rules, perform data sensitivity grading mapping on sensitive medical data nodes to obtain multi-dimensional desensitization labels for sensitive medical data nodes. Specifically, this includes: pre-establishing medical data classification and grading rules, dividing medical data into three levels according to sensitivity from low to high. Level 1 sensitive data corresponds to the lowest desensitization requirement, Level 2 sensitive data corresponds to the medium desensitization requirement, and Level 3 sensitive data corresponds to the highest desensitization requirement. The sensitivity level is a quantitative indicator that measures the potential harm that sensitive medical data nodes may cause to patients' personal rights, clinical diagnosis and treatment order, and medical data security in unauthorized access scenarios. Its value is determined by the strength of the data's own privacy attributes and spatial association risks. The higher the sensitivity level, the higher the risk of privacy infringement, distortion of diagnosis and treatment information, and compliance risks caused by data leakage.

[0037] The specific methods for obtaining sensitivity levels are as follows: The basic sensitivity score is calculated based on the location of the sensitive medical data node within the medical diagnostic link hierarchy. The score is positively correlated with the privacy exposure risk of each hierarchy: the patient basic information layer has a basic sensitivity score of 60; this layer contains information that directly identifies an individual, such as name, ID number, and contact information, and leakage of this information could directly pinpoint the individual patient. The examination execution information layer has a basic sensitivity score of 45; this layer contains auxiliary data that indirectly relates to identity, such as examination time, executing institution, and laboratory technician information. The imaging diagnostic information layer has a basic sensitivity score of 70; this layer contains core health privacy information such as lesion imaging characteristics and imaging diagnostic descriptions, possessing both identity-related and treatment privacy attributes. The clinical treatment information layer has a basic sensitivity score of 80; this layer contains core treatment privacy data such as treatment plans, medication records, and surgical records, and leakage of this data would seriously damage the patient's medical privacy rights. The prognostic follow-up information layer has a basic sensitivity score of 90; this layer contains highly sensitive health data such as long-term prognostic data and specialized testing information, posing the highest level of privacy risk.

[0038] Spatial intersection risk correction: Based on the intersection of the obtained bounding box and the region of concern for diagnosis and treatment, a correction coefficient is introduced to adjust the basic sensitivity score. The higher the overlap between the privacy region and the region of concern for diagnosis and treatment, the stronger the attribute of the data simultaneously carrying privacy information and core diagnosis and treatment information, and the greater the magnitude of the sensitivity correction. The correction coefficient for a completely non-intersecting state is 1.0, and the base sensitivity score remains unchanged; the correction coefficient for a marginally intersecting state is 1.1, and the base sensitivity score increases by 10%; the correction coefficient for a partially intersecting state is 1.25, and the base sensitivity score increases by 25%; the correction coefficient for a completely contained state is 1.4, and the base sensitivity score increases by 40%.

[0039] Sensitivity level mapping: Calculate the final sensitivity score as the product of the basic sensitivity score and the intersection state correction coefficient, and complete the three-level hierarchical mapping based on the final sensitivity score: Level 1 sensitive data is defined as a final sensitivity score ≤ 60, corresponding to the minimum desensitization requirement; Level 2 sensitive data is defined as 60 < final sensitivity score ≤ 80, corresponding to the medium desensitization requirement; Level 3 sensitive data is defined as a final sensitivity score > 80, corresponding to the highest desensitization requirement.

[0040] A multi-dimensional desensitization labeling system is pre-constructed, comprising three dimensions: sensitivity level identifier, desensitization type identifier, and desensitization intensity identifier. The sensitivity level identifier ranges from 1 to 3, corresponding to Level 1, Level 2, and Level 3 sensitivity, respectively. The desensitization type identifier ranges from 1 to 4, corresponding to character replacement, position offset, region blurring, and complete masking, respectively. The desensitization intensity identifier ranges from 1 to 5, corresponding to extremely low intensity, low intensity, medium intensity, high intensity, and extremely high intensity, respectively. Read the hierarchical location characteristics of sensitive medical data nodes, and determine the initial sensitivity level based on the highest-authority access role contained in the hierarchical location characteristics. The highest-authority access role is an administrative staff member, corresponding to an initial sensitivity level of 1; the highest-authority access role is a general medical staff member, corresponding to an initial sensitivity level of 1; the highest-authority access role is a laboratory technician, corresponding to an initial sensitivity level of 2; the highest-authority access role is a radiologist, corresponding to an initial sensitivity level of 2; the highest-authority access role is an attending physician, corresponding to an initial sensitivity level of 2; the highest-authority access role is an associate chief physician, corresponding to an initial sensitivity level of 3; and the highest-authority access role is a chief physician, corresponding to an initial sensitivity level of 3.

[0041] The initial sensitivity level is adjusted based on the intersection status judgment result. If the intersection status judgment result is completely non-intersecting, the initial sensitivity level remains unchanged. If the intersection status judgment result is edge intersection, the initial sensitivity level is increased by 1 level. If the intersection status judgment result is partial intersection, the initial sensitivity level is increased by 2 levels. If the intersection status judgment result is complete containment, the initial sensitivity level is increased by 3 levels. If the adjusted sensitivity level exceeds 3, it is directly set to 3. The corresponding desensitization type identifier and desensitization intensity identifier are matched according to the adjusted sensitivity level. Sensitivity level 1 corresponds to desensitization type identifier 1 and desensitization intensity identifier 2, sensitivity level 2 corresponds to desensitization type identifier 2 and desensitization intensity identifier 3, and sensitivity level 3 corresponds to desensitization type identifier 3 and desensitization intensity identifier 4. The matched sensitivity level identifier, desensitization type identifier, and desensitization intensity identifier are combined to form a multi-dimensional desensitization label for sensitive medical data nodes.

[0042] In this embodiment of the invention, the intersection state between the spatial bounding box and the area of ​​medical interest is determined by calculating the overlapping interval of the projection extrema on the plane normal vector corresponding to the area of ​​medical interest. Based on the intersection state, the data access role of the sensitive medical data node in the medical diagnosis link is determined to obtain the hierarchical position characteristics. Then, combined with the preset medical data classification and grading rules, data sensitivity grading mapping is performed to generate multi-dimensional desensitization labels. Therefore, this method overcomes the technical problem in the prior art that when formulating data desensitization strategies, it is impossible to effectively combine the three-dimensional spatial geometric intersection relationship with the medical business permission level, resulting in a single dimension of desensitization labels and the inability to dynamically and finely classify the actual sensitivity of the same data under different diagnosis and treatment scenarios and roles. Thus, it achieves a deep integration of spatial intersection state and business permission level to obtain multi-dimensional desensitization labels.

[0043] In a preferred embodiment of the present invention, step 4 above may include: Step 4.1: Based on the multi-dimensional desensitization labels of sensitive medical data nodes, extract the sensitivity level identifier and desensitization type identifier from the multi-dimensional desensitization labels to obtain the desensitization requirement features. Specifically, this includes: based on the multi-dimensional desensitization labels of sensitive medical data nodes, parsing the triplet data structure of the multi-dimensional desensitization labels to obtain the original values ​​of the sensitivity level identifier field, the desensitization type identifier field, and the desensitization intensity identifier field in the label structure.

[0044] The triplet data structure for multi-dimensional desensitization labels is defined as follows: ; The meaning of each parameter in the formula is as follows: The multi-dimensional desensitization label for sensitive medical data nodes is a three-dimensional tuple structure. This is a sensitivity level indicator, with a value range of [value range missing]. These correspond to Level 1, Level 2, and Level 3 sensitivity levels, respectively. This is a desensitization type identifier, with a value range of [value range missing]. These correspond to character replacement, position offset, region blurring, and complete masking, respectively. This is an indicator of desensitization intensity, with a value range of [value range missing]. These correspond to extremely low strength, low strength, medium strength, high strength, and extremely high strength, respectively.

[0045] Based on the original values ​​of the sensitivity level identifier field, the desensitization type identifier field, and the desensitization intensity identifier field in the label structure, target field filtering is performed to extract the original values ​​of the sensitivity level identifier field and the desensitization type identifier field, while discarding the original value of the desensitization intensity identifier field, resulting in the filtered sensitivity level identifier and the filtered desensitization type identifier.

[0046] The extraction formula for target field filtering is: ; The meaning of each parameter in the formula is as follows: The filtered two-dimensional feature tuple contains a sensitivity level identifier and a desensitization type identifier; This is the projection operator, which indicates the extraction of a subset of specified fields from a triple; This refers to the value of the sensitivity level identifier field in the multi-dimensional desensitization label; This is the value of the desensitization type identifier field in the multi-dimensional desensitization label.

[0047] Based on the filtered sensitivity level identifier and the filtered de-identification type identifier, perform a valid validation of the identifier field value range. If the validation passes, combine the two identifiers into a de-identification requirement feature vector to obtain the de-identification requirement feature.

[0048] The formula for determining the validity of the value range of the identifier field is as follows: ; The formula for constructing the feature vector for de-identification requirements is: ; The meaning of each parameter in the formula is as follows: This is a boolean function for validating the validity of a function. It returns true if the validation passes and false if the validation fails. This is the sensitivity level label value after filtering; This is the filtered desensitization type identifier value; The feature vector represents the desensitization requirement, and the feature tuple represents a two-dimensional feature set. For the sensitivity level component in the desensitization requirement characteristics, the value is... ; For the desensitization type component in the desensitization requirement characteristics, the value is... .

[0049] Step 4.2: Based on the location of the permission node of the target agent initiating the knowledge base query request, parse the role access control list corresponding to the permission node location to obtain the permission node characteristics. Specifically, this includes: based on the permission node location identifier of the target agent initiating the knowledge base query request, perform layer-by-layer node positioning in the permission tree structure of the medical business system to obtain the permission node object of the target agent.

[0050] The path parsing formula for locating permission nodes is: ; The meaning of each parameter in the formula is as follows: The permission node object of the target intelligent agent in the permission tree of the medical business system; The permission tree structure of the medical business system is a hierarchical organization with the root node representing the system administrator and the leaf nodes representing the various functional positions. A unique identifier for the target intelligent agent that initiates the knowledge base query request; The node location function starts from the root node of the permission tree, searches downwards along the tree path according to the agent's identity, and returns the matching permission node object.

[0051] Based on the permission node object of the target intelligent agent, traverse the role access control list associated with the permission node object, extract the role identifier and role permission level from the role access control list, and obtain the set of role identifiers and the set of role permission levels.

[0052] The formula for traversing and extracting the role access control list is: ; ; ; The meaning of each parameter in the formula is as follows: Permission node The associated role access control list consists of several role-permission level pairs; For the role access control list, the first The identifier for each role, with the following possible values: administrative staff, general medical staff, laboratory technicians, radiologists, attending physicians, associate chief physicians, and chief physicians. For the role access control list, the first The permission level value corresponding to each role, with a range of values ​​being: A higher value indicates a higher level of access control. The total number of characters in the role access control list; This is a set of role identifiers, containing all role identifiers associated with the permission node; This is a set of role permission levels, containing the permission level values ​​of all roles associated with the permission node.

[0053] Based on the set of role identifiers and the set of role permission levels, calculate the highest permission level value and the role coverage width value, and combine the highest permission level value and the role coverage width value into a permission node feature vector to obtain the permission node features.

[0054] The formula for calculating the highest privilege level is: ; The formula for calculating the character coverage width is: ; The formula for constructing the feature vector of the permission node is: ; The meaning of each parameter in the formula is as follows: The highest permission level value is obtained from the set of role permission levels. The maximum value in, the range of values ​​is ; This function retrieves the maximum value of a set of permission levels, returning the highest-level value in the set. The role coverage width value represents the proportion of roles associated with a permission node to the total number of roles, and its value range is [value range missing]. ; The cardinality of the role identifier set, i.e., the number of roles associated with the permission node; The total number of predefined roles in the medical business system, with a value of [value to be filled in]. ; is the feature vector of the permission node, and is a two-dimensional feature tuple.

[0055] Step 4.3: Based on the desensitization requirement characteristics and permission node characteristics, match the preset desensitization rule library to obtain a dynamic desensitization strategy for sensitive medical data nodes. Specifically, this includes: based on the desensitization requirement characteristics and permission node characteristics, traversing each desensitization rule in the preset desensitization rule library, calculating the sensitivity matching degree and type matching degree between the desensitization requirement characteristics and the conditional pattern of each desensitization rule, calculating the permission matching degree between the permission node characteristics and the conditional pattern of each desensitization rule, and performing a weighted summation of the three matching degrees to obtain the comprehensive matching degree score of each desensitization rule.

[0056] The structural definition formula for the de-identification rule base is as follows: ; ; The formula for calculating the overall matching score is: ; The formula for calculating the sensitivity matching subfunction is: ; The formula for calculating the desensitization type matching sub-function is: ; The formula for calculating the permission matching sub-function is: ; The meaning of each parameter in the formula is as follows: The pre-defined desensitization rule base contains Desensitization rules; For the first in the desensitization rule base Desensitization rules; For the first The conditional pattern of the desensitization rule is determined by the sensitivity condition. Desensitization type conditions and permission conditions composition; For the first The strategy action body of each de-identification rule includes the mask offset rule and the de-identification character set; Characteristics of desensitization needs and permission node features With the Rules The overall matching score; The sensitivity is matched with a weighting coefficient, which takes the value of ; A weighting coefficient is assigned to the desensitization type, with a value of [value to be filled in]. ; A weight coefficient is assigned to match permissions, with a value of [value to be filled in]. ; As a sensitivity matching sub-function, it calculates the degree of matching between the sensitivity level component in the desensitization requirement features and the rule sensitivity conditions; This is a sub-function for matching desensitization types, which calculates the degree of matching between the desensitization type component in the desensitization requirement characteristics and the regular desensitization type conditions; This is a sub-function for permission matching, which calculates the degree of matching between the characteristics of permission nodes and the permission conditions of rules; For the first The minimum permission level threshold defined in the permission conditions of this rule.

[0057] Based on the comprehensive matching score of each de-identification rule, de-identification rules with a comprehensive matching score greater than or equal to the preset matching threshold are selected and sorted from high to low to obtain a candidate de-identification rule sequence.

[0058] The formula for selecting candidate desensitization rules is as follows: ; The formula for ranking candidate desensitization rules is: ; The meaning of each parameter in the formula is as follows: This is a set of candidate de-identification rules, containing all rules whose overall matching score is greater than or equal to the matching threshold; The preset matching threshold has a value of [value]. ; The candidate desensitization rule sequences are sorted in descending order of comprehensive matching score; This is a descending sorting function that arranges candidate rules from highest to lowest based on their overall matching score.

[0059] Based on the candidate desensitization rule sequence, the policy action body of the desensitization rule ranked first in the sequence is extracted. The mask offset rule and desensitization character set in the policy action body are instantiated into a dynamic desensitization policy for the current sensitive medical data node, thus obtaining the dynamic desensitization policy for the sensitive medical data node.

[0060] The instantiation formula for the dynamic desensitization strategy is: ; ; The meaning of each parameter in the formula is as follows: The final desensitization rule with the highest overall matching score among the candidate desensitization rule sequences; The first element of the candidate desensitization rule sequence is selected, which is the rule with the highest matching degree; A dynamic desensitization strategy for current sensitive medical data nodes; The policy instantiation function will combine the policy action body of the final rule with the node identifier of the current sensitive medical data node. Bind and generate a dynamic desensitization strategy that can be executed directly; This is the policy action body for the final rule, containing mask offset rule parameters and de-identified character set configuration. For example, Figure 4 As shown, the horizontal axis represents the agent's permission level (levels 1-7); the vertical axis represents the data sensitivity level (levels 1-3); and the color intensity represents the matching score (0-1). High-permission agents are matched with low-intensity desensitization strategies, while low-permission agents are matched with high-intensity desensitization strategies, achieving dynamic adaptation.

[0061] In this embodiment of the invention, sensitivity level identifiers and desensitization type identifiers are extracted based on multi-dimensional desensitization tags to obtain desensitization requirement features. The role access control list is then parsed based on the location of the target agent's permission node initiating the knowledge base query request to obtain permission node features. These desensitization requirement features are then matched with the permission node features to a preset desensitization rule base to generate a dynamic desensitization strategy for sensitive medical data nodes. This overcomes the technical problem of existing large-scale model knowledge bases using static, uniform desensitization rules when processing medical data. This fails to perceive real-time permission differences and fine-grained sensitivity requirements of the caller, leading to rigid desensitization strategies, excessive desensitization that damages model reasoning capabilities, and unauthorized access. The invention achieves precise matching between fine-grained desensitization requirements on the data side and dynamic permission features on the caller side, generating dynamic, differentiated desensitization strategies for different target agents. This maximizes the retention of necessary diagnostic and treatment feature information while ensuring that sensitive medical data is not leaked unauthorizedly, thereby improving the security management capabilities and data utilization efficiency of large-scale model knowledge bases in multi-agent collaborative scenarios.

[0062] In a preferred embodiment of the present invention, step 5 above may include: Step 5.1: Based on the dynamic desensitization strategy for sensitive medical data nodes, extract the original spatial coordinates of the sensitive medical data nodes in the original document of the knowledge base to obtain the original location information. Specifically, this includes: based on the dynamic desensitization strategy for sensitive medical data nodes, extract the sensitive medical data node identifier bound in the dynamic desensitization strategy, perform node identifier matching traversal in the original document of the knowledge base, and locate the corresponding sensitive medical data node object in the original document of the knowledge base.

[0063] The retrieval formula for node identifier matching and location is: ; The meaning of each parameter in the formula is as follows: This refers to the sensitive medical data node object matched in the original document of the knowledge base, containing all the attribute fields of that node; The original document of the knowledge base consists of a collection of entity nodes encapsulated from structured nodes; The unique identifier for the sensitive medical data node bound in the dynamic desensitization strategy output in step 4; This function is a node identifier query function that iterates through the node identifier indices in the original documents of the knowledge base and returns node objects with matching identifiers.

[0064] Based on the sensitive medical data node objects located in the original document of the knowledge base, the attribute field set of the node object is parsed, and the original text space coordinate field value and the original three-dimensional physical space coordinate field value are extracted from the attribute field set to obtain the original text space coordinates and the original three-dimensional physical space coordinates.

[0065] The formula for extracting node attribute fields is: ; ; The meaning of each parameter in the formula is as follows: These are the original text space coordinates, representing the location range of the sensitive medical data node in the original document text stream of the knowledge base; For the text space coordinate attribute field in the node object's attribute field collection; This is the starting character index value of the original text of the sensitive medical data node, in character offset. This is the index value of the end character of the original text of the sensitive medical data node, in character offset. These are the original three-dimensional physical space coordinates, representing the position of the sensitive medical data node in the patient's three-dimensional physical coordinate system; The three-dimensional physical space coordinate attribute field in the node object's attribute field collection; This represents the coordinates of the sensitive medical data node along the X-axis in the patient's physical coordinate system, in mm. This represents the Y-axis coordinate of the sensitive medical data node in the patient's physical coordinate system, in mm. This represents the Z-axis coordinate of the sensitive medical data node in the patient's physical coordinate system, in mm.

[0066] Based on the original text space coordinates and the original three-dimensional physical space coordinates, the two coordinate fields are combined into an original location information structure. Non-empty checks and value range validity checks are performed on each coordinate component in the original location information structure. After the checks pass, the original location information is obtained.

[0067] The formula for constructing the original location information structure is: ; The formulas for determining non-empty checks and range validity checks are as follows: ; The meaning of each parameter in the formula is as follows: This is the result of the original location information validity check; true indicates that the check passed. To ensure that the starting index of the text is less than the ending index, thus guaranteeing the validity of the text range; To ensure that all three-dimensional physical coordinates are real numbers, null values ​​are excluded.

[0068] Step 5.2: Based on the original location information and the mask offset rules in the dynamic desensitization strategy for sensitive medical data nodes, calculate the replacement coordinates of the sensitive medical data nodes to obtain the mapped location information. Specifically, this includes: based on the original location information and the predefined desensitization intensity level, generating a mask offset rule that includes an offset direction vector, an offset distance value, and an offset mode identifier.

[0069] The formula for constructing the mask offset rule is: ; The meaning of each parameter in the formula is as follows: This is a mask offset rule structure that guides subsequent coordinate replacement calculations. The unit offset direction vector, ,and ; This is the offset distance value, in mm, and the value range meets the following conditions. ; This is the offset mode identifier, with a value of [value to be filled in]. These correspond to translation offset mode, mirror offset mode, and random disturbance offset mode, respectively.

[0070] Based on the original 3D physical space coordinates in the output original position information, combined with the offset direction vector, offset distance value and offset mode identifier in the mask offset rule, the corresponding coordinate transformation function is selected according to the offset mode identifier, and the offset calculation is performed on the original 3D physical space coordinates to obtain the replaced 3D physical space coordinates.

[0071] The piecewise formula for calculating and replacing the 3D physical space coordinates according to the offset mode is as follows: Translation offset mode (when) hour): ; Right now: ; Mirror offset mode (when) hour): ; Random perturbation offset mode (when hour): ; The noise vector is defined as: ; The meaning of each parameter in the formula is as follows: The replaced three-dimensional physical space coordinate vector. ; This represents the original three-dimensional physical space coordinate vector; This is the offset distance value; The offset direction vector; This is the dot product operation between the original coordinate vector and the offset direction vector. ; The vector is a random perturbation noise, with its three components independently sampled from samples with a mean of 0 and a variance of . The normal distribution; The standard deviation parameter of the random disturbance noise has a value of [value missing]. .

[0072] Based on the replaced three-dimensional physical space coordinates, the replaced three-dimensional physical space coordinates are mapped back from the patient's three-dimensional physical coordinate system to the text space coordinate system of the original document in the knowledge base through the inverse transformation of the established voxel-level coordinate mapping function, thus obtaining the replaced text space coordinates.

[0073] The transformation formula for inverse coordinate mapping is: ; The specific calculation steps for the inverse mapping function are as follows: Inverse mapping from physical coordinates to image voxel coordinates: ; Conversion from voxel coordinates to text character indices: ; ; The meaning of each parameter in the formula is as follows: The coordinates of the replaced text space. ; This is a coordinate inverse mapping function that maps continuous coordinates in the patient's three-dimensional physical coordinate system back to discrete character indices in the text space. This represents the voxel index value corresponding to the replaced 3D physical space coordinates in the image space coordinate system. The image orientation vector in the DICOM image report is the unit direction vector for the row direction, column direction, and slice normal, respectively. The three-dimensional spatial offset coordinates of the image origin in the patient coordinate system; This is a floor function that converts continuous voxel index values ​​into discrete integer coordinates. The number of character columns corresponding to each line in the text space is determined by the text layout format of the original document in the knowledge base; This is the index value of the starting character of the replaced text; This is the index value of the end-of-text character in the replaced text; These are the start and end character indices for the original text space coordinates.

[0074] This calculation process ensures that the character length of the replaced text fragment is exactly the same as that of the original text fragment, that is, it satisfies... .

[0075] Based on the replaced text space coordinates and the replaced three-dimensional physical space coordinates, the two coordinate fields are combined into a mapped position information structure. The replacement coordinates in the structure are checked for consistency with the original coordinates (the character span and spatial offset are both within the legal range). After the check passes, the mapped position information is obtained.

[0076] The formula for constructing the mapped location information structure is: ; The formula for determining consistency is: ; in, ; The meaning of each parameter in the formula is as follows: The consistency check result is true, indicating that it passed. This represents the change in character length and must be 0 to ensure that the text structure remains unchanged. The spatial offset distance must be less than the maximum allowable offset threshold. ; The maximum allowed spatial offset threshold is preset by the desensitization strategy.

[0077] Step 5.3: Based on the mapped location information, extract the corresponding desensitized character set from the dynamic desensitization strategy for sensitive medical data nodes, and perform a replacement operation on the original characters of the sensitive medical data nodes in the original document of the knowledge base to obtain the medical text after character replacement. Specifically, this includes: selecting a replacement character sequence from the pre-generated desensitized character library based on the spatial coordinates of the replaced text in the mapped location information, and performing a coverage replacement on the characters in the original document of the knowledge base corresponding to the original text spatial coordinate interval to obtain the medical text after character replacement. The generation rules of the desensitized character library are as follows: for sensitive information such as names, random combinations are drawn from a predefined common surname library and given name library to ensure that the replaced text still conforms to the distribution of Chinese names; for sensitive information such as ID numbers, the format characteristics are maintained but each digit is replaced with a random number; for sensitive information such as addresses, they are replaced with random addresses in the same province, preserving the consistency of the administrative division prefix; for DICOM label text, valid default values ​​in the corresponding DICOM data dictionary are used for replacement.

[0078] The formula for performing a character replacement operation is: ; The replacement character sequence satisfy: ; The meaning of each parameter in the formula is as follows: The medical text after character replacement, i.e., the document body after desensitization processing; This is a string replacement function that replaces strings within a specified range. use Overwrite the original text; The replacement character sequence is selected from the desensitized character library, and its length is strictly equal to the length of the original sensitive text; This is a function for calculating the length of a string.

[0079] Step 5.4: Based on the medical text after character replacement, integrate the mapped location information to obtain the desensitized medical knowledge fragment. Specifically, this includes: updating the text space coordinate attribute and three-dimensional physical space coordinate attribute in the sensitive medical data node object based on the medical text after character replacement and the mapped location information to obtain the node object with updated coordinates.

[0080] The formula for updating node coordinate attributes is: ; ; The meaning of each parameter in the formula is as follows: This refers to the sensitive medical data node object after coordinate updates. For the updated text space coordinate attribute field; This refers to the updated 3D physical space coordinate attribute field.

[0081] Based on the updated coordinates of the node object, calculate the minimum Euclidean distance between its replaced 3D physical space coordinates and the 3D physical space coordinates of all other nodes. If the minimum distance is greater than the preset spatial spacing threshold, the spatial consistency check is deemed to have passed.

[0082] The formula for determining spatial consistency is: ; The formula for calculating the minimum distance is: ; The meaning of each parameter in the formula is as follows: The minimum Euclidean distance from the current node's replaced 3D physical space coordinates to the 3D physical space coordinates of all other nodes, in mm; This is the set of all nodes in the medical text after character replacement; This is a unique identifier for the sensitive medical data node currently being verified; The three-dimensional physical space coordinate vector after the current node is replaced; For the first The three-dimensional physical space coordinate vectors of the other nodes; This is the Euclidean distance operator; The minimum spatial spacing threshold is set to a value of [value]. This is used to prevent the replacement coordinates from completely coinciding with the coordinates of other nodes, which could lead to spatial ambiguity. This is a space consistency check function that returns true if it passes and false if it fails.

[0083] Based on the node object whose coordinates have been updated after passing the spatial consistency check, the complete text fragment to which the node object belongs and its associated spatial coordinate attributes are extracted from the medical text after character replacement. The text fragment content, the mapped position information, the node identification information, and the desensitization strategy identifier are encapsulated into a desensitized medical knowledge fragment structure to obtain the desensitized medical knowledge fragment.

[0084] The encapsulation formula for the desensitized medical knowledge fragment structure is: ; ; The meaning of each parameter in the formula is as follows: This is the desensitized medical knowledge fragment, the final output of step 5, containing four core fields; It serves as a unique identifier for sensitive medical data nodes, used to associate node information in the knowledge base vector index; The content of the anonymized text fragment is the string form of the sequence of replaced characters extracted from the medical text after character replacement; This is a text extraction function that extracts a string within a specified character range from medical text after character replacement. The mapped location information includes the replaced text space coordinates and three-dimensional physical space coordinates; It serves as a unique identifier for dynamic desensitization strategies, used to trace the version of the strategy upon which the desensitization operation is based.

[0085] In this embodiment of the invention, the original spatial coordinates of sensitive medical data nodes are extracted to obtain the original location information. The replacement coordinates are calculated using mask offset rules to obtain the mapped location information. Then, the desensitized character set is extracted, and the original characters are replaced to obtain the medical text with character replacement. Finally, the mapped location information is integrated to obtain the desensitized medical knowledge fragment. This overcomes the technical problem of existing data desensitization methods that directly overwrite during character replacement, destroying the original spatial topology and character length correspondence of the text. This leads to positional shifts, context misalignments, and model comprehension biases when the desensitized text is input into a large model. Thus, this invention achieves the technical effect of maintaining the original spatial topology and physical location correspondence of the desensitized medical text while hiding the original sensitive information, avoiding context misalignment caused by character replacement, ensuring that the large model can accurately locate and restore multimodal context logic when processing desensitized knowledge fragments, and improving the accuracy of knowledge retrieval and the reliability of model inference.

[0086] In a preferred embodiment of the present invention, step 6 above may include: Step 6.1: Based on the anonymized medical knowledge fragments, perform text segmentation processing to obtain multiple medical knowledge text blocks. Specifically, this includes: extracting the anonymized text fragment content field and node identifier field from the anonymized medical knowledge fragment structure, parsing each anonymized medical knowledge fragment into an independent text unit to be segmented, and obtaining a set of text units to be segmented.

[0087] The formula for extracting the set of text units to be segmented is: ; The meaning of each parameter in the formula is as follows: This is the set of text units to be segmented, containing all the output from step 5. A desensitized medical knowledge fragment text unit to be segmented; For the first Each text unit to be segmented is a binary tuple structure. For the first The unique identifier for a sensitive medical data node in a de-identified medical knowledge fragment originates from... ; For the first The desensitized text fragment of the medical knowledge segment is sourced from... ; This represents the total number of medical knowledge fragments after desensitization.

[0088] Based on the set of text units to be segmented, the text length distribution of all text units to be segmented is statistically analyzed, the mean and standard deviation of the text length are calculated, and the target segment length and segment overlap length are determined according to the preset maximum number of input tokens of the large language model, thus obtaining the segmentation strategy parameters.

[0089] The formula for calculating text length statistics is: ; ; The formula for calculating the target block length is: ; The formula for calculating the overlap length of the blocks is: ; The meaning of each parameter in the formula is as follows: This represents the average length of the text units to be segmented, in characters. The standard deviation of the text length of the text unit to be segmented is expressed in characters. For the first A function to calculate the character length of a de-identified text fragment; The target block length is defined as the maximum number of characters in each medical knowledge text block. This is the preset maximum number of input tokens for a large language model, typically set to a value of [value missing]. ; This represents the character-to-token conversion ratio, which is set to a value suitable for Chinese scenarios. ; To find the minimum value function, we need to ensure that the block length does not exceed the model limit and closely matches the actual text distribution as much as possible; This is the overlap length of the text blocks, which is the number of characters that overlap between two adjacent text blocks; This is the overlap ratio coefficient, with a value of [value missing]. That is, the overlap length is 15% of the block length.

[0090] Based on the set of text units to be segmented and the target segment length and segment overlap length in the segmentation strategy parameters, the anonymized text fragments in each text unit to be segmented are traversed sequentially. Using the target segment length as the window size and the segment overlap length as the window step overlap amount, the sliding window method is used to perform window-by-window truncation on the anonymized text fragments to obtain multiple medical knowledge text blocks corresponding to each text unit to be segmented.

[0091] The formula for executing sliding window block partitioning is: ; ; The recursive formula for the starting position of the sliding window is: ; ; No. The formula for calculating the number of blocks in a text unit is: ; The meaning of each parameter in the formula is as follows: For the first One text unit to be segmented A collection of medical knowledge text blocks generated after being segmented by a sliding window; For the first The first text unit to be segmented Each medical knowledge text block is a string fragment; For the first The total number of blocks for each text unit to be segmented; For the first The starting character index position of a sliding window in the content of the desensitized text fragment; : String slicing operation, extracting substrings from index Start, length is The character substring.

[0092] Based on the multiple medical knowledge text blocks corresponding to each text unit to be segmented, the starting character index of the text block in the content of its corresponding de-identified text segment and the node identifier of the corresponding sensitive medical data node are appended to each medical knowledge text block. The medical knowledge text blocks with appended metadata are then aggregated into a global medical knowledge text block set. The character length of each medical knowledge text block is then verified to be within the specified range. Within the range, each node identifier's corresponding block sequence completely covers the original text. After verification, multiple medical knowledge text blocks are obtained.

[0093] The metadata encapsulation formula for medical knowledge text blocks is as follows: ; ; ; ; The aggregation formula for the global medical knowledge text block set is: ; The formula for determining the integrity of a block is: ; The formula for verifying the length of a single block is: ; in .

[0094] The meaning of each parameter in the formula is as follows: For the first time after attaching metadata The node Each medical knowledge text block is a quadruple structure. It is a globally unique identifier for medical knowledge text blocks, generated by a hash function from the node identifier, starting offset, and block length; The cryptographic hash function uses the SHA-256 algorithm to ensure the uniqueness and traceability of block identifiers; For string concatenation operators; The text content of the medical knowledge text block, i.e., the string fragment extracted in step 6.1.3. ; This is the starting character index of the medical knowledge text block within the content of its associated de-identified text segment; This is a global collection of medical knowledge text blocks, containing all blocks from all nodes; For the first A function for verifying the integrity of block coverage of individual text units; This is the interval coverage determination operator, indicating whether the union of the block interval sets completely covers the original text interval; This is the minimum block length threshold to avoid leaving excessively short blocks at the end that could affect the quality of subsequent vectorization.

[0095] Step 6.2: Based on multiple medical knowledge text blocks, perform vectorization transformation through a pre-trained word embedding model to obtain the initial feature vectors corresponding to the multiple medical knowledge text blocks. Specifically, this includes: based on the global medical knowledge text block set, traversing each medical knowledge text block, extracting the text content field of the medical knowledge text block, performing text preprocessing operations on the text content, and obtaining the preprocessed text content sequence.

[0096] The formula for performing text preprocessing is: ; ; The meaning of each parameter in the formula is as follows: For the first The node The preprocessed text content of a medical knowledge text block; For the first The node The original text content of each medical knowledge text block; This is a text normalization function that involves the sequential execution of three sub-operations. To encode a unified function, input text Convert to UTF-8 encoding format; This is a full-width / half-width conversion function that converts half-width letters, numbers, and punctuation marks into full-width forms, eliminating encoding differences. To control the character removal function, remove ASCII codes in and Invisible control characters within the range.

[0097] Based on the preprocessed text content sequence, the word segmenter of the pre-trained word embedding model is used to segment each preprocessed text content into a word sequence. Each word is mapped to the word embedding matrix of the pre-trained word embedding model to obtain the corresponding word embedding vector. Mean pooling is performed on all word embedding vectors in the word sequence to obtain the initial text block embedding vector for each medical knowledge text block. The pre-trained word embedding model uses an MC-BERT model fine-tuned with a Chinese medical corpus, with a word embedding dimension demb=768 and a vocabulary size |V|=21,128. This model has an F1-score ≥0.93 on the Chinese medical named entity recognition task, effectively capturing the professional semantic information in medical text. The pre-trained word embedding model uses an MC-BERT (MedicalChineseBERT) model fine-tuned with a Chinese medical corpus, with a word embedding dimension demb=768 and a vocabulary size |V|=21,128. vocabulary size The model achieves an F1-score of ≥0.93 on the Chinese medical named entity recognition task, effectively capturing professional semantic information in medical texts.

[0098] The formula for word segmentation is: ; The formula for executing word embedding mapping is: ; The formula for calculating the initial feature vector using mean pooling is: ; The meaning of each parameter in the formula is as follows: For the first The node A sequence of terms in a medical knowledge text block; This is a word segmentation function for a pre-trained word embedding model, which segments a text string into a sequence of words. The first in the lexical sequence Each lexical element is a lexical index value in the word embedding matrix; For the first The node The total number of tokens in a text block; as a word element The corresponding word embedding vector has a dimension of ; This is the word embedding matrix of the pre-trained word embedding model, with dimensions of... ,in For vocabulary size; For the first The node The initial feature vector of each medical knowledge text block has a dimension of [missing information]. , which is the arithmetic mean of all word embedding vectors.

[0099] Based on the word sequence and word embedding vector of each medical knowledge text block, the attention weight of each word in the context of the text block is calculated. The word embedding vector is then weighted and summed using the attention weight as a coefficient to obtain the attention-enhanced feature vector of each medical knowledge text block.

[0100] The formula for calculating attention weights is: ; The formula for calculating the attention-enhanced feature vector is: ; The meaning of each parameter in the formula is as follows: The th word in the lexical sequence The normalized attention weights of each word element satisfy the following conditions: ; A learnable query vector with dimension . Initialized by the self-attention query parameters provided by the pre-trained word embedding model. ; For query vector and the first The dot product of the word embedding vectors represents the relevance score of that word element to the global semantic query; This is a scaling factor used to prevent the softmax gradient from vanishing due to excessively large dot product values; It is a natural exponential function; For the first The node The attention-enhanced feature vector of each medical knowledge text block, with dimension [missing information]. .

[0101] Based on the initial feature vector and attention-enhanced feature vector of each medical knowledge text block, a feature concatenation and fusion operation is performed. The initial feature vector and the attention-enhanced feature vector are concatenated and then reduced to the target dimension through a fully connected projection layer to obtain the initial feature vector corresponding to each medical knowledge text block.

[0102] The calculation formula for feature cascade fusion is as follows: ; The formula for calculating fully connected projection dimensionality reduction is: ; The meaning of each parameter in the formula is as follows: The intermediate feature vector after cascading fusion has a dimension of ; This is a vector concatenation operator that joins two vectors end-to-end to form a longer vector. Let be the initial feature vector, with dimension . ; For attention-enhanced feature vectors, the dimension is... ; For the first The node The initial feature vector corresponding to each medical knowledge text block is the final output, with a target dimension of [missing value]. ; Here is the weight matrix of the fully connected projection layer, with dimension 1. ; Let be the bias vector of the fully connected projection layer, with dimension . ; To modify the activation function of the linear unit, ; The dimension of the projection target is set to a value of 1. The dimension is determined by the vector index requirements of the large language model.

[0103] Step 6.3: Based on the initial feature vectors corresponding to multiple medical knowledge text blocks, calculate the similarity matrix between the initial feature vectors, and perform dimensionality reduction on the initial feature vectors based on the similarity matrix to obtain the target feature vector. Specifically, this includes: calculating the cosine similarity between any two initial feature vectors in the initial feature vector set, and organizing all pairwise similarity values ​​into a symmetric similarity matrix according to the vector index to obtain the initial similarity matrix.

[0104] The formula for calculating cosine similarity is: ; in: ; ; The formula for constructing the initial similarity matrix is: ; The meaning of each parameter in the formula is as follows: For the initial feature vector With the initial feature vector The cosine similarity between them ranges from 1 to 10. ; Let each be the first in the initial feature vector set. The and the first For the initial feature vector, double subscripts will be used for simplification. Mapped to a single subscript index; The dot product of vectors represents the sum of the products of the components of two vectors in each dimension; For vectors The L2 norm; The initial similarity matrix has dimensions of . Satisfying symmetry And diagonal elements ; A collection of global medical knowledge text blocks The total number of text blocks containing knowledge about traditional Chinese medicine.

[0105] Based on the initial similarity matrix, all diagonal elements of the similarity matrix are set to zero to eliminate self-similarity interference. A symmetric normalized Laplace transform is then performed on the self-loop-free similarity matrix to enhance the numerical stability of the similarity matrix and highlight the local neighborhood structure, resulting in a normalized similarity matrix.

[0106] The formula for setting the diagonal to zero is: ; The formula for calculating the symmetric normalized Laplace transform is: ; The definition formula for the degree matrix is: ; ; The meaning of each parameter in the formula is as follows: The similarity value is calculated by setting the diagonal to zero. This is the similarity matrix with its diagonal lines set to zero, and its dimension is . ; The similarity matrix is ​​after symmetric normalization; Let be a degree matrix, and be a diagonal matrix with diagonal elements of . The sum of each row's elements plus a smoothing term; The inverse square root matrix of the degree matrix. ; For the degree matrix The diagonal element represents the th element. The weighted connectivity of each vector in the similarity graph; This is the numerical smoothing constant, with a value of [value missing]. To prevent isolated nodes ( This leads to a division by zero error.

[0107] Based on the normalized similarity matrix, perform the following on the graph defined by the normalized similarity matrix: The random walk probability diffusion method captures the global similarity structure of each vector in the multi-hop neighborhood using the random walk process. The steady-state distribution matrix after the random walk converges is used as the intermediate representation matrix for diffusion dimensionality reduction to obtain the diffusion feature matrix.

[0108] The formula for calculating the transition probability matrix of a single-step random walk is: ; in, The row normalization degree matrix: ; The formula for calculating the diffusion feature matrix of a random walk is: ; The formula for truncating the row vectors of the diffusion feature matrix is: ; The meaning of each parameter in the formula is as follows: The transition probability matrix for a single-step random walk has dimensions of . ,element Indicates from node One-step transfer to node The probability of; The adjacency matrix is ​​obtained by non-negative truncation of the normalized similarity matrix. Set the negative similarity value to zero; Let the row normalization degree matrix be such that the sum of each row of the transition probability matrix is ​​1; The number of random walk steps, with values ​​ranging from 1 to 2. This ensures that the walking range covers the global structure of the graph; for The diffusion feature matrix after one random walk has a dimension of ; For the first The diffused feature row vectors corresponding to the initial feature vectors have dimensions of . This indicates that the journey starts from this node and proceeds via... The probability distribution of reaching each node after a random walk.

[0109] Based on all row vectors of the diffusion feature matrix, concatenate the row vectors of the diffusion feature matrix column-wise to form the diffusion feature data matrix. Calculate the covariance matrix of the diffusion feature data matrix and perform eigenvalue decomposition, taking the first... The projection matrix is ​​constructed from the eigenvectors corresponding to the largest eigenvalues. The diffuse feature data matrix is ​​then mapped to a low-dimensional space through the projection matrix to obtain the target feature vector corresponding to each medical knowledge text block.

[0110] The formula for constructing the diffusion feature data matrix is: ; The formula for calculating the covariance matrix is: ; The formula for calculating the centralized diffusion characteristic matrix is: ; ; The formula for calculating the eigenvalue decomposition is: ; The formula for constructing the projection matrix is: ; The dimensionality reduction mapping formula for the target feature vector is: ; The meaning of each parameter in the formula is as follows: This is a diffusion feature data matrix, where each row corresponds to a diffusion feature row vector of a medical knowledge text block; The centered diffusion feature data matrix has the global mean vector subtracted from each row. Let be the global mean row vector of the diffusion feature data matrix, with dimension . ; It is a column vector of all 1s with dimension 1. Used for broadcast average; Let be the covariance matrix with dimension . ; The first covariance matrix is ​​the first... The feature values ​​are arranged in descending order. ; The first covariance matrix is ​​the first... There are feature vectors with dimension . ; The projection matrix is ​​formed by the previous... The eigenvectors corresponding to the largest eigenvalues ​​are concatenated column-wise, with a dimension of . ; To reduce the dimensionality of the target, the value should satisfy... The minimum number of dimensions, where Set a threshold for the variance retention ratio; For the first The node The target feature vector corresponding to each medical knowledge text block has a dimension of [missing information]. ; To use double subscripts Mapped to row index of the diffusion feature matrix The function.

[0111] Step 6.4: Based on the target feature vector and the node identifier information of the corresponding medical knowledge text block, construct a vector index for the large language model to obtain a medical large model knowledge base under access control. Specifically, this includes: based on the target feature vector set and the global medical knowledge text block set, associating each target feature vector with the block identifier and node identifier of the corresponding medical knowledge text block, constructing a four-element index entry containing vector data, block identifier, node identifier, and policy identifier, and obtaining a set of index entries.

[0112] The formula for constructing index entries is: ; The aggregation formula for the set of indexed entries is: ; The meaning of each parameter in the formula is as follows: For the first The first sensitive medical data node The index entries corresponding to each medical knowledge text block are quadruple structures. For the first The node The target feature vector obtained after dimensionality reduction of the text blocks in step 6.3 has a dimension of . ( , For step 6.2, embed the original dimension of the word. The variance retention threshold from step 6.3 Determined, typical value ); For the first The node The globally unique identifier for each text block is determined by the hash function in step 6.1. Generate, in the format of This ensures that block identifiers across nodes are globally unique. For the first The unique identifier for each sensitive medical data node comes from the node ID field encapsulated in the structured node in step 1.4; For application to the The unique identifier of the dynamic desensitization strategy for each node comes from the strategy version number bound when the strategy is instantiated in step 4.3; A collection of indexed entries, containing all Each node The complete index entries corresponding to each block, with a set cardinality of . ; The total number of nodes containing sensitive medical data; For the first The number of medical knowledge text blocks generated by each node after being segmented in step 6.1.

[0113] Based on all target feature vectors in the index entry set, a vector index for large language models is constructed. The vector index space structure is initialized by inserting each target feature vector as an index node into the vector index space. Clustering partitioning is recursively performed to construct a tree-like index structure, specifically employing a navigable small-world graph index based on approximate nearest neighbor search. The distance metric function during vector index space initialization is defined as the angular distance between two target feature vectors. ; The meaning of each parameter in the formula is as follows: The angular distance between two target feature vectors, with values ​​ranging from 1 to 2. The smaller the value, the closer the semantic directions are; the reason for using angular distance instead of Euclidean distance is that the semantic information of the feature vector after dimensionality reduction and random walk diffusion in step 6.3 is mainly encoded in the direction rather than the magnitude. For the set of index entries For any two distinct entries in the target feature vector, there exists... and Make , ,and ; The dot product of two vectors is calculated as follows: ; For vectors The L2 norm is calculated as follows: ; Let be the numerical stability constant, and take . This prevents division by zero errors when the vector magnitude approaches zero; in normal scenarios This constant is always true and is used only for security protection in floating-point operations. For the inverse cosine function, map the cosine similarity to... The geometric angular distance within the range.

[0114] Based on vector index and set of index entries traversal Each index entry in Extract the node identifier of the entry. and strategy identifiers In the vector index, write the permission tag field to the metadata storage area of ​​the corresponding index node to obtain the vector index with permission metadata.

[0115] The formula for constructing the permission label field is: ; Node permission levels The extraction formula is: ; The execution formula for writing metadata is: ; The meaning of each parameter in the formula is as follows: For index entries The bound permission tag field is a triple structure, which is stored in the metadata area of ​​the corresponding index node in the vector index; This is a unique identifier for the node, as defined in step 6.4.1, used to trace the sensitive medical data node to which the permission tag belongs; For the first The hierarchical location and permission level of each sensitive medical data node, which is an integer value and ranges from [value missing]. These correspond to the seven data access roles defined in step 3.2: 1=Administrator, 2=General medical staff, 3=Laboratory technician, 4=Radiologist, 5=Attending physician, 6=Associate chief physician, and 7=Chief physician. The higher the value, the higher the minimum permission level required to access the node. This is a function to query node permission levels, using the node identifier. As input, retrieve the highest-level access role corresponding to the node from the hierarchical location features of the output, and return the permission level value of that role. ; This is a unique identifier for the dynamic de-identification strategy, as defined in step 6.41, used to trace the de-identification strategy version when querying the knowledge base, and supports strategy auditing and backtracking; Metadata writing primitives for vector indexes, identified by blocks. Use the permission label field as the key. The associated write operation is performed in the metadata storage area of ​​the index node. The write operation is an atomic key-value pair insertion.

[0116] Based on the vector index with permission-enabled metadata, combined with the global medical knowledge text block set The text block content is used as the raw data storage layer. A vector retrieval interface and a permission filtering middleware are encapsulated. The vector index, raw data storage of text blocks, retrieval interface and permission filtering middleware are combined into a permission-controlled medical big model knowledge base service entity, resulting in a permission-controlled medical big model knowledge base.

[0117] The encapsulation formula for knowledge base service entities is: ; The filtering decision formula for the permission filtering middleware is: ; The query execution flow formula for the vector retrieval interface is as follows: ; The meaning of each parameter in the formula is as follows: It serves as a knowledge base for medical big data models under access control, and encapsulates four major components: vector indexing, data storage, retrieval, and access control filtering, while exposing a unified controlled retrieval interface to the outside world. It is a vector index structure with permissioned metadata, internally organized using a graph index. Each index node carries a target feature vector and an authorization label field. This serves as the raw data storage layer for the text blocks, specifically the global medical knowledge text block set output in step 6.1. Identified by block Use the primary key to store the de-identified text block content, supporting... Key-based search with time complexity; This is a vector retrieval interface function that accepts query vectors. and candidate pool size Two parameters; in Perform an approximate nearest neighbor search based on a distance metric. Minimum return angular distance A set of candidate index entries; This is a middleware for permission filtering, which accepts a set of candidate index entries and the target agent identifier. Two parameters; iterate through each candidate entry. , call The decision function verifies permissions one by one, retains only the entries that pass the permission verification, and returns a filtered set of candidate entries; This is a permission filtering function that returns a boolean value; when an index entry... Associated permission levels Not exceeding the target agent's permission level Time return (Send through), otherwise return (Interception); For index entries The associated permission level value is determined by the permission label field in step 6.4.3. The second component The values ​​are provided and derived from the hierarchical position features in step 3.2; The permission level value of the target agent initiating the knowledge base query request is provided by the first component of the permission node feature vector in step 4.2, and its value range is the same as... for ; The query vector has dimensions of 1. The natural language query input by the user is encoded by the large language model during the inference stage using the same Chinese medical fine-tuning MC-BERT model as in step 6.2, and then subjected to the same dimensionality reduction projection matrix as in step 6.3. The mapping ensures that the query vector and the index vector are in the same vector space. The candidate pool size is for the vector retrieval stage. The number of initial candidate entries returned by the function is usually taken as... That is, at least three times the final number of returned results should be taken to ensure that there are still enough candidates after permission filtering; The number of de-identified knowledge text blocks ultimately returned to the large language model is specified by the caller, with a typical value being [value missing]. ; The constant holds true, the difference Tolerance space reserved for permission filtering; For the top K selection function, sort the candidate items in ascending order by angular distance from the set after permission filtering, and truncate the top K. One entry; The final set of search results returned to the caller, containing at most A de-identified medical knowledge text block and its metadata that has been granted access permissions and is most relevant to the query semantics.

[0118] This is a knowledge base for a large-scale medical model that is subject to access control. This knowledge base embeds access tags at the underlying vector index. When the large language model initiates a knowledge base query through the target agent, the retrieval interface... Combining vector similarity retrieval and permission filtering middleware First, recall semantically relevant candidates by angular distance, then by permission level. Access is determined by a threshold, and only desensitized medical knowledge text blocks that are semantically relevant to the query and that the target agent has the right to access are returned, thus achieving a balance between retrieval accuracy and access security.

[0119] In this embodiment of the invention, text segmentation is performed on the desensitized medical knowledge fragments. Initial feature vectors are obtained through vectorization transformation using a pre-trained word embedding model. Then, the similarity matrix between the initial feature vectors is calculated and dimensionality reduction is performed to obtain the target feature vector. Finally, a vector index for a large language model is constructed by combining the corresponding node identification information to obtain a medical large-scale model knowledge base with access control. This overcomes the technical problems of existing technologies that directly perform high-dimensional vectorization on the desensitized long text when constructing the vector index of a large-scale model knowledge base, resulting in dimensional redundancy, high computational resource consumption, and susceptibility to semantic distribution changes caused by desensitization, leading to low retrieval efficiency and poor recall accuracy. This makes it difficult to meet the needs of large models for efficient and accurate retrieval of massive amounts of knowledge. Thus, this invention effectively removes redundant vector features, reduces computational dimensionality, and retains core medical semantics, improving vector retrieval efficiency and similarity calculation accuracy, while also enabling rapid location of knowledge nodes and fine-grained access control.

[0120] like Figure 2 As shown, embodiments of the present invention also provide a data anonymization processing system for large model knowledge bases, comprising: The acquisition module is used to acquire multimodal medical datasets. Based on the patient's structured electronic medical record text and entity location features in the DICOM image report, it obtains the original knowledge base document of sensitive medical data nodes. The calculation module is used to extract the discrete spatial coordinate point set of the preset privacy area in the DICOM image report from the original document of the knowledge base of sensitive medical data nodes, calculate the covariance matrix of the discrete spatial coordinate point set and solve the eigenvector; use the eigenvector as the principal axis direction, construct a spatial bounding box with the principal axis direction as the centroid of the discrete spatial coordinate point set, and calculate the extreme values ​​of the projection of the vertices of the spatial bounding box onto the plane normal vector corresponding to the area of ​​medical interest. The judgment module is used to determine the intersection status between the spatial bounding box and the area of ​​concern for diagnosis and treatment based on the overlapping interval of the projection extreme values, and to obtain multi-dimensional desensitization labels for sensitive medical data nodes by combining the hierarchical position of sensitive medical data nodes in the medical diagnosis link and the preset medical data classification and grading rules. The processing module is used to obtain a dynamic desensitization strategy for sensitive medical data nodes based on the multi-dimensional desensitization tags of the sensitive medical data nodes and the location of the permission nodes of the target intelligent agent that initiates the knowledge base query request. The replacement module is used to perform position mapping and character replacement on sensitive medical data nodes in the original document of the knowledge base according to the dynamic desensitization strategy for sensitive medical data nodes, so as to obtain desensitized medical knowledge fragments. The module is used to build vector indexes for large language models based on anonymized medical knowledge fragments, resulting in a medical large model knowledge base with access control.

[0121] It should be noted that this system is a system corresponding to the above method. All implementation methods in the above method embodiments are applicable to this embodiment and can achieve the same technical effect.

[0122] Embodiments of the present invention also provide a computing device, including: a processor and a memory storing a computer program, wherein the computer program, when executed by the processor, performs the method described above. All implementations in the above method embodiments are applicable to this embodiment and can achieve the same technical effects.

[0123] Embodiments of the present invention also provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method described above. All implementations in the above method embodiments are applicable to this embodiment and can achieve the same technical effects.

[0124] It should be noted that the processing of patient structured electronic medical record texts and DICOM image reports involved in this technical solution strictly complies with relevant laws and regulations. All data must be anonymized and desensitized with the explicit authorization and consent of the patient to avoid infringing on the patient's privacy rights.

[0125] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A data anonymization method for large model knowledge bases, characterized in that, The method includes: Obtain a multimodal medical dataset, and perform semantic parsing on the patient structured electronic medical record text in the multimodal medical dataset to obtain the entity location features of the patient structured electronic medical record text; Voxel analysis was performed on DICOM image reports from the multimodal medical dataset to obtain entity location features from the DICOM image reports; Based on the entity location features of the patient's structured electronic medical record text and the entity location features of the DICOM image report, multimodal spatial coordinate alignment is performed to obtain the aligned entity location features. Based on the aligned entity location features, the patient's structured electronic medical record text and DICOM image report are encapsulated into structured nodes to obtain the original knowledge base document of the sensitive medical data node; Based on the original document of the knowledge base of sensitive medical data nodes, the discrete spatial coordinate point set of the preset privacy area in the DICOM image report is extracted, the covariance matrix of the discrete spatial coordinate point set is calculated and the eigenvector is solved; the eigenvector is used as the principal axis direction, and a spatial bounding box with the principal axis direction is constructed with the centroid of the discrete spatial coordinate point set as the center, and the extreme values ​​of the projection of the vertices of the spatial bounding box onto the plane normal vector corresponding to the area of ​​medical interest are calculated. The intersection status between the spatial bounding box and the area of ​​concern for diagnosis and treatment is determined based on the overlapping interval of the projection extreme values. Combined with the hierarchical position of the sensitive medical data node in the medical diagnosis link and the preset medical data classification and grading rules, multi-dimensional desensitization labels for the sensitive medical data node are obtained. The pre-defined medical data classification and grading rules include: determining the corresponding basic sensitivity score based on the medical diagnosis link hierarchy to which the sensitive medical data node belongs; adjusting the basic sensitivity score based on the intersection state of the spatial bounding box and the area of ​​concern for diagnosis and treatment, with a higher degree of overlap between the privacy area and the area of ​​concern for diagnosis and treatment resulting in a greater degree of sensitivity correction; calculating the final sensitivity score as the product of the basic sensitivity score and the intersection state correction coefficient, and completing the three-level grading mapping based on the final sensitivity score. Based on the multi-dimensional desensitization tags of sensitive medical data nodes, and combined with the permission node location of the target intelligent agent that initiates the knowledge base query request, a dynamic desensitization strategy for sensitive medical data nodes is obtained. Based on the dynamic desensitization strategy for sensitive medical data nodes, position mapping and character replacement are performed on the sensitive medical data nodes in the original document of the knowledge base to obtain desensitized medical knowledge fragments. Based on the anonymized medical knowledge fragments, a vector index for a large language model is constructed to obtain a medical large model knowledge base with access control.

2. The data anonymization method for large model knowledge bases according to claim 1, characterized in that, Based on the original document of the knowledge base of sensitive medical data nodes, extract the discrete spatial coordinate point set of the preset privacy area in the DICOM image report, calculate the covariance matrix of the discrete spatial coordinate point set and solve the eigenvector. Using the feature vector as the principal axis direction, a spatial bounding box with the principal axis direction is constructed centered on the centroid of the discrete spatial coordinate point set. The extreme values ​​of the projections of the vertices of the spatial bounding box onto the normal vectors of the plane corresponding to the region of clinical interest are calculated, including: Based on the original document of the knowledge base of sensitive medical data nodes, the three-dimensional voxel boundary of the preset privacy region in the DICOM image report is identified, and the discrete spatial coordinate point set of the preset privacy region in the DICOM image report is extracted based on the three-dimensional voxel boundary. Based on the set of discrete spatial coordinate points, calculate the covariance matrix of the set of discrete spatial coordinate points, and perform eigenvalue decomposition on the covariance matrix to obtain the eigenvectors. Using the feature vector as the principal axis direction and the centroid of the discrete spatial coordinate point set as the center, calculate the coordinate extrema of the discrete spatial coordinate point set along the principal axis direction, and construct a spatial bounding box with the principal axis direction based on the coordinate extrema. Obtain the plane normal vector corresponding to the region of clinical interest, calculate the projection scalar of the vertices of the bounding box onto the plane normal vector corresponding to the region of clinical interest, and calculate the extreme values ​​of the projection of the vertices of the bounding box onto the plane normal vector corresponding to the region of clinical interest based on the projection scalar.

3. The data anonymization method for large model knowledge bases according to claim 2, characterized in that, Based on the overlapping intervals of the projection extrema, the intersection status between the spatial bounding box and the region of clinical interest is determined. Combined with the hierarchical position of sensitive medical data nodes in the medical diagnostic chain and pre-defined medical data classification and grading rules, multi-dimensional desensitization labels for sensitive medical data nodes are obtained, including: Based on the projection extrema, calculate the overlap interval of the projection extrema on the plane normal vector corresponding to the area of ​​concern for diagnosis and treatment. Based on the overlap interval, determine the intersection state between the spatial bounding box and the area of ​​concern for diagnosis and treatment, and obtain the intersection state judgment result. Based on the intersection state judgment results, the data access role corresponding to the hierarchical position of the sensitive medical data node in the medical diagnosis link is determined, and the hierarchical position characteristics are obtained. Based on the hierarchical location characteristics and the preset medical data classification and grading rules, sensitive medical data nodes are mapped to a data sensitivity level to obtain multi-dimensional desensitization labels for sensitive medical data nodes.

4. The data anonymization method for large model knowledge bases according to claim 3, characterized in that, Based on the multi-dimensional de-identification tags of sensitive medical data nodes, and combined with the permission node location of the target intelligent agent initiating the knowledge base query request, a dynamic de-identification strategy for sensitive medical data nodes is obtained, including: Based on the multi-dimensional desensitization labels of sensitive medical data nodes, the sensitivity level identifier and desensitization type identifier are extracted from the multi-dimensional desensitization labels to obtain the desensitization requirement characteristics. Based on the location of the permission node of the target agent that initiated the knowledge base query request, the role access control list corresponding to the permission node location is parsed to obtain the permission node features; Based on the characteristics of desensitization requirements and permission nodes, a dynamic desensitization strategy is obtained by matching a preset desensitization rule base with the data.

5. The data anonymization method for large model knowledge bases according to claim 4, characterized in that, Based on a dynamic desensitization strategy targeting sensitive medical data nodes, position mapping and character replacement are performed on the sensitive medical data nodes in the original documents of the knowledge base to obtain desensitized medical knowledge fragments, including: Based on the dynamic desensitization strategy for sensitive medical data nodes, the original spatial coordinates of sensitive medical data nodes in the original documents of the knowledge base are extracted to obtain the original location information; Based on the original location information, and combined with the mask offset rules in the dynamic desensitization strategy for sensitive medical data nodes, the replacement coordinates of the sensitive medical data nodes are calculated to obtain the mapped location information. Based on the mapped location information, the corresponding desensitized character set is extracted from the dynamic desensitization strategy for sensitive medical data nodes. The original characters of the sensitive medical data nodes in the original document of the knowledge base are replaced to obtain the medical text after character replacement. Based on the medical text after character replacement, the mapped location information is integrated to obtain the desensitized medical knowledge fragments.

6. The data anonymization method for large model knowledge bases according to claim 5, characterized in that, Based on the anonymized medical knowledge fragments, a vector index for a large language model is constructed, resulting in a permission-controlled medical large-scale model knowledge base, including: Based on the anonymized medical knowledge fragments, text segmentation is performed to obtain multiple medical knowledge text blocks; Based on multiple medical knowledge text blocks, vectorization is performed using a pre-trained word embedding model to obtain the initial feature vectors corresponding to the multiple medical knowledge text blocks; Based on the initial feature vectors corresponding to multiple medical knowledge text blocks, a similarity matrix is ​​calculated between the initial feature vectors. The initial feature vectors are then reduced in dimensionality based on the similarity matrix to obtain the target feature vector. Based on the target feature vector and combined with the node identifier information of the corresponding medical knowledge text block, a vector index for large language models is constructed to obtain a medical large model knowledge base under access control.

7. A data anonymization system for large model knowledge bases, the system implementing the method as described in any one of claims 1 to 6, characterized in that, include: The acquisition module is used to acquire multimodal medical datasets. Based on the patient's structured electronic medical record text and entity location features in the DICOM image report, it obtains the original knowledge base document of sensitive medical data nodes. The calculation module is used to extract the set of discrete spatial coordinate points of the preset privacy area in the DICOM image report based on the original document of the knowledge base of sensitive medical data nodes, calculate the covariance matrix of the discrete spatial coordinate point set and solve the eigenvectors. Using the feature vector as the principal axis direction, construct a spatial bounding box with the principal axis direction centered on the centroid of the discrete spatial coordinate point set, and calculate the extreme values ​​of the projection of the vertices of the spatial bounding box onto the normal vector of the plane corresponding to the region of clinical interest. The judgment module is used to determine the intersection status between the spatial bounding box and the area of ​​concern for diagnosis and treatment based on the overlapping interval of the projection extreme values, and to obtain multi-dimensional desensitization labels for sensitive medical data nodes by combining the hierarchical position of sensitive medical data nodes in the medical diagnosis link and the preset medical data classification and grading rules. The processing module is used to obtain a dynamic desensitization strategy for sensitive medical data nodes based on the multi-dimensional desensitization tags of the sensitive medical data nodes and the location of the permission nodes of the target intelligent agent that initiates the knowledge base query request. The replacement module is used to perform position mapping and character replacement on sensitive medical data nodes in the original document of the knowledge base according to the dynamic desensitization strategy for sensitive medical data nodes, so as to obtain desensitized medical knowledge fragments. The module is used to build vector indexes for large language models based on anonymized medical knowledge fragments, resulting in a medical large model knowledge base with access control.

8. A computing device, characterized in that, include: One or more processors; A storage device for storing one or more programs that, when executed by one or more processors, cause the one or more processors to implement the method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program that, when executed by a processor, implements the method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Hospital database management method and system based on adaptive data desensitization

    CN120030601A

  • Localized intelligent desensitization method and system for multi-modal medical data and storage medium

    CN122117205A

  • Mesh fiber dyeing pathological image intelligent segmentation method and application thereof

    CN122176704A

  • Methods and apparatus for recording anonymized volumetric data from medical image visualization software

    US20200005930A1