Sensitive data detection method and device based on hierarchical information enhancement and graph convolution network
By combining hierarchical information enhancement and graph convolutional networks with the BERT model and graph convolutional networks, an undirected graph model is constructed, which solves the problem of detection accuracy of multi-dimensional sensitive entity association risks in financial texts and achieves efficient sensitive data detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CSC FINANCIAL CO LTD
- Filing Date
- 2026-01-09
- Publication Date
- 2026-04-10
AI Technical Summary
Existing methods for detecting sensitive data are insufficient to effectively capture the associated risks of multi-dimensional sensitive entities in financial texts, resulting in inadequate detection accuracy.
We employ a method based on hierarchical information enhancement and graph convolutional networks. By extracting text sequence features through a pre-trained BERT model, and combining it with a named entity recognition model and a graph convolutional network, we construct an undirected graph model, aggregate node and neighborhood features, and generate probability values for sensitive data.
It improves the accuracy of sensitive data detection in complex and sensitive scenarios, adapts to diverse sensitive data detection needs, and can be quickly migrated to different fields.
Smart Images

Figure CN121479840B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and in particular to a sensitive data detection method and device based on hierarchical information enhancement and graph convolution network. BACKGROUND
[0002] The existing sensitive data detection methods are mostly based on rule matching or single feature extraction, which is difficult to effectively capture the associated risks of multi-dimensional sensitive entities in financial texts, such as the co-occurrence of “name + address + phone number”. For example, the annual report of xxx listed company in 2024 shows that “the company's products have been successfully applied in multiple key industries such as the Internet, carriers, and finance. The company's products have passed the verification of customer's harsh environment in terms of software platform usability, large-scale commercial scenario deployment stability, and artificial intelligence application scenario universality, and have gained widespread recognition from industry customers, which reflects the company's technological leadership. On xx, xx, 20xx, Zhang San was appointed as a director of the company, responsible for data security, and his personal contact information is mobile phone number xxxxxxxxxx. He was previously vice president of xxx company, responsible for data security projects, and his office address is Beijing xx district xxx street xx number”. If the existing single feature extraction is used, only 1) Zhang San is a director of the company; 2) his mobile phone number xxxxxxxxxx will be detected as general sensitive data or non-sensitive data. However, in fact, the text also shows that “Zhang San's office address is Beijing xx district xxx street xx number”, and the co-occurrence of these entity information will pose a risk of sensitive data; therefore, there is an urgent need to solve the technical problem of insufficient recognition of multi-entity co-occurrence risks, and to improve the detection accuracy of sensitive data in complex sensitive scenarios. SUMMARY
[0003] In view of the above problems, the present application is proposed to provide a sensitive data detection method and device based on hierarchical information enhancement and graph convolution network, which overcomes the above problems or at least partially solves the above problems. The technical solution is as follows:
[0004] In a first aspect, a sensitive data detection method based on hierarchical information enhancement and graph convolution network is provided, the method comprising:
[0005] converting the text to be detected into a Token sequence to obtain a sequence of the text to be detected;
[0006] inputting the sequence of the text to be detected into a pre-trained BERT model to obtain word or word embedding vectors containing context semantics and capture the dependency relationship of the sequence, and outputting sequence features ;
[0007] extracting each type of suspected sensitive entity value from the text to be detected according to a pre-defined set of suspected sensitive entity types using a pre-trained named entity recognition model;
[0008] According to the risk level of the suspected sensitive entity type, a tree-like hierarchical structure is constructed, for each type of suspected sensitive entity value, a hierarchical index of the type of suspected sensitive entity value in the tree is generated through a preset hierarchical traversal algorithm, and a hierarchical vector of the type of suspected sensitive entity value is generated through an embedding layer; after the hierarchical vectors of all types of suspected sensitive entity values in the text to be detected are removed according to the suspected sensitive entity types, a text-level hierarchical embedding feature vector L agg is generated through an average pooling operation;
[0009] Each type of suspected sensitive entity value and non-sensitive text unit in the text to be detected is taken as a node, and the association relationship between the nodes is taken as an edge, and an undirected graph containing the nodes and edges is constructed;
[0010] Based on the constructed undirected graph, sequence features are extracted, and character embeddings of each node are extracted as initial features of the nodes of the graph convolution network through an average pooling operation; the node and neighborhood features are aggregated through a multi-layer graph convolution network, and a sentence-level graph feature vector E sent is generated through an average pooling operation;
[0011] The sequence features , the text-level hierarchical embedding feature vector L agg and the sentence-level graph feature vector E sent are spliced into fusion features; the fusion features are output through a full connection layer and an activation function to output a probability value of the text to be detected containing sensitive data.
[0012] In a possible implementation, the pre-trained named entity recognition model is based on a recurrent neural network RNN, and the model is divided into an input layer, an RNN layer and an output layer, wherein the input layer performs word embedding on the text to be detected through Word2Vec and converts it into a fixed-dimensional vector; the RNN layer processes the input word embedding vector one by one, and at each time step, the current input and the hidden state of the previous time step are considered to update the current hidden state, denotes the hidden state of the time step t , denotes the input word embedding vector of the time step t , and the update formula is:
[0013]
[0014] wherein, , are weight matrices; denotes a time step t a hidden state of -1; b is a bias term; f is an activation function;
[0015] The output of the output layer is used to predict the label corresponding to each time step through a fully connected layer. The output of the fully connected layer is converted into a probability distribution through a softmax function, so as to obtain the probability of each label.
[0016] In a possible implementation, the suspected sensitive entity types in the predefined set of suspected sensitive entity types include multiple types of names, ID numbers, addresses, and contact information.
[0017] In a possible implementation, the association relationship between nodes includes co-occurrence in the same sentence and / or type association. The adjacency matrix of the constructed undirected graph is , which represents the connection strength of nodes in the undirected graph.
[0018] In a possible implementation, the node and neighborhood features are aggregated through a multi-layer graph convolution network, and the specific formula is as follows:
[0019]
[0020] wherein, is the node feature matrix of the i-th layer, and each row of the node feature matrix corresponds to a feature vector of a node; is a degree matrix; D is a normalized adjacency matrix, which is used to ensure the stability of the feature updating process; is the node feature matrix of the i-th layer; is a learnable weight; is an activation function. In a possible implementation, the fusion feature is output through a fully connected layer and an activation function to obtain a probability value of the to-be-detected text containing sensitive data, and the specific formula is as follows:
[0021]
[0022]
[0023] wherein, is the probability value of the to-be-detected text containing sensitive data; is an activation function; is a fusion feature, . , are classifier parameters.
[0024] In a second aspect, a sensitive data detection device based on hierarchical information enhancement and graph convolution network is provided, and the device comprises:
[0025] a sequence feature extraction unit configured to convert the text to be detected into a Token sequence to obtain a sequence of the text to be detected, input the sequence of the text to be detected into a pre-trained BERT model to obtain word or word embedding vectors containing context semantics and capture the dependency of the sequence, and output sequence features .
[0026] each type of suspected sensitive entity value extraction unit configured to use a pre-trained named entity recognition model to extract each type of suspected sensitive entity value from the text to be detected according to a pre-defined set of suspected sensitive entity types;
[0027] a generation unit configured to construct a tree structure according to the risk level of the suspected sensitive entity type, generate a hierarchical index of each type of suspected sensitive entity value in the tree through a pre-set hierarchical traversal algorithm, and generate a hierarchical vector of each type of suspected sensitive entity value through an embedding layer; and generate a text-level hierarchical embedding feature vector L agg after the hierarchical vectors of all types of suspected sensitive entity values in the text to be detected are de-duplicated according to the suspected sensitive entity type, through an average pooling operation
[0028] a construction unit configured to take each type of suspected sensitive entity value and non-sensitive text unit in the text to be detected as a node, and take the association relationship between the nodes as an edge, to construct an undirected graph containing the nodes and the edges;
[0029] a graph convolution calculation unit configured to, based on the constructed undirected graph, extract character embedding of each node as the initial feature of the node of the graph convolution network through an average pooling operation ; aggregate the node and neighborhood features of the node through a multi-layer graph convolution network, and generate a sentence-level graph feature vector E sent .
[0030] a feature fusion and sensitive risk classification unit configured to concatenate the sequence features , the text-level hierarchical embedding feature vector L agg , and the sentence-level graph feature vector E sent to obtain a fusion feature; and output a probability value of the text to be detected containing sensitive data through a fully connected layer and an activation function.
[0031] In a third aspect, an electronic device is provided, comprising a processor and a memory, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the sensitive data detection method based on hierarchical information enhanced graph convolution network according to any one of the preceding aspects.
[0032] In a fourth aspect, a storage medium is provided, which stores a computer program, wherein the computer program is configured to perform the sensitive data detection method based on hierarchical information enhanced graph convolution network according to any one of the preceding aspects when running.
[0033] In a fifth aspect, a computer program product is provided, comprising a computer program configured to perform the sensitive data detection method based on hierarchical information enhanced graph convolution network according to any one of the preceding aspects when running.
[0034] By means of the technical solutions described above, the sensitive data detection method, device and related product based on hierarchical information enhanced graph convolution network provided by the embodiments of the present application combine the text sequence semantics (BERT), entity hierarchy (hierarchical embedding) and entity association relationship (graph convolution), improve the modeling capability for complex sensitive scenarios (such as multi-entity co-occurrence), and further improve the detection accuracy of sensitive data in complex sensitive scenarios. In addition, by constructing a tree-like hierarchical structure according to the risk levels of suspected sensitive entity types, the risk weights of different dimensional entity associations can be flexibly adjusted to adapt to diversified sensitive data detection requirements. Furthermore, based on the pre-trained BERT model and the graph structure containing nodes and edges, the sensitive data detection task can be quickly migrated to different fields (such as medical care, finance, etc.). BRIEF DESCRIPTION OF DRAWINGS
[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the description of the embodiments of the present application will be briefly introduced.
[0036] Figure 1 A flowchart of the sensitive data detection method based on hierarchical information enhanced graph convolution network provided by the embodiments of the present application is shown;
[0037] Figure 2 A structural diagram of the sensitive data detection device based on hierarchical information enhanced graph convolution network provided by the embodiments of the present application is shown;
[0038] Figure 3 A structural diagram of an electronic device provided by the embodiments of the present application is shown. DETAILED DESCRIPTION
[0039] Exemplary embodiments of the present application will be described herein below with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it is understood that the present application can be embodied in many forms and should not be limited by 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 present application to those skilled in the art.
[0040] It should be noted that the terms "first", "second", and the like in the description and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that such use can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the term "comprising" and its variants are to be interpreted as meaning "including but not limited to" an open term.
[0041] To solve the above technical problems, the embodiments of the present application provide a sensitive data detection method based on hierarchical information enhancement and graph convolution network, as shown in Figure 1 The sensitive data detection method based on hierarchical information enhancement and graph convolution network can include the following steps S101-S107:
[0042] Step S101, converting the text to be detected into a Token sequence to obtain a sequence of the text to be detected.
[0043] Token here translates to word element, which is the smallest unit of text processing. Converting the text to be detected into a Token facilitates subsequent pre-training of the BERT model.
[0044] Step S102, inputting the sequence of the text to be detected into the pre-trained BERT model to obtain word or word embedding vectors containing context semantics and capture the dependency relationship of the sequence, and outputting sequence features .
[0045] BERT, Bidirectional Encoder Representations from Transformer, is a bidirectional Transformer encoder that captures contextual information, is based on the Transformer encoder part, and discards the decoder. It realizes deep bidirectional language representation by stacking multiple layers of self-attention mechanisms and feedforward neural networks. Here, Transformer is a deep learning model architecture based on self-attention mechanisms. It discards traditional recurrent neural networks and convolutional neural networks, and parallel processes the entire sequence data through self-attention mechanisms to effectively capture long-distance dependencies in the sequence.
[0046] In step S103, a pre-trained named entity recognition model is used to extract suspected sensitive entity values of each type from the text to be detected according to a pre-defined suspected sensitive entity type set.
[0047] In this step, the suspected sensitive entity types in the pre-defined suspected sensitive entity type set can include multiple types of names, ID numbers, addresses, and contact information, for example. In this step, E is a pre-defined suspected sensitive entity type set, and each element in the set is a suspected sensitive entity type, n is a positive integer.
[0048] The extracted suspected sensitive entity values of each type from the text to be detected generate an entity list as Here, , is the suspected sensitive entity value of each type, i takes the value of 1, 2, … m .
[0049] In step S104, a tree-like hierarchical structure is constructed according to the risk level of the suspected sensitive entity type. For each suspected sensitive entity value of each type, a pre-set hierarchical traversal algorithm is used to generate the hierarchical index of the suspected sensitive entity value in the tree, and an embedding layer is used to generate the hierarchical vector of the suspected sensitive entity value. After removing the hierarchical vectors of all suspected sensitive entity values of each type in the text to be detected according to the suspected sensitive entity type, a text-level hierarchical embedding feature vector L agg is generated through average pooling operation.
[0050] In step S105, each type of suspected sensitive entity value and non-sensitive text unit in the text to be detected is taken as a node, and the association relationship between the nodes is taken as an edge, to construct an undirected graph containing nodes and edges.
[0051] Step S106, based on the constructed undirected graph, the sequence features After the average pooling operation, the character embedding of each node is extracted as the initial feature of the node of the graph convolution network; the node and the neighborhood feature of the node are aggregated through the multi-layer graph convolution network, and the sentence-level graph feature vector E sent is generated through the average pooling operation.
[0052] Step S107, the sequence feature , the text-level hierarchical embedding feature vector L agg and the sentence-level graph feature vector E sent are spliced into the fusion feature; the fusion feature is output through the full connection layer and the activation function, and the probability value of the text to be detected containing sensitive data is output.
[0053] The embodiment combines the text sequence semantics (BERT), the entity hierarchy (hierarchical embedding) and the entity association relationship (graph convolution), improves the modeling ability of the complex sensitive scene (such as multi-entity co-occurrence), and further improves the detection accuracy of sensitive data in the complex sensitive scene; and by constructing the tree-like hierarchical structure of the risk level of the suspected sensitive entity type, the risk weight of the association of different dimensions of entities can be flexibly adjusted, and the diversified sensitive data detection requirements can be adapted; in addition, based on the pre-trained BERT model and the graph structure containing nodes and edges, the sensitive data detection task in different fields (such as medical treatment, finance, etc.) can be quickly migrated.
[0054] In the embodiment of the application, a possible implementation manner is provided, and in the above step S103, the pre-trained named entity recognition model is realized based on RNN (Recurrent Neural Network, recurrent neural network). The model is divided into an input layer, an RNN layer and an output layer. The input layer converts the text to be detected into a fixed-dimensional vector through word embedding by Word2Vec; the RNN layer processes the input word embedding vector one by one, and updates the current hidden state at each time step by considering the current input and the hidden state of the previous time step, represents the hidden state of the time step t , represents the input word embedding vector of the time step t , and the update formula is:
[0055]
[0056] wherein, , is a weight matrix; represents the hidden state of the time step t -1; b is a bias term; f is an activation function.
[0057] The output of the output layer is passed through a fully connected layer to predict the label at each time step. The output of the fully connected layer is then passed through a softmax function to convert the output into a probability distribution, thereby obtaining the probability of each label.
[0058] Word2Vec is a natural language processing technique whose core goal is to transform words into dense, low-dimensional vectors, often called word embeddings, using shallow neural network models. This allows words with similar semantics or grammar to be positioned close together in the vector space. Based on the "distribution hypothesis" (that the meaning of a word is determined by its context), it captures the complex relationships between words by learning word vectors from large-scale unlabeled text.
[0059] The softmax function is a mathematical function widely used in machine learning and deep learning. Its main function is to transform a vector containing arbitrary real numbers into a probability distribution such that each element has a value between 0 and 1, and the sum of all elements is 1. It is typically applied to the output layer of neural networks for multi-class classification tasks, converting the model's raw scores into interpretable class probabilities.
[0060] This application provides a possible implementation method. In step S105 above, the association between nodes may include co-occurrence in the same sentence and / or type association; the adjacency matrix of the constructed undirected graph is... , which represents the connection strength between nodes in an undirected graph.
[0061] In this embodiment, co-occurrence relationships (such as words appearing in the same sentence) directly reflect local contextual associations, while type associations can be extended to implicit logical connections across sentences (such as the consistency of verb-object structures). Adjacency matrix A By quantifying the strength of these associations with weight values, the graph structure can simultaneously accommodate direct co-occurrence and indirect semantic similarity, reducing information loss in sparse graphs.
[0062] This application embodiment provides a possible implementation method. In step S106 above, nodes and their neighborhood features are aggregated through a multi-layer graph convolutional network. The specific formula is as follows:
[0063]
[0064] in, It is the first The node feature matrix of the layer, where each row of the node feature matrix corresponds to the feature vector of a node; D It is a degree matrix; It is the normalized adjacency matrix, used to ensure the stability of the feature update process; It is the first The node feature matrix of the layer; is a learnable weight; is an activation function.
[0065] In the formula of the embodiment, the normalized adjacency matrix is multiplied by the node feature matrix, and the new feature of each node is no longer isolated, but a weighted combination of its own feature and the features of all its directly adjacent nodes, which enables the representation of the node to reflect its local network environment. Moreover, by stacking multiple layers of graph convolution networks, at each layer, the node aggregates the information of its first-order neighbors; at the second layer, the node feature already contains the information of the first-order and second-order neighbors; the deeper the number of layers, the wider the range of the graph structure that each node can "perceive", so as to learn the node representation containing high-order correlation information. In addition, combined with the learnable weight matrix and the nonlinear activation function, the model not only simply averages the neighbor features, but also learns how to selectively and nonlinearly transform and combine these information; the finally generated node feature vector has stronger expression ability and discrimination, which is very beneficial to the downstream task.
[0066] In the embodiment of the application, in step S107 above, the fusion feature is outputted through a fully connected layer and an activation function, and a probability value of the to-be-detected text containing sensitive data is outputted, and the specific formula is as follows:
[0067]
[0068] wherein, is the probability value of the to-be-detected text containing sensitive data; is an activation function; is a fusion feature, ; , are classifier parameters.
[0069] In the embodiment, the fused feature is inputted into a fully connected layer, and is processed through an activation function, and finally a probability value between 0 and 1 is outputted, which is used to quantify the possibility of "the to-be-detected text containing sensitive data".
[0070] Next, the design of the loss function is introduced, including the following design goals:
[0071] 1) Fit the distribution difference between the probability output and the true label: the output is a continuous probability value , and a loss function suitable for the regression task needs to be designed.
[0072] 2) Strengthen the risk signal of multiple suspected sensitive entities: explicitly model the risk difference between "single suspected sensitive entity" and "multiple suspected sensitive entity combination", and avoid the misjudgment of the model to the combined risk.
[0073] 3) Compatible with positive and negative sample imbalance scenarios: In sensitive data detection, the number of negative samples (no sensitive) is usually much larger than that of positive samples (with sensitive), and a weight mechanism needs to be introduced to balance the training.
[0074] The loss function architecture adopts a composite loss function of weighted mean square error (Weighted MSE) and suspected sensitive entity combination regular term, and the formula is as follows:
[0075]
[0076] wherein, is the balance coefficient, adjusting the weight of the main loss and the regular term;
[0077] is the weighted mean square error, processing the probability regression task;
[0078] is the suspected sensitive entity combination regular term, strengthening the risk signal of multiple suspected sensitive entity association.
[0079] 3.1) Weighted mean square error
[0080] 3.1.1) Basic mean square error
[0081]
[0082] wherein, is the total number of samples; is the true label (1 for sensitive and 0 for non-sensitive); is the model prediction probability value.
[0083] 3.1.2) Positive and negative sample weighting
[0084] Introducing the weight coefficient to balance the sample imbalance problem:
[0085]
[0086] wherein, is the positive sample weight factor;
[0087] Then the weighted mean square error .
[0088] 3.2) Suspected sensitive entity combination regular term
[0089] 3.2.1) Suspected sensitive entity combination feature extraction
[0090] For each sample, the set of suspected sensitive entity types contained therein is counted to generate a combined feature vector, and a combined risk assessment standard is formulated, for example, a single suspected sensitive entity has a risk score of 0.2; a double suspected sensitive entity has a risk score of 0.7; and a multiple suspected sensitive entity (three or more) has a risk score of 1.0. It should be noted that the above examples are illustrative only and do not limit the embodiments.
[0091] 3.2.2) Regular term calculation
[0092] The model prediction probability The difference between the combined risk score is included in the loss, forcing the model to learn the risk level associated with multiple suspected sensitive entities:
[0093]
[0094] wherein, is the number of samples containing suspected sensitive entities, excluding negative samples without suspected sensitive entities;
[0095] is the preset risk score of the sample j , and a single suspected sensitive entity takes the corresponding score, and a multiple suspected sensitive entity takes the combined score.
[0096] It should be noted that the sequence numbers of the steps in the above embodiments do not mean the order of execution, and the execution order of the processes should be determined according to their functions and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. In actual application, all possible implementation manners described above can be combined in any combination to form possible embodiments of the present application, which will not be repeated here.
[0097] Based on the sensitive data detection method based on hierarchical information enhancement and graph convolution network provided in the above embodiments, based on the same inventive concept, the present embodiment further provides a sensitive data detection device based on hierarchical information enhancement and graph convolution network.
[0098] Figure 2 is the structure diagram of the sensitive data detection device based on hierarchical information enhancement and graph convolution network provided by the present embodiment. As Figure 2 shown, the sensitive data detection device based on hierarchical information enhancement and graph convolution network can specifically include a sequence feature extraction unit 210, a suspected sensitive entity value extraction unit 220 of each type, a generation unit 230, a construction unit 240, a graph convolution calculation unit 250, and a feature fusion and sensitive risk classification unit 260.
[0099] The sequence feature extraction unit 210 is configured to convert the text to be detected into a Token sequence to obtain a sequence of the text to be detected; input the sequence of the text to be detected into a pre-trained BERT model to obtain word or word embedding vectors containing context semantics and capture the dependency relationship of the sequence, and output sequence features. ;
[0100] The suspected sensitive entity value extraction unit 220 is configured to use a pre-trained named entity recognition model to extract suspected sensitive entity values of each type from the text to be detected according to a pre-defined suspected sensitive entity type set.
[0101] The generation unit 230 is configured to construct a tree-like hierarchical structure according to the risk level of the suspected sensitive entity type, generate a hierarchical index of the suspected sensitive entity value of each type in the tree through a pre-set hierarchical traversal algorithm, and generate a hierarchical vector of the suspected sensitive entity value of each type through an embedding layer; after removing the hierarchical vectors of suspected sensitive entity values of all types in the text to be detected according to the suspected sensitive entity type, a text-level hierarchical embedding feature vector L is generated through an average pooling operation. agg ;
[0102] The construction unit 240 is configured to take the suspected sensitive entity values of each type in the text to be detected and the non-sensitive text units as nodes, and take the association relationship between the nodes as edges, to construct an undirected graph containing the nodes and the edges.
[0103] The graph convolution calculation unit 250 is configured to, based on the constructed undirected graph, extract the sequence features through an average pooling operation, and extract the character embedding of each node as the initial feature of the node of the graph convolution network; aggregate the node and neighborhood features through a multi-layer graph convolution network, and generate a sentence-level graph feature vector E sent ;
[0104] The feature fusion and sensitive risk classification unit 260 is configured to concatenate the sequence features , the text-level hierarchical embedding feature vector L agg , and the sentence-level graph feature vector E sent to obtain fusion features; and output a probability value of the text to be detected containing sensitive data through a full connection layer and an activation function.
[0105] This application provides a possible implementation method where a pre-trained named entity recognition model is implemented based on a recurrent neural network (RNN). This model consists of an input layer, an RNN layer, and an output layer. The input layer uses Word2Vec to embed words into the text to be detected, converting it into a fixed-dimensional vector. The RNN layer processes the input word embedding vectors one by one, updating the current hidden state at each time step by considering the current input and the hidden state of the previous time step. Indicates time step t The hidden state, Indicates time step t The input word embedding vector is updated using the following formula:
[0106]
[0107] in, , It is a weight matrix; Indicates time step t -1 is a hidden state; b It is a bias term; f It is an activation function;
[0108] The output of the output layer is passed through a fully connected layer to predict the label at each time step. The output of the fully connected layer is then passed through a softmax function to convert the output into a probability distribution, thereby obtaining the probability of each label.
[0109] This application provides a possible implementation method in which the predefined set of suspected sensitive entity types includes multiple types such as name, ID number, address, and contact information.
[0110] This application provides a possible implementation method in its embodiments, where the association relationships between nodes include co-occurrence in the same sentence and / or type association; the adjacency matrix of the constructed undirected graph is... , which represents the connection strength between nodes in an undirected graph.
[0111] This application embodiment provides a possible implementation method in which the graph convolution calculation unit 250 aggregates nodes and their neighborhood features through a multi-layer graph convolutional network, as shown in the following formula:
[0112]
[0113] in, It is the first The node feature matrix of the layer, where each row of the node feature matrix corresponds to the feature vector of a node; D It is a degree matrix; It is the normalized adjacency matrix, used to ensure the stability of the feature update process; is the node feature matrix of the layer is the node feature matrix of the layer is the learnable weight is the activation function.
[0114] In an embodiment of the present application, a possible implementation is provided. The feature fusion and sensitive risk classification unit 260 outputs a probability value of the to-be-detected text containing sensitive data by passing the fusion feature through a full connection layer and an activation function, and the specific formula is as follows:
[0115]
[0116] wherein, is the probability value of the to-be-detected text containing sensitive data; is the activation function; is the fusion feature, . , are classifier parameters.
[0117] Based on the same inventive concept, an electronic device is also provided in an embodiment of the present application, which includes a processor and a memory. The memory stores a computer program, and the processor is configured to execute the computer program to perform the sensitive data detection method based on the hierarchical information enhancement and graph convolution network according to any one of the above embodiments.
[0118] In an exemplary embodiment, an electronic device is provided, as shown in Figure 3 , the electronic device 300 shown in Figure 3 includes a processor 301 and a memory 303. The processor 301 and the memory 303 are connected, such as through a bus 302. Optionally, the electronic device 300 can also include a transceiver 304. It should be noted that in actual applications, the transceiver 304 is not limited to one, and the structure of the electronic device 300 does not constitute a limitation on the embodiments of the present application.
[0119] The processor 301 can be a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It can implement or execute various exemplary logical blocks, modules and circuits described in connection with the disclosure. The processor 301 can also be a combination of computing functions, such as one or more microprocessor combinations, combinations of DSP and microprocessor, etc.
[0120] The bus 302 can include a path for transmitting information between the above-mentioned components. The bus 302 can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 302 can be divided into an address bus, a data bus, a control bus, etc. For convenience of representation, Figure 3 In the figure, only one thick line is used, but it does not mean that there is only one bus or one type of bus.
[0121] The memory 303 can be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, an optical disk storage (including a compact disk, a laser disk, an optical disk, a digital versatile disk, a Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
[0122] The memory 303 is configured to store computer program codes for implementing the scheme of the present application, and the processor 301 is configured to execute the computer program codes stored in the memory 303. The processor 301 is configured to execute the computer program codes stored in the memory 303 to implement the content shown in the foregoing method embodiments.
[0123] The electronic device includes, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (Personal Digital Assistant), a PAD (Tablet Personal Computer), a PMP (Portable Multimedia Player), a car terminal (for example, a car navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like. Figure 3 The electronic device shown is merely an example, and should not impose any limitation on the functions and use range of the embodiments of the present application.
[0124] Based on the same inventive concept, the embodiments of the present application further provide a storage medium, which stores a computer program, wherein the computer program is configured to execute the sensitive data detection method based on the hierarchical information enhanced graph convolution network of any one of the foregoing embodiments when running.
[0125] Based on the same inventive concept, the embodiments of the present application further provide a computer program product, which includes a computer program configured to execute the sensitive data detection method based on the hierarchical information enhanced graph convolution network of any one of the foregoing embodiments when running.
[0126] Those skilled in the art can clearly understand the specific working process of the system, device, and module described above, which can refer to the corresponding process in the foregoing method embodiments, and for the sake of brevity, no further description is given here.
[0127] Those skilled in the art can understand that the technical scheme of the present application can be embodied in the form of a software product in essence or in whole or part of the technical scheme, the computer software product is stored in a storage medium, and includes a plurality of program instructions for causing an electronic device (such as a personal computer, a server, or a network device) to execute all or part of the steps of the method described in the embodiments of the present application when running the program instructions. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0128] Alternatively, all or part of the steps of the foregoing method embodiments can be completed by program instruction related hardware (such as an electronic device of a personal computer, a server, or a network device), and the program instructions can be stored in a computer readable storage medium, and when the program instructions are executed by the processor of the electronic device, the electronic device executes all or part of the steps of the method described in the embodiments of the present application.
[0129] The above embodiments are only used to illustrate the technical solutions of the present application, but not limit the present application; even though the present application has been described in detail with reference to the foregoing embodiments, those ordinarily skilled in the art should understand: within the spirit and principle of the present application, the technical solutions recorded in the foregoing embodiments can still be modified, or some or all of the technical features can be replaced by equivalents; and these modifications or replacements do not cause the corresponding technical solutions to depart from the scope of the present application.
Claims
1. A sensitive data detection method based on hierarchical information enhancement and graph convolutional networks, characterized in that, The method includes: The text to be detected is converted into a token sequence, thus obtaining the sequence of the text to be detected; The sequence of text to be detected is input into a pre-trained BERT model to obtain word or character embedding vectors containing contextual semantics, capture the dependencies in the sequence, and output sequence features. ; Using a pre-trained named entity recognition model, the values of each type of suspected sensitive entity are extracted from the text to be detected based on a predefined set of suspected sensitive entity types. A tree-like hierarchical structure is constructed based on the risk level of suspected sensitive entity types. For each type of suspected sensitive entity value, a pre-defined hierarchical traversal algorithm is used to generate the level index of that type of suspected sensitive entity value in the tree, and an embedding layer is used to generate a hierarchical vector of that type of suspected sensitive entity value. After deduplicating the hierarchical vectors of all types of suspected sensitive entity values in the text to be detected according to the suspected sensitive entity type, average pooling is used to generate a text-level hierarchical embedding feature vector L. agg ; By treating the suspected sensitive entity values and non-sensitive text units in the text to be detected as nodes and the relationships between nodes as edges, an undirected graph containing nodes and edges is constructed. Based on the constructed undirected graph, sequence features are... After average pooling, the character embeddings of each node are extracted. The initial features of the nodes are used as the initial features of the graph convolutional network; the features of the nodes and their neighborhoods are aggregated through a multi-layer graph convolutional network, and the sentence-level graph feature vector E is generated through average pooling. sent ; sequence features Text-level hierarchical embedding feature vectors L agg and sentence-level graph feature vector E sent The features are concatenated to form a fusion feature; the fusion feature is then passed through a fully connected layer and an activation function to output the probability value that the text to be detected contains sensitive data.
2. The method according to claim 1, characterized in that, The pre-trained named entity recognition model is implemented based on a recurrent neural network (RNN). This model consists of an input layer, an RNN layer, and an output layer. The input layer uses Word2Vec to embed words into the text to be detected, converting it into a fixed-dimensional vector. The RNN layer processes the input word embedding vectors one by one, updating the current hidden state at each time step by considering the current input and the hidden state from the previous time step. Indicates time step t The hidden state, Indicates time step t The input word embedding vector is updated using the following formula: in, , It is a weight matrix; Indicates time step t -1 is a hidden state; b It is a bias term; f It is an activation function; The output of the output layer is passed through a fully connected layer to predict the label at each time step. The output of the fully connected layer is then passed through a softmax function to convert the output into a probability distribution, thereby obtaining the probability of each label.
3. The method according to claim 1, characterized in that, The predefined set of suspected sensitive entity types includes various types such as name, ID number, address, and contact information.
4. The method according to claim 1, characterized in that, The relationships between nodes include co-occurrence in the same sentence and / or type associations; the adjacency matrix of the constructed undirected graph is... , which represents the connection strength between nodes in an undirected graph.
5. The method according to claim 4, characterized in that, The nodes and their neighborhood features are aggregated using a multi-layer graph convolutional network, as shown in the following formula: in, It is the first The node feature matrix of the layer, where each row of the node feature matrix corresponds to the feature vector of a node; D It is a degree matrix; It is the normalized adjacency matrix, used to ensure the stability of the feature update process; It is the first The node feature matrix of the layer; These are learnable weights; It is an activation function.
6. The method according to claim 1, characterized in that, The fused features are passed through a fully connected layer and an activation function to output the probability value that the text to be detected contains sensitive data. The specific formula is as follows: in, It is the probability value that the text to be detected contains sensitive data; It is an activation function; It is a feature of fusion. ; , These are all classifier parameters.
7. A sensitive data detection device based on hierarchical information enhancement and graph convolutional networks, characterized in that, The device includes: The sequence feature extraction unit converts the text to be detected into a token sequence, thus obtaining the sequence of the text to be detected. This sequence is then input into a pre-trained BERT model to obtain word or character embedding vectors containing contextual semantics, capture the dependencies within the sequence, and output the sequence features. ; The suspected sensitive entity value extraction unit is used to extract the values of each type of suspected sensitive entity from the text to be detected using a pre-trained named entity recognition model based on a predefined set of suspected sensitive entity types. The generation unit is used to construct a tree-like hierarchical structure based on the risk level of suspected sensitive entity types. For each type of suspected sensitive entity value, a preset hierarchical traversal algorithm is used to generate the hierarchical index of that type of suspected sensitive entity value in the tree, and an embedding layer is used to generate a hierarchical vector of that type of suspected sensitive entity value. After deduplicating the hierarchical vectors of all types of suspected sensitive entity values in the text to be detected according to the suspected sensitive entity type, average pooling is used to generate a text-level hierarchical embedding feature vector L. agg ; The building unit is used to construct an undirected graph containing nodes and edges by taking various types of suspected sensitive entity values and non-sensitive text units in the text to be detected as nodes and the relationships between nodes as edges. Graph convolution computation units are used to perform sequence feature processing based on a constructed undirected graph. After average pooling, the character embeddings of each node are extracted. The initial features of the nodes are used as the initial features of the graph convolutional network; the features of the nodes and their neighborhoods are aggregated through a multi-layer graph convolutional network, and the sentence-level graph feature vector E is generated through average pooling. sent ; Feature fusion and sensitive risk classification unit, used to integrate sequence features Text-level hierarchical embedding feature vectors L agg and sentence-level graph feature vector E sent The features are concatenated to form a fusion feature; the fusion feature is then passed through a fully connected layer and an activation function to output the probability value that the text to be detected contains sensitive data.
8. An electronic device, characterized in that, The device includes a processor and a memory, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the sensitive data detection method based on hierarchical information enhancement and graph convolutional networks as described in any one of claims 1 to 6.
9. A storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to execute the sensitive data detection method based on hierarchical information enhancement and graph convolutional networks as described in any one of claims 1 to 6 at runtime.
10. A computer program product, comprising a computer program, characterized in that, The computer program is configured to execute the sensitive data detection method based on hierarchical information enhancement and graph convolutional networks as described in any one of claims 1 to 6 at runtime.
Citation Information
Patent Citations
Structured sensitive data identification system and method based on Roberta model
CN120688089A
Method and apparatus for semantic data leak prevention
WO2025087520A1